2012-06-04 14:58:40 +00:00
<? php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
2014-09-24 01:03:34 +00:00
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
2012-06-04 14:58:40 +00:00
*/
include "root.php" ;
2013-07-06 06:03:27 +00:00
require_once "resources/require.php" ;
2013-07-06 05:50:55 +00:00
require_once "resources/check_auth.php" ;
2012-06-04 14:58:40 +00:00
if ( permission_exists ( 'call_broadcast_edit' )) {
//access granted
}
else {
echo "access denied" ;
exit ;
}
2012-10-23 14:29:14 +00:00
//add multi-lingual support
2015-01-18 10:06:08 +00:00
$language = new text ;
$text = $language -> get ();
2012-10-06 18:03:46 +00:00
2012-06-04 14:58:40 +00:00
//set the action with add or update
if ( isset ( $_REQUEST [ "id" ])) {
$action = "update" ;
$call_broadcast_uuid = check_str ( $_REQUEST [ "id" ]);
}
else {
$action = "add" ;
}
//get the http post variables and set them to php variables
if ( count ( $_POST ) > 0 ) {
$broadcast_name = check_str ( $_POST [ "broadcast_name" ]);
$broadcast_description = check_str ( $_POST [ "broadcast_description" ]);
$broadcast_timeout = check_str ( $_POST [ "broadcast_timeout" ]);
$broadcast_concurrent_limit = check_str ( $_POST [ "broadcast_concurrent_limit" ]);
//$recording_uuid = check_str($_POST["recording_uuid"]);
$broadcast_caller_id_name = check_str ( $_POST [ "broadcast_caller_id_name" ]);
$broadcast_caller_id_number = check_str ( $_POST [ "broadcast_caller_id_number" ]);
$broadcast_destination_type = check_str ( $_POST [ "broadcast_destination_type" ]);
$broadcast_phone_numbers = check_str ( $_POST [ "broadcast_phone_numbers" ]);
2014-07-07 20:43:45 +00:00
$broadcast_avmd = check_str ( $_POST [ "broadcast_avmd" ]);
2012-06-04 14:58:40 +00:00
$broadcast_destination_data = check_str ( $_POST [ "broadcast_destination_data" ]);
2015-02-15 06:50:00 +00:00
2014-09-24 01:03:34 +00:00
if ( if_group ( "superadmin" )){
$broadcast_accountcode = check_str ( $_POST [ "broadcast_accountcode" ]);
}
2016-01-17 00:01:13 -07:00
elseif ( if_group ( "admin" ) && file_exists ( $_SERVER [ "PROJECT_ROOT" ] . "/app/billing/app_config.php" )){
2014-09-24 01:03:34 +00:00
$sql_accountcode = "SELECT COUNT(*) as count FROM v_billings WHERE domain_uuid = '" . $_SESSION [ 'domain_uuid' ] . "' AND type_value='" . $_POST [ "accountcode" ] . "'" ;
$prep_statement_accountcode = $db -> prepare ( check_sql ( $sql_accountcode ));
$prep_statement_accountcode -> execute ();
$row_accountcode = $prep_statement_accountcode -> fetch ( PDO :: FETCH_ASSOC );
if ( $row_accountcode [ 'count' ] > 0 ) {
$broadcast_accountcode = check_str ( $_POST [ "broadcast_accountcode" ]);
}
else {
$broadcast_accountcode = $_SESSION [ 'domain_name' ];
}
unset ( $sql_accountcode , $prep_statement_accountcode , $row_accountcode );
}
else {
$broadcast_accountcode = $_SESSION [ 'domain_name' ];
}
2012-06-04 14:58:40 +00:00
}
if ( count ( $_POST ) > 0 && strlen ( $_POST [ "persistformvar" ]) == 0 ) {
$msg = '' ;
if ( $action == "update" ) {
$call_broadcast_uuid = check_str ( $_POST [ "call_broadcast_uuid" ]);
}
//check for all required data
2012-10-23 15:36:57 +00:00
if ( strlen ( $broadcast_name ) == 0 ) { $msg .= "" . $text [ 'confirm-name' ] . "<br> \n " ; }
2012-06-04 14:58:40 +00:00
//if (strlen($broadcast_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
//if (strlen($broadcast_timeout) == 0) { $msg .= "Please provide: Timeout<br>\n"; }
//if (strlen($broadcast_concurrent_limit) == 0) { $msg .= "Please provide: Concurrent Limit<br>\n"; }
//if (strlen($recording_uuid) == 0) { $msg .= "Please provide: Recording<br>\n"; }
//if (strlen($broadcast_caller_id_name) == 0) { $msg .= "Please provide: Caller ID Name<br>\n"; }
//if (strlen($broadcast_caller_id_number) == 0) { $msg .= "Please provide: Caller ID Number<br>\n"; }
//if (strlen($broadcast_destination_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($broadcast_phone_numbers) == 0) { $msg .= "Please provide: Phone Number List<br>\n"; }
2014-07-07 20:43:45 +00:00
//if (strlen($broadcast_avmd) == 0) { $msg .= "Please provide: Voicemail Detection<br>\n"; }
2012-06-04 14:58:40 +00:00
//if (strlen($broadcast_destination_data) == 0) { $msg .= "Please provide: Destination<br>\n"; }
if ( strlen ( $msg ) > 0 && strlen ( $_POST [ "persistformvar" ]) == 0 ) {
2013-07-06 06:29:50 +00:00
require_once "resources/header.php" ;
2013-07-06 06:21:12 +00:00
require_once "resources/persist_form_var.php" ;
2012-06-04 14:58:40 +00:00
echo "<div align='center'> \n " ;
echo "<table><tr><td> \n " ;
echo $msg . "<br />" ;
echo "</td></tr></table> \n " ;
persistformvar ( $_POST );
echo "</div> \n " ;
2013-07-06 06:29:50 +00:00
require_once "resources/footer.php" ;
2012-06-04 14:58:40 +00:00
return ;
}
//add or update the database
if ( $_POST [ "persistformvar" ] != "true" ) {
if ( $action == "add" && permission_exists ( 'call_broadcast_add' )) {
$call_broadcast_uuid = uuid ();
$sql = "insert into v_call_broadcasts " ;
$sql .= "(" ;
$sql .= "domain_uuid, " ;
$sql .= "call_broadcast_uuid, " ;
$sql .= "broadcast_name, " ;
$sql .= "broadcast_description, " ;
$sql .= "broadcast_timeout, " ;
$sql .= "broadcast_concurrent_limit, " ;
//$sql .= "recording_uuid, ";
$sql .= "broadcast_caller_id_name, " ;
$sql .= "broadcast_caller_id_number, " ;
$sql .= "broadcast_destination_type, " ;
$sql .= "broadcast_phone_numbers, " ;
2014-07-07 20:43:45 +00:00
$sql .= "broadcast_avmd, " ;
2014-09-24 01:03:34 +00:00
$sql .= "broadcast_destination_data, " ;
$sql .= "broadcast_accountcode " ;
2012-06-04 14:58:40 +00:00
$sql .= ")" ;
$sql .= "values " ;
$sql .= "(" ;
$sql .= "' $domain_uuid ', " ;
$sql .= "' $call_broadcast_uuid ', " ;
$sql .= "' $broadcast_name ', " ;
$sql .= "' $broadcast_description ', " ;
if ( strlen ( $broadcast_timeout ) == 0 ) {
$sql .= "null, " ;
}
else {
$sql .= "' $broadcast_timeout ', " ;
}
if ( strlen ( $broadcast_concurrent_limit ) == 0 ) {
$sql .= "null, " ;
}
else {
$sql .= "' $broadcast_concurrent_limit ', " ;
}
//$sql .= "'$recording_uuid', ";
$sql .= "' $broadcast_caller_id_name ', " ;
$sql .= "' $broadcast_caller_id_number ', " ;
$sql .= "' $broadcast_destination_type ', " ;
$sql .= "' $broadcast_phone_numbers ', " ;
2014-07-07 20:43:45 +00:00
$sql .= "' $broadcast_avmd ', " ;
2014-09-24 01:03:34 +00:00
$sql .= "' $broadcast_destination_data ', " ;
$sql .= "' $broadcast_accountcode ' " ;
2012-06-04 14:58:40 +00:00
$sql .= ")" ;
$db -> exec ( check_sql ( $sql ));
unset ( $sql );
2017-06-10 03:13:40 +01:00
messages :: add ( $text [ 'confirm-add' ]);
2014-02-21 02:13:06 +00:00
header ( "Location: call_broadcast.php" );
2012-06-04 14:58:40 +00:00
return ;
} //if ($action == "add")
if ( $action == "update" && permission_exists ( 'call_broadcast_edit' )) {
$sql = "update v_call_broadcasts set " ;
$sql .= "broadcast_name = ' $broadcast_name ', " ;
$sql .= "broadcast_description = ' $broadcast_description ', " ;
if ( strlen ( $broadcast_timeout ) == 0 ) {
$sql .= "broadcast_timeout = null, " ;
}
else {
$sql .= "broadcast_timeout = ' $broadcast_timeout ', " ;
}
if ( strlen ( $broadcast_concurrent_limit ) == 0 ) {
$sql .= "broadcast_concurrent_limit = null, " ;
}
else {
$sql .= "broadcast_concurrent_limit = ' $broadcast_concurrent_limit ', " ;
}
//$sql .= "recording_uuid = '$recording_uuid', ";
$sql .= "broadcast_caller_id_name = ' $broadcast_caller_id_name ', " ;
$sql .= "broadcast_caller_id_number = ' $broadcast_caller_id_number ', " ;
$sql .= "broadcast_destination_type = ' $broadcast_destination_type ', " ;
$sql .= "broadcast_phone_numbers = ' $broadcast_phone_numbers ', " ;
2014-07-07 20:43:45 +00:00
$sql .= "broadcast_avmd = ' $broadcast_avmd ', " ;
2014-09-24 01:03:34 +00:00
$sql .= "broadcast_destination_data = ' $broadcast_destination_data ', " ;
$sql .= "broadcast_accountcode = ' $broadcast_accountcode ' " ;
2012-06-04 14:58:40 +00:00
$sql .= "where domain_uuid = ' $domain_uuid ' " ;
$sql .= "and call_broadcast_uuid = ' $call_broadcast_uuid '" ;
2014-07-07 20:43:45 +00:00
echo $sql . "<br><br>" ;
2012-06-04 14:58:40 +00:00
$db -> exec ( check_sql ( $sql ));
unset ( $sql );
2017-06-10 03:13:40 +01:00
messages :: add ( $text [ 'confirm-update' ]);
2014-02-21 02:13:06 +00:00
header ( "Location: call_broadcast.php" );
2012-06-04 14:58:40 +00:00
return ;
} //if ($action == "update")
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if ( count ( $_GET ) > 0 && $_POST [ "persistformvar" ] != "true" ) {
$call_broadcast_uuid = $_GET [ "id" ];
2012-11-24 00:24:54 +00:00
$sql = "select * from v_call_broadcasts " ;
2012-06-04 14:58:40 +00:00
$sql .= "where domain_uuid = ' $domain_uuid ' " ;
$sql .= "and call_broadcast_uuid = ' $call_broadcast_uuid ' " ;
$prep_statement = $db -> prepare ( check_sql ( $sql ));
$prep_statement -> execute ();
while ( $row = $prep_statement -> fetch ()) {
$broadcast_name = $row [ "broadcast_name" ];
$broadcast_description = $row [ "broadcast_description" ];
$broadcast_timeout = $row [ "broadcast_timeout" ];
$broadcast_concurrent_limit = $row [ "broadcast_concurrent_limit" ];
//$recording_uuid = $row["recording_uuid"];
$broadcast_caller_id_name = $row [ "broadcast_caller_id_name" ];
$broadcast_caller_id_number = $row [ "broadcast_caller_id_number" ];
$broadcast_destination_type = $row [ "broadcast_destination_type" ];
$broadcast_phone_numbers = $row [ "broadcast_phone_numbers" ];
2014-07-07 20:43:45 +00:00
$broadcast_avmd = $row [ "broadcast_avmd" ];
2012-06-04 14:58:40 +00:00
$broadcast_destination_data = $row [ "broadcast_destination_data" ];
2014-09-24 01:03:34 +00:00
$broadcast_accountcode = $row [ "broadcast_accountcode" ];
2012-06-04 14:58:40 +00:00
break ; //limit to 1 row
}
unset ( $prep_statement );
}
//begin header
2013-07-06 06:29:50 +00:00
require_once "resources/header.php" ;
2012-06-04 14:58:40 +00:00
//begin content
echo "<form method='post' name='frm' action=''> \n " ;
2015-02-15 07:59:02 +00:00
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'> \n " ;
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
2012-10-23 15:36:57 +00:00
echo "<td width='30%' align='left' nowrap='nowrap'><b>" . $text [ 'label-call-broadcast' ] . "</b></td> \n " ;
2012-06-04 14:58:40 +00:00
echo "<td width='70%' align='right'> \n " ;
2014-07-07 20:43:45 +00:00
echo " <input type='button' class='btn' name='back' alt='" . $text [ 'button-back' ] . "' onclick= \" window.location='call_broadcast.php' \" value='" . $text [ 'button-back' ] . "'> \n " ;
if ( $action == "update" ) {
echo "<input type='hidden' name='call_broadcast_uuid' value=' $call_broadcast_uuid '> \n " ;
echo "<input type='button' class='btn' name='' alt='" . $text [ 'button-send' ] . "' onclick= \" window.location='call_broadcast_send.php?id= $call_broadcast_uuid ' \" value='" . $text [ 'button-send' ] . "'> \n " ;
echo "<input type='button' class='btn' name='' alt='" . $text [ 'button-stop' ] . "' onclick= \" window.location='call_broadcast_stop.php?id=" . $call_broadcast_uuid . "' \" value='" . $text [ 'button-stop' ] . "'> \n " ;
}
2014-04-26 23:37:41 +00:00
echo " <input type='submit' class='btn' name='submit' value='" . $text [ 'button-save' ] . "'> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
echo "<td class='vncellreq' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-name' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2014-12-21 06:40:39 +00:00
echo " <input class='formfld' type='text' name='broadcast_name' maxlength='255' value= \" $broadcast_name \" required='required'> \n " ;
2012-06-04 14:58:40 +00:00
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-name' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2014-09-24 01:03:34 +00:00
if ( if_group ( "superadmin" )){
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-accountcode' ] . " \n " ;
2014-09-24 01:03:34 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
if ( $action == "add" ){ $accountcode = $_SESSION [ 'domain_name' ]; }
echo " <input class='formfld' type='text' name='broadcast_accountcode' maxlength='255' value= \" $broadcast_accountcode \" > \n " ;
echo "<br /> \n " ;
echo $text [ 'description-accountcode' ] . " \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
2016-01-17 00:01:13 -07:00
} elseif ( if_group ( "admin" ) && file_exists ( $_SERVER [ "PROJECT_ROOT" ] . "/app/billing/app_config.php" )){
2014-09-24 01:03:34 +00:00
$sql_accountcode = "SELECT type_value FROM v_billings WHERE domain_uuid = '" . $_SESSION [ 'domain_uuid' ] . "'" ;
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-accountcode' ] . " \n " ;
2014-09-24 01:03:34 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <select name='broadcast_accountcode' id='broadcast_accountcode' class='formfld'> \n " ;
$prep_statement_accountcode = $db -> prepare ( check_sql ( $sql_accountcode ));
$prep_statement_accountcode -> execute ();
$result_accountcode = $prep_statement_accountcode -> fetchAll ( PDO :: FETCH_NAMED );
foreach ( $result_accountcode as & $row_accountcode ) {
$selected = '' ;
if (( $action == "add" ) && ( $row_accountcode [ 'type_value' ] == $_SESSION [ 'domain_name' ])){
$selected = 'selected="selected"' ;
}
elseif ( $row_accountcode [ 'type_value' ] == $accountcode ){
$selected = 'selected="selected"' ;
}
echo " <option value= \" " . $row_accountcode [ 'type_value' ] . " \" $selected >" . $row_accountcode [ 'type_value' ] . "</option> \n " ;
}
2015-02-15 06:50:00 +00:00
2014-09-24 01:03:34 +00:00
unset ( $sql_accountcode , $prep_statement_accountcode , $result_accountcode );
echo "</select>" ;
echo "<br /> \n " ;
echo $text [ 'description-accountcode' ] . " \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
}
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-timeout' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2014-12-21 06:40:39 +00:00
echo " <input class='formfld' type='number' name='broadcast_timeout' maxlength='255' min='1' step='1' value= \" $broadcast_timeout \" > \n " ;
2012-06-04 14:58:40 +00:00
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-timeout' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-concurrent-limit' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2014-12-21 06:40:39 +00:00
echo " <input class='formfld' type='number' name='broadcast_concurrent_limit' maxlength='255' min='1' step='1' value= \" $broadcast_concurrent_limit \" > \n " ;
2012-06-04 14:58:40 +00:00
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-concurrent-limit' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
//echo "<tr>\n";
//echo "<td class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
//echo " Recording\n";
2012-06-04 14:58:40 +00:00
//echo "</td>\n";
//echo "<td class='vtable' align='left'>\n";
//echo " <select name='recording_uuid' class='formfld'>\n";
//echo " <option></option>\n";
//$sql = "";
//$sql .= "select * from v_recordings ";
//$sql .= "where domain_uuid = '$domain_uuid' ";
//$prep_statement = $db->prepare(check_sql($sql));
//$prep_statement->execute();
//while($row = $prep_statement->fetch()) {
// if ($recording_uuid == $row['recording_uuid']) {
// echo " <option value='".$row['recording_uuid']."' selected='yes'>".$row['recordingname']."</option>\n";
// }
// else {
// echo " <option value='".$row['recording_uuid']."'>".$row['recordingname']."</option>\n";
// }
//}
//unset ($prep_statement);
//echo " </select>\n";
//echo "<br />\n";
//echo "Recording to play when the call is answered.<br />\n";
//echo "\n";
//echo "</td>\n";
//echo "</tr>\n";
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-caller-id-name' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <input class='formfld' type='text' name='broadcast_caller_id_name' maxlength='255' value= \" $broadcast_caller_id_name \" > \n " ;
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-caller-id-name' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-callerid-number' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
2014-12-21 06:40:39 +00:00
echo " <input class='formfld' type='number' name='broadcast_caller_id_number' maxlength='255' min='0' step='1' value= \" $broadcast_caller_id_number \" > \n " ;
2012-06-04 14:58:40 +00:00
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-caller-id-number' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
/*
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Type\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_destination_type' maxlength='255' value=\"$broadcast_destination_type\">\n";
echo "<br />\n";
echo "Optional, Destination Type: bridge, transfer, voicemail, conference, fifo, etc.\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Destination\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='broadcast_destination_data' maxlength='255' value=\"$broadcast_destination_data\">\n";
echo "<br />\n";
echo "Optional, send the call to an auto attendant, conference room, or any other destination. <br /><br />\n";
echo "conference (8khz): 01-\${domain}@default <br />\n";
echo "bridge (external number): sofia/gateway/gatewayname/12081231234 <br />\n";
echo "bridge (auto attendant): sofia/internal/5002@\${domain} <br />\n";
echo "transfer (external number): 12081231234 XML default <br />\n";
echo "</td>\n";
echo "</tr>\n";
*/
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-destination' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <input class='formfld' type='text' name='broadcast_destination_data' maxlength='255' value= \" $broadcast_destination_data \" > \n " ;
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-destination' ] . " <br /><br /> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-phone' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <textarea class='formfld' type='text' name='broadcast_phone_numbers' rows='10'> $broadcast_phone_numbers </textarea> \n " ;
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-phone' ] . " <br /><br /> \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
2014-07-07 20:43:45 +00:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-avmd' ] . " \n " ;
2014-07-07 20:43:45 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <select class='formfld' name='broadcast_avmd'> \n " ;
echo " <option value='false' " . (( $broadcast_avmd == "false" ) ? "selected='selected'" : null ) . ">" . $text [ 'option-false' ] . "</option> \n " ;
echo " <option value='true' " . (( $broadcast_avmd == "true" ) ? "selected='selected'" : null ) . ">" . $text [ 'option-true' ] . "</option> \n " ;
echo " </select> \n " ;
echo "<br /> \n " ;
echo "<br /> \n " ;
echo $text [ 'description-avmd' ] . " \n " ;
echo "</td> \n " ;
echo "</tr> \n " ;
2012-06-04 14:58:40 +00:00
echo "<tr> \n " ;
echo "<td class='vncell' valign='top' align='left' nowrap> \n " ;
2015-02-15 06:50:00 +00:00
echo " " . $text [ 'label-description' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "<td class='vtable' align='left'> \n " ;
echo " <input class='formfld' type='text' name='broadcast_description' maxlength='255' value= \" $broadcast_description \" > \n " ;
echo "<br /> \n " ;
2012-10-23 15:36:57 +00:00
echo "" . $text [ 'description-info' ] . " \n " ;
2012-06-04 14:58:40 +00:00
echo "</td> \n " ;
echo "</tr> \n " ;
echo " <tr> \n " ;
echo " <td colspan='2' align='right'> \n " ;
2015-02-15 09:20:19 +00:00
echo " <br>" ;
2014-07-07 20:43:45 +00:00
echo " <input type='submit' name='submit' class='btn' value='" . $text [ 'button-save' ] . "'> \n " ;
2012-06-04 14:58:40 +00:00
echo " </td> \n " ;
echo " </tr>" ;
echo "</table>" ;
2015-02-15 07:59:02 +00:00
echo "<br><br>" ;
2012-06-04 14:58:40 +00:00
echo "</form>" ;
/*
if ($action == "update") {
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' nowrap><b>Call Broadcast</b></td>\n";
echo "<td width='50%' align='right'> </td>\n";
echo "</tr>\n";
echo "</table>\n";
2012-11-24 00:24:54 +00:00
echo "<form method='get' name='frm' action='call_broadcast_send.php'>\n";
2012-06-04 14:58:40 +00:00
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Category\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='user_category' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select distinct(user_category) as user_category from v_users ";
//$sql .= "where domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
while($row = $prep_statement->fetch()) {
if ($user_category == $row['user_category']) {
echo " <option value='".$row['user_category']."' selected='yes'>".$row['user_category']."</option>\n";
}
else {
echo " <option value='".$row['user_category']."'>".$row['user_category']."</option>\n";
}
}
unset ($prep_statement);
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Group\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='group_name' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select * from v_groups ";
//$sql .= "where domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
while($row = $prep_statement->fetch()) {
if ($recording_uuid == $row['group_name']) {
echo " <option value='".$row['group_name']."' selected='yes'>".$row['group_name']."</option>\n";
}
else {
echo " <option value='".$row['group_name']."'>".$row['group_name']."</option>\n";
}
}
unset ($prep_statement);
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width='30%' class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Gateway\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <select name='gateway' class='formfld'>\n";
echo " <option></option>\n";
$sql = "";
$sql .= "select * from v_gateways ";
//$sql .= "where domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
while($row = $prep_statement->fetch()) {
if ($gateway == $row['gateway']) {
echo " <option value='".$row['gateway']."' selected='yes'>".$row['gateway']."</option>\n";
}
else {
echo " <option value='".$row['gateway']."'>".$row['gateway']."</option>\n";
}
}
unset ($prep_statement);
echo " <option value='loopback'>loopback</option>\n";
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Phone Type\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='phonetype1' class='formfld'>\n";
echo " <option></option>\n";
echo " <option value='phone1'>phone1</option>\n";
echo " <option value='phone2'>phone2</option>\n";
echo " <option value='cell'>cell</option>\n";
//echo " <option value='zzz'>cell</option>\n";
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
2015-02-15 06:50:00 +00:00
echo " Phone Type\n";
2012-06-04 14:58:40 +00:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='phonetype2' class='formfld'>\n";
echo " <option></option>\n";
echo " <option value='phone1'>phone1</option>\n";
echo " <option value='phone2'>phone2</option>\n";
echo " <option value='cell'>cell</option>\n";
//echo " <option value='zzz'>cell</option>\n";
echo " </select>\n";
echo "<br />\n";
//echo "zzz.<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
echo " <input type='hidden' name='call_broadcast_uuid' value='$call_broadcast_uuid'>\n";
echo " <input type='submit' name='submit' class='btn' value='Send Broadcast'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
}
*/
2013-07-06 06:29:50 +00:00
require_once "resources/footer.php" ;
2014-09-24 01:03:34 +00:00
?>