示例#1
0
/**
 * 
 * @todo Funcion que genera una funcion en javascript para buscar autos con sus diarios
 * @author Jean Carlos Nuñez
 * @return string
 *  
 */
function buscar_auto_diarios()
{
    global $conn;
    $var_hora = date("H:i:s");
    $rs = phpmkr_query("select * from operaciones_generales ", $conn) or die("Fallo al ejecutar la consulta en la linea" . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql);
    while ($row_rs = $rs->fetch_assoc()) {
        $var_hora_termino_dia = $row_rs['hora_termino_dia'];
    }
    $var_cantidad_horas = RestarHoras($var_hora, $var_hora_termino_dia);
    $rs = mysqli_query($conn, "select a.monto_diario,a.num_und from autos a where a.num_ope = 0");
    echo "<script>\n";
    echo "function buscar_auto_diarios()\n";
    echo "{\n";
    echo "var doc = document.form1; \n";
    echo "var horas_calcular =" . $var_cantidad_horas . ";\n";
    echo "var var_num_auto = doc.num_und.value; \n";
    while ($row_rs = mysqli_fetch_array($rs)) {
        $var_num_und = $row_rs['num_und'];
        $var_monto_diario_por_hora = number_format($row_rs['monto_diario'] / 24, 2);
        echo "\tif(var_num_auto=='" . $var_num_und . "')\n";
        echo "\t{ \n";
        echo "      var var_monto_cobrar = parseInt(horas_calcular) * parseFloat(" . $var_monto_diario_por_hora . ")\n";
        echo "\t\tdoc.diario.value=var_monto_cobrar;";
        echo "\t}\n";
    }
    echo "\n\t}\n\t</script>\t\n\t\n";
}
            while ($inf = $conexion->getFetchArray()) {
                $cod = $inf["tiempo_preparacion"];
                if ($rs_inf['tiempo_preparacion'] > $cod) {
                    $s = 1;
                }
            }
            if ($s == 1) {
                $ver_estado = RestarHoras($tiempo_prep, $tiempo);
            } else {
                $ver_estado = "NO";
            }
        } else {
            $ver_estado = "NO";
        }
    } else {
        $tiempo = RestarHoras($rs_inf['hora_alta'], $rs_inf['hora_entrega']);
        $ver_estado = "NO";
    }
    //if($tiempo>$tiempo_prep) $ver_estado = RestarHoras($tiempo_prep,$tiempo); else $ver_estado = "NO";
    ?>
                
                    <?php 
    if ($rs_inf['id'] != $id_ant) {
        ?>
                        <tr  id="tr_<?php 
        echo $rs_inf['id'];
        ?>
" style="background-color: #6FA7D1;text-align: left">
                        <td><?php 
        echo $rs_inf['fecha_alta_'];
        ?>
示例#3
0
            <td style="width: 20px">Hora Cocina</td>
            <td style="width: 20px">Hora Entrega</td>                    
            <td>Tiempo excedido</td>                                    
        </tr>
    <?php 
$id_ant = 0;
$total = 0;
while ($rs_inf = $paging->fetchResultado()) {
    if ($rs_inf['pasa_cocina'] == 1) {
        $tiempo = RestarHoras($rs_inf['hora_cocina'], $rs_inf['hora_entrega']);
    } else {
        $tiempo = RestarHoras($rs_inf['hora_alta'], $rs_inf['hora_entrega']);
    }
    $tiempo_prep = date("H:i:s", mktime(00, $rs_inf['demora_preparacion'], 00));
    if ($tiempo > $tiempo_prep) {
        $ver_estado = RestarHoras($tiempo_prep, $tiempo);
    } else {
        $ver_estado = "NO";
    }
    ?>
                
                    
                    <tr  id="tr_<?php 
    echo $rs_inf['id'];
    ?>
" >
                            <td><?php 
    echo $rs_inf['fecha_alta_'];
    ?>
</td>
                            <td style="text-align: right" ><?php