Commit 4ca3e0ec authored by Denis S. Valdenaire's avatar Denis S. Valdenaire

integration calendar, games list

parent 5d5466d7
<?php
// display a calendar in async mode to select a date in the date field
ini_set("include_path", ini_get("include_path").":..");
include("classes/calendar.php");
include("helpers/date.php");
$cal = new calendar ($year, $month);
?>
<div class="calendar_title">
<a href="javascript:modif_date('<?=$previous_year."-".sprintf("%02d", $previous_month)."-".date("t", mktime(0,0,0,$previous_month,1,$previous_year))?>','<?=$_POST["div"]?>','<?=$_POST["field"]?>');">&lt;&lt;</a>&nbsp;&nbsp;
<?=$cal->getFullMonthName()." ".$cal->getYear()?>&nbsp;&nbsp;
<a href="javascript:modif_date('<?=$next_year."-".sprintf("%02d", $next_month)."-01"?>','<?=$_POST["div"]?>','<?=$_POST["field"]?>')">&gt;&gt;</a>
</div>
<?=$cal->display();?>
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
body {
font: 100% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
background-color: White;
color: Black;
width: 1062px;
text-align: center;
}
/*
* Base structure
*/
#header_zone {
border: 1px dashed gray;
padding: 2px;
margin: 2px;
height: 36px;
/* Move down content because we have a fixed navbar that is 50px tall */
body {
padding-top: 50px;
background-color : #bbbbff;
}
#title_zone {
float: left;
font: 120% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
border: #444444 2px solid;
padding: 3px;
padding-right: 8px;
padding-left: 8px;
img#logo {
position: absolute;
top: 5px;
left: 5px;
}
#menu_zone {
float: right;
margin-right: 400px;
margin-top:10px;
/*
* Global add-ons
*/
.sub-header {
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
#middle_zone {
min-height: 500px;
/*
* Top navigation
* Hide default border to remove 1px line.
*/
.navbar-fixed-top {
border: 0;
}
#main_view {
min-height: 500px;
border: 1px dashed gray;
padding: 2px;
margin: 2px;
float: right;
width: 800px;
}
/*
* Sidebar
*/
#toolbox {
border: 1px dashed gray;
padding: 2px;
margin: 2px;
float: left;
width: 240px;
min-height: 500px;
/* Hide for mobile, show later */
.sidebar {
display: none;
}
@media (min-width: 768px) {
.sidebar {
position: fixed;
top: 51px;
bottom: 0;
left: 0;
z-index: 1000;
display: block;
padding: 20px;
overflow-x: hidden;
overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
background-color: #bbbbff;
border-left: 1px solid black;
}
}
#footer_zone {
border: 1px dashed gray;
padding: 2px;
margin: 2px;
margin-top: 12px;
clear: both;
text-align: left;
/* Sidebar navigation */
/*
.nav-sidebar {
margin-right: -21px;
margin-bottom: 20px;
margin-left: -20px;
}
.nav-sidebar > li > a {
padding-right: 20px;
padding-left: 20px;
}
.nav-sidebar > .active > a,
.nav-sidebar > .active > a:hover,
.nav-sidebar > .active > a:focus {
color: #fff;
background-color: #428bca;
}
*/
.info_msg {
border: #444444 1px solid;
font-size: 95%;
background: #faffab;
margin: 6px;
padding: 5px;
.navbar-default {
background-color: #bbbbff;
border-color: #3a2bc0;
}
.navbar-default .navbar-brand {
color: #54595a;
}
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus {
color: #010002;
}
.navbar-default .navbar-text {
color: #54595a;
}
.navbar-default .navbar-nav > li > a {
color: #54595a;
}
.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
color: #010002;
}
.navbar-default .navbar-nav > li > .dropdown-menu {
background-color: #bbbbff;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a {
color: #54595a;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav > li > .dropdown-menu > li > a:focus {
color: #010002;
background-color: #3a2bc0;
}
.navbar-default .navbar-nav > li > .dropdown-menu > li > .divider {
background-color: #bbbbff;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus {
color: #010002;
background-color: #3a2bc0;
}
.navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
color: #010002;
background-color: #3a2bc0;
}
.navbar-default .navbar-toggle {
border-color: #3a2bc0;
}
.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: #3a2bc0;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #54595a;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #54595a;
}
.navbar-default .navbar-link {
color: #54595a;
}
.navbar-default .navbar-link:hover {
color: #010002;
}
.error_msg {
border: #444444 1px solid;
font-size: 95%;
background: #ed7878;
margin: 6px;
padding: 5px;
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #54595a;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #010002;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #010002;
background-color: #3a2bc0;
}
}
.warning_msg {
border: #444444 1px solid;
font-size: 95%;
background: #e7b361;
margin: 6px;
padding: 5px;
/*
* Main content
*/
.main {
padding: 20px;
}
@media (min-width: 768px) {
.main {
padding-right: 40px;
padding-left: 40px;
}
}
.main .page-header {
margin-top: 0;
}
/* calendar stuff */
......
div.zabuto_calendar{margin:0;padding:0}div.zabuto_calendar .table{width:100%;margin:0;padding:0}div.zabuto_calendar .table th,div.zabuto_calendar .table td{padding:4px 2px;text-align:center}div.zabuto_calendar .table tr th,div.zabuto_calendar .table tr td{background-color:#fff}div.zabuto_calendar .table tr.calendar-month-header th{background-color:#fafafa}div.zabuto_calendar .table tr.calendar-month-header th span{cursor:pointer;display:inline-block;padding-bottom:10px}div.zabuto_calendar .table tr.calendar-dow-header th{background-color:#f0f0f0}div.zabuto_calendar .table tr:last-child{border-bottom:1px solid #ddd}div.zabuto_calendar .table tr.calendar-month-header th{padding-top:12px;padding-bottom:4px}div.zabuto_calendar .table-bordered tr.calendar-month-header th{border-left:0;border-right:0}div.zabuto_calendar .table-bordered tr.calendar-month-header th:first-child{border-left:1px solid #ddd}div.zabuto_calendar div.calendar-month-navigation{cursor:pointer;margin:0;padding:0;padding-top:5px}div.zabuto_calendar tr.calendar-dow-header th,div.zabuto_calendar tr.calendar-dow td{width:14%}div.zabuto_calendar .table tr td div.day{margin:0;padding-top:7px;padding-bottom:7px}div.zabuto_calendar .table tr td.event div.day,div.zabuto_calendar ul.legend li.event{background-color:#fff0c3}div.zabuto_calendar .table tr td.dow-clickable,div.zabuto_calendar .table tr td.event-clickable{cursor:pointer}div.zabuto_calendar .badge-today,div.zabuto_calendar div.legend span.badge-today{background-color:#357ebd;color:#fff;text-shadow:none}div.zabuto_calendar .badge-event,div.zabuto_calendar div.legend span.badge-event{background-color:#ff9b08;color:#fff;text-shadow:none}div.zabuto_calendar .badge-event{font-size:.95em;padding-left:8px;padding-right:8px;padding-bottom:4px}div.zabuto_calendar div.legend{margin-top:5px;text-align:right}div.zabuto_calendar div.legend span{color:#999;font-size:10px;font-weight:normal}div.zabuto_calendar div.legend span.legend-text:after,div.zabuto_calendar div.legend span.legend-block:after,div.zabuto_calendar div.legend span.legend-list:after,div.zabuto_calendar div.legend span.legend-spacer:after{content:' '}div.zabuto_calendar div.legend span.legend-spacer{padding-left:25px}div.zabuto_calendar ul.legend>span{padding-left:2px}div.zabuto_calendar ul.legend{display:inline-block;list-style:none outside none;margin:0;padding:0}div.zabuto_calendar ul.legend li{display:inline-block;height:11px;width:11px;margin-left:5px}div.zabuto_calendar ul.legend div.zabuto_calendar ul.legend li:first-child{margin-left:7px}div.zabuto_calendar ul.legend li:last-child{margin-right:5px}div.zabuto_calendar div.legend span.badge{font-size:.9em;border-radius:5px 5px 5px 5px;padding-left:5px;padding-right:5px;padding-top:2px;padding-bottom:3px}@media(max-width:979px){div.zabuto_calendar .table th,div.zabuto_calendar .table td{padding:2px 1px}}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,51 +16,36 @@ This file is part of phpLudoreve.
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
// controller part
switch($_REQUEST["a"]) {
case "edit":
// SQL SELECT jeu
$sql = "SELECT id_jeu, nom, reference, fabricant, categorie, categorie_esar_id,
commentaire, infos_fabricant, inventaire, date_achat, prix, nombre_mini, nombre_maxi,
age_mini, age_maxi, type
FROM jeu WHERE id_jeu = ".mysql_real_escape_string($_REQUEST["i"]);
$data->select($sql, $rset);
if($rset->numrows) {
// get medias associated with it
// SQL SELECT media
$sql = " SELECT id, description, media_type_id, file
FROM medias
WHERE id_jeu = ".mysql_real_escape_string($_REQUEST["i"]);
$data->select($sql, $media_rset);
} else {
$media_rset = "";
}
break;
}
$sql = "SELECT jeu.id_jeu, nom, CONCAT (categorie_esar.label, ' - ', categorie_esar.name) AS label,
id_pret as etat_pret
FROM jeu
left outer join categorie_esar on jeu.categorie_esar_id = categorie_esar.id
left outer join prets on (jeu.id_jeu = prets.id_jeu AND date_retour > curdate())
ORDER BY nom";
$requete = mysql_query($sql,$server_link);
// view part
switch($_REQUEST["a"]) {
case "edit":
include("games/edit.php");
break;
?>
<h1>Liste des jeux</h1>
<table id="list_jeu">
<thead>
<tr>
<th>Nom</th>
<th>ESAR</th>
<th>Etat</th>
</tr>
</thead>
<tbody>
<?php
$ligne=FALSE;
# affichage des résultats de la requête dans le menu déroulant
while ($resultat = mysql_fetch_array($requete)) { ?>
<tr>
<td>
<a href="edit.php?id_jeu=<?=$resultat['id_jeu']?>"><?=$resultat['nom']?></a>
</td>
<td>
<?=$resultat['label']?>
</td>
<td>
<?=($resultat['etat_pret'] == '') ? "Libre" : "Emprunte"?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<script src="../js/jquery-1.11.3.min.js"></script>
<script src="../js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function() {$('#list_jeu').DataTable()});
</script>
<?php
include "../fonctions/finpage.php";
default: // list
include("games/list.php");
break;
}
?>
<?php
// SQL SELECT jeu categorie_esar prets
$sql = "SELECT jeu.id_jeu, nom,
CONCAT (categorie_esar.label, ' - ', categorie_esar.name) AS label,
id_pret as etat_pret
FROM jeu
LEFT OUTER JOIN categorie_esar ON jeu.categorie_esar_id = categorie_esar.id
LEFT OUTER JOIN prets ON (jeu.id_jeu = prets.id_jeu AND date_retour > curdate())
ORDER BY nom";
$data->select($sql, $rset);
?>
<h1>Liste des jeux</h1>
<table id="list_jeu">
<thead>
<tr>
<th>Nom</th>
<th>ESAR</th>
<th>Etat</th>
</tr>
</thead>
<tbody>
<?php
$ligne=FALSE;
# affichage des résultats de la requête dans le menu déroulant
do { ?>
<tr>
<td>
<a href="index.php?o=games&a=edit&i=<?=$rset->value("id_jeu")?>"><?=$rset->value("nom")?></a>
</td>
<td>
<?=$rset->value("label")?>
</td>
<td>
<?=($rset->value("etat_pret") == "") ? "Libre" : "Emprunte"?>
</td>
</tr>
<?php } while($rset->nextrow()); ?>
</tbody>
</table>
<script>
$(document).ready(function() {$('#list_jeu').DataTable({"autoWidth": false})});
/* FIXME : translation of the table
see https://datatables.net/plug-ins/i18n/French
*/
</script>
......@@ -21,50 +21,64 @@ include("config/config.php");
include("classes/data.php");
$data = new data();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
<link href="css/styles.css" rel="stylesheet" type="text/css">
<link href="css/jquery.dataTables.min.css" rel="stylesheet" type="text/css">
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/functions.js"></script>
</head>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- link rel="stylesheet" href="css/bootstrap-theme.min.css" -->
<link rel="stylesheet" href="css/zabuto_calendar.min.css">
<link rel="stylesheet" href="css/jquery.dataTables.min.css" -->
<link rel="stylesheet" href="css/styles.css">
<script src="js/jquery-1.11.3.min.js"></script>
</head>
<body>
<div id="header_zone">
<div id="menu_zone">
<?php
$contexts = array("home", "members", "games");
if(!array_key_exists("o", $_REQUEST)) {
$contexts = array("members" => "Adhérents", "games" => "Jeux");
if(!array_key_exists("o", $_REQUEST) || !array_key_exists($_REQUEST["o"], $contexts)) {
$_REQUEST["o"] = "home";
} else {
if(!in_array($_REQUEST["o"], $contexts)) {
echo '{"message":"Error : '.$_REQUEST["o"].' : no such context."}';
exit();
}
}
}
?>
<a href="javascript:set_value('o', '<?=$val?>');set_value('a','');set_value('i','');document.defaultform.submit()"><?=$val?></a>
<?php
while(list($key, $val) = each($contexts)) { ?>
:: <a href="javascript:set_value('o', '<?=$val?>');set_value('a','');set_value('i','');document.defaultform.submit()"><?=$val?></a>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">
<img id="logo" src="images/logo-texte.png" alt="phpLudoreve"></a>
</div>
<div id="navbar" class="collapse navbar-collapse navbar-right">
<ul class="nav navbar-nav">
<?php while(list($key, $val) = each($contexts)) { ?>
<li><a href="index.php?o=<?=$key?>"><?=$val?></a></li>
<?php } ?>
</ul>
<form class="navbar-form navbar-right">
<input type="text" class="form-control" placeholder="Recherche...">
</form>
<!-- when authentication will be ready
<ul class="nav navbar-nav navbar-right">
<li><a href="#/users"><span class="glyphicon glyphicon-user"></span> Account</a></li>
<li><a href="#/logout"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
-->
</div>
</div>
</div>
</nav>
<?php
// compute date
include("helpers/date.php");
?>
<div id="middle_zone">
<div id="main_view">
<form action="index.php" method="post" id="defaultform" name="defaultform">
<form action="index.php" method="post" id="defaultform" name="defaultform">
<div class="container-fluid">
<div class="row">
<div class="col-sm-9 col-md-10 main">
<?php
switch($_REQUEST["o"]) {
case "games";
include("games/games.php");
......@@ -75,27 +89,31 @@ switch($_REQUEST["o"]) {
break;
default:
//header("Location: ./accueil/index.php");
?>
//include("accueil/index.php");
<?php
break;
}
//header("Location: ./accueil/index.php");
?>
<input type="hidden" name="o" id="o" value="<?=$_REQUEST["o"]?>">
<input type="hidden" name="a" id="a" value="<?=(array_key_exists("a", $_REQUEST)) ? $_REQUEST["a"] : ""?>">
<input type="hidden" name="i" id="i" value="<?=(array_key_exists("i", $_REQUEST)) ? $_REQUEST["i"] : ""?>">
</div>
<div id="toolbox">
<div>
<div class="col-sm-3 col-sm-offset-9 col-md-2 col-md-offset-10 sidebar">
<ul class="nav nav-sidebar">
<div id="my-calendar"></div>
<?php
include("helpers/calendar.php");
//include("helpers/calendar.php");
// FIXME include("helpers/history.php");
?>
</div>
</form>
</div>
<div id="footer_zone">
</ul>
</div>
</div>
</div>
</form>
<footer>
<?php if($debug) { ?>
<pre>
REQUEST :
......@@ -104,7 +122,23 @@ SESSION :
<?php print_r($_SESSION) ?>
</pre>
<?php } ?>
</div>
</footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/zabuto_calendar.min.js"></script>
<script src="js/functions.js"></script>
<script type="application/javascript">
$(document).ready(function () {
$("#my-calendar").zabuto_calendar({
language: "fr",
today: true,
});
});
/*
TODO : Display calendar events via ajax
See documentation at https://github.com/zabuto/calendar
*/
</script>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
......@@ -16,7 +16,7 @@ This file is part of phpLudoreve.
*/
html,body {
background-color : #bbbbff;
background-color : #bbbbff !important;
color : #552222;
}
......@@ -129,4 +129,4 @@ border-style:none;
}
OPTION.old{background-color:red; color:white}
OPTION.good{background-color:white; color:black}
\ No newline at end of file
OPTION.good{background-color:white; color:black}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment