23 $monLibrary = dirname(__FILE__) .
"/../library";
24 require_once(
"$monLibrary/cu_top.i");
25 require_once(
"$monLibrary/ck_hticket.i");
26 require_once(
"$monLibrary/monitorView.i");
28 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
31 header(
"Location: /hcuadm/hcu_noperm.prg");
35 $dms_ok = array(
'user_name'=>
'string',
'cu_name'=>
'string',
'act'=>
'string',
'f'=>
'string',
36 'cu_mxcu'=>
'string',
'script_doc'=>
'string',
"language"=>
"string",
37 "import_file"=>
"string",
"doc_id"=>
"digits",
"useDefault"=>
"string",
"showLink"=>
"string",
38 "responseLasts"=>
"digits",
"startDate"=>
"string",
"endDate"=>
"string",
"showTab"=>
"string");
45 $doc = isset($script_doc) ? trim($script_doc) :
"";
46 $returnArray = ValidateXML($doc);
47 header(
'Content-type: application/json');
48 print HCU_JsonEncode($returnArray);
54 function ValidateXML($script_doc) {
55 libxml_use_internal_errors(
true);
56 $xmlValid = simplexml_load_string($script_doc) !==
false;
58 libxml_use_internal_errors(
false);
59 return array(
"xmlValid" => $xmlValid);
63 $sectionMaster = Array(
74 $self = $_SERVER[
'SCRIPT_NAME'] .
"?user_name={$user_name}&cu_name=" . urlencode($cu_name);
76 $act = isset($act) ? $act :
"";
77 $language = isset($language) ? $language :
"en_US";
78 $showTab = isset($showTab) ? $showTab :
'';
79 $selfShowTab = $showTab ==
"" ?
"" :
"&showTab=$showTab";
80 $responseLasts = isset($responseLasts) ? $responseLasts : 0;
82 $baseURL = $_SERVER[
"SCRIPT_NAME"];
86 where user_name = '{$user_name}'";
87 $result = db_query($query, $link);
89 $cuinfo_row = db_fetch_object($result);
90 $num_rows = db_num_rows($result);
92 $sql =
"select trim(addr1) \"cuAddrLine1\", trim(addr2) \"cuAddrLine2\", 93 trim(city) \"cuCity\", trim(state) \"cuState\", trim(zip) \"cuZip\", trim(main_phone) \"cuPhone\" 95 where user_name = '" . prep_save($user_name, 12) .
"'";
96 $sth = db_query($sql, $link);
97 $addrPhRow = db_num_rows($sth) > 0 ? db_fetch_assoc($sth, 0) : array();
99 function substituteKeywords($textIn, $cu, $cuName, $server, $mxcu, $dir, $addrPhRow)
102 $textIn = str_replace(
"CULOGIN", $cu, $textIn);
103 $textIn = str_replace(
"CUNAME", $cuName, $textIn);
104 $textIn = str_replace(
"CUSERVER", $server, $textIn);
105 $textIn = str_replace(
"CUMXCU", $mxcu, $textIn);
106 $textIn = str_replace(
"DBPREFIX", strtoupper($cu), $textIn);
107 $textIn = str_replace(
"HCUDIR", $dir, $textIn);
108 $textIn = str_replace(
"RECAPTCHASITEKEY", GetCaptchaSiteKey(), $textIn);
110 $phone = HCU_array_key_value(
"cuPhone", $addrPhRow);
111 $addr1 = HCU_array_key_value(
"cuAddrLine1", $addrPhRow);
112 $addr2 = HCU_array_key_value(
"cuAddrLine2", $addrPhRow);
113 $city = HCU_array_key_value(
"cuCity", $addrPhRow);
114 $state = HCU_array_key_value(
"cuState", $addrPhRow);
115 $zip = HCU_array_key_value(
"cuZip", $addrPhRow);
118 if (!empty($phone)) {
119 $phoneParts = explode(
"-", $phone);
120 $phone =
"(" . $phoneParts[0] .
") " . $phoneParts[1] .
"-" . $phoneParts[2];
126 if (!empty($addr1)) {
129 if (!empty($addr2)) {
132 if (!(empty($city) && empty($state) && empty($zip))) {
137 if (!empty($state)) {
138 if (!empty($addr3)) {
144 if (!empty($addr3)) {
152 $address = implode(
", ", $address);
154 $textIn = str_replace(
"CUPHONE", $phone, $textIn);
155 $textIn = str_replace(
"CUADDRESS", $address, $textIn);
159 function getFilePath($docInfo, $cu, $cuName, $server, $mxcu, $dir, $language, $addrPhRow)
161 $target= trim($docInfo[
"docstarget"]);
162 $targetName= trim($docInfo[
"docstargetname"]);
163 $regularName= HCU_array_key_exists(
"name", $docInfo) ? trim($docInfo[
"name"]) :
"";
164 if ($regularName ==
"")
165 $regularName= trim($docInfo[
"docsname"]);
166 $filePath=
"/home/$cu/public_html/";
167 $langExt= $language ==
"en_US" ?
"" :
"_" . substr( $language, 0, 2 );
168 $substitutedName = substituteKeywords($targetName, $cu, $cuName, $server, $mxcu, $dir, $addrPhRow);
176 $filePath .=
"mobile/";
179 $filePath .=
"bankingIncludes/$language/";
182 $filePath .=
"bankingIncludes/$language/";
184 if ($targetName !=
"")
186 if ($target ==
"public_html" || $target ==
"mobile")
189 $pos = strrpos($substitutedName,
".");
190 $filePath .= $pos ===
false ? $substitutedName . $langExt : substr_replace ($substitutedName, $langExt, $pos, 0);
193 $filePath .= $substitutedName;
197 $filePath .= $target ==
"public_html" || $target ==
"mobile" ?
"$regularName${langExt}.html" :
"$regularName.html";
213 $contentFragList = Array(
214 "AddChangeAdmin" => Array(
"fragName" =>
"addchangefrm2",
"fragESExt" =>
""),
215 "AddChangeForm" => Array(
"fragName" =>
"addchangefrm",
"fragESExt" =>
"_es"),
216 "AddChangeThanks" => Array(
"fragName" =>
"thanks_ac",
"fragESExt" =>
"_es"),
218 "alertTerms" => Array(
"fragName" =>
"alertfrag",
"fragESExt" =>
"_es"),
219 "bpPSCUNotice" =>
"",
220 "ccPaymentTnx" =>
"",
221 "ConnectNoService" => Array(
"fragName" =>
"nobillpayfrag",
"fragESExt" =>
"_es"),
222 "ConnectSpeedbump" =>
"",
223 "esNotice" => Array(
"fragName" =>
"EStatement",
"fragESExt" =>
"_es"),
224 "esTermsStart" => Array(
"fragName" =>
"agreefrag",
"fragESExt" =>
"_es"),
225 "esTermsStop" => Array(
"fragName" =>
"unagreefrag",
"fragESExt" =>
"_es"),
226 "loginNotice" => Array(
"fragName" =>
"LoginNotice",
"fragESExt" =>
"_es"),
228 "LogoutScreen" =>
"",
230 "profileDescNotice" =>
"",
231 "Promo ES" => Array(
"fragName" =>
"Promo",
"fragESExt" =>
"_es"),
232 "pwdRules" => Array(
"fragName" =>
"pwdRules",
"fragESExt" =>
"_es"),
233 "resetMemberPwd" => Array(
"fragName" =>
"unlockfrag",
"fragESExt" =>
"_es"),
234 "rptTransferTerms" => Array(
"fragName" =>
"repeattxfrag",
"fragESExt" =>
"_es"),
236 "signupfrm" => Array(
"fragName" =>
"signupfrm",
"fragESExt" =>
"_es"),
237 "smsHelp" => Array(
"fragName" =>
"sms_helpfrag",
"fragESExt" =>
"_es"),
238 "smsTerms" => Array(
"fragName" =>
"sms_agree",
"fragESExt" =>
"_es"),
239 "transferNotice" => Array(
"fragName" =>
"Transfer",
"fragESExt" =>
"_es"),
240 "TxnDownloadHelp" => Array(
"fragName" =>
"TxnDownloadHelp",
"fragESExt" =>
"_es")
244 $user_name = trim($cuinfo_row->user_name);
245 $cu_name = trim($cu_name);
246 $cu_mxcu = trim($cuinfo_row->mxcu);
247 $hcu_dir =
'banking';
248 switch (strtoupper(trim($act))):
252 $docInfo = SearchDocs( $f );
253 if ( $docInfo !=
null) {
255 <form action=
"$self&act=New" method=
"post">
256 <input type=
"hidden" name=
"f" value=
"{$f}">
257 <input type=
"hidden" name=
"language" value=
"$language">
258 <input type=
"hidden" name=
"user_name" value=
"$user_name">
259 <input type=
"hidden" name=
"cu_name" value=
"$cu_name">
260 <input type=
"hidden" name=
"cu_mxcu" value=
"$cu_mxcu">
261 <input type=
"hidden" name=
"hcu_dir" value=
"$hcu_dir">
262 <input type=
"hidden" name=
"showTab" value=
"$showTab">
263 <div
class=
'k-block k-shadow content-info'>
264 <div
class=
'k-header'>Custom Content Confirmation</div>
265 <div
class=
'content-text'>
268 This will create the file
'{$docInfo['docsname
']}'<br>
269 that is described as: {$docInfo[
'docsdesc']}.<br><br>
270 Are you sure
this is what you want to
do?
273 <input type=
"submit" name=
"btnSub" class=
'k-button k-primary' value=
"Create this">
274 <input type=
"button" name=
"btnCan" class=
'k-button' value=
"Yikes! I don't know what I am doing here!" onclick=
"document.location='$self$selfShowTab'">
291 if ( $useDefault !=
"Y" ) $useDefault =
"N";
292 if ( $showLink !=
"Y" ) $showLink =
"N";
293 if ( !ctype_digit($responseLasts) ) $responseLasts = 0;
295 if ( $responseLasts > 365 ) {
296 $responseLasts = 365;
298 if (trim($startDate) ==
'' || trim($startDate) ==
'null') {
299 $saveStartDate =
'NULL';
301 $testDate = date(
'm/d/Y', strtotime($startDate));
302 if (isdate($testDate)) {
303 $saveStartDate =
" '$testDate' ";
305 $saveStartDate =
'NULL';
308 if (trim($endDate) ==
'' || trim($endDate) ==
'null') {
309 $saveEndDate =
'NULL';
311 $testDate = date(
'm/d/Y', strtotime($endDate));
312 if (isdate($testDate)) {
313 $saveEndDate =
" '$testDate' ";
315 $saveEndDate =
'NULL';
320 $cuName = strtoupper($user_name);
323 $query =
"SELECT * FROM cucmsfrags WHERE docsid = $doc_id AND cu = '$cuName'";
324 $result = db_query($query, $link);
325 $row = db_fetch_assoc($result);
327 if ( $row[
"docsid"] > 0 ) {
329 $query =
"UPDATE cucmsfrags SET fragusedefault = '$useDefault', fraguselink = '$showLink', 330 fragclearresponse = $responseLasts, fragstartdate = {$saveStartDate}, 331 fragenddate = {$saveEndDate} WHERE docsid = $doc_id AND cu = '$cuName'";
334 $query =
"INSERT INTO cucmsfrags (docsid, cu, fragusedefault, fraglocation, fraguselink, fragclearresponse, fragstartdate, fragenddate) 335 VALUES ($doc_id, '$cuName', '$useDefault', '', '$showLink', $responseLasts, {$saveStartDate}, {$saveEndDate})";
338 db_query($query, $link);
340 header(
'Content-Type: application/json');
341 print json_encode(
"");
350 $cuName = strtoupper($user_name);
353 $query =
"DELETE FROM cucmsfrags WHERE docsid = $doc_id AND cu = '$cuName'";
354 db_query($query, $link);
356 header(
'Content-Type: application/json');
357 print json_encode(
"");
361 $currFragList = array();
362 $currFragList[] = array(
"script"=>
"alertfrag.html",
"desc"=>
"Alerts Terms of Use");
363 $currFragList[] = array(
"script"=>
"nobillpayfrag.html",
"desc"=>
"Bill Pay ID not Found");
364 $currFragList[] = array(
"script"=>
"agreefrag.html",
"desc"=>
"E-Statement START");
365 $currFragList[] = array(
"script"=>
"unagreefrag.html",
"desc"=>
"E-Statement STOP");
366 $currFragList[] = array(
"script"=>
"noestmntfrag.html",
"desc"=>
"E-Statement Flag Not Set");
367 $currFragList[] = array(
"script"=>
"EStatement.html",
"desc"=>
"E-Statement Message");
368 $currFragList[] = array(
"script"=>
"disclosure.html",
"desc"=>
"Home Banking Terms (BATCH)");
369 $currFragList[] = array(
"script"=>
"signupfrm.html",
"desc"=>
"Home Banking Signup Form");
370 $currFragList[] = array(
"script"=>
"onlinereply.html",
"desc"=>
"Home Banking Signup Reply");
371 $currFragList[] = array(
"script"=>
"ipayenrollfrag.html",
"desc"=>
"iPay SSO Auto-Enroll Message");
372 $currFragList[] = array(
"script"=>
"LoginNotice.html",
"desc"=>
"Login NCUA Notice");
373 $currFragList[] = array(
"script"=>
"Promo.html",
"desc"=>
"Login Promo Page",
"odd"=>
"#eeeeee");
374 $currFragList[] = array(
"script"=>
"NDTPromo.html",
"desc"=>
"CU-Dismissable Login Promo Page");
375 $currFragList[] = array(
"script"=>
"memsettingsfrag.html",
"desc"=>
"Member Settings (BATCH)");
376 $currFragList[] = array(
"script"=>
"addchangefrm.html",
"desc"=>
"Member Address Change Form");
377 $currFragList[] = array(
"script"=>
"addchangefrm2.html",
"desc"=>
"Member Address Change Secure Form output");
378 $currFragList[] = array(
"script"=>
"thanks_ac.html",
"desc"=>
"Member Address Change Thanks page");
379 $currFragList[] = array(
"script"=>
"MemberActfrag.html",
"desc"=>
"Member Auto-Activate authentication form");
380 $currFragList[] = array(
"script"=>
"MemberActThxfrag.html",
"desc"=>
"Member Auto-Activate Display new Password");
381 $currFragList[] = array(
"script"=>
"unlockfrag.html",
"desc"=>
"Member Password Reset");
382 $currFragList[] = array(
"script"=>
"lmenu.html",
"desc"=>
"Mobile Banking Embedded Menu");
383 $currFragList[] = array(
"script"=>
"onldepositdisclosure.html",
"desc"=>
"On-Line Deposit Terms of Use");
384 $currFragList[] = array(
"script"=>
"onldepositaddr.html",
"desc"=>
"On-Line Deposit Deposit Address");
385 $currFragList[] = array(
"script"=>
"lnappCuPortal.html",
"desc"=>
"On-Line Loan App Portal Menu");
386 $currFragList[] = array(
"script"=>
"pwdRules.html",
"desc"=>
"Password selection hints");
389 $currFragList[] = array(
"script"=>
"repeattxfrag.html",
"desc"=>
"Repeating Transfers Terms of Use");
390 $currFragList[] = array(
"script"=>
"noRDCfrag.html",
"desc"=>
"Remote Deposit Capture Terms of Use / Enroll Request");
391 $currFragList[] = array(
"script"=>
"sms_agree.html",
"desc"=>
"SMS Terms of Use");
392 $currFragList[] = array(
"script"=>
"sms_helpfrag.html",
"desc"=>
"SMS User Help Fragment");
393 $currFragList[] = array(
"script"=>
"Stopformfrag.html",
"desc"=>
"Stop Payment terms");
394 $currFragList[] = array(
"script"=>
"TxnDownloadHelp.html",
"desc"=>
"Transaction Download Help");
395 $currFragList[] = array(
"script"=>
"Transfer.html",
"desc"=>
"Transfer Message");
396 $currFragList[] = array(
"script"=>
"appconfig.xml",
"desc"=>
"App Config file for mobile devices");
397 $currFragList[] = array(
"script"=>
"mblnav.html",
"desc"=>
"MBL Navigation Menu");
398 $currFragList[] = array(
"script"=>
"mblnav_test.html",
"desc"=>
"MBL Navigation Menu TEST");
399 $currFragList[] = array(
"script"=>
"mblfooter.html",
"desc"=>
"MBL Footer Content");
400 $currFragList[] = array(
"script"=>
"mblEStatement.html",
"desc"=>
"MBL E-Statement Message");
401 $currFragList[] = array(
"script"=>
"mblLoginNotice.html",
"desc"=>
"MBL Login NCUA Notice");
402 $currFragList[] = array(
"script"=>
"mblPromo.html",
"desc"=>
"MBL Login Promo Page");
403 $currFragList[] = array(
"script"=>
"mblNDTPromo.html",
"desc"=>
"MBL CU-Dismissable Login Promo Page");
404 $currFragList[] = array(
"script"=>
"mblpwdRules.html",
"desc"=>
"MBL Password selection hints");
405 $currFragList[] = array(
"script"=>
"mblTxnDownloadHelp.html",
"desc"=>
"MBL Transaction Download Help");
406 $currFragList[] = array(
"script"=>
"mblTransfer.html",
"desc"=>
"MBL Transfer Message");
407 $currFragList[] = array(
"script"=>
"alertfrag_es.html",
"desc"=>
"(Spanish) Alerts Terms of Use");
408 $currFragList[] = array(
"script"=>
"agreefrag_es.html",
"desc"=>
"(Spanish) E-Statement START");
409 $currFragList[] = array(
"script"=>
"unagreefrag_es.html",
"desc"=>
"(Spanish)E-Statement STOP");
410 $currFragList[] = array(
"script"=>
"noestmntfrag_es.html",
"desc"=>
"(Spanish) E-Statement Flag Not Set");
411 $currFragList[] = array(
"script"=>
"EStatement_es.html",
"desc"=>
"(Spanish) E-Statement Message");
412 $currFragList[] = array(
"script"=>
"mmenu_es.html",
"desc"=>
"(Spanish) Home Banking Menu");
413 $currFragList[] = array(
"script"=>
"mindex_es.html",
"desc"=>
"(Spanish) Home Banking mindex_es.html");
414 $currFragList[] = array(
"script"=>
"disclosure_es.html",
"desc"=>
"(Spanish) Home Banking Terms (BATCH)");
415 $currFragList[] = array(
"script"=>
"signupfrm_es.html",
"desc"=>
"(Spanish) Home Banking Signup Form");
416 $currFragList[] = array(
"script"=>
"onlinereply_es.html",
"desc"=>
"(Spanish) Home Banking Signup Reply");
417 $currFragList[] = array(
"script"=>
"LoginNotice_es.html",
"desc"=>
"(Spanish) Login NCUA Notice");
418 $currFragList[] = array(
"script"=>
"Promo_es.html",
"desc"=>
"(Spanish) Login Promo Page",
"odd"=>
"#d7e1cc");
419 $currFragList[] = array(
"script"=>
"NDTPromo_es.html",
"desc"=>
"(Spanish) CU-Dismissable Login Promo Page");
420 $currFragList[] = array(
"script"=>
"memsettingsfrag_es.html",
"desc"=>
"(Spanish) Member Settings (BATCH)");
421 $currFragList[] = array(
"script"=>
"addchangefrm_es.html",
"desc"=>
"(Spanish) Member Address Change Form (uses English output)");
422 $currFragList[] = array(
"script"=>
"thanks_ac_es.html",
"desc"=>
"(Spanish) Member Address Change Thanks page");
423 $currFragList[] = array(
"script"=>
"MemberActfrag_es.html",
"desc"=>
"(Spanish) Member Auto-Activate authentication form");
424 $currFragList[] = array(
"script"=>
"MemberActThxfrag_es.html",
"desc"=>
"(Spanish) Member Auto-Activate Display new Password");
425 $currFragList[] = array(
"script"=>
"unlockfrag_es.html",
"desc"=>
"(Spanish) Member Password Reset");
426 $currFragList[] = array(
"script"=>
"lmenu_es.html",
"desc"=>
"(Spanish) Mobile Banking Embedded Menu");
427 $currFragList[] = array(
"script"=>
"pwdRules_es.html",
"desc"=>
"(Spanish) Password selection hints");
428 $currFragList[] = array(
"script"=>
"repeattxfrag_es.html",
"desc"=>
"(Spanish) Repeating Transfers Terms of Use");
429 $currFragList[] = array(
"script"=>
"sms_agree_es.html",
"desc"=>
"(Spanish) SMS Terms of Use");
430 $currFragList[] = array(
"script"=>
"sms_helpfrag_es.html",
"desc"=>
"(Spanish) SMS User Help Fragment");
431 $currFragList[] = array(
"script"=>
"TxnDownloadHelp_es.html",
"desc"=>
"(Spanish) Transaction Download Help");
432 $currFragList[] = array(
"script"=>
"Transfer_es.html",
"desc"=>
"(Spanish) Transfer Message");
433 $currFragList[] = array(
"script"=>
"mblnav_es.html",
"desc"=>
"(Spanish) MBL Navigation Menu");
434 $currFragList[] = array(
"script"=>
"mblnav_es_test.html",
"desc"=>
"(Spanish) MBL Navigation Menu TEST");
435 $currFragList[] = array(
"script"=>
"mblfooter_es.html",
"desc"=>
"(Spanish) MBL Footer Content");
436 $currFragList[] = array(
"script"=>
"mblEStatement_es.html",
"desc"=>
"(Spanish) MBL E-Statement Message");
437 $currFragList[] = array(
"script"=>
"mblLoginNotice_es.html",
"desc"=>
"(Spanish) MBL Login NCUA Notice");
438 $currFragList[] = array(
"script"=>
"mblPromo_es.html",
"desc"=>
"(Spanish) MBL Login Promo Page",
"odd"=>
"#d5dfe8");
439 $currFragList[] = array(
"script"=>
"mblNDTPromo_es.html",
"desc"=>
"(Spanish) MBL CU-Dismissable Login Promo Page");
440 $currFragList[] = array(
"script"=>
"mblpwdRules_es.html",
"desc"=>
"(Spanish) MBL Password selection hints");
441 $currFragList[] = array(
"script"=>
"mblTxnDownloadHelp_es.html",
"desc"=>
"(Spanish) MBL Transaction Download Help");
442 $currFragList[] = array(
"script"=>
"mblTransfer_es.html",
"desc"=>
"(Spanish) MBL Transfer Message");
445 $importList = array();
446 $importList[] = array(
"script"=>
"",
"desc"=>
"Select File...");
448 for ( $i = 0; $i < count( $currFragList ); $i++ ) {
449 if (file_exists($fragBasePath . $currFragList[$i][
"script"])) {
450 $importList[] = $currFragList[$i];
456 <form action=
"$self&act=FileImport" method=
"post">
457 <input type=
"hidden" name=
"f" value=
"{$f}">
458 <input type=
"hidden" name=
"language" value=
"$language">
459 <input type=
"hidden" name=
"user_name" value=
"$user_name">
460 <div
class=
'k-block k-shadow content-info'>
461 <div
class=
'k-header'>Choose Import File</div>
462 <div
class=
'content-text'>
465 <select name=
"import_file" id=
"import_file">
467 for ( $i = 0; $i < count( $importList ); $i++ ) {
468 print
"<option value={$importList[$i]["script
"]}>{$importList[$i]["desc
"]}</option>";
474 <input type=
"submit" id=
"btnImportFile" class=
'k-button k-primary' name=
"btnSub" value=
"Import File">
487 $docInfo = SearchDocs( $f );
488 if ( $docInfo !=
null) {
490 <form action=
"$self&act=CreateScript" method=
"post">
491 <input type=
"hidden" name=
"f" value=
"{$f}">
492 <input type=
"hidden" name=
"language" value=
"$language">
493 <input type=
"hidden" name=
"user_name" value=
"$user_name">
494 <input type=
"hidden" name=
"cu_name" value=
"$cu_name">
495 <input type=
"hidden" name=
"cu_mxcu" value=
"$cu_mxcu">
496 <input type=
"hidden" name=
"hcu_dir" value=
"$hcu_dir">
497 <input type=
"hidden" name=
"showTab" value=
"$showTab">
498 <div
class=
'k-block k-shadow content-info'>
499 <div
class=
'k-header'>Refresh Custom Content Confirmation</div>
500 <div
class=
'content-text'>
503 This will overwrite the existing file
'{$docInfo['docsname
']}'<br>
504 that is described as: {$docInfo[
'docsdesc']}.<br><br>
505 Are you sure
this is what you want to
do?
508 <input type=
"submit" name=
"btnSub" class=
'k-button k-primary' value=
"Overwrite file">
509 <input type=
"button" name=
"btnCan" class=
'k-button' value=
"I changed my mind" onclick=
"document.location='$self$selfShowTab'">
524 $docInfo = SearchDocs( $f );
526 if ( $docInfo !=
null) {
527 $skel_file =
"skel_" . $docInfo[
'docsname'];
530 $infourl = str_replace(
"//",
"//nobody:no1home@",$infourl);
534 if ($fp = fopen(
"$skeletonLocation/$language/$skel_file",
"r")) {
536 $contents .= fread($fp, 1024);
541 $contents = substituteKeywords($contents, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $addrPhRow);
542 $save_as = getFilePath($docInfo, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $language, $addrPhRow);
546 if (file_exists($save_as))
547 chmod($save_as, 0666);
550 if ($save_fp = fopen($save_as,
"w")) {
551 if (fwrite($save_fp, $contents)) {
556 chmod($save_as, 0644);
560 <div
class=
'k-block k-shadow content-info'>
561 <div
class=
'k-header'>Custom Content Script Confirmation</div>
562 <div
class=
'content-text'>
566 if ($file_save ==
true) {
568 The custom content file {$docInfo[
'docsname']} was refreshed and saved <b>successfully</b>.<br><br>
569 To
do this choose the edit option from the <a href=
"$self">menu</a>.<br><br>
570 This screen will refresh in 4 seconds.
572 setTimeout(
function(){
573 document.location =
'$self$selfShowTab';
580 An error occurred, the script was NOT saved successfully.<br>
581 Please
try again before screaming.
587 <input type=
"button" name=
"btnCan" class=
'k-button k-primary' value=
"Continue" onclick=
"document.location='$self$selfShowTab'">
601 $docInfo = SearchDocs( $f );
602 if ( $docInfo !=
null) {
604 <form action=
"$self&act=FileDelete" method=
"post">
605 <input type=
"hidden" name=
"f" value=
"{$f}">
606 <input type=
"hidden" name=
"language" value=
"$language">
607 <input type=
"hidden" name=
"user_name" value=
"$user_name">
608 <input type=
"hidden" name=
"cu_name" value=
"$cu_name">
609 <input type=
"hidden" name=
"cu_mxcu" value=
"$cu_mxcu">
610 <input type=
"hidden" name=
"hcu_dir" value=
"$hcu_dir">
611 <input type=
"hidden" name=
"showTab" value=
"$showTab">
612 <div
class=
'k-block k-shadow content-info'>
613 <div
class=
'k-header'>Delete Custom Content Confirmation</div>
614 <div
class=
'content-text'>
617 This will
delete the existing custom content file
'{$docInfo['docsname
']}'<br>
618 that is described as: {$docInfo[
'docsdesc']}.<br><br>
619 Are you sure
this is what you want to
do?
622 <input type=
"submit" name=
"btnSub" class=
'k-button k-primary' value=
"Please Delete">
623 <input type=
"button" name=
"btnCan" class=
'k-button' value=
"I changed my mind" onclick=
"document.location='$self$selfShowTab'">
638 $docInfo = SearchDocs( $f );
639 if ( $docInfo !=
null) {
640 $skel_file =
"skel_" . $docInfo[
'docsname'];
642 $delete = getFilePath($docInfo, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $language, $addrPhRow);
646 if (file_exists($delete)) {
647 if (unlink($delete)) {
653 <div
class=
'k-block k-shadow content-info'>
654 <div
class=
'k-header'>Delete Custom Content File</div>
655 <div
class=
'content-text'>
658 This will
delete the existing custom content file
'{$docInfo['docsname
']}'<br>
659 that is described as: {$docInfo[
'docsdesc']}.<br><br>
660 Are you sure
this is what you want to
do?
662 if ($file_del ==
true) {
664 The custom content file {$docInfo[
'docsname']} was deleted <b>successfully</b>.<br><br>
669 An error occurred, the Custom Content file was NOT deleted successfully.<br>
670 Please
try again before screaming.
674 <br/>Screen will refresh in 4 seconds.
677 <input type=
"button" name=
"btnCan" class=
'k-button k-primary' value=
"Continue" onclick=
"document.location='$self$selfShowTab'">
683 setTimeout(
function(){
684 document.location =
'$self$selfShowTab';
695 $docInfo = SearchDocs( $f );
698 $cuName = strtoupper($user_name);
700 $fragInfo = SearchFrags( $f, $cuName );
702 if ( $docInfo !=
null && $fragInfo !=
null ) {
704 if ( $fragInfo[
"fragusedefault"] ==
"Y" ) {
706 $cu_file =
"$exportLocation/$language/skel_{$docInfo['docsname']}";
708 $cu_file = getFilePath($docInfo, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $language, $addrPhRow);
710 $file_opened =
false;
711 if (file_exists($cu_file)) {
712 printMonitorPageTop(
'', $homecuKendoVersion, $cloudfrontDomainName,
'',
'',
true);
714 <body
id=
"fixedBody">
721 print
"File not found.";
739 $docInfo = SearchDocs( $f );
741 if ( $docInfo !=
null) {
744 if (strtoupper($act) ==
"NEW") {
745 $skel_file =
"skel_" . $docInfo[
'docsname'];
748 $infourl = str_replace(
"//",
"//nobody:no1home@",$infourl);
750 if (file_exists(
"$skeletonLocation/$language/$skel_file")) {
751 if ($fp = fopen(
"$skeletonLocation/$language/$skel_file",
"r")) {
753 $contents .= fread($fp, 1024);
758 $contents = substituteKeywords($contents, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $addrPhRow);
762 if ( $language !=
"en_US" ) {
763 if ($fp = fopen(
"$skeletonLocation/en_US/$skel_file",
"r")) {
765 $contents .= fread($fp, 1024);
769 $userWarning =
"Language-specific skeleton file missing. Using English file as a starting point.";
771 $contents = substituteKeywords($contents, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $addrPhRow);
774 $userWarning =
"No skeleton found. Starting new file for non-English.";
779 $userWarning =
"No skeleton found. Starting new file.";
784 }
else if (strtoupper($act) ==
"FILEIMPORT") {
786 if ($fp = fopen(
"/home/$user_name/public_html/$import_file",
"r")) {
788 $contents .= fread($fp, 1024);
796 $cu_file = getFilePath($docInfo, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $language, $addrPhRow);
798 $file_opened =
false;
800 if (file_exists($cu_file)) {
801 if ($fp = fopen($cu_file,
"r")) {
803 $contents = fread($fp, filesize($cu_file));
808 if ($file_opened ==
true) {
809 $includeFragClassicText =
"";
811 $showFragContents =
"";
812 $bolFragFound =
false;
814 $showcontents = htmlspecialchars($contents);
816 $textarea_TinyMCE =
"";
820 $sql =
"select www_server from cuinfo where user_name = '" . prep_save(strtolower($user_name), 12) .
"'";
821 $sth = db_query($sql, $link);
822 $www = $sth !==
false ? (db_num_rows($sth) > 0 ? trim(db_fetch_row($sth, 0)[0]) :
"") :
"";
823 $isMammoth = in_array($www, array(
"www",
"www4",
"www3",
"www5",
"www6"));
826 $oldLoc =
"https://$www.homecu.net/hcuadm/ContentMntc";
827 $url =
"$oldLoc?user_name=" . urlencode($user_name) .
"&cu_name=" . urlencode($cu_name) .
"&act=edit&f=" . urlencode($f) .
"&language=" 828 . urlencode($language) .
"&showTab=" . urlencode($showTab);
830 $ch = curl_init($url);
831 curl_setopt($ch,CURLOPT_COOKIE,
"HCUTicket=" . urlencode($_COOKIE[
'HCUTicket']));
832 curl_setopt($ch,CURLOPT_USERPWD,
"nobody:no1home");
833 curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); #
get response as
string 835 $rawresp = curl_exec($ch);
838 $start =
"<textarea id=\"script_doc\" name=\"script_doc\" rows=50 cols=90 class='mceCustomContent'>";
839 $end =
"</textarea>";
840 $startPos = strpos($rawresp, $start);
841 $endPos = strpos($rawresp, $end, $startPos);
843 if ($startPos !==
false && $endPos !==
false && $endPos > $startPos) {
844 $startMid = $startPos + strlen($start);
845 $lenMid = $endPos - $startMid;
846 $mammothScript = substr($rawresp, $startMid, $lenMid);
849 $includeFragClassicText =
'<textarea name="script_doc_CLASSIC" rows=50 cols=90 class="mceFragMntc" disabled="true">' 850 . $mammothScript .
'</textarea></div>';
854 if ( $userWarning ) {
855 print
"<h4><span style='background-color:yellow;'>$userWarning</span></h4>";
858 if ( $docInfo[
"docstype"] != 3 ) {
860 $contentAreaHeight = ($isMammoth ? 400 : 800);
862 $kendoStyle = GetMonitorDefaultKendoStyle();
863 print <<< set_TinyMCE
865 .mce-btn-small button {
869 <script type=
"text/javascript" src=
"https://{$cloudfrontDomainName}/homecu/js/tinymce/{$tinyMceVersion}/tinymce.min.js"></script>
870 <script type=
"text/javascript">
873 doctype :
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
874 selector :
"textarea.mceCustomContent",
877 height : {$contentAreaHeight},
878 content_css: [
"https://$cloudfrontDomainName/homecu/css/reset.4085.min.css",
"https://$cloudfrontDomainName/homecu/css/layout.4110.min.css",
879 "https://$cloudfrontDomainName/homecu/css/monitorCustom.tinyMCE.css",
"https://$cloudfrontDomainName/homecu/css/KendoUI/$homecuKendoVersion/kendo.common.min.css",
880 "https://$cloudfrontDomainName/homecu/css/KendoUI/$homecuKendoVersion/kendo.$kendoStyle.min.css"],
881 plugins : [
"autolink autosave link image lists charmap preview hr anchor spellchecker searchreplace wordcount visualchars code fullscreen insertdatetime nonbreaking save table contextmenu directionality emoticons textcolor paste textcolor"],
883 toolbar_items_size:
'small',
885 toolbar1 :
"save preview code | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
886 toolbar2 :
"cut copy paste pastetext pasteword | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image | insertdatetime inserttime | forecolor backcolor",
887 toolbar3 :
"table | hr removeformat visualaid | subscript superscript | charmap emoticons | spellchecker | visualchars nonbreaking | insertfile ",
888 relative_urls:
false,
889 remove_script_host :
false,
891 save_enablewhendirty :
true,
892 save_onsavecallback :
"savefile",
893 insertdatetime_formats: [
"%Y.%m.%d",
"%H:%M"],
895 valid_children :
"+body[style]",
896 valid_elements :
"+*[*]" 901 doctype :
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
902 selector :
"textarea.mceFragMntc",
906 plugins : [
"autolink autosave link image lists charmap preview hr anchor spellchecker searchreplace wordcount visualchars code fullscreen insertdatetime nonbreaking save table contextmenu directionality emoticons textcolor paste textcolor"],
908 toolbar_items_size:
'small',
911 relative_urls:
false,
912 remove_script_host :
false,
914 save_enablewhendirty :
true,
915 save_onsavecallback :
"savefile",
916 insertdatetime_formats: [
"%Y.%m.%d",
"%H:%M"],
919 valid_children :
"+body[style]",
920 valid_elements :
"+*[*]",
925 function savefile () {
927 document.forms[0].submit();
932 $fragFileStyle = (!$isMammoth ?
';display:none' :
'');
934 $mammothHeader = $isMammoth && $docInfo[
"docstype"] != 3 ?
"<div style='margin-top:20px;margin-bottom:20px;'> 935 <h6>Mammoth Script</h6> 938 $printPreviewButton =
"";
939 if ( $docInfo[
"docstype"] == 3 ) {
940 $printPreviewButton =
'<input type="button" class="k-button" name="btnCanc" value="Preview" onclick="Preview();">';
944 $isXML = substr(trim($docInfo[
"docsname"]), -4) ==
".xml";
945 $buttonType = $isXML ?
"button" :
"submit";
948 <script language=
"javascript">
952 $(
'#savefile').attr(
'target',
'_blank');
953 var initFormAction = $(
'#savefile').attr(
'action');
954 var initAct = $(
'#act').val();
955 $(
'#savefile').attr(
'action',
'$self&act=PREVIEWEDIT');
956 $(
'#act').val(
'PREVIEWEDIT');
958 $(
'#savefile').submit();
960 $(
'#savefile').attr(
'action', initFormAction);
961 $(
'#savefile').attr(
'target',
'');
962 $(
'#act').val(initAct);
968 var validateDS =
null;
969 function InitValidateDS() {
970 validateDS =
new kendo.data.DataSource({
973 url:
"<?php echo $baseURL; ?>",
980 parameterMap:
function(data, type) {
985 parse:
function(results) {
987 if (!results.xmlValid) {
988 var validDialog = $(
"#validDialog").data(
"kendoDialog");
989 if (validDialog ==
null) {
990 validDialog = $(
"<div id='validDialog'></div>").appendTo(
"body").kendoDialog({
991 title:
"Invalid XML",
992 content:
"Your document has invalid XML. Please correct and try again.",
994 {text:
"Okay", primary:
true}
997 if (window.activeWindows !=
null) {
998 window.activeWindows.push(
this);
1002 if (window.activeWindows !=
null) {
1003 window.activeWindows.pop();
1009 }).data(
"kendoDialog");
1016 $(
"[name='savefile']").submit();
1024 var activeWindows = [];
1025 $(document).ready(
function() {
1026 $(
"body").on(
"click",
".k-overlay",
function() {
if (activeWindows.length > 0) activeWindows[activeWindows.length - 1].close();
return false; });
1029 $(
"[name='btnSubmit']").click(
function() {
1030 validateDS.read({script_doc: $(
"[name='script_doc']").val()});
1035 print <<< print_html
1039 <form name=
"savefile" id=
'savefile' action=
"$self&act=SaveEdit" method=
"post">
1040 <input type=
"hidden" id=
'act' name=
"act" value=
"SaveEdit">
1041 <input type=
"hidden" name=
"f" value=
"$set_file">
1042 <input type=
"hidden" name=
"showTab" value=
"$showTab">
1043 <input type=
"hidden" name=
"language" value=
"$language">
1044 <input type=
"$buttonType" name=
"btnSubmit" class=
'k-button k-primary' value=
"Save my Changes">
1045 <input type=
"button" name=
"btnCanc" class=
'k-button' value=
"Don't save my Changes" onclick=
"document.location='$self$selfShowTab'">
1046 {$printPreviewButton}
1047 <span style=
'font-weight:300; padding-left: 100px;'>File: {$docInfo[
'docsname']}</span>
1049 <textarea
id=
"script_doc" name=
"script_doc" rows=50 cols=90
class=
'mceCustomContent'>$showcontents</textarea>
1051 {$includeFragClassicText}
1056 print print_error(
"The file could not be found ($act).");
1060 print print_error();
1067 $docInfo = SearchDocs( $f );
1068 if ( $docInfo !=
null) {
1070 libxml_use_internal_errors(
true);
1074 if (substr(trim($docInfo[
"docsname"]), -4) ==
".xml") {
1075 $xmlValid = simplexml_load_string($script_doc) !==
false;
1078 libxml_use_internal_errors(
false);
1081 $save_as = getFilePath($docInfo, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $language, $addrPhRow);
1083 $contents = $script_doc;
1087 if (file_exists($save_as))
1088 chmod($save_as, 0666);
1091 if ($save_fp = fopen($save_as,
"w")) {
1092 if (fwrite($save_fp, $contents)) {
1099 chmod($save_as, 0644);
1103 print <<< print_html
1104 <div
class=
'k-block k-shadow content-info'>
1105 <div
class=
'k-header'>Custom Content Confirmation</div>
1106 <div
class=
'content-text'>
1112 print trim($docInfo[
"docsname"]) .
"'s XML was not valid.<br><br>";
1113 }
else if ($file_save ==
true) {
1114 print <<< print_html
1115 The script {$docInfo[
'docsname']} was saved <b>successfully</b>.<br><br>
1116 To
do this choose the edit option from the <a href=
"$self$selfShowTab">menu</a></br>
1117 Screen will refresh in 4 seconds.
1119 setTimeout(
function(){
1120 document.location =
'$self$selfShowTab';
1127 print <<< print_html
1128 An error occurred, the script was NOT saved successfully.<br>
1129 Please
try again before screaming.
1132 print <<< print_html
1135 <input type=
"button" name=
"btnCan" class=
'k-button k-primary' value=
"Continue" onclick=
"document.location='$self$selfShowTab'">
1142 print print_error();
1149 $docInfo = SearchDocs( $f );
1152 header(
"X-XSS-Protection:0");
1155 printMonitorPageTop(
'', $homecuKendoVersion, $cloudfrontDomainName,
'',
'',
true);
1157 <body
id=
"fixedBody">
1169 $cuSettings = Array(
"language" => Array(
"en_US" =>
"English" ) );
1170 if ($user_name !=
'') {
1172 $loadSettingsFile =
"/home/{$user_name}/public_html/bankingIncludes/production/hcuSettings.i";
1174 if (is_readable($loadSettingsFile)) {
1176 $fileContent = file_get_contents($loadSettingsFile);
1178 $cuSettings = json_decode($fileContent,
true);
1180 if (json_last_error() != JSON_ERROR_NONE) {
1182 $cuSettings = Array(
"language" => Array(
"en_US" =>
"English" ) );
1187 $cuName = strtoupper($user_name);
1188 $languages = $cuSettings[
"language"];
1189 $languageKeys = array_keys( $languages );
1192 $order_by =
"CASE WHEN coalesce(docsmaintsection, '') = '' THEN 0 ";
1193 foreach ($sectionMaster as $sectionKey => $sectionValue) {
1194 $order_by .=
" WHEN docsmaintsection = '$sectionValue' THEN $sectionKey ";
1196 $order_by .=
"ELSE 0 END, CASE WHEN cucmsfrags.docsid is null then 1 else 0 end, cucmsdocs.docsmaintsort, lower(cucmsdocs.docsname)";
1198 $query =
"SELECT CASE WHEN cucmsfrags.docsid is null then 1 else 0 end, cucmsdocs.*, 1199 case when coalesce(cucmsdocs.docsmaintsection, '') = '' then '{$sectionMaster[0]}' else cucmsdocs.docsmaintsection end as docssectionname 1201 LEFT JOIN cucmsfrags on 1202 cucmsdocs.docsid = cucmsfrags.docsid 1203 AND cucmsfrags.cu = '$cuName' 1204 where cucmsdocs.docstype in (1,2,3) 1205 ORDER BY $order_by";
1207 $result = db_query($query, $link);
1211 $dataForGrid = array();
1212 $dataSectionGrid = array();
1213 while ($contentRow = db_fetch_assoc($result, $row)) {
1218 $entry[
"doc_id"] = $contentRow[
"docsid"];
1220 $docsName = $contentRow[
'docsname'];
1221 $entry[
"name"] = $docsName;
1222 $entry[
'responseType'] = $contentRow[
'docsresponsetype'];
1223 $entry[
"docstype"] = $contentRow[
"docstype"];
1225 $entry[
"desc"] = $contentRow[
"docsdesc"];
1226 $entry[
"docsmaintsection"] = $contentRow[
"docsmaintsection"];
1229 $query =
"SELECT *, to_char(fragstartdate, 'mm/dd/yyyy') as formstartdate, to_char(fragenddate, 'mm/dd/yyyy') as formenddate FROM cucmsfrags WHERE docsid = {$contentRow["docsid
"]} AND cu = '$cuName'";
1230 $resultFragEntry = db_query($query, $link);
1232 $fragRow = db_fetch_assoc( $resultFragEntry );
1234 if ( $fragRow[
"docsid"] > 0 ) {
1235 $entry[
"frag"] =
true;
1236 $entry[
"useDefault"] = $fragRow[
"fragusedefault"];
1237 $entry[
"showLink"] = $fragRow[
"fraguselink"];
1238 $entry[
"responseLasts"] = $fragRow[
"fragclearresponse"];
1239 $entry[
"startDate"] = $fragRow[
"formstartdate"];
1240 $entry[
"endDate"] = $fragRow[
"formenddate"];
1242 $entry[
"frag"] =
false;
1243 $entry[
"useDefault"] =
"";
1244 $entry[
"showLink"] =
"";
1245 $entry[
"responseLasts"] =
"";
1246 $entry[
"startDate"] =
"";
1247 $entry[
"endDate"] =
"";
1251 $entry[
"docstarget"]= $contentRow[
"docstarget"];
1252 $entry[
"docstargetname"]= $contentRow[
"docstargetname"];
1255 $langList = array();
1256 for ( $i = 0; $i < count( $languageKeys ); $i++ ) {
1257 $lang = $languageKeys[$i];
1259 $filePathName = getFilePath($entry, $user_name, $cu_name, $home_host, $cu_mxcu, $hcu_dir, $lang, $addrPhRow);
1261 $fileExists = file_exists( $filePathName );
1263 $entry[$lang] = $fileExists;
1267 $dataForGrid[] = $entry;
1268 $dataSectionGrid[$contentRow[
'docssectionname']][] = $entry;
1272 usort( $dataForGrid,
"cmp" );
1280 <!-- KENDO UI CSS Includes -->
1281 <link rel=
"stylesheet" media=
"all" type=
"text/css" href=
"https://<?php echo $cloudfrontDomainName; ?>/homecu/css/reset.css" />
1283 <link href=
"https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.common.min.css" rel=
"stylesheet">
1284 <link href=
"https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.<?php echo GetMonitorDefaultKendoStyle(); ?>.min.css" rel=
"stylesheet">
1285 <link href=
"/monitor/css/monitor-core.css" rel=
"stylesheet">
1287 <!-- Required Jquery min -->
1288 <script type=
"text/javascript" src=
"https://<?php echo $cloudfrontDomainName; ?>/jquery/js/jquery-1.10.2.min.js.gz"></script>
1290 <!-- KENDO UI JS scripts -->
1291 <script src=
"https://<?php echo $cloudfrontDomainName; ?>/homecu/js/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.web.min.js.gz"></script>
1293 <div style=
'font-size:12px; width:1000px; overflow: hidden;'>
1295 <div
id=
"contentStrip">
1297 <?php reset($sectionMaster);
1298 foreach ($sectionMaster as $sectionKey => $sectionValue) : ?>
1299 <li <?php
if ($sectionKey == 0) { echo
'class="k-state-active"'; } ?>>
1300 <?php echo $sectionValue; ?>
1302 <?php endforeach; ?>
1305 <div
id=
"contentFiles" class=
"k-content"></div>
1306 <div
id=
"progressShow" style=
"z-index:20000;"></div>
1309 <script type=
"text/javascript">
1310 var gridSource = <?php echo json_encode($dataForGrid); ?>;
1311 var gridSectionSource = <?php echo json_encode($dataSectionGrid); ?>;
1314 var containsFilter =
1317 operators : { string : { contains :
"Contains"}},
1318 ui :
function( element )
1320 var parent = element.parent();
1321 while( parent.children().length > 1 )
1322 $(parent.children()[0]).
remove( );
1324 parent.prepend(
"<input data-bind=\"value:filters[0].value\" class=\"k-textbox\" type=\"text\">" );
1327 var gridColumnList = [
1328 { title:
"", width:
"80px", scrollable:
false },
1329 { field:
"name", title:
"Doc Name", width:
"120px", filterable: containsFilter, scrollable:
false },
1330 { field:
"desc", title:
"Description", width:
"200px", filterable: containsFilter },
1331 { field:
"useDefault", title:
"Use Def", width:
"50px", filterable:
false },
1332 { field:
"showLink", title:
"Show Link", width:
"50px", filterable:
false },
1333 { field:
"responseLasts", title:
"Clear", width:
"50px", filterable:
false },
1336 for ( $i = 0; $i < count( $languageKeys ); $i++ ) {
1337 $fieldName = $languageKeys[$i];
1338 $title = $languages[$languageKeys[$i]];
1340 { field:
"<?php echo $fieldName ?>", title:
"<?php echo $title ?>", width:
"95px", filterable:
false },
1344 { field:
"startDate", title:
"Start Date", format:
"{0:MM/dd/yyyy}", hidden:
true},
1345 { field:
"endDate", title:
"End Date", format:
"{0:MM/dd/yyyy}", hidden:
true},
1346 { field:
"responseType", hidden:
true },
1347 { title:
"", width:
"90px" }
1350 var initTables =
function(e) {
1351 <?php reset($sectionMaster);
1352 foreach ($sectionMaster as $sectionKey => $sectionValue) : ?>
1354 $(
'#<?php echo str_replace(' ', '_
', $sectionValue); ?>-grid').kendoGrid({
1355 dataSource: gridSectionSource[
'<?php echo $sectionValue; ?>'],
1364 confirmation:
"Are you sure you want to delete this record?",
1365 template: kendo.template($(
"#popup-editor").html())
1367 filterable: { contains:
true },
1368 columns: gridColumnList,
1369 change:
function(e) {
1370 var selectedRow = this.dataItem(this.select());
1372 this.editRow(this.select());
1374 remove:
function(e) {
1376 var rowData = JSON.parse(JSON.stringify(e.model));
1378 postData[
"act"] =
"DELETEROW";
1379 postData[
"showTab"] =
'<?php echo $sectionKey; ?>';
1380 postData[
"user_name"] =
"<?php echo $user_name ?>";
1381 postData[
"doc_id"] = rowData[
"doc_id"];
1382 postData[
"cu_name"] =
"<?php echo $cu_name ?>";
1384 var parameters =
"";
1385 $.each(postData,
function( index,
object ) {
1386 if ( parameters.length > 0 ) parameters +=
"&";
1387 parameters += index +
"=" +
object;
1390 kendo.ui.progress($(
'#progressShow'),
true);
1392 url:
'<?php echo $baseURL ?>',
1395 success:
function (data) {
1397 location.href =
"<?php echo $self ?>&showTab=<?php echo $sectionKey; ?>";
1399 error:
function (data) {
1400 kendo.ui.progress($(
'#progressShow'),
false);
1401 alert(
'Some error happened.');
1410 switch (e.model.responseType) {
1414 if ((e.model.endDate ===
null ? 0 : e.model.endDate.toString().length) !== 0
1415 || (e.model.startDate ===
null ? 0 : e.model.startDate.toString().length) !== 0) {
1418 if ((e.model.endDate ===
null ? 0 : e.model.endDate.toString().length) === 0
1419 || (e.model.startDate ===
null ? 0 : e.model.startDate.toString().length) === 0) {
1420 alert(
"When setting date values, both dates must be entered.");
1423 }
else if (e.model.endDate <= e.model.startDate) {
1424 alert(
"The ending date must be greater than start date.");
1433 var postData = JSON.parse(JSON.stringify(e.model));
1434 postData[
"act"] =
"UPDATE";
1435 postData[
"showTab"] =
'<?php echo $sectionKey; ?>';
1436 postData[
"user_name"] =
"<?php echo $user_name ?>";
1437 postData[
"cu_name"] =
"<?php echo $cu_name ?>";
1440 if ( postData[
"responseLasts"] > 365 ) postData[
"reponseLasts"] = 365;
1442 var idUpdated = postData[
"doc_id"];
1443 var parameters =
"";
1444 $.each(postData,
function( index,
object ) {
1445 if ( parameters.length > 0 ) parameters +=
"&";
1446 parameters += index +
"=" +
object;
1449 kendo.ui.progress($(
'#progressShow'),
true);
1452 url:
'<?php echo $baseURL ?>',
1455 success:
function (data, status, xhr) {
1457 $.each(gridSectionSource[
'<?php echo $sectionValue; ?>'],
function( index,
object ) {
1458 if (
object[
"doc_id"] == idUpdated ) {
1459 object[
"useDefault"] = postData[
"useDefault"];
1460 object[
"showLink"] = postData[
"showLink"];
1461 object[
"responseLasts"] = postData[
"responseLasts"];
1468 if ( !postData[
"frag"] ) {
1469 location.href =
"<?php echo $self ?>&showTab=<?php echo $sectionKey; ?>";
1474 error:
function (xhr, status, error) {
1475 alert(
'Some error happened:' + error);
1478 complete:
function( xhr, status ) {
1479 kendo.ui.progress($(
'#progressShow'),
false);
1483 dataBound:
function () {
1484 $(
"table tbody tr").hover(
1486 $(
this).toggleClass(
"k-state-hover");
1491 rowTemplate: kendo.template($(
"#rowTemplate").html()),
1492 altRowTemplate: kendo.template($(
"#altRowTemplate").html())
1498 <?php endforeach; ?>
1500 $(document).ready(
function() {
1501 $(
'#contentStrip').kendoTabStrip({
1502 animation: { open: { effects:
"fadeIn" } },
1503 dataTextField:
"sectionValue",
1504 dataContentField:
"sectionContent",
1506 <?php reset($sectionMaster);
1507 foreach ($sectionMaster as $sectionKey => $sectionValue) : ?>
1508 <?php echo ($sectionKey > 0 ?
', ' :
''); ?>
1510 sectionValue:
"<?php echo $sectionValue; ?>",
1511 sectionContent:
'<div id="<?php echo str_replace(' ', '_
', $sectionValue); ?>-grid"></div>' 1513 <?php endforeach; ?>
1517 }).data(
'kendoTabStrip').select(0);
1521 wnd = $(
"#modalDeleteWindow").kendoWindow({
1522 title:
"Delete confirmation",
1527 }).data(
"kendoWindow");
1529 <?php
if ($showTab !=
''): ?>
1530 $(
'#contentStrip').data(
'kendoTabStrip').select(<?php echo $showTab; ?>);
1534 function HandleActions(selectObject, action, docId, language) {
1535 var cu =
"<?php echo trim($user_name) ?>";
1537 if ( action ===
"edit" ) {
1538 location.href=
"<?php echo $self?>&act=edit&f=" + docId +
"&user_name=" + cu +
"&language=" + language +
"&showTab=" + $(
'#contentStrip').data(
'kendoTabStrip').select().index();
1540 else if ( action ===
"preview" ) {
1541 OpenPreview(
"<?php echo $self?>&act=preview&f=" + docId +
"&user_name=" + cu +
"&language=" + language);
1544 $(selectObject).val(
'' );
1546 var dropdownlist = $(
"#dropdownlist").data(
"kendoDropDownList");
1548 var test2 =
'string';
1550 else if ( action ===
"refresh" ) {
1551 location.href=
"<?php echo $self?>&act=refresh&f=" + docId +
"&user_name=" + cu +
"&language=" + language +
"&showTab=" + $(
'#contentStrip').data(
'kendoTabStrip').select().index();
1553 else if ( action ===
"delete" ) {
1554 location.href=
"<?php echo $self?>&act=delete&f=" + docId +
"&user_name=" + cu +
"&language=" + language +
"&showTab=" + $(
'#contentStrip').data(
'kendoTabStrip').select().index();
1556 else if ( action ===
"create" ) {
1557 location.href=
"<?php echo $self?>&act=create&f=" + docId +
"&user_name=" + cu +
"&language=" + language +
"&showTab=" + $(
'#contentStrip').data(
'kendoTabStrip').select().index();
1559 else if ( action ===
"import" ) {
1560 location.href=
"<?php echo $self?>&act=import&f=" + docId +
"&user_name=" + cu +
"&language=" + language +
"&showTab=" + $(
'#contentStrip').data(
'kendoTabStrip').select().index();
1565 function OpenPreview(url) {
1566 $(document.body).append(
'<div id="previewWindow"></div>');
1567 $(
'#previewWindow').kendoWindow({
1569 actions: [
"Close" ],
1576 close:
function(e) {
1577 var dialog = $(
"#previewWindow").data(
"kendoWindow");
1583 var dialog = $(
"#previewWindow").data(
'kendoWindow');
1584 dialog.center().open();
1587 function StartImport(url) {
1588 $(document.body).append(
'<div id="importWindow"></div>');
1589 $(
'#importWindow').kendoWindow({
1591 actions: [
"Close" ],
1594 title:
"Import existing Fragment file",
1598 close:
function(e) {
1599 var dialog = $(
"#importWindow").data(
"kendoWindow");
1605 var dialog = $(
"#importWindow").data(
'kendoWindow');
1606 dialog.center().open();
1609 <script
id=
"rowTemplate" type=
"text/x-kendo-tmpl">
1610 # var rowBgColor = (!frag ? 'background-color: \#CBCBCB;' : (name.substring(0, 3) == 'NOTmbl' ? 'background-color: \#E0EAFF;' : '')); # 1611 # var btnText = (!frag ? 'Add' : 'Edit'); # 1612 <tr data-uid=
"#= uid #" style=
"#= rowBgColor #">
1613 <td #
if ( !frag) { # style=
"background-color: \#FFF0F0;" # } #>
1614 <a
class=
"k-button k-button-icontext k-grid-edit" href=
"\#">
1615 <span
class=
"k-icon k-i-edit"></span>#= btnText #
1620 <td>#= useDefault #</td>
1621 <td>#= showLink #</td>
1622 <td>#= responseLasts #</td>
1625 for ( $i = 0; $i < count( $languageKeys ); $i++ ) {
1628 # if ( frag && useDefault == "Y" ) { # 1629 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1630 <option value=
"">Action...</option>
1631 <option value=
"preview">Preview</option>
1633 # } else if ( frag && <?php echo $languageKeys[$i] ?> ) { # 1634 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1635 <option value=
"">Action...</option>
1636 <option value=
"edit">Edit</option>
1637 <option value=
"preview">Preview</option>
1638 <option value=
"refresh">Refresh</option>
1639 <option value=
"delete">Delete</option>
1641 # } else if ( frag ) { # 1642 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1643 <option value=
"">Missing...</option>
1644 <option value=
'create'>Create</option>
1645 <option value=
'import'>Import</option>
1656 <a
class=
"k-button k-button-icontext k-grid-delete" href=
"\#">
1657 <span
class=
"k-icon k-i-delete"></span>Delete
1665 <script
id=
"altRowTemplate" type=
"text/x-kendo-tmpl">
1666 # var rowBgColor = (!frag ? 'background-color: \#CBCBCB;' : (name.substring(0, 3) == 'NOTmbl' ? 'background-color: \#BBCCF0;' : '')); # 1667 # var btnText = (!frag ? 'Add' : 'Edit'); # 1668 <tr
class=
"k-alt" data-uid=
"#= uid #" style=
"#= rowBgColor #">
1669 <td #
if ( !frag ) { # style=
"background-color: \#FFF0F0;" # } #>
1670 <a
class=
"k-button k-button-icontext k-grid-edit" href=
"\#">
1671 <span
class=
"k-icon k-i-edit"></span>#= btnText #
1676 <td>#= useDefault #</td>
1677 <td>#= showLink #</td>
1678 <td>#= responseLasts #</td>
1681 for ( $i = 0; $i < count( $languageKeys ); $i++ ) {
1684 # if ( frag && useDefault == "Y" ) { # 1685 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1686 <option value=
"">Action...</option>
1687 <option value=
"preview">Preview</option>
1689 # } else if ( frag && <?php echo $languageKeys[$i] ?> ) { # 1690 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1691 <option value=
"">Action...</option>
1692 <option value=
"edit">Edit</option>
1693 <option value=
"preview">Preview</option>
1694 <option value=
"refresh">Refresh</option>
1695 <option value=
"delete">Delete</option>
1697 # } else if ( frag ) { # 1698 <select onchange=
'if (this.value) { HandleActions( this, this.value, "#: doc_id #", "<?php echo $languageKeys[$i] ?>" ); }'>
1699 <option value=
"">Missing...</option>
1700 <option value=
'create'>Create</option>
1701 <option value=
'import'>Import</option>
1712 <a
class=
"k-button k-button-icontext k-grid-delete" href=
"\#">
1713 <span
class=
"k-icon k-i-delete"></span>Delete
1721 <script
id=
"popup-editor" type=
"text/x-kendo-template">
1722 <h3 style=
'text-align:center;'>Edit Custom Content Entry</h3>
1723 <span style=
'text-align:center;'>
1724 <table style=
'width:100%;'>
1726 <td
class=
"edit_label"><label>Name:</td><td
class=
'edit_entry'><input name=
"name" readonly /></label></td>
1729 <td
class=
"edit_label"><label
for=
"useDefault">Use Default:</label></td><td
class=
'edit_entry'><input type=
"radio" name=
"useDefault" id=
"useDefault" value=
"Y" />Yes <input type=
"radio" name=
"useDefault" id=
"useDefault" value=
"N" />No </td>
1732 <td
class=
"edit_label"><label
for=
"showLink">Show Button Link:</label></td><td
class=
'edit_entry'><input type=
"radio" name=
"showLink" id=
"showLink" value=
"Y" />Yes <input type=
"radio" name=
"showLink" id=
"showLink" value=
"N" />No </td>
1735 <td
class=
"edit_label"><label
for=
"responseLasts">Auto-Clear Response:</label></td><td
class=
'edit_entry'><input data-role=
"numerictextbox" data-decimals=0 data-format=
"\\#" min=
'0' max=
'365' name=
"responseLasts" id=
"responseLasts" style=
"width:75px"/></td>
1737 # var localResponseType = data.responseType; # 1738 # switch (data.responseType) { 1743 <td
class=
"edit_label"><label
for=
"startDate">Start Date:</label></td><td
class=
'edit_entry'><input data-role=
"datepicker" data-format=
"MM/dd/yyyy" name=
"startDate" id=
"startDate" /></td>
1746 <td
class=
"edit_label"><label
for=
"endDate">End Date:</label></td><td
class=
'edit_entry'><input data-role=
"datepicker" data-format=
"MM/dd/yyyy" name=
"endDate" id=
"endDate" /></td>
1755 .edit_label { text-align: right; font-weight: bold; width: 50%; }
1756 .edit_entry { text-align: left; }
1764 print <<< print_html
1771 function print_top() {
1772 $title=
"Custom Content Management";
1773 global $homecuKendoVersion, $cloudfrontDomainName;
1774 printMonitorPageTop($title, $homecuKendoVersion, $cloudfrontDomainName);
1790 .content-info .content-text {
1794 .content-info .k-header {
1799 printMonitorPageMiddle($title,
null,
true);
1803 function print_bottom() {
1804 printMonitorPageBottom();
1806 function print_error($optionalMsg =
"") {
1807 global $self, $selfShowTab;
1809 $optionalMsg .= ($optionalMsg !=
'' ?
'<br/>' :
'');
1810 $printError = <<< print_html
1811 <div
class=
'k-block k-shadow content-info'>
1812 <div
class=
'k-header'>Custom Content Error</div>
1813 <div
class=
'content-text'>
1817 An unexpected error was raised when processing your selection. Please go back to the <a href=
"$self$selfShowTab">menu</a><br>
1818 and select again.<br/>
1819 Screen will refresh in 4 seconds.
1825 setTimeout(
function(){
1826 document.location =
'$self$selfShowTab';
1832 function SearchDocs( $docId ) {
1838 WHERE docsid = $docId";
1840 $result = db_query($query, $link);
1842 $contentRow = db_fetch_assoc($result);
1843 if ( $contentRow[
"docsid"] > 0 )
1849 function SearchFrags( $docId, $cuCode ) {
1855 WHERE docsid = $docId 1856 AND cu = '$cuCode'";
1858 $result = db_query($query, $link);
1860 $contentRow = db_fetch_assoc($result);
1861 if ( $contentRow[
"docsid"] > 0 )
1867 function cmp($a, $b)
1869 return strcasecmp($a[
"name"], $b[
"name"]);