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/prueba_desarrollo.php
<?php

/*
require_once("mainfile.php");

function Conectarse()
{
   if (!($link=@mysql_connect("localhost","root","as2006")))
   {
      echo "Error conectando con el servidor.";
      exit();
   }
   $dbname = "asjudinet";
   if (!@mysql_select_db($dbname,$link))
   {
      echo "Error seleccionando la base de datos.";
      exit();
   }
   return $link;
}
 Conectarse();

*/
?>


<?php 
 // require_once("mainfile.php");
  // include ("config.php");
   require_once("Conectarse.php");   
   
   $sql = mysql_query('SELECT * FROM sucursal order by nombre');
			if (!$sql) {
				die('Invalid query: ' . mysql_error());
			}
	$row_sql = mysql_fetch_assoc($sql);
	$totalRows_sql = mysql_num_rows($sql); 
   
   
   if(isset($_POST["guardar"]))
		{
			
		$fecha_asignac = date("Y")."-".date("m")."-".date("d");
		$nombre_completo =$_POST["nombre"]." ".$_POST["apellidos"] ;
		
		
		
		$csql = mysql_query("SELECT cedula FROM consultorio_juridico WHERE cedula= '".$_POST["ced"]. "' || apellidos= '".$_POST["apellidos"]. "' and nombres= '".$_POST["nombre"]. "' ");	
			if (!$csql) {
				die('Invalid query: ' . mysql_error());
				
				
			} 		

	
		
if ((mysql_num_rows($csql)==0))


{
		
$csql6 = mysql_query("INSERT INTO consultorio_juridico  (fecha_registro,apellidos,nombres, cedula , celular,   email ,numero_contrato,tipo_contrato, empresa_laboral, direccion_empresa, telefono_empresa,direccion_residencia,ciudad_residencia, fecha_consulta, hora_consulta,motivo_consulta, relsutado_consulta,estado) VALUES ('" ."$fecha_asignac". "','" . $_POST["apellidos"] . "','" .$_POST["nombre"]. "', '".$_POST["ced"]. "', '" .$_POST["celular"]. "', '" .$_POST["email"]. "', 'CORPORATIVO','CORPORATIVO', '" .$_POST["empre"]. "', '" . $_POST["dirempre"]. "',  '" .$_POST["telempre"]. "', '" .$_POST["dirresi"]. "', '" .$_POST["ciudadresi"]. "', '" . $_POST["fech"] . "', '" . $_POST["hora"] . "','" . $_POST["mensaje"] . "','" . $_POST["mensaje"] . "', '0' )");	 
				
				if (!$csql6) { // esto es para que aparescan los errores
				die('Invalid query csql: ' . mysql_error()); 
					
			
							} 

						
$csql2 = mysql_query("INSERT INTO impresion_carnet (cedula , nombre,fecha,estado) VALUES ('".$_POST["ced"]. "','" ."$nombre_completo. "."', '" ."$fecha_asignac". "','0' )");	 
				
				if (!$csql2) { // esto es para que aparescan los errores
				die('Invalid query csql: ' . mysql_error()); 
			
							} 
							
$mss = mysql_query("UPDATE solicitud_citas set fecha = '".$fechas."',hora = '".$_GET[horas]."', estado = '5' WHERE cedula =  '".$_GET[cedulita]."' and id = '".$_GET[id]."' ");
				if (!$mss) {
				die('Invalid query update 174: ' . mysql_error());
							}		
							
							
		
	echo "<script>alert('Los datos fueron grabados correctamente');</script>"; 
		
		
		}
		
else

{
	
	 echo "<script>alert('Usuario Ya Esta Registrado ');</script>";   
	
	}
	}
		

?>


<html>
<head>
<title>Registro de Formulario Juridico</title>
<style type="text/css">
<!--

-->
</style>

<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;
 }
 


 
 return true;
}
</script>
</head>
 
<body bgcolor="#EFEFEF" text="#000000" topmargin="0" leftmargin="0">  
<form method="post" name="frm" onSubmit="return Verificar()">

<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="49%" bgcolor="#EFEFEF" align="center" border="0" cellspacing="0" cellpadding="6">
 <tr>
   <td align="center" bgcolor="#306090"><big style="color:#FFFFFF"><b>INGRESAR REGISTRO</b></big></td>
  
 </tr>
 
 <tr>
   <td align="center" colspan="2">
 

 

     
  <table border="0" bgcolor="#EFEFEF" cellspacing="5">
  
  <tr>
    <td align="right"><b>Apellidos:</b></td>
    <td width="300"><input type="text" name="apellidos" size="50" maxlength="40"></td>
    
    <td align="right"><b>Apellidos:</b></td>
    <td width="300"><input type="text" name="apellidos" size="50" maxlength="40"></td>
    
   </tr>
  
       <td width="80"><div align="right">Hora :</div></td>
        <td colspan="2"><div align="left">
          <input name="hora_diligenciav" type="text" id="hora_diligenciav" value="<?php echo $horadil ?>" size="6" maxlength="6" />
          <label>
          <select name="hap" class="est_cont2" id="hap">
            <option value="AM">AM</option>
            <option value="PM">PM</option>
          </select>
          </label>
        </div></td>
  
  <tr>
    <td align="right"><b>Nombres:</b></td>
    <td><input type="text" name="nombre" size="50" maxlength="40"></td>
    
    
   <td width="67" scope="col"><div align="right">Sucursal :</div></td>
        <th colspan="3" scope="col"><div align="left">
          <select name="cod_sucursalv" class="est_cont2" id="cod_sucursalv">
            <option value="">--SELECCIONE SUCURSAL--</option>
            <?php
     do {  
?>
            <option value="<?php echo $row_sql['codigo'];?>"><?php echo $row_sql['nombre']?></option>
            <?php
} while ($row_sql = mysql_fetch_assoc($sql));
  $rows = mysql_num_rows($sql);
  if($rows > 0) {
      mysql_data_seek($sql, 0);
       $row_sql = mysql_fetch_assoc($sql); 
  }
?>
          </select>
        </div></th>
  </tr>
  
  <tr>
        <td colspan="2"><div align="right">Tipo de Orden :</div></td>
        <td colspan="2">
        <label>
        <input type="radio" name="tipo_ordenv" value="Inicio" id="tipoo_0" />Inicio</label>
          
        <label>
        <input type="radio" name="tipo_ordenv" value="Revista" id="tipoo_1" />Revista</label>
        
        <label>
        <input type="radio" name="tipo_ordenv" value="Terminacion" id="tipoo_2" />Terminacion</label>

  		</td>
   	
       </tr>
        </table>           
      </table><br>
 <b>Gestion De Telemercadeo</b><br>
     
 	 <textarea name="mensaje" cols="10" rows="2"><? echo $moticonsu?></textarea><br><br>
	  
	 
 	<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_consultorio_juridico.php'" value="IR AL MENU" />
    <input name="guardar" type="submit" class="Estilo53" id="guardar" value="GUARDAR " /></td>
 </tr>
      </table><br>
 
    </td>  
  </tr>
 
</body>
</html>