diff --git a/admin/quotarow.php b/admin/quotarow.php index 0b6393c0..1d16dfc6 100755 --- a/admin/quotarow.php +++ b/admin/quotarow.php @@ -103,7 +103,7 @@ if (isset($_POST['submitexport'])) $q2 = $db->GetAll($sql); - $sql = "SELECT exclude_var as samplerecord,comparison,exclude_val as value + $sql = "SELECT exclude_var_id, exclude_var as samplerecord,comparison,exclude_val as value FROM qsqr_sample WHERE questionnaire_sample_quota_row_id = $tmp"; @@ -248,12 +248,15 @@ if (isset($_GET['qsqri']) & isset($_GET['edit'])) if (isset($_POST['adds'])) { - $comparison = $db->qstr($_POST['comparisons']); - $exvar = $db->qstr(substr($_POST['sample_var'],12,strpos($_POST['sample_var'],'&')-12)); + $exvar_id = $db->qstr(substr($_POST['sample_var_id'],15,strpos($_POST['sample_var_id'],'&')-15)); + $exvar = $db->qstr($_POST['sample_var']); $exval = $db->qstr($_POST['exclude_val']); + $comparison = $db->qstr($_POST['comparisons']); + $description = $db->qstr($_POST['description']); + //add ssample - $sql = "INSERT INTO qsqr_sample (questionnaire_sample_quota_row_id,exclude_var,exclude_val,comparison) - VALUES ($qsqri,$exvar,$exval,$comparison)"; + $sql = "INSERT INTO qsqr_sample (questionnaire_sample_quota_row_id,exclude_var_id,exclude_var,exclude_val,comparison,description) + VALUES ($qsqri,$exvar_id,$exvar,$exval,$comparison,$description)"; $db->Execute($sql); @@ -263,12 +266,13 @@ if (isset($_GET['qsqri']) & isset($_GET['edit'])) if (isset($_POST['addq'])) { - $comparison = $db->qstr($_POST['comparison']); - $value = $db->qstr($_POST['value']); $sgqa = $db->qstr(substr($_POST['sgqa'],6,strpos($_POST['sgqa'],'&')-6)); + $value = $db->qstr($_POST['value']); + $comparison = $db->qstr($_POST['comparison']); + $description = $db->qstr($_POST['description']); //add ssample - $sql = "INSERT INTO qsqr_question (questionnaire_sample_quota_row_id,lime_sgqa,value,comparison) - VALUES ($qsqri,$sgqa,$value,$comparison)"; + $sql = "INSERT INTO qsqr_question (questionnaire_sample_quota_row_id,lime_sgqa,value,comparison,description) + VALUES ($qsqri,$sgqa,$value,$comparison,$description)"; $db->Execute($sql); @@ -280,7 +284,7 @@ if (isset($_GET['qsqri']) & isset($_GET['edit'])) $questionnaire_id = false; if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']); -xhtml_head(T_("Quota row management"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../include/bootstrap-toggle/css/bootstrap-toggle.min.css","../css/custom.css"),array("../js/jquery-2.1.3.min.js","../include/bootstrap-toggle/js/bootstrap-toggle.min.js","../js/window.js")); +xhtml_head(T_("Quota row management"),true,array("../include/bootstrap-3.3.2/css/bootstrap.min.css","../include/bootstrap-toggle/css/bootstrap-toggle.min.css","../include/font-awesome-4.3.0/css/font-awesome.css","../include/iCheck/skins/square/blue.css","../css/custom.css"),array("../js/jquery-2.1.3.min.js","../include/bootstrap-toggle/js/bootstrap-toggle.min.js","../include/iCheck/icheck.min.js","../js/window.js")); print "
" . T_("Currently no row quotas") . "
"; + print "" . T_("Currently no row quotas") . "
"; } else { - xhtml_table($r,array('qedit','completions','current_completions','status','priority','ap','qselect'),array(T_("Description"),T_("Quota"),T_("Completions"),T_("Status"),T_("Priority"),T_("Auto prioritise"),T_("Select"))); - print ""; - print ""; - - //select sample - + print "
-
-
-
-
- "/>
"/>
-" data-off="" data-offstyle="warning"/>
+"/>
+..." accept=""/>
+ +