Esempio n. 1
0
    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)
    		{
    			$initDatas[$filter]=$value;
    		}
    		$oneElement->initWithDatas($initDatas);
    		
    	}*/
Esempio n. 2
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"/>
Esempio n. 3
0
    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'];
    }
    ?>
</div>
	      <div class="hero-unit" id="gridContainer">
	        <button id="addElement" class="btn"><?php 
    echo $globalInfosClass->getGlobalInfoForNodeAndTable("global_add_label", $page);
    ?>
</button>
	        <h4 id="filterBt" class="clickable"><?php 
    echo $globalInfosClass->getGlobalInfoForNodeAndTable("global_filter_label", $page);
    ?>
<img src="medias/images/rouage.png"/></h4>
	        <form id="filterForm"> 
				
				<?php 
    //we make a loop on the result of the 'getFields' method of the instance of the model and display the differents fields
    foreach ($oneElement->getFields() as $key => $value) {
        if ($value["isFilterVisible"] == "true" && $value["isPictureField"] == "false" && $value["isFileField"] == "false" && $value["isRichTextEditorField"] == "false" && $value["isDateField"] == "false") {
            //we get the form with the right context
            echo $oneElement->getFormFromField($key, "filterContext");
        }
Esempio n. 4
0
        ?>
 <li <?php 
        if ($page == $menu['tableName']) {
            echo "class='active'";
        }
        ?>
><a href="router.php?page=<?php 
        echo $menu['tableName'];
        ?>
"><?php 
        echo $menu['displayName'];
        ?>
</a></li> <?php 
    }
}
?>
              
            </ul>
           
          </div>
        </div>
        
        <div id="disconnectLink"><a href="disconnect.php"> <?php 
echo $globalInfosClass->getGlobalInfoForNodeAndTable("global_disconnect");
?>
</a></div>
      </div>
</div>
<!-- //container of the header -->

Esempio n. 5
0
         if (count(explode("|", (string) $xml->{"" . $columnName . ""}->displayColumn)) > 1) {
             $concatDisplay = "";
             foreach (explode("|", (string) $xml->{"" . $columnName . ""}->displayColumn) as $columnConcat) {
                 $concatDisplay .= $resultChoices[0][$columnConcat] . " ";
             }
             $xmlRetour->text($concatDisplay);
         } else {
             if (array_key_exists((string) $xml->{"" . $columnName . ""}->displayColumn, $picturesThumnailColumn)) {
                 $xmlRetour->writeCData("<img src='" . $picturesThumnailColumn[(string) $xml->{"" . $columnName . ""}->displayColumn] . $resultChoices[0][(string) $xml->{"" . $columnName . ""}->displayColumn] . "'/>");
             } else {
                 $xmlRetour->text($resultChoices[0][(string) $xml->{"" . $columnName . ""}->displayColumn]);
             }
         }
     } else {
         if ((string) $xml->{"" . $columnName . ""}->dateField['enabled'] == "true") {
             $xmlRetour->text(myTools::getDateFromTimeAndCustomFormat($columnValue, $gb->getGlobalInfoForNodeAndTable("global_date_format", $table)));
         } else {
             if ((string) $xml->{"" . $columnName . ""}->booleanField['enabled'] == "true") {
                 if ($columnValue == 0) {
                     $xmlRetour->text((string) $xml->{"" . $columnName . ""}->booleanField->boolean_false_label);
                 }
                 if ($columnValue == 1) {
                     $xmlRetour->text((string) $xml->{"" . $columnName . ""}->booleanField->boolean_true_label);
                 }
             } else {
                 //we return the value
                 $xmlRetour->text($columnValue);
             }
         }
     }
 }