[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-ocs/sources/www/ -> users.php (source)

   1  <?
   2  //====================================================================================
   3  // OCS INVENTORY REPORTS
   4  // Copyleft Pierre LEMMET 2005
   5  // Web: http://ocsinventory.sourceforge.net
   6  //
   7  // This code is open source and may be copied and modified as long as the source
   8  // code is always made freely available.
   9  // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
  10  //====================================================================================
  11  //Modified on 7/7/2005
  12  include  ('fichierConf.class.php');
  13  
  14  include ('req.class.php');
  15  if($_GET["suppAcc"]) {
  16      dbconnect();
  17      @mysql_query("DELETE FROM operators WHERE id='".$_GET["suppAcc"]."'");    
  18      echo "<br><br><center><font face='Verdana' size=-1 color='red'><b>". $_GET["suppAcc"] ."</b> ".$l->g(245)." </font></center><br>";
  19  }
  20  
  21  if($_POST["nom"])
  22  {
  23      switch($_POST["type"]) {
  24          case $l->g(242): $suff = "1"; break;
  25          case $l->g(243): $suff = "2"; break;
  26      }
  27      
  28      $query = "INSERT INTO operators(id,passwd,accesslvl) VALUES('".$_POST["nom"]."','".md5( $_POST["pass"])."', '$suff')";
  29      @mysql_query($query);
  30      echo "<br><br><center><font face='Verdana' size=-1 color='red'><b>". $_POST["nom"] ."</b> ".$l->g(234)." </font></center><br>";
  31  }//fin if    
  32  ?>
  33              <script language=javascript>
  34  				function confirme(did)
  35                  {
  36                      if(confirm("<?echo $l->g(246)?> "+did+" ?"))
  37                          window.location="index.php?multi=<?=$_GET["multi"]?>&c=<?=($_SESSION["c"]?$_GET["c"]:2)?>&a=<?=$_GET["a"]?>&page=<?=$_GET["page"]?>&suppAcc="+did;
  38                  }
  39              </script>
  40  <?
  41  printEntete($l->g(244));        
  42  echo "<br>
  43           <form name='ajouter_reg' method='POST' action='index.php?multi=10'>
  44      <center>
  45      <table width='60%'>
  46      <tr>
  47          <td align='right' width='50%'>
  48              <font face='Verdana' size='-1'>".$l->g(49)." :&nbsp;&nbsp;&nbsp;&nbsp;</font>
  49          </td>
  50          <td width='50%' align='left'><input size=40 name='nom'>
  51          </td>
  52      </tr>
  53      <tr>
  54          <td align='right' width='50%'>
  55              <font face='Verdana' size='-1'>".$l->g(236)." :&nbsp;&nbsp;&nbsp;&nbsp;</font>
  56          </td>
  57          <td width='50%' align='left'><input size=40 type='password' name='pass'>
  58          </td>
  59      </tr>
  60      <tr>
  61          <td align='right' width='50%'>
  62              <font face='Verdana' size='-1'>".$l->g(66).":&nbsp;&nbsp;&nbsp;&nbsp;</font>
  63          </td>
  64          <td>
  65              <select name='type'>
  66                  <option>".$l->g(242)."</option>
  67                  <option>".$l->g(243)."</option>                
  68              </select>
  69          </td>
  70      </tr>
  71      <tr><td>&nbsp;</td></tr>
  72          <tr>
  73          <td colspan='2' align='center'>
  74              <input class='bouton' name='enre' type='submit' value=".$l->g(114)."> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  75          </td>
  76      </tr>
  77      
  78      </table></center></form><br>";
  79          
  80      printEntete($l->g(233));
  81      echo "<br>";
  82      
  83      $reqAc = mysql_query("SELECT id,accesslvl FROM operators ORDER BY accesslvl,id ASC") or die(mysql_error());
  84      echo "<table BORDER='0' WIDTH = '50%' ALIGN = 'Center' CELLPADDING='0' BGCOLOR='#C7D9F5' BORDERCOLOR='#9894B5'>";
  85      echo "<tr><td align='center'><FONT FACE='tahoma' SIZE=2><b>".$l->g(49)."</b></font></td><td align='center'><FONT FACE='tahoma' SIZE=2><b>".$l->g(66)."</b></font></td></tr>";        
  86      while($row=mysql_fetch_array($reqAc)) {            
  87          $x++;
  88          echo "<TR height=20px bgcolor='". ($x%2==0 ? "#FFFFFF" : "#F2F2F2") ."'>";    // on alterne les couleurs de ligne            
  89          echo "<td align=center><FONT FACE='tahoma' SIZE=2>".$row["id"]."</font></td><td align=center><FONT FACE='tahoma' SIZE=2>".($row["accesslvl"]==1?$l->g(242):$l->g(243))."</font></td><td align=center>
  90          <a href=# OnClick='confirme(\"".$row["id"]."\");'><img src=image/supp.png></a></td></tr>";
  91          
  92      }
  93      echo "</table><br>";
  94  
  95  ?>
  96  


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1