group_id, DATE_FORMAT(updated, '%W %b %d %h:%i %Y') as updated, DATE_FORMAT(created, '%W %b %d %h:%i %Y') as created FROM " . T_TICKETS . " WHERE id IN(" . implode(",", $_SESSION["selected_tickets"]) . ")"; $rows = SQL_select($query); $i = 1; foreach($rows as $row) { if((int)$row["cc_member_id"]) $applicant = "Consumer ID: <b>" . (int)$row["cc_member_id"] . "</b> "; if($row["from_email"] != "") $applicant .= "E-mail: <b>" . trim($row["from_email"]) . "</b>"; $applicant_name = ""; if(trim($row["cc_fname"]) != "" || trim($row["cc_lname"]) != "") $applicant_name = " <b>" . ucwords(htmlspecialchars($row["cc_fname"])) . " " . ucwords(htmlspecialchars($row["cc_lname"])) . "</b>"; $xtpl->assign("APPLICANT", "#" . $i . ": " . $applicant . $applicant_name . "</br>"); $xtpl->parse("main.update.group_tickets.group_ticket_info"); $xtpl->assign("TICKET_INFO", "#" . $i . ": " . "Owner: <strong>" . get_user_login($row["user_id"]) . "</strong> Queue: <strong>" . get_queue_name($row["group_id"]) . "</strong> Status: <strong>" . $row["status"] . "</strong><br>"); $i++; $xtpl->parse("main.update.group_tickets.group_ticket_info1"); } $xtpl->parse("main.update.group_tickets"); get_group_operations($xtpl, "main.update", "form1", 0, 0); $type_message = array("comment"=>"Add comments", "reply"=>"Send answer"); $xtpl->assign("TYPE_MESSAGE", get_drop_down_list($type_message, "message_status")); $xtpl->assign("MESSAGE_STATUS", $_REQUEST["message_status"]); if($template > 0) $xtpl->assign("MESSAGE", get_template($template, 0, 0)); } $query = "SELECT id, name FROM " . T_TEMPLATES . " WHERE template_website='" . $_SESSION['website_url'] . "'";
$actions = ""; $temp_actions = "<a href=\"update.php?message_status=reply&ta_id=" . $val["id"] . "\"><img src=\"" . MAIN_HOST . "images/reply.gif\" border=\"0\" alt=\"Reply\"></a> <a href=\"update.php?message_status=comment&ta_id=" . $val["id"] . "\" class=\"table_header_text\"><img src=\"" . MAIN_HOST . "images/add_comment.gif\" border=\"0\" alt=\"Add comment\"></a>"; if(trim($val["user_action"]) != "") { if($val["user_action"] == "change_priority") { $comment = "The user <b>" . get_user_login($val["now_user_id"]) . "</b> have changed ticket priority from <b>" . $val["prev_ticket_priority"] . "</b> to <b>" . $val["now_ticket_priority"] . "</b>"; } if($val["user_action"] == "changed_status") { $comment = "The user <b>" . get_user_login($val["now_user_id"]) . "</b> have changed ticket status from <b>" . $val["prev_ticket_status"] . "</b> to <b>" . $val["now_ticket_status"] . "</b>"; }elseif($val["user_action"] == "changed_group") { $comment = "The user <b>" . get_user_login($val["now_user_id"]) . "</b> have changed queue for ticket from <b>" . get_queue_name($val["prev_group_id"]) . "</b> to <b>" . get_queue_name($val["now_group_id"]) . "</b>"; }elseif($val["user_action"] == "take_ticket") { $comment = "The user <b>" . get_user_login($val["now_user_id"]) . "</b> took away the ticket from user <b>" . get_user_login($val["prev_user_id"]) . "</b>"; }elseif($val["user_action"] == "gave_ticket") { $comment = "The user <b>" . get_user_login($val["prev_user_id"]) . "</b> gave the ticket to user <b>" . get_user_login($val["now_user_id"]) . "</b>"; } }else { if($val["message_type"] == "incoming") { if((int)$row["cc_member_id"]) $comment = "The consumer with ID: <b>" . (int)$row["cc_member_id"] . " " . $applicant_name . "</b> - sent new message"; else $comment = "The person with email: <b>" . htmlspecialchars(trim($row["from_email"])) . "</b> - sent new message"; $actions = $temp_actions; $xtpl->assign("MESSAGE_CLASS", "income");