function index($closed = 0) { global $lvlUser, $nuked, $user, $color_content2, $color_content1, $color_top; if ($lvlUser and $closed == 0) { $tickets = recupTickets(); } else { if ($closed == 1) { $tickets = recupTicketsClose(); } } if ($tickets == false) { die("Erreur dans le chargement de la page (module probablement non installé)"); } ?> <div style="text-align:center;"> <h2><?php echo _SUPPORT; ?> </h2> <?php if ($closed) { ?> <a href="index.php?file=Support"><?php } else { echo "<b>"; } echo "[ " . _LISTTICKETS . " " . _OUVERTS . " ]"; if ($closed) { ?> </a> <?php } else { echo "</b>"; } ?> - <?php if (!$closed) { ?> <a href="index.php?file=Support&op=index&tickets=close"><?php } else { echo "<b>"; } echo "[ " . _LISTTICKETS . " " . _FERMES . " ]"; if (!$closed) { ?> </a><?php } else { echo "</b>"; } ?> <br /><br /> </div> <table style="margin-left:auto; margin-right:auto; text-align:left; background:<?php echo $color_content1; ?> ; border:1px solid <?php echo $color_top; ?> ; width:98%;" cellspacing="1" cellpadding="2"> <tbody> <tr style="background: <?php echo $color_top; ?> "> <td><b>#</b></td> <td><b><?php echo _SUJET; ?> </b></td> <td><b><?php echo _CAT; ?> </b></td> <td style="width: 20%;"><b><?php echo _DATE; ?> </b></td> <td><b><?php echo _OPERATIONS; ?> </b></td> </tr> <?php if ($lvlUser == 0) { ?> <tr> <td colspan="5" style="text-align:center;"><?php echo _VIEWUNREG; redirect("javascript:history.back()", 5); ?> </td> </tr> <?php } else { if (mysql_num_rows($tickets) == 0) { ?> <tr style="background: <?php echo $color_content1; ?> "> <td colspan="5" style="text-align:center;"><?php echo _NOTICKETS; ?> </td> </tr> <?php } else { $counter = 0; while ($t = mysql_fetch_assoc($tickets)) { ?> <tr <?php if ($counter % 2 == 0) { ?> style="background: <?php echo $color_content1; ?> " <?php } else { ?> style="background: <?php echo $color_content2; ?> " <?php } ?> > <td><?php echo $t["id"]; ?> </td> <td><?php echo $t["titre"]; ?> </td> <td><?php $cat = getCatName($t["cat_id"]); echo $cat["nom"]; ?> </td> <td><?php echo strftime("%x %H:%M", $t["date"]); ?> </td> <td><a href="index.php?file=Support&op=view&id=<?php echo $t["id"]; ?> "><?php echo _CONSULT; if (!$closed) { echo '/' . _REPLY; } ?> </a> - <a href="index.php?file=Support&op=<?php if (!$closed) { echo "close"; } else { echo "open"; } ?> &id=<?php echo $t["id"]; ?> "><?php if (!$closed) { echo _CLOSE; } else { echo _OPEN; } ?> </a></td> </tr> <?php $counter++; } } } ?> <tr></tr> </tbody> </table> <?php if (!$closed) { define('EDITOR_CHECK', 1); ?> <br /><br /><br /><form method="post" action="index.php?file=Support&op=post"> <table style="width:100%;" cellspacing="1" cellpadding="3" border="0"> <tr><td align="center"><h3><?php echo _ADDTICKET; ?> </h3></td></tr> <tr><td><b><?php echo _SUJET; ?> : </b> <input id="ns_sujet" type="text" name="sujet" value="" size="36" /></td></tr> <tr><td><b><?php echo _CAT; ?> : </b> <select name="cat" id="cat"> <?php $cat = recupCat(); while ($c = mysql_fetch_assoc($cat)) { ?> <option value="<?php echo $c["id"]; ?> "><?php echo $c["nom"]; ?> </option> <?php } ?> </select></td></tr> <tr><td><textarea id="e_basic" name="corps" cols="60" rows="12"></textarea></td></tr> <tr><td><b><?php echo _NOTIFYME; ?> : </b> <input type="checkbox" name="notify" id="notify" checked="checked" /></td></tr> <tr><td align="center"><br /><input type="submit" class="bouton" value="<?php echo _SEND; ?> " /></td></tr></table></form><br /> <?php } }
function delete_cat($id) { global $nuked; $erreur = 0; $cat = recupCat(); while ($c = mysql_fetch_assoc($cat)) { $erreur++; } if ($erreur > 1) { $erreur = false; } else { $erreur = true; } if (is_nan($id) or $erreur or $id < 1) { echo "<div class=\"notification error png_bg\">\n" . "<div>\n" . "" . _ERREUR . "\n"; if ($erreur) { echo "<br />" . _ERRNOCAT . "\n"; } echo "</div>\n" . "</div>\n"; redirect("index.php?file=Support&page=admin&op=main_pref", 5); } else { $sql = mysql_query("DELETE FROM " . mysql_real_escape_string($nuked["prefix"]) . "_support_cat WHERE id = '" . mysql_real_escape_string($id) . "' "); echo "<div class=\"notification success png_bg\">\n" . "<div>\n" . "" . _CATDELETED . "\n" . "</div>\n" . "</div>\n"; redirect("index.php?file=Support&page=admin", 2); } }