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