mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
fixes for "client-panel" merged branch
This commit is contained in:
@@ -140,18 +140,18 @@ if (isset($_POST['submit']))
|
||||
}
|
||||
|
||||
/* delete client from quexs and lime tables*/ //requires data-toggle-confirmation to finalize
|
||||
if (isset($_POST['delete']) && isset($_POST['uid']))
|
||||
if (isset($_GET['delete']) && isset($_GET['uid']) && isset($_GET['uname']))
|
||||
{
|
||||
$client_id = intval($_POST['delete']);
|
||||
$uid = intval($_POST['uid']);
|
||||
$uname = $_POST['uname'];
|
||||
|
||||
$client_id = intval($_GET['delete']);
|
||||
$uid = intval($_GET['uid']);
|
||||
$uname = $_GET['uname'];
|
||||
|
||||
global $db;
|
||||
|
||||
$db->StartTrans();
|
||||
|
||||
|
||||
if ($uid !=1){ //double protect superadmin from being deleted
|
||||
|
||||
|
||||
$db->StartTrans();
|
||||
|
||||
$sql = "DELETE FROM " . LIME_PREFIX . "templates_rights WHERE `uid` = '$uid' AND `uid` != 1";
|
||||
$db->Execute($sql);
|
||||
|
||||
@@ -164,20 +164,19 @@ if (isset($_POST['delete']) && isset($_POST['uid']))
|
||||
$sql = "DELETE FROM " . LIME_PREFIX . "users WHERE `uid` = '$uid' AND `uid` != 1";
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM `client_questionnaire` WHERE `client_id` = '$client_id' ";
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM `client` WHERE `client_id` = '$client_id'";
|
||||
$db->Execute($sql);
|
||||
|
||||
$db->CompleteTrans();
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM `client_questionnaire` WHERE `client_id` = '$client_id' ";
|
||||
$db->Execute($sql);
|
||||
|
||||
$sql = "DELETE FROM `client` WHERE `client_id` = '$client_id'";
|
||||
$db->Execute($sql);
|
||||
|
||||
$db->CompleteTrans();
|
||||
|
||||
if ($db->CompleteTrans()) $msg = "<p class='alert alert-info'>". T_("Client with username $uname deleted") . "</p>";
|
||||
else $msg = "<p class='alert alert-warning'>". T_("ERROR deleting client with username $uname") . "</p>";
|
||||
else $msg = "<p class='alert alert-warning'>". T_("ERROR deleting client with username $uname") . "</p>";
|
||||
|
||||
unset($_POST['delete'], $_POST['uid'], $_POST['uname'], $client_id, $username, $uid);
|
||||
unset($_GET['delete'], $_GET['uid'], $_GET['uname'], $client_id, $username, $uid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -124,6 +124,9 @@ if (isset($_POST['client']) && !empty($_POST['client']))
|
||||
}
|
||||
}
|
||||
else $a = T_("Username") . " " . $client . ". " . T_("is already in use");
|
||||
|
||||
$client =""; $firstname="";$lastname="";$email=""; $time_zone_name="";
|
||||
unset($_POST['client'],$_POST['password'],$_POST['lastname'],$_POST['firstname'],$_POST['email'],$_POST['Time_zone_name']);
|
||||
}
|
||||
|
||||
$header = T_("Add a client");
|
||||
|
||||
@@ -78,10 +78,9 @@ if ($client_id)
|
||||
print "<p class='alert alert-info'>" . T_("There are no questionnaires assigned to you") . "</p>";
|
||||
else
|
||||
{
|
||||
print "<div class='col-lg-2'>";
|
||||
|
||||
foreach($qs as $q)
|
||||
{
|
||||
print "<div class='col-lg-2'>";
|
||||
print "<div class=' '><h2>{$q['description']}</h2>";
|
||||
|
||||
$questionnaire_id = $q['questionnaire_id'];
|
||||
@@ -116,22 +115,25 @@ if ($client_id)
|
||||
if (!empty($rs))
|
||||
{
|
||||
translate_array($rs,array("des"));
|
||||
xhtml_table($rs,array("des","count"),array(T_("Outcome"),T_("Count")),"tclass",array("des" => "Complete"));
|
||||
xhtml_table($rs,array("des","count"),array(T_("Outcome"),T_("Count")),"tclass",array("des" => "Complete"),array("count"));
|
||||
}
|
||||
else print "<p class='alert alert-info'>" . T_("No outcomes recorded for this questionnaire") . "</p>";
|
||||
|
||||
print "</br><a href=\"?qsid=$qsid\" class=\"btn btn-default btn-block btn-lime\">" . T_("View summary results") . "</a></div>";
|
||||
print "</br><a href=\"?qsid=$qsid\" class=\"btn btn-default btn-block btn-lime\">" . T_("View summary results") . "</a></div></div>";
|
||||
}
|
||||
|
||||
if (isset($_GET['qsid'])) $qsid = intval($_GET['qsid']);
|
||||
$page = LIME_URL . "admin/admin.php?action=browse&sid=$qsid";
|
||||
?>
|
||||
</div>
|
||||
if (isset($_GET['qsid'])) {
|
||||
$qsid = intval($_GET['qsid']);
|
||||
$page = LIME_URL . "admin/admin.php?action=browse&sid=$qsid"; }
|
||||
else $page ='';
|
||||
|
||||
<div class="col-lg-10" id=" " style="height:820px;">
|
||||
if ($page){
|
||||
?>
|
||||
<div class="col-lg-10 pull-right" id=" " style="height:820px;">
|
||||
<?php xhtml_object($page,' ',"full"); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user