Exemple #1
0
<?php

ini_set("display_errors", "1");
session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
//we extract the get parameters
extract($_GET);
//import of the differents files
include '../libs/php/globalInfos.php';
$gb = new globalInfos();
$gb->requireModel($table);
//the model for the current page
$myTools = new myTools();
include '../libs/php/inclusion_' . $table . '.php';
//file that instanciate the differents models
$globalInfosClass = new globalInfos();
$gb->setGlobalXmlConfig(simplexml_load_file("../config/global_config.xml"));
//this variable contains the title for the form ( edit or add )
$titre = $mode == "edit" ? $gb->getGlobalInfoForNodeAndTable("global_edit_title_label", $table) : $gb->getGlobalInfoForNodeAndTable("global_add_title_label", $table);
//if we are in edit mode , we init the model with the saved values
if ($mode == "edit") {
    $oneElement->initFromDatas(array($datasManager->getPrimaryKey() => $id));
} else {
    $id = 'aucun';
    /*if(isset($_SESSION['hierarchy']["filter"]) && count($_SESSION['hierarchy']["filter"])>0)
    	{
    		$initDatas=array();
    		foreach($_SESSION['hierarchy']["filter"] as $filter=>$value)
    		{
<?php

ini_set("display_errors", "1");
session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
//we extract the get parameters
//extract($_GET);
if (isset($_GET['parentClass']) && isset($_GET['childClass']) && isset($_GET['idParent'])) {
    include 'libs/php/globalInfos.php';
    //global info class, very usefull
    $gb = new globalInfos();
    $gb->requireModel($_GET['childClass']);
    $modelChild = $gb->getModelInstance($_GET['childClass']);
    $_SESSION['pushHierarchy'] = array();
    $_SESSION['pushHierarchy']["filter"] = array();
    $_SESSION['pushHierarchy']['parentClass'] = $_GET['parentClass'];
    $_SESSION['pushHierarchy']['childClass'] = $_GET['childClass'];
    //$_SESSION['pushHierarchy']['ariane']="<a href="
    //$_SESSION['pushHierarchyFilter']
    foreach ($modelChild->arrayRelations as $key => $value) {
        if ($value['assoc_table'] == $_GET['parentClass']) {
            $_SESSION['pushHierarchy']['filter'][$key] = $_GET['idParent'];
        }
    }
    //echo "<pre>";var_dump($_SESSION['pushHierarchy']);exit;
    header('Location: index.php?page=' . $_GET['childClass']);
}
//$_SESSION['parentClass']
Exemple #3
0
<?php

//import of differents files
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
if (file_exists("components/custom/" . $page . ".php")) {
    require_once "components/custom/" . $page . ".php";
} else {
    $globalInfosClass = new globalInfos();
    $globalInfosClass->requireModel($page);
    //the model
    include 'libs/php/inclusion_' . $page . '.php';
    //the file that instanciate the model, creates $datasManager and $oneElement
    $xml = $oneElement->getXmlConfig();
    $myTools = new myTools();
    $globalInfosClass->setGlobalXmlConfig(simplexml_load_file("config/global_config.xml"));
    $globalInfosClass->setGlobalXmlHierarchy(simplexml_load_file("config/hierarchy.xml"));
    $hierarchyInfos = $globalInfosClass->getHierarchyInfos($page, isset($_SESSION['hierarchy']) ? $_SESSION['hierarchy'] : false);
    //we get the session if  exist, and turn it into a json object
    if (isset($_SESSION['searchFilters'][$page])) {
        $sessionJson = json_encode($_SESSION['searchFilters'][$page]);
    }
    ?>
	<!-- container -->
	
	<div class="container" id="content">
		  <div id="ariane"><?php 
    if ($hierarchyInfos['ariane']) {
        echo $hierarchyInfos['ariane'];
    }