} $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++) { $checkid = $_POST['checkid' . $i]; $itemid = $_POST['itemid' . $i]; if ($checkid == "on" && $itemid) { $up = array('c_timestamp' => mktime(), 'flag_deleted' => '1'); $conditions = array('smslog_id' => $itemid); if ($queue_code = trim($_REQUEST['queue_code'])) { $conditions['queue_code'] = $queue_code; } dba_update(_DB_PREF_ . '_tblSMSOutgoing', $up, $conditions); } } $ref = $nav['url'] . '&search_keyword=' . $search['keyword'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav'];
/** * This file is part of playSMS. * * playSMS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * playSMS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 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(); } $poll_id = $_REQUEST['poll_id']; switch (_OP_) { case 'list': $conditions['poll_id'] = $poll_id; $list = dba_search(_DB_PREF_ . '_featurePoll', '*', $conditions); $poll_keyword = $list[0]['poll_keyword']; $content = sms_poll_export_csv($poll_id, $poll_keyword); $filename = 'sms-poll-' . $poll_keyword . '-' . $core_config['datetime']['now_stamp'] . '.csv'; core_download($content, $filename, 'text/csv'); break; }