*/ include("session.php"); require_once("class_functions.php"); require_once("class_db.php"); require_once("class_letterbox.php"); $conn = new dbquery(); $conn->connect(); if(file_exists($_SESSION['config']['lang'].'.php')) { include($_SESSION['config']['lang'].'.php'); } else { $_SESSION['error'] = "Language file missing...
"; } if (!empty($_REQUEST['fileplan_label'])) { $conn->query("SELECT * FROM ".$_SESSION['tablename']['fileplans']. " WHERE FILEPLAN_DESCRIPTION = '".$_REQUEST['fileplan_label']."'and SHARED_FILEPLAN='N' and FILEPLAN_OWNER = '".$_SESSION['user']['UserId']."'"); if($conn->nb_result() !=0) { $_SESSION['error'] = $_REQUEST['fileplan_label'].' '._ALREADY_EXISTS; header("location: index.php?page=folders"); exit; } else { $conn->query("INSERT INTO ".$_SESSION['tablename']['fileplans'] ." ( FILEPLAN_DESCRIPTION, FILEPLAN_OWNER, CREATION_DATE, SHARED_FILEPLAN) VALUES ( '".addslashes($_REQUEST['fileplan_label'])."', '".$_SESSION['user']['UserId']."', now(), 'N')"); $conn->query("select FILEPLAN_ID from ".$_SESSION['tablename']['fileplans']." where FILEPLAN_DESCRIPTION = '".addslashes($_REQUEST['fileplan_label']) ."' and FILEPLAN_OWNER = '".$_SESSION['user']['UserId']."' and SHARED_FILEPLAN='N'"); $res = $conn->fetch_object(); $_SESSION['user']['fileplan']['ID'] = $res->FILEPLAN_ID; if($_SESSION['history']['fileplansadd'] == "true") { require_once("class_history.php"); $history = new history(); $history->add($_SESSION['tablename']['fileplans'], $_SESSION['user']['fileplan']['ID'],"ADD", _FILEPLAN_ADDED." : ".$_REQUEST['fileplan_label']); } $_SESSION['info'] = _FILEPLAN_ADDED; //echo $_SESSION['info']; $url = "index.php?page=folders"; header("location: ".$url); } } elseif (!empty($_REQUEST['fileplan_name'])) { $conn->query("SELECT * FROM ".$_SESSION['tablename']['fileplans']. " WHERE FILEPLAN_DESCRIPTION = '".$_REQUEST['fileplan_name']."'and SHARED_FILEPLAN='N' and FILEPLAN_OWNER = '".$_SESSION['user']['UserId']."'"); if($conn->nb_result() !=0) { $_SESSION['error'] = $_REQUEST['fileplan_name'].' '._ALREADY_EXISTS; header("location: index.php?page=folders"); exit; } else { $conn->query("INSERT INTO ".$_SESSION['tablename']['fileplans'] ." ( FILEPLAN_DESCRIPTION, FILEPLAN_OWNER, CREATION_DATE, SHARED_FILEPLAN) VALUES ( '".addslashes($_REQUEST['fileplan_name'])."', '".$_SESSION['user']['UserId']."', now(), 'N')"); $conn->query("select FILEPLAN_ID from ".$_SESSION['tablename']['fileplans']." where FILEPLAN_DESCRIPTION = '".addslashes($_REQUEST['fileplan_name']) ."' and FILEPLAN_OWNER = '".$_SESSION['user']['UserId']."' and SHARED_FILEPLAN='N'"); $res = $conn->fetch_object(); $_SESSION['user']['fileplan']['ID'] = $res->FILEPLAN_ID; if($_SESSION['history']['fileplansadd'] == "true") { require_once("class_history.php"); $history = new history(); $history->add($_SESSION['tablename']['fileplans'], $_SESSION['user']['fileplan']['ID'],"ADD", _FILEPLAN_ADDED." : ".$_REQUEST['fileplan_label']); } $_SESSION['info'] = _FILEPLAN_ADDED; //echo $_SESSION['info']; $url = "index.php?page=folders"; header("location: ".$url); } } else { $_SESSION['error'] = _FILEPLAN.' '._UNKNOWN; echo $_SESSION['error']; $url = "index.php?page=folders"; header("location: ".$url); } ?>