<?php require_once('../Connections/local.php'); ?>
<?phpif (!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;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_cant_cursos_andes = 10;$pageNum_cant_cursos_andes = 0;if (isset($_GET['pageNum_cant_cursos_andes'])) { $pageNum_cant_cursos_andes = $_GET['pageNum_cant_cursos_andes'];}$startRow_cant_cursos_andes = $pageNum_cant_cursos_andes * $maxRows_cant_cursos_andes;mysql_select_db($database_local, $local);$query_cant_cursos_andes = "SELECT * FROM `cantidad de cursos region andes`";$query_limit_cant_cursos_andes = sprintf("%s LIMIT %d, %d", $query_cant_cursos_andes, $startRow_cant_cursos_andes, $maxRows_cant_cursos_andes);$cant_cursos_andes = mysql_query($query_limit_cant_cursos_andes, $local) or die(mysql_error());$row_cant_cursos_andes = mysql_fetch_assoc($cant_cursos_andes);if (isset($_GET['totalRows_cant_cursos_andes'])) { $totalRows_cant_cursos_andes = $_GET['totalRows_cant_cursos_andes'];} else { $all_cant_cursos_andes = mysql_query($query_cant_cursos_andes); $totalRows_cant_cursos_andes = mysql_num_rows($all_cant_cursos_andes);}$totalPages_cant_cursos_andes = ceil($totalRows_cant_cursos_andes/$maxRows_cant_cursos_andes)-1;$queryString_cant_cursos_andes = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_cant_cursos_andes") == false && stristr($param, "totalRows_cant_cursos_andes") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_cant_cursos_andes = "&" . htmlentities(implode("&", $newParams)); }}$queryString_cant_cursos_andes = sprintf("&totalRows_cant_cursos_andes=%d%s", $totalRows_cant_cursos_andes, $queryString_cant_cursos_andes);$totales = $row_cant_cursos_andes;session_start();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'];?>
<!doctype html>
<html>
<head>
</head>
<body>
<table border="1" align="center" bgcolor="#CBCBCB" width="1280">
<tr bgcolor="#DBDBDB">
<td><strong>Región</strong></td>
<td><strong>Año</strong></td>
<td><strong>Enero</strong></td>
<td><strong>Febrero</strong></td>
<td><strong>Marzo</strong></td>
<td><strong>Abril</strong></td>
<td><strong>Mayo</strong></td>
<td><strong>Junio</strong></td>
<td><strong>Julio</strong></td>
<td><strong>Agosto</strong></td>
<td><strong>Septiembre</strong></td>
<td><strong>Octubre</strong></td>
<td><strong>Noviembre</strong></td>
<td><strong>Diciembre</strong></td>
<td><strong>Total</strong></td>
<td><strong>Promedio</strong></td>
<td><strong>Actualizar</strong></td>
</tr>
<?php do { ?>
<tr>
<td bgcolor="#E0E0E0"><strong><?php echo $row_cant_cursos_andes['Region']; ?>
</a></strong></td>
<td><?php echo $row_cant_cursos_andes['year']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Enero']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Febrero']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Marzo']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Abril']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Mayo']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Junio']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Julio']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Agosto']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Septiembre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Octubre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Noviembre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Diciembre']; ?>
</td>
<td><strong> <?php echo $suma=$row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'] ?>
</strong></td>
<td><strong> <?php $prom=($row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'])/12; echo $prom= round($prom, 1) ?>
</strong></td>
<td><strong><form action="act_cant_cursos/act_cursos_andes.php?year=<?php echo $row_cant_cursos_andes['year']; ?>
" method="post">
<input type="submit" value="Actualizar" style="background-color:#8FB9DA"/> </form></strong>
</td>
</tr>
<?php } while ($row_cant_cursos_andes = mysql_fetch_assoc($cant_cursos_andes)); ?>
</table>
<!-- ------------------------------- Aqui quisiera realizar la suma----------------------------------------- -->
<?php do { ?>
<?php $totales["year"]+=$row_cant_cursos_andes['year']; ?>
<?php $totales["Enero"]+=$row_cant_cursos_andes['Enero']; ?>
<?php $totales["Febrero"]+=$row_cant_cursos_andes['Febrero']; ?>
<?php $totales["Marzo"]+=$row_cant_cursos_andes['Marzo']; ?>
<?php $totales["Abril"]+=$row_cant_cursos_andes['Abril']; ?>
<?php $totales["Mayo"]+=$row_cant_cursos_andes['Mayo']; ?>
<?php $totales["Junio"]+=$row_cant_cursos_andes['Junio']; ?>
<?php $totales["Julio"]+=$row_cant_cursos_andes['Julio']; ?>
<?php $totales["Agosto"]+=$row_cant_cursos_andes['Agosto']; ?>
<?php $totales["Septiembre"]+=$row_cant_cursos_andes['Septiembre']; ?>
<?php $totales["Octubre"]+=$row_cant_cursos_andes['Octubre']; ?>
<?php $totales["Noviembre"]+=$row_cant_cursos_andes['Noviembre']; ?>
<?php $totales["Diciembre"]+=$row_cant_cursos_andes['Diciembre']; ?>
<table border="1" align="center" bgcolor="#CBCBCB" width="1280">
</tr>
<td><strong>Total</strong></td>
<td><?php echo $totales["year"]; ?>
</td>
<td><?php echo $totales["Enero"]; ?>
</td>
<td><?php echo $totales["Febrero"]; ?>
</td>
<td><?php echo $totales["Marzo"]; ?>
</td>
<td><?php echo $totales["Abril"]; ?>
</td>
<td><?php echo $totales["Mayo"]; ?>
</td>
<td><?php echo $totales["Junio"]; ?>
</td>
<td><?php echo $totales["Julio"]; ?>
</td>
<td><?php echo $totales["Agosto"]; ?>
</td>
<td><?php echo $totales["Septiembre"]; ?>
</td>
<td><?php echo $totales["Octubre"]; ?>
</td>
<td><?php echo $totales["Noviembre"]; ?>
</td>
<td><?php echo $totales["Diciembre"]; ?>
</td>
<td>Total</td>
<td>Promedio</td>
<td>Actualizar</td>
</tr>
</table>
<?php } while ($totales = $row_cant_cursos_andes); ?>
<!-- -------------------------------Termina Suma de Filas----------------------------------------- -->
<p align="center">Gerencia de Capacitación ®</p>
</body>
</html>
<?php mysql_free_result($cant_cursos_andes);?>
<td><strong> <?php echo $suma=$row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'] ?>
</strong></td>
<td><strong> <?php $prom=($row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'])/12; echo $prom= round($prom, 1) ?>
</strong></td>
<?php require_once('../Connections/local.php'); ?>
<?phpif (!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;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_cant_cursos_andes = 10;$pageNum_cant_cursos_andes = 0;if (isset($_GET['pageNum_cant_cursos_andes'])) { $pageNum_cant_cursos_andes = $_GET['pageNum_cant_cursos_andes'];}$startRow_cant_cursos_andes = $pageNum_cant_cursos_andes * $maxRows_cant_cursos_andes;mysql_select_db($database_local, $local);$query_cant_cursos_andes = "SELECT * FROM `cantidad de cursos region andes`";$query_limit_cant_cursos_andes = sprintf("%s LIMIT %d, %d", $query_cant_cursos_andes, $startRow_cant_cursos_andes, $maxRows_cant_cursos_andes);$cant_cursos_andes = mysql_query($query_limit_cant_cursos_andes, $local) or die(mysql_error());$row_cant_cursos_andes = mysql_fetch_assoc($cant_cursos_andes);if (isset($_GET['totalRows_cant_cursos_andes'])) { $totalRows_cant_cursos_andes = $_GET['totalRows_cant_cursos_andes'];} else { $all_cant_cursos_andes = mysql_query($query_cant_cursos_andes); $totalRows_cant_cursos_andes = mysql_num_rows($all_cant_cursos_andes);}$totalPages_cant_cursos_andes = ceil($totalRows_cant_cursos_andes/$maxRows_cant_cursos_andes)-1;$queryString_cant_cursos_andes = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_cant_cursos_andes") == false && stristr($param, "totalRows_cant_cursos_andes") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_cant_cursos_andes = "&" . htmlentities(implode("&", $newParams)); }}$queryString_cant_cursos_andes = sprintf("&totalRows_cant_cursos_andes=%d%s", $totalRows_cant_cursos_andes, $queryString_cant_cursos_andes);$totales = $row_cant_cursos_andes;session_start();// -------------------------------iNICIO DE SESION----------------------------------------- //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'];?>
<table border="1" align="center" bgcolor="#FFFFFF" width="1280">
<tr bgcolor="#E0E0E0">
<td><strong>Región</strong></td>
<td><strong>Año</strong></td>
<td><strong>Enero</strong></td>
<td><strong>Febrero</strong></td>
<td><strong>Marzo</strong></td>
<td><strong>Abril</strong></td>
<td><strong>Mayo</strong></td>
<td><strong>Junio</strong></td>
<td><strong>Julio</strong></td>
<td><strong>Agosto</strong></td>
<td><strong>Septiembre</strong></td>
<td><strong>Octubre</strong></td>
<td><strong>Noviembre</strong></td>
<td><strong>Diciembre</strong></td>
<td><strong>Total</strong></td>
<td><strong>Promedio</strong></td>
<td><strong>Actualizar</strong></td>
</tr>
<?php do { ?>
<tr>
<td bgcolor="#E0E0E0"><strong><?php echo $row_cant_cursos_andes['Region']; ?>
</a></strong></td>
<td><?php echo $row_cant_cursos_andes['year']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Enero']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Febrero']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Marzo']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Abril']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Mayo']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Junio']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Julio']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Agosto']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Septiembre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Octubre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Noviembre']; ?>
</td>
<td><?php echo $row_cant_cursos_andes['Diciembre']; ?>
</td>
<td><strong> <?php echo $suma=$row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'] ?>
</strong></td>
<td><strong> <?php $prom=($row_cant_cursos_andes['Enero']+ $row_cant_cursos_andes['Febrero']+ $row_cant_cursos_andes['Marzo']+ $row_cant_cursos_andes['Abril']+ $row_cant_cursos_andes['Mayo']+ $row_cant_cursos_andes['Junio']+ $row_cant_cursos_andes['Julio']+ $row_cant_cursos_andes['Agosto']+ $row_cant_cursos_andes['Septiembre']+ $row_cant_cursos_andes['Octubre']+ $row_cant_cursos_andes['Noviembre']+ $row_cant_cursos_andes['Diciembre'])/12; echo $prom= round($prom, 1) ?>
</strong></td>
<td><strong><form action="act_cant_cursos/act_cursos_andes.php?year=<?php echo $row_cant_cursos_andes['year']; ?>
" method="post">
<input type="submit" value="Actualizar" style="background-color:#8FB9DA"/> </form></strong>
</td>
</tr>
<!-- AQUI ES DONDE TENGO EL PROBLEMA -->
<?php $totales["year"]+=$row_cant_cursos_andes['year']; $totales["Enero"]+=$row_cant_cursos_andes['Enero']; $totales["Febrero"]+=$row_cant_cursos_andes['Febrero']; $totales["Marzo"]+=$row_cant_cursos_andes['Marzo']; $totales["Abril"]+=$row_cant_cursos_andes['Abril']; $totales["Mayo"]+=$row_cant_cursos_andes['Mayo']; $totales["Junio"]+=$row_cant_cursos_andes['Junio']; $totales["Julio"]+=$row_cant_cursos_andes['Julio']; $totales["Agosto"]+=$row_cant_cursos_andes['Agosto']; $totales["Septiembre"]+=$row_cant_cursos_andes['Septiembre']; $totales["Octubre"]+=$row_cant_cursos_andes['Octubre']; $totales["Noviembre"]+=$row_cant_cursos_andes['Noviembre']; $totales["Diciembre"]+=$row_cant_cursos_andes['Diciembre']; ?>
<?php } while ($row_cant_cursos_andes = mysql_fetch_assoc($cant_cursos_andes)); ?>
</tr>
<td bgcolor="#E0E0E0" colspan="2"><strong>Total x mes</strong></td>
<td><strong><?php echo $totales["Enero"]; ?>
</strong></td>
<td><strong><?php echo $totales["Febrero"]; ?>
</strong></td>
<td><strong><?php echo $totales["Marzo"]; ?>
</strong></td>
<td><strong><?php echo $totales["Abril"]; ?>
</strong></td>
<td><strong><?php echo $totales["Mayo"]; ?>
</strong></td>
<td><strong><?php echo $totales["Junio"]; ?>
</strong></td>
<td><strong><?php echo $totales["Julio"]; ?>
</strong></td>
<td><strong><?php echo $totales["Agosto"]; ?>
</strong></td>
<td><strong><?php echo $totales["Septiembre"]; ?>
</strong></td>
<td><strong><?php echo $totales["Octubre"]; ?>
</strong></td>
<td><strong><?php echo $totales["Noviembre"]; ?>
</strong></td>
<td><strong><?php echo $totales["Diciembre"]; ?>
</strong></td>
<td colspan="3" bgcolor="E0E0E0"></td>
</tr>
</table>
SELECT SUM( `habitantes` )
FROM ciudades<?php$conexio = mysql_connect("localhost","root","1234");mysql_select_db ("capacitacion", $conexio) OR die ("No se puede conectar");//Seleccionar todos los registros$sql="SELECT * FROM `cantidad de cursos region centro`";$result=mysql_query($sql,$conexio);$totalEnero = 0;$totalFebrero = 0;$totalMarzo = 0;$totalAbril = 0;$totalMayo = 0;$totalJunio = 0;$totalJulio = 0;$totalAgosto = 0;$totalSeptiembre = 0;$totalOctubre = 0;$totalNoviembre = 0;$totalDiciembre = 0;while ($row = mysql_fetch_array($result)){$totalEnero+=$row["Enero"];$totalFebrero+=$row["Febrero"];$totalMarzo+=$row["Marzo"];$totalAbril+=$row["Abril"];$totalMayo+=$row["Mayo"];$totalJunio+=$row["Junio"];$totalJulio+=$row["Julio"];$totalAgosto+=$row["Agosto"];$totalSeptiembre+=$row["Septiembre"];$totalOctubre+=$row["Octubre"];$totalNoviembre+=$row["Noviembre"];$totalDiciembre+=$row["Diciembre"];}//Cerrar la conexionmysql_close($conexio);?>
<!-- muestras los totales -->
<tr>
<td bgcolor="#E0E0E0" colspan="2"><strong>Total x mes</strong></td>
<td><strong><?php echo $totalEnero; ?>
</strong></td>
<td><strong><?php echo $totalFebrero; ?>
</strong></td>
<td><strong><?php echo $totalMarzo; ?>
</strong></td>
<td><strong><?php echo $totalAbril; ?>
</strong></td>
<td><strong><?php echo $totalMayo; ?>
</strong></td>
<td><strong><?php echo $totalJunio; ?>
</strong></td>
<td><strong><?php echo $totalJulio; ?>
</strong></td>
<td><strong><?php echo $totalAgosto; ?>
</strong></td>
<td><strong><?php echo $totalSeptiembre; ?>
</strong></td>
<td><strong><?php echo $totalOctubre; ?>
</strong></td>
<td><strong><?php echo $totalNoviembre; ?>
</strong></td>
<td><strong><?php echo $totalDiciembre; ?>
</strong></td>
<td colspan="3" bgcolor="E0E0E0"></td>
</tr>