Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / front / find_num.php @ b67d8923

Historique | Voir | Annoter | Télécharger (9,72 ko)

1
<?php
2
/*
3
 * @version $Id: find_num.php 7763 2009-01-06 18:44:50Z moyo $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2009 by the INDEPNET Development Team.
7

8
 http://indepnet.net/   http://glpi-project.org
9
 -------------------------------------------------------------------------
10

11
 LICENSE
12

13
 This file is part of GLPI.
14

15
 GLPI is free software; you can redistribute it and/or modify
16
 it under the terms of the GNU General Public License as published by
17
 the Free Software Foundation; either version 2 of the License, or
18
 (at your option) any later version.
19

20
 GLPI is distributed in the hope that it will be useful,
21
 but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 GNU General Public License for more details.
24

25
 You should have received a copy of the GNU General Public License
26
 along with GLPI; if not, write to the Free Software
27
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
 --------------------------------------------------------------------------
29
 */
30

    
31
// ----------------------------------------------------------------------
32
// Original Author of file:
33
// Purpose of file:
34
// ----------------------------------------------------------------------
35

    
36

    
37
$NEEDED_ITEMS=array("user");
38

    
39
define('GLPI_ROOT', '..');
40
include (GLPI_ROOT . "/inc/includes.php");
41

    
42
if(isset($_GET["name"]) && ($_GET["name"] == "Helpdesk") && ($CFG_GLPI["permit_helpdesk"] == "1"))
43
{
44
        $id = new Identification();
45
        $id->initSession();
46
} else exit();
47

    
48
// Send UTF8 Headers
49
header("Content-Type: text/html; charset=UTF-8");
50

    
51
?>
52
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
53
<html>
54
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
56
<title>GLPI</title>
57

    
58
<?php
59
// Appel CSS
60
echo "<link rel='stylesheet'  href='".$CFG_GLPI["root_doc"]."/css/styles.css' type='text/css' media='screen' >";
61
// Appel javascript
62
echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/script.js'></script>";
63

    
64
?>
65

    
66
</head>
67

    
68
<body>
69
<script language="javascript" type="text/javascript">
70
function fillidfield(Type,Id){
71
        window.opener.document.forms["helpdeskform"].elements["computer"].value = Id;
72
        window.opener.document.forms["helpdeskform"].elements["device_type"].value = Type;
73
        window.close();}
74
        </script>
75

    
76
        <?php 
77

    
78
        echo "<div align='center'>";
79
        echo "<p><strong>".$LANG["help"][22]."</strong></p>";
80
        echo " <form name=\"form1\" method=\"post\"  action=\"".$_SERVER['PHP_SELF']."\">"; 
81

    
82
        echo "<table cellspacing='1' width='100%'  class='tab_cadre'>";
83
        echo "<tr><th align='center'  width='100%' height='29'>".$LANG["help"][23]."</th>";
84
        echo "</tr><tr><td class='tab_bg_1' align='center' width='100%'>"; 
85
        echo "<input name='NomContact' type='text' id='NomContact' >";
86
        echo "<input type='hidden' name='send' value='1' />"; // bug IE ! La validation par enter ne fonctionne pas sans cette ligne  incroyable mais vrai !
87
        echo "<input type='submit' name='send' value=\"". $LANG["buttons"][0]."\">";
88
        echo "</td>  </tr> </table> </form></div>";
89

    
90

    
91
        if(isset($_POST["send"]))
