index.php 1.28 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
<?php
session_start();
require_once("../inc/confNetisse.php");


$MAT = '';
$IDA = '';
if (isset($_REQUEST["MAT"])) $MAT = $_REQUEST["MAT"];
if (isset($_REQUEST["mat"]) && !empty($_REQUEST["mat"])) $MAT = $_REQUEST["mat"];
if (isset($_REQUEST["matricule"]) && !empty($_REQUEST["matricule"])) $MAT = $_REQUEST["matricule"];
if (isset($_REQUEST["IDA"])) $IDA = $_REQUEST["IDA"];

if ($IDA != '') {
	$redirectionPath = isset($GLOBALS["APP_CONF"]["SIEGE"]) && $GLOBALS["APP_CONF"]["SIEGE"]["ENABLED"] && isset($GLOBALS["APP_CONF"]["SIEGE"]["PATH"]) && !empty($GLOBALS["APP_CONF"]["SIEGE"]["PATH"]) ? $GLOBALS["APP_CONF"]["SIEGE"]["PATH"]."/pile" : "";
	$siege = isset($GLOBALS["BO_CONF"]["AGENCE"]["SIEGE"]) && $GLOBALS["BO_CONF"]["AGENCE"]["SIEGE"] ? true : false;
	if($siege){
		$q = "SELECT siege FROM ca_agences WHERE code_agence=:code AND supp = 0";
		$values = array(':code' => $IDA);
		$result = excuteQuery($q, $values);
		$res = $result['stmt'];
		$o = $res->fetchObject();
		$n = $res->rowCount();
		if(!empty($redirectionPath) && $o->siege == 0){
			if($MAT != ''){
				header("Location:./".$redirectionPath."?IDA=".$IDA."&MAT=".$MAT);  
			}else{
				header("Location:./".$redirectionPath."?IDA=".$IDA);  
			}
		    
		}
	}
}

require_once("functions.php");

// Init pile
pile($SERVER,$PROJECT_TITLE);
?>