 
			
				05/06/2011, 22:01
			
			
			     |  
        |     |    |    Fecha de Ingreso: mayo-2011  
						Mensajes: 18
					  Antigüedad: 14 años, 3 meses Puntos: 0     |        |  
  |      Respuesta: Texto en php        <?php require_once('Connections/apuntes2.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; 
} 
}   
$currentPage = $_SERVER["PHP_SELF"];   
$maxRows_Recordset1 = 3; 
$pageNum_Recordset1 = 0; 
if (isset($_GET['pageNum_Recordset1'])) { 
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; 
} 
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;   
mysql_select_db($database_apuntes2, $apuntes2); 
$query_Recordset1 = "SELECT * FROM resgistros"; 
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); 
$Recordset1 = mysql_query($query_limit_Recordset1, $apuntes2) or die(mysql_error()); 
$row_Recordset1 = mysql_fetch_assoc($Recordset1); 
if (isset($_GET['totalRows_Recordset1'])) { 
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; 
} else { 
  $all_Recordset1 = mysql_query($query_Recordset1); 
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); 
} 
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;   
$queryString_Recordset1 = ""; 
if (!empty($_SERVER['QUERY_STRING'])) { 
  $params = explode("&", $_SERVER['QUERY_STRING']); 
  $newParams = array(); 
  foreach ($params as $param) { 
    if (stristr($param, "pageNum_Recordset1") == false &&  
        stristr($param, "totalRows_Recordset1") == false) { 
      array_push($newParams, $param); 
    } 
  } 
  if (count($newParams) != 0) { 
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams)); 
  } 
} 
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1); 
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> 
<title>Documento sin título</title> 
<?php 
$mes[0]="-"; 
$mes[1]="Enero"; 
$mes[2]="Febrero"; 
$mes[3]="Marzo"; 
$mes[4]="Abril"; 
$mes[5]="Mayo"; 
$mes[6]="Junio"; 
$mes[7]="Julio"; 
$mes[8]="Agosto"; 
$mes[9]="Septiembre"; 
$mes[10]="Octubre"; 
$mes[11]="Noviembre"; 
$mes[12]="Diciembre"; 
$dia[0]="Domingo"; 
$dia[1]="Lunes"; 
$dia[2]="Martes"; 
$dia[3]="Miércoles"; 
$dia[4]="Jueves"; 
$dia[5]="Viernes"; 
$dia[6]="Sábado"; 
$gisett=(int)date("w"); 
$mesnum=(int)date("m"); 
$hora = date(" H:i",time()); 
echo $dia[$gisett].", ".date("d")." de ".$mes[$mesnum]." de ".date("Y"); 
?> 
        </td> 
      </tr> 
  </table> 
  <style type="text/css"> 
body,td,th { 
	color: #FFF; 
} 
body { 
	background-color: #0F0F0F; 
} 
    </style> 
    <div class="sidebar1"> 
    <ul class="nav"> 
      <li><a href="index.php">Home</a></li> 
      <li><a href="listado.php">Listado de Apuntes</a></li> 
      <li><a href="admin.php">Poner Apuntes</a></li> 
      <li><a href="contactar.php">Contactar</a></li> 
    </ul> 
    <p> </p>   
    <table border="0" align="center"> 
      <tr> 
        <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> 
          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="images/Backward.png" alt="" height="36" /></a> 
        <?php } // Show if not first page ?></td> 
        <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?> 
          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="images/Arrow Left.png" alt="" height="36" /></a> 
        <?php } // Show if not first page ?></td> 
        <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> 
          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="images/Arrow Right.png" alt="" height="36" /></a> 
        <?php } // Show if not last page ?></td> 
        <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?> 
          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="images/Forward.png" alt="" height="36" /></a>         
        <?php } // Show if not last page ?></td> 
      </tr> 
    </table> 
    <p> </p>   
</div> 
  <div> 
    <?php do { ?>     
    <br /> 
      <br /> 
      <br /> 
      <table width="80%" align="left"> 
        <tr> 
          <td><img src="images/linea.png" width="750" height="2" /></td> 
        </tr> 
        <tr> 
          <td><span class="aa">Asignatura:</span> <?php echo $row_Recordset1['asignatura']; ?> <span class="aa">Tema:</span> <?php echo $row_Recordset1['tema']; ?></td> 
        </tr> 
        <tr> 
          <td class="aa">Apunte: </td> 
        </tr> 
        <tr> 
          <td><?php echo $row_Recordset1['apuntesuni']; ?></td> 
        </tr> 
        <tr> 
          <td><img src="images/linea.png" alt="" width="750" height="2" /></td> 
        </tr> 
      </table> 
      <br /> 
      <br /> 
      <br /> 
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> 
  </div>   
  <div class="footer"><img src="images/bajo.jpg" width="960" height="57" /></a> 
</div> 
</div> 
</body> 
</html> 
<?php 
mysql_free_result($Recordset1); 
?>           |