| [ PHPXref.com ] | [ Generated: Sun Jul 20 19:05:01 2008 ] | [ OneOrZero 1.6.3 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * file: myopen.php 5 * 6 * This file grabs the information about all open tickets of the supporter that is logged in 7 * and displays that information. 8 * 9 /*************************************************************************** 10 * This program is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU General Public 12 * License as published by the Free Software Foundation; either 13 * version 2.1 of the License, or (at your option) any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public 21 * License along with This program; if not, write to: 22 * Free Software Foundation, Inc. 23 * 59 Temple Place 24 * Suite 330 25 * Boston, MA 02111-1307 USA 26 * 27 * Copyright 2005 One or Zero 28 * info@oneorzero.com 29 * http://www.oneorzero.com 30 * Developers: OneOrZero Team / Contributors: OneOrZero Community 31 ****************************************************************************/ 32 33 require_once "../common/common.php"; 34 require_once "../common/init_server_settings.php"; 35 require_once "../common/$database.class.php"; 36 require_once "../common/init_ooz.php"; 37 require_once "../common/login.php"; 38 39 $highest_pri = getRPriority(getHighestRank($tpriorities_table)); //set the highest priority rating 40 $supporter_id = getUserID($_SESSION[user]); 41 42 startTable("$lang_youropen", "center"); 43 echo '<tr> 44 <td class=back> '; 45 // everything in here should be the ticket information 46 // start the table, use a while loop to cycle through all the tickets. 47 echo '<table class=border cellSpacing=0 cellPadding=0 width="100%" align=center border=0> 48 <tr> 49 <td> 50 <table cellSpacing=1 cellPadding=5 width="100%" border=0> 51 <tr>'; 52 53 if ($_GET[s] == 'id') { 54 echo '<td class=hf align=center> 55 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop"><b>' . $lang_id . '</b></a></td>'; 56 } else { 57 echo '<td class=hf align=center> 58 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=id"><b>' . $lang_id . '</b></a></td>'; 59 } 60 61 echo '<td class=hf align=center> 62 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=sup"><b>' . $lang_Supporter . '</b></a></td>'; 63 64 if ($_GET[s] == 'ds') { 65 echo '<td class=hf align=center> 66 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=sd"><b>' . $lang_shortdesc . '</b></a></td>'; 67 } else { 68 echo '<td class=hf align=center> 69 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=ds"><b>' . $lang_shortdesc . '</b></a></td>'; 70 } 71 72 if ($_GET[s] == 'ur') { 73 echo '<td class=hf align=center> 74 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=ru"><b>' . $lang_user . '</b></a></td>'; 75 } else { 76 echo '<td class=hf align=center> 77 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=ur"><b>' . $lang_user . '</b></a></td>'; 78 } 79 80 if ($_GET[s] == 'pr') { 81 echo '<td class=hf align=center> 82 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=rp"><b>' . $lang_priority . '</b></a></td>'; 83 } else { 84 echo '<td class=hf align=center> 85 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=pr"><b>' . $lang_priority . '</b></a></td>'; 86 } 87 88 if ($_GET[s] == 'cr') { 89 echo '<td class=hf align=center> 90 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=rc"><b>' . $lang_created . '</b></a></td>'; 91 } else { 92 echo '<td class=hf align=center> 93 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=cr"><b>' . $lang_created . '</b></a></td>'; 94 } 95 96 if ($_GET[s] == 'st') { 97 echo '<td class=hf align=center> 98 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=ts"><b>' . $lang_status . '</b></a></td>'; 99 } else { 100 echo '<td class=hf align=center> 101 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=st"><b>' . $lang_status . '</b></a></td>'; 102 } 103 104 if ($_GET[s] == 'rt') { 105 echo '<td class=hf align=center> 106 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=tr"><b>' . $lang_time . '</b></a></td>'; 107 } else { 108 echo '<td class=hf align=center> 109 <a class=hf href="' . $supporter_site_url . '/index.php?t=tmop&s=rt"><b>' . $lang_time . '</b></a></td>'; 110 } 111 112 echo '</tr>'; 113 114 listOpenTickets($supporter_id, $_GET[s]); 115 116 endTable(); 117 endTable(); 118 119 function listOpenTickets($id, $sort) 120 { 121 global $tickets_table, $tstatus_table, $tpriorities_table, $db; 122 123 $time = time(); 124 switch ($sort) { 125 case ("su"): 126 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by supporter asc"; 127 $result = $db->query($sql); 128 displayTicket($result); 129 break; 130 case ("sd"): 131 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by short asc"; 132 $result = $db->query($sql); 133 displayTicket($result); 134 break; 135 case ("ds"): 136 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by short desc"; 137 $result = $db->query($sql); 138 displayTicket($result); 139 break; 140 case ("ur"): 141 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by user asc"; 142 $result = $db->query($sql); 143 displayTicket($result); 144 break; 145 case ("ru"): 146 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by user desc"; 147 $result = $db->query($sql); 148 displayTicket($result); 149 break; 150 case ("pr"): 151 listByPriority($id, "asc"); 152 break; 153 case ("rp"): 154 listByPriority($id, "desc"); 155 break; 156 case ("cr"): 157 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by create_date asc"; 158 $result = $db->query($sql); 159 displayTicket($result); 160 break; 161 case ("rc"): 162 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by create_date desc"; 163 $result = $db->query($sql); 164 displayTicket($result); 165 break; 166 case ("st"): 167 listByStatus($id, "asc"); 168 break; 169 case ("ts"): 170 listByStatus($id, "desc"); 171 break; 172 case ("tr"): 173 $sql = "SELECT t.*, ($time - t.lastupdate)/p.response_time as a from $tickets_table t, $tpriorities_table p where p.priority=t.priority and t.status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and t.supporter_id=$id group by t.id order by a desc"; 174 $result = $db->query($sql); 175 displayTicket($result); 176 break; 177 case ("rt"): 178 $sql = "SELECT t.*, ($time - t.lastupdate)/p.response_time as a from $tickets_table t, $tpriorities_table p where p.priority=t.priority and t.status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and t.supporter_id=$id group by t.id order by a asc"; 179 $result = $db->query($sql); 180 displayTicket($result); 181 break; 182 case ("id"): 183 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by id desc"; 184 $result = $db->query($sql); 185 displayTicket($result); 186 break; 187 default: 188 $sql = "select * from $tickets_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' and supporter_id=$id order by id asc"; 189 $result = $db->query($sql); 190 displayTicket($result); 191 break; 192 } 193 } 194 195 function listByPriority($id, $order) 196 { 197 global $tpriorities_table, $tickets_table, $tstatus_table, $db; 198 199 $high_status = getRStatus(getHighestRank($tstatus_table)); 200 $sql = "select priority from $tpriorities_table order by rank $order"; 201 $result = $db->query($sql); 202 while ($row = $db->fetch_array($result)) { 203 $sql2 = "select * from $tickets_table where priority='$row[0]' and supporter_id=$id and status!='$high_status'"; 204 $result2 = $db->query($sql2); 205 displayTicket($result2); 206 } 207 // now we have to list all of the tickets that have a priority other than what is in the priority list 208 // ie. if a priority gets deleted via the admin tool and there are still tickets with that priority, we 209 // still need to list them. 210 $sql = "select * from $tickets_table where supporter_id=$id and "; 211 $prios = getPriorityList(); 212 for($i = 0; $i < sizeof($prios); $i++) { 213 if ($flag != 1) { 214 $sql .= "priority!='" . $prios[$i] . "'"; 215 $flag = 1; 216 } else { 217 $sql .= " and priority!='" . $prios[$i] . "'"; 218 $flag = 1; 219 } 220 } 221 222 $result3 = $db->query($sql); 223 displayTicket($result3); 224 } 225 226 function listByStatus($id, $order) 227 { 228 global $tstatus_table, $tickets_table, $db; 229 230 $sql = "select status from $tstatus_table where status!='" . getRStatus(getHighestRank($tstatus_table)) . "' order by rank $order"; 231 $result = $db->query($sql); 232 while ($row = $db->fetch_array($result)) { 233 $sql2 = "select * from $tickets_table where status='$row[0]' and supporter_id=$id"; 234 $result2 = $db->query($sql2); 235 displayTicket($result2); 236 } 237 // now we have to list all of the tickets that have a priority other than what is in the priority list 238 // ie. if a priority gets deleted via the admin tool and there are still tickets with that priority, we 239 // still need to list them. 240 $sql = "select * from $tickets_table where supporter_id=$id and "; 241 $list = getStatusList(); 242 for($i = 0; $i < sizeof($list); $i++) { 243 if ($flag != 1) { 244 $sql .= "status!='" . $list[$i] . "'"; 245 $flag = 1; 246 } else { 247 $sql .= " and status!='" . $list[$i] . "'"; 248 $flag = 1; 249 } 250 } 251 252 $result3 = $db->query($sql); 253 displayTicket($result3); 254 } 255 256 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |