예제 #1
0
require_once "../models/index/index.php";
$index = new index();
$cnct = new cnct_class();
$cnct->cnct();
$table = $_GET['table'];
$TABLE = $index->capitalize($table);
$selecBoxName = 'company_username';
$Table = $index->toView($table);
$cols = $index->getGeneralColums($table);
$keys = $cols['keys'];
$PRI = $cols['primaryKeys'];
$PRI = $PRI[0];
if (isset($_GET[$PRI])) {
    if ($_GET[$PRI] != '0') {
        $selectedItemId = $_GET[$PRI];
        if (!$index->checkIdIfExist($selectedItemId, $table)) {
            header('Location:index.php?note=Invalid Inputs');
        }
        $Aitm = $index->getGeneralItemById($selectedItemId, $table);
        $itm = $Aitm[$selectedItemId];
    }
}
?>
<div id="body">	
		
		<div id="firstColumn" >
		<div >
			<input id="add_item_buttom" type="button" style="width:<?php 
echo strlen($table) * 9;
?>
px" onClick="window.location='<?php 
예제 #2
0
if (!$index->isAllowed($data)) {
    //if(strpos($_SERVER["HTTP_REFERER"],'?')===false) $char='?' ; else $char='&'; echo  '<script language="javascript" > window.location="'.$_SERVER["HTTP_REFERER"].$char.'note=No Permition"; </script>';
    //die('Please enable JavaScript To Continue');
}
//************************************* check if the user control_p_group allow him to enter this page *******
//******************************************* constants *****************************************
$table = strtolower(substr($page, 6));
//get the name of the table from the file name
$Table = $index->capitalize($table);
//******************************************* constants end *************************************
//******************************************************** sub menu *****************************
$data['page'] = $page;
$menu = $index->getMenuList($data);
//********************************************************* get folder uploaded to ************************************
if (isset($_GET['table']) && isset($_GET['id'])) {
    if ($index->hasFiles($_GET['table']) && $index->checkIdIfExist($_GET['id'], $_GET['table'])) {
        $T = $_GET['table'];
        $I = $_GET['id'];
    } else {
        if (strpos($_SERVER["HTTP_REFERER"], '?') === false) {
            $char = '?';
        } else {
            $char = '&';
        }
        echo '<script language="javascript" > window.location="' . $_SERVER["HTTP_REFERER"] . $char . 'note=Not Exist"; </script>';
        die('Please enable JavaScript To Continue');
    }
} elseif (isset($_GET['table']) && !isset($_GET['id']) && isset($_SESSION['context'][$_GET['table']])) {
    if ($index->hasFiles($_GET['table']) && $index->checkIdIfExist($_SESSION['context'][$_GET['table']], $_GET['table'])) {
        $T = $_GET['table'];
        $I = $_SESSION['context'][$_GET['table']];