<?php require_once('../../Connections/local.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
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"] == "form1")) {
$updateSQL = sprintf("UPDATE `cantidad de cursos nacional` SET `year`=%s, Region=%s, Enero=%s, Febrero=%s, Marzo=%s, Abril=%s, Mayo=%s, Junio=%s, Julio=%s, Agosto=%s, Septiembre=%s, Octubre=%s, Noviembre=%s, Diciembre=%s WHERE `year`=%s, `Region`=%s",
GetSQLValueString($_POST['Region'], "text"),
GetSQLValueString($_POST['Enero'], "int"),
GetSQLValueString($_POST['Febrero'], "int"),
GetSQLValueString($_POST['Marzo'], "int"),
GetSQLValueString($_POST['Abril'], "int"),
GetSQLValueString($_POST['Mayo'], "int"),
GetSQLValueString($_POST['Junio'], "int"),
GetSQLValueString($_POST['Julio'], "int"),
GetSQLValueString($_POST['Agosto'], "int"),
GetSQLValueString($_POST['Septiembre'], "int"),
GetSQLValueString($_POST['Octubre'], "int"),
GetSQLValueString($_POST['Noviembre'], "int"),
GetSQLValueString($_POST['Diciembre'], "int"),
GetSQLValueString($_POST['ID_Curso'], "text"),
GetSQLValueString($_POST['year'], "date"));
mysql_select_db($database_local, $local);
$Result1 = mysql_query($updateSQL, $local) or die(mysql_error());
$updateGoTo = "../cantcandes.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_act = "-1";
if (isset($_GET['year'])) {
$colname_act = $_GET['year'];
}
mysql_select_db($database_local, $local);
$query_act = sprintf("SELECT * FROM `cantidad de cursos nacional` WHERE Region='Andes' AND Year='$colname_act'", GetSQLValueString($colname_act, "date"));
$act = mysql_query($query_act, $local) or die(mysql_error());
$row_act = mysql_fetch_assoc($act);
$totalRows_act = mysql_num_rows($act);
?>
<?php require_once('../../Connections/local.php');
session_start(); //INICIO DE SESION USUARIO * IMPORTANTE DEBE IR AL INICIO DE LA PAGINA
?>
<?php //INICIO DE SESION USUARIO (CONTINUA EL INICIO)
require("conexion.php");
$usu=$_SESSION['usuario'];
$consulta11=mysql_query("SELECT * FROM usuario where usuario='$usu' ") or die(mysql_error());
$pacientes=mysql_fetch_array($consulta11);
$usu=$pacientes['nombre']." ".$pacientes['apellido']; //MUESTRA NOMBRE Y APELLIDO DE USUARIO EN EL FRONT
// TERMINA INICIO DE SESION
?>