From afdebbc94dac3ac6bb1148a3838d465bf3f6e85e Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Fri, 8 Mar 2013 15:09:42 +1100 Subject: [PATCH] Allow for sample name to be edited --- admin/samplelist.php | 47 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/admin/samplelist.php b/admin/samplelist.php index 890fb0bf..3cfe3266 100644 --- a/admin/samplelist.php +++ b/admin/samplelist.php @@ -44,6 +44,21 @@ include_once(dirname(__FILE__).'/../db.inc.php'); */ include_once(dirname(__FILE__).'/../functions/functions.xhtml.php'); + + +if (isset($_POST['submitr'])) +{ + $sample_import_id = intval($_POST['sample_import_id']); + + $sql = "UPDATE sample_import + SET description = " . $db->qstr($_POST['description']) . " + WHERE sample_import_id = $sample_import_id"; + + $db->Execute($sql); + + $_GET['rename'] = $sample_import_id; +} + if (isset($_POST['submit'])) { $sample_import_id = intval($_POST['sample_import_id']); @@ -67,6 +82,33 @@ if (isset($_POST['submit'])) $_GET['edit'] = $sample_import_id; } +if (isset($_GET['rename'])) +{ + xhtml_head(T_("Rename"),true,array("../css/table.css")); + + $sample_import_id = intval($_GET['rename']); + + $sql = "SELECT description + FROM sample_import + WHERE sample_import_id = $sample_import_id"; + + $rs = $db->GetOne($sql); + + print "

" . T_("Rename") . ": " . $rs. "

"; + echo "

" . T_("Go back") . "

"; + + ?> +
+
+
+
"/>
+
+ " . T_("Deidentify") . "') as did, + CONCAT('" . T_("Rename") . "') as rname, description FROM sample_import"; @@ -144,8 +187,8 @@ $rs = $db->GetAll($sql); xhtml_head(T_("Sample list"),true,array("../css/table.css")); -$columns = array("description","enabledisable","did"); -$titles = array(T_("Sample"),T_("Enable/Disable"),T_("Deidentify")); +$columns = array("description","enabledisable","did","rname"); +$titles = array(T_("Sample"),T_("Enable/Disable"),T_("Deidentify"),T_("Rename")); xhtml_table($rs,$columns,$titles);