| Current Path : /home/happyrenas/old/happy-r.fr/transfere_pro/administration/templates/admin2/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/old/happy-r.fr/transfere_pro/administration/templates/admin2/calendrier.php |
<?
session_start();
include("config.php");
$page="mesreservations";
$logement_id=$_REQUEST['logement_id'];
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="fr">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title>HAPPY RENTALS ADMINISTRATION</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css"/>
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN THEME STYLES -->
<link href="../../assets/global/css/components.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout2/css/layout.css" rel="stylesheet" type="text/css"/>
<link id="style_color" href="../../assets/admin/layout2/css/themes/default.css" rel="stylesheet" type="text/css"/>
<link href="../../assets/admin/layout2/css/custom.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="favicon.ico"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
<body class="page-boxed page-header-fixed page-container-bg-solid page-sidebar-closed-hide-logo " style="background-color:#FF7311;">
<!-- BEGIN HEADER -->
<?include("header_top.php");?>
<!-- END HEADER -->
<div class="clearfix">
</div>
<div class="container">
<!-- BEGIN CONTAINER -->
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
<!-- DOC: Set data-auto-scroll="false" to disable the sidebar from auto scrolling/focusing -->
<!-- DOC: Change data-auto-speed="200" to adjust the sub menu slide up/down speed -->
<div class="page-sidebar navbar-collapse collapse">
<?include("header_left.php");?>
</div>
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
<?
$myquerytitre = "SELECT label from logement where id=".$logement_id;
$marequetetitre = $db->get_row($myquerytitre);
?>
Mes réservations <small> <?echo $marequetetitre->label?></small>
</h3>
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<i class="fa fa-home"></i>
<a href="index.php">Accueil</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
<a href="#">Mes réservations</a>
</li>
</ul>
<div class="page-toolbar">
<div class="page-toolbar">
<div class="btn-group pull-right">
<a href="reservation_ajout.php?logement_id=<?echo $logement_id;?>">
<button type="button" class="btn blue">
Nouvelle réservation
</button>
</a>
</div>
</div>
</div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<?
// SUPPRESSION
if ($_GET['action']=='delete' && $logement_id)
{
$requete="DELETE FROM reservation WHERE ID=".$_GET['id'];
$db->query($requete);
$type_message="info";
$type_message="danger";
$type_message="warning";
$type_message="success";
$titre_message="Mise à jour effectuée";
$texte_message="La suppression est validée";
echo "
<div class='portlet-body'>
<div class='note note-$type_message'>
<h4 class='block'>$titre_message</h4>
<p>$texte_message</p>
</div>
</div>
";
}
// MODIF
if ($_GET['n']!='' && $logement_id)
{
$requete="UPDATE reservation set is_remboursement =".$_GET['n']." where id =".$_GET['reservation_id'];
//echo $requete;
$db->query($requete);
$type_message="info";
$type_message="danger";
$type_message="warning";
$type_message="success";
$titre_message="Mise à jour effectuée";
$texte_message="La modification est validée";
echo "
<div class='portlet-body'>
<div class='note note-$type_message'>
<h4 class='block'>$titre_message</h4>
<p>$texte_message</p>
</div>
</div>
";
}
?>
<div class="row">
<div class="col-md-6">
<!-- BEGIN SAMPLE TABLE PORTLET-->
<div class="portlet box blue-hoki">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i>Calendrier
</div>
<div class="tools">
<a href="javascript:;" class="reload">
</a>
</div>
</div>
<div class="portlet-body">
<!--CALENDRIER GAUCHE-->
<?php
$monthNames = Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet","Aout", "Septembre", "Octobre", "Novembre", "Decembre");
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];
$prev_year = $cYear;
$next_year = $cYear;
$prev_month = $cMonth-1;
$next_month = $cMonth+1;
if ($prev_month == 0 ) {
$prev_month = 12;
$prev_year = $cYear - 1;
}
if ($next_month == 13 ) {
$next_month = 1;
$next_year = $cYear + 1;
}
?>
<table width="450">
<tr align="center">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" align="left"><a href="<?php echo $_SERVER["PHP_SELF"] . "?logement_id=$logement_id&month=". $prev_month . "&year=" . $prev_year; ?>" > <button type="button" class="btn btn-default"><i class="fa fa-angle-double-left"></i></button></a></td>
<td width="80%" align="center"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></a></td>
<td width="10%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?logement_id=$logement_id&month=". $next_month . "&year=" . $next_year; ?>"><button type="button" class="btn btn-default"><i class="fa fa-angle-double-right"></i></button> </a></td>
</tr>
</table><br>
</td>
</tr>
<tr>
<td align="center">
<table class="table table-bordered table-hover">
<tr>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>D</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>L</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>J</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>V</strong></td>
<td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td>
</tr>
<?php
/*
$ladate="2014-12-10";
$myquery = "SELECT id from reservation where id_logement=$logement_id AND date1<='$ladate' AND date2>='$ladate'";
$marequete = $db->get_row($myquery);
echo $myquery;
echo $marequete->id;
*/
if ($marequete->id) {echo "ok";}
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++)
{
if(($i % 7) == 0 ) echo "<tr>";
if($i < $startday) echo "<td></td>";
else
{
$ladate=$cYear."-".($cMonth)."-".($i - $startday + 1);
$myquery = "SELECT id,statut from reservation where id_logement=$logement_id AND date1<='$ladate' AND date2>='$ladate'";
$marequete = $db->get_row($myquery);
//echo $myquery."<br>";
echo "<td align='center' valign='middle' height='20px'>";
if ($marequete->id && $marequete->statut==1) {echo "<span class='label label-info'>";}
if ($marequete->id && $marequete->statut==3) {echo "<span class='label label-success'>";}
if ($marequete->id && $marequete->statut==4) {echo "<span class='label label-danger'>";}
if ($marequete->id && $marequete->statut==5) {echo "<span class='label label-success'>";}
if ($marequete->id && $marequete->statut==8) {echo "<span class='label label-warning'>";}
if ($marequete->id && $marequete->statut==9) {echo "<span class='label label-danger'>";}
echo ($i - $startday + 1);
echo "</span></td>";
//echo $ladate;
//echo "</td>";
}
if(($i % 7) == 6 ) echo "</tr>";
}
?>
</table>
</td>
</tr>
</table>
<!--FIN CALENDRIER GAUCHE-->
</div>
</div>
<!-- END SAMPLE TABLE PORTLET-->
</div>
<!--
<div class="portlet box green-meadow">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-rocket"></i>Liste globale de vos réservations
</div>
<div class="tools">
<a href="javascript:;" class="collapse">
</a>
<a href="javascript:;" class="reload">
</a>
<a href="javascript:;" class="remove">
</a>
</div>
</div>
<div class="portlet-body">
<table class="table table-bordered table-hover">
<tr>
<th></th>
<th>Début</th>
<th>Fin</th>
<th></th>
</tr>
<?
$myquery = "SELECT id,date1,date2 from reservation where id_logement=$logement_id and (statut=1 || statut=3) order by date1";
//echo $myquery;
$site_calls = $db->get_results($myquery);
if (!empty($site_calls))
{
foreach ( $site_calls as $call )
{
echo "<tr>";
echo "<td align='center'><a onclick=\"return confirm('Vous confirmez la suppression?' )\" href='calendrier.php?action=delete&id=$call->id&logement_id=$logement_id&month=$cMonth&year=$cYear'><i class='fa fa-trash-o'></i></a></td>";
echo "<td>". date("d-m-Y", strtotime($call->date1))."</td>";
echo "<td>". date("d-m-Y", strtotime($call->date2))."</td>";
echo "<td><a href='contrat.php?reservation_id=".$call->id."'>contrat</a></td>";
echo "</tr>";
}
}
?>
</table>
</div>
</div>
</div>
-->
<div class="col-md-6">
<!-- BEGIN BORDERED TABLE PORTLET-->
<div class="portlet box yellow">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-rocket"></i>Supprimer vos indisponibilités
</div>
<div class="tools">
<a href="javascript:;" class="collapse">
</a>
<a href="javascript:;" class="reload">
</a>
<a href="javascript:;" class="remove">
</a>
</div>
</div>
<div class="portlet-body">
<!--CALENDRIER DROITE-->
<table class="table table-bordered table-hover">
<tr>
<th></th>
<th>Début</th>
<th>Fin</th>
</tr>
<?
$myquery = "SELECT id,date1,date2 from reservation where id_logement=$logement_id and (statut=8 || statut=9) order by date1";
//echo $myquery;
$site_calls = $db->get_results($myquery);
if (!empty($site_calls))
{
foreach ( $site_calls as $call )
{
echo "<tr>";
echo "<td align='center'><a onclick=\"return confirm('Vous confirmez la suppression?' )\" href='calendrier.php?action=delete&id=$call->id&logement_id=$logement_id&month=$cMonth&year=$cYear'><i class='fa fa-trash-o'></i></a></td>";
echo "<td>". date("d-m-Y", strtotime($call->date1))."</td>";
echo "<td>". date("d-m-Y", strtotime($call->date2))."</td>";
echo "</tr>";
}
}
?>
</table>
<!--FIN CALENDRIER DROITE-->
</div>
</div>
</div>
<!--SYNTHESE GLOBALE-->
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box grey-cascade">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-globe"></i>Synthèse des réservations
</div>
<div class="tools">
<a href="javascript:;" class="collapse">
</a>
<a href="javascript:;" class="reload">
</a>
</div>
</div>
<div class="portlet-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th class="table-checkbox">
<input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
</th>
<th>Du</th>
<th>Au</th>
<th>Logement</th>
<th>Client</th>
<th>Montant</th>
<th>Assurance<br>annulation</th>
<th>Statut</th>
<th colspan="1">Contrat</th>
<th> </th>
</tr>
</thead>
<tbody>
<?
$myquery = "SELECT * from reservation where id_logement=$logement_id AND (statut=1 || statut=3 || statut=4) order by date1";
//echo $myquery;
$site_calls = $db->get_results($myquery);
if (!empty($site_calls))
{
foreach ( $site_calls as $call )
{
$myquery = "SELECT label from logement where id=$call->id_logement";
$logement = $db->get_row($myquery);
$macouleur="";
$montexte="";
if ($mois_ancien && $mois_ancien!=date("m", strtotime($call->date1))) {echo "<tr class='odd gradeX'><td colspan=11 style='background-color:#95A5A6;'> </td></tr>";}
?>
<tr class="odd gradeX">
<td><input type="checkbox" class="checkboxes" value="1"/></td>
<td><?echo date("d-m-Y", strtotime($call->date1));?></td>
<td><?echo date("d-m-Y", strtotime($call->date2));?></td>
<td><?echo $logement->label;?></td>
<td><a href="#"><?echo $call->mail;?></a></td>
<td class="center"><?echo $call->tarif;?></td>
<td><?echo $call->assurance_annulation;?></td>
<?if ($call->statut=='1') {$macouleur="info";$montexte="Demandée";}?>
<?if ($call->statut=='3') {$macouleur="success";$montexte="Validée";}?>
<?if ($call->statut=='4') {$macouleur="danger";$montexte="Payée";}?>
<td><span class="label label-sm label-<?echo $macouleur;?>"><?echo $montexte;?></span>
<?
if ($_SESSION['statut']==10 && $call->statut=='4')
{
echo "<span class='label label-sm label-danger'>".$call->paymentid." </span>| ";
if ($call->is_remboursement==1) {echo "<a onclick=\"return confirm('Vous confirmez l annulation du remboursement automatique ?' )\" href='calendrier.php?logement_id=$logement_id&reservation_id=$call->id&n=0'>oui</a>";} else {echo "<a onclick=\"return confirm('Vous confirmez la mise en place du remboursement automatique?' )\" href='calendrier.php?logement_id=$logement_id&reservation_id=$call->id&n=1'>non</a>";}
}
?></td>
<!--<td><i class="fa fa-print"></i></td>-->
<td align="center"><a target="_blank" href="contrat.php?reservation_id=<?echo $call->id;?>"><i class="fa fa-file-pdf-o"></i> Contrat</a></td>
<td><a onclick="return confirm('Vous confirmez la suppression?' )" href="calendrier.php?logement_id=<?echo $logement_id;?>&id=<?echo $call->id;?>&action=delete"><i class="fa fa-trash-o"></i></a></td>
</tr>
<?
$mois_ancien=date("m", strtotime($call->date1));
}
}
?>
</tbody>
</table>
</div>
<span class="label label-sm label-info">Réservation demandée</span>
<span class="label label-sm label-success">Réservation validée</span>
<span class="label label-sm label-danger">Réservation payée</span>
<span class="label label-sm label-warning">Indisponible</span>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
<!--SYNTHESE GLOBALE-->
</div>
<!-- END BORDERED TABLE PORTLET-->
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- BEGIN QUICK SIDEBAR -->
<!--Cooming Soon...-->
<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="page-footer">
<div class="page-footer-inner">
2014 © P.J
</div>
<div class="scroll-to-top">
<i class="icon-arrow-up"></i>
</div>
</div>
<!-- END FOOTER -->
</div>
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="../../assets/global/plugins/respond.min.js"></script>
<script src="../../assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
<script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="../../assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<script src="../../assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="../../assets/admin/layout2/scripts/layout.js" type="text/javascript"></script>
<script src="../../assets/admin/layout2/scripts/demo.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
// initiate layout and plugins
Metronic.init(); // init metronic core components
Layout.init(); // init current layout
Demo.init(); // init demo features
});
</script>
</body>
<!-- END BODY -->
</html>