Statistiques
| Branche: | Révision :

root / src / headers.php @ d072e29c

Historique | Voir | Annoter | Télécharger (8,13 ko)

1 1a2be799 Florent Chuffart
<html>
2 1a2be799 Florent Chuffart
<head>
3 1a2be799 Florent Chuffart
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4 1a2be799 Florent Chuffart
<style type="text/css">
5 1a2be799 Florent Chuffart
6 1a2be799 Florent Chuffart
body {
7 1a2be799 Florent Chuffart
  font-family:  sans-serif;
8 1a2be799 Florent Chuffart
  background-color: #FFF;
9 1a2be799 Florent Chuffart
  color: #000;
10 1a2be799 Florent Chuffart
}
11 1a2be799 Florent Chuffart
12 1a2be799 Florent Chuffart
#onglets
13 1a2be799 Florent Chuffart
{
14 1a2be799 Florent Chuffart
  list-style-type : none;
15 1a2be799 Florent Chuffart
  padding-bottom : 30px; /* à modifier suivant la taille de la police ET de la hauteur de l'onglet dans #onglets li */
16 1a2be799 Florent Chuffart
  border-bottom : 1px solid #000;
17 1a2be799 Florent Chuffart
  margin-left : 0;
18 1a2be799 Florent Chuffart
}
19 1a2be799 Florent Chuffart
20 1a2be799 Florent Chuffart
#onglets li
21 1a2be799 Florent Chuffart
{
22 1a2be799 Florent Chuffart
    float : left;
23 1a2be799 Florent Chuffart
    height : 27px; /* à modifier suivant la taille de la police pour centrer le texte dans l'onglet */
24 1a2be799 Florent Chuffart
    margin : 2px 2px 0 2px !important;  /* Pour les navigateurs autre que IE */
25 1a2be799 Florent Chuffart
    margin : 1px 2px 0 2px;  /* Pour IE  */
26 1a2be799 Florent Chuffart
    border : 1px solid #000;
27 1a2be799 Florent Chuffart
    background-color: #DDD;
28 1a2be799 Florent Chuffart
}
29 1a2be799 Florent Chuffart
30 1a2be799 Florent Chuffart
#onglets li.active
31 1a2be799 Florent Chuffart
{
32 1a2be799 Florent Chuffart
    border-bottom: 1px solid #fff;
33 1a2be799 Florent Chuffart
    background-color: #fff;
34 1a2be799 Florent Chuffart
}
35 1a2be799 Florent Chuffart
36 1a2be799 Florent Chuffart
#onglets a
37 1a2be799 Florent Chuffart
{
38 1a2be799 Florent Chuffart
    display : block;
39 1a2be799 Florent Chuffart
    color : #000;
40 1a2be799 Florent Chuffart
    text-decoration : none;
41 1a2be799 Florent Chuffart
    padding : 4px;
42 1a2be799 Florent Chuffart
}
43 1a2be799 Florent Chuffart
44 1a2be799 Florent Chuffart
#onglets a:hover
45 1a2be799 Florent Chuffart
{
46 1a2be799 Florent Chuffart
    background : #fff;
47 1a2be799 Florent Chuffart
}
48 1a2be799 Florent Chuffart
49 1a2be799 Florent Chuffart
input.btn{ color: #050; font: bold 84%'trebuchet ms',helvetica,sans-serif; background-color: #fed;}
50 1a2be799 Florent Chuffart
input.btn2{ color: #050; font: bold 84%'trebuchet ms',helvetica,sans-serif; background-color: #CC6633;}
51 1a2be799 Florent Chuffart
52 1a2be799 Florent Chuffart
hr.pme-hr                    { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
53 1a2be799 Florent Chuffart
table.pme-main       { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
54 1a2be799 Florent Chuffart
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
55 1a2be799 Florent Chuffart
td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; }
56 1a2be799 Florent Chuffart
th.pme-header        { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
57 1a2be799 Florent Chuffart
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0,
58 1a2be799 Florent Chuffart
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1,
59 1a2be799 Florent Chuffart
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; }
60 1a2be799 Florent Chuffart
td.pme-buttons { text-align: left;   }
61 1a2be799 Florent Chuffart
td.pme-message { text-align: center; }
62 1a2be799 Florent Chuffart
td.pme-stats   { text-align: right;  }
63 1a2be799 Florent Chuffart
</style>
64 1a2be799 Florent Chuffart
65 1a2be799 Florent Chuffart
</head>
66 1a2be799 Florent Chuffart
67 1a2be799 Florent Chuffart
<body>
68 1a2be799 Florent Chuffart
69 1a2be799 Florent Chuffart
<h3>GY Lab Stocks</h3>
70 1a2be799 Florent Chuffart
71 1a2be799 Florent Chuffart
<div id="menu">
72 1a2be799 Florent Chuffart
  <ul id="onglets">
73 1a2be799 Florent Chuffart
    <li id="home"><a href="home.php"> Home </a></li>
74 1a2be799 Florent Chuffart
    <li id="plasmids"><a href="plasmids.php"> Plasmids </a></li>
75 1a2be799 Florent Chuffart
    <li id="pl_features"><a href="pl_features.php"> Plasmids Features </a></li>
76 1a2be799 Florent Chuffart
    <li id="strains"><a href="strains.php"> Strains </a></li>
77 1a2be799 Florent Chuffart
    <li id="oligos"><a href="oligos.php"> Oligos </a></li>
78 1a2be799 Florent Chuffart
    <li id="wwwblast"><a href="wwwblast.php"> wwwBlast </a></li>
79 1a2be799 Florent Chuffart
    <li id="antibodies"><a href="antibodies.php"> Antibodies </a></li>
80 1a2be799 Florent Chuffart
    <li id="collections"><a href="collections.php"> Collections </a></li>
81 d072e29c Florent Chuffart
    <li id="pip_stock"><a href="pip_stock.php"> Pipets </a></li>
82 d072e29c Florent Chuffart
    <li id="pip_history"><a href="pip_history.php"> Pipet History </a></li>
83 1a2be799 Florent Chuffart
    <li id="notebooks"><a href="notebooks.php"> Lab's Notebooks </a></li>
84 1a2be799 Florent Chuffart
    <li id="logout"><a href="logout.php"> Logout </a></li>
85 1a2be799 Florent Chuffart
    <li id="admin"><a href="admin.php"> Admin </a></li>
86 1a2be799 Florent Chuffart
  </ul>
87 1a2be799 Florent Chuffart
</div>
88 1a2be799 Florent Chuffart
</div>
89 1a2be799 Florent Chuffart
90 1a2be799 Florent Chuffart
<div id="divDebug" style="font-weight:normal; position:absolute; background-color:#EEEEEE; font-size:xx-small; top:0ex; width:38ex; right:0ex;">toto</div>
91 1a2be799 Florent Chuffart
92 1a2be799 Florent Chuffart
<script type="text/javascript"> 
93 1a2be799 Florent Chuffart
id=window.location.href.split("/").pop().split(".")[0];
94 1a2be799 Florent Chuffart
document.getElementById("divDebug").innerHTML=id;
95 1a2be799 Florent Chuffart
document.getElementById(id).setAttribute("class","active");
96 1a2be799 Florent Chuffart
</script>
97 1a2be799 Florent Chuffart
98 1a2be799 Florent Chuffart
99 d072e29c Florent Chuffart
100 1a2be799 Florent Chuffart
<?php
101 1a2be799 Florent Chuffart
102 d072e29c Florent Chuffart
$to_be_post_list_content = "";
103 d072e29c Florent Chuffart
$to_be_pre_list_content = "";
104 d072e29c Florent Chuffart
// print($_SERVER["SCRIPT_FILENAME"]);
105 d072e29c Florent Chuffart
106 d072e29c Florent Chuffart
107 d072e29c Florent Chuffart
$tb = array_shift(split("\.php", array_pop(split("/", $_SERVER["SCRIPT_FILENAME"]))));
108 1a2be799 Florent Chuffart
/*************************/
109 1a2be799 Florent Chuffart
//
110 1a2be799 Florent Chuffart
// Connect to DB and 
111 1a2be799 Florent Chuffart
// handle session/authentification
112 1a2be799 Florent Chuffart
//
113 1a2be799 Florent Chuffart
/*************************/
114 1a2be799 Florent Chuffart
115 1a2be799 Florent Chuffart
require_once ("connect_entry.php");
116 d072e29c Florent Chuffart
require_once ("lib/session.lib.php");
117 1a2be799 Florent Chuffart
// connect to DB
118 1a2be799 Florent Chuffart
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE);
119 1a2be799 Florent Chuffart
if (!$connexion)
120 1a2be799 Florent Chuffart
{
121 1a2be799 Florent Chuffart
 echo "Sorry, connexion to " . SERVEUR . " failed\n";
122 1a2be799 Florent Chuffart
 exit;
123 1a2be799 Florent Chuffart
}
124 1a2be799 Florent Chuffart
if (!mysql_select_db (BASE, $connexion))
125 1a2be799 Florent Chuffart
{
126 1a2be799 Florent Chuffart
 echo "Sorry, connexion to database " . BASE . " failed\n";
127 1a2be799 Florent Chuffart
 exit;
128 1a2be799 Florent Chuffart
}
129 d072e29c Florent Chuffart
130 d072e29c Florent Chuffart
if (!(in_array($tb, array("home", "")))) {
131 d072e29c Florent Chuffart
  // authentification
132 d072e29c Florent Chuffart
  CleanOldSessions($connexion);
133 d072e29c Florent Chuffart
  $session = control_access ($tb.".php", $_POST, session_id(), $connexion);
134 d072e29c Florent Chuffart
  if (!is_object($session)) {
135 d072e29c Florent Chuffart
          exit;
136 d072e29c Florent Chuffart
  }
137 d072e29c Florent Chuffart
138 d072e29c Florent Chuffart
  // According to login:
139 d072e29c Florent Chuffart
  // Define priviledge options
140 d072e29c Florent Chuffart
  // to pass to phpMyEdit
141 d072e29c Florent Chuffart
  //
142 d072e29c Florent Chuffart
  //check that visitor is allowed to use this table
143 d072e29c Florent Chuffart
  if ($tb == "admin" && $session->mode != "super") {
144 d072e29c Florent Chuffart
    echo "<p>Sorry, your session is not granted access to admin panel. Please logout and try again with appropriate login...</p>";
145 d072e29c Florent Chuffart
    exit;
146 d072e29c Florent Chuffart
  } else if ($session->target_table != $tb && $session->target_table != "all") {
147 d072e29c Florent Chuffart
    echo "<p>Sorry, your session is not granted access to table <B> $tb </B> in <B>$session->mode</B> mode (login must be <b>$session->mode$tb</b>). Please logout and try again with appropriate login...</p>";
148 d072e29c Florent Chuffart
    exit;
149 d072e29c Florent Chuffart
  }
150 d072e29c Florent Chuffart
  //define priv options and display warning accordingly
151 d072e29c Florent Chuffart
  if ($session->login == "superuser"){
152 d072e29c Florent Chuffart
          $privopt = 'ACPVDF';
153 d072e29c Florent Chuffart
          $colorband = "red";
154 d072e29c Florent Chuffart
          $messageband = '<blink>WARNING</bink>: You are in <I><B> SUPERUSER </I></B> mode, at your own risk.';
155 d072e29c Florent Chuffart
  } else if ($session->mode == "view"){
156 d072e29c Florent Chuffart
          $privopt = 'VF';
157 d072e29c Florent Chuffart
          $colorband = "#00ff00";
158 d072e29c Florent Chuffart
          $messageband = "You are safely in VIEW mode";
159 d072e29c Florent Chuffart
  } else if ($session->mode == "add"){
160 d072e29c Florent Chuffart
          $privopt = 'APVF';
161 d072e29c Florent Chuffart
          $colorband = "orange";
162 d072e29c Florent Chuffart
          $messageband = 'You are in <I><B> ADD </I></B> mode, please logout after you additions';
163 d072e29c Florent Chuffart
  } else if ($session->mode == "edit"){
164 d072e29c Florent Chuffart
          $privopt = 'ACPVDF';
165 d072e29c Florent Chuffart
          $colorband = "rgb(250,0,255)";
166 d072e29c Florent Chuffart
          $messageband = 'IMPORTANT: You are in <I><B> EDIT </I></B> mode, please logout after editing.';
167 d072e29c Florent Chuffart
  } else{
168 d072e29c Florent Chuffart
          $privopt = '';
169 d072e29c Florent Chuffart
          $colorband = "grey";
170 d072e29c Florent Chuffart
  }
171 d072e29c Florent Chuffart
  echo '<style type="text/css"> ';
172 d072e29c Florent Chuffart
  echo        "h4 {background-color: $colorband }";
173 d072e29c Florent Chuffart
  echo '</style>';
174 d072e29c Florent Chuffart
  echo "<h4> $messageband </h4>";
175 d072e29c Florent Chuffart
  echo "<HR>";
176 1a2be799 Florent Chuffart
}
177 d072e29c Florent Chuffart
// Fix a problem displaying
178 d072e29c Florent Chuffart
// symbols (such as delta)
179 d072e29c Florent Chuffart
mysql_query("SET NAMES 'UTF8'", $connexion);
180 d072e29c Florent Chuffart
181 d072e29c Florent Chuffart
// // Include My own MVC (FCh.)
182 d072e29c Florent Chuffart
// $mvc_filename = $tb . ".MVC.php";
183 d072e29c Florent Chuffart
// if (file_exists($mvc_filename)) {
184 d072e29c Florent Chuffart
//   require($mvc_filename);
185 d072e29c Florent Chuffart
// } 
186 d072e29c Florent Chuffart
187 d072e29c Florent Chuffart
// Number of records to display on the screen
188 d072e29c Florent Chuffart
// Value of -1 lists all records in a table
189 d072e29c Florent Chuffart
$opts['inc'] = 15;
190 d072e29c Florent Chuffart
191 d072e29c Florent Chuffart
// Number of lines to display on multiple selection filters
192 d072e29c Florent Chuffart
$opts['multiple'] = '4';
193 d072e29c Florent Chuffart
194 d072e29c Florent Chuffart
// Navigation style: B - buttons (default), T - text links, G - graphic links
195 d072e29c Florent Chuffart
// Buttons position: U - up, D - down (default)
196 d072e29c Florent Chuffart
$opts['navigation'] = 'UDBG';
197 d072e29c Florent Chuffart
198 d072e29c Florent Chuffart
// Display special page elements
199 d072e29c Florent Chuffart
$opts['display'] = array(
200 d072e29c Florent Chuffart
        'form'  => true,
201 d072e29c Florent Chuffart
        'query' => true,
202 d072e29c Florent Chuffart
        'sort'  => true,
203 d072e29c Florent Chuffart
        'time'  => true,
204 d072e29c Florent Chuffart
        'tabs'  => true
205 d072e29c Florent Chuffart
);
206 d072e29c Florent Chuffart
207 d072e29c Florent Chuffart
// Set default prefixes for variables
208 d072e29c Florent Chuffart
$opts['js']['prefix']               = 'PME_js_';
209 d072e29c Florent Chuffart
$opts['dhtml']['prefix']            = 'PME_dhtml_';
210 d072e29c Florent Chuffart
$opts['cgi']['prefix']['operation'] = 'PME_op_';
211 d072e29c Florent Chuffart
$opts['cgi']['prefix']['sys']       = 'PME_sys_';
212 d072e29c Florent Chuffart
$opts['cgi']['prefix']['data']      = 'PME_data_';
213 d072e29c Florent Chuffart
214 d072e29c Florent Chuffart
/* Get the user's default language and use it if possible or you can
215 d072e29c Florent Chuffart
   specify particular one you want to use. Refer to official documentation
216 d072e29c Florent Chuffart
   for list of available languages. */
217 d072e29c Florent Chuffart
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';
218 1a2be799 Florent Chuffart
219 d072e29c Florent Chuffart
?>
220 1a2be799 Florent Chuffart
221 1a2be799 Florent Chuffart
222 d072e29c Florent Chuffart
<div id="pre_list"></div>
223 d072e29c Florent Chuffart
224 d072e29c Florent Chuffart
<?php
225 d072e29c Florent Chuffart
226 d072e29c Florent Chuffart
// MVC for ADV_SEARCH
227 d072e29c Florent Chuffart
if (array_key_exists("action", $_REQUEST)) {
228 d072e29c Florent Chuffart
  if ($_REQUEST["action"] == "ADV_SEARCH") {
229 d072e29c Florent Chuffart
    $fltr = "";
230 d072e29c Florent Chuffart
    $cols = preg_filter("/col_/","", array_keys($_REQUEST));
231 d072e29c Florent Chuffart
    foreach ($cols as $index) {
232 d072e29c Florent Chuffart
      if ($index != 0) {
233 d072e29c Florent Chuffart
        $fltr .= " " . $_REQUEST["op_$index"];
234 d072e29c Florent Chuffart
      }
235 d072e29c Florent Chuffart
      if ($_REQUEST["col_$index"] == "Genotype") {
236 d072e29c Florent Chuffart
        $k = $_REQUEST["input_$index"];
237 d072e29c Florent Chuffart
        $fltr .= " (`locus1` LIKE '%$k%' OR `locus2` LIKE '%$k%' OR `locus3` LIKE '%$k%' OR `locus4` LIKE '%$k%' OR `locus5` LIKE '%$k%' OR `ADE2` LIKE '%$k%' OR `HIS3` LIKE '%$k%' OR `LEU2` LIKE '%$k%' OR `LYS2` LIKE '%$k%' OR `MET15` LIKE '%$k%' OR `TRP1` LIKE '%$k%' OR `URA3` LIKE '%$k%' OR `HO_` LIKE '%$k%' OR `Cytoplasmic_Character` LIKE '%$k%' OR `extrachromosomal_plasmid` LIKE '%$k%')";
238 d072e29c Florent Chuffart
      } else {
239 d072e29c Florent Chuffart
        $fltr .= " " . $_REQUEST["col_$index"];
240 d072e29c Florent Chuffart
        $fltr .= " " . $_REQUEST["cond_$index"];
241 d072e29c Florent Chuffart
        if ($_REQUEST["cond_$index"] == "LIKE") {
242 d072e29c Florent Chuffart
          $fltr .= " '%" . $_REQUEST["input_$index"] . "%'";                    
243 d072e29c Florent Chuffart
        } else {
244 d072e29c Florent Chuffart
          $fltr .= " '" . $_REQUEST["input_$index"] . "'";          
245 d072e29c Florent Chuffart
        }
246 d072e29c Florent Chuffart
      }
247 d072e29c Florent Chuffart
    }
248 d072e29c Florent Chuffart
    $opts["filters"] = $fltr;
249 d072e29c Florent Chuffart
  }
250 1a2be799 Florent Chuffart
}
251 1a2be799 Florent Chuffart
252 d072e29c Florent Chuffart
?>