3600) { header("Location: ../../login.php"); } else { $sesstime = time(); } //define("DOMAIN_ROOT","http://ang.geccms.com"); // Should start with http:// ... define("DOMAIN_ROOT","http://www.gecanderson.co.uk/"); // Should start with http:// ... include("dataconn.inc"); /* if(time() - $sesstime > 3600) { //header("Location: $redirurl/scripts/login.php?ercode=408"); header("Location: ../scripts/login.php"); } else { $sesstime = time(); } */ //To define table names //====================== define(Static_Menu, "Static_Menu"); define(User_Menu, "User_Menu"); define(Pagecategory_Master, "PageCategory_Master"); $basedir=".."; $rootdir = ".."; $admindir ="../admin"; $templatedir_admin = "../templates/admin/"; $templatedir_user = "../templates/user/"; $usertemplatedir = "../user/"; $commondir ="../includes/common/"; #$website_url = "http://ang.geccms.com/"; $website_url = "http://www.indiaimportsexports.com/GECAnderson/Application/"; $website_url = "../../"; $server_path = $_SERVER["PHP_SELF"]; $path = split("/",$server_path); $file_path = $path[2]; $flag = 0; if($file_path != "page_modify.php" && $page != "") { global $page; $qry_update_page = "Update Page_Details set Check_In = 'N' where Page_Id = $page"; $update_result = mysql($db,$qry_update_page); } if($usertypeid == 1) { $usertype = "Super"; } else if($usertypeid == 2) { $usertype = "ContentAdmin"; } else if($usertypeid == 3) { $usertype = "EComAdmin"; } function my_profile($id) { return $my_profile = "select User_Name,User_Title,User_Email,Receive_Email from GECAnderson_Users where User_Id=$id"; } function user_sql($id) { return $user_sql = "select User_Id,Usertype_Id, User_Title,User_Name,User_Email,Login_Id,Password,Status from GECAnderson_Users where User_Id=$id"; } function interactivemodule_sql() { return $interactivemodule_sql = "select Module_Id, Module_Name from Interactive_Modules order by Module_Name "; } function title_sql() { return $title_sql = "select Title_Id, Title_Name from User_Title"; } function pagecat_sql() { return $pagecat_sql = "select PageCat_Id,PageCat_Name from PageCategory_Master where Del_Flag != 'Y' order by PageCat_Id"; } function pagecat_sql1() { return $pagecat_sql = "select PageCat_Id,PageCat_Name from PageCategory_Master where Del_Flag != 'Y' and PageCat_ID = '$dept_id'"; } function pagecat_sql2($pg) { return $pagecat_sql = "select PageCat_Id,PageCat_Name from PageCategory_Master where Del_Flag != 'Y' and PageCat_ID = '$pg'"; } function usertype_admin() { global $usertypeid,$deptid; if ($usertypeid==1) return $usertype_admin = "select Type_Id,Type_Name from User_Type where Type_Id != 1 order by Type_Id"; else return $usertype_admin = "select Type_Id,Type_Name from User_Type where User_Category = 1 and Type_Id=3 order by Type_Id"; } function usertype_name($id) { return $usertype_name = "select Type_Name from User_Type where Type_Id = $id"; } function template_sql() { return $template_sql = "select Template_Id,Template_Name from Template_Master where Status =1 and Created_Flag = 'C' order by Template_Name "; } function dept_sql() { global $usertypeid,$deptid; if ($usertypeid==1) return $dept_sql = "select Department_Id,Department_Name from Department_Master order by Department_Name"; else return $dept_sql = "select Department_Id, Department_Name from Department_Master where Department_Id=$deptid"; } function home_sql() { return $home_sql = "Select Id,Title,Overview,Image_Name,Home_Image from GKNM_HomePage"; } function smenu_sql() { if($usertype=="Super") return $smenu_sql = "select Menu_Id,Menu_Name from Static_Menu where Type_Id=$pagecatid"; else return $smenu_sql = "select Menu_Id,Menu_Name from Static_Menu"; } function mtype_sql() { return $mtype_sql = "Select Type_Id,Type_Name from Menu_Type"; } function website_Select() { global $usertypeid,$deptid; if($usertypeid==1) return $website_sql = "select PageCat_Id,Approval_Super,Page_Title from Page_Details where Approval_Super = 0 and Approval_Dept=1 order by PageCat_Id"; else return $website_sql = "Select PageCat_Id, Approval_Super,Page_Title from Page_Details where User_Id=$deptid"; } function title_row1($title) { return $title_table = "
 
$title
"; } function title_row($title) { return $title_table = "
$title
"; } function no_contents($module) { return "
No ".$module." found
"; } function rm_dir($dir) { if($dir) { $handle = opendir($dir); while (false!==($item = readdir($handle))) { if($item != '.' && $item != '..') { if($item) { if(is_dir($dir.'/'.$item)) { rm_dir($dir.'/'.$item); } else { unlink($dir.'/'.$item); } } } } closedir($handle); rmdir($dir); } } $dt = Array( "0" => "00", "1" => "01", "2" => "02", "3" => "03", "4" => "04", "5" => "05", "6" => "06", "7" => "07", "8" => "08", "9" => "09", "10" => "10", "11" => "11", "12" => "12", "13" => "13", "14" => "14", "15" => "15", "16" => "16", "17" => "17", "18" => "18", "19" => "19", "20" => "20", "21" => "21", "22" => "22", "23" => "23", "24" => "24", "25" => "25", "26" => "26", "27" => "27", "28" => "28", "29" => "29", "30" => "30", "31" => "31" ); $mon = Array( "1" => "January", "2" => "February", "3" => "March", "4" => "April", "5" => "May", "6" => "June", "7" => "July", "8" => "August", "9" => "September", "10" => "October", "11" => "November", "12" => "December", ); # Function used to Encript and Decript the Password FUNCTION ENCRYPT_DECRYPT($Str_Message) { //Function : encrypt/decrypt a string message v.1.0 without a known key //Author : Aitor Solozabal Merino (spain) //Email : aitor-3@euskalnet.net //Date : 01-04-2005 $Len_Str_Message=STRLEN($Str_Message); $Str_Encrypted_Message=""; FOR ($Position = 0;$Position<$Len_Str_Message;$Position++){ // long code of the function to explain the algoritm //this function can be tailored by the programmer modifyng the formula //to calculate the key to use for every character in the string. $Key_To_Use = (($Len_Str_Message+$Position)+1); // (+5 or *3 or ^2) //after that we need a module division because canīt be greater than 255 $Key_To_Use = (255+$Key_To_Use) % 255; $Byte_To_Be_Encrypted = SUBSTR($Str_Message, $Position, 1); $Ascii_Num_Byte_To_Encrypt = ORD($Byte_To_Be_Encrypted); $Xored_Byte = $Ascii_Num_Byte_To_Encrypt ^ $Key_To_Use; //xor operation $Encrypted_Byte = CHR($Xored_Byte); $Str_Encrypted_Message .= $Encrypted_Byte; //short code of the function once explained //$str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255)); } RETURN $Str_Encrypted_Message; } if($server_path != "/scripts/page_preview.php") { // Javascript Functions // ==================== echo ''; echo ''; // Navigation function to navigate to Interactive Modules // ====================================================== echo ''; } ?>