$current_slid = $db_row['smslog_id']; $p_username = uid2username($db_row['uid']); $p_dst = $db_row['p_dst']; $p_desc = phonebook_number2name($p_dst); $current_p_dst = $p_dst; if ($p_desc) { $current_p_dst = "{$p_dst}<br>({$p_desc})"; } $hide_p_dst = $p_dst; if ($p_desc) { $hide_p_dst = "{$p_dst} ({$p_desc})"; } $p_sms_type = $db_row['p_sms_type']; $hide_p_dst = str_replace("\\'", "", $hide_p_dst); $hide_p_dst = str_replace("\"", "", $hide_p_dst); $p_msg = core_display_text($db_row['p_msg'], 25); if (($p_footer = $db_row['p_footer']) && ($p_sms_type == "text" || $p_sms_type == "flash")) { $p_msg = $p_msg . " {$p_footer}"; } $p_datetime = core_display_datetime($db_row['p_datetime']); $p_gateway = $db_row['p_gateway']; $p_update = $db_row['p_update']; $p_status = $db_row['p_status']; $p_gpid = $db_row['p_gpid']; // 0 = pending // 1 = sent // 2 = failed // 3 = delivered if ($p_status == "1") { $p_status = "<p><font color=green>" . _('Sent') . "</font></p>"; } else {
function core_display_data($data) { if (is_array($data)) { foreach ($data as $key => $val) { $data[$key] = core_display_text($val); } } else { $data = core_display_text($data); } return $data; }
} else { $p_status = "<span class=status_pending title='" . _('Pending') . "'/>"; } } } // get billing info $billing = billing_getdata($smslog_id); $p_count = $billing['count'] ? $billing['count'] : '0'; $p_rate = $billing['rate'] ? $billing['rate'] : '0.0'; $p_charge = $billing['charge'] ? $billing['charge'] : '0.0'; // if send SMS failed then display charge as 0 if ($list[$j]['p_status'] == 2) { $p_charge = '0.0'; } $msg = $list[$j]['p_msg']; $p_msg = core_display_text($msg); if ($msg && $p_dst) { $resend = _sendsms($p_dst, $msg, '', $icon_config['resend']); $forward = _sendsms('', $msg, '', $icon_config['forward']); } $c_message = "\n\t\t\t\t<div id=\"msg_label\">" . $p_datetime . " " . _('count') . ":" . $p_count . " " . _('rate') . ":" . $p_rate . " " . _('cost') . ":" . $p_charge . " " . $p_status . "</div>\n\t\t\t\t<div id=\"all_outgoing_msg\">" . $p_msg . "</div>\n\t\t\t\t<div id=\"msg_option\">" . $resend . " " . $forward . "</div>"; $i--; $content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$p_username}</td>\n\t\t\t\t\t<td><div>" . $p_smsc . "</div><div>" . $p_gateway . "</td>\n\t\t\t\t\t<td><div>" . $current_p_dst . "</div><div>" . $queue_view_link . "</div></td>\n\t\t\t\t\t<td>{$c_message}</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=hidden name=itemid" . $j . " value=\"{$smslog_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>"; } $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>" . $queue_home_link; if ($err = TRUE) { _p(_dialog()); } _p($content); break; case "actions":
} $content .= "<div align=center>" . $nav['form'] . "</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"; if (auth_isadmin()) { $content .= "\n\t\t\t\t<th width=20%>" . _('Queue Code') . "</th>\n\t\t\t\t<th width=15%>" . _('User') . "</th>\n\t\t\t"; } else { $content .= "\n\t\t\t\t<th width=30%>" . _('Queue Code') . "</th>\n\t\t\t"; } $content .= "\n\t\t\t\t<th width=15%>" . _('Scheduled') . "</th>\n\t\t\t\t<th width=10%>" . _('Count') . "</th>\n\t\t\t\t<th width=30%>" . _('Message') . "</th>\n\t\t\t\t<th width=10%>" . _('Action') . "</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t"; $data = queuelog_get($nav['limit'], $nav['offset']); for ($c = count($data) - 1; $c >= 0; $c--) { $c_queue_code = $data[$c]['queue_code']; $c_datetime_scheduled = core_display_datetime($data[$c]['datetime_scheduled']); $c_username = user_uid2username($data[$c]['uid']); // total number of SMS in queue $c_count = $data[$c]['sms_count']; $c_message = stripslashes(core_display_text($data[$c]['message'])); $c_action = "<a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to delete queue")) . " " . $c_queue_code . " ?','" . _u('index.php?app=main&inc=feature_queuelog&op=queuelog_delete&queue=' . $c_queue_code) . "')\">" . $icon_config['delete'] . "</a>"; $content .= "\n\t\t\t\t<tr>\n\t\t\t"; if (auth_isadmin()) { $content .= "\n\t\t\t\t\t<td>" . $c_queue_code . "</td>\n\t\t\t\t\t<td>" . $c_username . "</td>\n\t\t\t\t"; } else { $content .= "\n\t\t\t\t\t<td>" . $c_queue_code . "</td>\n\t\t\t\t"; } $content .= "\n\t\t\t\t\t<td>" . $c_datetime_scheduled . "</td>\n\t\t\t\t\t<td>" . $c_count . "</td>\n\t\t\t\t\t<td>" . $c_message . "</td>\n\t\t\t\t\t<td>" . $c_action . "</td>\n\t\t\t\t</tr>\n\t\t\t"; } $content .= "\n\t\t\t</tbody></table>\n\t\t\t</div>\n\t\t\t<div align=center>" . $nav['form'] . "</div>\n\t\t"; _p($content); break; case "queuelog_delete": if ($queue = $_REQUEST['queue']) { if (queuelog_delete($queue)) {
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 />'); // $in_status = strtolower($in_status); $c_feature = ''; if ($in_feature) { $c_feature = "<br />" . $in_feature; } $msg = trim($list[$j]['in_message']); $in_message = core_display_text($msg); $reply = ''; $forward = ''; if ($msg && $in_sender) { $reply = _sendsms($in_sender, $msg); $forward = _sendsms('', $msg, '', $icon_config['forward']); } $c_message = "<div id=\"user_incoming_msg\">" . $in_message . "</div><div id=\"msg_label\">" . $in_datetime . " " . $in_status . "</div><div id=\"msg_option\">" . $reply . " " . $forward . "</div>"; $i--; $content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$current_sender}</td>\n\t\t\t\t\t<td>" . $in_keyword . $c_feature . "</td>\n\t\t\t\t\t<td>{$c_message}</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=hidden name=itemid" . $j . " value=\"{$in_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>"; } $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);
$content = "\n\t <h2>" . _('Incoming SMS') . "</h2>\n\t <p>{$nav_pages}</p>\n\t <form name=\"fm_incoming\" action=\"index.php?app=menu&inc=user_incoming&op=act_del\" method=post onSubmit=\"return SureConfirm()\">\n\t <table cellpadding=1 cellspacing=2 border=0 width=100% class=\"sortable\">\n <thead>\n\t <tr>\n\t <th align=center width=4>*</th>\n\t <th align=center width=20%>" . _('Time') . "</th>\n\t <th align=center width=10%>" . _('Sender') . "</th>\n\t <th align=center width=10%>" . _('Keyword') . "</th>\n\t <th align=center width=40%>" . _('Content') . "</th>\n\t <th align=center width=10%>" . _('Feature') . "</th>\n\t <th align=center width=10%>" . _('Status') . "</th>\n\t <th align=center>" . _('Action') . "</td>\n\t <th width=4 class=\"sorttable_nosort\"><input type=checkbox onclick=CheckUncheckAll(document.fm_incoming)></td>\n\t </tr>\n </thead>\n <tbody>\n\t"; $db_query = "SELECT * FROM " . _DB_PREF_ . "_tblSMSIncoming WHERE in_uid='{$uid}' AND flag_deleted='0' ORDER BY in_id DESC LIMIT {$limit},{$line_per_page}"; $db_result = dba_query($db_query); $i = $num_rows - $line_per_page * ($page - 1) + 1; $j = 0; while ($db_row = dba_fetch_array($db_result)) { $j++; $in_id = $db_row['in_id']; $in_sender = $db_row['in_sender']; $p_desc = phonebook_number2name($in_sender); $current_sender = $in_sender; if ($p_desc) { $current_sender = "{$in_sender}<br>({$p_desc})"; } $in_keyword = $db_row['in_keyword']; $in_message = core_display_text($db_row['in_message'], 25); $in_datetime = core_display_datetime($db_row['in_datetime']); $in_feature = $db_row['in_feature']; $in_status = $db_row['in_status'] == 1 ? '<p><font color=green>' . _('handled') . '</font></p>' : '<p><font color=red>' . _('unhandled') . '</font></p>'; $i--; $td_class = $i % 2 ? "box_text_odd" : "box_text_even"; $content .= "\n\t\t<tr>\n\t <td valign=top class={$td_class} align=left>{$i}.</td>\n\t <td valign=top class={$td_class} align=center>{$in_datetime}</td>\n\t <td valign=top class={$td_class} align=center>{$current_sender}</td>\n\t <td valign=top class={$td_class} align=center>{$in_keyword}</td>\n\t <td valign=top class={$td_class} align=left>{$in_message}</td>\n\t <td valign=top class={$td_class} align=center>{$in_feature}</td>\n\t <td valign=top class={$td_class} align=center>{$in_status}</td>\n\t <td valign=top class={$td_class} align=center nowrap>\n\t\t <!-- <a href=\"javascript: PopupReplySms('{$current_sender}', '" . urlencode($in_message) . "')\">{$icon_reply}</a> -->\n\t\t <!-- <a href=\"index.php?app=menu&inc=phone_add&op=add&phone={$current_sender}\">{$icon_phonebook}</a> -->\n\t\t <a href=\"javascript: ConfirmURL('" . _('Are you sure you want to delete this SMS ?') . "','index.php?app=menu&inc=user_incoming&op=user_incoming_del&inid={$in_id}')\">{$icon_delete}</a>\n\t\t </td>\n\t\t<td class={$td_class} width=4>\n\t\t <input type=hidden name=inid" . $j . " value=\"{$in_id}\">\n\t\t <input type=checkbox name=chkid" . $j . ">\n\t\t</td>\t\t \n\t\t</tr>\n\t "; } $item_count = $j; $content .= "\n </tbody>\n </table>\n\t<table width=100% cellpadding=0 cellspacing=0 border=0>\n\t<tr>\n\t <td width=100% colspan=2 align=right>\n\t\t<input type=hidden name=item_count value=\"{$item_count}\">\n\t\t<input type=submit value=\"" . _('Delete selection') . "\" class=button />\n\t </td>\n\t</tr>\n\t</table>\t \n </form>\n <p>{$nav_pages}</p>\n "; if ($err) { echo "<div class=error_string>{$err}</div><br><br>"; } echo $content; break; case "user_incoming_del":