Viewing file: controlSalida.php (7.02 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
date_default_timezone_set('Europe/Madrid');
include('class.MySqliDB.php');
include('globals.php');
$Debug= 1;
$ConnectionArray= array('Server'=>Server,
'Usser'=>User,
'Pass'=>Pass,
'Db'=>Db);
$ConnMysql= new MysqliDB($ConnectionArray);
$Sql= '';
$Sql= "UPDATE `".Db."`.`controlsalidaR` CR,`".Db."`.`gestionrfid` GR
SET CR.`DORSAL`= GR.`Dorsal`,CR.`CARRERA`= GR.`Carrera` WHERE CR.`RFID`=GR.`IdLlave` AND (CR.`DORSAL` IS NULL OR CR.`CARRERA` IS NULL)";
$ConnMysql->EnviarInsertMv2($Sql);//print_r($ConnMysql);die();
$Sql= '';
$Sql= "SELECT `DORSAL`,`CARRERA` FROM `".Db."`.`controlsalidaR`";
$ConnMysql->EnviarQuery($Sql);
$ConnMysql->ResultadoObjeto();
$ListaDorsales= array();
$FinalizadosCorta= 0;$FinalizadosLarga= 0;
if($ConnMysql->MySqliResult->num_rows != 0)
{
foreach($ConnMysql->ArrayResultado as $FDatos)
{
$ListaDorsales[]= $FDatos->DORSAL;
if($FDatos->CARRERA == 'CORTA'){$FinalizadosCorta++;}
elseif($FDatos->CARRERA == 'LARGA'){$FinalizadosLarga++;}
}
unset($FDatos);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Control de Llegada</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<link rel="shortcut icon" href="favicon.ico">
<script src="./jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$('document').ready(function()
{
$('#nombre').focus();
$('#form1').on('submit', function(e)
{
e.preventDefault();
if($('#nombre').val()=="")
{
alert("Introduce el nombre");
return false;
}
else
{
var nombre = $('#nombre').val();
}
$('#nombre').val('');
$(":input:first").focus();
jQuery.post("procesarSalida.php", {
name:nombre,tipo:'I'
}, function(data, textStatus){
if(data == 0)
{
$( "#res" ).append( "<span class='Red'>Ha ocurrido un error con el RFID: "+nombre+'</span><br>' );
}
else{
$( "#res" ).append( "<span class='Green'>SALIDA DORSAL : "+data+'</span><br>' );
var Area= 'A'+data;
$("#"+Area).css("background-color","red");
}
});
});
});
</script>
<script type="text/javascript">
function Delete(Id)
{
jQuery.post("procesarSalida.php", {
name:Id,tipo:'D'
}, function(data, textStatus){
if(data == 0)
{
$( "#res" ).append( "<span class='Red'>Ha ocurrido un error al borrar el Dorsal: "+Id+'</span><br>' );
}
else{
$( "#res" ).append( "<span class='Green'>BORRADO DORSAL : "+data+'</span><br>' );
var Area= 'A'+data;
$("#"+Area).css("background-color","#FFF");
//window.location.reload();
}
});
}
</script>
<style type="text/css">
.Green {
font-family: "Times New Roman", Times, serif;
font-size: 14px;
font-weight: bold;
color: #0C0;
}
.Red {
font-family: "Times New Roman", Times, serif;
font-size: 14px;
font-weight: bold;
color: #F30;
}
</style>
</head>
<body>
<div id="Logo" style="margin-left:20px;">
<a href="./PuntoControl1.php"><img src="css/cmmClaroS.jpg" width="75" height="75" /></a><span class="Logo"><?php echo VarTitle;?></span>
</div>
<span class="Titulo">Control de Llegada</span>
<table>
<tr>
<td rowspan="2">
<div id="res" style="width:200px; float:left; border:solid; min-height:700px;">
<span class='Blue'>SALIDA CORTA: <?php echo $FinalizadosCorta;?></span><br>
<span class='Blue'>SALIDA LARGA: <?php echo $FinalizadosLarga;?></span><br>
</div>
</td>
<td>
<div id="Contenedor2" class="Contenedor" align="center">
<div id="Formulario">
<form id="form1">
<label class="Texto35 Negrita left40">DORSAL: </label>
<input type="text" id="nombre" align="right" style="width: 80px; padding: 2px; border: 1px solid black" class="Texto35 Negrita" />
<button type="submit" name="Finaliza" class="button-success pure-button">Finaliza</button>
</form>
</div>
</div>
<br />
</td>
</tr>
<tr>
<td>
<div id="Container">
<div id="marcador" style="float:left;">
<div id="CarreraLarga" style="background-color:#C9F;"><span class="Texto20 Blue Negrita">Carrera Larga</span></div>
<?php
for($i = 001; $i <= 340; $i++)
{
unset($StyleBG);
if(in_array($i,$ListaDorsales))$StyleBG= 'Red';else $StyleBG= '#FFF';
?> <div id="A<?php echo $i;?>" class="Texto20 Negrita" align="center" style="background-color:<?php echo $StyleBG;?>; width:40px; height:20px; float:left; border:solid;" onClick="Delete('<?php echo $i;?>')">
<?php echo $i;?>
</div> <?php
if($i == 25 or $i == 50 or $i == 75 or $i == 100 or $i == 125 or $i == 150 or $i == 175 or $i == 200 or $i == 225 or $i == 250 or $i == 275 or $i == 300 or $i == 325 or $i == 365 or $i == 390 or $i == 415 or $i == 440 or $i == 465 or $i == 490 or $i == 500)echo '<div style="clear: both"></div>';
if($i == 501)$i= 800;
} ?>
<br />
<div style="clear: both"></div>
<div id="CarreraCorta" style="background-color:#FC0;"><span class="Texto20 Blue Negrita">Carrera Corta</span></div>
<?php for($i = 341; $i <= 500; $i++)
{
unset($StyleBG);
if(in_array($i,$ListaDorsales))$StyleBG= 'Red';else $StyleBG= '#FFF';
?> <div id="A<?php echo $i;?>" class="Texto20 Negrita" align="center" style="background-color:<?php echo $StyleBG;?>; width:40px; height:20px; float:left; border:solid;" onClick="Delete('<?php echo $i;?>')">
<?php echo $i;?>
</div> <?php
if($i == 25 or $i == 50 or $i == 75 or $i == 100 or $i == 125 or $i == 150 or $i == 175 or $i == 200 or $i == 225 or $i == 250 or $i == 275 or $i == 300 or $i == 325 or $i == 365 or $i == 390 or $i == 415 or $i == 440 or $i == 465 or $i == 490 or $i == 500)echo '<div style="clear: both"></div>';
if($i == 501)$i= 800;
}
?>
</div>
</div>
</td>
</tr>
</table>
<br />
<div style="clear: both"></div>
</body>
|