<?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']
<?php

session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
ini_set("display_errors", "1");
//we extract the differents parameters
extract($_POST);
//parameters list
/*
 *table:name of the concerned table
 *mode:saving mode
 *id:id of the element if in edit mode
 *params:an array containing the different parameters
 */
//import of differents files
include '../libs/php/globalInfos.php';
$gb = new globalInfos();
$gb->requireModel($table);
include '../libs/php/inclusion_' . $table . '.php';
//the file that instanciate the model
//we empty the session datas
$_SESSION['searchFilters'][$table] = $params;
echo json_encode(array("result" => "ok"));
Example #3
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)
    		{
Example #4
0
<?php

session_start();
ini_set("display_errors", "1");
include 'libs/php/globalInfos.php';
//global info class, very usefull
$gb = new globalInfos();
$gb->setGlobalXmlConfig(simplexml_load_file("config/global_config.xml"));
if (isset($_SESSION['connected'])) {
    header('Location: index.php');
}
if (isset($_POST['login']) && isset($_POST['mdp'])) {
    if ($_POST['login'] == (string) $gb->getGlobalInfoForNodeAndTable("global_login") && $_POST['mdp'] == (string) $gb->getGlobalInfoForNodeAndTable("global_password")) {
        $_SESSION['connected'] = "ok";
        header('Location: index.php');
    } else {
        $errorMessage = $gb->getGlobalInfoForNodeAndTable("global_wrong_login");
    }
    //header('Location: auth.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
	   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <!-- import of the differents js ans css files -->
	    <link rel="stylesheet" type="text/css" href="css/main.css"/>
	    <link rel="stylesheet" type="text/css" href="libs/bootstrap/css/bootstrap.min.css"/>
	    <link rel="stylesheet" type="text/css" href="libs/js/editableGrid/editablegrid-2.0.1.css"/>
	    <link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.9.2.custom.min.css"/>
ini_set("display_errors", "1");
session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
//we extract the differents parameters
extract($_POST);
//parameters list
/*
 *table:name of the concerned table
 *
 */
//import of differents files
include '../libs/php/globalInfos.php';
$gb = new globalInfos();
$gb->requireModel($table);
$md = $gb->getModelInstance($table);
$xml = $md->getXmlConfig();
$arrayResult = array();
$need = "no";
$index = 0;
$incre = 0;
foreach ($xml as $key => $child) {
    if ($child['isGridVisible'] == 'true' || $child['isPrimaryKey'] == 'true' && $child['isGridVisible'] == 'false') {
        if ($child['isPrimaryKey'] == 'true' && $child['isGridVisible'] == 'false') {
            $need = "yes";
            $index = $incre;
        }
        $incre++;
    }
Example #6
0
$pages = array();
foreach ($datas->aMenu as $menu) {
    $pages[] = (string) $menu['tableName'];
}
//we create a page variable that will contains the name of the current page
$page;
if (isset($_GET['page'])) {
    if (in_array($_GET['page'], $pages)) {
        $page = $_GET['page'];
    } else {
        $page = $pages[0];
    }
} else {
    $page = $pages[0];
}
$globalInfosClass = new globalInfos();
$globalInfosClass->setGlobalXmlConfig(simplexml_load_file("config/global_config.xml"));
?>
<!-- container of the header -->
<div class="navbar navbar-inverse navbar-fixed-top" id="headerDiv">
      <div class="navbar-inner">
        <div class="container">
          
          <div class="nav-collapse collapse">
            <ul class="nav" id="menuDiv">
              <?php 
foreach ($datas->aMenu as $menu) {
    if (strlen((string) $menu['displayName']) > 0) {
        ?>
 <li <?php 
        if ($page == $menu['tableName']) {
Example #7
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'];
    }
Example #8
0
session_start();
if (!isset($_SESSION['connected'])) {
    header('Location: auth.php');
}
ini_set("display_errors", "1");
//echo "<pre>";var_dump($_SESSION);exit;
//we extract the differents parameters
extract($_GET);
//parameters list
/*
 *table:name of the concerned table
 *page:index of the page (used to limit the query)
 */
//import of differents files
include '../libs/php/globalInfos.php';
$gb = new globalInfos();
$gb->requireModel($table);
include '../libs/php/inclusion_' . $table . '.php';
//the file that instanciate the model
$xml = $oneElement->getXmlConfig();
$dbh = $gb->globalDbh;
$gb->setGlobalXmlConfig(simplexml_load_file("../config/global_config.xml"));
$myTools = new myTools();
$filterArray = array();
if (isset($_SESSION['searchFilters'][$table]) && count($_SESSION['searchFilters'][$table]) > 0) {
    $filterArray = $_SESSION['searchFilters'][$table];
}
if (isset($_SESSION['hierarchy']["filter"]) && count($_SESSION['hierarchy']["filter"]) > 0) {
    if (isset($filterArray) && count($filterArray) > 0) {
        foreach ($_SESSION['hierarchy']["filter"] as $filter => $value) {
            if (array_key_exists($filter, $datasManager->getFields())) {