MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/aevaluacion/ingresar_evaluacion_directores_camaras.php
<?php
global $dbi;
require_once("../Conectarse.php");

$control = mysql_query('SELECT nombre_completo FROM Usuarios WHERE cedula = "'.$_GET["ced2"]. '" and codigo = "'.$_GET["codigo"].'" ');
if (!$control) {
	die('Invalid query 1: ' . mysql_error());
}
list($apenom) = mysql_fetch_row($control);

   
?>


<!DOCTYPE HTML>
<html>
<head>
<title>Evaluacion Monitoreo Camaras</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width, user-scalable=yes">

<link rel="stylesheet" href="css/estilos.css">

<script languaje="JavaScript">
function Mostrar_Fecha()
{
         var mydate=new Date()
         var year=mydate.getYear()
         if (year < 1000)
                 year+=1900
                 var day=mydate.getDay()
                 var month=mydate.getMonth()
                 var daym=mydate.getDate()
                 if (daym<10)
                    daym="0"+daym
                    var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
                    var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
                    document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}					
</script>
<script language="javascript">
function AbreGral()
{ 
    var menu;   
	menu=window.open("mostrar_ingreso.php","","toolbar=no,scrollbars=no,width=800,height=500,status=yes");  
	menu.focus();  
	var ventana = window.self;  
	ventana.opener = window.self;  
	ventana.close();
}
</script>
</head>

<body onLoad="document.formulario.cedula.focus()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<?php include('../headerint.php'); ?>
<h3 class="titulo">INGRESAR EVALUACI&Oacute;N MONITOREO CAMARAS</h3>


<script>
function Verificar() {
	
	
if(document.formulario.mess.value == "") {
  alert("Por Favor Seleccione El MES");
  document.formulario.mess.focus();
  return false;
 }	
 
 return true;
}
</script>


<form name="formulario" action="" method="post">

<div class="fecha"><script languaje="JavaScript">Mostrar_Fecha()</script></div>

<table>
	<tr>
	<td>
	<fieldset>
	<table class="calificaciones">
 	
  	 <tr>
    	<td class="resaltada" colspan="5">Funcionario : <input name="apenom" type="text" class="Estilo66" id="apenom" value="<?php echo $apenom  ?>" size="60" maxlength="65"  readonly=""/></td>
  	</tr>

	<tr>
		<td class="resaltada center">Puntos para evaluar :</td>
		<td class="resaltada" colspan="4"><div align="center">Calificacion : </div></td>
	</tr>
	<tr>
		<td>
		Calificacion Mensual : 
		<select name="mess" required>
		  <option value="0" required>--SELECCIONE EL MES--</option>
		  <option value="1">ENERO</option>
		  <option value="2">FEBRERO</option>
		  <option value="3">MARZO</option>
		  <option value="4">ABRIL</option>
		  <option value="5">MAYO</option>
		  <option value="6">JUNIO</option>
		  <option value="7">JULIO</option>
		  <option value="8">AGOSTO</option>
		  <option value="9">SEPTIEMBRE</option>
		  <option value="10">OCTUBRE</option>
		  <option value="11">NOVIEMBRE</option>
		  <option value="12">DICIEMBRE</option>
		</select>
		</td>
		<td class='nota-titulo'>B</td>
		<td class='nota-titulo'>M</td>
		<td class='nota-titulo'>A</td>
		<td class='nota-titulo'>F</td>
	</tr>

	<tr>
		<td>
		<input name="codigosu2" type="text" class="item" id="codigosu2" value="CONTROL PUNTUALIDAD" size="60" maxlength="60" readonly />
		</td>
		<td class='nota'><input type="radio" name="a" id="a1" value="1"></td>
		<td class='nota'><input type="radio" name="a" id="a2" value="2"></td>
		<td class='nota'><input type="radio" name="a" id="a3" value="3"></td>
		<td class='nota'><input type="radio" name="a" id="a4" value="-3"></td>
	</tr>

	<tr>
		<td>
		<input name="codigosu2" type="text" class="item" id="codigosu2" value="CONTROL AUSENTISMO" size="60" maxlength="60" readonly />
		</td>
		<td class='nota'><input type="radio" name="b" id="b1" value="1"></td>
		<td class='nota'><input type="radio" name="b" id="b2" value="2"></td>
		<td class='nota'><input type="radio" name="b" id="b3" value="3"></td>
		<td class='nota'><input type="radio" name="b" id="b4" value="-3"></td>
	</tr>


	<tr>
		<td>
		<input name="codigosu2" type="text" class="item" id="codigosu2" value="CONTROL ACTIVIDADES CONTRAVENCIONALES" size="60" maxlength="60" readonly />
		</td>
		<td class='nota'><input type="radio" name="c" id="c1" value="1"></td>
		<td class='nota'><input type="radio" name="c" id="c2" value="2"></td>
		<td class='nota'><input type="radio" name="c" id="c3" value="3"></td>
		<td class='nota'><input type="radio" name="c" id="c4" value="-3"></td>
	</tr>


	<tr>
		<td>
		<input name="codigosu2" type="text" class="item" id="codigosu2" value="CONTROL DE INGRESO" size="60" maxlength="60" readonly />
		</td>
		<td class='nota'><input type="radio" name="d" id="d1" value="1"></td>
		<td class='nota'><input type="radio" name="d" id="d2" value="2"></td>
		<td class='nota'><input type="radio" name="d" id="d3" value="3"></td>
		<td class='nota'><input type="radio" name="d" id="d4" value="-3"></td>
	</tr>




	<!--<input name="punaten" type="text" class="Estilo66" id="punaten" value="0" size="4" maxlength="4" />-->


	  <tr>
		<td colspan="5"><div align="center" class="Estilo51">
		  <!--<input name="menu2" type="button" class="irmenu" id="menu2" onClick="window.location.href='listado_evaluacion_directores_camaras.php'" value="IR AL MENU">-->
		   <input name="guardarcalificaion" type="submit" class="direcciona" id="consultar" value="GUARDAR"  />
		</div></td>
	  </tr>
