Está en la página 1de 6

<!

DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ingrese Datos </title>
</head>
<body>
<center>
<h2>Factura:</h2>
<form action="fecturareporte.php" method="POST">
<p>Ingrese numero de factura<input type="text" name="numero"></p>
<p>Ingrese fecha inicial<input type="text" name="fechain"></p>
<p>Ingrese fecha final<input type="text" name="fechafin"></p>
<p>Ingrese cliente<input type="text" name="cliente"></p>
<p>Ingrese nit<input type="text" name="nit"></p>
<p>Ingrese monto inicial<input type="text" name="montoin"></p>
<p>Ingrese monto final<input type="text" name="montofin"></p>
<input type="submit" name="reporte" id="Reporte" value= "Reporte" onClick="this.form.action =
'facturareporte.php'"><br>
<input type="submit" name="Ingresar" id="Insertar" value= "Ingresar Datos"
onClick="this.form.action ='ingresar.php'">
<input type="submit" name="Modificar" id="Modificar" value= "Modificar Datos"
onClick="this.form.action ='modificar.php'">
<input type="submit" name="Eliminar" id="Eliminar" value= "Eliminar Datos"
onClick="this.form.action = 'eliminar9.php'">
<input type="submit" name="Consultar" id="Consultar" value= "Consultar Datos"
onClick="this.form.action = 'consultar.php'"> </form>
</center>
</body>
</html>
<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$numero=$_POST["numero"];
$fechain=$_POST["fechain"];
$fechafin=$_POST["fechafin"];
$cliente=$_POST["cliente"];
$nit=$_POST["nit"];
$montoin=$_POST["montoin"];
$montofin=$_POST["montofin"];
$sql ="select * from factura";
if ($fechain<>"")
$sql =$sql." where fecha>='$fechain'";
else
$sql =$sql." where FechaAnac<>'1/1/1'";

if ($fechafin<>"")
$sql =$sql." and FechaAnac<='$fechafin'";

if ($cliente<>"")
$sql =$sql." and cliente like'%$cliente%'";

if ($nit<>"")
$sql =$sql." and nit like'%$nit%'";

if ($montoin<>"")
$sql =$sql." and monto>= $montoin";

if ($montofin<>"")
$sql =$sql." and monto<= $montofin";

if ($numero<>"")
$sql =$sql." and numero like '$numero'";
$resultado = mysqli_query($conexion,$sql);
while ($Consulta=mysqli_fetch_array($resultado)){
echo "numero: " . $Consulta['numero']; echo "<br>";
echo "FechaAnac: " . $Consulta['FechaAnac']; echo "<br>";
echo "cliente: " . $Consulta['cliente']; echo "<br>";
echo "nit: " . $Consulta['nit']; echo "<br>";
echo "monto: " . $Consulta['monto']; echo "<br><br>";
}
echo "<br><br><a href='Facturas.html'> Regresar al men&uacute;</a>";
?>
<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$Numero = $_POST["numero"];
$Fechainicial = $_POST["Fechainicial"];
$Fechafinal = $_POST["Fechafinal"];
$Cliente = $_POST["cliente"];
$Nit = $_POST["nit"];
$Montoinicial = $_POST["Montoinicial"];
$Montofinal = $_POST["Montofinal"];

$sql = "select * from factura";


if ($Fechainicial<>"")
$sql = $sql . " where fecha>='$Fechainicial'";
else
$sql = $sql . " where fecha<>'1/1/1'";

if ($numero<>"")
$sql = $sql . " and numero='$numero'";

if ($Fechafinal<>"")
$sql = $sql . " and fecha<='$Fechafinal'";

if ($cliente<>"")
$sql = $sql . " and cliente like '%$cliente%'";

if ($nit<>"")
$sql = $sql . " and nit like '%$nit%'";

if ($Montoinicial<>"")
$sql = $sql . " and monto>=$Montoinicial";

if ($Montofinal<>"")
$sql = $sql . " and monto<=$Montofinal";

$resultado = mysqli_query($conexion,$sql);
echo " <h3 color='red' align='center'>Tabla de Consulta <br></h3>";
echo "<table align='center' border='5'>";
echo "<tr><td align='center'><strong>numero</strong></td><td align='center'><strong>fecha</strong></td><td
align='center'><strong>cliente</strong></td></td><td align='center'><strong>nit</strong></td></td><td
align='center'><strong>monto</strong></td></tr>";
while ($Consulta= mysqli_fetch_array($resultado)){
echo "<tr><td>" . $Consulta['numero']; echo "</td>";
echo "<td>" . $Consulta['fecha']; echo "</td>";
echo "<td>" . $Consulta['cliente']; echo "</td>";
echo "<td>" . $Consulta['nit']; echo "</td>";
echo "<td>" . $Consulta['monto']; echo "</td></tr>";
}
echo "</table>";
echo "<br><br><a href='factura.php'> Regresar a menu</a>";
?>
<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$numero=$_POST["numero"];
$fechain=$_POST["fechain"];
$fechafin=$_POST["fechafin"];
$cliente=$_POST["cliente"];
$nit=$_POST["nit"];
$montoin=$_POST["montoin"];
$sql="insert into factura values('$numero', '$fechain', '$cliente', '$nit', '$montoin')";
$res=mysqli_query($conexion, $sql);
if ($res>0)
echo "Datos ingresados";
else
echo "Datos no ingresados <br><br>";
echo "<br><a href='factura.html'> Regresar al menu</a>";
?>

<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$numero=$_POST["numero"];
$fechain=$_POST["fechain"];
$fechafin=$_POST["fechafin"];
$cliente=$_POST["cliente"];
$nit=$_POST["nit"];
$montoin=$_POST["montoin"];
$montofin=$_POST["montofin"];
$sql="update factura set monto='$montoin', FechaAnac='$fechain', cliente='$cliente', nit='$nit' where
numero='$numero'";
$res=mysqli_query($conexion, $sql);
if ($res>0)
echo "Datos Modificados";
else
echo "Datos no Modificados <br><br>";
echo "<br><a href='factura.html'> Regresar al men&uacute</a>";
?>

<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$numero=$_POST["numero"];
$sql="delete from factura where numero='$numero'";
$res=mysqli_query($conexion, $sql);
if ($res>0)
echo "Datos eliminados";
else
echo "Datos no eliminados <br><br>";
echo "<br><a href='factura.html'> Regresar al men&uacute</a>";
?>
<?php
$conexion= mysqli_connect('localhost','root','','sexto');
$numero= $_POST["numero"];
if ($numero=="")
$sql = "select * from factura";
else
$sql = "select * from factura where numero= '$numero'";
$resultado = mysqli_query($conexion,$sql);
echo "<table align='center' border='5'>";
echo "<tr><td align='center'><b>Numero</b></td><td align='center'><b>Fecha</b></td><td
align='center'><strong>Cliente</strong></td><td align='center'><b>NIT</b></td><td
align='center'><b>Monto</b></td></tr>";
while ($Consulta= mysqli_fetch_array($resultado)){
echo "<tr><td>" . $Consulta['numero']; echo "</td>";
echo "<td>" . $Consulta['FechaAnac']; echo "</td>";
echo "<td>" . $Consulta['cliente']; echo "</td>";
echo "<td>" . $Consulta['nit']; echo "</td>";
echo "<td>" . $Consulta['monto']; echo "</td></tr>";
}
echo "</table>";
echo "<center><br><br><a href='factura.html'> Regresar</a>";

?>

ESTADISTICOS MONTO,PRECIO, COSTO, EXISTENCA

<?php
$conexion= mysqli_connect('localhost','root','','bdd5to2021');
$sql = "select sum(Monto) as Total, max(Monto) as Maximo, min(Monto) as Minimo, avg(Monto) as
Promedio, count(Monto) as Contar from venta8";
$resultado = mysqli_query($conexion, $sql);
$datos = mysqli_fetch_array($resultado);
$Total = $datos ["Total"];
$Maximo = $datos ["Maximo"];
$Minimo = $datos ["Minimo"];
$Promedio = $datos ["Promedio"];
$Contar = $datos ["Contar"];
echo ("El total es:$Total <br> EL Maximo es:$Maximo <br> El Minimo es: $Minimo <br> El promedio es:
$Promedio <br> El Conteo de registros es: $Contar");
echo "<br><br><a href='venta.html'> Regresar al men&uacute</a>";
?>

<?php
$conexion= mysqli_connect('localhost','root','','bdd5to2021');
$sql = "select sum(Existencia) as Total, max(Existencia) as Maximo, min(Existencia) as Minimo,
avg(Existencia) as Promedio, count(Existencia) as Contar from articulo2";
$resultado = mysqli_query($conexion, $sql);
$datos = mysqli_fetch_array($resultado);
$Total = $datos ["Total"];
$Maximo = $datos ["Maximo"];
$Minimo = $datos ["Minimo"];
$Promedio = $datos ["Promedio"];
$Contar = $datos ["Contar"];
echo ("El total es:$Total <br> EL Maximo es:$Maximo <br> El Minimo es: $Minimo <br> El promedio es:
$Promedio <br> El Conteo de registros es: $Contar");
echo "<br><br><a href='articulo.html'> Regresar al men&uacute</a>";
?>
<?php
$conexion= mysqli_connect('localhost','root','','bdd5to2021');
$sql = "select sum(Precio) as Total, max(Precio) as Maximo, min(Precio) as Minimo, avg(Precio) as
Promedio, count(Precio) as Contar from articulo2";
$resultado = mysqli_query($conexion, $sql);
$datos = mysqli_fetch_array($resultado);
$Total = $datos ["Total"];
$Maximo = $datos ["Maximo"];
$Minimo = $datos ["Minimo"];
$Promedio = $datos ["Promedio"];
$Contar = $datos ["Contar"];
echo ("El total es:$Total <br> EL Maximo es:$Maximo <br> El Minimo es: $Minimo <br> El promedio es:
$Promedio <br> El Conteo de registros es: $Contar");
echo "<br><br><a href='articulo.html'> Regresar al men&uacute</a>";
?>

<?php
$conexion= mysqli_connect('localhost','root','','bdd5to2021');
$sql = "select sum(Costo) as Total, max(Costo) as Maximo, min(Costo) as Minimo, avg(Costo) as Promedio,
count(Costo) as Contar from articulo2";
$resultado = mysqli_query($conexion, $sql);
$datos = mysqli_fetch_array($resultado);
$Total = $datos ["Total"];
$Maximo = $datos ["Maximo"];
$Minimo = $datos ["Minimo"];
$Promedio = $datos ["Promedio"];
$Contar = $datos ["Contar"];
echo ("El total es:$Total <br> EL Maximo es:$Maximo <br> El Minimo es: $Minimo <br> El promedio es:
$Promedio <br> El Conteo de registros es: $Contar");
echo "<br><br><a href='articulo.html'> Regresar al men&uacute</a>";
?>

<input type="submit" name="Estadístico" id="Estadístico" value= "Estadísticos" onClick="this.form.action =


'estadisticos.php'">

También podría gustarte