当前位置: 首页>>代码示例>>PHP>>正文


PHP dba_search函数代码示例

本文整理汇总了PHP中dba_search函数的典型用法代码示例。如果您正苦于以下问题:PHP dba_search函数的具体用法?PHP dba_search怎么用?PHP dba_search使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dba_search函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: email2sms_hook_playsmsd

function email2sms_hook_playsmsd()
{
    global $core_config;
    // fetch every 60 seconds
    if (!core_playsmsd_timer(60)) {
        return;
    }
    // _log('fetch now:'.$now, 2, 'email2sms_hook_playsmsd');
    // get all users
    $users = dba_search(_DB_PREF_ . '_tblUser', 'uid');
    foreach ($users as $user) {
        $uid = $user['uid'];
        // get email2sms registry data for $uid
        $items = registry_search($uid, 'features', 'email2sms');
        $enable = $items['features']['email2sms']['enable'];
        $protocol = $items['features']['email2sms']['protocol'];
        $port = $items['features']['email2sms']['port'];
        $server = $items['features']['email2sms']['server'];
        $username = $items['features']['email2sms']['username'];
        $password = $items['features']['email2sms']['password'];
        if (!($enable && $protocol && $port && $server && $username && $password)) {
            continue;
        }
        // _log('fetch uid:' . $uid, 3, 'email2sms_hook_playsmsd');
        $param = 'email2sms_uid_' . $uid;
        $is_fetching = playsmsd_pid_get($param) ? TRUE : FALSE;
        if (!$is_fetching) {
            $RUN_THIS = "nohup " . $core_config['daemon']['PLAYSMS_BIN'] . "/playsmsd playsmsd once " . $param . " >/dev/null 2>&1 &";
            // _log('execute:' . $RUN_THIS, 3, 'email2sms_hook_playsmsd');
            shell_exec($RUN_THIS);
        }
    }
}
开发者ID:yrahman,项目名称:playSMS,代码行数:33,代码来源:fn.php

示例2: report_count

/**
 * Count number of SMS for report
 *
 * @param integer $uid
 *        	User ID or 0 for all users
 * @param integer $dlr_status
 *        	Delivery report status
 * @param integer $flag_deleted
 *        	Deleted SMS flagged with 1
 * @return integer Number of SMS
 */
function report_count($uid = 0, $dlr_status = 0, $flag_deleted = 0)
{
    $sms_count = 0;
    $db_table = _DB_PREF_ . '_tblSMSOutgoing';
    $conditions = array('p_status' => (int) $dlr_status, 'flag_deleted' => (int) $flag_deleted);
    if ($uid) {
        $conditions['uid'] = $uid;
    }
    $list = dba_search($db_table, 'queue_code', $conditions, '', array('GROUP BY' => 'queue_code'));
    foreach ($list as $row) {
        $db_table = _DB_PREF_ . '_tblSMSOutgoing_queue';
        $data = dba_search($db_table, 'sms_count', array('queue_code' => $row['queue_code']));
        $sms_count += $data[0]['sms_count'];
    }
    return (int) $sms_count;
}
开发者ID:yrahman,项目名称:playSMS,代码行数:27,代码来源:fn.php

示例3: dlrd

function dlrd()
{
    global $core_config;
    $core_config['dlrd_limit'] = (int) $core_config['dlrd_limit'] ? (int) $core_config['dlrd_limit'] : 200;
    $list = dba_search(_DB_PREF_ . '_tblDLR', '*', array('flag_processed' => 1), '', array('LIMIT' => $core_config['dlrd_limit']));
    $j = 0;
    for ($j = 0; $j < count($list); $j++) {
        if ($id = $list[$j]['id']) {
            $smslog_id = $list[$j]['smslog_id'];
            $p_status = $list[$j]['p_status'];
            $uid = $list[$j]['uid'];
            if (dba_update(_DB_PREF_ . '_tblDLR', array('flag_processed' => 2), array('id' => $id))) {
                logger_print("id:" . $id . " smslog_id:" . $smslog_id . " p_status:" . $p_status . " uid:" . $uid, 3, "dlrd");
                setsmsdeliverystatus($smslog_id, $uid, $p_status);
            }
        }
    }
}
开发者ID:RobinKarlsen,项目名称:playSMS,代码行数:18,代码来源:fn_dlr.php