92
{
93
        echo "<table width='100%' class='tab_cadre'>";
94
        echo " <tr class='tab_bg3'>";
95
        echo " <td align='center' width='30%'><b>".$LANG["reports"][19]."</b></td>";
96
        echo " <td align='center' width='20%'><b>".$LANG["help"][24]."</b></td>";
97
        echo " <td align='center' width='30%'><b>".$LANG["common"][1]."</b></td>";
98
        echo " <td align='center' width='5%'><b>".$LANG["common"][2]."</b></td>";
99
        echo " <td align='center' width='20%'><b>".$LANG["common"][19]."&nbsp;/&nbsp;".$LANG["common"][20]."</b></td>";
100
        echo " </tr>";
101

    
102

    
103
        $query = "select name,ID,contact, serial, otherserial from glpi_computers where is_template='0' AND deleted='0' AND (contact like '%".$_POST["NomContact"]."%' OR name like '%".$_POST["NomContact"]."%' OR serial like '%".$_POST["NomContact"]."%' OR otherserial like '%".$_POST["NomContact"]."%')";
104
        $result = $DB->query($query);
105
        while($ligne = $DB->fetch_array($result))
106
        {
107
                $Comp_num = $ligne['ID'];
108
                $Contact = $ligne['contact'];
109
                $Computer = $ligne['name'];
110
                $s1 = $ligne['serial'];
111
                $s2 = $ligne['otherserial'];
112
                echo " <tr class='tab_find' onClick=\"fillidfield(".COMPUTER_TYPE.",".$Comp_num.")\">";
113
                echo "<td width='25%' align='center'><b>&nbsp;$Contact</b></td>";
114
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][25]."</b></td>";
115
                echo "<td width='25%' align='center'><b>&nbsp;$Computer&nbsp;</b></td>";
116
                echo "<td  width='25%' align='center'>";
117
                echo "<b>&nbsp;$Comp_num </b></td>";
118
                echo "<td width='25%' align='center'>";
119
                if ($s1!="") echo $s1;
120
                if ($s1!=""&&$s2!="") echo "&nbsp;/&nbsp;";
121
                if ($s2!="") echo $s2;
122
                echo "</td>";
123
                echo "</tr>";
124
        }
125

    
126
        $query = "select name,ID,contact, serial, otherserial from glpi_networking where is_template='0' AND deleted='0' AND (contact like '%".$_POST["NomContact"]."%' OR name like '%".$_POST["NomContact"]."%' OR serial like '%".$_POST["NomContact"]."%' OR otherserial like '%".$_POST["NomContact"]."%')";
127
        $result = $DB->query($query);
128
        while($ligne = $DB->fetch_array($result))
129
        {
130
                $Comp_num = $ligne['ID'];
131
                $Contact = $ligne['contact'];
132
                $Computer = $ligne['name'];
133
                $s1 = $ligne['serial'];
134
                $s2 = $ligne['otherserial'];
135
                echo " <tr class='tab_find' onClick=\"fillidfield(".NETWORKING_TYPE.",".$Comp_num.")\">";
136
                echo "<td width='25%' align='center'><b>&nbsp;$Contact </b></td>";
137
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][26]."</b></td>";
138
                echo "<td width='25%' align='center'><b>&nbsp;$Computer </b></td>";
139
                echo "<td  width='25%' align='center'>";
140
                echo "<b>&nbsp;$Comp_num </b></td>";
141
                echo "<td width='25%' align='center'>";
142
                if ($s1!="") echo $s1;
143
                if ($s1!=""&&$s2!="") echo "&nbsp;/&nbsp;";
144
                if ($s2!="") echo $s2;
145
                echo "</td>";
146
                echo "</tr>";
147
        }
148

    
149
        $query = "select name,ID,contact, serial, otherserial from glpi_printers where is_template='0' AND deleted='0' AND (contact like '%".$_POST["NomContact"]."%' OR name like '%".$_POST["NomContact"]."%' OR serial like '%".$_POST["NomContact"]."%' OR otherserial like '%".$_POST["NomContact"]."%')";
150
        $result = $DB->query($query);
151
        while($ligne = $DB->fetch_array($result))
152
        {
153
                $Comp_num = $ligne['ID'];
154
                $Contact = $ligne['contact'];
155
                $Computer = $ligne['name'];
156
                $s1 = $ligne['serial'];
157
                $s2 = $ligne['otherserial'];
158
                echo " <tr class='tab_find' onClick=\"fillidfield(".PRINTER_TYPE.",".$Comp_num.")\">";
159
                echo "<td width='25%' align='center'><b>&nbsp;$Contact </b></td>";
160
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][27]."</b></td>";
161
                echo "<td width='25%' align='center'><b>&nbsp;$Computer </b></td>";
162
                echo "<td  width='25%' align='center'>";
163
                echo "<b>&nbsp;$Comp_num </b></td>";
164
                echo "<td width='25%' align='center'>";
165
                if ($s1!="") echo $s1;
166
                if ($s1!=""&&$s2!="") echo "&nbsp;/&nbsp;";
167
                if ($s2!="") echo $s2;
