/[dolibarr]/dolibarr/htdocs/societe.php
ViewVC logotype

Diff of /dolibarr/htdocs/societe.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43 by tipaul, Mon Oct 24 08:59:37 2005 UTC revision 1.44 by eldy, Tue Oct 25 19:45:59 2005 UTC
# Line 39  $langs->load("customers"); Line 39  $langs->load("customers");
39  $langs->load("suppliers");  $langs->load("suppliers");
40    
41    
42  /*  // Sécurité accés client
43   * Sécurité accés client  $socid=0;
  */  
   
44  if ($user->societe_id > 0)  if ($user->societe_id > 0)
45  {  {
46    $action = '';      $action = '';
47    $socid = $user->societe_id;      $socid = $user->societe_id;
48  }  }
49    
50    
 // llxHeader();  
   
51  $search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];  $search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];
52  $search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_ville"];  $search_ville=isset($_GET["search_ville"])?$_GET["search_ville"]:$_POST["search_ville"];
53    
# Line 71  $pagenext = $page + 1; Line 67  $pagenext = $page + 1;
67    
68    
69  /*  /*
70   * Recherche   * Actions
71   *   *
72   */   */
73    
74    // Recherche
75  $mode=isset($_GET["mode"])?$_GET["mode"]:$_POST["mode"];  $mode=isset($_GET["mode"])?$_GET["mode"]:$_POST["mode"];
76  $modesearch=isset($_GET["mode-search"])?$_GET["mode-search"]:$_POST["mode-search"];  $modesearch=isset($_GET["mode-search"])?$_GET["mode-search"]:$_POST["mode-search"];
77    
78  if ($mode == 'search')  if ($mode == 'search')
79  {  {
80    $_POST["search_nom"]="$socname";      $_POST["search_nom"]="$socname";
81    
82    $sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";      $sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";
83    $sql .= " WHERE s.nom like '%".$socname."%'";      $sql .= " WHERE s.nom like '%".$socname."%'";
84      
85    $result=$db->query($sql);      $result=$db->query($sql);
86    if ($result)      if ($result)
87      {      {
88        if ($db->num_rows($result) == 1)          if ($db->num_rows($result) == 1)
89          {          {
90            $obj = $db->fetch_object($result);              $obj = $db->fetch_object($result);
91            $socid = $obj->idp;              $socid = $obj->idp;
92            print header("location: soc.php?socid=$socid");              header("location: soc.php?socid=$socid");
93            exit;              exit;
94          }          }
95        $db->free($result);          $db->free($result);
96      }      }
97        // Sécurité accès client
98    /*      if ($user->societe_id > 0)
    * Sécurité accés client  
    */  
   if ($user->societe_id > 0)  
99      {      {
100        $action = '';          $action = '';
101        $socid = $user->societe_id;          $socid = $user->societe_id;
102      }        }
103  }  }
104    
105    
106  llxHeader();  llxHeader();
107    
108  // As-t-on cliqué sur purge des criètres de recherche  // As-t-on cliqué sur purge des criètres de recherche
# Line 126  if (isset($_POST["button_removefilter_x" Line 122  if (isset($_POST["button_removefilter_x"
122  $title=$langs->trans("ListOfCompanies");  $title=$langs->trans("ListOfCompanies");
123    
124  $sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea,  st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur";  $sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea,  st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur";
125  $sql .= ", s.siren";  $sql.= ", s.siren";
126  $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";  $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
127  $sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";  $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
128  $sql .= " WHERE s.fk_stcomm = st.id";  $sql.= " WHERE s.fk_stcomm = st.id";
   
129  if ($user->societe_id > 0)  if ($user->societe_id > 0)
130  {  {
131    $sql .= " AND s.idp = " . $user->societe_id;    $sql .= " AND s.idp = " . $user->societe_id;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26