This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include 'php/functions.php'; ?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Calendario</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap --> | |
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> | |
<link href="css/style.css" rel="stylesheet" media="screen"> | |
<script src="js/jquery.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dia = array("Domingo", "Lunes", "Mártes", "Miercoles", "Jueves", "Viernes", "Sábado"); | |
$mes = array("", "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); | |
$actual_m = date("n"); | |
$actual_d = date("j"); | |
$actual_y = date("Y"); | |
if ($timestamp = strtotime($_GET['d'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include './functions.php'; ?> | |
<tr> | |
<?php | |
for ($i = 1; $i <= $days_number; $i++) { | |
echo "<td>".$i."</td>"; | |
if ($i % 7 == 0){ | |
echo "</tr><tr>"; | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dia = array("Domingo", "Lunes", "Mártes", "Miercoles", "Jueves", "Viernes", "Sábado"); | |
$mes = array("", "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); | |
$actual_m = date("n"); | |
$actual_d = date("j"); | |
$actual_y = date("Y"); | |
if ($timestamp = strtotime($_GET['d'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include './functions.php'; if(isset($_GET['source'])) { highlight_file(__FILE__); exit; } ?> | |
<tr> | |
<?php | |
for ($i = 1; $i <= 7; $i++){ | |
if ($i < $primer_dia){ | |
echo "<td><span></span></td>"; | |
} | |
else { | |
echo "<td>".$diap."</td>"; | |
$diap++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include './functions.php'; ?> | |
<tr> | |
<?php | |
for ($i = 1; $i <= 7; $i++){ | |
if ($i < $primer_dia){ | |
echo "<td><span></span></td>"; | |
} | |
else { | |
echo "<td>".$diap."</td>"; | |
$diap++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i = 1; i <= days_number; i++) { | |
if (month == actual_m && diap == actual_d) { | |
tbody.append("<td id=\"2013-07-16 00:00:00\" class=\"actual\"><span><a href=\"#myModal\" role=\"button\" class=\"days\" data-toggle=\"modal\">" + diap + "</a></span></td>"); | |
} | |
else { | |
tbody.append("<td id=\"2013-07-16 00:00:00\"><span><a href=\"#myModal\" role=\"button\" class=\"days\" data-toggle=\"modal\">" + diap + "</a></span></td>"); | |
} | |
if (i % 7 === 0) tbody.append("</tr><tr>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'config/db_config.php'; | |
$sql = "SELECT * FROM events WHERE timestamp = '".$_POST['d']."' ORDER BY ID"; | |
$query = mysqli_query($link, $sql); | |
if (mysqli_num_rows($query) > 0){ | |
$data = array(); $index = 0; | |
while ($recset = mysqli_fetch_array($query)){ | |
$data[$index] = $recset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `calendario`.`events` ( | |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | |
`timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | |
`title` varchar(45) NOT NULL DEFAULT '', | |
`desc` varchar(200) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'config/db_config.php'; | |
$sql = "SELECT *, DATE_FORMAT(timestamp, '%Y-%c-%e') selector FROM events WHERE DATE_FORMAT(timestamp, '%Y-%c') = '".$_POST['d']."' ORDER BY DATE_FORMAT(timestamp, '%Y%c%e'), id DESC"; | |
$query = mysqli_query($link, $sql); | |
if (mysqli_num_rows($query) > 0){ | |
$data = array(); $index = 0; | |
while ($recset = mysqli_fetch_array($query)){ | |
$data[$index] = $recset; |
OlderNewer