poleList.php 4.08 KB
Newer Older
Hamza Arfaoui's avatar
Hamza Arfaoui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
<?php
session_start();
if(!isset($_SESSION['auth'])) {
	header("location:index.php");
}

require_once("../inc/confNetisse.php");
require_once("./functions.php");


$DATA = $FILTER = "";
$values = array();
if(isset($_REQUEST["pid"])){
	$FILTER = "AND ca_grappes.id_pole =:id_pole";
	$values[':id_pole'] =intval($_REQUEST['pid']);
}
$q = "SELECT p.id_pole, p.nom_pole, (SELECT count(id_grappe) FROM ca_grappes WHERE id_pole = p.id_pole AND supp IS NULL) as nbGrappes
FROM ca_poles p WHERE p.supp IS NULL ".$FILTER." ORDER BY p.nom_pole ASC";
$result = excuteQuery($q, $values);
$r = $result['stmt'];
while($o = $r->fetchObject()) {
	$DATA .= "<tr>\r\n<td>".$o->nom_pole."</td>\r\n<td><a href='grappeList.php?pid=".$o->id_pole."'>Gérer(".$o->nbGrappes.")</a></td>";
	$DATA .= "\r\n<td><a href='poleUpd.php?pid=".$o->id_pole."' >Editer</a></td>";
}


?>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><?php echo $PROJECT_TITLE;?> : Liste des pôles</title>
	<link rel="stylesheet" href="css/font-awesome.min.css" />
	<link rel="stylesheet" type="text/css" href="css/cadif.css" />
	<link rel="stylesheet" type="text/css" href="css/dashboard.css" />
	<link rel="stylesheet" type="text/css" href="css/cans/jquery-ui-1.8.17.custom.css" />
	<!--<link rel="stylesheet" type="text/css" href="css/tableTools_jui.css" />-->
	<link rel="stylesheet" type="text/css" href="css/datatable_jui.css" />

	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery.dataTables.js"></script>

	<script type="text/javascript">
	$(document).ready( function () {

		oTable = $('#AdminsDataTable').dataTable( {
			"bJQueryUI": true,
			"sPaginationType": "full_numbers",
			"sDom": '<"H"Tfr>t<"F"ip>',

			"oTableTools": {
				"sSwfPath": "./swf/copy_csv_xls_pdf.swf",
				"aButtons": [{"sExtends":    "xls","sButtonText": "Excel"},{"sExtends":    "pdf","sButtonText": "PDF"}]
			},
			"oLanguage": {
				"sProcessing":     "Traitement en cours...",
				"sLengthMenu":     "Afficher _MENU_ &eacute;l&eacute;ments",
				"sZeroRecords":    "Aucun &eacute;l&eacute;ment &agrave; afficher",
				"sInfo":           "Affichage : _START_ &agrave; _END_ sur _TOTAL_ &eacute;l&eacute;ments",
				"sInfoEmpty":      "Affichage de l'&eacute;lement 0 &agrave; 0 sur 0 &eacute;l&eacute;ments",
				"sInfoFiltered":   "(filtr&eacute; de _MAX_ &eacute;l&eacute;ments au total)",
				"sInfoPostFix":    "",
				"sSearch":         "Rechercher&nbsp;/&nbsp;Filtrer&nbsp;:",
				"sLoadingRecords": "T&#233;l&#233;chargement...",
				"sUrl":            "",
				"oPaginate": {
					"sFirst":    "Premier",
					"sPrevious": "Pr&eacute;c&eacute;dent",
					"sNext":     "Suivant",
					"sLast":     "Dernier"
				}
			}


		});

	});
	</script>
</head>


<body>

	<div id="global">
		<div id="home">
			<div id="logo"><a href="dashboard.php"><img src="<?php echo $SERVER; ?>assets/img/logo.png" height="110" border="0"/></a></div>
			<div id="username">
				<b><?php echo isset($_SESSION["nom"]) ? $_SESSION["nom"] : $_SESSION["matricule"];?></b> &nbsp; | &nbsp; <a href="close.php" class="link" title="Fermer et clore votre session">D&#233;connexion</a>
				<br/>
			</div>
		</div>
		<div id="panels">
			<?php include "menu.php";?>
			<div class="main-content">
				<div id="title">
					Liste des pôles
				</div>
				<div>
					<?php if(in_array("add_all_agences",$_SESSION['permissions'])) { ?>
						<a href='poleNew.php' class='formNav2'><i class="fa fa-plus-circle" style="color:#ED1B2F;font-size:150%"></i> <span style="color:#ED1B2F;">Cr&#233;er un nouveau pôle</span></a><br/><br/>
					<?php } ?>
				</div>
				<div id="list">
					<table cellpadding="0" cellspacing="0" border="0" class="display" id="AdminsDataTable">
						<thead>
							<tr>
								<td>Nom</td>
								<td>Grappes</td>
								<td>Actions</td>
							</tr>
						</thead>
						<tbody>
							<?php
							echo $DATA;
							?>
						</tbody>

					</table>

					<br/>

				</div>

			</div>

			<?php include 'footer.php';?>


		</body>

		</html>