// echo $qq . "<br>"; pg_safe_exec($qq); } $mumuq = pg_safe_exec("SELECT id FROM complaints_threads WHERE complaint_ref='" . (int) $da_id . "' ORDER BY reply_ts DESC LIMIT 1"); if ($mommoq = pg_fetch_object($mumuq)) { $da_rt = $mommoq->id; } else { $da_rt = 0; } if ($da_rt > 0) { if ($do_notify_user) { $mm = ""; $mm .= "Your complaint has received a reply from a CService Admin,\n"; $mm .= "you will find the reply below :\n\n"; $mm .= "============================================================================\n"; $mm .= N_get_pure_string($_POST["areply"]) . "\n\n"; $mm .= "============================================================================\n"; if ($_POST["newstatus"] > 0) { $mm .= "Thanks for using our Complaint system, this is the last event of this ticket.\n"; $mm .= "You'll receive a confirmation right after this message.\n\n"; } else { $mm .= "You can reply to this message by following the next link :\n"; $da_url = gen_server_url() . substr($REQUEST_URI, 0, strrpos($REQUEST_URI, "/")) . "/ticket.php?A=reply&ID=" . $_GET["ID"] . "&C=" . md5(CRC_SALT_0005 . $_GET["ID"] . $da_rt . "reply-user") . "&RT=" . $da_rt; $mm .= $da_url . "\n\n"; } mail($daobj->from_email, "[" . NETWORK_NAME . " CService Complaints] " . $_GET["ID"] . " - Admin Reply", $mm, "From: " . NETWORK_NAME . " Channel Service <" . OBJECT_EMAIL . ">\nReply-to: DO.NOT@REPLY.THANKS\nX-Mailer: " . NETWORK_NAME . " CService Complaint Module\n\n"); echo "<br><br><b>Your reply has been recorded, The user is being notified by e-mail.</b><br><br>"; } else { echo "<br><br><b>Your reply has been recorded (admin only), The user is NOT being notified.</b><br><br>"; } if ($_POST["newstatus"] > 0) {
echo "Offending/Purged channel(s). "; } if ($_POST["ouser"] == 1) { echo "Authenticated/Suspended username(s). "; } if ($_POST["qt"] > 0) { echo "<br>Specific complaint type (" . $cpt_name[$_POST["qt"]] . "). "; } echo "</h4>"; echo "</h2>\n"; echo "<hr width=100% size=1 noshade>"; echo "<a href=\"javascript:history.go(-1);\"><b>< back</b></a><br>\n"; $matchstring = post2db(strtolower(str_replace("*", "%", str_replace("?", "_", str_replace("%", "\\%", str_replace("_", "\\_", N_get_pure_string($_POST["q"]))))))); unset($cidz); $cidz = array(); if (ereg("\\*", N_get_pure_string($_POST["q"])) || ereg("\\?", N_get_pure_string($_POST["q"]))) { $cmp_oper = "LIKE"; } else { $cmp_oper = " = "; } unset($rQT); $rQT = ""; if ((int) $_POST["qt"] > 0) { $rQT = "complaints.complaint_type='" . (int) $_POST["qt"] . "' AND "; } if ($_POST["thread"] == 1) { // ticket events (must be separately) [forced auto %wild%] $q = "SELECT complaints_threads.complaint_ref FROM complaints_threads,complaints WHERE (lower(reply_text) LIKE '%" . $matchstring . "%' OR lower(actions_text) LIKE '%" . $matchstring . "%') AND " . $rQT . "complaints.id=complaints_threads.complaint_ref AND complaints.status!=99 ORDER BY created_ts DESC"; //echo $q . "<br>"; $r = pg_safe_exec($q); while ($o = pg_fetch_object($r)) {