download materiels.php
Language: PHP
License: GPL
Copyright: (C) 2001 Loc Dayot
LOC: 444
Project Info
epnadmin
Server: Savannah NonGNU
Type: cvs
...epnadmin\epnadmin\epnadmin\
   6cartes.inc.php
   add_message.sh
   add_message_file.sh
   animateur.php
   ...eurs-disponibilites.php
   animateurs-horaires.php
   animateurs.inc.php
   autoeval.js
   barcode.inc.php
   basdepage.inc.php
   camembert.inc.php
   cartes.inc.php
   common.initial.sql
   config.php
   configuration.php
   constantes.inc.php
   courriel.php
   dateheure.inc.php
   debug.inc.php
   domaines.php
   en.lang.inc.php
   entete.inc.php
   epnadmin.css
   epnadminv.css
   exemple.sql
   fonctions.inc.php
   footer.inc.php
   fr.initial.sql
   fr.lang.inc.php
   header.inc.php
   horaires.php
   i25object.inc.php
   image.inc.php
   index.php
   initial.sql
   initiations.inc.php
   initiations.php
   inscription_session.php
   localisations.php
   logiciels.php
   materiels.php
   menu2.js
   mysql.inc.php
   parcours.inc.php
   parcours.php
   positionnement.php
   prets.php
   print.php
   questions.php
   remove_message.sh
   reservations.inc.php
   reservations.php
   session.php
   sessions.inc.php
   siteweb.inc.php
   siteweb.php
   stats.php
   structure.sql
   structures.inc.php
   structures.php
   table_horaire.php
   table_horaire_session.php
   tableaux.inc.php
   tarifs.php
   themes.php
   usagers.inc.php
   usagers.php
   usages.php

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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
<?php
/*
    Copyright (C) 2001 Loc Dayot

    EPNadmin - Version 0.7

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

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

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://epnadmin.pierrefitte93.fr/
*/

require_once("header.inc.php");
if (! defined("FCT_PARC"))
{
  $fctnonactive;
  exit;
}

require_once("constantes.inc.php");             // dfinition des constantes
//require_once("fonctions.inc.php");              // concernant des fonctions transversales inclassables
require_once("mysql.inc.php");                  // concernant mysql
//require_once("sessions.inc.php");             // concernant les sessions et initiations
//require_once("usagers.inc.php");              // concernant la gestion des usagers
//require_once("reservations.inc.php");         // concernant les rservations des postes en accs individuel par des usagers
//require_once("tableaux.inc.php");             // Concernant l'affichage transpos d'un tableau
//require_once("siteweb.inc.php");              // concernant les pages perso des usagers et les sites web des structures
//require_once("dateheure.inc.php");            // concernant la manipulation des heures et des dates, formulaire, conversion...
require_once("structures.inc.php");           // concernant les structures
//require_once("initiations.inc.php");          // concernant les initiations et les thmes
//require_once("parcours.inc.php");             // concernant les parcours des usagers et leur positionnement


$stitr= $smateriels;
$titr = $stitremateriel;
$datemaj="13 juin 2003";
define("COULEUR", COULEUR_PARC);
require("entete.inc.php");

if (PARC<="~")
  echo $pasledroit;
else
  if (PARC_AUTRES>="r")
    echo "<a href=\"logiciels.php?operation=5\">$svoirlistelogiciels</a>
         - <a href=\"materiels.php?operation=5\">$svoirlistemateriels</a>\n";
  elseif (PARC_MOI>="r")
    echo "<a href=\"logiciels.php?operation=5\">$svoirmalistelogiciels</a> -
         <a href=\"materiels.php?operation=5\">$svoirmalistemateriels</a>\n";
echo "<hr>";

