[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-ocs/sources/www/ -> index.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 10/21/2005
  12  error_reporting(E_ALL & ~E_NOTICE);
  13  include_once ('req.class.php');
  14  
  15  
  16  // First installation checking
  17  if((!function_exists('session_start')) || (!function_exists('mysql_connect'))) {
  18  //if( (!$fconf=@fopen("dbconfig.inc.php","r")) || (!function_exists('session_start')) || (!function_exists('mysql_connect'))) {
  19      include ('install.php');
  20      die();
  21  }
  22  //else
  23  //    fclose($fconf);
  24  //
  25  @session_start();
  26  $showingReq = false;
  27  foreach( $_GET as $key=>$val) {
  28      $_GET["key"] = urldecode($val);
  29      if( $key == "lareq" ) {
  30          $showingReq = true;
  31      }
  32  }
  33  
  34  if( isset($_GET["pcparpage"]) ) {
  35      $_SESSION["pcparpage"] = $_GET["pcparpage"];
  36      setcookie( "PcParPage", $_GET["pcparpage"], time() + 3600 * 24 * 15 );
  37  }
  38  
  39  include  ('header.php');
  40  include  ('donnees.php');
  41  
  42  $pcparpage = $_SESSION["pcparpage"];
  43  
  44  if( ! $_SESSION["pcparpage"] ) {
  45      if( isset($_COOKIE["PcParPage"]) )
  46          $pcparpage = $_COOKIE["PcParPage"];
  47      else    
  48          $pcparpage = PC_PAR_PAGE;
  49          
  50      $_SESSION["pcparpage"] = $pcparpage;    
  51  }
  52  
  53  if(isset($_GET["lareq"]))  {
  54      //unset( $_SESSION["c"] );
  55      $_SESSION["lareqpages"] = stripslashes($_GET["lareq"]);
  56  }
  57  else if(isset($_SESSION["lareqpages"]))
  58      $_GET["lareq"] = $_SESSION["lareqpages"] ;
  59      
  60  unset($_SESSION["user"],$_SESSION["add"],$_SESSION["suppr"]);
  61  
  62  if(!isset($_SESSION["pageCur"]))
  63      $_SESSION["pageCur"] = 1;
  64      
  65  if($_GET["page"])
  66  {
  67      if($_GET["page"]==-1)
  68          $_SESSION["pageCur"] -= 1;
  69      else if($_GET["page"]==-2)
  70          $_SESSION["pageCur"] += 1;
  71      else 
  72          $_SESSION["pageCur"] = $_GET["page"];        
  73          
  74      if($_SESSION["pageCur"]<=0)
  75          $_SESSION["pageCur"]=1;
  76  }
  77  else if($_GET["multi"]!=6)
  78      $_SESSION["pageCur"] = 1;
  79  
  80  if($_GET["supp"] && $_GET["multi"] != 8) {
  81          deleteDid($_GET["supp"]);
  82  }
  83  if( $_GET["suppnet"] ) {
  84      deleteNet($_GET["suppnet"]);
  85  }
  86  
  87  if( isset($_GET["cuaff"])) {
  88          $_GET["lareq"]=$l->g(182);
  89          $_POST["option0"]=$_GET["cuaff"];
  90          $_POST["sub"]=true;
  91          $_SESSION["lareq"]=$_GET["lareq"];
  92  }
  93  
  94  if( !isset($_GET["popup"] )) {
  95  
  96  echo "<table width='100%' border=0><tr><td>";
  97  if(! isset($_SESSION["first"])||!$_GET["lareq"]) {
  98      $_GET["lareq"] = $l->g(2);
  99      $_SESSION["first"] = true;
 100  }
 101      $i=0;
 102      $selectionne=0;
 103      foreach($requetes as $lareq)
 104      {                            
 105          $selected=""; 
 106  
 107          if($lareq->label == $l->g(182)) 
 108              continue;
 109          $countHl++;
 110          echo "<a href=index.php?lareq=".urlencode($lareq->label)."><img title=\"".htmlspecialchars($lareq->label)."\" src='image/".$lareq->pics[(!isset($_GET["multi"])&&$_GET["lareq"]==$lareq->label?1:0)]."'></a>";
 111      }    
 112      
 113      $countHl++;
 114      //multicrit
 115      echo "<a href=index.php?multi=1><img title=\"".htmlspecialchars($l->g(9))."\" src='image/".($_GET["multi"]==1||(!isset($_GET["multi"])&&$_GET["lareq"]==$l->g(9))?"recherche_a.png":"recherche.png")."'></a>";
 116      $countHl++;
 117      /*if(!isset($_GET["lareq"]) || ( isset( $_GET["multi"] ) && $_GET["multi"]!=1 && $_GET["multi"]!=2&& $_GET["multi"]!=15) || isset($_GET["cuaff"]) || isset($_GET["lang"]) )
 118          echo "<option".($countHl%2==1?" class='hi'":""). " selected>".$l->g(32)."</option>\n";*/
 119      /*if( @stat("composants.php"))
 120          echo "<option".(!isset($_GET["multi"])&&$_GET["lareq"]==$l->g(371)?" selected":"").">".$l->g(371)."</option>\n";*/
 121  
 122      
 123      echo "</td><td>";    
 124  
 125      echo "<table BORDER='0' ALIGN = 'right' CELLPADDING='0' BGCOLOR='#FFFFFF' BORDERCOLOR='#9894B5'>";
 126      echo "<tr height=20px  bgcolor='white'>";
 127      flush();
 128      if($_SESSION["lvluser"]==SADMIN) {
 129  ?>
 130  <script language='javascript'>
 131      
 132  	function montre(id) {
 133          
 134          var d = document.getElementById(id);
 135              for (var i = 1; i<=10; i++) {
 136                  if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
 137              }
 138          if (d) {d.style.display='block';}
 139          }
 140  </script>
 141  
 142      <td onmouseover="javascript:montre('smenu1');">
 143      <dl id="menu">
 144          <dt onmouseover="javascript:montre('smenu1');">
 145          <a href='javascript:void(0);'>
 146      <img src='image/pack<?
 147      $packAct = array(22,23,24,27,20,21,26);
 148      if( in_array($_GET["multi"],$packAct) )
 149          echo "_a";?>.png'></a></dt>
 150              <dd id="smenu1" onmouseover="javascript:montre('smenu1');" onmouseout="javascript:montre();">
 151                  <ul>
 152                      <li><b><? echo $l->g(512); ?></b></li>
 153                      
 154                      <li><a href="index.php?multi=20"><? echo $l->g(513); ?></a></li>
 155                      <li><a href="index.php?multi=21"><? echo $l->g(514); ?></a></li>
 156                      <li><a href="index.php?multi=26"><? echo $l->g(515); ?></a></li>
 157                  </ul>
 158              </dd>
 159      </dl>
 160      </td>
 161  <script language='javascript'>montre();</script>    
 162  <?
 163      
 164              if( @stat("/var/www/se3/ocsreports/ipdiscover.php"))
 165                  tab($l->g(174), 3);
 166   
 167              if( @stat("dico.php"))
 168                  tab($l->g(380),14);
 169              
 170              tab($l->g(107), 4);
 171              tab($l->g(211), 5);
 172          
 173          tab($l->g(225), 9);
 174          tab($l->g(175), 6);
 175          tab("Label", 12);
 176  //        tab($l->g(235), 10);
 177          tab($l->g(287), 13);
 178      }    
 179  }    
 180  
 181      echo "</tr></table>";
 182      echo "</td></tr></table>";
 183      flush();
 184      
 185      if(isset($_POST["subPass"])) {
 186          if(!$_POST["pass1"] || !$_POST["pass2"]) {
 187              echo "<br><center><font color=red><b>".$l->g(239)."</b></font></center>";
 188          }
 189          else if($_POST["pass1"] != $_POST["pass2"]) {
 190              echo "<br><center><font color=red><b>".$l->g(240)."</b></font></center>";
 191          }
 192          else {
 193              echo "<br><center><font color=red><b>".$l->g(241)."</b></font></center>";
 194              // DL 25/08/2005
 195              // When changing password, always use MD5 encrypted password
 196              mysql_query("UPDATE operators SET passwd='".md5( $_POST["pass1"])."' WHERE ID='".$_SESSION["loggeduser"]."'",$_SESSION["writeServer"]);
 197          }
 198      }
 199      
 200      if( $_POST["lareq"] == $l->g(9) && !$_GET["multi"])
 201          $_GET["multi"] = 1;
 202      
 203      if($_POST["lareq"] == $l->g(371) && !$_GET["multi"])
 204          $_GET["multi"] = 15;
 205          
 206      echo "<center><span id='wait'><h3><font color=red>".$l->g(332)."</font></h3></span></center>";
 207      flush();
 208      switch($_GET["multi"]) {
 209          case 1: include  ('multicritere.php');    break;
 210          case 3: include  ('ipdiscover.php');    break;
 211          case 4:    include  ('confiGale.php');    break;
 212          case 5:    include  ('reqRegistre.php');    break;
 213          case 6:    include  ('doublons.php');    break;
 214          case 9:    include  ('donAdmini.php');    break;
 215          case 10: include  ('users.php');    break;
 216          case 11: include  ('pass.php');    break;
 217          case 12: include  ('label.php');    break;
 218          case 13: include  ('local.php');    break;
 219          case 14: include  ('dico.php');    break;
 220          case 15: include ('composants.php'); break;
 221          case 20: include  ('tele_package.php'); break; 
 222          case 21: include  ('tele_activate.php'); break; 
 223          case 22: include  ('opt_frequency.php'); break; 
 224          case 23: include  ('opt_ipdiscover.php'); break; 
 225          case 24: include  ('tele_affect.php'); break; 
 226          case 25: include  ('tele_stats.php'); break;
 227          case 26: include  ('tele_actives.php'); break;
 228          case 27: include  ('opt_suppr.php'); break; 
 229           default: include  ('resultats.php');        
 230       }
 231  
 232  if( !isset($_GET["popup"] ))
 233      include  ('footer.php');
 234      
 235  echo "<script language='javascript'>wait(0);</script>";
 236      
 237  function tab( $label, $multi, $lien=null ) {
 238      global $l, $_GET, $showingReq;
 239      if( isset($lien))
 240          $llink = $lien;
 241      else
 242          $llink = "?multi=$multi";
 243      
 244      switch($multi) {
 245          case 10: $img = "utilisateurs"; break;
 246          case 2: $img = "codes";    break;
 247           case 3: $img = "securite";    break;
 248           case 4:    $img = "configuration";    break;
 249           case 5:    $img = "regconfig";    break;
 250           case 6:    $img = "doublons";    break;
 251           case 8:    $img = "agent";    break;
 252           case 9:    $img = "administration"; break;
 253          case 13: $img = "local";    break;        
 254          case 12: $img = "label";    break;    
 255          default: if( $label==$l->g(15) )
 256                      $img = "utilisateurs";
 257                  else if( $label==$l->g(16) )
 258                      $img = "codes";
 259                  else
 260                      $img = "dictionnaire";
 261      }
 262      if( !$showingReq && ($_GET["multi"] == $multi && $multi != "") ) {
 263          $img .= "_a";
 264      }
 265                  
 266      echo "<td onmouseover=\"javascript:montre();\"><a href='$llink'><img title=\"".htmlspecialchars($label)."\" src='image/$img.png'></a></td>";    
 267  }
 268  
 269  ?>


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