File: /home/asjudine/www/ingresar_informe_ventas_dir_ser.php
<html>
<head>
<title>INFORME DE VENTAS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {font-family: "Arial Narrow"}
.Estilo2 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo18 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; }
.Estilo19 {font-family: "Arial Narrow"; font-weight: bold; }
.Estilo20 {color: #990000}
.Estilo21 {font-family: "Arial Narrow"; font-weight: bold; font-size: 14; color: #990000; }
.Estilo23 {color: #990000; font-family: "Arial Narrow";}
.Estilo13 {font-size: 12px; font-weight: bold; }
.Estilo41 {font-family: "Times New Roman", Times, serif}
.Estilo42 {color: #009933}
.Estilo44 {font-family: "Arial Narrow"; font-weight: bold; font-size: 16px; color: #3366FF; }
.Estilo45 {
color: #0066FF;
font-size: 16px;
}
.Estilo48 {
color: #666633;
font-weight: bold;
}
.Estilo50 {
color: #CC3333;
font-family: "Arial Narrow";
font-weight: bold;
}
.Estilo51 {color: #003333}
.Estilo52 {
font-size: 16px;
color: #0066FF;
font-weight: bold;
font-family: "Arial Narrow";
}
.Estilo53 {color: #666633}
.Estilo54 {
font-size: 16px;
font-family: "Courier New", Courier, mono;
color: #FF0033;
font-weight: bold;
}
-->
</style>
<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 validar(formulario)
{
if (formulario.ciudad.value == "")
{
alert("Ingrese el nombre de la ciudad");
formulario.ciudad.focus();
return (false);
}
if (formulario.cedula.value == "")
{
alert("Ingrese el número de la cédula");
formulario.cedula.focus();
return (false);
}
if (formulario.nombre_completo.value == "")
{
alert("Ingrese apellidos y nombres");
formulario.nombre_completo.focus();
return (false);
}
if (formulario.expedicion_cedula.value == "")
{
alert("Ingrese la ciudad donde expidió su cédula");
formulario.expedicion_cedula.focus();
return (false);
}
if (formulario.edad.value == "")
{
alert("Ingrese su edad");
formulario.edad.focus();
return (false);
}
if (formulario.estado_civil.value == "")
{
alert("Ingrese su estado civil");
formulario.estado_civil.focus();
return (false);
}
if (formulario.ciudad.value == "")
{
alert("Ingrese el nombre de la ciudad");
formulario.ciudad.focus();
return (false);
}
if (formulario.natural_de.value == "")
{
alert("Ingrese de donde es usted");
formulario.natural_de.focus();
return (false);
}
if (formulario.residente_en.value == "")
{
alert("Ingrese la dirección de residencia");
formulario.residente_en.focus();
return (false);
}
if (formulario.ciudad_reside.value == "")
{
alert("Ingrese la ciudad donde reside");
formulario.ciudad_reside.focus();
return (false);
}
if (formulario.telefono_fijo.value == "")
{
alert("Ingrese el su número de teléfono fijo");
formulario.telefono_fijo.focus();
return (false);
}
if (formulario.celular.value == "")
{
alert("Ingrese el número de su celular");
formulario.celular.focus();
return (false);
}
if (formulario.grado.value == "")
{
alert("Ingrese su grado militar");
formulario.grado.focus();
return (false);
}
if (formulario.cargo.value == "")
{
alert("Ingrese su cargo actual");
formulario.cargo.focus();
return (false);
}
if (formulario.hechos.value == "")
{
alert("Redacte los hechos por el cual se le imputan los cargos");
formulario.hechos.focus();
return (false);
}
if (formulario.nom_funcionario.value == "")
{
alert("Escriba el nombre del funcionario investigador");
formulario.nom_funcionario.focus();
return (false);
}
if (formulario.cargo_funcionario.value == "")
{
alert("Escriba el cargo del funcionario investigador");
formulario.cargo_funcionario.focus();
return (false);
}
if (formulario.dia_noti.value == "")
{
alert("Escriba el día de la notificación");
formulario.dia_noti.focus();
return (false);
}
if (formulario.mes_noti.value == "")
{
alert("Escriba el mes de la notificación");
formulario.mes_noti.focus();
return (false);
}
return (true);
}
//--></script>
<script Language="JavaScript"><!--
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime ()
{
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " p.m." : " a.m."
document.formulario.hora.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock ()
{
stopclock ();
showtime ();
}
//--></script>
<link href="file:///C|/Documents%20and%20Settings/web%20master/Mis%20documentos/job9.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Estilo55 {color: #0066FF}
-->
</style>
</head>
<body onLoad="document.formulario.ciudad.focus();startclock()">
<form method="post" name="formulario" action="<?php echo $editFormAction; ?>" onSubmit="return validar(this)">
<table width="863" border="0" align="center" cellpadding="3" cellspacing="3" bgcolor="#FAFAF5">
<tr valign="baseline" bgcolor="#0099FF">
<td colspan="6" align="right" nowrap><div align="center"><span class="Estilo2">INGRESO INFORME DE VENTAS </span></div></td>
</tr>
<tr valign="baseline" bgcolor="#FAFAF5">
<td colspan="6" align="right" nowrap><div align="center" class="Estilo2">
<script languaje="JavaScript">Mostrar_Fecha()</script></div></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td colspan="6"><table width="852">
<tr>
<td width="265"><div align="center"></div></td>
<td width="289"><div align="center"><span class="Estilo19 Estilo20">Fecha dd-mm/aaaa:</span><span class="Estilo21"> <span class="Estilo13">
<input name="dia" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly="">
<input name="mes" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly="">
<input name="ano" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly="">
</span></span></div></td>
<td width="282"><div align="center"></div></td>
</tr>
</table></td>
</tr>
<tr valign="baseline" bgcolor="#FFCC99">
<td colspan="6"><div align="right" class="Estilo19 Estilo20">
<div align="left" class="Estilo41">
<div align="center" class="Estilo42">
<p>A CONTINUACION ENCONTRARA UNA SERIE DE DATOS A INGRESAR POR PARTE DE LOS </p>
<p>DIRECTORES DE SERVICIOS, EL CUAL DEBERA DILIGENCIAR EN FORMA DIARIA. </p>
</div>
</div>
</div>
</td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td width="170" align="right" nowrap bordercolor="#ECE9D8" bgcolor="#99CCCC"><div align="left"><span class="Estilo44">Apellidos y nombres: </span></div></td>
<td colspan="5"><input name="nombre_completo" type="text" value="<?php echo $nombre ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td bgcolor="#99CCCC"><div align="right" class="Estilo20">
<div align="left"><strong><span class="Estilo5 Estilo1 Estilo45"> Cédula:</span></strong></div>
</div></td>
<td width="319"><input name="cedula" type="text" value="<?php echo $cedula ?>" size="15" maxlength="15" readonly=""></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td align="right" nowrap bgcolor="#CCCCCC"><div align="center" class="Estilo55">
<p class="Estilo18"><span class="Estilo5 Estilo55">INFORME </span>DE GESTION</p>
<p class="Estilo18">Y</p>
<p class="Estilo18"><span class="Estilo5 Estilo55">DISTRIBUCION DE PUBLICIDAD </span></p>
</div></td>
<td colspan="5" align="right" nowrap><div align="center">
<table width="508" align="center">
<tr>
<td width="500" bgcolor="#CCCCCC"><div align="justify" class="Estilo23">
<p align="center" class="Estilo48">INFORME</p>
</div></td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><div align="justify" class="Estilo23">
<div align="center"><span class="Estilo20">
<textarea name="gestion" cols="50" rows="4" id="hechos"></textarea>
</span></div>
</div></td>
</tr>
</table>
</div></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td align="right" nowrap bgcolor="#CCCCCC"><div align="center">
<p align="center" class="Estilo51 Estilo52">EN ESTE ESPACIO USTED </p>
<p align="center" class="Estilo51 Estilo52">DEBERA RELACIONAR LOS </p>
<p align="center" class="Estilo51 Estilo52">CONTACTOS QUE NOS </p>
<p align="center" class="Estilo51 Estilo52">PUEDEN SERVIR PARA </p>
<p align="center" class="Estilo51 Estilo52">REALIZAR UNA CHARLA</p>
<p align="center" class="Estilo51 Estilo52">EN EL AREA COMERCIAL. </p>
</div></td>
<td colspan="5" align="right" nowrap><div align="center">
<table width="508" align="center">
<tr>
<td width="500" bgcolor="#CCCCCC"><div align="justify" class="Estilo50 Estilo53">
<div align="center">DATOS DE CONTACTOS </div>
</div></td>
</tr>
</table>
<table width="508" align="center">
<tr>
<td width="500"><div align="justify" class="Estilo23">
<div align="center"><span class="Estilo20">
<textarea name="contactos" cols="50" rows="4" id="textarea9">GRADO:
CARGO:
APELLIDOS:
NOMBRES:
DIRECCION:
TELEFONOS:
COMENTARIO:
GRADO:
CARGO:
APELLIDOS:
NOMBRES:
DIRECCION:
TELEFONOS:
COMENTARIO:
</textarea>
</span></div>
</div></td>
</tr>
</table>
<p class="Estilo54">A estos contactos la empresa les otorgara un contrato</p>
<p class="Estilo54">de cortesia en el plan EJC1, el cual se enviara por parte</p>
<p class="Estilo54">de la Gerencia General, una vez se reciba el informe de</p>
<p class="Estilo54">resultado por parte de los grupos de ventas. </p>
</div></td>
</tr>
<tr valign="baseline" bgcolor="#F2F2E6">
<td height="25" align="right" nowrap bgcolor="#F2F2E6"> </td>
<td bgcolor="#F2F2E6"> </td>
<td colspan="4"> </td>
</tr>
<tr valign="baseline" bgcolor="#009999">
<td colspan="6" align="right" nowrap><div align="center" class="Estilo20">
<p>
<input name="submit" type="submit" value="ENVIAR" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid" onClick="window.location.href='index.php'" value="IR A LA PAGINA PRINCIPAL">
<input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; background-color: #C0C0C0; border-style: solid" onClick="window.location.reload()" value="Actualizar">
</p>
<p>
<input name="menu2" type="button" class="Estilo50" id="menu2" onClick="window.location.href='menu_admin.php'" value="IR AL MENU">
</p>
</div></td>
</tr>
</table>
<div align="center">
<input type="hidden" name="MM_insert" value="formulario">
</div>
</form>
</body>
</html>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']))
{
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "formulario"))
{
require_once("mainfile.php");
include ("config.php");
global $dbi;
function Conectarse()
{
if (!($link=@mysql_connect("localhost","asjudine","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();
if($cedula)
{
$fecha = $ano.$mes.$dia;
$fechanoti = $ano_noti.$mes_noti.$dia_noti;
mysql_query("INSERT INTO informe_ventas_dir_ser (cedula, nombre_funcionario, contactos, gestion ,fecha_reporte) VALUES ('" . $_POST["cedula"] . "', '" . $_POST["nombre"] . "', '" . $_POST["contactos"] . "', '" . $_POST["gestion"] . "', '" . $_POST["fecha"] . "')");
echo "<script>alert('La información se ha enviado correctamente a la persona encargada de ventas');</script>";
}
}
?>