Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
cpdadmin /
Delete
Unzip
Name
Size
Permission
Date
Action
ajax
[ DIR ]
drwxr-sr-x
2025-06-24 07:20
assessordocs
[ DIR ]
drwxr-sr-x
2026-03-23 08:03
calendar
[ DIR ]
drwxr-sr-x
2022-04-19 07:00
certificates
[ DIR ]
drwxrwsr-x
2026-08-25 05:49
ckeditor
[ DIR ]
drwxr-sr-x
2022-04-19 07:00
images
[ DIR ]
drwxr-sr-x
2022-04-19 07:59
js
[ DIR ]
drwxr-sr-x
2022-04-19 06:59
lang
[ DIR ]
drwxr-sr-x
2022-04-19 06:59
providerdocs
[ DIR ]
drwxr-sr-x
2026-08-12 07:21
txt
[ DIR ]
drwxr-sr-x
2022-04-19 06:59
uploads
[ DIR ]
drwxr-sr-x
2026-08-17 12:51
yui280
[ DIR ]
drwxr-sr-x
2022-04-19 07:00
CESA_CPD.css
10.23
KB
-rw-r--r--
2022-04-19 06:59
CPDAdminUsersadd.php
28.52
KB
-rw-r--r--
2022-09-15 19:16
CPDAdminUsersdelete.php
20.94
KB
-rw-r--r--
2022-09-15 19:16
CPDAdminUsersedit.php
29.37
KB
-rw-r--r--
2022-09-15 19:16
CPDAdminUsersinfo.php
24.37
KB
-rw-r--r--
2022-09-15 19:16
CPDAdminUserslist.php
58.77
KB
-rw-r--r--
2022-09-15 19:16
CPDAdminUsersview.php
40.59
KB
-rw-r--r--
2022-09-15 19:16
CPDAssessors_CVFile_bv.php
6.5
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessors_Document1_bv.php
6.54
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessors_Document2_bv.php
6.54
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessors_Document3_bv.php
6.54
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessors_NDAFile_bv.php
6.52
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessors_QualificationFile_bv.php
6.63
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorsadd.php
77.14
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorsdelete.php
28.85
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorsedit.php
92.45
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorsinfo.php
30.15
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorslist.php
73.5
KB
-rw-r--r--
2023-04-21 10:09
CPDAssessorsview.php
69.35
KB
-rw-r--r--
2023-04-21 10:09
CPDProviderDocs_DocFile_bv.php
8.02
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocsadd.php
40.38
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocsdelete.php
24.9
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocsedit.php
46.12
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocsinfo.php
25.55
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocslist.php
84.13
KB
-rw-r--r--
2023-02-27 12:50
CPDProviderDocsview.php
56.09
KB
-rw-r--r--
2023-02-27 12:50
CPDSPReview_ReviewChecklist_bv.php
6.74
KB
-rw-r--r--
2023-03-08 11:27
CPDSPReview_ReviewFile1_bv.php
6.69
KB
-rw-r--r--
2023-03-08 11:27
CPDSPReview_ReviewFile2_bv.php
6.69
KB
-rw-r--r--
2023-03-08 11:27
CPDSPReviewadd.php
54.32
KB
-rw-r--r--
2023-03-08 12:02
CPDSPReviewdelete.php
25.1
KB
-rw-r--r--
2023-03-08 12:02
CPDSPReviewedit.php
64.65
KB
-rw-r--r--
2023-03-08 12:02
CPDSPReviewinfo.php
28.05
KB
-rw-r--r--
2023-03-08 12:02
CPDSPReviewlist.php
69.12
KB
-rw-r--r--
2023-03-08 12:02
CPDSPReviewview.php
51.23
KB
-rw-r--r--
2023-03-08 12:02
CPDServiceProvider_AccountabilityStructure_bv.php
7.13
KB
-rw-r--r--
2024-12-10 09:46
CPDServiceProvider_CPDActivities_bv.php
7.02
KB
-rw-r--r--
2024-12-10 09:46
CPDServiceProvider_EvaluatorInvoice_bv.php
7.34
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvider_EvaluatorTimesheet_bv.php
7.36
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvider_InvoiceFile_bv.php
7.28
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvider_LearnerAssessProcedure_bv.php
7.12
KB
-rw-r--r--
2024-12-10 09:46
CPDServiceProvider_OtherVACPDSPNumberCertificate_bv.php
7.49
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvider_PrevSPNumberCertificate_bv.php
7.42
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvider_ProofOfPayment_bv.php
7.31
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProvideradd.php
219.49
KB
-rw-r--r--
2025-04-16 15:56
CPDServiceProviderdelete.php
60.68
KB
-rw-r--r--
2025-04-16 15:56
CPDServiceProvideredit.php
244.46
KB
-rw-r--r--
2025-04-16 15:56
CPDServiceProviderinfo.php
51.93
KB
-rw-r--r--
2025-04-16 15:56
CPDServiceProviderlist.php
204.5
KB
-rw-r--r--
2025-04-16 15:56
CPDServiceProvidermaster.php
7.74
KB
-rw-r--r--
2025-03-30 11:38
CPDServiceProviderview.php
166.72
KB
-rw-r--r--
2025-04-16 15:56
CPDStepsTakenTMadd.php
33.05
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenTMdelete.php
24.02
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenTMedit.php
39.11
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenTMinfo.php
26.47
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenTMlist.php
67.53
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenTMview.php
42.7
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenadd.php
27.91
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakendelete.php
21.87
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenedit.php
34
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakeninfo.php
24.84
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenlist.php
102.44
KB
-rw-r--r--
2022-09-15 19:16
CPDStepsTakenview.php
39.89
KB
-rw-r--r--
2022-09-15 21:50
CPDTMReviewadd.php
68.75
KB
-rw-r--r--
2022-09-15 19:16
CPDTMReviewdelete.php
30.53
KB
-rw-r--r--
2022-09-15 19:16
CPDTMReviewedit.php
68.14
KB
-rw-r--r--
2022-09-15 19:16
CPDTMReviewinfo.php
30.75
KB
-rw-r--r--
2022-09-15 19:16
CPDTMReviewlist.php
76.95
KB
-rw-r--r--
2022-09-15 19:16
CPDTMReviewview.php
58.41
KB
-rw-r--r--
2022-09-15 19:16
CPDTrainingMaterial_ActivityProgramme_bv.php
6.92
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_AssessmentDoc_bv.php
6.87
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_CourseBrochure_bv.php
6.88
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_EvaluatorInvoice_bv.php
6.91
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_EvaluatorTimesheet_bv.php
6.93
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_FeedbackForm_bv.php
6.86
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_InvoiceFile_bv.php
6.85
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_LearningOutcomesFile_bv.php
6.95
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_Presenter1CV_bv.php
6.86
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_Presenter1IDDoc_bv.php
6.9
KB
-rw-r--r--
2025-01-14 11:59
CPDTrainingMaterial_Presenter1SLA_bv.php
6.87
KB
-rw-r--r--
2025-01-14 12:31
CPDTrainingMaterial_Presenter2CV_bv.php
6.86
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_Presenter2IDDoc_bv.php
6.9
KB
-rw-r--r--
2025-01-14 11:59
CPDTrainingMaterial_Presenter2SLA_bv.php
6.87
KB
-rw-r--r--
2025-01-14 12:31
CPDTrainingMaterial_Presenter3CV_bv.php
6.86
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterial_Presenter3IDDoc_bv.php
6.9
KB
-rw-r--r--
2025-01-14 11:59
CPDTrainingMaterial_Presenter3SLA_bv.php
6.87
KB
-rw-r--r--
2025-01-14 12:31
CPDTrainingMaterial_ProofOfPayment_bv.php
6.88
KB
-rw-r--r--
2023-08-24 13:47
CPDTrainingMaterialadd.php
312.71
KB
-rw-r--r--
2025-05-20 07:41
CPDTrainingMaterialdelete.php
69.75
KB
-rw-r--r--
2025-05-20 07:41
CPDTrainingMaterialedit.php
367.27
KB
-rw-r--r--
2025-05-20 07:41
CPDTrainingMaterialinfo.php
61.66
KB
-rw-r--r--
2025-05-20 07:41
CPDTrainingMateriallist.php
220.65
KB
-rw-r--r--
2025-05-20 07:41
CPDTrainingMaterialmaster.php
5.84
KB
-rw-r--r--
2024-09-18 11:13
CPDTrainingMaterialview.php
222.22
KB
-rw-r--r--
2025-05-20 07:41
SpryMenuBarHorizontal.css
5.52
KB
-rw-r--r--
2022-04-19 06:59
SpryMenuBarVertical.css
4.52
KB
-rw-r--r--
2022-04-19 06:59
changepwd.php
10.52
KB
-rw-r--r--
2023-02-11 10:44
cstReviewProgressinfo.php
21.94
KB
-rw-r--r--
2022-09-15 19:16
cstReviewProgresslist.php
65.64
KB
-rw-r--r--
2022-09-15 19:16
echasl23add.php
29.32
KB
-rw-r--r--
2022-09-15 21:50
echasl23delete.php
21.56
KB
-rw-r--r--
2022-09-15 21:50
echasl23edit.php
31.02
KB
-rw-r--r--
2022-09-15 21:50
echasl23info.php
24.92
KB
-rw-r--r--
2022-09-15 21:50
echasl23list.php
70.56
KB
-rw-r--r--
2022-09-15 21:50
echasl23srch.php
32.07
KB
-rw-r--r--
2022-09-15 21:50
echasl23view.php
39.44
KB
-rw-r--r--
2022-09-15 21:50
ewbv7.php
1.88
KB
-rw-r--r--
2022-04-19 06:59
ewcfg7.php
68.37
KB
-rw-r--r--
2026-08-24 10:13
ewemail7.php
1.87
KB
-rw-r--r--
2022-04-19 06:59
ewlookup7.php
2.8
KB
-rw-r--r--
2022-04-19 06:59
ewmenu.php
2.14
KB
-rw-r--r--
2024-09-18 11:13
ewmysql7.php
29.43
KB
-rw-r--r--
2026-08-20 18:36
ewshared7.php
26.13
KB
-rw-r--r--
2023-03-08 11:59
footer.php
2.48
KB
-rw-r--r--
2025-06-24 07:24
forgotpwd.php
13.11
KB
-rw-r--r--
2023-02-11 10:44
genspcertificate.php
2.74
KB
-rw-r--r--
2025-07-14 12:09
gentmcertificate.php
4.46
KB
-rw-r--r--
2025-09-12 09:17
header.php
5.62
KB
-rw-r--r--
2022-04-19 08:00
inc_functions.php
15.82
KB
-rw-r--r--
2026-08-14 12:06
index.php
6.01
KB
-rw-r--r--
2023-02-11 10:44
login.php
18.09
KB
-rw-r--r--
2023-02-11 10:44
logout.php
6.14
KB
-rw-r--r--
2023-03-10 10:31
php_errors.log
36.69
KB
-rw-r--r--
2026-08-20 18:36
phpfn7.php
142.58
KB
-rw-r--r--
2026-08-24 10:13
userfn7.php
355
B
-rw-r--r--
2023-02-10 11:50
userlevelpermissionsadd.php
27.07
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionsdelete.php
19.54
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionsedit.php
26.11
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionsinfo.php
21.32
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionslist.php
67.92
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionssrch.php
21.52
KB
-rw-r--r--
2022-09-15 19:16
userlevelpermissionsview.php
36.58
KB
-rw-r--r--
2022-09-15 19:16
userlevelsadd.php
24.5
KB
-rw-r--r--
2022-09-15 19:16
userlevelsdelete.php
16.89
KB
-rw-r--r--
2022-09-15 19:16
userlevelsedit.php
20.2
KB
-rw-r--r--
2022-09-15 19:16
userlevelsinfo.php
18.72
KB
-rw-r--r--
2022-09-15 19:16
userlevelslist.php
58.24
KB
-rw-r--r--
2022-09-15 19:16
userlevelsmaster.php
1.69
KB
-rw-r--r--
2022-09-15 19:16
userlevelssrch.php
17.79
KB
-rw-r--r--
2022-09-15 19:16
userlevelsview.php
32.56
KB
-rw-r--r--
2022-09-15 19:16
userpriv.php
14.51
KB
-rw-r--r--
2023-02-11 10:44
vwCPD_SPExpiredNotRenewedinfo.php
49.76
KB
-rw-r--r--
2024-09-18 11:03
vwCPD_SPExpiredNotRenewedlist.php
129.54
KB
-rw-r--r--
2024-09-18 11:03
vwCPD_SPExpiredNotRenewedmaster.php
10.96
KB
-rw-r--r--
2024-09-18 11:03
vwCPD_SPLatestinfo.php
53.45
KB
-rw-r--r--
2024-09-18 11:03
vwCPD_SPLatestlist.php
130.76
KB
-rw-r--r--
2024-09-18 11:03
vwCPD_SPLatestmaster.php
14.99
KB
-rw-r--r--
2024-09-18 11:03
xenon.css
0
B
-rw-r--r--
2025-06-24 07:25
Save
Rename
<?php // // Shared code for PHPMaker and PHP Report Maker // /** * Functions for converting encoding */ function ew_ConvertToUtf8($str) { return ew_Convert(EW_ENCODING, "UTF-8", $str); } function ew_ConvertFromUtf8($str) { return ew_Convert("UTF-8", EW_ENCODING, $str); } function ew_Convert($from, $to, $str) { if ($from != "" && $to != "" && strtoupper($from) != strtoupper($to)) { if (function_exists("iconv")) { return iconv($from, $to, $str); } elseif (function_exists("mb_convert_encoding")) { return mb_convert_encoding($str, $to, $from); } else { return $str; } } else { return $str; } } /** * Langauge class */ class cLanguage { var $LanguageId; var $Phrases = NULL; // Constructor function __construct() { global $gsLanguage; $this->LoadFileList(); // Set up file list if (@$_GET["language"] <> "") { // Set up language id $this->LanguageId = $_GET["language"]; $_SESSION[EW_SESSION_LANGUAGE_ID] = $this->LanguageId; } elseif (@$_SESSION[EW_SESSION_LANGUAGE_ID] <> "") { $this->LanguageId = $_SESSION[EW_SESSION_LANGUAGE_ID]; } else { $this->LanguageId = EW_LANGUAGE_DEFAULT_ID; } $gsLanguage = $this->LanguageId; $this->Load($this->LanguageId); } // Load language file list function LoadFileList() { global $EW_LANGUAGE_FILE; if (is_array($EW_LANGUAGE_FILE)) { $cnt = count($EW_LANGUAGE_FILE); for ($i = 0; $i < $cnt; $i++) $EW_LANGUAGE_FILE[$i][1] = $this->LoadFileDesc(EW_LANGUAGE_FOLDER . $EW_LANGUAGE_FILE[$i][2]); } } // Load language file description function LoadFileDesc($File) { if (EW_USE_DOM_XML) { $this->Phrases = new cXMLDocument(); if ($this->Phrases->Load($File)) return $this->GetNodeAtt($this->Phrases->DocumentElement(), "desc"); } else { $ar = ew_Xml2Array(substr(ew_ReadFile($File), 0, 512)); // Just read the first part return (is_array($ar)) ? @$ar['ew-language']['attr']['desc'] : ""; } } // Load language file function Load($id) { $sFileName = $this->GetFileName($id); if ($sFileName == "") $sFileName = $this->GetFileName(EW_LANGUAGE_DEFAULT_ID); if ($sFileName == "") return; if (EW_USE_DOM_XML) { $this->Phrases = new cXMLDocument(); $this->Phrases->Load($sFileName); } else { if (is_array(@$_SESSION[EW_PROJECT_NAME . "_" . $sFileName])) { $this->Phrases = $_SESSION[EW_PROJECT_NAME . "_" . $sFileName]; } else { $this->Phrases = ew_Xml2Array(ew_ReadFile($sFileName)); } } } // Get language file name function GetFileName($Id) { global $EW_LANGUAGE_FILE; if (is_array($EW_LANGUAGE_FILE)) { $cnt = count($EW_LANGUAGE_FILE); for ($i = 0; $i < $cnt; $i++) if ($EW_LANGUAGE_FILE[$i][0] == $Id) { return EW_LANGUAGE_FOLDER . $EW_LANGUAGE_FILE[$i][2]; } } return ""; } // Get node attribute function GetNodeAtt($Nodes, $Att) { $value = ($Nodes) ? $this->Phrases->GetAttribute($Nodes, $Att) : ""; //return ew_ConvertFromUtf8($value); return $value; } // Get phrase function Phrase($Id) { if (is_object($this->Phrases)) { return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//global/phrase[@id='" . strtolower($Id) . "']"), "value"); } elseif (is_array($this->Phrases)) { return ew_ConvertFromUtf8(@$this->Phrases['ew-language']['global']['phrase'][strtolower($Id)]['attr']['value']); } } // Set phrase function setPhrase($Id, $Value) { if (is_array($this->Phrases)) { $this->Phrases['ew-language']['global']['phrase'][strtolower($Id)]['attr']['value'] = $Value; } } // Get project phrase function ProjectPhrase($Id) { if (is_object($this->Phrases)) { return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//project/phrase[@id='" . strtolower($Id) . "']"), "value"); } elseif (is_array($this->Phrases)) { return ew_ConvertFromUtf8(@$this->Phrases['ew-language']['project']['phrase'][strtolower($Id)]['attr']['value']); } } // Set project phrase function setProjectPhrase($Id, $Value) { if (is_array($this->Phrases)) { $this->Phrases['ew-language']['project']['phrase'][strtolower($Id)]['attr']['value'] = $Value; } } // Get menu phrase function MenuPhrase($MenuId, $Id) { if (is_object($this->Phrases)) { return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//project/menu[@id='" . $MenuId . "']/phrase[@id='" . strtolower($Id) . "']"), "value"); } elseif (is_array($this->Phrases)) { return ew_ConvertFromUtf8(@$this->Phrases['ew-language']['project']['menu'][$MenuId]['phrase'][strtolower($Id)]['attr']['value']); } } // Set menu phrase function setMenuPhrase($MenuId, $Id, $Value) { if (is_array($this->Phrases)) { $this->Phrases['ew-language']['project']['menu'][$MenuId]['phrase'][strtolower($Id)]['attr']['value'] = $Value; } } // Get table phrase function TablePhrase($TblVar, $Id) { if (is_object($this->Phrases)) { return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//project/table[@id='" . strtolower($TblVar) . "']/phrase[@id='" . strtolower($Id) . "']"), "value"); } elseif (is_array($this->Phrases)) { return ew_ConvertFromUtf8(@$this->Phrases['ew-language']['project']['table'][strtolower($TblVar)]['phrase'][strtolower($Id)]['attr']['value']); } } // Set table phrase function setTablePhrase($TblVar, $Id, $Value) { if (is_array($this->Phrases)) { $this->Phrases['ew-language']['project']['table'][strtolower($TblVar)]['phrase'][strtolower($Id)]['attr']['value'] = $Value; } } // Get field phrase function FieldPhrase($TblVar, $FldVar, $Id) { if (is_object($this->Phrases)) { return $this->GetNodeAtt($this->Phrases->SelectSingleNode("//project/table[@id='" . strtolower($TblVar) . "']/field[@id='" . strtolower($FldVar) . "']/phrase[@id='" . strtolower($Id) . "']"), "value"); } elseif (is_array($this->Phrases)) { return ew_ConvertFromUtf8(@$this->Phrases['ew-language']['project']['table'][strtolower($TblVar)]['field'][strtolower($FldVar)]['phrase'][strtolower($Id)]['attr']['value']); } } // Set field phrase function setFieldPhrase($TblVar, $FldVar, $Id, $Value) { if (is_array($this->Phrases)) { $this->Phrases['ew-language']['project']['table'][strtolower($TblVar)]['field'][strtolower($FldVar)]['phrase'][strtolower($Id)]['attr']['value'] = $Value; } } // Output XML as JSON function XmlToJSON($XPath) { $NodeList = $this->Phrases->SelectNodes($XPath); $Str = "{"; foreach ($NodeList as $Node) { $Id = $this->GetNodeAtt($Node, "id"); $Value = $this->GetNodeAtt($Node, "value"); $Str .= "\"" . ew_JsEncode2($Id) . "\":\"" . ew_JsEncode2($Value) . "\","; } if (substr($Str, -1) == ",") $Str = substr($Str, 0, strlen($Str) - 1); $Str .= "}"; return $Str; } // Output array as JSON function ArrayToJSON($client) { $ar = @$this->Phrases['ew-language']['global']['phrase']; $Str = "{"; if (is_array($ar)) { foreach ($ar as $id => $node) { $is_client = @$node['attr']['client'] == '1'; $value = ew_ConvertFromUtf8(@$node['attr']['value']); if (!$client || ($client && $is_client)) $Str .= "\"" . ew_JsEncode2($id) . "\":\"" . ew_JsEncode2($value) . "\","; } } if (substr($Str, -1) == ",") $Str = substr($Str, 0, strlen($Str) - 1); $Str .= "}"; return $Str; } // Output all phrases as JSON function AllToJSON() { if (is_object($this->Phrases)) { return "var ewLanguage = new ew_Language(" . $this->XmlToJSON("//global/phrase") . ");"; } elseif (is_array($this->Phrases)) { return "var ewLanguage = new ew_Language(" . $this->ArrayToJSON(FALSE) . ");"; } } // Output client phrases as JSON function ToJSON() { if (is_object($this->Phrases)) { return "var ewLanguage = new ew_Language(" . $this->XmlToJSON("//global/phrase[@client='1']") . ");"; } elseif (is_array($this->Phrases)) { return "var ewLanguage = new ew_Language(" . $this->ArrayToJSON(TRUE) . ");"; } } } /** * XML document class */ class cXMLDocument { var $Encoding = "utf-8"; var $RootTagName; var $RowTagName; var $XmlDoc = FALSE; var $XmlTbl; var $XmlRow; var $NullValue = 'NULL'; function __construct($encoding = "") { if ($encoding <> "") $this->Encoding = $encoding; if (EW_IS_PHP5) { if ($this->Encoding <> "") { $this->XmlDoc = new DOMDocument("1.0", strval($this->Encoding)); } else { $this->XmlDoc = new DOMDocument("1.0"); } } else { if (function_exists("domxml_new_doc")) $this->XmlDoc = domxml_new_doc("1.0"); } } function Load($filename) { $filepath = realpath($filename); if (EW_IS_PHP5) { return $this->XmlDoc->load($filepath); } else { if (function_exists("domxml_open_file")) $this->XmlDoc = domxml_open_file($filepath); return $this->XmlDoc; } } function &DocumentElement() { if (EW_IS_PHP5) { $de = $this->XmlDoc->documentElement; } else { $de = $this->XmlDoc->document_element(); } return $de; } function GetAttribute($element, $name) { if (EW_IS_PHP5) { return ($element) ? ew_ConvertFromUtf8($element->getAttribute($name)) : ""; } else { return ($element) ? ew_ConvertFromUtf8($element->get_attribute($name)) : ""; } } function SelectSingleNode($query) { $elements = $this->SelectNodes($query); if (EW_IS_PHP5) { return ($elements->length > 0) ? $elements->item(0) : NULL; } else { return (count($elements) > 0) ? $elements[0] : NULL; } } function SelectNodes($query) { if (EW_IS_PHP5) { $xpath = new DOMXPath($this->XmlDoc); return $xpath->query($query); } else { $xpath = xpath_new_context($this->XmlDoc); $xpathobj = xpath_eval_expression($xpath, $query); return $xpathobj->nodeset; } } function AddRoot($roottagname = 'table') { $this->RootTagName = $roottagname; if (EW_IS_PHP5) { $this->XmlTbl = $this->XmlDoc->createElement($this->RootTagName); $this->XmlDoc->appendChild($this->XmlTbl); } else { $this->XmlTbl = $this->XmlDoc->create_element($this->RootTagName); $this->XmlDoc->append_child($this->XmlTbl); } } function AddRow($rowtagname = 'row') { $this->RowTagName = $rowtagname; if (EW_IS_PHP5) { $this->XmlRow = $this->XmlDoc->createElement($this->RowTagName); if ($this->XmlTbl) $this->XmlTbl->appendChild($this->XmlRow); } else { $this->XmlRow = $this->XmlDoc->create_element($this->RowTagName); if ($this->XmlTbl) $this->XmlTbl->append_child($this->XmlRow); } } function AddField($name, $value) { if (is_null($value)) $value = $this->NullValue; $value = ew_ConvertToUtf8($value); // Convert to UTF-8 if (EW_IS_PHP5) { $xmlfld = $this->XmlDoc->createElement($name); $this->XmlRow->appendChild($xmlfld); $xmlfld->appendChild($this->XmlDoc->createTextNode($value)); } else { $xmlfld = $this->XmlDoc->create_element($name); $this->XmlRow->append_child($xmlfld); $xmlfld->append_child($this->XmlDoc->create_text_node($value)); } } function XML() { if (EW_IS_PHP5) { return $this->XmlDoc->saveXML(); } else { if (phpversion() >= "4.3.0") { return $this->XmlDoc->dump_mem(TRUE, $this->Encoding); } else { return $this->XmlDoc->dump_mem($this->Encoding); } } } } /** * Menu class */ class cMenu { var $Id; var $IsRoot = FALSE; var $NoItem = NULL; var $ItemData = array(); function __construct($id) { $this->Id = $id; } // Add a menu item function AddMenuItem($id, $text, $url, $parentid, $src, $allowed = TRUE) { $item = new cMenuItem($id, $text, $url, $parentid, $src, $allowed); // Fire MenuItem_Adding event if (function_exists("MenuItem_Adding") && !MenuItem_Adding($item)) return; if ($item->ParentId < 0) { $this->AddItem($item); } else { if ($oParentMenu = & $this->FindItem($item->ParentId)) $oParentMenu->AddItem($item); } } // Add item to internal array function AddItem($item) { $this->ItemData[] = $item; } // Find item function &FindItem($id) { $cnt = count($this->ItemData); for ($i = 0; $i < $cnt; $i++) { $item = & $this->ItemData[$i]; if ($item->Id == $id) { return $item; } elseif (!is_null($item->SubMenu)) { if ($subitem = & $item->SubMenu->FindItem($id)) return $subitem; } } return $this->NoItem; } // Check if a menu item should be shown function RenderItem($item) { if (!is_null($item->SubMenu)) { foreach ($item->SubMenu->ItemData as $subitem) { if ($item->SubMenu->RenderItem($subitem)) return TRUE; } } return ($item->Allowed && $item->Url <> ""); } // Check if this menu should be rendered function RenderMenu() { foreach ($this->ItemData as $item) { if ($this->RenderItem($item)) return TRUE; } return FALSE; } // Render the menu function Render() { if (!$this->RenderMenu()) return; echo "<ul"; if ($this->Id <> "") { if (is_numeric($this->Id)) { echo " id=\"menu_" . $this->Id . "\""; } else { echo " id=\"" . $this->Id . "\""; } } if ($this->IsRoot) echo " class=\"" . EW_MENUBAR_CLASSNAME . "\""; echo ">\n"; foreach ($this->ItemData as $item) { if ($this->RenderItem($item)) { echo "<li><a"; if (!is_null($item->SubMenu) && $item->SubMenu->RenderMenu()) echo " class=\"" . EW_MENUBAR_SUBMENU_CLASSNAME . "\""; if ($item->Url <> "") echo " href=\"" . htmlspecialchars(strval($item->Url)) . "\""; if ($item->Target <> "") echo " target=\"" . $item->Target . "\""; echo ">" . $item->Text . "</a>\n"; if (!is_null($item->SubMenu)) $item->SubMenu->Render(); echo "</li>\n"; } } echo "</ul>\n"; } } // Menu item class class cMenuItem { var $Id; var $Text; var $Url; var $ParentId; var $SubMenu = NULL; // Data type = cMenu var $Source; var $Allowed = TRUE; var $Target; function __construct($id, $text, $url, $parentid, $src, $allowed) { $this->Id = $id; $this->Text = $text; $this->Url = $url; $this->ParentId = $parentid; $this->Source = $src; $this->Allowed = $allowed; } function AddItem($item) { // Add submenu item if (is_null($this->SubMenu)) $this->SubMenu = new cMenu($this->Id); $this->SubMenu->AddItem($item); } } // Debug timer class cTimer { var $StartTime; var $EndTime; function __construct($start = TRUE) { if ($start) $this->Start(); } function GetTime() { list($usec, $sec) = explode(" ", microtime()); return ((float) $usec + (float) $sec); } // Get script start time function Start() { if (EW_DEBUG_ENABLED) $this->StartTime = $this->GetTime(); } // display elapsed time (in seconds) function Stop() { if (EW_DEBUG_ENABLED) $this->EndTime = $this->GetTime(); if (isset($this->EndTime) && isset($this->StartTime) && $this->EndTime > $this->StartTime) echo '<p>Page processing time: ' . ($this->EndTime - $this->StartTime) . ' seconds</p>'; } } // Convert XML to array function ew_Xml2Array($contents) { if (!$contents) return array(); if (!function_exists('xml_parser_create')) return FALSE; $get_attributes = 1; // Always get attributes. DO NOT CHANGE! // Get the XML Parser of PHP $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); // Always return in utf-8 xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, trim($contents), $xml_values); xml_parser_free($parser); if (!$xml_values) return; $xml_array = array(); $parents = array(); $opened_tags = array(); $arr = array(); $current = &$xml_array; $repeated_tag_index = array(); // Multiple tags with same name will be turned into an array foreach ($xml_values as $data) { unset($attributes, $value); // Remove existing values // Extract these variables into the foreach scope // tag(string), type(string), level(int), attributes(array) extract($data); $result = array(); if (isset($value)) $result['value'] = $value; // Put the value in a assoc array // Set the attributes if (isset($attributes) and $get_attributes) { foreach ($attributes as $attr => $val) $result['attr'][$attr] = $val; // Set all the attributes in a array called 'attr' } // See tag status and do the needed if ($type == "open") { // The starting of the tag '<tag>' $parent[$level - 1] = &$current; if (!is_array($current) || !in_array($tag, array_keys($current))) { // Insert New tag if ($tag <> 'ew-language' && @$result['attr']['id'] <> '') { // $last_item_index = $result['attr']['id']; $current[$tag][$last_item_index] = $result; $repeated_tag_index[$tag . '_' . $level] = 1; $current = &$current[$tag][$last_item_index]; } else { $current[$tag] = $result; $repeated_tag_index[$tag . '_' . $level] = 0; $current = &$current[$tag]; } } else { // Another element with the same tag name if ($repeated_tag_index[$tag . '_' . $level] > 0) { // If there is a 0th element it is already an array if (@$result['attr']['id'] <> '') { $last_item_index = $result['attr']['id']; } else { $last_item_index = $repeated_tag_index[$tag . '_' . $level]; } $current[$tag][$last_item_index] = $result; $repeated_tag_index[$tag . '_' . $level] ++; } else { // Make the value an array if multiple tags with the same name appear together $temp = $current[$tag]; $current[$tag] = array(); if (@$temp['attr']['id'] <> '') { $current[$tag][$temp['attr']['id']] = $temp; } else { $current[$tag][] = $temp; } if (@$result['attr']['id'] <> '') { $last_item_index = $result['attr']['id']; } else { $last_item_index = 1; } $current[$tag][$last_item_index] = $result; $repeated_tag_index[$tag . '_' . $level] = 2; } $current = &$current[$tag][$last_item_index]; } } elseif ($type == "complete") { // Tags that ends in one line '<tag />' if (!isset($current[$tag])) { // New key $current[$tag] = array(); // Always use array for "complete" type if (@$result['attr']['id'] <> '') { $current[$tag][$result['attr']['id']] = $result; } else { $current[$tag][] = $result; } $repeated_tag_index[$tag . '_' . $level] = 1; } else { // Existing key if (@$result['attr']['id'] <> '') { $current[$tag][$result['attr']['id']] = $result; } else { $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result; } $repeated_tag_index[$tag . '_' . $level] ++; } } elseif ($type == 'close') { // End of tag '</tag>' $current = &$parent[$level - 1]; } } return($xml_array); } // Load file data function ew_ReadFile($file) { $content = ''; if (function_exists("file_get_contents")) { $content = file_get_contents($file); } else { if ($handle = @fopen($file, 'r')) { $content = fread($handle, filesize($file)); fclose($handle); } } return $content; } // Encode value for double-quoted Javascript string function ew_JsEncode2($val) { $val = str_replace("\\", "\\\\", strval($val)); $val = str_replace("\"", "\\\"", $val); $val = str_replace("\r\n", "<br>", $val); $val = str_replace("\r", "<br>", $val); $val = str_replace("\n", "<br>", $val); return $val; } // Encode value to single-quoted Javascript string for HTML attributes function ew_JsEncode3($val) { $val = str_replace("\\", "\\\\", strval($val)); $val = str_replace("'", "\\'", $val); $val = str_replace("\"", """, $val); return $val; } // Convert array to JSON for HTML attributes function ew_ArrayToJsonAttr($ar) { $Str = "{"; foreach ($ar as $key => $val) $Str .= $key . ":'" . ew_JsEncode3($val) . "',"; if (substr($Str, -1) == ",") $Str = substr($Str, 0, strlen($Str) - 1); $Str .= "}"; return $Str; } // Get current page name function ew_CurrentPage() { return ew_GetPageName(ew_ScriptName()); } // Get page name function ew_GetPageName($url) { $PageName = ""; if ($url <> "") { $PageName = $url; $p = strpos($PageName, "?"); if ($p !== FALSE) $PageName = substr($PageName, 0, $p); // Remove QueryString $p = strrpos($PageName, "/"); if ($p !== FALSE) $PageName = substr($PageName, $p + 1); // Remove path } return $PageName; } // Adjust text for caption function ew_BtnCaption($Caption) { $Min = 10; if (strlen($Caption) < $Min) { $Pad = abs(intval(($Min - strlen($Caption)) / 2 * -1)); $Caption = str_repeat(" ", $Pad) . $Caption . str_repeat(" ", $Pad); } return $Caption; } // Get current user levels as array of user level IDs function CurrentUserLevels() { global $Security; if (isset($Security)) { return $Security->UserLevelID; } else { if (isset($_SESSION[EW_SESSION_USER_LEVEL_ID])) { return array($_SESSION[EW_SESSION_USER_LEVEL_ID]); } else { return array(); } } } // Check if menu item is allowed for current user level function AllowListMenu($TableName) { $userlevels = CurrentUserLevels(); // Get user level ID list as array if (IsLoggedIn()) { if (in_array("-1", $userlevels)) { return TRUE; } else { $priv = 0; if (is_array(@$_SESSION[EW_SESSION_AR_USER_LEVEL_PRIV])) { foreach ($_SESSION[EW_SESSION_AR_USER_LEVEL_PRIV] as $row) { if (strval($row[0]) == strval($TableName) && in_array($row[1], $userlevels)) { $thispriv = $row[2]; if (is_null($thispriv)) $thispriv = 0; $thispriv = intval($thispriv); $priv = $priv | $thispriv; } } } return ($priv & EW_ALLOW_LIST); } } else { return FALSE; } } // Get server variable by name function ew_ServerVar($Name) { $str = @$_SERVER[$Name]; if (empty($str)) $str = @$_ENV[$Name]; return $str; } // Get domain URL function ew_DomainUrl() { $sUrl = "http"; $bSSL = (ew_ServerVar("HTTPS") <> "" && ew_ServerVar("HTTPS") <> "off"); $sPort = strval(ew_ServerVar("SERVER_PORT")); $defPort = ($bSSL) ? "443" : "80"; $sPort = ($sPort == $defPort) ? "" : ":$sPort"; $sUrl .= ($bSSL) ? "s" : ""; $sUrl .= "://"; $sUrl .= ew_ServerVar("SERVER_NAME") . $sPort; return $sUrl; } // Get full URL function ew_FullUrl() { return ew_DomainUrl() . ew_ScriptName(); } // Get current URL function ew_CurrentUrl() { $s = ew_ScriptName(); $q = ew_ServerVar("QUERY_STRING"); if ($q <> "") $s .= "?" . $q; return $s; } // Convert to full URL function ew_ConvertFullUrl($url) { if ($url == "") return ""; $sUrl = ew_FullUrl(); return substr($sUrl, 0, strrpos($sUrl, "/") + 1) . $url; } ?>