pfff se me olvidaba el codigo:
aqui el PHP:
Código PHP:
Ver original<?php require_once('../Connections/telefams.php'); ?>
<?php
}
$MM_authorizedUsers = "admin,dataentry";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); $isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized
("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); }
?>
<?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 reparaciones SET fechaRE=%s, trabajo_realizado=%s, reparado_por=%s, monto_reparacion=%s, estatus=%s WHERE ordenID=%s", GetSQLValueString($_POST['fechaRE'], "text"),
GetSQLValueString($_POST['trabajo_realizado'], "text"),
GetSQLValueString($_POST['reparado_por'], "text"),
GetSQLValueString($_POST['monto_reparacion'], "text"),
GetSQLValueString($_POST['estatus'], "text"),
GetSQLValueString($_POST['ordenID'], "int"));
$updateGoTo = "indexl.php";
if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ?
"&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING'];
}
}
$colname_rsUsuarios = "-1";
if (isset($_SESSION['MM_Username'])) { $colname_rsUsuarios = $_SESSION['MM_Username'];
}
$query_rsUsuarios = sprintf("SELECT * FROM usuarios WHERE usuario = %s", GetSQLValueString
($colname_rsUsuarios, "text"));
$colname_rsReparaciones = "-1";
if (isset($_GET['ordenID'])) { $colname_rsReparaciones = $_GET['ordenID'];
}
$query_rsReparaciones = sprintf("SELECT * FROM reparaciones WHERE ordenID = %s", GetSQLValueString
($colname_rsReparaciones, "int")); ?>