File: /home/asjudine/public_html/modificar_servicios_documentos_ap.php
<?php
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();
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING']))
{
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form"))
{
$contenido = strtoupper($contenido);
// $msql = "update actuaciones_servicios set documentos_ap = '$contenido', estado = '1' where id = $id";
// mysql_query($msql, $dbi) or die(mysql_error());
$msql = mysql_query("UPDATE actuaciones_servicios set documentos_ap = '" . $_POST[contenido] . "' WHERE id = '" . $HTTP_GET_VARS["id"] . "' ");
if (!$msql) {
die('Invalid query update: ' . mysql_error());
}
echo "<script>alert('Registro modificado correctamente');<script>";
}
?>
<html>
<head>
<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>
<style type="text/css">
<!--
.Estilo1 {
color: #990000;
font-family: "Arial Narrow";
font-weight: bold;
}
-->
</style>
</head>
<body>
<FORM action="<?php echo $editFormAction; ?>" method="post" name="form">
<table width="430" border="1" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="418" bgcolor="#00CCFF"><div align="center"><span class="Estilo1">MODIFICAR ASESORIA SOLICITADA </span></div></td>
</tr>
<tr>
<td height="22" bgcolor="#00CCFF"><div align="center">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</div></td>
</tr>
<tr>
<?php
// $sql = "select * from actuaciones_servicios where id = $id";
// $control = mysql_query($sql, $dbi);
$control = mysql_query('SELECT * FROM actuaciones_servicios WHERE id = "' . $HTTP_GET_VARS["id"] . '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
$da = mysql_result($control,0,"documentos_ap");
$control = mysql_query('SELECT cedula, numero_atencion FROM actuaciones_servicios WHERE cedula = "' . $HTTP_GET_VARS["cedu"] . '" and numero_atencion = "' . $HTTP_GET_VARS["atencion"] . '" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
list($cedu, $numero_atencion) = mysql_fetch_row($control);
//$fec = mysql_result($control,0,"fecha");
echo "<tr><td><textarea name='contenido' cols='50' rows='4' title='MODIFICA ASESORIA'>\n";
echo htmlspecialchars($da)."\n";
echo "</textarea></td></tr>";
echo "<input name='id' type='hidden' value=$id size='11' maxlength='11'>";
?>
<tr>
<td height="22" bgcolor="#00CCFF"> </td>
</tr>
<td bgcolor="#00CCFF"><div align="center">
<input name="submit" type="submit" class="Estilo1" value="MODIFICAR ASESORIA" >
<input name="menu2" type="button" class="Estilo1" id="menu2" onClick="window.location.href='modificar_atencion_revision.php?id=<?php echo $cedu; ?>&atencion=<?php echo $numero_atencion; ?>'"'" value="CERRAR VENTANA">
</div></td>
</tr>
</TABLE>
<input type="hidden" name="MM_insert" value="form">
</FORM>
</body>
</html>