示例4: recvsmsd

function recvsmsd()
{
    global $core_config;
    $core_config['recvsmsd_limit'] = (int) $core_config['recvsmsd_limit'] ? (int) $core_config['recvsmsd_limit'] : 200;
    $list = dba_search(_DB_PREF_ . '_tblRecvSMS', '*', array('flag_processed' => 1), '', array('LIMIT' => $core_config['recvsmsd_limit']));
    $j = 0;
    for ($j = 0; $j < count($list); $j++) {
        if ($id = $list[$j]['id']) {
            $sms_datetime = $list[$j]['sms_datetime'];
            $sms_sender = $list[$j]['sms_sender'];
            $message = $list[$j]['message'];
            $sms_receiver = $list[$j]['sms_receiver'];
            $smsc = $list[$j]['smsc'];
            if (dba_update(_DB_PREF_ . '_tblRecvSMS', array('flag_processed' => 2), array('id' => $id))) {
                logger_print("id:" . $id . " dt:" . core_display_datetime($sms_datetime) . " sender:" . $sms_sender . " m:" . $message . " receiver:" . $sms_receiver . " smsc:" . $smsc, 3, "recvsmsd");
                recvsms_process(core_display_datetime($sms_datetime), $sms_sender, $message, $sms_receiver, $smsc);
            }
        }
    }
}
开发者ID:10corp,项目名称:playSMS,代码行数:20,代码来源:fn.php

示例5: _gateway_display_smsc

/**
 * Display SMSCs on UI
 *
 * @global array $core_config
 * @return string
 */
function _gateway_display_smsc()
{
    global $core_config, $icon_config;
    $db_table = _DB_PREF_ . '_tblGateway';
    $extras = array('ORDER BY' => 'gateway');
    $smsc_list = dba_search($db_table, '*', '', '', $extras);
    $content = "\n\t\t<div class=table-responsive>\n\t\t<table class=playsms-table-list id='gateway_view_smsc'>\n\t\t\t<thead><tr>\n\t\t\t\t<th width=40%>" . _('Name') . "</th>\n\t\t\t\t<th width=50%>" . _('Gateway') . "</th>\n\t\t\t\t<th width=10%>" . _('Action') . "</th>\n\t\t\t</tr></thead>\n\t\t\t<tbody>";
    foreach ($smsc_list as $smsc) {
        $c_link_edit = '';
        $c_link_del = '';
        if (!($smsc['gateway'] == 'dev' || $smsc['gateway'] == 'blocked')) {
            $smsc['link_edit'] = "index.php?app=main&inc=core_gateway&op=edit_smsc&id=" . $smsc['id'];
            $c_link_edit = "<a href='" . _u($smsc['link_edit']) . "'>" . $icon_config['edit'] . "</a>";
            $smsc['link_del'] = "index.php?app=main&inc=core_gateway&op=del_smsc&id=" . $smsc['id'];
            $c_link_del = "<a href=\"javascript: ConfirmURL('" . _('Are you sure ?') . "', '" . _u($smsc['link_del']) . "')\">" . $icon_config['delete'] . "</span></a>";
        }
        $content .= "\n\t\t\t<tr>\n\t\t\t\t<td>" . $smsc['name'] . "</td>\n\t\t\t\t<td>" . $smsc['gateway'] . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t" . $c_link_edit . "\n\t\t\t\t\t" . $c_link_del . "\n\t\t\t\t</td>\n\t\t\t</tr>";
    }
    $content .= "</tbody></table></div>";
    return $content;
}
开发者ID:RobinKarlsen,项目名称:playSMS,代码行数:27,代码来源:fn.php

