Commit 457bc94f authored by Ayolo's avatar Ayolo

j espere que j ai pas fait de la boue dans mon script

parent 0d72bb80
......@@ -27,26 +27,26 @@
include($topdir. "include/site.inc.php");
include($topdir. "include/entities/page.inc.php");
$site = new site ();
$site->start_page("none","Erreur 403");
if ( !$site->user->is_valid() )
{
$cts = new contents("Veuillez vous connecter pour accéder à  la page demandée");
if ( $_SESSION['session_redirect'] )
$cts->add_paragraph("Vous serez automatiquement redirigé vers la page que vous avez demandé.");
$frm = new form("connect2","connect.php",true,"POST","Connexion");
$frm->add_select_field("domain","Connexion",array("utbm"=>"UTBM","assidu"=>"Assidu","id"=>"ID","autre"=>"Autre","alias"=>"Alias"));
$frm->add_text_field("username","Utilisateur","prenom.nom","",27);
$frm->add_password_field("password","Mot de passe","","",27);
$frm->add_submit("connectbtn2","Se connecter");
$cts->add($frm,true);
$cts->add($frm,true);
$site->add_contents($cts);
}
......@@ -57,7 +57,7 @@ else
$site->add_contents(new error("Accés refusé (403)",$_REQUEST['reason']));
else
$site->add_contents(new error("Accés refusé (403)","Vous n'avez pas les droits requis pour accéder à  cette page."));
}
$site->end_page();
}
$site->end_page();
?>
......@@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
/** @file
*
* @brief Page d'erreur HTTP 404
......@@ -30,12 +30,12 @@ Header("HTTP/1.0 404 Not Found");
include($topdir. "include/site.inc.php");
include($topdir. "include/entities/page.inc.php");
$site = new site ();
$site->start_page("none","Erreur 404");
$site->add_contents(new error("Page inconnue (404)","Merci de vérifier le lien que vous avez emprunté"));
$site->end_page();
$site->end_page();
?>
......@@ -35,7 +35,7 @@ if (!$site->user->is_in_group ("gestion_ae"))
$site->start_page("none","Activités");
$req_assos = new requete($site->db, "SELECT asso_parent.id_asso AS id_asso_parent,
asso_parent.nom_asso AS nom_asso_parent,
asso_parent.nom_asso AS nom_asso_parent,
asso.id_asso AS id_asso,
asso.nom_asso AS nom_asso,
utilisateurs_resp.id_utilisateur as id_utilisateur_resp,
......@@ -44,12 +44,12 @@ $req_assos = new requete($site->db, "SELECT asso_parent.id_asso AS id_asso_paren
CONCAT(utilisateurs_tres.nom_utl,' ',utilisateurs_tres.prenom_utl) AS nom_utilisateur_tres
FROM asso
LEFT JOIN asso_membre AS tbl_resp ON (tbl_resp.id_asso=asso.id_asso AND tbl_resp.role='10' AND tbl_resp.date_fin IS NULL)
LEFT JOIN asso_membre AS tbl_tres ON (tbl_tres.id_asso=asso.id_asso AND tbl_tres.role='7' AND tbl_tres.date_fin IS NULL)
LEFT JOIN utilisateurs AS utilisateurs_resp ON tbl_resp.id_utilisateur=utilisateurs_resp.id_utilisateur
LEFT JOIN asso_membre AS tbl_tres ON (tbl_tres.id_asso=asso.id_asso AND tbl_tres.role='7' AND tbl_tres.date_fin IS NULL)
LEFT JOIN utilisateurs AS utilisateurs_resp ON tbl_resp.id_utilisateur=utilisateurs_resp.id_utilisateur
LEFT JOIN utilisateurs AS utilisateurs_tres ON tbl_tres.id_utilisateur=utilisateurs_tres.id_utilisateur
INNER JOIN asso AS asso_parent ON asso.id_asso_parent=asso_parent.id_asso
WHERE asso.id_asso_parent IN (SELECT id_asso FROM asso WHERE id_asso_parent='1')
GROUP BY asso.id_asso
WHERE asso.id_asso_parent IN (SELECT id_asso FROM asso WHERE id_asso_parent='1')
GROUP BY asso.id_asso
ORDER BY asso_parent.nom_asso, asso.nom_asso");
$table = new sqltable("", "Liste des responsables et des trésoriers des activités", $req_assos, "", "",
......
......@@ -38,4 +38,4 @@ else if ( $_REQUEST['action'] == "admin" || $_REQUEST['page'] == "admin" )
header("Location:../asso.php");
exit();
?>
\ No newline at end of file
?>
This diff is collapsed.
......@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
$topdir = "../";
require_once($topdir. "include/site.inc.php");
require_once($topdir."include/cts/board.inc.php");
......@@ -32,7 +32,7 @@ $site = new site ();
if ( !$site->user->is_in_group("moderateur_site") )
$site->error_forbidden();
$site->start_page("none","Tâches courantes Com` AE");
$cts = new contents("Tâches courantes de la Com` AE");
......@@ -46,7 +46,7 @@ $sublist->add("<a href=\"../article.php?name=info:welcome\">Texte d'acceuil pour
$board->add($sublist,true);
$sublist = new itemlist("Modération");
$sublist = new itemlist("Modération");
$req = new requete($site->db,"SELECT COUNT(*) FROM `nvl_nouvelles` WHERE `modere_nvl`='0' ");
list($nbnews) = $req->get_row();
......@@ -80,7 +80,7 @@ else
$board->add($sublist,true);
$sublist = new itemlist("Divers");
$sublist = new itemlist("Divers");
$sublist->add("<a href=\"sondage.php\">Sondages</a>");
$sublist->add("<a href=\"weekmail.php\">Weekmail</a>");
$board->add($sublist,true);
......@@ -88,7 +88,7 @@ $board->add($sublist,true);
$cts->add($board);
$site->add_contents($cts);
$site->end_page();
$site->end_page();
?>
......@@ -35,27 +35,27 @@ if ( !$site->user->is_in_group("gestion_ae") )
if ( isset($_REQUEST["id_election"]))
{
$elec->load_by_id($_REQUEST["id_election"]);
$elec->load_by_id($_REQUEST["id_election"]);
if ( $elec->id < 1 )
{
$site->error_not_found();
exit();
exit();
}
}
if ( $_REQUEST["action"] == "newelec" )
{
if ( !$_REQUEST["name"] )
if ( !$_REQUEST["name"] )
$ErrorElec="Pécisez un nom";
elseif ( $_REQUEST["fin"] <= $_REQUEST["debut"] )
elseif ( $_REQUEST["fin"] <= $_REQUEST["debut"] )
$ErrorElec="Dates et heures invalides";
else
$elec->new_election($_REQUEST["groupid"],$_REQUEST["debut"],$_REQUEST["fin"],$_REQUEST["name"]);
}
}
if ( $elec->id > 0 )
{
if ( $_REQUEST["action"] == "addposte" )
{
if ( !$_REQUEST["name"] )
......@@ -66,20 +66,20 @@ if ( $elec->id > 0 )
elseif ( $_REQUEST["action"] == "addliste" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur_head"]);
if ( !$user->is_valid() && !$user->ae)
$ErrorListe = "Tête de liste erronée ou non cotisante";
elseif ( !$_REQUEST["nom"])
$ErrorListe = "Précisez un nom";
else
{
$rq = $elec->add_liste($user->id,$_REQUEST["nom"]);
$id_liste = $rq->get_id();
$sql = new requete($site->db,"SELECT id_poste FROM vt_postes WHERE id_election='".$elec->id."'");
while ( list($id_poste) = $sql->get_row() )
{
......@@ -90,29 +90,29 @@ if ( $elec->id > 0 )
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
}
}
}
elseif ( $_REQUEST["action"] == "addcandidat" )
{
$user = new utilisateur($site->db);
$user->load_by_id($_REQUEST["id_utilisateur"]);
if ( $user->is_valid() && $user->ae)
{
$id_poste=$_REQUEST["id_poste"];
$id_liste=null;
if ( $_REQUEST["id_liste"] > 0 )
$id_liste=$_REQUEST["id_liste"];
$elec->add_candidat($user->id, $id_poste, $id_liste);
$elec->add_candidat($user->id, $id_poste, $id_liste);
}
else
$ErrorCandidat = "Utilisateur iconnu ou non cotisant";
}
elseif ( $_REQUEST["action"] == "delete" )
{
if ( isset($_REQUEST["id_liste"]) )
$elec->remove_liste($_REQUEST["id_liste"]);
elseif ( isset($_REQUEST["id_poste"]))
......@@ -120,28 +120,28 @@ if ( $elec->id > 0 )
else
{
list($id_poste,$id_utilisateur) = explode(",",$_REQUEST["id_candidature"]);
$elec->remove_candidat($id_utilisateur,$id_poste);
}
}
$site->start_page("none","Election");
$cts = new contents($elec->nom);
$cts->add_paragraph("Election du ".date("d/m/Y H:s",$elec->debut)." au ".date("d/m/Y H:s",$elec->fin));
$cts->add_paragraph("<a href=\"../elections.php?id_election=".$elec->id."&page=results\">Resultats</a>");
$sql = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$postes[$row["id_poste"]] = $row["nom_poste"];
$listes[0] = "Independant";
$listes[0] = "Independant";
$sql = new requete($site->db,"SELECT * FROM vt_liste_candidat WHERE id_election='".$elec->id."'");
while ( $row = $sql->get_row() )
$listes[$row["id_liste"]] = $row["nom_liste"];
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
......@@ -154,15 +154,15 @@ if ( $elec->id > 0 )
"LEFT JOIN `vt_liste_candidat` ON `vt_liste_candidat`.`id_liste`=`vt_candidat`.`id_liste` " .
"WHERE `vt_postes`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_candidat`.`id_poste`,`vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstcand","Candidats",$req,"elections.php?id_election=".$elec->id,"id_candidature",
array("nom_utilisateur"=>"Candidat","nom_poste"=>"Poste","nom_liste"=>"Liste"),
array("delete"=>"Supprimer"),array(),
array());
array());
$cts->add($tbl,true);
$req = new requete($site->db,
"SELECT `utilisateurs`.`id_utilisateur`, " .
"CONCAT(`utilisateurs`.`prenom_utl`,' ',`utilisateurs`.`nom_utl`) as `nom_utilisateur`," .
......@@ -171,33 +171,33 @@ if ( $elec->id > 0 )
"FROM `vt_liste_candidat` " .
"INNER JOIN `utilisateurs` ON `utilisateurs`.`id_utilisateur`=`vt_liste_candidat`.`id_utilisateur` " .
"WHERE `vt_liste_candidat`.`id_election`='".$elec->id."' " .
"ORDER BY `vt_liste_candidat`.`nom_liste`");
"ORDER BY `vt_liste_candidat`.`nom_liste`");
$tbl = new sqltable("lstlst","Listes",$req,"elections.php?id_election=".$elec->id,"id_liste",
array("nom_liste"=>"Nom","nom_utilisateur"=>"Tête de liste"),
array("delete"=>"Supprimer"),array(),
array());
array());
$cts->add($tbl,true);
$req = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
$req = new requete($site->db,"SELECT * FROM vt_postes WHERE id_election='".$elec->id."'");
$tbl = new sqltable("lstpst","Postes",$req,"elections.php?id_election=".$elec->id,"id_poste",
array("nom_poste"=>"Nom du poste","description_poste"=>"Description"),
array("delete"=>"Supprimer"),array(),
array());
array());
$cts->add($tbl,true);
$frm = new form("addposte","elections.php?id_election=".$elec->id,$ErrorPoste!="","POST","Ajouter un poste");
$frm->add_hidden("action","addposte");
if ( $ErrorPoste )
$frm->error($ErrorPoste);
$frm->add_text_field("name","Nom","",true);
$frm->add_text_area("description","Description");
$frm->add_text_field("name","Nom","",true);
$frm->add_text_area("description","Description");
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
$frm = new form("addliste","elections.php?id_election=".$elec->id,$ErrorListe!="","POST","Ajouter une liste");
$frm->add_hidden("action","addliste");
if ( $ErrorListe )
......@@ -211,7 +211,7 @@ if ( $elec->id > 0 )
}
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
if ( count($postes) )
{
$frm = new form("addcandidat","elections.php?id_election=".$elec->id,$ErrorCandidat!="","POST","Ajouter un candidat");
......@@ -219,18 +219,18 @@ if ( $elec->id > 0 )
if ( $ErrorCandidat )
$frm->error($ErrorCandidat);
$frm->add_entity_smartselect("id_utilisateur",
"Candidat",
"Candidat",
new utilisateur($site->db));
$frm->add_select_field("id_poste","Poste",$postes);
$frm->add_select_field("id_liste","Liste",$listes);
$frm->add_submit("save","Ajouter");
$cts->add($frm,true);
}
$site->add_contents($cts);
$site->end_page();
$site->end_page();
exit();
}
......@@ -240,10 +240,10 @@ $frm = new form("newelec","elections.php",true,"POST","Organiser une élection")
$frm->add_hidden("action","newelec");
if ( $ErrorElec )
$frm->error($ErrorElec);
$frm->add_text_field("name","Nom","",true);
$frm->add_text_field("name","Nom","",true);
$frm->add_datetime_field("debut","Date et heure de début",-1,true);
$frm->add_datetime_field("fin","Date et heure de fin",-1,true);
$frm->add_entity_select("groupid","Groupe electeur",$site->db,"group" );
$frm->add_entity_select("groupid","Groupe electeur",$site->db,"group" );
$frm->add_submit("save","Ajouter");
$site->add_contents($frm);
......@@ -256,6 +256,6 @@ $tbl = new sqltable("lstelecs","Elections",$sql,"elections.php","id_election",
$site->add_contents($tbl);
$site->end_page();
$site->end_page();
?>
......@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
$topdir = "../";
require_once($topdir. "include/site.inc.php");
require_once($topdir."include/cts/board.inc.php");
......@@ -31,14 +31,14 @@ $site = new site ();
if ( !$site->user->is_in_group("gestion_ae") )
$site->error_forbidden("none","group","gestion_ae");
$site->start_page("none","Tâches courantes AE");
$cts = new contents("Tâches courantes AE");
$board = new board();
$sublist = new itemlist("Pret matériel");
$sublist = new itemlist("Pret matériel");
$sublist->add("<a href=\"../emprunt.php\">Reserver du matériel</a>");
$sublist->add("<a href=\"../emprunt.php?page=retrait\">Preter du matériel</a> (retrait immédiat)");
$sublist->add("<a href=\"modereemp.php?view=togo\">Retrait matériel</a>");
......@@ -47,35 +47,35 @@ $sublist->add("<a href=\"../emprunt.php?page=retour\">Retour de matériel</a>");
$board->add($sublist,true);
$sublist = new itemlist("Salles");
$sublist = new itemlist("Salles");
$sublist->add("<a href=\"".$topdir."salle.php?page=reservation\">Reserver une salle</a>");
$sublist->add("<a href=\"".$topdir."ae/modereres.php\">Modération des reservations de salle</a>");
$board->add($sublist,true);
$sublist = new itemlist("Carte AE");
$sublist = new itemlist("Carte AE");
$sublist->add("<a href=\"cartesae.php?view=retrait\">Retrait carte AE (+ cadeau)</a>");
$sublist->add("<a href=\"cartesae.php?view=bureau\">Arrivée cartes AE au bureau</a>");
$sublist->add("<a href=\"cartesae.php\">Impression cartes AE</a>");
$board->add($sublist,true);
$sublist = new itemlist("Cotisations");
$sublist = new itemlist("Cotisations");
$sublist->add("<a href=\"cotisations.php#newstudent\">Nouvelle cotisation</a>");
$sublist->add("<a href=\"cotisations.php\">Renouvellement cotisation/consultation</a> (Possible aussi depuis la fiche utilisateur)");
$board->add($sublist,true);
$sublist = new itemlist("Inventaire");
$sublist = new itemlist("Inventaire");
$sublist->add("Ajout matériel");
$sublist->add("Types d'objet");
$sublist->add("Batiments/Salles");
$board->add($sublist,true);
$sublist = new itemlist("Elections");
$sublist = new itemlist("Elections");
$sublist->add("<a href=\"elections.php\">Organiser une election</a>");
$sublist->add("<a href=\"elections.php\">Modifier/Consulter une election</a>");
$board->add($sublist,true);
$sublist = new itemlist("Divers");
$sublist = new itemlist("Divers");
$sublist->add("<a href=\"activites.php\">Listing des responsables et des trésoriers des activités</a>");
$sublist->add("<a href=\"".$topdir."asso/sendfax.php?id_asso=1\">Envoyer des fax</a>");
$board->add($sublist,true);
......@@ -83,7 +83,7 @@ $board->add($sublist,true);
$cts->add($board);
$site->add_contents($cts);
$site->end_page();
$site->end_page();
?>
......@@ -25,7 +25,7 @@
* @see include/entities/files.inc.php
* @see include/entities/folder.inc.php
*/
$topdir="../";
require_once($topdir."include/site.inc.php");
require_once($topdir . "include/cts/sqltable.inc.php");
......@@ -37,57 +37,57 @@ $site = new site ();
if ( !$site->user->is_in_group("moderateur_site") )
$site->error_forbidden();
if ( $_REQUEST["action"] == "foldermodere")
if ( $_REQUEST["action"] == "foldermodere")
{
$fl = new dfolder($site->db,$site->dbrw);
foreach ($_REQUEST["id_folders"] as $id)
foreach ($_REQUEST["id_folders"] as $id)
{
$fl->load_by_id($id);
if ( $fl->id > 0 )
if ( $fl->id > 0 )
$fl->set_modere();
}
}
}
elseif ( $_REQUEST["action"] == "folderdelete")
elseif ( $_REQUEST["action"] == "folderdelete")
{
$fl = new dfolder($site->db,$site->dbrw);
foreach ($_REQUEST["id_folders"] as $id)
foreach ($_REQUEST["id_folders"] as $id)
{
$fl->load_by_id($id);
if ( $fl->id > 0 )
if ( $fl->id > 0 )
$fl->delete_folder();
}
}
}
elseif ( $_REQUEST["action"] == "filemodere")
elseif ( $_REQUEST["action"] == "filemodere")
{
$fl = new dfile($site->db,$site->dbrw);
foreach ($_REQUEST["id_files"] as $id)
foreach ($_REQUEST["id_files"] as $id)
{
$fl->load_by_id($id);
if ( $fl->id > 0 )
if ( $fl->id > 0 )
$fl->set_modere();
}
}
}
elseif ( $_REQUEST["action"] == "filedelete")
elseif ( $_REQUEST["action"] == "filedelete")
{
$fl = new dfile($site->db,$site->dbrw);
foreach ($_REQUEST["id_files"] as $id)
foreach ($_REQUEST["id_files"] as $id)
{
$fl->load_by_id($id);
if ( $fl->id > 0 )
if ( $fl->id > 0 )
$fl->delete_file();
}
}
}
$site->start_page("none","Modération des fichiers");
$cts = new contents("Modération");
$cts = new contents("Modération");
$req = new requete($site->db,"SELECT * " .
"FROM d_folder " .
"WHERE " .
"modere_folder='0'");
"modere_folder='0'");
$tbl = new sqltable("modfolders",
"Dossiers à modérer",
$req,
......@@ -99,14 +99,14 @@ $tbl = new sqltable("modfolders",
array("foldermodere" => "Accepter",
"folderdelete" => "Supprimer"),
array());
$cts->add($tbl,true);
$cts->add($tbl,true);
$req = new requete($site->db,"SELECT * " .
"FROM d_file " .
"WHERE " .
"modere_file='0'");
"modere_file='0'");