detalles en totales empezando alta de material
This commit is contained in:
@@ -3,8 +3,18 @@ session_start();
|
||||
require "../../conexion.php";
|
||||
$impresoras = [];
|
||||
$info = [];
|
||||
$inv=[];
|
||||
$imp1 =0;
|
||||
$imp2 =0;
|
||||
$i=0;
|
||||
$n=0;
|
||||
$c=0;
|
||||
$m=0;
|
||||
$a=0;
|
||||
$cant=0;
|
||||
$salida = "";
|
||||
$x=0;
|
||||
|
||||
$query = "SELECT impresora from cat_impresora";
|
||||
$resultado = $conexion->query($query);
|
||||
|
||||
@@ -17,15 +27,15 @@ if($resultado->rowCount() > 0){
|
||||
<td style=\"text-align:center;\">Existencia</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>";
|
||||
<tbody>";
|
||||
|
||||
|
||||
while($row = $resultado->fetch(PDO::FETCH_ASSOC)){
|
||||
$impresoras[$i] =$row;
|
||||
$i++;
|
||||
}
|
||||
$j=0;
|
||||
//print_r($impresoras[0]['impresora']);
|
||||
|
||||
|
||||
foreach ($impresoras as $impresora) {
|
||||
$salida.="<tr>
|
||||
<td style=\"text-align:center;\">".$impresora['impresora']."</td>";
|
||||
@@ -36,35 +46,111 @@ if($resultado->rowCount() > 0){
|
||||
$query = "CALL st_totales('$busq');";
|
||||
$resultado = $conexion->query($query);
|
||||
while($fila = $resultado->fetch(PDO::FETCH_ASSOC)){
|
||||
$info[$i] =$fila;
|
||||
$info[$i]=$fila;
|
||||
|
||||
if($i == 0){
|
||||
if($info[$i]['impresora'] == 'HP Laserjet P3015' or $info[$i]['impresora'] == 'HP Color Laserjet CP1515N' or $info[$i]['impresora'] == 'HP Laserjet 1320') {
|
||||
if ($info[$i]['impresora'] == 'HP Laserjet P3015') {
|
||||
$imp1 += $info[$i]['existencia'];
|
||||
} if ($info[$i]['impresora'] == 'HP Laserjet P3015' and $i>1) {
|
||||
$salida .= "
|
||||
|
||||
<td style=\"text-align:center;\">Negro</td>
|
||||
<td style=\"text-align:center;\">" . $imp1 . "</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$salida.="
|
||||
<td style=\"text-align:center;\">".$info[$i]['color']."</td>
|
||||
<td style=\"text-align:center;\">".$info[$i]['existencia']."</td>
|
||||
<tr>";
|
||||
}else{
|
||||
$salida.="
|
||||
|
||||
if ($info[$i]['impresora'] == 'HP Color Laserjet CP1515N') {
|
||||
if ($info[$i]['color'] == 'Negro') {
|
||||
$n += $info[$i]['existencia'];
|
||||
}
|
||||
if ($info[$i]['color'] == 'Cyan') {
|
||||
$c += $info[$i]['existencia'];
|
||||
}
|
||||
if ($info[$i]['color'] == 'Magenta') {
|
||||
$m += $info[$i]['existencia'];
|
||||
}
|
||||
if ($info[$i]['color'] == 'Amarillo') {
|
||||
$a += $info[$i]['existencia'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($x== 1 and $impresora['impresora'] == 'HP Color Laserjet CP1515N') {
|
||||
$salida .= "
|
||||
<td style=\"text-align:center;\"><br></td>
|
||||
<td style=\"text-align:center;\">Negro</td>
|
||||
<td style=\"text-align:center;\">" . $n . "</td></tr>
|
||||
";
|
||||
$salida .= "
|
||||
<tr>
|
||||
<td style=\"text-align:center;\"><br></td>
|
||||
<td style=\"text-align:center;\">Cyan</td>
|
||||
<td style=\"text-align:center;\">" . $c . "</td></tr>
|
||||
";
|
||||
$salida .= "
|
||||
<tr>
|
||||
<td style=\"text-align:center;\"><br></td>
|
||||
<td style=\"text-align:center;\">Magenta</td>
|
||||
<td style=\"text-align:center;\">" . $a . "</td></tr>
|
||||
";
|
||||
$salida .= "
|
||||
<tr>
|
||||
<td style=\"text-align:center;\"><br></td>
|
||||
<td style=\"text-align:center;\">Amarillo</td>
|
||||
<td style=\"text-align:center;\">" . $a . "</td>
|
||||
</tr>
|
||||
";
|
||||
$x++;
|
||||
}
|
||||
|
||||
|
||||
if ($info[$i]['impresora'] == 'HP Laserjet 1320') {
|
||||
$imp2 += $info[$i]['existencia'];
|
||||
}
|
||||
if ($i >1 and $info[$i]['impresora'] == 'HP Laserjet 1320') {
|
||||
$salida .= "
|
||||
|
||||
<td style=\"text-align:center;\">Negro</td>
|
||||
<td style=\"text-align:center;\">" . $imp2 . "</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
}else{
|
||||
if($info[$i]['color']== 'Negro' or $info[$i]['color']== 'Negro mate'){
|
||||
$salida.="
|
||||
|
||||
<td style=\"text-align:center;\">".$info[$i]['color']."</td>
|
||||
<td style=\"text-align:center;\">".$info[$i]['existencia']."</td>
|
||||
<tr>";
|
||||
}
|
||||
</tr>";
|
||||
}else{
|
||||
$salida.="
|
||||
<td style=\"text-align:center;\"><br></td>
|
||||
<td style=\"text-align:center;\">".$info[$i]['color']."</td>
|
||||
<td style=\"text-align:center;\">".$info[$i]['existencia']."</td>
|
||||
</tr>";
|
||||
}}
|
||||
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
//print_r($info);
|
||||
|
||||
//print_r($info);
|
||||
$j++;
|
||||
|
||||
}
|
||||
|
||||
$salida.="</tbody></table>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$cant=0;
|
||||
//print_r($info);
|
||||
|
||||
//print_r($inv);
|
||||
$salida.="</tbody></table>";
|
||||
|
||||
|
||||
//echo'<br><br>';echo'<br><br>';echo'<br><br>';echo'<br><br>';echo'<br><br>';
|
||||
//print_r($info[0])
|
||||
echo $salida;
|
||||
echo $n. ' .';
|
||||
echo $c. ' .';
|
||||
echo $m. ' .';
|
||||
echo $a. ' .';
|
||||
$conexion = null;
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user