示例6: tpl_apply

     $tpl['vars']['DIALOG_DISPLAY'] = $error_content;
     $tpl['name'] = 'user_inbox';
     $content = tpl_apply($tpl);
     _p($content);
     break;
 case "actions":
     $nav = themes_nav_session();
     $search = themes_search_session();
     $go = $_REQUEST['go'];
     switch ($go) {
         case 'export':
             $conditions = array('in_uid' => $user_config['uid'], 'flag_deleted' => 0);
             if ($in_sender = trim($_REQUEST['in_sender'])) {
                 $conditions['in_sender'] = $in_sender;
             }
             $list = dba_search(_DB_PREF_ . '_tblSMSInbox', 'in_datetime, in_sender, in_msg', $conditions, $search['dba_keywords']);
             $data[0] = array(_('Time'), _('From'), _('Message'));
             for ($i = 0; $i < count($list); $i++) {
                 $j = $i + 1;
                 $data[$j] = array(core_display_datetime($list[$i]['in_datetime']), $list[$i]['in_sender'], $list[$i]['in_msg']);
             }
             $content = core_csv_format($data);
             if ($in_sender) {
                 $fn = 'user_inbox-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '-' . $in_sender . '.csv';
             } else {
                 $fn = 'user_inbox-' . $user_config['username'] . '-' . $core_config['datetime']['now_stamp'] . '.csv';
             }
             core_download($content, $fn, 'text/csv');
             break;
         case 'delete':
             for ($i = 0; $i < $nav['limit']; $i++) {
开发者ID:10corp,项目名称:playSMS,代码行数:31,代码来源:user_inbox.php

示例7: user_getdatabyusername

        $url_uname = '&uname=' . $uname;
    } else {
        $user_edited = user_getdatabyusername($uname);
        $c_username = $uname;
        $url_uname = '&uname=' . $uname;
        if ($user_edited['parent_uid'] == $user_config['uid']) {
            $is_parent = TRUE;
        } else {
            auth_block();
        }
    }
}
$c_uid = user_username2uid($c_username);
switch (_OP_) {
    case "user_config":
        if ($c_user = dba_search(_DB_PREF_ . '_tblUser', '*', array('flag_deleted' => 0, 'uid' => $c_uid))) {
            $token = $c_user[0]['token'];
            $webservices_ip = $c_user[0]['webservices_ip'];
            $enable_webservices = $c_user[0]['enable_webservices'];
            $sender = core_sanitize_sender($c_user[0]['sender']);
            $footer = core_sanitize_footer($c_user[0]['footer']);
            $datetime_timezone = core_get_timezone($c_username);
            $fwd_to_inbox = $c_user[0]['fwd_to_inbox'];
            $fwd_to_email = $c_user[0]['fwd_to_email'];
            $fwd_to_mobile = $c_user[0]['fwd_to_mobile'];
            $local_length = $c_user[0]['local_length'];
            $replace_zero = $c_user[0]['replace_zero'];
            $acl_id = (int) $c_user[0]['acl_id'];
            $credit = rate_getusercredit($c_username);
        } else {
            $_SESSION['dialog']['info'][] = _('User does not exist') . ' (' . _('username') . ': ' . $uname . ')';
开发者ID:10corp,项目名称:playSMS,代码行数:31,代码来源:user_config.php

示例8: core_get_timezone

/**
 * Get timezone
 *
 * @param $username username
 *        or empty for default timezone
 * @return timezone
 */
function core_get_timezone($username = '')
{
    global $core_config;
    $ret = '';
    if ($username) {
        $list = dba_search(_DB_PREF_ . '_tblUser', 'datetime_timezone', array('flag_deleted' => 0, 'username' => $username));
        $ret = $list[0]['datetime_timezone'];
    }
    if (!$ret) {
        $ret = $core_config['main']['gateway_timezone'];
    }
    return $ret;
}
开发者ID:RobinKarlsen,项目名称:playSMS,代码行数:20,代码来源:fn_core.php

示例9: _p

     }
     _p($content);
     break;
 case "actions":
     $nav = themes_nav_session();
     $search = themes_search_session();
     $go = $_REQUEST['go'];
     switch ($go) {
         case 'export':
             $conditions = array('A.flag_deleted' => 0);
             if ($queue_code = trim($_REQUEST['queue_code'])) {
                 $conditions['A.queue_code'] = $queue_code;
             }
             $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', 'B.username, A.p_gateway, A.p_smsc, A.p_datetime, A.p_dst, A.p_msg, A.p_footer, A.p_status', $conditions, $search['dba_keywords'], '', $join);
             $data[0] = array(_('User'), _('Gateway'), _('SMSC'), _('Time'), _('To'), _('Message'), _('Status'));
             for ($i = 0; $i < count($list); $i++) {
                 $j = $i + 1;
                 $data[$j] = array($list[$i]['username'], $list[$i]['p_gateway'], $list[$i]['p_smsc'], core_display_datetime($list[$i]['p_datetime']), $list[$i]['p_dst'], $list[$i]['p_msg'] . $list[$i]['p_footer'], $list[$i]['p_status']);
             }
             $content = core_csv_format($data);
             if ($queue_code) {
                 $fn = 'all_outgoing-' . $core_config['datetime']['now_stamp'] . '-' . $queue_code . '.csv';
             } else {
                 $fn = 'all_outgoing-' . $core_config['datetime']['now_stamp'] . '.csv';
             }
             core_download($content, $fn, 'text/csv');
             break;
         case 'delete':
             for ($i = 0; $i < $nav['limit']; $i++) {
开发者ID:10corp,项目名称:playSMS,代码行数:31,代码来源:all_outgoing.php

示例10: registry_search_record

function registry_search_record($search, $keywords = '', $extras = '')
{
    $db_table = _DB_PREF_ . '_tblRegistry';
    foreach ($search as $key => $val) {
        if ($val) {
            $conditions[$key] = $val;
        }
    }
    return dba_search($db_table, '*', $conditions, $keywords, $extras);
}
开发者ID:10corp,项目名称:playSMS,代码行数:10,代码来源:fn.php

示例11: defined

 * 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>";
            }
            $content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$username}</td>\n\t\t\t\t\t<td>{$mobile}</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=hidden name=itemid[" . $j . "] value=\"{$pid}\">\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>";
        }
        $content .= "\n\t\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>";
