File: /home/asjudine/public_html/formulario_consultorio_juridico6.php
<?php
require_once("mainfile.php");
include ("config.php");
require_once("Conectarse.php");
$control = mysql_query('SELECT fecha_registro,apellidos,nombres,cedula,celular,email,empresa_laboral,direccion_empresa,telefono_empresa,
fecha_consulta,hora_consulta,motivo_consulta,relsutado_consulta,asesor_comercial FROM consultorio_juridico WHERE estado= "2" and cedula = "'.$_GET["cedula"].'"');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($control);
list($fecha_registro,$ape, $nom, $cedu, $celular, $email, $empresa, $dirempre, $telempresa,$fechconsul,$hora,$motivo,$resultado, $asesor_comercial) = mysql_fetch_row($control);
$controlusuarios = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$asesor_comercial.'" ');
if (!$controlusuarios) {
die('Invalid query sucursal: ' . mysql_error());
}
$num=mysql_num_rows($controlusuarios);
list($nombusua) = mysql_fetch_row($controlusuarios);
?>
<html>
<head>
<title>Registro de Formulario Juridico</title>
<style type="text/css">
<!--
img {border: 0}
body,td {font-family: Verdana,Arial; font-size: 8pt; color: #000000}
input,select {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt
}
a:link, a:visited {text-decoration: none; color: #2030F0}
a:hover, a:active {text-decoration: underline; color: #D02010}
body table tr td table tr td form table tr td b {
font-size: 14pt;
}
body table tr td table tr td form table tr td b {
font-size: 10pt;
}
body table tr td table tr td form b {
font-size: 10pt;
}
body table tr td table tr td form table tr td div strong {
font-size: 10pt;
}
-->
</style>
</head>
<body bgcolor="#EFEFEF" text="#000000" topmargin="0" leftmargin="0">
<br>
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br>
<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="61%" bgcolor="#EFEFEF" align="center" border="0" cellspacing="0" cellpadding="6">
<tr>
<td align="left" bgcolor="#306090"><big style="color:#FFFFFF"><b>Ingreso Datos</b></big></td>
</tr>
<tr>
<td align="center" colspan="2">
<script>
function Verificar() {
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 La Cedula");
document.frm.ced.focus();
return false;
}
return true;
}
</script>
<form method="post" name="frm" onSubmit="return Verificar()">
<table border="0" bgcolor="#EFEFEF" cellspacing="5">
<td><div align="right"><strong> Fecha Registro</strong></div></td>
<td><div align="left">
<input name="fecha" type="text" id="dia2" value="<?php echo $fecha_registro?>"size="12" maxlength="12" readonly>
</div></td></tr>
<tr>
<td align="right" ><b>Apellidos:</b></td>
<td><input type="text" name="apellidos" value="<? echo $ape?>"size="50" maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Nombres:</b></td>
<td><input type="text" name="nombre" value="<? echo $nom?>"size="50"maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Cedula de Ciudadania:</b></td>
<td><input type="text" name="ced" value="<? echo $cedu?>"size="50"maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Celular:</b></td>
<td><input type="text" name="celu" value="<? echo $celular?>"size="50"maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Correo Electronico:</b></td>
<td><input type="text" name="email" value="<? echo $email?>"size="50"></td>
</tr>
<tr>
<td align="right"><b>Empresa Laboral:</b></td>
<td><input type="text" name="empre" value="<? echo $empresa ?>"size="50"></td>
</tr>
<tr>
<td align="right"><b>Direccion Empresa:</b></td>
<td><input type="text" name="dirempre" value="<? echo $dirempre?>"size="50"></td>
</tr>
<tr>
<td align="right"><b>Telefono Empresa:</b></td>
<td><input type="text" name="telempre" value="<? echo $telempresa?>"size="50"></td>
</tr>
<td><div align="right"><strong> Fecha Consulta </strong>ano/mes/dia</div></td>
<td><div align="left">
<input name="fecha" type="text" id="dia2" value="<?php echo $fechconsul?>"size="12" maxlength="12" >
</div></td></tr>
<tr>
<td align="right" ><b>Hora Consulta:</b></td>
<td><input type="text" name="hora" value="<? echo $hora ?>"size="10"></td>
</tr>
<tr>
<td align="right" ><b>Asesor Comercial:</b></td>
<td><input type="text" name="asesor_comercial" value="<? echo $nombusua ?>"size="50"></td>
</tr>
</table><br>
<b>Gestion De Telemercadeo </b><br>
<textarea name="mensaje" cols="100" rows="10"><? echo $motivo ?></textarea><br><br>
<input name="guardar3" type="submit" class="Estilo53" id="guardar" value="Consulta Asignada " />
<!--<input name="guardar4" type="submit" class="Estilo53" id="guardar" value="Guardar " /> -->
<input name="guardar0" type="submit" class="Estilo53" id="guardar" value="Se Afilio " />
<input name="guardar" type="submit" class="Estilo53" id="guardar" value="Pendiente " />
<input name="guardar5" type="submit" class="Estilo53" id="guardar" value="Muy Interesado " />
<input name="guardar6" type="submit" class="Estilo53" id="guardar" value="Enviar Contrato" />
<input name="guardar2" type="submit" class="Estilo53" id="guardar" value="Sin Interes " />
</form>
</td>
</tr>
</table><br>
</td>
</tr>
<td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='listado_pendiente_consultorio.php'" value="REGRESAR AL LISTADO">
</div></td>
<tr>
<td height="10" align="center" bgcolor="#000052"><b style="font-size:7.5p;color:#FFFFFF">Registro Formulario Juridico</b></td>
</tr>
</table>
</body>
</html>
<?php
if(isset($_POST["guardar0"]))
{
$mssql12 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos] . "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "',motivo_consulta= '" . $_POST[mensaje] . "', relsutado_consulta= '" . $_POST[mensaje2] . "',estado= '4' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql12) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos] . "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "',motivo_consulta= '" . $_POST[mensaje] . "', relsutado_consulta= '" . $_POST[mensaje2] . "',estado= '3' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar2"]))
{
if ($cedu==$_GET["cedula"]);
$mssql12 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos] . "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "', motivo_consulta= '" . $_POST[mensaje] . "',relsutado_consulta= '" . $_POST[mensaje2] . "', estado= '5' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql12) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar3"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos]. "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' ,direccion_residencia= '" . $_POST[dirresidencia] . "' ,ciudad_residencia= '" . $_POST[ciuresidencia] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "',motivo_consulta= '" . $_POST[mensaje] . "', estado= '1' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar4"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos] . "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "', motivo_consulta= '" . $_POST[mensaje] . "', relsutado_consulta= '" . $_POST[mensaje2] . "', estado= '3' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar5"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos]. "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "', fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "',motivo_consulta= '" . $_POST[mensaje] . "', estado= '2' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
if(isset($_POST["guardar6"]))
{
if ($cedu==$_GET["cedula"]);
$mssql3 = mysql_query("UPDATE consultorio_juridico set apellidos = '" . $_POST[apellidos] . "', nombres = '" . $_POST[nombre] . "', cedula = '" . $_POST[ced] . "', celular = '" . $_POST[celu] . "' , email = '" . $_POST[email] . "', empresa_laboral = '" . $_POST[empre] . "', direccion_empresa = '" . $_POST[dirempre] . "', telefono_empresa= '" . $_POST[telempre] . "' , fecha_consulta= '" . $_POST[fecha] . "' , hora_consulta= '" . $_POST[hora] . "', motivo_consulta= '" . $_POST[mensaje] . "', relsutado_consulta= '" . $_POST[mensaje2] . "', estado= '8' WHERE cedula = '" . $_GET["cedula"] . "' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICAR: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
?>