este es el formulario de edicion
Código PHP:
Ver original<?php require_once('../../Connections/agregarequipos.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form")) { $updateSQL = sprintf("UPDATE clientes SET nombres=%s, ip=%s, mac=%s, cell=%s, direcion=%s, comentario=%s, categoria=%s, pago_total=%s, fecha_inicial=%s, fecha_final=%s, codigo=%s, dias_p=%s,disable=%s, apellido=%s WHERE id=%s", GetSQLValueString($_POST['nombres'], "text"),
GetSQLValueString($_POST['ip'], "text"),
GetSQLValueString($_POST['mac'], "text"),
GetSQLValueString($_POST['cell'], "text"),
GetSQLValueString($_POST['direcion'], "text"),
GetSQLValueString($_POST['comentario'], "text"),
GetSQLValueString($_POST['categoria'], "text"),
GetSQLValueString($_POST['pago_total'], "text"),
GetSQLValueString($_POST['fecha_inicial'], "text"),
GetSQLValueString($_POST['fecha_final'], "text"),
GetSQLValueString($_POST['codigo'], "text"),
GetSQLValueString($_POST['dias_p'], "text"),
GetSQLValueString($_POST['disable'], "text"),
GetSQLValueString($_POST['apellido'], "text"),
GetSQLValueString($_POST['id'], "int"));
}
$colname_Recordset1 = "-1";
if (isset($_GET['id'])) { $colname_Recordset1 = $_GET['id'];
}
$query_Recordset1 = sprintf("SELECT * FROM clientes WHERE id = %s", GetSQLValueString
($colname_Recordset1, "text"));
?>
<form action="../app/Arp_Dhcp/Editar/editar_arp_dhcp.php" method="post" name="form" id="form">
<div class="row-fluid">
<div class="span2 lightblue">
<label>Nombre.</label>
<input name="nombres" required type="text" class="span12" id="nombres" placeholder="Nombre del Titular" value="
<?php echo htmlentities($row_Recordset1['nombres'], ENT_COMPAT, ''); ?>">
</div>
<div class="span5 lightblue">
<label>Apellidos.</label>
<input name="apellido" type="text" class="span12" id="cell" required placeholder="Apellidos del Cliente" value="
<?php echo htmlentities($row_Recordset1['apellido'], ENT_COMPAT, ''); ?>">
</div>
<div class="span5 lightblue">
<label>Cell.</label>
<input name="cell" type="text" class="span12" id="cell" required placeholder="# Celular del Cliente" value="
<?php echo htmlentities($row_Recordset1['cell'], ENT_COMPAT, ''); ?>">
</div>
<div class="row-fluid">
<div class="span4 lightblue">
<label>IP</label>
<input name="ip" required type="text" class="span12" id="ip" placeholder="Ip del Equipo" value="
<?php echo htmlentities($row_Recordset1['ip'], ENT_COMPAT, ''); ?>">
</div>