root / src / publish_it.php @ master
Historique | Voir | Annoter | Télécharger (1,12 ko)
1 | 49db860c | Florent Chuffart | <?php
|
---|---|---|---|
2 | 49db860c | Florent Chuffart | session_start(); |
3 | 49db860c | Florent Chuffart | require("headers.php"); |
4 | 49db860c | Florent Chuffart | |
5 | e77b752b | Florent Chuffart | $output = ""; |
6 | 66b3419e | Florent Chuffart | $ids = ""; |
7 | e77b752b | Florent Chuffart | |
8 | 49db860c | Florent Chuffart | if (isset($_REQUEST["action"])) { |
9 | 49db860c | Florent Chuffart | // print_r($_REQUEST);
|
10 | 49db860c | Florent Chuffart | $ids = $_REQUEST["ids"]; |
11 | e77b752b | Florent Chuffart | $all_ids = preg_split("/([^0-9]+)/",$ids, -1, PREG_SPLIT_NO_EMPTY); |
12 | 49db860c | Florent Chuffart | // print("<pre>");
|
13 | 49db860c | Florent Chuffart | // print_r($all_ids);
|
14 | 49db860c | Florent Chuffart | // print("</pre>");
|
15 | 49db860c | Florent Chuffart | if ($_REQUEST["action"] == "publish_genotypes") { |
16 | 49db860c | Florent Chuffart | $where_clause = "id IN (" . implode(",", $all_ids) . ")"; |
17 | 49db860c | Florent Chuffart | $qry = "SELECT * FROM strains WHERE $where_clause"; |
18 | 49db860c | Florent Chuffart | $result = mysql_query($qry, $connexion); |
19 | 49db860c | Florent Chuffart | while($strain = mysql_fetch_object($result)) { |
20 | 49db860c | Florent Chuffart | // print("<pre>");
|
21 | 49db860c | Florent Chuffart | // print_r($strain);
|
22 | 49db860c | Florent Chuffart | // print("</pre>");
|
23 | e77b752b | Florent Chuffart | $output .= dump_genotype($strain); |
24 | 49db860c | Florent Chuffart | } |
25 | 49db860c | Florent Chuffart | } |
26 | 49db860c | Florent Chuffart | } |
27 | 49db860c | Florent Chuffart | |
28 | 49db860c | Florent Chuffart | |
29 | 49db860c | Florent Chuffart | $output .= "<p>Enter IDs of strains (blank separated) that you want to publish genotypes.</p>"; |
30 | 49db860c | Florent Chuffart | $output .= "<form>"; |
31 | 49db860c | Florent Chuffart | |
32 | 49db860c | Florent Chuffart | $output .= "<textarea name='ids' cols='25' rows='5'>$ids</textarea><br>"; |
33 | 49db860c | Florent Chuffart | $output .= "<input type='hidden' name='action' value='publish_genotypes'>\n"; |
34 | 49db860c | Florent Chuffart | $output .= "<br><input type='submit' value='Extract genotypes.'>\n"; |
35 | 49db860c | Florent Chuffart | $output .= "</form>"; |
36 | 49db860c | Florent Chuffart | |
37 | 49db860c | Florent Chuffart | echo $output; |
38 | 49db860c | Florent Chuffart | |
39 | 49db860c | Florent Chuffart | // session_start ();
|
40 | 49db860c | Florent Chuffart | require("footers.php"); |
41 | 49db860c | Florent Chuffart | |
42 | 49db860c | Florent Chuffart | |
43 | 49db860c | Florent Chuffart | ?>
|
44 | 49db860c | Florent Chuffart |