</table>
</fieldset></td>

  </tr>
</table>
</form>
</body>
</html>


<?php

if(isset($_POST["guardarcalificaion"]))
{
	require_once("../Conectarse.php");

	$dia= date("d");
    $mes =date("m");
    $ano= date("Y");

	$fechasis = $ano.'-'.$mes.'-'.$dia;
	
	$mess = $_POST['mess'];

	$a = $_POST['a'];
	$b = $_POST['b'];
	$c = $_POST['c'];
	$d = $_POST['d'];

	if($a == 1){$a = 1;}
	elseif($a == 2){$a = 2;}
	elseif($a == 3){$a = 3;}
	elseif($a == -3){$a = -3;}
	
	if($b == 1){$b = 1;}
	elseif($b == 2){$b = 2;}
	elseif($b == 3){$b = 3;}
	elseif($b == -3){$b = -3;}
		
	if($c == 1){$c = 1;}
	elseif($c == 2){$c = 2;}
	elseif($c == 3){$c = 3;}
	elseif($c == -3){$c = -3;}
	
	if($d == 1){$d = 1;}
	elseif($d == 2){$d = 2;}
	elseif($d == 3){$d = 3;}
	elseif($d == -3){$d = -3;}
		
	//$total = $a + $b + $c + $d + $e;
		
		
	$contro2 = mysql_query('SELECT codigo,cedula,nombre_completo,calif_1,calif_2,calif_3,calif_4 FROM eval_direc_moni_camaras WHERE codigo = "'.$_GET["codigo"].'" and cedula = "'.$_GET["ced2"].'"  and mes= "'.$_POST['mess'].'"  ');
	if (!$contro2) {
		die('Invalid query: ' . mysql_error());
	}
	
	$recor = mysql_num_rows($contro2);
	//list($codigo, $cedula, $nombre, $gerencia) = mysql_num_rows($control2);
	
	
	
	if ((mysql_num_rows($contro2)==0)) 
	{
		
		if($mes == $mess)
		{
			if    ($mess == 1){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 2){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 3){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 4){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 5){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 6){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 7){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 8){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 9){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 10){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 11){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
			elseif($mess == 12){$acmes1 = $a; $acmes2 = $b; $acmes3 = $c; $acmes4 = $d;}
	
			$totalmensual = $a + $b + $c + $d;

			if ($acmes1=='0' || $acmes2=='0' || $acmes3=='0' || $acmes4=='0' || $acmes1=='' || $acmes2=='' || $acmes3=='' || $acmes4=='')
			{
				echo "<script>alert('No Ha Seleccionado Todas Las Calificaciones');</script>";
			}
			else
			{
				$ins = mysql_query("INSERT INTO eval_direc_moni_camaras (codigo, cedula, nombre_completo, calif_1 ,calif_2, calif_3, calif_4, mes, acumulado_mensual,fecha) VALUES ('".$_GET['codigo']."','".$_GET['ced2']."','".$_POST['apenom']."', '$acmes1', '$acmes2', '$acmes3', '$acmes4','".$mess."', '".$totalmensual."', '".$fechasis."')");
	
				echo "<script>alert('La informacion fue Grabada correctamente');</script>";
				/*echo "<SCRIPT LANGUAGE='javascript'>window.location.href='listado_evaluacion_directores_camaras.php'</SCRIPT> ";*/
				echo "<script languaje='javascript'>window.close();</script>";
			}
		}
		else
		{
			echo "<script>alert('Seleccione el mes correcto');</script>";
		}
	}
	else
	{
		$control3 = mysql_query('SELECT calif_1,calif_2,calif_3,calif_4 FROM eval_direc_moni_camaras WHERE codigo = "'.$_GET["codigo"].'" and cedula = "'.$_GET["ced2"].'"  ');
		if (!$control3) {
			die('Invalid query: ' . mysql_error());
		}
				
		list($cal1, $cal2, $cal3, $cal4) = mysql_fetch_row($control3);	
				
		if ($cal1 !='0' || $cal2!= '0' || $cal3!= '0' || $cal4!= '0')
		{
			echo "<script>alert('Ya tiene Calificacion');</script>";
		}
	}
}

?>