<?php
/*********************************************************************************
 * Gest'Ecole is a school management software developped by
 * DOX Conception Copyright (C) 2012-2013 DOX Conception
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the license published by DOX Conception.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY.  See the Software License for more details.
 * 
 * You should have received a copy of the software license along with
 * this program; if not, see:
 * http://www.doxconception.com/index.php/licence-de-gestecole.html
 ********************************************************************************/

  if (!isset($_GET['voircolonne'])) { $_GET['voircolonne']="1"; }
?>
<div class="floatgauche"><button id="colonne_centre" name="colonne_centre"><?php echo $Langue['BTN_PARTIE_CENTRALE']; ?></button>&nbsp;<button id="colonne_droite" name="colonne_droite"><?php echo $Langue['BTN_PARTIE_DROITE']; ?></button></div>
<div class="aide2"><button id="aide_fenetre" name="aide_fenetre"><?php echo $Langue['BTN_AIDE']; ?></button></div>
<div class="ui-widget"><div class="ui-state-highlight ui-corner-all" style="margin-top: 10px; padding: 10px;"><?php echo $Langue['EXPL_AJOUT_PANNEAU']; ?></div></div><br />
<?php if ($_GET['voircolonne']=="1") { ?>
	<div class="ui-widget ui-widget-header ui-corner-all ui-div-separation"><?php echo $Langue['LBL_PANNEAUX_RATTACHES_MODULE']; ?></div>
	<table class=display cellspacing=0 cellpadding=0>
	<tr class="even">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_EMAIL']; ?></label></td>
	  <td class="gauche"><input type="button" id="email" name="email" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('email','5','<?php echo $Langue_JS['LBL_EMAIL_TITRE']; ?>','1')"></td>
	</tr>
	<tr class="odd">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_BIBLIO_P_D']; ?></label></td>
	  <td class="gauche"><input type="button" id="bibliotheque" name="bibliotheque" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('bibliotheque','<?php if ($gestclasse_config_plus['biblio_ecole']=="1") { echo "E"; } else { echo "C"; } ?>|5','<?php echo $Langue_JS['LBL_BIBLIO_TITRE_P_D']; ?>','1')"></td>
	</tr>
	<tr class="even">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_REUNIONS']; ?></label></td>
	  <td class="gauche"><input type="button" id="reunions" name="reunions" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('reunions','L|5','<?php echo $Langue_JS['LBL_REUNIONS_TITRE']; ?>','1')"></td>
	</tr>
	</table>
	<div class="ui-widget ui-widget-header ui-corner-all ui-div-separation ui-div-separation-haut"><?php echo $Langue['LBL_PANNEAUX_INFOS']; ?></div>
	<table class=display cellspacing=0 cellpadding=0>
	<tr class="even">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_NEWS_D']; ?></label></td>
	  <td class="gauche"><input type="button" id="actualites" name="actualites" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('news','T|5','<?php echo $Langue_JS['LBL_NEWS_TITRE2']; ?>','1')"></td>
	</tr>
	<tr class="odd">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_TACHE']; ?></label></td>
	  <td class="gauche"><input type="button" id="taches" name="taches" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('taches','5','<?php echo $Langue_JS['LBL_TACHE_TITRE']; ?>','1')"></td>
	</tr>
	</table>
	<div class="ui-widget ui-widget-header ui-corner-all ui-div-separation ui-div-separation-haut"><?php echo $Langue['LBL_PANNEAUX_EXTERIEUR']; ?></div>
	<table class=display cellspacing=0 cellpadding=0>
	<tr class="even">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_MINISTERE']; ?></label></td>
	  <td class="gauche"><input type="button" id="ministere" name="ministere" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('ministere','M|5','<?php echo $Langue_JS['LBL_MINISTERE_TITRE']; ?>','1')"></td>
	</tr>
	<tr class="odd">
	  <td class="gauche" width=100%><label class="label_detail_non_gras"><?php echo $Langue['EXPL_GESTECOLE']; ?></label></td>
	  <td class="gauche"><input type="button" id="gestecole" name="gestecole" value="<?php echo $Langue['BTN_AJOUTER']; ?>" onClick="Accueil_Ajout_Panneau('gestecole','5|T','<?php echo $Langue_JS['LBL_GESTECOLE_TITRE']; ?>','1')"></td>
	</tr>
	</table>
<?php } else { ?>
	<div class="ui-widget ui-widget-header ui-corner-all ui-div-separation"><?php echo $Langue['LBL_PANNEAUX_LATERAUX']; ?></div>
	<table class=display cellspacing=0 cellpadding=0>
<?php
  $req=mysql_query("SELECT * FROM `modules` WHERE type='subpanel' ORDER BY nom ASC");
	$ligne='even';
	$total=mysql_num_rows($req);
	for ($i=1;$i<=mysql_num_rows($req);$i++)
	{
	  include "accueil/langues/fr-FR_".mysql_result($req,$i-1,"cle").".php";
		if (file_exists("accueil/langues/".$_SESSION['language_application']."_".mysql_result($req,$i-1,"cle").".php"))
		{
	    include "accueil/langues/".$_SESSION['language_application']."_".mysql_result($req,$i-1,"cle").".php";
		}
		echo '<tr class="'.$ligne.'"><td class="gauche" width=100%><label class="label_detail_non_gras">'.$Langue_Panneau['EXPL_PANNEAU'].'</label></td>';
		echo '<td class="gauche"><input type="button" id="bouton_'.$i.'" name="bouton_'.$i.'" value="'.$Langue['BTN_AJOUTER'].'" onClick="Accueil_Ajout_Panneau(\''.mysql_result($req,$i-1,"cle").'\',\''.mysql_result($req,$i-1,"info").'\',\''.mysql_result($req,$i-1,"nom").'\',\'2\')"></td>';
		echo '</tr>';
		if ($ligne=="even") { $ligne="odd"; } else { $ligne="even"; }
	}
?>
	</table>
<?php } ?>
<br />
<script language="Javascript">
$(document).ready(function()
{
  $("#colonne_centre").button();
  $("#colonne_droite").button();
  $("#colonne_centre").click(function()
  {
    Charge_Dialog("index2.php?module=accueil&action=ajouter_panneau&voircolonne=1","<?php echo $Langue_JS['LBL_PERSONNALISER_ACCUEIL']; ?>");
  });  
  $("#colonne_droite").click(function()
  {
    Charge_Dialog("index2.php?module=accueil&action=ajouter_panneau&voircolonne=2","<?php echo $Langue_JS['LBL_PERSONNALISER_ACCUEIL']; ?>");
  });  

  $("#aide_fenetre").button();
  $("#aide_fenetre").click(function(event)
  {
		event.preventDefault();
    window.open("http://www.doxconception.com/index.php/directeur-page-daccueil.html","Aide");
  });
<?php if ($_GET['voircolonne']=="1") { ?>
  $("#email").button();
  $("#bibliotheque").button();
  $("#reunions").button();

  $("#actualites").button();
  $("#taches").button();

  $("#ministere").button();
  $("#gestecole").button();
<?php } else {
  if ($total>0)
	{
		for ($i=1;$i<=$total;$i++)
		{
			echo '$("#bouton_'.$i.'").button();';
		}
	}
}
?>
});
</script>