开发者ID:10corp,项目名称:playSMS,代码行数:31,代码来源:stoplist.php

示例12: _p

     $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);
     break;
 case "actions":
     $nav = themes_nav_session();
     $search = themes_search_session();
     $go = $_REQUEST['go'];
     switch ($go) {
         case 'export':
             $conditions = array('A.flag_deleted' => 0, 'A.in_status' => 1);
             $join = "INNER JOIN " . _DB_PREF_ . "_tblUser AS B ON B.flag_deleted='0' AND A.in_uid=B.uid";
             $extras = array('AND A.in_keyword' => '!= ""');
             $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, $search['dba_keywords'], $extras, $join);
             $data[0] = array(_('User'), _('Time'), _('From'), _('Keyword'), _('Content'), _('Feature'));
             for ($i = 0; $i < count($list); $i++) {
                 $j = $i + 1;
                 $data[$j] = array($list[$i]['username'], core_display_datetime($list[$i]['in_datetime']), $list[$i]['in_sender'], $list[$i]['in_keyword'], $list[$i]['in_message'], $list[$i]['in_feature']);
             }
             $content = core_csv_format($data);
             $fn = 'all_incoming-' . $core_config['datetime']['now_stamp'] . '.csv';
             core_download($content, $fn, 'text/csv');
             break;
         case 'delete':
             for ($i = 0; $i < $nav['limit']; $i++) {
                 $checkid = $_POST['checkid' . $i];
                 $itemid = $_POST['itemid' . $i];
                 if ($checkid == "on" && $itemid) {
                     $up = array('c_timestamp' => mktime(), 'flag_deleted' => '1');
开发者ID:10corp,项目名称:playSMS,代码行数:31,代码来源:all_incoming.php

示例13: playnet_hook_webservices_output

function playnet_hook_webservices_output($operation, $requests, $returns)
{
    global $plugin_config;
    $go = $requests['go'];
    $smsc = $requests['smsc'];
    $username = $requests['u'];
    $password = $requests['p'];
    if (!($operation == 'playnet' && $go && $smsc && $username && $password)) {
        return FALSE;
    }
    $c_plugin_config = gateway_apply_smsc_config($smsc, $plugin_config);
    // auth remote
    if (!($c_plugin_config['playnet']['local_playnet_username'] && $c_plugin_config['playnet']['local_playnet_password'] && $c_plugin_config['playnet']['local_playnet_username'] == $username && $c_plugin_config['playnet']['local_playnet_password'] == $password)) {
        $content['status'] = 'ERROR';
        $content['error_string'] = 'Authentication failed';
        $returns['modified'] = TRUE;
        $returns['param']['content'] = json_encode($content);
        $returns['param']['content-type'] = 'text/json';
        return $returns;
    }
    switch ($go) {
        case 'get_outgoing':
            $conditions = array('flag' => 1, 'smsc' => $smsc);
            $extras = array('ORDER BY' => 'id', 'LIMIT' => $c_plugin_config['playnet']['poll_limit']);
            $list = dba_search(_DB_PREF_ . '_gatewayPlaynet_outgoing', '*', $conditions, '', $extras);
            foreach ($list as $data) {
                $rows[] = array('smsc' => $data['smsc'], 'smslog_id' => $data['smslog_id'], 'uid' => $data['uid'], 'sender_id' => $data['sender_id'], 'sms_to' => $data['sms_to'], 'message' => $data['message'], 'sms_type' => $data['sms_type'], 'unicode' => $data['unicode']);
                // update flag
                $items = array('flag' => 2);
                $condition = array('flag' => 1, 'id' => $data['id']);
                dba_update(_DB_PREF_ . '_gatewayPlaynet_outgoing', $items, $condition, 'AND');
                // update dlr
                $p_status = 1;
                dlr($data['smslog_id'], $data['uid'], $p_status);
            }
            if (count($rows)) {
                $content['status'] = 'OK';
                $content['data'] = $rows;
            } else {
                $content['status'] = 'ERROR';
                $content['error_string'] = 'No outgoing data';
            }
            break;
        case 'set_incoming':
            $payload = json_decode(stripslashes($requests['payload']), 1);
            if ($payload['message']) {
                $sms_sender = $payload['sms_sender'];
                $message = $payload['message'];
                $sms_receiver = $payload['sms_receiver'];
                if ($id = recvsms(core_get_datetime(), $sms_sender, $message, $sms_receiver, $smsc)) {
                    $content['status'] = 'OK';
                    $content['data'] = array('recvsms_id' => $id);
                } else {
                    $content['status'] = 'ERROR';
                    $content['error_string'] = 'Unable to save incoming data';
                }
            } else {
                $content['status'] = 'ERROR';
                $content['error_string'] = 'No incoming data';
            }
    }
    $returns['modified'] = TRUE;
    $returns['param']['content'] = json_encode($content);
    $returns['param']['content-type'] = 'text/json';
    if ($content['status'] == 'OK') {
        _log('accessed param_go:[' . $go . '] param_smsc:[' . $smsc . '] param_u:[' . $username . '] param_p:[' . $password . ']', 3, 'playnet_hook_webservices_output');
    }
    return $returns;
}
开发者ID:10corp,项目名称:playSMS,代码行数:69,代码来源:fn.php

示例14: defined

 * 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_isvalid()) {
    auth_block();
}
if ($poll_id = (int) $_REQUEST['poll_id']) {
    $db_table = _DB_PREF_ . '_featurePoll';
    $conditions = array('poll_id' => $poll_id);
    if (!auth_isadmin()) {
        $conditions['uid'] = $user_config['uid'];
    }
    $list = dba_search($db_table, 'poll_id', $conditions);
    if (!($list[0]['poll_id'] == $poll_id)) {
        auth_block();
    }
}
switch (_OP_) {
    case "sms_poll_list":
        if ($err = $_SESSION['error_string']) {
            $content = "<div class=error_string>{$err}</div>";
        }
        $content .= "\n\t\t\t<h2>" . _('Manage poll') . "</h2>\n\t\t\t" . _button('index.php?app=main&inc=feature_sms_poll&op=sms_poll_add', _('Add SMS poll'));
        $content .= "\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead><tr>";
        if (auth_isadmin()) {
            $content .= "\n\t\t\t\t<th width=15%>" . _('Keyword') . "</th>\n\t\t\t\t<th width=20%>" . _('Title') . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Once') . " " . _hint(_('Senders sent once')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Multi') . " " . _hint(_('Senders sent multi votes')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Valid') . " " . _hint(_('Total valid SMS')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Invalid') . " " . _hint(_('Total invalid SMS')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('All') . " " . _hint(_('Grand total SMS')) . "</th>\n\t\t\t\t<th width=15%>" . _('User') . "</th>\n\t\t\t\t<th width=10%>" . _('Status') . "</th>\n\t\t\t\t<th width=15%>" . _('Action') . "</th>";
        } else {
            $content .= "\n\t\t\t\t<th width=15%>" . _('Keyword') . "</th>\n\t\t\t\t<th width=35%>" . _('Title') . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Once') . " " . _hint(_('Senders sent once')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Multi') . " " . _hint(_('Senders sent multi votes')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Valid') . " " . _hint(_('Total valid SMS')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('Invalid') . " " . _hint(_('Total invalid SMS')) . "</th>\n\t\t\t\t<th width=5% nowrap>" . _('All') . " " . _hint(_('Grand total SMS')) . "</th>\n\t\t\t\t<th width=10%>" . _('Status') . "</th>\n\t\t\t\t<th width=15%>" . _('Action') . "</th>";
开发者ID:yrahman,项目名称:playSMS,代码行数:31,代码来源:sms_poll.php

示例15: webservices_query

function webservices_query($username)
{
    $user = user_getdatabyusername($username);
    // get user's data
    $status = $user['status'];
    $uid = $user['uid'];
    $name = $user['name'];
    $email = $user['email'];
    $mobile = $user['mobile'];
    // get credit
    $credit = rate_getusercredit($username);
    $credit = $credit ? $credit : '0';
    // get last id on user's inbox table
    $fields = 'in_id';
    $conditions = array('in_uid' => $uid, 'flag_deleted' => 0);
    $extras = array('ORDER BY' => 'in_id DESC', 'LIMIT' => 1);
    $list = dba_search(_DB_PREF_ . '_tblSMSInbox', $fields, $conditions, '', $extras);
    $last_inbox_id = $list[0]['in_id'];
    // get last id on incoming table
    $fields = 'in_id';
    $conditions = array('in_uid' => $uid, 'flag_deleted' => 0, 'in_status' => 1);
    $extras = array('ORDER BY' => 'in_id DESC', 'LIMIT' => 1);
    $list = dba_search(_DB_PREF_ . '_tblSMSIncoming', $fields, $conditions, '', $extras);
    $last_incoming_id = $list[0]['in_id'];
    // get last id on outgoing table
    $fields = 'smslog_id';
    $conditions = array('uid' => $uid, 'flag_deleted' => 0);
    $extras = array('ORDER BY' => 'smslog_id DESC', 'LIMIT' => 1);
    $list = dba_search(_DB_PREF_ . '_tblSMSOutgoing', $fields, $conditions, '', $extras);
    $last_outgoing_id = $list[0]['smslog_id'];
    // compile data
    $data = array('user' => array('username' => $username, 'uid' => (int) $uid, 'status' => (int) $status, 'name' => $name, 'email' => $email, 'mobile' => $mobile, 'credit' => $credit), 'last_id' => array('user_inbox' => (int) $last_inbox_id, 'user_incoming' => (int) $last_incoming_id, 'user_outgoing' => (int) $last_outgoing_id));
    $json['status'] = 'OK';
    $json['error'] = '0';
    $json['data'] = $data;
    return $json;
}
开发者ID:10corp,项目名称:playSMS,代码行数:37,代码来源:fn_webservices.php


注:本文中的dba_search函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。