示例#1
0
    header("location:/index.html");
}
foreach ($_POST as $key => $value) {
    $_POST[$key] = $database->filter($value);
}
foreach ($_GET as $key => $value) {
    $_GET[$key] = $database->filter($value);
}
$data = isset($_GET['data']) ? $_GET['data'] : "";
$op = isset($_GET['op']) ? $_GET['op'] : "";
$bulk = isset($_GET['bulk']) ? $_GET['bulk'] : "";
$func = isset($_GET['func']) ? $_GET['func'] : "";
$cuid = isset($_GET['cuid']) ? $_GET['cuid'] : "";
$cupon = isset($_GET['cupon']) ? $_GET['cupon'] : "";
$fecha_ini = isset($_GET['fecha_ini']) ? fechaustomysql($_GET['fecha_ini']) : "";
$fecha_fin = isset($_GET['fecha_fin']) ? fechaustomysql($_GET['fecha_fin']) : "";
$cantidad = isset($_GET['cantidad']) ? $_GET['cantidad'] : "";
$cuantos = isset($_GET['cuantos']) ? $_GET['cuantos'] : "";
$cupontipo_id = isset($_GET['cupontipo_id']) ? $_GET['cupontipo_id'] : "";
$compra_minima = isset($_GET['compra_minima']) ? $_GET['compra_minima'] : "";
$location = isset($_GET['location']) ? $_GET['location'] : "";
if ($func == "c") {
    $cliente = array('cantidad' => $cantidad, 'cupontipo_id' => $cupontipo_id, 'compra_minima' => $compra_minima);
    if ($cantidad) {
        $add_query = $database->insert('cupon', $cliente);
        $last_id = $database->lastid();
        $location = "Location: /index.php?data=cupones&cuid={$last_id}&eed=1";
    } else {
        $location = "Location: /index.php?data=cupones&eed=2";
    }
}
<?php 
$query = "SELECT sum(cantidad) as total from movimiento\n where fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59' AND (movimiento.tipomov_id=1 OR movimiento.tipomov_id=13 or movimiento.tipomov_id=14)";
list($total) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento\n\twhere movimiento.tipomov_id=2 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($devoluciones) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento\n\twhere movimiento.tipomov_id=14 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($ventas_contado) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento\n\twhere movimiento.tipomov_id=3 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($ventas_credito) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento\n\twhere movimiento.tipomov_id=1 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($abonos) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento\n\twhere movimiento.tipomov_id=13 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($enganche) = $database->get_row($query);
$query = "SELECT sum(total) as total from pedido\n\twhere fecha_orden>='" . fechaustomysql($fecha_inicio) . "' AND fecha_orden<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($pedidos_andrea) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from pedido_movimiento\n\twhere pedido_movimiento.tipomov_id=14 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'";
list($anticipos_andrea) = $database->get_row($query);
?>

	<div class="row-fluid condensed">
				<div class="box span3 hidden-print">
					<div class="box-header">
						<h2><i class="halflings-icon align-justify"></i><span class="break"></span>Corte de Caja</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="halflings-icon wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="halflings-icon chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="halflings-icon remove"></i></a>
						</div>
                    </div>
					<div class="box-content">
<?php 
echo $fecha_inicio = isset($_GET['fi']) ? fechaustomysql($_GET['fi']) : date("Y-m-d");
$fecha_final = isset($_GET['ff']) ? fechaustomysql($_GET['ff']) : date("Y-m-d");
?>
      <br><bR>







	<div class="row-fluid condensed">
				<div class="box span4 hidden-print">
					<div class="box-header">
						<h2><i class="halflings-icon align-justify"></i><span class="break"></span>Corte de Caja</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="halflings-icon wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="halflings-icon chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="halflings-icon remove"></i></a>
						</div>
                    </div>
					<div class="box-content">

    			    <form class="form-vertical" action="?data=estadisticas&op=ventas">
	    			    <fieldset>
								<input type="hidden" name="data" value="estadisticas" >
								<input type="hidden" name="op" value="ventas">