function verifdroits($droit="r", $affiche=TRUE)
{
global $id_materiel, $id_structure,
  $pasledroit, $materielintrouvable, $manqueinformateriel;
  if (!$id_materiel)
  {
    if ($affiche)
      echo $manqueinfomateriel;
    return FALSE;
  }
  $req="SELECT id_structure FROM materiels
          LEFT JOIN localisations ON materiels.id_localisation=localisations.id
          WHERE materiels.id=\"$id_materiel\"";
  $res=executeRequete($req);
  if (! $materiel=fetch_object($res))
  {
    if ($affiche)
      echo $materielintrouvable;
    return FALSE;
  }
  if (!(PARC_AUTRES>=$droit || (PARC_MOI>=$droit && $materiel->id_structure==$id_structure)))
  {
    if ($affiche)
      echo $pasledroit;
    return FALSE;
  }
  return TRUE;
}

switch ($operation)
{
case 11 : // confirmation d'ajout ou mise  jour
	echo cadre_debut($smajmateriel, "align=center", COULEUR_PARC);
  if ($id_materiel)
  {
    if (! verifdroits("w"))
    {
      echo cadre_fin(COULEUR_PARC);
      break;
    }
  }
  elseif (PARC_MOI<"w" && PARC_AUTRES<"w")
  {
    echo cadre_fin(COULEUR_PARC);
    break;
  }

   $mes="";
   if ($type=="") $mes.=$smanquetype."<br>";
   if ($description=="") $mes.=$smanquetitre."<br>";
   if ($pret_possible=="") $mes.=$smanquepret."<br>";
   if ($reservable=="") $mes.="$smanqueresa<br>";
   if ($mes!="")
   {
     echo "<p>$mes</p>";
     echo cadre_fin(COULEUR_PARC);
   }
   else
   {
      $sep=""; $i=0; $usagess="";
      while ($u=$usages[$i])
      {
         $usagess.=$sep.$u;
         $sep=",";
         $i++;
      }
      if (!$id_materiel)
      {
         echo "<p>$senrnouvmateriel</p>\n";
         $req = "INSERT INTO materiels "
              . "(type, materiel, specificite, ip, info_achat, "
              . "          description, usages, pret_possible, reservable, image, id_localisation) "
              . "VALUES "
              . "(\"$type\", \"$materiel\", \"$specificite\", \"$ip\", \"$info_achat\", "
              . "       \"$description\", \"$usagess\", \"$pret_possible\",
                        \"$reservable\", \"$image\", \"$id_localisation\")";
         $res = executeRequete($req);
         // on recherche l'id_materiel pour pouvoir faire le lien avec les logiciels
         $req = "SELECT MAX(id) as mx FROM materiels";
         $res = executeRequete($req);
         $max = fetch_object($res);
         $id_materiel = $max->mx;
      }
      else
      { // C'est une mise  jour de l'enregistrement.
         echo "<p>$smaj</p>\n";
         $req = "UPDATE materiels SET type=\"$type\", "
              . "materiel=\"$materiel\", specificite=\"$specificite\", ip=\"$ip\", "
              . "info_achat=\"$info_achat\", "
              . "description=\"$description\", usages=\"$usagess\", pret_possible=\"$pret_possible\",
                 reservable=\"$reservable\", image=\"$image\", id_localisation=\"$id_localisation\"";
         $req .= " WHERE id = \"$id_materiel\"";
         $res = executeRequete($req);

         // Suppression des liens entre matriel et logiciels
         $req = "DELETE FROM logi_mate WHERE id_materiel=$id_materiel";
         $res = executeRequete($req);
        }
     // Affectation des liens
     $i=0;
     while ($id_logiciel[$i])
     {
        $req = "INSERT INTO logi_mate (id_logiciel, id_materiel) "
             . "VALUES ($id_logiciel[$i], $id_materiel)";
        $res = executeRequete($req);
        $i++;
     }
     echo cadre_fin(COULEUR_PARC);
     break; // tout c'est bien pass
   }
   // pas de break si jamais il y avait besoin d'une nouvelle saisie.

case 2 : // formulaire d'dition
   // Saisie pour modification d'un enregistrement
   if (! verifdroits("w") && $operation!=11)
      break;

   $req = "SELECT * FROM materiels WHERE id=$id_materiel";
   $res = recherche("materiels", "id", $id_materiel);
   if ($mate = fetch_array($res))
      extract($mate);
   // pas de break, on enchane avec le formulaire d'dition

case 1 : // formulaire d'ajout
// Dbut du fomulaire de saisie d'enregistrement de logiciels
	echo cadre_debut($smajmateriel, "align=center", COULEUR_PARC);
	if ($id_materiel)
  {
		if (! verifdroits("w"))
		{
			echo cadre_fin(COULEUR_PARC);
			break;
		}
  }
  elseif (PARC_MOI<"w" && PARC_AUTRES<"w")
	{
		echo cadre_fin(COULEUR_PARC);
		break;
	}

   echo "<form action=\"$PHP_SELF\" method=\"post\">";
   echo "<input type=\"hidden\" name=\"operation\" value=\"11\">";
   if ($id_materiel)
      echo "<input type=\"hidden\" name=\"id_materiel\" value=\"$id_materiel\">";
   echo "<table align=\"center\">
         <tr><td>$stype*</td><td><select name=\"type\" size=\"1\">
             <option></option>";
	for ($ntype=0; $slistetypemateriels[$ntype]; $ntype++)
	{
		echo "   <option value=\"$slistetypemateriels[$ntype]\"";
		if ($type==$slistetypemateriels[$ntype]) echo " SELECTED";
		echo ">$slistetypemateriels[$ntype]</option>\n";
	}
	echo " </select></td></tr>
         <tr><td>$sCommentaire</td><td><textarea name=\"description\" rows=\"4\" cols=\"30\">$description</textarea></td></tr>
         <tr><td>$sAppellation</td><td><input type=\"text\" name=\"materiel\" value=\"$materiel\" size=\"20\" maxlength=\"20\"></td></tr>
         <tr><td>$sSpecificite</td><td><input type=\"text\" name=\"specificite\" value=\"$specificite\" size=\"20\" maxlength=\"20\"></td></tr>
         <tr><td>IP</td><td><input type=\"text\" name=\"ip\" value=\"$ip\" size=\"20\" maxlength=\"20\"></td></tr>
         <tr><td>$sLocalisation</td>";
   choixSalle($id_localisation, "enable", PARC_AUTRES>="w");
   echo "</tr>

         <tr><td>$slielogiciels</td>
         <td><select name=\"id_logiciel[]\" size=\"10\" multiple>";
   $req = "SELECT * FROM logiciels
                    LEFT JOIN logi_mate ON logiciels.id=logi_mate.id_logiciel";
   if (! (PARC_AUTRES>="w" && $id_structure))
    $req.="         LEFT JOIN materiels ON materiels.id=id_materiel
                    LEFT JOIN localisations ON localisations.id=materiels.id_localisation
                    WHERE (id_structure=\"$id_localisation\" OR id_localisation=\"\"";
   $req.="          ORDER BY type,titre,licence";
   $res = executeRequete($req);
   $mat = fetch_object($res);
   $ancien_id_mat=$mat->id;
   while ($mat)
   {
      $l = "<option value=\"$mat->id\"";
      $l2 = ">$mat->type : $mat->titre ($mat->licence)\n";
      $l1 = "";
      while (($mat) && ($mat->id == $ancien_id_mat))
      {
         if ($mat->id_materiel==$id_materiel) $l1 = " SELECTED";
         $mat = fetch_object($res);
      }
      echo "$l$l1$l2\n";
      $ancien_id_mat=$mat->id;
   }
   echo "</select>\n";
   echo "</td></tr>\n";
	if (defined("FCT_USAGES"))
	{
		echo "<tr><td>$usagesimpossibles</td>
						<td><select name=\"usages[]\" size=10 multiple>";
		if ($usages=="") $usages="0";
		$req = "SELECT * FROM usages WHERE id IN ($usages) ORDER BY 'nom'";
		$res = executeRequete($req);
		while ($usage=fetch_object($res))
				echo "<option value=\"$usage->id\" SELECTED>$usage->nom\n";
		$req = "SELECT * FROM usages WHERE id NOT IN ($usages) ORDER BY 'nom'";
		$res = executeRequete($req);
		while ($usage=fetch_object($res))
				echo "<option value=\"$usage->id\">$usage->nom\n";
		echo "</select>\n";
		echo "</td></tr>\n";
	}

  echo "<tr><td>$spretpossible*</td><td><select name=\"pret_possible\" size=\"1\">
           <option>
           <option value=\"oui\"";
   if ($pret_possible=="oui") echo " SELECTED";
   echo ">$soui
           <option value=\"non\"";
   if ($pret_possible=="non") echo " SELECTED";
   echo ">$snon
         </select></td></tr>\n
      <tr><td>$smaterielreservable*</td><td><select name=\"reservable\" size=\"1\">
           <option>
           <option value=\"oui\"";
   if ($reservable=="oui") echo " SELECTED";
   echo ">$soui
           <option value=\" deux\"";
   if ($reservable==" deux") echo " SELECTED";
   echo ">$sreservablea2
           <option value=\"non\"";
   if ($reservable=="non") echo " SELECTED";
   echo ">$snon
         </select></td></tr>\n
        <tr><td>$sinfoachat</td>
            <td><textarea name=\"info_achat\" rows=\"5\" cols=\"40\">$info_achat</textarea></td>
        </tr>
        <tr><td>$slienimage</td><td><input type=\"text\" name=\"image\" value=\"$image\" size=\"30\" maxlength=\"50\"></td></tr>
        <tr><td colspan=\"2\"><center><input type=\"submit\" name=\"send\" value=\"$envoyer\"></center></td></tr>
        </table>
        </form>\n";
   // Fin du formulaire de saisie.
	 echo cadre_fin(COULEUR_PARC);
   break;

case 3 : // formulaire de suppression
   if (! verifdroits("w"))
     break;
   $contenu="<p align=center>$sattentionsupprmateriel</p>
	 						<p align=center>
							<form action=\"$PHP_SELF\" method=\"POST\" enctype=\"multipart/form-data\">
							<input type=\"hidden\" name=\"operation\" value=31>
							<input type=\"hidden\" name=\"id_materiel\" value=\"$id_materiel\">
							<input type=\"submit\" value=\"$sconfirmer\">
            </form></p>\n";
	echo cadre($ssupprmateriel, $contenu, "align=center", COULEUR_PARC);
   break;

case 31 : // confirmation de suppression
	cadre_debut($ssupprmateriel, "align=center", COULEUR_PARC);
	if (verifdroits("w"))
	{
		echo "<p>$smaterielsupprime</p>\n";
		$req = "DELETE FROM materiels WHERE id=$id_materiel";
		$res = executeRequete($req);

		$req = "DELETE FROM logi_mate WHERE id_materiel=$id_materiel";
		$res = executeRequete($req);
	}
	cadre_fin(COULEUR_PARC);
	break;

case 5 :
  // Affichage de la liste des materiels
	echo cadre_debut($slistemateriels, "align=center", COULEUR_PARC);
  if (PARC<="~")
	{
		echo cadre_fin(COULEUR_PARC);
		break;
	}
  $req = "SELECT *, materiels.id AS id, materiels.description AS description FROM materiels ";
  $req.=" LEFT JOIN localisations ON localisations.id=id_localisation
					LEFT JOIN structures ON structures.id=localisations.id_structure ";
  $req.=" WHERE (0=0) ";
  if (PARC_AUTRES<"r")
    $req.=" AND id_structure=\"$id_structure\" ";
  if ($lieuv>"0" && $lieuv!="*")
    $req.=" AND  ((CONCAT(\"V\",structures.ville)=\"$lieuv\") OR
                  (CONCAT(\"S\",localisations.id_structure)=\"$lieuv\") OR
                  (CONCAT(\"L\",localisations.id)=\"$lieuv\")) ";
	if ($type>"" && $type!="*")
	  $req.=" AND type=\"$type\"";
  $req.=" ORDER BY type, id_localisation, materiel, localisations.description";
  $res = executeRequete($req);

  echo "<table border=1 align=center>
	      <tr><th>$stype";
	echo "</th><th>$sLocalisation</th><th>$sAppellation</th><th>$sCommentaire</th><th>$sActions";
	echo "</th></tr>\n\n";

	echo "<form action=\"$PHP_SELF\" method=\"POST\" enctype=\"multipart/form-data\">
				<input type=\"hidden\" name=\"operation\" value=\"$operation\">
        <tr><td>";
	echo " <select name=\"type\"><option value=\"*\">Tous</option>";
	$reqtype="SELECT type FROM materiels GROUP BY type ORDER BY type";
	$restype=executeRequete($reqtype);
	while ($enrtype=fetch_object($restype))
	{
		echo "<option value=\"$enrtype->type\"";
		if ($enrtype->type==$type) echo " selected";
		echo ">$enrtype->type</option>\n";
	}
	echo "</select>\n";
	echo "</td><td>";
	choix_lieu($lieuv, "lieuv");
	echo "</td><td></td><td></td><td><input type=\"submit\" value=\"$srechercher\">";
	echo "</td></tr>\n</form>\n";
  $type="";
  while ($log = fetch_object($res))
  {
    echo "<tr>\n";
    if ($type!=$log->type)
    {
        echo "<th>$log->type</th>\n";
        $type=$log->type;
    }
    else
    echo "<td></td>\n";
    echo "<td>".localisation($log->id_localisation)."</td>
          <td><b>$log->materiel</b> ($log->specificite)</td>
          <td>$log->description</td>
          <td nowrap><a href=\"$PHP_SELF?id_materiel=$log->id\">$info</a>";
    if ((PARC_MOI>="w" && $log->id_structure==$id_structure) || PARC_AUTRES>="w")
      echo "<a href=\"$PHP_SELF?operation=2&id_materiel=$log->id\">$modifier</a>
            <a href=\"$PHP_SELF?operation=3&id_materiel=$log->id\">$supprimer</a>";
    echo "</td></tr>\n";
  }
  if (PARC_MOI>="w" || PARC_AUTRES>="w")
    echo "<tr><td colspan='4'></td><td><a href=\"$PHP_SELF?operation=1\">$ajouter</a></td></tr>\n";
  echo "</table>\n";
	echo cadre_fin(COULEUR_PARC);
  break;

default : // affichage dtails
	echo cadre_debut($sdetailmateriel, "align=center", COULEUR_PARC);
	if (! verifdroits("r"))
	{
		echo cadre_fin(COULEUR_PARC);
		break;
	}
  // affichage d'un rsum du matriel et des lments attenants
  $req1 = "SELECT * FROM materiels WHERE id=$id_materiel";// AND type='Unit centrale'";
  $res1 = executeRequete($req1);
  if ($materiel=fetch_object($res1))
  {
    echo "<table align=center border=1>
          <tr><td colspan=2 align=center><h3>$materiel->materiel</h3>";
    if ($materiel->specificite!="")
      echo "<p>($materiel->specificite)</p>";
    if ($materiel->ip!="")
      echo "<p>($materiel->ip)</p>";
    echo "</td></tr>\n";
    echo "<tr><td colspan=2>".nl2br($materiel->description)."</td>";
    if (verifdroits("w", FALSE))
        echo "<td><a href=\"materiels.php?operation=2&id_materiel=$materiel->id&$idu\">$modifier</a>
              <a href=\"materiels.php?operation=3&id_materiel=$materiel->id&$idu\">$supprimer</a>\n";
    echo "</tr>\n";

    echo "<tr><td>Rservable</td><td>";
    switch ($materiel->reservable)
    {
    case "oui" : echo "Oui, un seul utilisateur."; break;
    case "non" : echo "Non"; break;
    case " deux" : echo "Oui, un ou deux utilisateurs"; break;
    }
    echo "</td></tr>\n";
    if ($materiel->localisation!="")
        echo "<tr><td>Localisation</td><td>$materiel->localisation</td></tr>\n";
    if ($materiel->materiel!="")
    {
        echo "<tr><td colspan=2 align=center><b>Liste des lments attachs</b></td></tr>\n";
        $res2 = recherche ("materiels", "materiel", $materiel->materiel, "type");
        while ($materiel2 = fetch_object($res2))
        {
          echo "<tr><td>$materiel2->type</a>";
          if ($materiel2->specificite!="")
              echo " (".$materiel2->specificite.")";
          echo "</td><td>".nl2br($materiel2->description)."</td>";
					echo "<td><a href=\"materiels.php?id_materiel=$materiel2->id\">$info</a> ";
          if (verifdroits("w", FALSE))
            echo "<a href=\"materiels.php?operation=2&id_materiel=$materiel2->id\">$modifier</a>
            			<a href=\"materiels.php?operation=3&id_materiel=$materiel2->id\">$supprimer</a>\n";
					echo "</td></tr>\n";
        }
    // affichage des logiciels attachs  la machine
        $res2 = recherche ("materiels", "materiel", $materiel->materiel, "type");
        echo "<tr><td colspan=2 align=center><b>Liste des logiciels attachs  ce matriel</b></td></tr>\n";
        while ($materiel2 = fetch_object($res2))
        {
          $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel2->id ORDER BY type, titre, licence";
          $res3 = executeRequete($req3);
          while ($logiciel=fetch_object($res3)) // il y a des logiciels attachs au matriel $id_materiel
          {
              echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
              //if ($logiciel->licence!="")
              //  echo "<br>$logiciel->licence";
              if ($logiciel->commentaire!="")
                echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
              echo "</td>";
              echo "<td><a href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
              echo "</tr>\n";
          }
        }
    }
    else // affichage pour le seul matriel slectiionn s'il n'a pas de nom
    {
        $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel->id";
        $res3 = executeRequete($req3);
        while ($logiciel=fetch_object($res3)) // il y a des logiciels attachs au matriel $id_materiel
        {
          echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
          if ($logiciel->commentaire!="")
            echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
          echo "</td>";
          echo "<td><a href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
          echo "</tr>\n";
        }
    }
    // affichage des usages possibles sur cet ordinateur si c'est une UC.
    if ($materiel->type="Unit centrale" && defined("FCT_USAGES"))
    {
      if ($materiel->usages=="") $materiel->usages="0";
        $req4 = "SELECT * FROM usages WHERE id NOT IN ($materiel->usages) ORDER BY 'nom'";
        $res4 = executeRequete($req4);
        echo "<tr><td colspan=2 align=center><b>Liste des usages possibles</b></td></tr>\n<tr><td colspan=2>";
        while ($usage = fetch_object($res4)) // il y a des logiciels attachs au matriel $id_materiel
          echo "$usage->nom, ";
        echo "</td></tr>\n";
    }
    echo "</table>\n";
  }
	echo cadre_fin(COULEUR_PARC);

} // switch

if ($operation || $id_materiel)
{
  echo "<hr>\n";
	if (PARC_AUTRES>="r")
		echo "<a href=\"logiciels.php?operation=5\">$svoirlistelogiciels</a>
				- <a href=\"materiels.php?operation=5\">$svoirlistemateriels</a>\n";
	elseif (PARC_MOI>="r")
		echo "<a href=\"logiciels.php?operation=5\">$svoirmalistelogiciels</a> -
				<a href=\"materiels.php?operation=5\">$svoirmalistemateriels</a>\n";
}

require("basdepage.inc.php");
echo "</body></html>\n";
require("footer.inc.php");
?>

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us