* @copyright Australian Consortium for Social and Political Research Incorporated (ACSPRI) 2013 * @package queXS * @subpackage admin * @link http://www.acspri.org.au/software queXS was writen for ACSPRI * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 * */ /** * Configuration file */ include_once(dirname(__FILE__).'/../config.inc.php'); /** * Database */ include_once(dirname(__FILE__).'/../db.inc.php'); /** * XHTML functions */ include_once(dirname(__FILE__).'/../functions/functions.xhtml.php'); if (isset($_POST['submit'])) { $sample_import_id = intval($_POST['sample_import_id']); unset($_POST['submit']); unset($_POST['sample_import_id']); foreach($_POST as $p) { $sql = "DELETE FROM sample_var WHERE var LIKE " . $db->qstr($p) . " AND sample_id IN (SELECT sample_id FROM sample WHERE import_id = $sample_import_id)"; $db->Execute($sql); } $_GET['edit'] = $sample_import_id; } if (isset($_GET['edit'])) { xhtml_head(T_("Deidentify"),true,array("../css/table.css")); $sample_import_id = intval($_GET['edit']); $sql = "SELECT si.description, sv.val, sv.var, CONCAT('') as box FROM sample_import as si, sample_var as sv, sample as s WHERE si.sample_import_id = $sample_import_id AND sv.sample_id = s.sample_id AND s.import_id = si.sample_import_id GROUP BY sv.var"; $rs = $db->GetAll($sql); print "

" . T_("Deidentify") . ": " . $rs[0]['description'] . "

"; echo "

" . T_("Go back") . "

"; print "

" . T_("Select which fields from this sample to deidentify. Deidentified fields will be permanently deleted from the sample.") . "

"; ?>
"/>
Execute($sql); } if (isset($_GET['sampleenable'])) { $id = intval($_GET['sampleenable']); $sql = "UPDATE sample_import SET enabled = 1 WHERE sample_import_id = '$id'"; $db->Execute($sql); } $sql = "SELECT CASE WHEN enabled = 0 THEN CONCAT('" . T_("Enable") . "') ELSE CONCAT('" . T_("Disable") . "') END as enabledisable, CONCAT('" . T_("Deidentify") . "') as did, description FROM sample_import"; $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")); xhtml_table($rs,$columns,$titles); xhtml_foot(); ?>