1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
<style type="text/css">
<!--
div#content {
clear:both;
width: 700px;
height: 300px;
overflow:auto;
margin-top:0px;
}
-->
</style>
</head>
<body>
<!--TITRE-->
<form id="FormViewTicket" name="FormViewTicket" method="post" action="">
<!--CONNECTION-->
<?php
//Connection
$link = mysql_connect("localhost", "root", "");
mysql_select_db("incidents") or die(mysql_error());
?>
<!--CORPS-->
<?
$result_division = mysql_query("SELECT NOM_DIVISION FROM `DIVISION` order by 1");
// Gestion des erreurs
if (!$result_division) {
die('Requête invalide : ' . mysql_error());
}
while ($row_division = mysql_fetch_array($result_division, MYSQL_NUM)) {
$division[] = $row_division[0] ;
}
mysql_free_result($result_division);
// Création du select categ
echo '<select name="division" onchange="javascript:submit();">';
echo '<option value=""'; if (!isset($_POST["division"])) echo "SELECTED >";
echo ' > </option>';
foreach ( $division as $key => $value )
{
echo '<option value="'.$value .'" '; if (isset($_POST["division"])){if ($_POST["division"]==$value) echo "SELECTED";}
echo ' >' . $value . '</option>';
}
echo '</select>' ;
?>
<div id="content" class="style3">
<table align="center">
<tr>
<th style="background-color:#AFDBFE" >Ref</th>
<th style="background-color:#AFDBFE" >Summary</th>
</tr>
<?
unset($parametres);
//$parametres = array();
if((isset($_POST['division']))and(!empty($_POST['division'])))
{
$parametres[] = 'DIVISION = "'.$_POST['division'].'"';
}
if (!empty($parametres)){
$query ='SELECT ID_TICKET, SUJET from `ticket` where '.implode(' AND ', $parametres);;
$result_Id = mysql_query("$query");
// Gestion des erreurs
if (!$result_Id) {
die('Requête invalide : ' . mysql_error());
}
$i=0;
while ($row_Id = mysql_fetch_array($result_Id, MYSQL_ASSOC)) {
$nomTD = $row_Id["ID_TICKET"];
if ($i==0){
echo '<tr style="background-color:#FFFFFF" onMouseOver="this.style.cursor=\'hand\';this.style.background=\'#FFECEC\';" onMouseOut="this.style.cursor=\'default\';this.style.background=\'#FFFFFF\';" >';
}
if ($i==1){
echo '<tr style="background-color:#E1EDFF" onMouseOver="this.style.cursor=\'hand\';this.style.background=\'#FFECEC\';" onMouseOut="this.style.cursor=\'default\';this.style.background=\'E1EDFF\';" >';
}
echo '<td id="'.$nomTD.'" onclick="retourneValeur(\''.$nomTD.'\')">'.$row_Id["ID_TICKET"].'</td>' ;
echo '<td id="'.$nomTD.'" onclick="retourneValeur(\''.$nomTD.'\')">'.$row_Id["SUJET"].'</td>';
echo '</tr>';
if ($i==0) {$i=1;} else {$i=0;}
}
mysql_free_result($result_Id);
}
?>
</table>
</div>
<!--Variable contenant le numéro de ticket-->
<input type="hidden" value="" name="idtick" />
</form>
<? mysql_close($link); ?>
</body>
</html> |
Partager