예제 #1
0
                     // $error_string .= _('Fail to sent SMS')." ("._('to').": `".$to[$i]."`)<br>";
                     $sms_failed++;
                 }
             }
             // fixme anton - we dont need to add new lang entry, just use available phrase
             $error_string = _('Your SMS has been delivered to queue') . " (" . _('sent') . ": " . $sms_sent . ", " . _('failed') . ": " . $sms_failed . ")";
         }
         $errid = logger_set_error_string($error_string);
         header("Location: index.php?app=menu&inc=send_sms&op=sendsmstopv&message=" . urlencode($message) . "&errid=" . $errid);
     } else {
         header("Location: index.php?app=menu&inc=send_sms&op=sendsmstopv&message=" . urlencode($message) . "&err=" . urlencode(_('You must select receiver and your message should not be empty')));
     }
     break;
 case "sendsmstogr":
     $message = $_REQUEST['message'];
     $rows = phonebook_getgroupbyuid($uid, "gp_name");
     foreach ($rows as $key => $db_row) {
         $c_count = phonebook_getmembercountbyid($db_row['gpid']);
         $list_of_group .= "<option value=\"" . $db_row['gpid'] . "\" {$selected}>" . $db_row['gp_name'] . " (" . $db_row['gp_code'] . ")(" . $c_count . ")</option>";
     }
     // add shared group
     $rows = phonebook_getsharedgroup($uid);
     foreach ($rows as $key => $db_row) {
         $c_uid = $db_row['uid'];
         $c_username = uid2username($c_uid);
         $c_count = phonebook_getmembercountbyid($db_row['gpid']);
         $list_of_group .= "<option value=\"" . $db_row['gpid'] . "\" {$selected}>" . $db_row['gp_name'] . " (" . $db_row['gp_code'] . ")(" . $c_count . ") - " . _('shared by') . " " . $c_username . "</option>";
     }
     $sms_from = sendsms_get_sender($username);
     $max_length = $core_config['smsmaxlength'];
     if ($sms_footer = username2footer($username)) {
예제 #2
0
}
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'];
            $group_code = "";
            $groupfields = 'B.id AS id, B.uid AS uid, B.code AS code, B.flag_sender AS flag_sender';
            $groupconditions = array('C.pid' => $list[$j]['pid'], '( B.uid' => $user_config['uid'] . "' OR B.id in (\n\t\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\t" . $join . "\n\t\t\t\t\t\t\t\t\t\tWHERE A.mobile='" . $user_config['mobile'] . "'\n\t\t\t\t\t\t\t\t\t\tAND B.flag_sender='1'\n\t\t\t\t\t\t\t\t\t\t) OR ( B.uid<>'" . $user_config['uid'] . "' AND B.flag_sender>'1' ) ) AND '1'='1");
            $groupextras = array('ORDER BY' => 'B.code ASC', 'LIMIT' => $nav['limit']);