168
                echo "</td>";
169
                echo "</tr>";
170
        }
171

    
172
        $query = "select name,ID,contact, serial, otherserial from glpi_monitors where is_template='0' AND deleted='0' AND (contact like '%".$_POST["NomContact"]."%' OR name like '%".$_POST["NomContact"]."%' OR serial like '%".$_POST["NomContact"]."%' OR otherserial like '%".$_POST["NomContact"]."%')";
173
        $result = $DB->query($query);
174
        while($ligne = $DB->fetch_array($result))
175
        {
176
                $Comp_num = $ligne['ID'];
177
                $Contact = $ligne['contact'];
178
                $Computer = $ligne['name'];
179
                $s1 = $ligne['serial'];
180
                $s2 = $ligne['otherserial'];
181
                echo " <tr class='tab_find' onClick=\"fillidfield(".MONITOR_TYPE.",".$Comp_num.")\">";
182
                echo "<td width='25%' align='center'><b>&nbsp;$Contact </b></td>";
183
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][28]."</b></td>";
184
                echo "<td width='25%' align='center'><b>&nbsp;$Computer </b></td>";
185
                echo "<td  width='25%' align='center'>";
186
                echo "<b>&nbsp;$Comp_num </b></td>";
187
                echo "<td width='25%' align='center'>";
188
                if ($s1!="") echo $s1;
189
                if ($s1!=""&&$s2!="") echo "&nbsp;/&nbsp;";
190
                if ($s2!="") echo $s2;
191
                echo "</td>";
192
                echo "</tr>";
193
        }
194

    
195
        $query = "select name,ID,contact, serial, otherserial from glpi_peripherals where is_template='0' AND deleted='0' AND (contact like '%".$_POST["NomContact"]."%' OR name like '%".$_POST["NomContact"]."%' OR serial like '%".$_POST["NomContact"]."%' OR otherserial like '%".$_POST["NomContact"]."%')";
196
        $result = $DB->query($query);
197
        while($ligne = $DB->fetch_array($result))
198
        {
199
                $Comp_num = $ligne['ID'];
200
                $Contact = $ligne['contact'];
201
                $Computer = $ligne['name'];
202
                $s1 = $ligne['serial'];
203
                $s2 = $ligne['otherserial'];
204
                echo " <tr class='tab_find' onClick=\"fillidfield(".PERIPHERAL_TYPE.",".$Comp_num.")\">";
205
                echo "<td width='25%' align='center'><b>&nbsp;$Contact </b></td>";
206
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][29]."</b></td>";
207
                echo "<td width='25%' align='center'><b>&nbsp;$Computer </b></td>";
208
                echo "<td  width='25%' align='center'>";
209
                echo "<b>&nbsp;$Comp_num </b></td>";
210
                echo "<td width='25%' align='center'>";
211
                if ($s1!="") echo $s1;
212
                if ($s1!=""&&$s2!="") echo "&nbsp;/&nbsp;";
213
                if ($s2!="") echo $s2;
214
                echo "</td>";
215
                echo "</tr>";
216
        }
217

    
218
        $query = "select name,ID from glpi_software where is_template='0' AND deleted='0' AND (name like '%".$_POST["NomContact"]."%' )";
219
        $result = $DB->query($query);
220
        while($ligne = $DB->fetch_array($result))
221
        {
222
                $Comp_num = $ligne['ID'];
223
                $Computer = $ligne['name'];
224
                echo " <tr class='tab_find' onClick=\"fillidfield(".SOFTWARE_TYPE.",".$Comp_num.")\">";
225
                echo "<td width='25%' align='center'>&nbsp;</td>";
226
                echo "<td width='25%' align='center'><b>&nbsp;".$LANG["help"][31]."</b></td>";
227
                echo "<td width='25%' align='center'><b>&nbsp;$Computer </b></td>";
228
                echo "<td  width='25%' align='center'>";
229
                echo "<b>&nbsp;$Comp_num </b></td>";
230
                echo "<td width='25%' align='center'>";
231
                echo "&nbsp;";
232
                echo "</td>";
233
                echo "</tr>";
234
        }
235

    
236
        echo "</table>";
237
}
238
?>
239
</body></html>
Redmine Appliance - Powered by TurnKey Linux