Statistiques
| Branche: | Révision :

root / src / publish_it.php @ e77b752b

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

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

    
5
$output = "";
6

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

    
27

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

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

    
36
  echo $output;
37

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

    
41
  
42
?>
43

    
44