Statistiques
| Branche: | Révision :

root / src / publish_it.php @ master

Historique | Voir | Annoter | Télécharger (1,12 ko)

1
<?php
2
session_start();
3
require("headers.php");
4

    
5
$output = "";
6
$ids = "";
7

    
8
if (isset($_REQUEST["action"])) {
9
  // print_r($_REQUEST);
10
  $ids = $_REQUEST["ids"];
11
  $all_ids = preg_split("/([^0-9]+)/",$ids, -1, PREG_SPLIT_NO_EMPTY);
12
  // print("<pre>");
13
  // print_r($all_ids);
14
  // print("</pre>");
15
  if ($_REQUEST["action"] == "publish_genotypes") {
16
    $where_clause = "id IN (" . implode(",", $all_ids) . ")";
17
    $qry = "SELECT * FROM strains WHERE $where_clause";
18
    $result = mysql_query($qry, $connexion);
19
    while($strain = mysql_fetch_object($result)) {
20
      // print("<pre>");
21
      // print_r($strain);
22
      // print("</pre>");
23
      $output .= dump_genotype($strain);
24
    }
25
  }
26
}
27

    
28

    
29
  $output .= "<p>Enter IDs of strains (blank separated) that you want to publish genotypes.</p>";
30
  $output .= "<form>";
31

    
32
  $output .= "<textarea name='ids' cols='25' rows='5'>$ids</textarea><br>";
33
  $output .= "<input type='hidden' name='action' value='publish_genotypes'>\n";
34
  $output .= "<br><input type='submit' value='Extract genotypes.'>\n";
35
  $output .= "</form>";
36

    
37
  echo $output;
38

    
39
  // session_start ();
40
  require("footers.php");
41

    
42
  
43
?>
44

    
45