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/public_html/comercial/formulario_consultorio_seminario_dih_cero.php
<?php 
require_once("../Conectarse.php");


$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (codigo="78" || codigo="555" || codigo="695") order by Nombre_Completo');

$row_Recordset1 = mysql_fetch_assoc($Recordset1); 
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

////////////////

$Recordset2 = mysql_query('SELECT * FROM sucursal order by nombre'); 
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
////////////////  

	
		
$control = mysql_query('SELECT apellidos,nombres,cedula,grado,escuela,email,celular,direccion,ciudad,departamento,telefono_fijo,nombre_acudiente,celular_acudiente FROM seminario_DIH WHERE cedula = "'.$_GET["cedula"].'" and celular = "'.$_GET["celular"].'"');
		  if (!$control) {
				die('Invalid query 1: ' . mysql_error());
			}
		$num=mysql_num_rows($control);
		 
list($apellidos,$nombres,$cedula,$grado,$escuela,$email,$celular,$direccion,$ciudad,$departamento,$telfijo,$nomacudiente,$celacudiente) = mysql_fetch_row($control);

?>
<!DOCTYPE HTML>
<html>
<head>
<title>Registro de Formulario Seminario</title>
<style type="text/css">
    *{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
    
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 4px;border-radius: 6px;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
    td{padding: 1px; border: 1px solid #a0a0a0;}
    .td{background-color: #e5e5e5; padding: 1px 30px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}
	.direcciona{width: 200px;background-color: #D4090C;color: #fff; padding: 4px;border-radius: 3px;}
	.direcciona:hover{background-color: #67a0d9; color: #000;}
    .boton1{width:30%;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:10px;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text]{border-radius: 5px; padding: 3px;background-color: #FFFFF4;}
	  .tdder{background-color: #e5e5e5; padding: 1px 2px;color: #00135F;font-size: 12px;font-weight: 600; text-align: right;}
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
    .botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
    .botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
	.tdizq{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 12px;font-weight: 600; text-align: left;}
</style>


<script>
function Verificar() {
	
	
if(document.frm.funcionario.value == "") {
  alert("Por Favor Seleccione Funcionario");
  document.frm.funcionario.focus();
  return false;
 }	

 if(document.frm.nombre.value == "") {
  alert("Por Favor Escriba El Nombre");
  document.frm.nombre.focus();
  return false;
 }
 


 
 return true;
}
</script>
 


</head>
 
<body bgcolor="#EFEFEF" text="#000000" topmargin="0" leftmargin="0">
<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<table width="100%" height="75%" bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
         
  <tr>
    <td height="10" valign="top">
 
      <table width="70%" border="0" cellspacing="0" cellpadding="0">
 
      </table>
    </td>
  </tr>
 
  <tr>
    <td align="center">
 
      <table width="90%" bgcolor="#EFEFEF" align="center" border="5" cellspacing="0" cellpadding="6">
 <tr>
   <td class="titulo">GESTION SEMINARIOS</td>
  
 </tr>
 
 <tr>
   <td align="center" colspan="2">
 
<script>
function Verificar() {
	
	
if(document.frm.apellidos.value == "") {
  alert("Por Favor Escriba Los Apellidos");
  document.frm.apellidos.focus();
  return false;
 }	

 if(document.frm.nombre.value == "") {
  alert("Por Favor Escriba El Nombre");
  document.frm.nombre.focus();
  return false;
 }
 
 if(document.frm.ced.value == "") {
  alert("Por Favor Escriba El Numero De Cedula");
  document.frm.ced.focus();
  return false;
 }
 
 if(document.frm.ecivil.value == "") {
  alert("Por Favor Escriba El Estado Civil");
  document.frm.ecivil.focus();
  return false;
 } 
 
  if(document.frm.funcionario.value == "") {
  alert("Por Favor Seleccione El Funcionario");
  document.frm.funcionario.focus();
  return false;
 } 


 
 return true;
}
</script>
 
     <form method="post" name="frm" onSubmit="return Verificar()">
       <table border="0" bgcolor="#EFEFEF" cellspacing="5">
 <!--<td class="tdizq"><div align="right"><strong> Fecha Registro</strong></div></td>
    <td class="tdizq"><div align="left">
      <input name="dia2" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly>
      <input name="mes2" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly>
      <input name="ano2" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly>
    </div></td> 
  </tr>  -->
 
     <form method="post" name="frm" onSubmit="return Verificar()">
       <table border="0" bgcolor="#EFEFEF" cellspacing="5">

       
       
        <tr>
  <td class="tdder">Apellidos:</td>
  <td class="tdizq"><input type="text" name="apellidos" value="<? echo $apellidos?>"size="50" maxlength="40"></td>
  
       </tr>
       
         <tr>
  <td class="tdder">Nombres:</td> 
  <td class="tdizq"><input type="text" name="nombres"  value="<? echo $nombres?>"size="50" maxlength="40"></td>
       </tr>
 
   <tr>
  <td class="tdder">Cedula de Ciudadania:</td>
  <td class="tdizq"><input type="text" name="cedula" value="<? echo $cedula ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Grado:</td>
  <td class="tdizq"><input type="text" name="grado" value="<? echo $grado ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Escuela:</td>
  <td class="tdizq"><input type="text" name="escuela" value="<? echo $escuela ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Email:</td>
  <td class="tdizq"><input type="text" name="email" value="<? echo $email ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Celular:</td>
  <td class="tdizq"><input type="text" name="celular" value="<? echo $celular ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Direccion:</td>
  <td class="tdizq"><input type="text" name="direccion" value="<? echo $direccion ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Ciudad:</td>
  <td class="tdizq"><input type="text" name="ciudad" value="<? echo $ciudad ?>"size="50" maxlength="40"></td>
   </tr>
   
   <tr>
  <td class="tdder">Departamento:</td>
  <td class="tdizq"><input type="text" name="departamento" value="<? echo $departamento ?>"size="50" maxlength="40"></td>
   </tr>
  
  <tr>
  <td class="tdder">Telefono Fijo:</td>
  <td class="tdizq"><input type="text" name="telfijo" value="<? echo $telfijo ?>"size="50" maxlength="40"></td>
       </tr>
  
  <tr>
  <td class="tdder">Nombre Acudiente:</td>
  <td class="tdizq"><input type="text" name="nomacudiente" value="<? echo $nomacudiente ?>"size="50" maxlength="25"></td>
       </tr>
       
  <tr>
  <td class="tdder">Celular Acudiente:</td>
  <td class="tdizq"><input type="text" name="celacudiente" value="<? echo $celacudiente ?>"size="50
  " maxlength="25"></td>
  </tr>
 
 
 
              
       
         <td class="tdder">Funcionario:</td>
        <td class="tdizq"><SELECT NAME="funcionario">
            <OPTION value="">--Nombre Funcionario--</OPTION>
            <?php
do {  
?>
            <option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
            <?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  $rows = mysql_num_rows($Recordset1);
  if($rows > 0) {
      mysql_data_seek($Recordset1, 0);
	  $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  }
?>
          </SELECT>
        </td>
        
        <tr>
         <td class="tdder">Sucursal:</td>
        <td class="tdizq"><SELECT NAME="sucursal">
            <OPTION value="">--Sucursal--</OPTION>
            <?php
do {  
?>
        <option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['nombre']?></option>
            <?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
  $rows = mysql_num_rows($Recordset2);
  if($rows > 0) {
      mysql_data_seek($Recordset2, 0);
	  $row_Recordset2 = mysql_fetch_assoc($Recordset2);
  }
?>
          </SELECT>
        </td>
        </tr>
     
         <tr>
  <td class="tdder">Numero Contrato:</td>
  <td class="tdizq"><input type="text" name="numcontrato"  value="<? echo $numcontrato ?>"size="6"></td>
       </tr>        
 <tr>
  <td class="tdder">Tipo Contrato:</td>
  <td class="tdizq"><input type="text" name="tipcontrato"  value="<? echo $tipcontrato?>"size="10"></td>
       </tr>      
       
    
       
  
       
   </table><br>
 
     <b>Gestion Seminarios<br>
     <textarea name="mensaje" cols="100" rows="10"></textarea><br><br>
 	 
     
     <input name="guardar" type="submit" class="direcciona" id="guardar" value="Guardar Datos" />
   
  
     </form>
 
   </td>
 </tr>
      </table><br>
 
    </td>
  </tr>
 
 
  <td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
  
  <input name="button" type="button" class="irmenu" onClick="javascript:window.close()" value="REGRESAR AL LISTADO">
    </div></td> 
 <br>   
  <tr>
    <td class="titulo">VERIFICACION ACTUACIONES</td>
  </tr>
</table>

</body>
</html>

<?
		
if(isset($_POST["guardar"]))
{
	
	$fechast = date("y").'-'.date("m").'-'.date("d");
	$hora=date("H:i:s",$time);
	$hora = Time() + (60 *60 * 1);   
	$hora=date('H:i:s',$hora);
	   
	$controlusua = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$_POST["funcionario"].'" ');
	
	if (!$controlusua) {
		die('Invalid query 1: ' . mysql_error());
	}
		
	$num=mysql_num_rows($controlusua); 
		
	list($nombreusuar) = mysql_fetch_row($controlusua);	
			 
$csqle1 = mysql_query("INSERT INTO actuaciones_seminario_DIH (cedula,actuaciones,fecha,funcionario,codigo_funcionario
,hora,sucursal) VALUES ('".$_POST["cedula"]."','".$_POST[mensaje]."','".$fechast."','".$nombreusuar."', '".$_POST[funcionario]."','".$hora."' ,'".$_POST[sucursal]."')");	 
		  		
			if (!$csqle1) { // esto es para que aparescan los errores
				die('Invalid query csql: ' . mysql_error()); 
			}


			
	
	if 	( $_POST[numcontrato] != '' and $_POST[tipcontrato] != '' )
	
	{
		
	$mssqlact = mysql_query("UPDATE seminario_DIH set numero_contrato = '".$_POST[numcontrato]."', tipo_contrato = '".$_POST[tipcontrato]."', funcionario = '".$nombreusuar."', codigo_funcionario = '".$_POST[funcionario]."', sucursal = '".$_POST[sucursal]."', estado='1' WHERE cedula =  '" . $_POST["cedula"] . "' " );	
		
		}	
			

	echo "<script>alert('Los datos fueron Guardados');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
	
	}
  
?>

<?php


$result= mysql_query('SELECT id,actuaciones,fecha,funcionario,hora FROM actuaciones_seminario_DIH WHERE cedula = "'.$_GET["cedula"].'" order by id ');
			if (!$result) {
				die('Error de consulta: ' . mysql_error());
			}
if(mysql_num_rows($result) != 0)
{
   echo "<table width=750 border=16 align=center cellpadding=1 cellspacing=1>
 
  <tr align=center>
 
    <td width='400' class=polici>Actuaci&oacute;n</td>
    <td width='75' class=polici>Fecha</td>
    <td width='65' class=polici>Funcionario</td>
	<td width='65' class=polici>Hora Registro</td>
  </tr>";

   while(list($id,$actuacion,$fecha,$funcionario,$hora) = mysql_fetch_row($result))
   {
       
		echo  "<tr class=lista><td align=center>$actuacion</td>
		<td align=center>$fecha</td>
		<td align=center>$funcionario</td>
		<td align=center>$hora</td></tr>";
   }
}
?>
</table>