* @copyright Deakin University 2007,2008 * @package queXS * @subpackage admin * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * * */ /** * Configuration file */ include("../config.inc.php"); /** * Database file */ include ("../db.inc.php"); /** * XHTML functions */ include("../functions/functions.xhtml.php"); /** * Input functions */ include("../functions/functions.input.php"); global $db; if (isset($_GET['sample_id'])) { //need to remove this sample record from the sample $sample_id = bigintval($_GET['sample_id']); $db->StartTrans(); $sql = "DELETE FROM sample_var WHERE sample_id = '$sample_id'"; $db->Execute($sql); $sql = "DELETE FROM sample WHERE sample_id = '$sample_id'"; $db->Execute($sql); $db->CompleteTrans(); } $sample_import_id = false; if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']); xhtml_head(T_("Search sample"),true,array("../css/table.css"),array("../js/window.js")); print "
" . T_("No records in this sample match this search criteria") . "
"; else { //add sample information to results $sql = "SELECT var FROM sample_var WHERE sample_id = {$r[0]['sample_id']}"; $rs = $db->GetAll($sql); $fnames = array("sample_id"); $fdesc = array(T_("Sample id")); foreach($rs as $rsw) { $fnames[] = $rsw['var']; $fdesc[] = $rsw['var']; } $fnames[] = "link"; $fdesc[] = T_("Link"); foreach($r as &$rw) { $sql = "SELECT var,val FROM sample_var WHERE sample_id = {$rw['sample_id']}"; $rs = $db->GetAll($sql); foreach($rs as $rsw) $rw[$rsw['var']] = $rsw['val']; } xhtml_table($r,$fnames,$fdesc); } } print "" . T_("Use the % character as a wildcard") ."
"; ?>