****<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="../css3/bootstrap.min.css">
</head>
<body>
<center><h3>LISTADO DE MATERIALES DEL ENCARGADO</h3></center>
<div class="E1" id="general">
<table class="table table-bordered table-hover" id="tabla">
<tr class="success">
<th></th>
<th></th>
<th></th>
<th>Encardado : <?php echo $_SESSION['nombre'];?></th>
<th><a href="cerrarSeccion.php">Cerrar Seccion</a></th>
</tr>
</table>
</div>
<section class="col-md-10 col-md-offset-1"><br><br>
<a href="ingresoMaterial.php" class="btn btn-primary">Ingrese Un Material</a>
<a href="../pdf/pdfReporte.php" class="btn btn-primary">Imprimir PDF</a>
<div class="E1" id="general">
<table class="table table-bordered table-hover" id="tabla">
<tr class="success">
<th>Materiales</th>
<th>Descripcion</th>
<th>Cantidad</th>
<th>Precio</th>
<th>Costo Total por Unidad</th>
<th>Operacion</th>
<th></th>
</tr>
<?php
include('../configuracion/conexion.php');
$conexion = conectarse();
$conector = " SELECT nombre, descripcion, cantidad, precio, cantidad*precio FROM materiales";
$id= $_SESSION['id'];
$resultado = mysqli_query($conexion,$conector);
$contador = 0;
while ($row = $resultado->fetch_array(MYSQLI_NUM)){
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "<td>$row[2]</td>";
echo "<td>$row[3]</td>";
echo "<td>$row[4]</td>";
$contador = $contador + $row[4];
// ESTOS SON LOS BOTONES PERO NO SE SI SE USA ASI
echo "<td>
<form method='POST' action='logicaEliminar.php'>
<button type='submit' name='$row[0]'>Eliminar</button>
</form>
</td>";
echo "<td>
<form method='POST' action='logicaCrudM.php'>
<button type='submit' name='$row[0]'>Modificar</button>
</form>
</td>";
echo "</tr>";
}
$conector2 = "UPDATE usuarios SET presupuesto='$contador' WHERE id='$id' ";
$resultado2 = mysqli_query($conexion,$conector2);
?>
</table>
<div class="E1" id="general">
<table class="table table-bordered table-hover" id="tabla">
<tr class="success">
<th>Presupuesto : <?php echo $contador;?> Bolivares</th>
</tr>
</table>
</div>
</body>
</html>****