コード例 #1
0
ファイル: catchall.php プロジェクト: yrahman/playSMS
     $keywords = $data['keywords'];
     $description = $data['description'];
     $c_members = count(inboxgroup_getmembers($rid));
     $c_members = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=members&op=members&rid=' . $rid) . "'>" . $c_members . "</a>";
     $c_catchall = count(inboxgroup_getcatchall($rid));
     $c_catchall = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=catchall&op=catchall&rid=' . $rid) . "'>" . $c_catchall . "</a>";
     $c_status = $data['status'] ? "<span class=status_enabled />" : "<span class=status_disabled />";
     if ($error_content) {
         $content .= $error_content;
     }
     $content .= "<h2>" . _('Group inbox') . "</h2>";
     $content .= "<h3>" . _('Delete catch-all') . "</h3>";
     $content .= "\n\t\t\t<table width='100%>\n\t\t\t<tr><td class=label-sizer>" . _('Receiver number') . "</td><td>" . $in_receiver . "</td></tr>\n\t\t\t<tr><td>" . _('Keywords') . "</td><td>" . $keywords . "</td></tr>\n\t\t\t<tr><td>" . _('Description') . "</td><td>" . $description . "</td></tr>\n\t\t\t<tr><td>" . _('Members') . "</td><td>" . $c_members . "</td></tr>\n\t\t\t<tr><td>" . _('Catch-all') . "</td><td>" . $c_catchall . "</td></tr>\n\t\t\t<tr><td>" . _('Status') . "</td><td>" . $c_status . "</td></tr>\n\t\t\t</table>";
     $list_of_catchall = '';
     // get catchall
     $users = inboxgroup_getcatchall($rid);
     for ($i = 0; $i < count($users); $i++) {
         $c_uid = $users[$i]['uid'];
         $c_user = user_getdatabyuid($c_uid);
         if ($c_username = $c_user['username']) {
             $c_name = $c_user['name'];
             $c_mobile = $c_user['mobile'];
             $list_of_users .= "<option value='" . $c_uid . "'>" . $c_name . " " . $c_mobile . "</option>";
         }
     }
     $content .= "\n\t\t\t<form action=\"index.php?app=main&inc=feature_inboxgroup&route=catchall&op=catchall_delete_submit\" method=\"post\">\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name='rid' value='" . $rid . "'>\n\t\t\t<table>\n\t\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td nowrap>\n\t\t\t\t\t\t" . _('Current catchall') . ":<br />\n\t\t\t\t\t\t<select name=\"uids_dump[]\" id=\"msg_combo_sendto\" size=\"10\" multiple=\"multiple\" onDblClick=\"moveSelectedOptions(this.form['uids_dump[]'],this.form['uids[]'])\">{$list_of_users}</select>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<p><input type=\"button\" class=\"button\" value=\"&gt;\" onclick=\"moveSelectedOptions(this.form['uids_dump[]'],this.form['uids[]'])\"></p>\n\t\t\t\t\t\t<p><input type=\"button\" class=\"button\" value=\"&lt;\" onclick=\"moveSelectedOptions(this.form['uids[]'],this.form['uids_dump[]'])\"></p>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td nowrap>\n\t\t\t\t\t    " . _('Selected catchall') . ":<br>\n\t\t\t\t\t    <select name=\"uids[]\" id=\"msg_combo_sendto\" size=\"10\" multiple=\"multiple\" onDblClick=\"moveSelectedOptions(this.form['uids[]'],this.form['uids_dump[]'])\"></select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p>" . _('Press submit button to remove selected catchall from catch-all list') . "</p>\n\t\t\t<p><input class='button' type='submit' value='Submit' onClick=\"selectAllOptions(this.form['uids[]'])\"></p>\n\t\t\t</form>\n\t\t" . _back('index.php?app=main&inc=feature_inboxgroup&route=catchall&op=catchall&rid=' . $rid);
     _p($content);
     break;
 case 'catchall_delete_submit':
     $rid = $_REQUEST['rid'];
     $rid = $_REQUEST['rid'];
