function registry_update($uid, $registry_group, $registry_family, $items) { $ret = false; $db_table = _DB_PREF_ . '_tblRegistry'; if (is_array($items)) { foreach ($items as $key => $val) { $conditions = array('uid' => $uid, 'registry_group' => $registry_group, 'registry_family' => $registry_family, 'registry_key' => $key); $values = array('c_timestamp' => strtotime(core_get_datetime()), 'registry_value' => $val); if (dba_count($db_table, $conditions)) { $ret[$key] = dba_update($db_table, $values, $conditions); } else { $ret[$key] = dba_add($db_table, array_merge($conditions, $values)); } unset($conditions); unset($values); } } return $ret; }
function queuelog_get($line_per_page = '', $limit = '') { global $user_config; $ret = array(); if ($user_config['status'] != 2) { $user_query = "AND uid='" . $user_config['uid'] . "'"; } if ($line_per_page) { $line_per_page_query = "LIMIT {$line_per_page}"; } if ($limit) { $limit_query = "OFFSET {$limit}"; } $db_query = "SELECT * FROM " . _DB_PREF_ . "_tblSMSOutgoing_queue WHERE (flag='0' OR flag='3') " . $user_query . " ORDER BY id " . $line_per_page_query . " " . $limit_query; $db_result = dba_query($db_query); while ($db_row = dba_fetch_array($db_result)) { $c_id = $db_row['id']; $db_row['count'] = dba_count(_DB_PREF_ . '_tblSMSOutgoing_queue_dst', array('flag' => 0, 'queue_id' => $c_id)); $ret[] = $db_row; } return $ret; }
switch (_OP_) { case "all_outgoing": $search_category = array(_('User') => 'username', _('Gateway') => 'p_gateway', _('SMSC') => 'p_smsc', _('Time') => 'p_datetime', _('To') => 'p_dst', _('Message') => 'p_msg', _('Footer') => 'p_footer'); $base_url = 'index.php?app=main&inc=feature_report&route=all_outgoing&op=all_outgoing'; $queue_label = ""; $queue_home_link = ""; if ($queue_code = trim($_REQUEST['queue_code'])) { $queue_label = "<h4>" . sprintf(_('List of queue %s'), $queue_code) . "</h4>"; $queue_home_link = _back($base_url); $base_url .= '&queue_code=' . $queue_code; $search = themes_search($search_category, $base_url); $conditions = array('A.queue_code' => $queue_code, 'A.flag_deleted' => 0); $keywords = $search['dba_keywords']; $table = _DB_PREF_ . '_tblSMSOutgoing'; $join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.uid=B.uid"; $count = dba_count($table . ' AS A', $conditions, $keywords, '', $join); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'A.smslog_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search($table . ' AS A', 'B.username, A.p_gateway, A.p_smsc, A.smslog_id, A.p_dst, A.p_sms_type, A.p_msg, A.p_footer, A.p_datetime, A.p_update, A.p_status, A.uid, A.queue_code', $conditions, $keywords, $extras, $join); } else { $search = themes_search($search_category, $base_url); $conditions = array('A.flag_deleted' => 0); $keywords = $search['dba_keywords']; $table = _DB_PREF_ . '_tblSMSOutgoing'; $join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.uid=B.uid"; $list = dba_search($table . ' AS A', 'A.id', $conditions, $keywords, array('GROUP BY' => 'A.queue_code'), $join); $count = count($list); $nav = themes_nav($count, $search['url']); $extras = array('GROUP BY' => 'A.queue_code', 'ORDER BY' => 'A.smslog_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search($table . ' AS A', 'B.username, A.p_gateway, A.p_smsc, A.smslog_id, A.p_dst, A.p_sms_type, A.p_msg, A.p_footer, A.p_datetime, A.p_update, A.p_status, A.uid, A.queue_code, COUNT(*) AS queue_count', $conditions, $keywords, $extras, $join); }
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule WHERE uid='" . $user_config['uid'] . "' AND id='{$id}' AND flag_deleted='0'"; $db_result = dba_query($db_query); $db_row = dba_fetch_array($db_result); $name = $db_row['name']; $message = $db_row['message']; $schedule_rule = $db_row['schedule_rule']; if ($id && $name && $message) { $content = _dialog() . "\n\t\t\t\t<h2>" . _('Schedule messages') . "</h2>\n\t\t\t\t<h3>" . _('Manage schedule') . "</h3>\n\t\t\t\t" . _CSRF_FORM_ . "\n\t\t\t\t<input type=hidden name=id value='{$id}'>\n\t\t\t\t<table class=playsms-table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=label-sizer>" . _('Schedule ID') . "</td><td>" . $id . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Schedule name') . "</td><td>" . $name . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Scheduled message') . "</td><td>" . $message . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Schedule rule') . "</td><td>" . $plugin_config['schedule']['rules_display'][$schedule_rule] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>"; // list of destinations $search_category = array(_('Schedule') => 'schedule', _('Name') => 'name', _('Destination') => 'destination'); $base_url = 'index.php?app=main&inc=feature_schedule&route=manage&op=list&id=' . $id; $search = themes_search($search_category, $base_url); $fields = '*'; $conditions = array('schedule_id' => $id); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_featureSchedule_dst', $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'schedule, name, destination', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_featureSchedule_dst', $fields, $conditions, $keywords, $extras); $content .= "\n\t\t\t\t<h3>" . _('List of destinations') . "</h3>\n\t\t\t\t<form name=fm_schedule_dst_list id=fm_schedule_dst_list action='" . $base_url . "' method=post>\n\t\t\t\t" . _CSRF_FORM_ . "\n\t\t\t\t<p>" . $search['form'] . "</p>\t\t\t\t\t\t\n\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_schedule&route=manage&op=dst_add&schedule_id=' . $id) . "'>" . $icon_config['add'] . "</a>\n\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_schedule&route=import&op=list&schedule_id=' . $id) . "'>" . $icon_config['import'] . "</a>\n\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_schedule&route=export&op=list&schedule_id=' . $id) . "'>" . $icon_config['export'] . "</a>\n\t\t\t\t<div class=table-responsive>\n\t\t\t\t<table class=playsms-table-list>\n\t\t\t\t<thead><tr>\n\t\t\t\t\t<th width=30%>" . _('Name') . "</th>\n\t\t\t\t\t<th width=30%>" . _('Destination') . "</th>\n\t\t\t\t\t<th width=30%>" . _('Schedule') . "</th>\n\t\t\t\t\t<th width=10%>" . _('Action') . "</th>\n\t\t\t\t</tr></thead>\n\t\t\t\t<tbody>"; foreach ($list as $db_row) { $action = "<a href=\"" . _u('index.php?app=main&inc=feature_schedule&route=manage&op=dst_edit&schedule_id=' . $id . '&id=' . $db_row['id']) . "\">" . $icon_config['edit'] . "</a> "; $action .= "<a href=\"javascript: ConfirmURL('" . _('Are you sure you want to remove this number from SMS schedule ?') . " (" . $db_row['name'] . " " . $db_row['destination'] . ")','" . _u('index.php?app=main&inc=feature_schedule&route=manage&op=dst_del&schedule_id=' . $id . '&id=' . $db_row['id']) . "')\">" . $icon_config['delete'] . "</a>"; $i++; $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $db_row['name'] . "</td>\n\t\t\t\t\t\t<td>" . $db_row['destination'] . "</td>\n\t\t\t\t\t\t<td>" . core_display_datetime($db_row['schedule']) . "</td>\n\t\t\t\t\t\t<td>" . $action . "</td>\n\t\t\t\t\t</tr>"; } $content .= "\n\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>" . $nav['form'] . "</div>\n\t\t\t\t</form>"; $content .= "<p>" . _back('index.php?app=main&inc=feature_schedule&op=list'); } else { auth_block(); }
$c_sender_id = core_sanitize_sender($c_sender_id); } // sender ID description $c_sender_id_description = trim($_REQUEST['description']) ? trim($_REQUEST['description']) : $c_sender_id; switch (_OP_) { case 'sender_id_list': $search_category = array(_('Username') => 'uid', _('Sender ID') => 'registry_key'); $keyword_converter = array('uid' => 'user_username2uid'); $base_url = 'index.php?app=main&inc=core_sender_id&op=sender_id_list'; $search = themes_search($search_category, $base_url, $keyword_converter); $conditions = array('uid' => $user_config['uid'], 'registry_family' => 'sender_id'); if (auth_isadmin()) { unset($conditions['uid']); } $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_tblRegistry', $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'uid', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblRegistry', '*', $conditions, $keywords, $extras); $sender_id_list = array(); $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $username = auth_isadmin() ? user_uid2username($list[$j]['uid']) : ''; $status = $list[$j]['registry_value'] == 1 ? "<span class=status_enabled></span>" : "<span class=status_disabled></span>"; $toggle_status = auth_isadmin() ? "<a href='" . _u('index.php?app=main&inc=core_sender_id&op=toggle_status&id=' . $list[$j]['id']) . "'>" . $status . "</a>" : $status; $action = "\n\t\t\t\t<a href='" . _u('index.php?app=main&inc=core_sender_id&op=sender_id_edit&id=' . $list[$j]['id']) . "'>" . $icon_config['edit'] . "</a>\n\t\t\t\t<a href=\"javascript: ConfirmURL('" . addslashes(_('Are you sure you want to delete sender ID') . ' ? (' . _('Sender ID') . ': ' . $list[$j]['registry_key'] . ')') . "','" . _u('index.php?app=main&inc=core_sender_id&op=sender_id_delete&id=' . $list[$j]['id']) . "')\">" . $icon_config['delete'] . "</a>\n\t\t\t"; $sender_id_list[] = array('username' => $username, 'sender_id' => core_sanitize_sender($list[$j]['registry_key']), 'sender_id_description' => sender_id_description($list[$j]['uid'], $list[$j]['registry_key']), 'lastupdate' => core_display_datetime(core_convert_datetime($list[$j]['c_timestamp'])), 'status' => $toggle_status, 'action' => $action); } $tpl = array('name' => 'sender_id', 'vars' => array('DIALOG_DISPLAY' => _dialog(), 'SEARCH_FORM' => $search['form'], 'NAV_FORM' => $nav['form'], 'FORM_TITLE' => _('Manage sender ID'), 'ADD_URL' => _u('index.php?app=main&inc=core_sender_id&op=sender_id_add'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_STATUS' => _hint(_('Click the status button to enable or disable status')), 'Sender ID' => _('Sender ID'), 'Username' => _('Username'), 'Last update' => _('Last update')), 'ifs' => array('isadmin' => auth_isadmin()), 'loops' => array('sender_id_list' => $sender_id_list), 'injects' => array('icon_config')); _p(tpl_apply($tpl));
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isadmin()) { auth_block(); } switch (_OP_) { case "stoplist_list": $search_category = array(_('Mobile') => 'mobile', _('Username') => 'uid'); $base_url = 'index.php?app=main&inc=feature_stoplist&op=stoplist_list'; $search = themes_search($search_category, $base_url, array('uid' => 'user_username2uid')); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_featureStoplist', '', $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'uid', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_featureStoplist', '*', '', $keywords, $extras); $content = _dialog() . "\n\t\t\t<h2>" . _('Manage stoplist') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form name=fm_stoplist_list id=fm_stoplist_list action='index.php?app=main&inc=feature_stoplist&op=actions' method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=3>\n\t\t\t\t\t\t\t<div class=actions_box>\n\t\t\t\t\t\t\t\t<div class=pull-left>\n\t\t\t\t\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_stoplist&op=stoplist_add') . "'>" . $icon_config['add'] . "</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\t\t\$('#action_go').click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\$('#fm_stoplist_list').submit();\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t\t<div class=pull-right>\n\t\t\t\t\t\t\t\t\t<select name=go class=search_input_category>\n\t\t\t\t\t\t\t\t\t\t<option value=>" . _('Select') . "</option>\n\t\t\t\t\t\t\t\t\t\t<option value=delete>" . _('Delete') . "</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t<a href='#' id=action_go>" . $icon_config['go'] . "</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th width=45%>" . _('User') . "</th>\n\t\t\t\t\t\t<th width=50%>" . _('Blocked mobile') . "</th>\n\t\t\t\t\t\t<th width=5%><input type=checkbox onclick=CheckUncheckAll(document.fm_stoplist_list)></th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $pid = $list[$j]['id']; $username = user_uid2username($list[$j]['uid']); $mobile = $list[$j]['mobile']; $i--; $c_i = "<a href=\"" . _u('index.php?app=main&inc=feature_stoplist&op=stoplist_edit&id=' . $pid) . "\">" . $i . ".</a>"; if ($list[$j]['uid'] == $user_config['uid']) { $name = "<a href='" . _u('index.php?app=main&inc=feature_stoplist&op=stoplist_edit&pid=' . $pid) . "'>" . $name . "</a>"; }
* * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "user_incoming": $search_category = array(_('Time') => 'in_datetime', _('From') => 'in_sender', _('Keyword') => 'in_keyword', _('Content') => 'in_message', _('Feature') => 'in_feature'); $base_url = 'index.php?app=main&inc=feature_report&route=user_incoming&op=user_incoming'; $search = themes_search($search_category, $base_url); $conditions = array('in_uid' => $user_config['uid'], 'flag_deleted' => 0, 'in_status' => 1); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_tblSMSIncoming', $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('AND in_feature' => '!= ""', 'ORDER BY' => 'in_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblSMSIncoming', 'in_id, in_sender, in_keyword, in_datetime, in_feature, in_message', $conditions, $keywords, $extras); $content = "\n\t\t\t<h2>" . _('My feature messages') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form id=fm_incoming name=fm_incoming action=\"index.php?app=main&inc=feature_report&route=user_incoming&op=actions\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=go value=delete>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_report&route=user_incoming&op=actions&go=export') . "\">" . $icon_config['export'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<a href='#' onClick=\"return SubmitConfirm('" . _('Are you sure you want to delete these items ?') . "', 'fm_incoming');\">" . $icon_config['delete'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=20%>" . _('From') . "</th>\n\t\t\t\t<th width=20%>" . _('Keyword') . "</th>\n\t\t\t\t<th width=55%>" . _('Content') . "</th>\n\t\t\t\t<th width=5% class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_incoming)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $list[$j] = core_display_data($list[$j]); $in_id = $list[$j]['in_id']; $in_sender = $list[$j]['in_sender']; $current_sender = report_resolve_sender($user_config['uid'], $in_sender); $in_keyword = $list[$j]['in_keyword']; $in_datetime = core_display_datetime($list[$j]['in_datetime']); $in_feature = $list[$j]['in_feature']; // $in_status = ($list[$j]['in_status'] == 1 ? '<span class=status_handled />' : '<span class=status_unhandled />');
* * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "user_inbox": $search_category = array(_('Time') => 'in_datetime', _('From') => 'in_sender', _('Message') => 'in_msg'); $base_url = 'index.php?app=main&inc=feature_report&route=user_inbox&op=user_inbox'; $search = themes_search($search_category, $base_url); $conditions = array('in_uid' => $user_config['uid'], 'flag_deleted' => 0); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_tblUser_inbox', $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'in_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblUser_inbox', '*', $conditions, $keywords, $extras); unset($tpl); $tpl = array('vars' => array('SEARCH_FORM' => $search['form'], 'NAV_FORM' => $nav['form'], 'Inbox' => _('Inbox'), 'Export' => $icon_config['export'], 'Delete' => $icon_config['delete'], 'From' => _('From'), 'Message' => _('Message'), 'ARE_YOU_SURE' => _('Are you sure you want to delete these items ?'))); $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $list[$j] = core_display_data($list[$j]); $in_id = $list[$j]['in_id']; $in_sender = $list[$j]['in_sender']; $p_desc = phonebook_number2name($in_sender); $current_sender = $in_sender; if ($p_desc) { $current_sender = "{$in_sender}<br />{$p_desc}";
} } switch (_OP_) { case "credit_list": $db_table = $plugin_config['credit']['db_table']; $search_category = array(_('Username') => 'username', _('Transaction datetime') => 'create_datetime'); $base_url = 'index.php?app=main&inc=feature_credit&op=credit_list'; $search = themes_search($search_category, $base_url); $conditions = array('flag_deleted' => 0); // only if users if ($user_config['status'] == 3) { $conditions['parent_uid'] = $user_config['uid']; $conditions['status'] = 4; } $keywords = $search['dba_keywords']; $count = dba_count($db_table, $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search($db_table, '*', $conditions, $keywords, $extras); $content = "\n\t\t\t<h2>" . _('Manage credit') . "</h2>\n\t\t\t<h3>" . _('List of transactions') . "</h3>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form id=fm_feature_credit name=fm_feature_credit action=\"" . _u('index.php?app=main&inc=feature_credit&op=actions') . "\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=go value=delete>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_credit&op=credit_add') . "\">" . $icon_config['add'] . "</a>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_credit&op=credit_reduce') . "\">" . $icon_config['reduce'] . "</a>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_credit&op=actions&go=export') . "\">" . $icon_config['export'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<a href='#' onClick=\"return SubmitConfirm('" . _('Are you sure you want to delete these transactions ?') . "', 'fm_feature_credit');\">" . $icon_config['delete'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=20%>" . _('User') . "</th>\n\t\t\t\t<th width=40%>" . _('Transaction datetime') . "</th>\n\t\t\t\t<th width=35%>" . _('Amount') . "</th>\n\t\t\t\t<th width=5% class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_feature_credit)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $j = 0; foreach ($list as $row) { $row = core_display_data($row); $content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $row['username'] . "</td>\n\t\t\t\t\t<td>" . core_display_datetime($row['create_datetime']) . "</td>\n\t\t\t\t\t<td>" . $row['amount'] . "</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=hidden name=itemid" . $j . " value=\"" . $row['id'] . "\">\n\t\t\t\t\t\t<input type=checkbox name=checkid" . $j . ">\n\t\t\t\t\t</td>\n\t\t\t\t</tr>"; $j++; } $content .= "\n\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div class=pull-right>" . $nav['form'] . "</div>\n\t\t\t</form>"; if ($err = TRUE) { _p(_dialog()); } _p($content);
* You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isadmin()) { auth_block(); } switch (_OP_) { case "all_incoming": $search_category = array(_('User') => 'username', _('Time') => 'in_datetime', _('From') => 'in_sender', _('Keyword') => 'in_keyword', _('Content') => 'in_message', _('Feature') => 'in_feature'); $base_url = 'index.php?app=main&inc=feature_report&route=all_incoming&op=all_incoming'; $search = themes_search($search_category, $base_url); $conditions = array('A.flag_deleted' => 0, 'A.in_status' => 1); $keywords = $search['dba_keywords']; $join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.in_uid=B.uid"; $count = dba_count(_DB_PREF_ . '_tblSMSIncoming as A', $conditions, $keywords, '', $join); $nav = themes_nav($count, $search['url']); $extras = array('AND A.in_feature' => '!= ""', 'ORDER BY' => 'A.in_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblSMSIncoming AS A', 'B.username, A.in_id, A.in_uid, A.in_sender, A.in_keyword, A.in_datetime, A.in_feature, A.in_message', $conditions, $keywords, $extras, $join); $content = "\n\t\t\t<h2>" . _('All feature messages') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form id=fm_all_incoming name=fm_all_incoming action=\"index.php?app=main&inc=feature_report&route=all_incoming&op=actions\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=go value=delete>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_report&route=all_incoming&op=actions&go=export') . "\">" . $icon_config['export'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<a href='#' onClick=\"return SubmitConfirm('" . _('Are you sure you want to delete these items ?') . "', 'fm_all_incoming');\">" . $icon_config['delete'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=20%>" . _('User') . "</th>\n\t\t\t\t<th width=20%>" . _('From') . "</th>\n\t\t\t\t<th width=20%>" . _('Keyword') . "</th>\n\t\t\t\t<th width=35%>" . _('Content') . "</th>\n\t\t\t\t<th width=5% class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_all_incoming)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $list[$j] = core_display_data($list[$j]); $in_username = $list[$j]['username']; $in_id = $list[$j]['in_id']; $in_uid = $list[$j]['in_uid']; $in_sender = $list[$j]['in_sender']; $current_sender = report_resolve_sender($in_uid, $in_sender); $in_keyword = $list[$j]['in_keyword']; $in_datetime = core_display_datetime($list[$j]['in_datetime']);
function sms_poll_output_serialize($poll_id, $poll_keyword) { $list2 = dba_search(_DB_PREF_ . '_featurePoll_choice', '*', array('poll_id' => $poll_id)); $poll_choices = array(); for ($i = 0; $i < count($list2); $i++) { $c_keyword = $list2[$i]['choice_keyword']; $c_title = $list2[$i]['choice_title']; $poll_choices[$c_keyword] = $c_title; $choice_ids[$c_keyword] = $list2[$i]['choice_id']; } $poll_results = array(); $votes = 0; foreach ($choice_ids as $key => $val) { $c_num = dba_count(_DB_PREF_ . '_featurePoll_log', array('poll_id' => $poll_id, 'choice_id' => $val, 'status' => 1)); $poll_results[$key] = (int) $c_num ? $c_num : 0; $votes += $c_num; } $ret['keyword'] = $poll_keyword; $ret['votes'] = $votes; $ret['choices'] = $poll_choices; $ret['results'] = $poll_results; $ret = serialize($ret); return $ret; }
${'selected_' . $group['flag_sender']} = 'selected'; $option_flag_sender = "\n\t\t\t<option value='0' {$selected_0}>" . _('Me only') . "</option>\n\t\t\t<option value='1' {$selected_1}>" . _('Members') . "</option>\n\t\t\t<option value='2' {$selected_2}>" . _('Anyone') . "</option>"; $content = _dialog() . "\n\t\t\t<h2>" . _('Phonebook') . "</h2>\n\t\t\t<h3>" . _('Edit group') . "</h3>\n\t\t\t<p>\n\t\t\t<form action=\"index.php?app=main&inc=feature_phonebook&route=group&op=actions&go=edit\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=gpid value=\"{$gpid}\">\n\t\t\t<table class=playsms-table>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('Group name') . "</td>\n\t\t\t\t<td><input type=text name=group_name value=\"" . phonebook_groupid2name($user_config['uid'], $gpid) . "\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Group code') . "</td>\n\t\t\t\t<td><input type=text name=group_code value=\"" . phonebook_groupid2code($user_config['uid'], $gpid) . "\" size=10> " . _hint(_('Please use uppercase and make it short')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Share phonebook and allow broadcast') . "</td>\n\t\t\t\t<td><select name=flag_sender>" . $option_flag_sender . "</select> " . _hint(_('Share this phonebook group and set permission for broadcasting SMS to this group from mobile phone')) . "</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\"></p>\n\t\t\t</form>\n\t\t\t" . _back('index.php?app=main&inc=feature_phonebook&route=group&op=list'); if ($err = TRUE) { _p(_dialog()); } _p($content); break; case "actions": $nav = themes_nav_session(); $search = themes_search_session(); $go = $_REQUEST['go']; switch ($go) { case 'delete': if ($gpid = $_REQUEST['gpid']) { if (!dba_count(_DB_PREF_ . '_featurePhonebook_group_contacts', array('gpid' => $gpid))) { if (dba_remove(_DB_PREF_ . '_featurePhonebook_group', array('uid' => $user_config['uid'], 'id' => $gpid))) { $_SESSION['dialog']['info'][] = _('Selected group has been deleted'); } else { $_SESSION['dialog']['danger'][] = _('Fail to delete group'); } } else { $_SESSION['dialog']['danger'][] = _('Unable to delete group until the group is empty'); } } $ref = $nav['url'] . '&search_keyword=' . $search['keyword'] . '&search_category=' . $search['category'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav']; header("Location: " . _u($ref)); exit; break; case 'add': $group_name = $_POST['group_name'];
*/ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "phonebook_list": $search_category = array(_('Name') => 'A.name', _('Mobile') => 'mobile', _('Email') => 'email', _('Group code') => 'code'); $base_url = 'index.php?app=main&inc=feature_phonebook&op=phonebook_list'; $search = themes_search($search_category, $base_url); $fields = 'DISTINCT A.id AS pid, A.uid AS uid, A.name AS name, A.mobile AS mobile, A.email AS email'; $join = 'LEFT JOIN ' . _DB_PREF_ . '_featurePhonebook_group_contacts AS C ON A.id=C.pid '; $join .= 'LEFT JOIN ' . _DB_PREF_ . '_featurePhonebook_group AS B ON B.id=C.gpid'; $conditions = array('( A.uid' => $user_config['uid'] . "' OR B.id in (\n\t\t\t\t\t\t\t\t\tSELECT B.id AS id FROM " . _DB_PREF_ . "_featurePhonebook AS A\n\t\t\t\t\t\t\t\t\t" . $join . "\n\t\t\t\t\t\t\t\t\tWHERE A.mobile='" . $user_config['mobile'] . "'\n\t\t\t\t\t\t\t\t\tAND B.flag_sender='1'\n\t\t\t\t\t\t\t\t\t) OR ( A.uid <>'" . $user_config['uid'] . "' AND B.flag_sender>'1' ) ) AND '1'='1"); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_featurePhonebook AS A', $conditions, $keywords, '', $join); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'A.name, mobile', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_featurePhonebook AS A', $fields, $conditions, $keywords, $extras, $join); $phonebook_groups = phonebook_getgroupbyuid($user_config['uid']); foreach ($phonebook_groups as $group) { $action_move_options .= '<option value=move_' . $group['gpid'] . '>' . _('Move to') . ' ' . $group['gp_name'] . ' (' . $group['gp_code'] . ')</option>'; } $content = "\n\t\t\t<h2>" . _('Phonebook') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form name=fm_phonebook_list id=fm_phonebook_list action='index.php?app=main&inc=feature_phonebook' method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden id=action_route name=route value=''>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_phonebook&route=group&op=list') . "'>" . $icon_config['group'] . "</a>\n\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_phonebook&route=import&op=list') . "'>" . $icon_config['import'] . "</a>\n\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_phonebook&op=actions&go=export') . "'>" . $icon_config['export'] . "</a>\n\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_phonebook&op=phonebook_add') . "'>" . $icon_config['add'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#action_go').click(function(){\n\t\t\t\t\t\t\t\$('input[name=route]').attr('value','phonebook_go');\n\t\t\t\t\t\t\t\$('#fm_phonebook_list').submit();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<select name=op class=search_input_category>\n\t\t\t\t\t\t<option value=>" . _('Select') . "</option>\n\t\t\t\t\t\t<option value=delete>" . _('Delete') . "</option>\n\t\t\t\t\t\t" . $action_move_options . "\n\t\t\t\t\t</select>\n\t\t\t\t\t<a href='#' id=action_go>" . $icon_config['go'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=25%>" . _('Name') . "</th>\n\t\t\t\t<th width=25%>" . _('Mobile') . "</th>\n\t\t\t\t<th width=30%>" . _('Email') . "</th>\n\t\t\t\t<th width=15%>" . _('Group code') . "</th>\n\t\t\t\t<th width=5%><input type=checkbox onclick=CheckUncheckAll(document.fm_phonebook_list)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $pid = $list[$j]['pid']; $name = $list[$j]['name']; $mobile = $list[$j]['mobile']; $email = $list[$j]['email'];
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isadmin()) { auth_block(); } switch (_OP_) { case "firewall_list": $search_category = array(_('IP address') => 'ip_address'); $base_url = 'index.php?app=main&inc=feature_firewall&op=firewall_list'; $search = themes_search($search_category, $base_url); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_featureFirewall', '', $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'ip_address', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_featureFirewall', '*', '', $keywords, $extras); $content = _err_display() . "\n\t\t\t<h2>" . _('Manage firewall') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form name=fm_firewall_list id=fm_firewall_list action='index.php?app=main&inc=feature_firewall&op=actions' method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href='" . _u('index.php?app=main&inc=feature_firewall&op=firewall_add') . "'>" . $icon_config['add'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#action_go').click(function(){\n\t\t\t\t\t\t\t\$('#fm_firewall_list').submit();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<select name=go class=search_input_category>\n\t\t\t\t\t\t<option value=>" . _('Select') . "</option>\n\t\t\t\t\t\t<option value=delete>" . _('Delete') . "</option>\n\t\t\t\t\t</select>\n\t\t\t\t\t<a href='#' id=action_go>" . $icon_config['go'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=45%>" . _('Username') . "</th>\n\t\t\t\t<th width=50%>" . _('Blocked IP address') . "</th>\n\t\t\t\t<th width=5%><input type=checkbox onclick=CheckUncheckAll(document.fm_firewall_list)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $pid = $list[$j]['id']; $username = user_uid2username($list[$j]['uid']); $ip_address = $list[$j]['ip_address']; $i--; $c_i = "<a href=\"" . _u('index.php?app=main&inc=feature_firewall&op=firewall_edit&id=' . $pid) . "\">" . $i . ".</a>"; if ($list[$j]['uid'] == $user_config['uid']) { $name = "<a href='" . _u('index.php?app=main&inc=feature_firewall&op=firewall_edit&pid=' . $pid) . "'>" . $name . "</a>"; }
* You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isadmin()) { auth_block(); } switch (_OP_) { case "all_inbox": $search_category = array(_('User') => 'username', _('Time') => 'in_datetime', _('From') => 'in_sender', _('Message') => 'in_msg'); $base_url = 'index.php?app=main&inc=feature_report&route=all_inbox&op=all_inbox'; $search = themes_search($search_category, $base_url); $conditions = array('A.flag_deleted' => 0); $keywords = $search['dba_keywords']; $join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.in_uid=B.uid"; $count = dba_count(_DB_PREF_ . '_tblSMSInbox AS A', $conditions, $keywords, '', $join); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'A.in_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblSMSInbox AS A', 'B.username, A.in_id, A.in_uid, A.in_datetime, A.in_sender, A.in_msg', $conditions, $keywords, $extras, $join); $content = "\n\t\t\t<h2>" . _('All inbox') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form id=fm_all_inbox name=fm_all_inbox action=\"index.php?app=main&inc=feature_report&route=all_inbox&op=actions\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=go value=delete>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_report&route=all_inbox&op=actions&go=export') . "\">" . $icon_config['export'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<a href='#' onClick=\"return SubmitConfirm('" . _('Are you sure you want to delete these items ?') . "', 'fm_all_inbox');\">" . $icon_config['delete'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=20%>" . _('User') . "</th>\n\t\t\t\t<th width=20%>" . _('From') . "</th>\n\t\t\t\t<th width=55%>" . _('Message') . "</th>\n\t\t\t\t<th width=5% class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_all_inbox)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $list[$j] = core_display_data($list[$j]); $in_username = $list[$j]['username']; $in_id = $list[$j]['in_id']; $in_uid = $list[$j]['in_uid']; $in_sender = $list[$j]['in_sender']; $current_sender = report_resolve_sender($in_uid, $in_sender); $in_datetime = core_display_datetime($list[$j]['in_datetime']); $msg = $list[$j]['in_msg'];
* * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "user_outgoing": $search_category = array(_('Time') => 'p_datetime', _('To') => 'p_dst', _('Message') => 'p_msg', _('Footer') => 'p_footer'); $base_url = 'index.php?app=main&inc=feature_report&route=user_outgoing&op=user_outgoing'; $search = themes_search($search_category, $base_url); $conditions = array('uid' => $user_config['uid'], 'flag_deleted' => 0); $keywords = $search['dba_keywords']; $count = dba_count(_DB_PREF_ . '_tblSMSOutgoing', $conditions, $keywords); $nav = themes_nav($count, $search['url']); $extras = array('ORDER BY' => 'smslog_id DESC', 'LIMIT' => $nav['limit'], 'OFFSET' => $nav['offset']); $list = dba_search(_DB_PREF_ . '_tblSMSOutgoing', '*', $conditions, $keywords, $extras); $content = "\n\t\t\t<h2>" . _('Outgoing messages') . "</h2>\n\t\t\t<p>" . $search['form'] . "</p>\n\t\t\t<form id=fm_outgoing name=fm_outgoing action=\"index.php?app=main&inc=feature_report&route=user_outgoing&op=actions\" method=POST>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=go value=delete>\n\t\t\t<div class=actions_box>\n\t\t\t\t<div class=pull-left>\n\t\t\t\t\t<a href=\"" . _u('index.php?app=main&inc=feature_report&route=user_outgoing&op=actions&go=export') . "\">" . $icon_config['export'] . "</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=pull-right>\n\t\t\t\t\t<a href='#' onClick=\"return SubmitConfirm('" . _('Are you sure you want to delete these items ?') . "', 'fm_outgoing');\">" . $icon_config['delete'] . "</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th width=20%>" . _('To') . "</th>\n\t\t\t\t<th width=75%>" . _('Message') . "</th>\n\t\t\t\t<th width=5% class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_outgoing)></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>"; $i = $nav['top']; $j = 0; for ($j = 0; $j < count($list); $j++) { $list[$j] = core_display_data($list[$j]); $smslog_id = $list[$j]['smslog_id']; $p_dst = $list[$j]['p_dst']; $p_desc = phonebook_number2name($p_dst); $current_p_dst = $p_dst; if ($p_desc) { $current_p_dst = "{$p_dst}<br />{$p_desc}"; }