<h1>YANZ UPLOAD ANJG</h1>

<?php require_once('Connections/banco1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $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;
}
}

//######### INICIO Paginação

	$numreg = 10; // Quantos registros por página vai ser mostrado
	if (!isset($pg)) {
		$pg = 0;
	}
	$inicial = $_GET['pg'] * $numreg;

//######### FIM dados Paginação

$hoje = date('Y-m-d');

mysql_select_db($database_banco1, $banco1);
$query_sql = "SELECT * FROM agenda WHERE  data >= '$hoje'  ORDER BY data  ASC LIMIT $inicial, $numreg";
$sql = mysql_query($query_sql, $banco1) or die(mysql_error());
$row_sql = mysql_fetch_assoc($sql);
$totalRows_sql = mysql_num_rows($sql);

mysql_select_db($database_banco1, $banco1);
$query_sql_conta = "SELECT * FROM agenda WHERE data >= '$hoje'  ORDER BY data ASC";
$sql_conta = mysql_query($query_sql_conta, $banco1) or die(mysql_error());
$row_sql_conta = mysql_fetch_assoc($sql_conta);
$totalRows_sql_conta = mysql_num_rows($sql_conta);

$quantreg = mysql_num_rows($sql_conta); // Quantidade de registros pra paginação
        
?>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 

<?          
do {

?>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.style1 {font-family: "Trebuchet MS", Verdana, Arial}
.style3 {font-family: "Trebuchet MS", Verdana, Arial; font-size: 14px; }
.style12 {font-family: "Trebuchet MS", Verdana, Arial; font-size: 14px; color: #FFFFFF; }
.style15 {font-size: 14px}
.style16 {color: #990000}
.style17 {font-family: "Trebuchet MS", Verdana, Arial; font-size: 14px; color: #990000; }
a:hover {
	color: #CCCCCC;
	text-decoration: none;
}
.style18 {
	color: #FFFFFF;
	font-weight: bold;
}
.style20 {color: #333333}
.style21 {font-family: "Trebuchet MS", Verdana, Arial; font-size: 14px; color: #333333; }
-->
</style>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="bord_rodape">
<tr  style="cursor:default" onMouseOver="javascript:this.style.backgroundColor='#E2E2E2'" onMouseOut="javascript:this.style.backgroundColor=''">
  <td width="11%" height="40" bgcolor="#990000" class="style3 style15 style1 style16">&nbsp;<span class="style18 style18"><?php echo date("d/m/Y", strtotime($row_sql["data"])); ?></span></td>
  <td width="88%" class="style12 style1 style16"><?php echo $row_sql['hora']; ?>&nbsp;hrs &nbsp;&nbsp;-&nbsp;&nbsp; <strong><?php echo $row_sql['evento']; ?></strong></td>
  <td width="1%" colspan="2" rowspan="2">&nbsp;</td>
</tr>
<tr  style="cursor:default" onMouseOver="javascript:this.style.backgroundColor='#E2E2E2'" onMouseOut="javascript:this.style.backgroundColor=''">
  <td colspan="2" valign="top"><span class="style12 style1 style15 style20"><?php echo $row_sql['conteudo']; ?></span><span class="style17"><br />
      <br />
    Local: <?php echo $row_sql['local']; ?></span></td>
  </tr>

<tr  style="cursor:default" onMouseOver="javascript:this.style.backgroundColor='#E2E2E2'" onMouseOut="javascript:this.style.backgroundColor=''">
                      <td height="29" colspan="4">&nbsp;</td>
</tr>
</table>
                  
                  
          
          








<? } while ($row_sql = mysql_fetch_assoc($sql));

        
        echo "<br><br>"; // Vai servir só para dar uma linha de espaço entre a paginação e o conteúdo

        include("paginacao.php"); // Chama o arquivo que monta a paginação. ex: << anterior 1 2 3 4 5 próximo >>

mysql_free_result($sql);

mysql_free_result($sql_conta);
?>
<?php
//mysql_fre