コード例 #2
0
ファイル: inboxgroup.php プロジェクト: 10corp/playSMS
         }
     } else {
         $_SESSION['dialog']['info'][] = _('You must fill all fields');
     }
     header("Location: " . _u('index.php?app=main&inc=feature_inboxgroup&op=edit&rid=' . $rid));
     exit;
     break;
 case 'del':
     $rid = $_REQUEST['rid'];
     $data = inboxgroup_getdatabyid($rid);
     $in_receiver = $data['in_receiver'];
     $keywords = $data['keywords'];
     $description = $data['description'];
     $c_members = count(inboxgroup_getmembers($rid));
     $c_members = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=members&op=members&rid=' . $rid) . "'>" . $c_members . "</a>";
     $c_catchall = count(inboxgroup_getcatchall($rid));
     $c_catchall = "<a href='" . _u('index.php?app=main&inc=feature_inboxgroup&route=catchall&op=catchall&rid=' . $rid) . "'>" . $c_catchall . "</a>";
     $c_status = $data['status'] ? "<span class=status_enabled />" : "<span class=status_disabled />";
     if ($error_content) {
         $content .= $error_content;
     }
     unset($tpl);
     $tpl = array('name' => 'inboxgroup_del', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Group inbox' => _('Group inbox'), 'Delete group inbox' => _('Delete group inbox'), 'RID' => $rid, 'Receiver number' => _('Receiver number'), 'Keywords' => _('Keywords'), 'Description' => _('Description'), 'Members' => _('Members'), 'Catch-all' => _('Catch-all'), 'Status' => _('Status'), 'IN_RECEIVER' => $in_receiver, 'KEYWORDS' => $keywords, 'DESCRIPTION' => $description, 'C_MEMBERS' => $c_members, 'C_CATCHALL' => $c_catchall, 'C_STATUS' => $c_status, 'ARE_YOU_SURE' => _('Are you sure you want to delete this group inbox ?'), 'Yes' => _('Yes'), 'BACK' => _back('index.php?app=main&inc=feature_inboxgroup&op=list')));
     _p(tpl_apply($tpl));
     break;
 case 'del_submit':
     $rid = $_REQUEST['rid'];
     $data = inboxgroup_getdatabyid($rid);
     $in_receiver = $data['in_receiver'];
     if ($rid && $in_receiver) {
         if (inboxgroup_datadel($rid)) {
コード例 #3
0
ファイル: fn.php プロジェクト: ranakhurram/playSMS
function inboxgroup_forwardcatchall($data, $log_in_id, $sms_sender, $message)
{
    global $core_config;
    logger_print("forwardcatchall id:" . $data['id'] . " s:" . $sms_sender . " r:" . $data['in_receiver'] . " m:" . $message, 3, "inboxgroup");
    if ($username = uid2username($data['uid'])) {
        $users = inboxgroup_getcatchall($data['id']);
        $continue = false;
        if ($data['exclusive']) {
            for ($i = 0; $i < count($users); $i++) {
                if ($sms_sender == $users[$i]['mobile']) {
                    $continue = true;
                }
            }
        } else {
            $continue = true;
        }
        if ($continue) {
            for ($i = 0; $i < count($users); $i++) {
                if (($sms_to = $users[$i]['mobile']) && $sms_to != $sms_sender) {
                    //list($ok, $to, $smslog_id) = sendsms_pv($username, $sms_to, $message, 'text', 0);
                    //logger_print("forwardcatchall sendsms smslog_id:".$smslog_id[0]." to:".$sms_to, 3, "inboxgroup");
                    //inboxgroup_saveoutlog($log_in_id, $smslog_id[0], 1, $users[$i]['uid']);
                    $c_username = uid2username($users[$i]['uid']);
                    insertsmstoinbox($core_config['datetime']['now'], $sms_sender, $c_username, $message, $data['in_receiver']);
                }
            }
        }
    }
}