Commit f52aa59d authored by mbriand's avatar mbriand

Résa bar...

parent 569be3ea
......@@ -224,7 +224,7 @@ if($site->user->is_in_group("gestion_ae"))
"asso.id_asso, asso.nom_asso," .
"sl_reservation.id_salres, sl_reservation.date_debut_salres," .
"sl_reservation.date_fin_salres, sl_reservation.description_salres, " .
"sl_reservation.date_accord_res," .
"sl_reservation.date_accord_res, sl_reservation.util_bar_salres," .
"(sl_reservation.convention_salres*10+sl_salle.convention_salle) as `convention` " .
"FROM sl_reservation " .
"INNER JOIN utilisateurs ON `utilisateurs`.`id_utilisateur`=sl_reservation.id_utilisateur " .
......@@ -245,11 +245,12 @@ if($site->user->is_in_group("gestion_ae"))
"date_debut_salres"=>"De",
"date_fin_salres"=>"A",
"description_salres" => "Motif",
"util_bar_salres" => "Bar",
"date_accord_res"=>"Accord le"
),
array("info"=>"Details"),
array(),
array()
array("util_bar_salres"=>array(1=>"Non", 2=>"Oui", 3=>"BDF"))
));
}
......
......@@ -35,19 +35,19 @@ $bat = new batiment($site->db,$site->dbrw);
$bat->load_by_id($_REQUEST["id_batiment"]);
if ( $bat->id < 1 )
{
$site->error_not_found();
exit();
$site->error_not_found();
exit();
}
$sitebat->load_by_id($bat->id_site);
if ( $_REQUEST["action"] == "addsalle" )
{
if ($_REQUEST["nom"] != "" && $_REQUEST["etage"] != "")
{
$salle = new salle($site->db,$site->dbrw);
$salle->add ( $bat->id, $_REQUEST["nom"], $_REQUEST["etage"], $_REQUEST["fumeur"], $_REQUEST["convention"], $_REQUEST["reservable"], $_REQUEST["surface"], $_REQUEST["tel"], $_REQUEST["notes"] );
}
if ($_REQUEST["nom"] != "" && $_REQUEST["etage"] != "")
{
$salle = new salle($site->db,$site->dbrw);
$salle->add ( $bat->id, $_REQUEST["nom"], $_REQUEST["etage"], $_REQUEST["fumeur"], $_REQUEST["convention"], $_REQUEST["reservable"], $_REQUEST["surface"], $_REQUEST["tel"], $_REQUEST["notes"], $_REQUEST['bar_bdf'] );
}
}
$site->start_page("none","Batiment ".$bat->nom);
......@@ -57,29 +57,30 @@ $cts->add_paragraph("Voir aussi : <a href=\"sitebat.php\">Autre sites</a>");
$req = new requete($site->db,"SELECT * FROM `sl_salle` WHERE `id_batiment`='".$bat->id."'");
$tbl = new sqltable(
"listsalles",
"Salles", $req, "batiment.php?id_batiment=".$bat->id,
"id_salle",
array("nom_salle"=>"Salle","etage"=>"Etage"),
array(), array(),array()
);
"listsalles",
"Salles", $req, "batiment.php?id_batiment=".$bat->id,
"id_salle",
array("nom_salle"=>"Salle","etage"=>"Etage"),
array(), array(),array()
);
$cts->add($tbl,true);
if ( $site->user->is_in_group("gestion_ae") )
{
$frm = new form("newsalle","batiment.php?id_batiment=".$bat->id,true,"POST","Nouvelle salle");
$frm->add_hidden("action","addsalle");
$frm->add_text_field("nom","Nom","",true);
$frm->add_text_field("etage","Etage","",true);
$frm->add_checkbox("fumeur","Fumeur",$bat->fumeur);
$frm->add_checkbox("convention","Convention de locaux",$bat->convention);
$frm->add_checkbox("reservable","Reservable");
$frm->add_text_field("surface","Surface");
$frm->add_text_field("tel","Téléphone");
$frm->add_text_area("notes","Notes");
$frm->add_submit("valid","Ajouter");
$cts->add($frm,true);
$frm = new form("newsalle","batiment.php?id_batiment=".$bat->id,true,"POST","Nouvelle salle");
$frm->add_hidden("action","addsalle");
$frm->add_text_field("nom","Nom","",true);
$frm->add_text_field("etage","Etage","",true);
$frm->add_checkbox("fumeur","Fumeur",$bat->fumeur);
$frm->add_checkbox("convention","Convention de locaux",$bat->convention);
$frm->add_checkbox("bar_bdf","La salle contient un bar géré par le BDF",false);
$frm->add_checkbox("reservable","Reservable");
$frm->add_text_field("surface","Surface");
$frm->add_text_field("tel","Téléphone");
$frm->add_text_area("notes","Notes");
$frm->add_submit("valid","Ajouter");
$cts->add($frm,true);
}
$site->add_contents($cts);
$site->end_page();
......
This diff is collapsed.
......@@ -146,14 +146,14 @@ if ( $salle->is_valid() )
{
list($debut,$fin) = explode(":",$seq);
if ( $resa->add ( $salle->id, $site->user->id, $id_asso, $debut, $fin, $_REQUEST['description'] ) )
if ( $resa->add ( $salle->id, $site->user->id, $id_asso, $debut, $fin, $_REQUEST['description'], $_REQUEST['util_bar'] ) )
{
$result->add("Le ".textual_plage_horraire($debut,$fin));
}
}
}
else if ( !$_REQUEST['debut'] || !$_REQUEST['fin']||!$_REQUEST['description'] )
else if ( !$_REQUEST['debut'] || !$_REQUEST['fin'] || !$_REQUEST['description'] || !$_REQUEST['util_bar'])
{
$_REQUEST["action"] = "reservation";
$ErreurResa = "Incomplet";
......@@ -173,6 +173,7 @@ if ( $salle->is_valid() )
$frm->add_hidden("action","reserver");
$frm->add_hidden("description",$_REQUEST['description']);
$frm->add_hidden("id_asso",$id_asso);
$frm->add_hidden("util_bar", $_REQUEST['util_bar']);
$h = intval(date("H",$_REQUEST["debut"]));
for($debut=$_REQUEST["debut"];$debut<$_REQUEST["until"];$debut+=60*60*24*7)
......@@ -206,7 +207,7 @@ if ( $salle->is_valid() )
$_REQUEST["action"] = "reservation";
}
else
$resa->add ( $salle->id, $site->user->id, $id_asso, $_REQUEST['debut'], $_REQUEST['fin'], $_REQUEST['description'] );
$resa->add ( $salle->id, $site->user->id, $id_asso, $_REQUEST['debut'], $_REQUEST['fin'], $_REQUEST['description'], $_REQUEST['util_bar'] );
......@@ -237,6 +238,8 @@ if ( $salle->is_valid() )
$frm->add_entity_select("id_asso", "Association", $site->db, "asso",$_REQUEST["id_asso"],true);
$frm->add_checkbox("allweeks","Toutes les semaines ...");
$frm->add_datetime_field("until","... jusqu'au");
if ( $salle->bar_bdf )
$frm->add_select_field("util_bar", "Utilisation du bar", array(1=>"Je n'utilise pas le bar", 2=>"J'utilise le bar", 3=>"Je laisse les barmens BDF tenir le bar"), 0, "", true);
$frm->add_submit("valide","Demander");
$cts->add($frm,true);
......
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