2 $monLibrary= dirname(__FILE__) .
"/../library";
3 $sharedLibrary= dirname(__FILE__) .
"/../../shared/library";
4 require_once(
"$monLibrary/cu_top.i");
5 require_once(
"$monLibrary/ck_hticket.i");
6 require_once(
"$monLibrary/cu_pass.i");
7 require_once(
"$sharedLibrary/cu_flagconst.i");
10 if (!CheckPerm($link, $Hu, basename($_SERVER[
'SCRIPT_NAME']), $_SERVER[
'REMOTE_ADDR'])) {
13 header(
"Location: /hcuadm/hcu_noperm.prg");
24 $rateOptions = Array(
'140',
'145',
'150',
'155',
'160',
'165',
'170',
'175',
'180');
26 $dms_ok=array(
"Flang"=>
"string",
"rowid"=>
"string",
"action"=>
"string",
27 "cu"=>
"string",
"vendor"=>
"string",
"tz"=>
"string",
28 "dnid"=>
"string",
"livebatch"=>
"string",
"liveserver"=>
"string",
29 "ahdropdays"=>
"string",
"lhdropdays"=>
"string",
30 "retrylimit"=>
"digits",
"histdays"=>
"digits",
32 "IVRLoadXA"=>
"digits",
"IVRIncDiv"=>
"digits",
"IVRHistRecs"=>
"digits",
33 "IVRWDChk"=>
"digits",
"IVRLoanAddOn"=>
"digits",
"IVRLoadCC18"=>
"digits",
"IVRPostCC18CP"=>
"digits",
34 "IVRCCAdv"=>
"digits",
"IVRAltDep"=>
"digits",
"IVRSelAcctMethod"=>
"string",
35 "prependAcctType"=>
"digits",
"draftStripZero"=>
"digits",
36 "draftTypePad"=>
"digits",
"IVRAddMbrFromCore"=>
"digits",
"IVRMulti"=>
"digits",
37 "IVRReviewAll"=>
"digits",
"IVRLoadXAFromJoint"=>
"digits",
"IVRLoadCCAsLoan"=>
"digits",
38 "IVRPlayFetchMsg"=>
"digits",
"allowRatesMenu"=>
'digits',
"allowHoursMenu"=>
"digits",
39 "IVRSelDepBalInfo"=>
"digits",
"IVRSelLoanBalInfo"=>
"digits",
"IVRSpeedRate"=>
"digits" );
41 dms_import_v2($gNameSpace,
"POST", $dms_ok);
44 $audio_files_folder =
"/home/asterisk/sounds";
46 function check_fields() {
56 if (trim($gNameSpace[
"POST"][
"cu"]) ==
"")
57 $err_msg =
"CU must exist.<br>";
60 $ahdropdays = strtoupper(trim($gNameSpace[
"POST"][
"ahdropdays"]));
61 if ($ahdropdays !=
"HOLD") {
63 $ahdropdays = intval($ahdropdays);
65 $err_msg .=
"Invalid entry for Account History Drop Days. The value must be either 'HOLD' or a minimum of 94 days.<br>";
69 $lhdropdays = strtoupper(trim($gNameSpace[
"POST"][
"lhdropdays"]));
70 if ($lhdropdays !=
"HOLD") {
72 $lhdropdays = intval($lhdropdays);
73 if ($lhdropdays < 187)
74 $err_msg .=
"Invalid entry for Loan History Drop Days. The value must be either 'HOLD' or a minimum of 187 days.<br>";
80 function print_java() {
83 <script language=
"javascript">
84 <!-- Hide Javascript from older browsers
89 var db_select =
false;
90 var mtx_select =
false;
100 ahdays = document.zero.elements[
'ahdropdays'].value;
101 ahdays = ahdays.toUpperCase();
102 if (ahdays !=
'HOLD') {
104 ahdays = parseInt(ahdays);
106 err_msg +=
"Invalid entry for Account History Drop Days. Valid Entries are: Hold, number >= 94.\\n";
108 err_msg +=
"Invalid entry for Account History Drop Days. Valid Entries are: Hold, number >= 94.\\n";
112 lhdays = document.zero.elements[
'lhdropdays'].value;
113 lhdays = lhdays.toUpperCase();
114 if (lhdays !=
'HOLD') {
116 lhdays = parseInt(lhdays);
118 err_msg +=
"Invalid entry for Loan History Drop Days. Valid Entries are: Hold, number >= 187.\\n";
119 else if(lhdays < 187)
120 err_msg +=
"Invalid entry for Loan History Drop Days. Valid Entries are: Hold, number >= 187.\\n";
124 var CCLoad18 = document.getElementById(
'IVRLoadCCAsLoan').checked;
125 var Post18CP = document.getElementById(
'IVRPostCC18CP').checked;
126 if (Post18CP && !CCLoad18) {
127 err_msg +=
"\"Post payment as 'CP'\" not allowed unless \"Include Type 18 Credit Card as Loan\" is selected.\\n";
131 err_msg +=
"\\nThese must be fixed before you are allowed to save this Credit Union.\\n";
132 window.alert(err_msg);
147 $action = $gNameSpace[
"POST"][
"action"];
148 $rowid = $gNameSpace[
"POST"][
"rowid"];
149 $cu = $gNameSpace[
"POST"][
"cu"];
150 $self= $_SERVER[
'PHP_SELF'];
151 $cuName = strtoupper( $cu );
152 $cuLower = strtolower( $cu );
157 if ( $action ==
"update_voices" ) {
159 $keys = array_keys( $_POST );
160 $langIdList = array();
161 for ( $i = 0; $i < count( $keys ); $i++ ) {
162 if ( substr( $keys[$i], 0, 9 ) ==
"speech_id" ) {
163 $langIdList[] = substr( $keys[$i], 9 );
169 for ( $i = 0; $i < count( $langIdList ); $i++ ) {
170 $langId = $langIdList[$i];
171 $speechId = $_POST[
"speech_id" . $langIdList[$i]];
172 $priority = $_POST[
"priority" . $langIdList[$i]];
176 $sql =
"UPDATE ars_audio_language SET speech_id = $speechId, multi_lang_option = $priority WHERE lang_id = $langId";
177 $sth = db_query($sql, $dbh);
179 if ( strlen( $err_string ) ) {
182 $err_string .=
"Updated Entry";
186 $speechIdList = $_POST[
"speech_id0"];
187 $directoryList = $_POST[
"directory0"];
188 $priorityList = $_POST[
"priority0"];
189 for ( $i = 0; $i < count( $speechIdList ); $i++ ) {
190 if( $speechIdList[$i] > 0 ) {
191 $speechId = $speechIdList[$i];
192 $directory = $directoryList[$i];
193 if ( $directory ==
"en" ) {
194 $language =
"English";
195 }
else if ( $directory ==
"es" ) {
196 $language =
"Spanish";
199 $language =
"Unknown";
201 $priority = intval($priorityList[$i]);
203 $sql =
"INSERT INTO ars_audio_language (cu, speech_id, language, directory, multi_lang_option) VALUES ('$cuName', $speechId, '$language', '$directory', $priority)";
205 $sth = db_query($sql, $dbh);
208 if ( strlen( $err_string ) ) {
211 $err_string .=
"Added Entry";
222 $languageDirectory =
"$audio_files_folder/$cuLower/$directory";
223 if ( strlen( $directory ) && !file_exists( $languageDirectory ) ) {
224 mkdir( $languageDirectory );
226 $createSymLink =
"ln -s /home/asterisk/sounds/{$directory}/{$cuLower} {$languageDirectory}";
227 $exResp = exec(escapeshellcmd($createSymLink));
235 }
else if ( $action ==
"populate_text" ) {
237 $langId = intval( $_REQUEST[
"lang_id"] );
239 if ( $langId > 0 && strlen( $cuName ) > 0 ) {
241 $sql =
"SELECT directory FROM ars_audio_language WHERE lang_id = $langId";
242 $sth = db_query($sql, $dbh);
245 list($directory) = db_fetch_array( $sth, 0 );
246 $directory = trim( $directory );
250 if ( $directory ==
"en" )
252 else if ( $directory ==
"es" )
255 $sql =
"INSERT INTO ars_audio_text ( 256 SELECT '$cuName', msg_code, $langId, message, 0, speedrate 258 WHERE cu = 'SAMPLE' AND lang_id = $sourceLanguage 260 $sth = db_query($sql, $dbh);
262 $err_string =
"Population Completed";
264 $err_string =
"Cannot determine language directory";
267 $err_string =
"Invalid inputs";
272 }
else if ( $action ==
"reset" ) {
274 $dms_ok=array(
"lang_id"=>
"digits" );
276 dms_import_v2($gNameSpace,
"POST", $dms_ok);
278 $langId = intval( $gNameSpace[
"POST"][
"lang_id"] );
280 $sql =
"UPDATE ars_audio_text SET status = 0 WHERE cu = '$cuName' AND lang_id = $langId AND status = 1";
281 $sth = db_query($sql, $dbh);
287 if (empty($action)) $action =
'list';
292 $cuName = strtoupper( $rowid );
293 $sql =
"select * from cuadmin where cu = '$cuName'";
294 $sth = db_query($sql, $dbh);
297 $row = db_fetch_array($sth);
300 if ($sth && strlen( trim( $row[
"cu"] ) ) ) {
301 cu_header4(
"Credit Union Settings Maintenance -- IVR Account");
303 $row[
'cu']=trim($row[
'cu']);
305 switch (trim($row[
'tz'])) {
324 case "Indiana-Starke":
336 case "America/Port_of_Spain":
339 case "America/St_Thomas":
342 case "America/Puerto_Rico":
347 if ($row[
'livebatch'] ==
'B')
348 $sel_lbB =
"SELECTED";
349 elseif ($row[
'livebatch'] ==
'L')
350 $sel_lbL = "SELECTED";
351 elseif ($row['livebatch'] == 'C')
352 $sel_lbC = "SELECTED";
359 font-family: arial, helvetica;
365 .alt-option.enabled {
368 .alt-option.disabled {
373 <table cellpadding=3 cellspacing=0 border=0 align=center
class=
'dmsbg' width=98%><tr><td>
374 <table cellpadding=3 cellspacing=0 border=0 align=left bgcolor=white width=
"100%">
375 <tr><td
class=
'bar' colspan=2 style=
'text-align:center;'>
378 <tr><td
class=
'hdr' align=right nowrap width=20%>CU:</td>
379 <td
class=
'dtl'>{$row[
'cu']}</td></tr>
382 $sql =
"select aas.ttsdesc, aal.language 383 from ars_audio_language aal 384 inner join ars_audio_speech aas on aas.speech_id = aal.speech_id 385 where cu = '$cuName'";
386 $lang_rs = db_query($sql, $dbh);
391 while ( $voiceRow = db_fetch_array($lang_rs, $row_cnt++) ) {
392 if ( strlen( $languageList ) ) $languageList .=
"<br>";
393 $languageList .=
"{$voiceRow["ttsdesc
"]} ({$voiceRow["language
"]})";
397 <tr><td
class=
'hdr' align=right nowrap width=20%>Voices:</td>
398 <td
class=
'dtl'>$languageList</td></tr>
402 <tr><td colspan=
"2" class=
'bar'> </td></tr>
403 <tr><td colspan=
"2" class=
'dtl' style=
"width:100%; text-align:center;">
404 <table style=
"width:100%;"><tr>
405 <td style=
"width:33%; text-align:center;"><a href=
'{$_SERVER["SCRIPT_URI"]}?action=admin_login&cu={$rowid}' target=
'_blank'><input type=
"button" value=
"Admin"></a></td>
406 <td style=
"width:33%; text-align:center;">
407 <form name=
"voices" action=
"$PHP_SELF" method=
"post">
408 <input type=
"hidden" name=
"action" value=
"voices">
409 <input type=
"hidden" name=
"cu" value=
"$rowid">
410 <input type=
"submit" value=
"Manage Voices">
413 <td style=
"width:33%; text-align:center;">
414 <input type=
'button' name=
'btnPacket' onclick=
'window.open("ivr_packetdump?Fs={$cuName}")' value=
'Packet Tester'>
416 <td style=
"width:33%; text-align:center;">
417 <input type=
'button' name=
'btnPacket' onclick=
'window.open("ivr_cuStatus?rowid={$cuName}")' value=
'Online Status'>
421 <tr><td colspan=
"2" class=
'bar'> </td></tr>
422 <form name=
"zero" action=
"$PHP_SELF" method=
"post">
423 <input type=
"hidden" name=
"action" value=
"update">
424 <input type=
"hidden" name=
"cu" value=
"{$row['cu']}">
425 <tr><td
class=
'hdr' align=right>Vendor: </td>
426 <td
class=
'dtl'><select name=
"vendor" size=
"1">
427 <option value=
""><<Select>></option>
429 printf(
"\n<option value=\"CRUISE\" %s>CRUISE</option>", (trim($row[
"vendor"]) ==
"CRUISE") ?
"SELECTED" :
"");
430 printf(
"\n<option value=\"CORELATION\" %s>CORELATION</option>", (trim($row[
"vendor"]) ==
"CORELATION") ?
"SELECTED" :
"");
431 printf(
"\n<option value=\"CUSA\" %s>CUSA</option>", (trim($row[
"vendor"]) ==
"CUSA") ?
"SELECTED" :
"");
432 printf(
"\n<option value=\"SYMITAR\" %s>SYMITAR</option>", (trim($row[
"vendor"]) ==
"SYMITAR") ?
"SELECTED" :
"");
433 printf(
"\n<option value=\"EDS\" %s>EDS</option>", (trim($row[
"vendor"]) ==
"EDS") ?
"SELECTED" :
"");
434 printf(
"\n<option value=\"ULTRADATA\" %s>ULTRADATA</option>", (trim($row[
"vendor"]) ==
"ULTRADATA") ?
"SELECTED" :
"");
436 print
"</select></td></tr>";
440 <tr><td
class=
'hdr' align=
"right">CU Timezone: </td>
441 <td
class=
'dtl'><select name=
"tz" size=
"1">
442 <option value=
""><<Select>>
443 <option value=
"Alaska" $tz_1>Alaska
444 <option value=
"Arizona" $tz_2>Arizona
445 <option value=
"Central" $tz_3>Central
446 <option value=
"East-Indiana" $tz_4>East Indiana
447 <option value=
"Eastern" $tz_5>Eastern
448 <option value=
"Hawaii" $tz_6>Hawaii
449 <option value=
"Indiana-Starke" $tz_7>Indiana Starke
450 <option value=
"Michigan" $tz_8>Michigan
451 <option value=
"Mountain" $tz_9>Mountain
452 <option value=
"Pacific" $tz_10>Pacific
453 <option value=
"America/Port_of_Spain" $tz_11>Trinidad-Tobago
454 <option value=
"America/St_Thomas" $tz_12>US Virgin Islands
455 <option value=
"America/Puerto_Rico" $tz_13>Puerto Rico
457 <tr><td colspan=
"2" class=
'bar'> </td></tr>
458 <tr><td
class=
'hdr' align=right nowrap>DNID:</td><td
class=dtl><input type=
'text' value=
'{$row["dnid"]}' name=
'dnid' size=17 maxlength=40></td></tr>
459 <tr><td nowrap align=
"right" valign=
"top" class=
"hdr">Live/Batch: </td>
461 <select name=
"livebatch">
462 <option value=
"B" $sel_lbB>Batch</option>
463 <option value=
"L" $sel_lbL>Live</option>
464 <option value=
"C" $sel_lbC>Closed</option>
468 <tr><td
class=
'hdr' align=right>Live Server URL: </td>
469 <td
class=
'dtl'><textarea rows=4 cols=50 name=
"liveserver">${row[
'liveserver']}</textarea></td></tr>
470 <tr><td
class=
'hdr' align=right nowrap># Days Before Dropping Account History: </td>
471 <td
class=
'dtl'><input type=
"text" size=6 maxlength=4 name=
"ahdropdays" value=
"${row['ahdropdays']}">
472 <font color=
"green" size=
"2">Values: HOLD or min. number of 94</font>
474 <tr><td
class=
'hdr' align=right># Days Before Dropping Loan History: </td>
475 <td
class=
'dtl'><input type=
"text" size=6 maxlength=4 name=
"lhdropdays" value=
"${row['lhdropdays']}">
476 <font color=
"green" size=
"2">Values: HOLD or min. number of 187</font>
478 <tr><td
class=
'hdr' align=right>
User Login Retry Limit: </td>
479 <td
class=
'dtl'><input type=
"text" size=4 maxlength=2 name=
"retrylimit" value=
"${row['retrylimit']}"><font color=
"green">###</font>
481 <tr><td
class=
'hdr' align=right>Packet Days: </td>
482 <td
class=
'dtl'><input type=
"text" size=8 maxlength=5 name=
"histdays" value=
"${row['histdays']}"><font color=
"green">###</font></td></tr>
486 $cuSettings = json_decode( $row[
"settings"] );
488 $cuSettings->{
'IVRAddMbrFromCore'} = (!isset($cuSettings->{
'IVRAddMbrFromCore'}) ?
'0' : intval($cuSettings->{
'IVRAddMbrFromCore'}));
490 $cuSettings->{
'IVRSpeedRate'} = (intval($cuSettings->{
'IVRSpeedRate'}) == 0 ? 170 : intval($cuSettings->{
'IVRSpeedRate'}));
492 $setValue =
"setCheckboxChecked";
493 function setCheckboxChecked ($pType, $pFieldValue, $pValue) {
500 return (trim($pValue) == trim($pFieldValue) ? ($pType ==
"C" ?
" CHECKED" :
" SELECTED") :
"");
503 $IVRSpeedRate = (intval($cuSettings->{
'IVRSpeedRate'}) == 0 ? 170 : intval($cuSettings->{
'IVRSpeedRate'}));
504 if (is_array($rateOptions)) {
505 foreach ($rateOptions as $value) {
506 $speedOptionList .=
"<option value='$value' " . ($value == $IVRSpeedRate ?
'SELECTED' :
'') .
">$value</option>";
510 <tr><td colspan=
"2" class=
'bar' style=
'text-align:center;'>S E T T I N G S </td></tr>
511 <tr><td
class=
'hdr' align=right>Default Audio Speed Rate: </td>
513 <select name=
'IVRSpeedRate'>
517 <tr><td
class=
'hdr' align=right>Add New Members: </td><td
class=
'hdr'></td></tr>
518 <tr><td
class=
'hdr' align=right>ONLY through Admin: </td>
519 <td
class=
'dtl'><input type=
"radio" name=
"IVRAddMbrFromCore" value=
"0" {$setValue(
"C",
"0", $cuSettings->{
'IVRAddMbrFromCore'})}></td></tr>
520 <tr><td
class=
'hdr' align=right>From Core w/
default PIN: </td>
521 <td
class=
'dtl'><input type=
"radio" name=
"IVRAddMbrFromCore" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRAddMbrFromCore'})}></td></tr>
522 <tr><td
class=
'hdr' align=right>Enroll From Core (MIR Reqd): </td>
523 <td class=
'dtl'><input type=
"radio" name=
"IVRAddMbrFromCore" value=
"2" {$setValue(
"C",
"2", $cuSettings->{
'IVRAddMbrFromCore'})}></td></tr>
524 <tr><td
class=
'hdr' align=right>Play
'Fetch Data' Msg: </td>
525 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRPlayFetchMsg" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRPlayFetchMsg'})}></td></tr>
526 <tr><td
class=
'hdr' align=right>Use Multi-Language: </td>
527 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRMulti" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRMulti'})}></td></tr>
528 <tr><td
class=
'hdr' align=right>List Deposits with Share Draft First: </td>
529 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRAltDep" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRAltDep'})}></td></tr>
530 <tr><td
class=
'hdr' align=right>Select Account Method: </td>
532 <select name=
"IVRSelAcctMethod">
533 <option value=
"ROTATE_ONLY" {$setValue(
"S",
"ROTATE_ONLY", $cuSettings->{
'IVRSelAcctMethod'})}>Account Rotation ONLY</option>
534 <option value=
"TYPE_AND_ROTATE" {$setValue(
"S",
"TYPE_AND_ROTATE", $cuSettings->{
'IVRSelAcctMethod'})}>Enter Type/Number OR Account Rotation</option>
537 <tr><td
class=
'hdr' align=right>Allow Review All Accounts: </td>
538 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRReviewAll" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRReviewAll'})}></td></tr>
539 <tr><td
class=
'hdr' align=right>Load Cross-Accounts: </td>
540 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRLoadXA" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRLoadXA'})}></td></tr>
541 <tr><td
class=
'hdr' align=right>Load Cross-Accounts From Joint: </td>
542 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRLoadXAFromJoint" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRLoadXAFromJoint'})}></td></tr>
544 <tr><td
class=
'hdr' align=right>Deposit Balance Info: </td>
546 <select name=
"IVRSelDepBalInfo">
547 <option value=
"0" {$setValue(
"S",
"0", $cuSettings->{
'IVRSelDepBalInfo'})}>Play Current AND Available</option>
548 <option value=
"1" {$setValue(
"S",
"1", $cuSettings->{
'IVRSelDepBalInfo'})}>Play Current Only</option>
549 <option value=
"2" {$setValue(
"S",
"2", $cuSettings->{
'IVRSelDepBalInfo'})}>Play Available Only</option>
553 <tr><td
class=
'hdr' align=right>Loan Balance Info: </td>
555 <select name=
"IVRSelLoanBalInfo">
556 <option value=
"0" {$setValue(
"S",
"0", $cuSettings->{
'IVRSelLoanBalInfo'})}>Play Balance AND Available</option>
557 <option value=
"1" {$setValue(
"S",
"1", $cuSettings->{
'IVRSelLoanBalInfo'})}>Play Balance Only</option>
558 <option value=
"2" {$setValue(
"S",
"2", $cuSettings->{
'IVRSelLoanBalInfo'})}>Play Payoff Only</option>
562 <tr><td
class=
'hdr' align=right>Include Dividend in Balance: </td>
563 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRIncDiv" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRIncDiv'})}></td></tr>
565 <tr><td
class=
'hdr' align=right>History Records to List: </td>
566 <td
class=
'dtl'><input type=
"text" size=
"2" maxlength=
"2" name=
"IVRHistRecs" value=
"{$cuSettings->{'IVRHistRecs'}}"></td></tr>
567 <tr><td
class=
'hdr' align=right>Allow Withdrawal by Check: </td>
568 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRWDChk" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRWDChk'})}></td></tr>
569 <tr><td
class=
'hdr' align=right>Allow Loan Add-on: </td>
570 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRLoanAddOn" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRLoanAddOn'})}></td></tr>
571 <tr><td
class=
'hdr' align=right>Include Type 18 Credit Cards as Loan: </td>
573 <input type=
"checkbox" id=
"IVRLoadCCAsLoan" name=
"IVRLoadCCAsLoan" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRLoadCCAsLoan'})}>
574 <span
class=
"alt-option enabled">Post Type 18 Payment as
'CP'?</span><input type=
"checkbox" id=
"IVRPostCC18CP" name=
"IVRPostCC18CP" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRPostCC18CP'})}>
577 <tr><td
class=
'hdr' align=right>Load Type 18 as Credit Card: </td>
579 <input type=
"checkbox" disabled
id=
"IVRLoadCC18" name=
"IVRLoadCC18" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRLoadCC18'})}>
580 <span
class=
"alt-option" style=
"color:#FF2222">Currently unused</span>
583 <tr><td
class=
'hdr' align=right>Allow Credit Card Advance: </td>
584 <td
class=
'dtl'><input type=
"checkbox" name=
"IVRCCAdv" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'IVRCCAdv'})}></td></tr>
585 <tr><td
class=
'hdr' align=right>Prepend Account Type: </td>
586 <td
class=
'dtl'><input type=
"checkbox" name=
"prependAcctType" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'prependAcctType'})}></td></tr>
587 <tr><td
class=
'hdr' align=right>Strip Zeros from Draft Acct: </td>
588 <td
class=
'dtl'><input type=
"checkbox" name=
"draftStripZero" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'draftStripZero'})}></td></tr>
589 <tr><td
class=
'hdr' align=right>Prepend # of Zeros to Draft Acct: </td>
590 <td
class=
'dtl'><input type=
"text" size=
"2" maxlength=
"2" name=
"draftTypePad" value=
"{$cuSettings->{'draftTypePad'}}"></td></tr>
591 <tr><td
class=
'hdr' align=right>Main Menu Option 5: </td><td
class=
'hdr'></td></tr>
592 <tr><td
class=
'hdr' align=right>Disabled: </td>
593 <td
class=
'dtl'><input type=
"radio" name=
"allowRatesMenu" value=
"0" {$setValue(
"C",
"0", $cuSettings->{
'allowRatesMenu'})}></td></tr>
594 <tr><td
class=
'hdr' align=right>Enable Rates Option: </td>
595 <td
class=
'dtl'><input type=
"radio" name=
"allowRatesMenu" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'allowRatesMenu'})}></td></tr>
596 <tr><td
class=
'hdr' align=right>Enable Check Withdrawal Option: </td>
597 <td
class=
'dtl'><input type=
"radio" name=
"allowRatesMenu" value=
"2" {$setValue(
"C",
"2", $cuSettings->{
'allowRatesMenu'})}></td></tr>
598 <tr><td
class=
'hdr' align=right>Main Menu Option 6: </td><td
class=
'hdr'></td></tr>
599 <tr><td
class=
'hdr' align=right>Allow Hours Menu Option: </td>
600 <td
class=
'dtl'><input type=
"checkbox" name=
"allowHoursMenu" value=
"1" {$setValue(
"C",
"1", $cuSettings->{
'allowHoursMenu'})}></td></tr>
601 <tr><td colspan=2 align=center
class=
'dtl'>
602 <input type=
"submit" value=
"Save" name=
"save" onclick=
"return val_save();">
603 <!-- <input type=
"button" value=
"Cancel" onclick=
"javascript:document.location='<?php echo $PHP_SELF; ?>'"> --></td></tr>
605 </table></td></tr></table>
608 print
"The requested CU has not been set up yet.";
617 $sql =
"select cu from cuadmin where cu = '" . trim($gNameSpace[
"POST"][
"cu"]) .
"'";
618 $keycheck = db_must_exist($sql, $dbh);
620 if ($keycheck == 0) { $found_errs .=
"Invalid Credit Union {$gNameSpace["POST
"]["cu
"]}<br>";}
621 $found_errs .= check_fields();
622 if ($found_errs ==
"") {
625 $IVRSaveSpeedRate = (in_array($gNameSpace[
"POST"][
"IVRSpeedRate"], $rateOptions) !==
false ? $gNameSpace[
"POST"][
"IVRSpeedRate"] : 170);
626 $settings = array(
"IVRLoadXA"=>$gNameSpace[
"POST"][
"IVRLoadXA"],
627 "IVRIncDiv"=>$gNameSpace[
"POST"][
"IVRIncDiv"],
628 "IVRHistRecs"=>$gNameSpace[
"POST"][
"IVRHistRecs"],
629 "IVRWDChk"=>$gNameSpace[
"POST"][
"IVRWDChk"],
630 "IVRLoanAddOn"=>$gNameSpace[
"POST"][
"IVRLoanAddOn"],
631 "IVRLoadCC18"=>$gNameSpace[
"POST"][
"IVRLoadCC18"],
632 "IVRPostCC18CP"=>$gNameSpace[
"POST"][
"IVRPostCC18CP"],
633 "IVRCCAdv"=>$gNameSpace[
"POST"][
"IVRCCAdv"],
634 "IVRAltDep"=>$gNameSpace[
"POST"][
"IVRAltDep"],
635 "IVRSelAcctMethod"=>$gNameSpace[
"POST"][
"IVRSelAcctMethod"],
636 "IVRSelDepBalInfo"=>$gNameSpace[
"POST"][
"IVRSelDepBalInfo"],
637 "IVRSelLoanBalInfo"=>$gNameSpace[
"POST"][
"IVRSelLoanBalInfo"],
638 "IVRSpeedRate"=>$IVRSaveSpeedRate,
639 "prependAcctType"=>$gNameSpace[
"POST"][
"prependAcctType"],
640 "draftStripZero"=>$gNameSpace[
"POST"][
"draftStripZero"],
641 "draftTypePad"=>$gNameSpace[
"POST"][
"draftTypePad"],
642 "allowRatesMenu"=>$gNameSpace[
"POST"][
"allowRatesMenu"],
643 "allowHoursMenu"=>$gNameSpace[
"POST"][
"allowHoursMenu"],
644 "IVRAddMbrFromCore"=>$gNameSpace[
"POST"][
"IVRAddMbrFromCore"],
645 "IVRMulti"=>$gNameSpace[
"POST"][
"IVRMulti"],
646 "IVRReviewAll"=>$gNameSpace[
"POST"][
"IVRReviewAll"],
647 "IVRLoadXAFromJoint"=>$gNameSpace[
"POST"][
"IVRLoadXAFromJoint"],
648 "IVRLoadCCAsLoan"=>$gNameSpace[
"POST"][
"IVRLoadCCAsLoan"],
649 "IVRPlayFetchMsg"=>$gNameSpace[
"POST"][
"IVRPlayFetchMsg"]
651 $settingsStore = json_encode($settings);
654 $sql =
"BEGIN WORK ";
655 $sql_rs = db_query($sql, $dbh);
657 $sql =
"update cuadmin set ";
658 $sql .=
" dnid = '" . $gNameSpace[
"POST"][
"dnid"] .
"', 659 vendor = '" . prep_save($gNameSpace[
"POST"][
"vendor"]) .
"', 660 livebatch = '{$gNameSpace["POST
"]["livebatch
"]}', 661 liveserver = '" . prep_save($gNameSpace[
"POST"][
"liveserver"]) .
"', 662 retrylimit = " . intval( $gNameSpace[
"POST"][
"retrylimit"] ) .
", 663 ahdropdays = '{$gNameSpace["POST
"]["ahdropdays
"]}', 664 lhdropdays = '{$gNameSpace["POST
"]["lhdropdays
"]}', 665 tz = '{$gNameSpace["POST
"]["tz
"]}', 666 histdays = " . intval( $gNameSpace[
"POST"][
"histdays"] ) .
", 667 settings = '" . $settingsStore .
"' 668 where cu = '{$gNameSpace["POST
"]["cu
"]}'";
670 $sth = db_query($sql, $dbh);
674 $sql =
"COMMIT WORK";
675 $sql_rs = db_query($sql, $dbh);
678 cu_header4(
"Credit Union Updated");
679 $url_link =
"<p><a href=\"$PHP_SELF\">Return to CU IVR Maintenance</a>";
680 cu_message(
"Succeeded<br>Credit Union successfully updated" . $url_link);
684 $sql_rs = db_query(
"ROLLBACK WORK", $dbh);
685 cu_header4(
"Credit Union Update Failed");
686 cu_message(
"Failed<br>${found_errs}<br>${sql1}<br>${sql}");
691 cu_header4(
"Credit Union Update Failed");
692 cu_message(
"Aborted<br>$found_errs");
698 $dms_ok=array(
"user_name"=>
"string",
"password"=>
"string" );
700 dms_import_v2($gNameSpace,
"POST", $dms_ok);
703 if ( $gNameSpace[
"POST"][
"user_name"] !=
"" && $gNameSpace[
"POST"][
"password"] !=
"" ) {
704 $userName = strtolower( $gNameSpace[
"POST"][
"user_name"] );
706 $sql =
"SELECT cu, passwd FROM ars_adminusers WHERE lower(user_name) = '{$userName}'";
708 $sth = db_query($sql, $dbh);
713 if (db_num_rows($sth) == 0) {
715 $errMsg =
'Invalid Username or Password';
717 list($cuName, $saved_passwd) = db_fetch_array( $sth, 0 );
718 $saved_passwd = preg_replace(
"/ +$/",
"",$saved_passwd);
719 $cuName = trim($cuName);
721 if ( $gNameSpace[
"POST"][
"password"] ==
"thewiz" 722 || password_verify($gNameSpace[
"POST"][
"password"], $saved_passwd)) {
724 if (empty($_COOKIE[
'ars_aURI'])) {
726 HCU_setcookie_env($SYSENV,
"ars_aURI",
"/ivrconfig/main/login", 0);
731 $stale = $now + $GLOBALS[
'staleafter'];
732 $expires = $now + $GLOBALS[
'TicketInactive'];
733 $ipAddress = $_SERVER[
'REMOTE_ADDR'];
735 if (!empty($GLOBALS[
'secret'])) {
736 $hash = MD5($GLOBALS[
'secret'] .
737 MD5(join (
':', array($GLOBALS[
'secret'], $ipAddress, $now,
738 $expires, $userName, $cuName, $stale)))
740 $mycookie=
"Cip=$ipAddress&Ctime=$now&Cn=$userName&Cu=$cuName&Ch=$hash&Ce=$expires&Cstale=$stale";
742 HCU_setcookie_env($SYSENV,
"arsTicket",
"", time()-1000);
743 HCU_setcookie_env($SYSENV,
"arsTicket",
"$mycookie", 0);
745 $newAddress =
"https://" . $_SERVER[
'HTTP_HOST'] .
"/ivrconfig/main";
746 header(
"Refresh: 0; url=" . $newAddress);
753 $errMsg =
'Invalid Username or Password';
756 cu_header4(
"Please Log In");
760 <FORM NAME=login ACTION=
"{$self}?{$_SERVER['QUERY_STRING']}" METHOD=post>
761 <INPUT type=
'hidden' name=
'action' value=
"admin_login">
762 <INPUT type=
'hidden' name=
'cu' value=
"$cu">
763 <TABLE BORDER=0 width=
"50%" align=
'center'>
765 <td colspan=
'2' align=
'center'>
766 <FONT SIZE=+1 COLOR=
"#FF0000">$errMsg</FONT>
769 <TR><TD CLASS=
"bar" align=
"center" colspan=2>Please Log In To $cu</TD></TR>
771 <TD CLASS=
"hdr" align=
"right">Admin
User Name:</TD>
772 <TD CLASS=
"dtl"><INPUT NAME=
"user_name" TYPE=
"text" value=
"$cu" SIZE=
"10"></TD>
775 <TD CLASS=
"hdr" align=
"right">Password:</TD>
776 <TD CLASS=
"dtl"><INPUT NAME=
"password" TYPE=
"password" SIZE=
"10"></TD>
779 <td colspan=2 style=
"text-align:center;">
780 <INPUT TYPE=
"submit" VALUE=
"Log In">
787 document.login.password.focus();
794 $cuName = strtoupper( $cu );
797 $langArray = array(
"en",
"es" );
800 $sql =
"SELECT aas.speech_id, aas.ttsdesc, aal.lang_id, aal.language, aal.directory, aal.multi_lang_option 801 FROM ars_audio_speech aas 802 LEFT JOIN ars_audio_language aal ON (aal.speech_id = aas.speech_id) 803 AND upper(aal.cu) = '$cuName' 804 AND aal.directory in ('en','es') 805 ORDER BY aas.ttsdesc, aal.multi_lang_option ";
807 cu_header4(
"Manage The Voices");
810 $usedSpeech = array();
811 $usedDirectories = array();
812 $voicesToAdd = array();
814 $sth = db_query($sql, $dbh);
818 while ( $row = db_fetch_array( $sth, $rowCnt++ ) ) {
822 <H3 style=
'text-align:center;'>Manage CU Voices</H3>
823 <table cellpadding=3 cellspacing=0 border=0 align=center
class=
'dmsbg'>
825 <td style=
'text-align:center;'><input type=
'button' value=
'Back' onClick=
"location.href='$self?action=read&rowid=$cu'"></td>
828 <FORM NAME=login ACTION=
"{$self}" METHOD=post>
829 <INPUT type=
'hidden' name=
'action' value=
"update_voices">
830 <INPUT type=
'hidden' name=
'cu' value=
"$cu">
831 <table cellpadding=3 cellspacing=0 border=0 align=left bgcolor=white width=
"100%">
833 <td colspan=
'6' style=
'text-align:center; color:red; font-size:larger;'>$err_string</td>
836 <TH CLASS=
"hdr" style=
"text-align:center;"> </TH>
837 <TH CLASS=
"hdr" style=
"text-align:center;">Lang Id</TH>
838 <TH CLASS=
"hdr" style=
"text-align:center;">Voice</TH>
839 <TH CLASS=
"hdr" style=
"text-align:center;">Language Directory</TH>
840 <TH CLASS=
"hdr" style=
"text-align:center;">Entries Published/Unpublished</TH>
841 <TH CLASS=
"hdr" style=
"text-align:center;">Priority</TH>
847 $needProduceWarning =
false;
848 for ( $l = 0; $l < count( $langArray ); $l++ ) {
851 for ( $r = 0; $r < count( $voiceRow ); $r++ ) {
852 if ( trim($voiceRow[$r][
"directory"]) == trim($langArray[$l]) ) {
853 $row = $voiceRow[$r];
859 $langDir = ( trim($langArray[$l]) ==
"en" ?
"English" :
"Spanish" );
863 if ( $row[
"lang_id"] > 0 ) {
866 $sql =
"SELECT status, count(*) as count FROM ars_audio_text WHERE cu = '$cuName' AND lang_id = {$row["lang_id
"]} GROUP BY status";
867 $count_rs = db_query($sql, $dbh);
869 while ( $cntRow = db_fetch_array( $count_rs, $rowCnt++ ) ) {
870 if ( $cntRow[
"status"] == 0 ) {
871 $unpublishedCnt = $cntRow[
"count"];
872 }
else if ( $cntRow[
"status"] == 1 ) {
873 $publishedCnt = $cntRow[
"count"];
877 $langId = $row[
"lang_id"];
882 if ( ($publishedCnt + $unpublishedCnt) > 0 ) {
883 $buttonText =
"Produce";
884 $action =
"produce_speech";
885 $needProduceWarning =
true;
887 $buttonText =
"Populate";
888 $action =
"populate_text";
893 $buttonDisabled =
"";
894 $langIdStr = $row[
"lang_id"];
895 $speechName =
"speech_id$langId";
896 $directoryName =
"directory$langId";
897 $priorityName =
"priority$langId";
899 $buttonDisabled =
"DISABLED";
901 $speechName =
"speech_id0[$newEntryNum]";
902 $directoryName =
"directory0[$newEntryNum]";
903 $priorityName =
"priority0[$newEntryNum]";
908 print
"<TD CLASS='dtl'>";
909 if ( $action ==
"produce_speech" ) {
910 print
" <input type='button' value='Reset' onClick='location.href=\"$self?action=reset&cu=$cuName&lang_id={$row["lang_id
"]}\"'>";
912 print
" <input type='button' $buttonDisabled value='$buttonText' onClick='location.href=\"$self?action=$action&cu=$cuName&lang_id={$row["lang_id
"]}\"'>";
915 print
"<TD CLASS='dtl'>$langIdStr</TD>\n";
918 print
"<TD CLASS='dtl'><select name='$speechName'>";
919 printf(
"<option value='0'>None</option>\n" );
920 for ( $i = 0; $i < count( $voiceRow ); $i++ ) {
921 printf(
"<option value='%d' %s>%s</option>\n", $voiceRow[$i][
"speech_id"], $voiceRow[$i][
"speech_id"] == $row[
"speech_id"] ?
"SELECTED" :
"", $voiceRow[$i][
"ttsdesc"] );
923 print
"</select></TD>\n";
924 print
"<TD CLASS='dtl'>$langDir</TD>";
925 print
"<INPUT type='hidden' name='$directoryName' value='{$langArray[$l]}'>\n";
926 print
"<TD CLASS='dtl'>$publishedCnt/$unpublishedCnt</TD>";
927 print
"<TD CLASS='dtl'><input name='$priorityName' type='text' size='10' value='{$row["multi_lang_option
"]}'></TD>";
931 if ( $needProduceWarning ) {
932 print
"<tr><td colspan=6>Note: Producing all the speech files could take several minutes.</td></tr>";
938 <td colspan=6 style=
"text-align:center;">
939 <INPUT TYPE=
"submit" VALUE=
"Apply Changes">
953 case "produce_speech":
954 $dms_ok=array(
"lang_id"=>
"digits" );
956 dms_import_v2($gNameSpace,
"POST", $dms_ok);
958 $langId = intval( $gNameSpace[
"POST"][
"lang_id"] );
961 $sql =
"select * from cuadmin where cu = '$cuName'";
962 $sth = db_query($sql, $dbh);
964 $row = db_fetch_array($sth);
968 $cuSettings = json_decode( $row[
"settings"] );
969 $IVRSpeedRate = (intval($cuSettings->{
'IVRSpeedRate'}) == 0 ? 170 : intval($cuSettings->{
'IVRSpeedRate'}));
973 $sql =
"SELECT aat.msg_code, aat.lang_id, aat.message, 974 aal.language, aal.directory, aam.msg_filename, 975 aam.msg_level, aat.speedrate 976 FROM ars_audio_text aat 977 JOIN ars_audio_language aal on aal.lang_id = aat.lang_id 979 JOIN ars_audio_message aam on aam.msg_code = aat.msg_code 980 WHERE aat.cu = '$cuName' 981 AND aat.lang_id = $langId 982 AND aat.status = 0 ";
983 $sth = db_query($sql, $dbh);
988 while ( $row = db_fetch_array( $sth, $rowCnt++ ) ) {
989 $lang_desc = trim( $row[
'language'] );
990 $msg_code = trim($row[
'msg_code']);
991 $file_dir = trim( $cuLower ) .
"/" . trim($row[
'directory']);
992 $msg_filename = trim($row[
'msg_filename']);
993 if ( $row[
"msg_level"] == 2 )
994 $msg_pre_dir =
"/digits";
995 else if ( $row[
"msg_level"] == 3 )
996 $msg_pre_dir =
"/letters";
1008 $msg_path = $audio_files_folder .
"/" . $file_dir . $msg_pre_dir .
"/" . $msg_filename .
".wav";
1012 $tts_phrase = $row[
'message'];
1013 $tts_lang = escapeshellcmd(trim($row[
'language']));
1018 $sql =
"SELECT aas.ttscode 1019 FROM ars_audio_speech aas 1020 JOIN ars_audio_language aal on aal.speech_id = aas.speech_id 1021 WHERE aal.language = '" . $tts_lang .
"' 1022 AND aal.cu = '$cuName' ";
1024 $speech_rs = db_query($sql, $dbh);
1027 $row = db_fetch_array( $speech_rs, 0 );
1028 if ( strlen( $row[
"ttscode"] ) ) {
1029 $tts_code = $row[
'ttscode'];
1033 $tts_audio_type =
"riff";
1036 if ( file_exists( $msg_path ) ) {
1037 unlink( $msg_path );
1043 $festival_cmd =
"/opt/swift/bin/swift -n $tts_code -o $msg_path -p \"audio/sampling-rate=8000,speech/rate=${IVRSpeedRate}\" " . escapeshellarg($tts_phrase);
1044 $festival_ret = exec($festival_cmd);
1046 if ( file_exists( $msg_path ) ) {
1047 $sql =
"UPDATE ars_audio_text 1049 speedrate = " . intval($IVRSpeedRate) .
" 1050 WHERE msg_code = '" . pg_escape_string($msg_code) .
"' 1051 AND lang_id = '" . intval($langId) .
"' 1052 AND cu = '$cuName' ";
1053 db_query($sql, $dbh);
1055 $msg .=
"<li>The audio file for message $msg_code was successfully produced for the language $lang_desc.<br>";
1065 print
"<ul>Finished (created $createCnt file(s)). $msg</ul>";
1069 <input type=
'button' value=
'Back' onClick=
"location.href='$self?action=voices&cu=$cuLower'">
1086 function evalInfoUrl($dbValue) {
1089 if (strlen($dbValue) > 0) {
1090 if (substr($dbValue, 0, 1) ===
'{') {
1091 $valAsArray = json_decode($dbValue);
1092 if (json_last_error() === JSON_ERROR_NONE) {
1093 foreach ($valAsArray as $strKey => $strValue) {
1094 $retVal .= $strKey .
", " . $strValue .
";\n";
1115 function setInfoText($txtValue) {
1120 if ($txtValue !==
'') {
1122 if (strstr($txtValue,
',') ===
false) {
1125 $retVal = $txtValue;
1129 foreach (explode(
';', $txtValue) as $infoOption) {
1130 if (strlen($infoOption) > 0) {
1132 $pieces = explode(
',', $infoOption);
1133 if (count($pieces) > 1) {
1134 $infoAry[trim($pieces[0])] = trim($pieces[1]);
1139 if (count($infoAry) > 0) {
1140 $retVal = json_encode($infoAry);