示例#4
0
    $codigo_cliente .= date("mdHis");
    //The fields and values to insert
    $cliente = array('codigo_cliente' => $codigo_cliente, 'activo' => $_GET['activo'], 'curp' => $_GET['curp'], 'nombre' => $_GET['nombre'], 'apellidop' => $_GET['apellidop'], 'apellidom' => $_GET['apellidom'], 'fechanac' => $_GET['fechanac'], 'sexo_id' => $_GET['sexo_id'], 'telefono_personal' => $_GET['telefono_personal'], 'email' => $_GET['email'], 'domicilio_casa' => $_GET['domicilio_casa'], 'colonia_casa_id' => $_GET['colonia_casa_id'], 'telefono_casa' => $_GET['telefono_casa'], 'antiguedad_empleo' => $_GET['antiguedad_empleo'], 'observaciones' => $_GET['observaciones'], 'observaciones' => $_GET['tipocredito_id'], 'credito' => 3000, 'total_ultimo' => $_GET['total_ultimo'], 'fecha_total_inicio' => fechaustomysql($_GET['fecha_total_inicio']), 'fecha_total_ultimo' => fechaustomysql($_GET['fecha_total_ultimo']), 'saldo' => $_GET['saldo'], 'abono' => $_GET['abono'], 'empresa_id' => $_GET['empresa_id']);
    if ($_GET['nombre'] && $_GET['curp']) {
        $add_query = $database->insert('cliente', $cliente);
        echo $last_id = $database->lastid();
        $location = "Location: /index.php?data={$data}&op=detalles&cid={$last_id}&eed=2";
    } else {
        $location = "Location: /index.php?data={$data}&op=cliente_form&func=agregar&eed=3";
    }
}
if ($func === "u") {
    // echo "<br><br>";          // ********DEBUG**********
    // foreach ($_GET as $k => $v) { echo "<br>[$k] => $v \n";}
    //echo fechatomysql($_GET['fecha_total_ultimo']);
    $update = array('activo' => $_GET['activo'], 'curp' => $_GET['curp'], 'nombre' => strtoupper($_GET['nombre']), 'apellidop' => strtoupper($_GET['apellidop']), 'apellidom' => strtoupper($_GET['apellidom']), 'fechanac' => $_GET['fechanac'], 'sexo_id' => $_GET['sexo_id'], 'telefono_personal' => $_GET['telefono_personal'], 'email' => $_GET['email'], 'domicilio_casa' => strtoupper($_GET['domicilio_casa']), 'colonia_casa_id' => $_GET['colonia_id'], 'telefono_casa' => $_GET['telefono_casa'], 'antiguedad_empleo' => $_GET['antiguedad_empleo'], 'observaciones' => $_GET['observaciones'], 'tipocredito_id' => $_GET['tipocredito_id'], 'credito' => $_GET['credito'], 'total_ultimo' => $_GET['total_ultimo'], 'fecha_total_inicio' => fechaustomysql($_GET['fecha_total_inicio']), 'fecha_total_ultimo' => fechaustomysql($_GET['fecha_total_ultimo']), 'saldo' => $_GET['saldo'], 'abono' => $_GET['abono'], 'empresa_id' => $_GET['empresa_id'], 'gruponomina_id' => $_GET['gruponomina_id']);
    //Add the WHERE clauses
    $where_clause = array('cliente_id' => $_GET['cid']);
    if ($_GET['cid'] > 0) {
        $updated = $database->update('cliente', $update, $where_clause, 1);
    }
    // //Output errors if they exist for the update query
    //$database->display( $updated );
    if ($_GET['cid'] > 0) {
        $location = "Location: /index.php?data={$data}&op=detalles&cid={$cid}&eed=1";
    } else {
        $location = "Location: /index.php?data=clientes&op=cliente_form&func=agregar&eed=3";
    }
}
if ($location) {
    header($location);
					 <div class="form-actions">
								<button type="submit" class="btn btn-primary">Generar</button>
							  </div>
							</fieldset>
			</form>



<br><br>

<?php 
$admin_id = $_SESSION['user_id'];
$query = "SELECT sum(cantidad) as total from movimiento \n where  fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'\n \t AND (movimiento.tipomov_id=1 OR movimiento.tipomov_id=13 or movimiento.tipomov_id=14) and movimiento.admin_id=" . $_SESSION['user_id'];
list($total) = $database->get_row($query);
$query = "SELECT sum(cantidad) as total from movimiento \n\twhere movimiento.tipomov_id=2 AND fecha>='" . fechaustomysql($fecha_inicio) . "' AND fecha<='" . fechaustomysql($fecha_final) . " 23:59:59'  and admin_id=" . $_SESSION['user_id'];
list($devoluciones) = $database->get_row($query);
?>

						<table class="table table-condensed">
							  <thead>
								  <tr>
									  <th>Total</th>


								  </tr>
							  </thead>
							  <tbody>
                                <tr><td style="text-align:right"><h1><?php 
echo dinero($total - $devoluciones);
?>