v=cYiqKW2FaUs
https://www.youtube.com/watch?v=AZpKqEQS4e4
https://www.youtube.com/watch?v=lZt6yAyVJCc
https://www.youtube.com/watch?v=9glSpdwygdk
https://es.wikihow.com/crear-una-base-de-datos-en-MySQL
https://www.youtube.com/watch?v=slJ4YthWAeU
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Cliver</title>
<link rel="shortcut icon" href=""/>
<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
body{
background-image: url("");
}
</style>
</head>
<style type="text/css">
</style></head>
<body>
<header>
<center>
<h2><font color="black">ADMINISTRADOR DE PRODUCTOS </font></h2>
<fieldset style="width:810px; margin-top: 20px;top:2px;box-
shadow:0 0 100px 50 px yellow; box-shadow:0 0 300px blue; ALIGN="justify ">
<body>
<FIELDSET>
<LEGEND>************************************</LEGEND>
<div class="row">
<form action ="<?php
$_SERVER['PHP_SELF'];?>" method="POST">
<b>Buscar producto:
</b><input type="text" id="campo" size="60" name="campo" placeholder="Buscar
producto..."/>
<input type ="submit"
id="enviar" name="enviar" value="Buscar" class="btn btn-info"/>
<a data-toggle="modal"
class="btn btn-primary" data-target="#nuevo_producto">Agregar producto</a>
</form>
</div>
</FIELDSET>
</from>
</body>
</fieldset>
<?php
$mysqli= new mysqli("localhost","root","1234","sis_ventas");
if($mysqli->connect_error){
echo "Fallo al conectar a MySQL:(".$mysqli-connect_error.")".$mysqli-
>connect_error;
exit();
}
$consulta="SELECT *FROM producto";
if($resultado=$mysqli->query($consulta))
{
while ($fila=$resultado->fetch_row()) {
# code...
echo"<tr>";
echo
"<td>$fila[0]</td><td>$fila[1]</td><td>$fila[2]</td><td>$fila[3]</td>";
echo"<td>";
echo "<a data-toggle='modal' data-target='#editproducto' data-
id='".$fila[0]."' data-nom_prod='".$fila[1]."' data-precio='".$fila[2]."' data-
fecha='".$fila[3]."'class='btn btn-warning'><span class='glyphicon glyphicon-
pencil'></span>Editar</a>";
echo"<a class='btn btn-danger' href='elimina.php?id=".
$fila[0]."'><span class='glyphicon glyphicon-remove'></span>Eliminar</a>";
echo "</td>";
echo"</tr>";
}
$resultado->close();
}
$mysqli->close();
?>
</table>
</div>
<div class="modal" id="nuevo_producto" tabindex="-1" role="dialog" aria-
labellebdy="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<CENTER><h4>NUEVO REGISTRO DE PRODUCTOS</h4></CENTER>
</div>
<div class="modal-body">
<form action="insertar.php" method="GET">
</div>
<script src="js.jquery.min.js"></script>
<script src="js,bootstrap.min.js"></script>
<script>
$('#editproducto').on('show.bs.modal',function(event){
var button = $(event.relatedTarget)
var recipient0=button.data('Id')
var recipient1=button.data('Nom_Prod')
var recipient2=button.data('Precio')
var recipient3=button.data('Fecha')
var modal = $(this)
modal.find('.modal-body #Id').val(recipient0)
modal.find('.modal-body #Nom_Prod').val(recipient1)
modal.find('.modal-body #Precio').val(recipient2)
modal.find('.modal-body #Fecha').val(recipient3)
});
</script>
</body>
</fieldset>
</center>
</html>