本文整理汇总了PHP中formdata_from_db函数的典型用法代码示例。如果您正苦于以下问题:PHP formdata_from_db函数的具体用法?PHP formdata_from_db怎么用?PHP formdata_from_db使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formdata_from_db函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ConferenceSetup
function ConferenceSetup()
{
global $mysqli;
$session =& $_SESSION['ConferenceSetup'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init form data (Extension)
if (@$_REQUEST['submit'] == 'save') {
$Conference = formdata_from_post();
$Errors = formdata_validate($Conference);
if (count($Errors) == 0) {
formdata_save($Conference);
asterisk_UpdateConf('confbridge.conf');
asterisk_Reload();
header("Location: ConferenceSetup.php?msg=MODIFY_CONFERENCE");
die;
}
} else {
$Conference = formdata_from_db($_SESSION['_USER']['PK_Extension']);
}
// Init Available Accounts (Accounts)
$query = "\n\t\tSELECT\n\t\t\tExtensions.PK_Extension,\n\t\t\tExtension,\n Name\n\t\tFROM\n\t\t\tExtensions\n\t\tWHERE\n\t\t\tExtensions.Type IN ('Virtual', 'SipPhone')\n\t\tORDER BY Extension\n\t";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$Accounts = array();
while ($row = $result->fetch_assoc()) {
$Accounts[] = $row;
}
$smarty->assign('Conference', $Conference);
$smarty->assign('Accounts', $Accounts);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('ConferenceSetup.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:34,代码来源:ConferenceSetup.php
示例2: NetworkSettings
function NetworkSettings()
{
$session =& $_SESSION['NetworkSettings'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (!empty($_REQUEST['submit'])) {
$Settings = formdata_from_post();
$Errors = formdata_validate($Settings, $variables);
if (count($Errors) == 0) {
$Message = 'SAVED_NETWORK_SETTINGS';
formdata_save($Settings);
set_network_interfaces($Settings);
asterisk_UpdateConf('sip.conf');
//asterisk_Reload();
}
$OldSettings = array_merge(formdata_from_db(), get_network_interfaces());
foreach ($OldSettings as $variable => $value) {
if (!isset($Settings[$variable])) {
$Settings[$variable] = $value;
}
}
} else {
$Settings = formdata_from_db();
}
$Interface = get_network_interfaces();
$smarty->assign('Errors', $Errors);
$smarty->assign('Message', $Message);
$smarty->assign('Settings', array_merge($Settings, $Interface));
return $smarty->fetch('NetworkSettings.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:30,代码来源:NetworkSettings.php
示例3: Extensions_DialTone_Modify
function Extensions_DialTone_Modify()
{
global $mysqli;
$session =& $_SESSION['Extensions_SimpleConf_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (@$_REQUEST['submit'] == 'save') {
$Extension = formdata_from_post();
$Errors = formdata_validate($Extension);
if (count($Errors) == 0) {
if ($Extension['PK_Extension'] != '') {
$msg = 'MODIFY_DIALTONE_EXTENSION';
} else {
$msg = 'ADD_DIALTONE_EXTENSION';
}
$id = formdata_save($Extension);
header("Location: Extensions_List.php?hilight={$id}&msg={$msg}");
die;
}
} elseif (@$_REQUEST['PK_Extension'] != "") {
$Extension = formdata_from_db($_REQUEST['PK_Extension']);
} else {
$Extension = formdata_from_default();
}
$smarty->assign('Extension', $Extension);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('Extensions_DialTone_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:29,代码来源:Extensions_DialTone_Modify.php
示例4: SystemClockSettings
function SystemClockSettings()
{
$session =& $_SESSION['SystemClockSettings'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (!empty($_REQUEST['submit'])) {
$Settings = formdata_from_post();
$Settings['Current_TimeZone'] = $Settings['TimeZones'][0];
$Settings['DisableNTP'] = $Settings['DisableNTPLast'];
$Errors = formdata_validate($Settings, $variables);
if (count($Errors) == 0) {
$Message = 'SAVED_SYSTEMCLOCK_SETTINGS';
formdata_save($Settings);
}
$OldSettings = formdata_from_db();
foreach ($OldSettings as $variable => $value) {
if (!isset($Settings[$variable])) {
$Settings[$variable] = $value;
}
}
} else {
$Settings = formdata_from_db();
}
$TimeZones = get_timezone_list();
$smarty->assign('Errors', $Errors);
$smarty->assign('Message', $Message);
$smarty->assign('Settings', $Settings);
$smarty->assign('TimeZones', $TimeZones);
$smarty->assign('CurrentTime', date("F j, Y, g:i a"));
return $smarty->fetch('SystemClockSettings.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:31,代码来源:SystemClockSettings.php
示例5: Extensions_Queue_Modify
function Extensions_Queue_Modify()
{
global $mysqli;
$session =& $_SESSION['Extensions_Queue_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init Available ringing strategies (RingStrategies)
$query = "SELECT PK_RingStrategy, Name, Description FROM RingStrategies";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$RingStrategies = array();
while ($row = $result->fetch_assoc()) {
$RingStrategies[] = $row;
}
// Init Available Members (Members)
$query = "\n\t\tSELECT\n\t\t\tExtensions.PK_Extension,\n\t\t\tExtension,\n Name\n\t\tFROM\n\t\t\tExtensions\n\t\tWHERE\n\t\t\tExtensions.Type IN ('Virtual', 'SipPhone')\n\t\tORDER BY Extension\n\t";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$Members = array();
while ($row = $result->fetch_assoc()) {
$Members[] = $row;
}
// Init available Sounds (SoundsFiles)
$query = "\n\t\tSELECT\n\t\t\tPK_SoundFile,\n\t\t\tSoundFiles.Name,\n\t\t\tSoundFiles.Description,\n\t\t\tSoundLanguages.Name AS Language\n\t\tFROM\n\t\t\tSoundFiles\n\t\t\tINNER JOIN SoundEntries ON FK_SoundEntry = PK_SoundEntry\n\t\t\tINNER JOIN SoundFolders ON FK_SoundFolder = PK_SoundFolder\n\t\t\tINNER JOIN SoundLanguages ON FK_SoundLanguage = PK_SoundLanguage\n\t\tWHERE\n\t\t\tSoundFolders.Name = 'Call Queues'\n\t\tORDER BY\n\t\t\tSoundLanguages.Name ASC,\n\t\t\tSoundFiles.Name ASC\n\t";
$result = $mysqli->query($query) or die($mysqli->error);
$SoundFiles = array();
while ($row = $result->fetch_assoc()) {
$SoundFiles[$row['Language']][$row['PK_SoundFile']] = $row['Name'];
}
// Init available moh groups
$query = "SELECT * FROM Moh_Groups ORDER BY Name ASC";
$result = $mysqli->query($query) or die($mysqli->error);
$MohGroups = array();
while ($row = $result->fetch_assoc()) {
$MohGroups[] = $row;
}
// Init form data (Queue)
if (@$_REQUEST['submit'] == 'save') {
$Queue = formdata_from_post();
$Errors = formdata_validate($Queue);
if (count($Errors) == 0) {
$id = formdata_save($Queue);
asterisk_UpdateConf('queues.conf');
asterisk_Reload();
header("Location: Extensions_List.php?msg=MODIFY_QUEUE_EXTENSION&hilight={$id}");
die;
}
} elseif (@$_REQUEST['PK_Extension'] != "") {
$Queue = formdata_from_db($_REQUEST['PK_Extension']);
} else {
$Queue = array('MemberRingTime' => '16', 'NextWaitTime' => '5', 'WrapUpTime' => '30', 'PlayMohInQueue' => '1', 'AnnounceFrequency' => '90', 'FK_Sound_PickupAnnouncement' => '4552', 'FK_Sound_YouAreNext' => '4401', 'FK_Sound_ThereAre' => '4249', 'FK_Sound_CallsWaiting' => '4394', 'FK_Sound_HoldTime' => '4351', 'FK_Sound_Minutes' => '4361', 'FK_Sound_ThankYou' => '4243');
}
$smarty->assign('Queue', $Queue);
$smarty->assign('RingStrategies', $RingStrategies);
$smarty->assign('SoundFiles', $SoundFiles);
$smarty->assign('MohGroups', $MohGroups);
$smarty->assign('Members', $Members);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('Extensions_Queue_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:60,代码来源:Extensions_Queue_Modify.php
示例6: Extensions_Action_Modify
function Extensions_Action_Modify()
{
global $mysqli;
$session =& $_SESSION['IVR_Action_Modify_record_digits'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
if (@$_REQUEST['submit'] == 'save') {
$Action = formdata_from_post();
$Errors = formdata_validate($Action);
if (count($Errors) == 0) {
$id = formdata_save($Action);
header("Location: IVR_Actions.php?PK_Menu={$Action['FK_Menu']}&hilight={$id}");
die;
}
} elseif (@$_REQUEST['PK_Action'] != "") {
$Action = formdata_from_db($_REQUEST['PK_Action']);
} else {
$Action = formdata_from_default();
}
// Get available vars
$query = "SELECT DISTINCT(Variable) FROM IVR_Action_Params";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_row()) {
if (!empty($row[0])) {
$Variables[] = $row[0];
}
}
$smarty->assign('Action', $Action);
$smarty->assign('Variables', $Variables);
return $smarty->fetch('IVR_Actions_Modify.record_digits.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:30,代码来源:IVR_Actions_Modify.record_digits.php
示例7: Groups_Popup_Create
function Groups_Popup_Create()
{
global $mysqli;
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init form data (Group, Errors)
if (@$_REQUEST['submit'] == 'save') {
$Group = formdata_from_post();
$Errors = formdata_validate($Group);
if (count($Errors) == 0) {
$id = formdata_save($Group);
return '
<script type="text/javascript" src="../script/jquery.selectboxes.js"></script>
<script>
$("#Groups", opener.document).addOption("' . $id . '", "' . $Group['Name'] . '");
window.close();
</script>
';
}
} else {
if ($_REQUEST['PK_Group'] != "") {
$Group = formdata_from_db($_REQUEST['PK_Group']);
}
}
// Init Availabe Extensions
$query = "\n\t\tSELECT\n\t\t\tExtensions.PK_Extension AS PK_Extension,\n\t\t\tExtension,\n\t\t\tName\n\t\tFROM\n\t\t\tExtensions\n\t\tWHERE\n\t\t\tType IN ('Virtual','SipPhone')\n\t\tORDER BY\n\t\t\tExtension ASC\n\t";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$Extensions = array();
while ($row = $result->fetch_assoc()) {
$Extensions[] = $row;
}
$smarty->assign('Errors', $Errors);
$smarty->assign('Group', $Group);
$smarty->assign('Extensions', $Extensions);
return $smarty->fetch('Groups_Popup_Create.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:35,代码来源:Groups_Popup_Create.php
示例8: Groups_Modify
function Groups_Modify()
{
global $mysqli;
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init form data (Group, Errors)
if (@$_REQUEST['submit'] == 'save') {
$Group = formdata_from_post();
$Errors = formdata_validate($Group);
if (count($Errors) == 0) {
$id = formdata_save($Group);
header("Location: Groups_List.php?msg=MODIFY_GROUP&hilight={$id}");
die;
}
} else {
if ($_REQUEST['PK_Group'] != "") {
$Group = formdata_from_db($_REQUEST['PK_Group']);
}
}
// Init Availabe Extensions
$query = "\n\t\tSELECT\n\t\t\tExtensions.PK_Extension AS PK_Extension,\n\t\t\tExtension,\n Name\n\t\tFROM\n\t\t\tExtensions\n\t\tWHERE\n\t\t\tType IN ('Virtual','SipPhone')\n\t\tORDER BY\n\t\t\tExtension ASC\n\t";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$Extensions = array();
while ($row = $result->fetch_assoc()) {
$Extensions[] = $row;
}
$smarty->assign('Errors', $Errors);
$smarty->assign('Group', $Group);
$smarty->assign('Extensions', $Extensions);
return $smarty->fetch('Groups_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:30,代码来源:Groups_Modify.php
示例9: IVR_Menus_Modify
function IVR_Menus_Modify()
{
global $mysqli;
$session =& $_SESSION['IVR_Menus_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
if (@$_REQUEST['submit'] == 'save') {
$Menu = formdata_from_post();
$Errors = formdata_validate($Action);
if (count($Errors) == 0) {
if ($Menu['PK_Menu'] != '') {
$msg = 'MODIFY_MENU';
} else {
$msg = 'ADD_MENU';
}
$id = formdata_save($Menu);
header("Location: IVR_Menus.php?PK_Menu={$id}&msg={$msg}");
die;
}
} elseif (@$_REQUEST['PK_Menu'] != "") {
$Menu = formdata_from_db($_REQUEST['PK_Menu']);
} else {
$Menu = formdata_from_default();
}
$smarty->assign('Menu', $Menu);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('IVR_Menus_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:27,代码来源:IVR_Menus_Modify.php
示例10: MOH_Groups_Modify
function MOH_Groups_Modify()
{
global $mysqli;
$session =& $_SESSION['MOH_Groups_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (@$_REQUEST['submit'] == 'save') {
$Group = formdata_from_post();
$Errors = formdata_validate($Group);
if (count($Errors) == 0) {
if ($Group['PK_Group'] != '') {
$msg = 'MODIFY_MOH_GROUP';
} else {
$msg = 'ADD_MOH_GROUP';
}
$id = formdata_save($Group);
asterisk_UpdateConf('musiconhold.conf');
asterisk_Reload();
header("Location: MOH_Groups_List.php?hilight={$id}&msg={$msg}");
die;
}
} elseif (@$_REQUEST['PK_Group'] != "") {
$Group = formdata_from_db($_REQUEST['PK_Group']);
} else {
$Group = formdata_from_default();
}
$smarty->assign('Group', $Group);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('MOH_Groups_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:31,代码来源:MOH_Groups_Modify.php
示例11: Account_Modify
function Account_Modify()
{
$session =& $_SESSION['Account_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init form data (Extension)
if (@$_REQUEST['submit'] == 'save') {
$Extension = formdata_from_post();
$Errors = formdata_validate($Extension);
if (count($Errors) == 0) {
$id = formdata_save($Extension);
asterisk_UpdateConf('sip.conf');
asterisk_UpdateConf('voicemail.conf');
asterisk_Reload();
header("Location: Account_Modify.php?msg=MODIFY_EXTENSION&hilight={$id}");
die;
}
} else {
$Extension = formdata_from_db($_SESSION['_USER']['PK_Extension']);
}
$smarty->assign('Extension', $Extension);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('Account_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:26,代码来源:Account_Modify.php
示例12: SoundLanguages_Modify
function SoundLanguages_Modify()
{
$session =& $_SESSION['Templates_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (@$_REQUEST['submit'] == 'save') {
$SoundLanguage = formdata_from_post();
$Errors = formdata_validate($Rule);
if (count($Errors) == 0) {
if ($SoundLanguage['PK_SoundLanguage'] == '') {
$id = formdata_save($SoundLanguage);
header("Location: SoundLanguages_List.php?msg=CREATE_LANGUAGE&hilight={$id}");
die;
} else {
$id = formdata_save($SoundLanguage);
header("Location: SoundLanguages_List.php?msg=MODIFY_LANGUAGE&hilight={$id}");
die;
}
}
} elseif ($_REQUEST['PK_SoundLanguage'] != "") {
$SoundLanguage = formdata_from_db($_REQUEST['PK_SoundLanguage']);
}
$smarty->assign('SoundLanguage', $SoundLanguage);
$smarty->assign('Message', $Message);
return $smarty->fetch('SoundLanguages_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:27,代码来源:SoundLanguages_Modify.php
示例13: IVR_Options_Modify
function IVR_Options_Modify()
{
global $mysqli;
$session =& $_SESSION['IVR_Options_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
if (@$_REQUEST['submit'] == 'save') {
$Option = formdata_from_post();
$Errors = formdata_validate($Action);
if (count($Errors) == 0) {
if ($Option['PK_Option'] != '') {
$msg = 'MODIFY_OPTION';
} else {
$msg = 'ADD_OPTION';
}
$id = formdata_save($Option);
header("Location: IVR_Options_List.php?PK_Menu={$Option['FK_Menu']}&hilight={$id}&msg={$msg}");
die;
}
} elseif (@$_REQUEST['PK_Option'] != "") {
$Option = formdata_from_db($_REQUEST['PK_Option']);
} else {
$Option = formdata_from_default();
}
// Get available menus
$Menus = array();
$query = "SELECT PK_Menu, Name FROM IVR_Menus ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$menu = $row;
$query2 = "SELECT * FROM IVR_Actions WHERE FK_Menu = '{$menu['PK_Menu']}' ORDER BY `Order`";
$result2 = $mysqli->query($query2) or die($mysqli->error . $query2);
while ($row2 = $result2->fetch_assoc()) {
$action = $row2;
$query3 = "SELECT * FROM IVR_Action_Params WHERE FK_Action = {$action['PK_Action']}";
$result3 = $mysqli->query($query3) or die($mysqli->error . $query3);
while ($row3 = $result3->fetch_assoc()) {
$action['Param'][$row3['Name']] = $row3['Value'];
$action['Var'][$row3['Name']] = $row3['Variable'];
}
$menu['Actions'][] = $action;
}
$Menus[] = $menu;
}
// Get used keys
$UsedKeys = array();
$query = "SELECT `Key` FROM IVR_Options WHERE PK_Option != '{$Option['PK_Option']}' AND FK_Menu={$Option['FK_Menu']}";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$UsedKeys[] = $row['Key'];
}
$smarty->assign('Menus', $Menus);
$smarty->assign('Option', $Option);
$smarty->assign('UsedKeys', $UsedKeys);
return $smarty->fetch('IVR_Options_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:55,代码来源:IVR_Options_Modify.php
示例14: SoundFiles_Modify
function SoundFiles_Modify()
{
global $mysqli;
$session =& $_SESSION['SoundFiles_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (@$_REQUEST['submit'] == 'save') {
$SoundFile = formdata_from_post();
$Errors = formdata_validate($SoundFile);
if (count($Errors) == 0) {
$id = formdata_save($SoundFile);
header("Location: SoundEntries_List.php?msg=MODIFY_ENTRY&hilight={$SoundFile['FK_SoundEntry']}");
die;
}
} elseif ($_REQUEST['PK_SoundFile'] != "") {
$SoundFile = formdata_from_db($_REQUEST['PK_SoundFile']);
}
$query = "SELECT PK_SoundFolder, Name FROM SoundFolders ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error);
while ($row = $result->fetch_assoc()) {
$SoundFolders[] = $row;
}
$query = "SELECT PK_SoundLanguage, Name FROM SoundLanguages ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error);
while ($row = $result->fetch_assoc()) {
$SoundLanguages[] = $row;
}
if ($_REQUEST['PK_SoundEntry'] != "") {
$PK_SoundEntry = $_REQUEST['PK_SoundEntry'];
} elseif ($SoundFile['PK_SoundFile'] != "") {
$PK_SoundEntry = $SoundFile['FK_SoundEntry'];
}
if ($_REQUEST['PK_SoundLanguage'] != "") {
$PK_SoundLanguage = $_REQUEST['PK_SoundLanguage'];
} elseif ($SoundFile['PK_SoundFile'] != "") {
$PK_SoundLanguage = $SoundFile['FK_SoundLanguage'];
}
if ($PK_SoundEntry != "") {
$query = "SELECT FK_SoundFolder FROM SoundEntries WHERE PK_SoundEntry = {$PK_SoundEntry} LIMIT 1";
$result = $mysqli->query($query) or die($mysqli->error . $query);
$row = $result->fetch_array();
$PK_SoundFolder = $row[0];
}
$smarty->assign('SoundFile', $SoundFile);
$smarty->assign('SoundFolders', $SoundFolders);
$smarty->assign('SoundLanguages', $SoundLanguages);
$smarty->assign('PK_SoundEntry', $PK_SoundEntry);
$smarty->assign('PK_SoundLanguage', $PK_SoundLanguage);
$smarty->assign('PK_SoundFolder', $PK_SoundFolder);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('SoundFiles_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:54,代码来源:SoundFiles_Modify.php
示例15: VoipProviders_Modify
function VoipProviders_Modify()
{
global $mysqli;
$session =& $_SESSION['VoipProviders_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// myprint($_REQUEST);
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init Available DTMF Modes (DTMFModes)
$query = "SELECT PK_DTMFMode, Name, Description FROM DTMFModes";
$result = $mysqli->query($query) or die($mysqli->errno());
$DTMFModes = array();
while ($row = $result->fetch_assoc()) {
$DTMFModes[] = $row;
}
// Init available codecs (Codecs)
$query = "SELECT PK_Codec, Name, Description, Recomended FROM Codecs";
$result = $mysqli->query($query) or die($mysqli->error);
$Codecs = array();
while ($row = $result->fetch_assoc()) {
$Codecs[] = $row;
}
// Init available outgoing rules (Rules)
$query = "SELECT * FROM OutgoingRules ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->errno());
$Rules = array();
while ($row = $result->fetch_assoc()) {
$Rules[] = $row;
}
// Init form data (Providers)
if ($_REQUEST['submit'] == 'save') {
$Provider = formdata_from_post();
$Errors = formdata_validate($Provider);
if (count($Errors) == 0) {
$id = formdata_save($Provider);
asterisk_UpdateConf('sip.conf');
asterisk_UpdateConf('extensions.conf');
asterisk_Reload();
header("Location: VoipProviders_List.php?msg=MODIFY_SIP_PROVIDER&hilight={$id}");
die;
}
} elseif ($_REQUEST['PK_SipProvider'] != "") {
$Provider = formdata_from_db($_REQUEST['PK_SipProvider']);
} else {
$Provider = formdata_from_default();
}
$smarty->assign('Provider', $Provider);
$smarty->assign('DTMFModes', $DTMFModes);
$smarty->assign('Codecs', $Codecs);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
$smarty->assign('Rules', $Rules);
return $smarty->fetch('VoipProviders_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:54,代码来源:VoipProviders_Modify.php
示例16: Recordings_ModifyRule
function Recordings_ModifyRule()
{
global $mysqli;
$session =& $_SESSION['Recordings_ModifyRule'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
if (@$_REQUEST['submit'] == 'save') {
$Rule = formdata_from_post();
$Errors = formdata_validate($Rule);
if (count($Errors) == 0) {
if ($Rule['PK_Rule'] != '') {
$msg = 'MODIFY_REC_RULE';
} else {
$msg = 'ADD_REC_RULE';
}
$id = formdata_save($Rule);
header("Location: Recordings_List.php?hilight={$id}&msg={$msg}");
die;
}
} elseif (@$_REQUEST['PK_Rule'] != "") {
$Rule = formdata_from_db($_REQUEST['PK_Rule']);
} else {
$Rule = formdata_from_default();
}
// Geting a list of phone extension (Phones)
$Phones = array();
$query = "\n\t\tSELECT\n\t\t\tExtensions.PK_Extension AS PK_Extension,\n\t\t\tExtension,\n\t\t\tName\n\t\tFROM\n\t\t\tExtensions\n\t\tWHERE\n\t\t\tType IN ('Virtual','SipPhone')\n\t\tORDER BY\n\t\t\tExtension ASC\n\t";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$Phones[] = $row;
}
// Geting a list of extension groups (Groups)
$Groups = array();
$query = "SELECT * FROM Groups ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$Groups[] = $row;
}
// Geting a list of queues (Queues)
$Queues = array();
$query = "SELECT * FROM Ext_Queues INNER JOIN Extensions ON Ext_Queues.PK_Extension = Extensions.PK_Extension ORDER BY Extension ASC";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$Queues[] = $row;
}
$smarty->assign('Groups', $Groups);
$smarty->assign('Queues', $Queues);
$smarty->assign('Phones', $Phones);
$smarty->assign('Rule', $Rule);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('Recordings_ModifyRule.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:53,代码来源:Recordings_ModifyRule.php
示例17: Extensions_Agent_Modify
function Extensions_Agent_Modify()
{
global $mysqli;
$session =& $_SESSION['Extensions_Agent_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init available extension groups (Groups)
$query = "SELECT PK_Group, Name FROM Groups";
$result = $mysqli->query($query) or die($mysqli->errno());
$Groups = array();
while ($row = $result->fetch_assoc()) {
$Groups[] = $row;
}
// Init available outgoing rules (Rules)
$query = "SELECT * FROM OutgoingRules ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->errno());
$Rules = array();
while ($row = $result->fetch_assoc()) {
$Rules[] = $row;
}
// Init available extension groups (Features)
$query = "SELECT PK_Feature, Name FROM Features";
$result = $mysqli->query($query) or die($mysqli->errno());
$Features = array();
while ($row = $result->fetch_assoc()) {
$Features[] = $row;
}
// Init form data (Extension)
if (@$_REQUEST['submit'] == 'save') {
$Extension = formdata_from_post();
$Errors = formdata_validate($Extension);
if (count($Errors) == 0) {
$id = formdata_save($Extension);
asterisk_UpdateConf('sip.conf');
asterisk_UpdateConf('voicemail.conf');
asterisk_Reload();
header("Location: Extensions_List.php?msg=MODIFY_AGENT_EXTENSION&hilight={$id}");
die;
}
} elseif (@$_REQUEST['PK_Extension'] != "") {
$Extension = formdata_from_db($_REQUEST['PK_Extension']);
} else {
$Extension = formdata_from_template($_REQUEST['FK_Template']);
}
$smarty->assign('Extension', $Extension);
$smarty->assign('Features', $Features);
$smarty->assign('Groups', $Groups);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
$smarty->assign('Rules', $Rules);
return $smarty->fetch('Extensions_Agent_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:53,代码来源:Extensions_Agent_Modify.php
示例18: Dongles_Modify
function Dongles_Modify()
{
global $mysqli;
$session =& $_SESSION['Dongles_Modify'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// myprint($_REQUEST);
// Init message (Message)
$Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : "";
// Init available outgoing rules (Rules)
$query = "SELECT * FROM OutgoingRules ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->errno());
$Rules = array();
while ($row = $result->fetch_assoc()) {
$Rules[] = $row;
}
$discovery_response = explode("\n", asterisk_Cmd('dongle discovery'));
$discovered_dongles = array();
$discovered_i = -1;
for ($i = 0; $i < sizeof($discovery_response); $i++) {
if (substr($discovery_response[$i], 0, 1) == "[") {
$discovered_i++;
$discovered_dongles[$discovered_i] = array();
} elseif (substr($discovery_response[$i], 0, 4) == "imsi") {
$discovered_dongles[$discovered_i]["IMSI"] = substr($discovery_response[$i], 5);
} elseif (substr($discovery_response[$i], 0, 4) == "imei") {
$discovered_dongles[$discovered_i]["IMEI"] = substr($discovery_response[$i], 5);
}
}
// Init form data (Providers)
if ($_REQUEST['submit'] == 'save') {
$Dongle = formdata_from_post();
$Errors = formdata_validate($Dongle);
if (count($Errors) == 0) {
$id = formdata_save($Dongle);
asterisk_UpdateConf('dongle.conf');
asterisk_UpdateConf('extensions.conf');
asterisk_Reload();
header("Location: Dongles_List.php?msg=MODIFY_DONGLE&hilight={$id}");
die;
}
} elseif ($_REQUEST['PK_Dongle'] != "") {
$Dongle = formdata_from_db($_REQUEST['PK_Dongle']);
} else {
$Dongle = formdata_from_default();
}
$smarty->assign('Dongle', $Dongle);
$smarty->assign('DiscoveredDongles', $discovered_dongles);
$smarty->assign('Message', $Message);
$smarty->assign('Errors', $Errors);
$smarty->assign('Rules', $Rules);
return $smarty->fetch('Dongles_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:52,代码来源:Dongles_Modify.php
示例19: Extensions_Action_Modify
function Extensions_Action_Modify()
{
global $mysqli;
$session =& $_SESSION['IVR_Action_Modify_conditional_clause'];
$smarty = smarty_init(dirname(__FILE__) . '/templates');
if (@$_REQUEST['submit'] == 'save') {
$Action = formdata_from_post();
$Errors = formdata_validate($Action);
if (count($Errors) == 0) {
$id = formdata_save($Action);
header("Location: IVR_Actions.php?PK_Menu={$Action['FK_Menu']}&hilight={$id}");
die;
}
} elseif (@$_REQUEST['PK_Action'] != "") {
$Action = formdata_from_db($_REQUEST['PK_Action']);
} else {
$Action = formdata_from_default();
}
// Get available vars
$Variables = array();
$query = "SELECT DISTINCT(Variable) FROM IVR_Action_Params";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_row()) {
if (!empty($row[0])) {
$Variables[] = $row[0];
}
}
// Get available menus
$Menus = array();
$query = "SELECT PK_Menu, Name FROM IVR_Menus ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error . $query);
while ($row = $result->fetch_assoc()) {
$menu = $row;
$query2 = "SELECT * FROM IVR_Actions WHERE FK_Menu = '{$menu['PK_Menu']}' ORDER BY `Order`";
$result2 = $mysqli->query($query2) or die($mysqli->error . $query2);
while ($row2 = $result2->fetch_assoc()) {
$action = $row2;
$query3 = "SELECT * FROM IVR_Action_Params WHERE FK_Action = {$action['PK_Action']}";
$result3 = $mysqli->query($query3) or die($mysqli->error . $query3);
while ($row3 = $result3->fetch_assoc()) {
$action['Param'][$row3['Name']] = $row3['Value'];
$action['Var'][$row3['Name']] = $row3['Variable'];
}
$menu['Actions'][] = $action;
}
$Menus[] = $menu;
}
$smarty->assign('Menus', $Menus);
$smarty->assign('Action', $Action);
$smarty->assign('Variables', $Variables);
return $smarty->fetch('IVR_Actions_Modify.conditional_clause.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:52,代码来源:IVR_Actions_Modify.conditional_clause.php
示例20: OutgoingCalls_Rule_Modify
function OutgoingCalls_Rule_Modify()
{
global $mysqli;
$smarty = smarty_init(dirname(__FILE__) . '/templates');
// Init form data (Rule, Errors)
if (@$_REQUEST['submit'] == 'save') {
$Rule = formdata_from_post();
$Errors = formdata_validate($Rule);
if (count($Errors) == 0) {
$id = formdata_save($Rule);
asterisk_UpdateConf('extensions.conf');
asterisk_Reload();
if ($Rule['PK_OutgoingRule'] == '') {
header("Location: OutgoingCalls.php?msg=CREATE_RULE&hilight={$id}");
die;
} else {
header("Location: OutgoingCalls.php?msg=MODIFY_RULE&hilight={$id}");
die;
}
}
} else {
if ($_REQUEST['PK_OutgoingRule'] != "") {
$Rule = formdata_from_db($_REQUEST['PK_OutgoingRule']);
} else {
$Rule['Allow'] = '1';
$Rule['Final'] = '1';
}
}
// SipProviders
$SipProviders = array();
$query = "SELECT * FROM SipProviders ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error);
while ($row = $result->fetch_assoc()) {
$SipProviders[] = $row;
}
// IaxProviders
$Dongles = array();
$query = "SELECT * FROM Dongles ORDER BY Name";
$result = $mysqli->query($query) or die($mysqli->error);
while ($row = $result->fetch_assoc()) {
$Dongles[] = $row;
}
$smarty->assign('SipProviders', $SipProviders);
$smarty->assign('Dongles', $Dongles);
$smarty->assign('Rule', $Rule);
$smarty->assign('Errors', $Errors);
return $smarty->fetch('OutgoingCalls_Rule_Modify.tpl');
}
开发者ID:rakesh-mohanta,项目名称:yunapbx,代码行数:48,代码来源:OutgoingCalls_Rule_Modify.php
注:本文中的formdata_from_db函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论