mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixes by Alex (thank you!)
This commit is contained in:
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -47,7 +47,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* Operator functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -133,7 +133,7 @@ if ($operator_id)
|
||||
|
||||
while ($r = $rs->FetchRow())
|
||||
{
|
||||
translate_array($r,array("des"));
|
||||
translate_array($r,array("descr"));
|
||||
echo $r['start_date'] . "," .$r['start_time'] . "," . $r['end'] . "," . $r['case_id'] . "," . $r['qd'] . "," . $r['spl'] . "," . $r['cpi'] . "," . $r['opname'] . "," . $r['descr'] . "," . $r['casenotes'] . "," . $r['firstName'] . "\n";
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ if ($operator_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
translate_array($rs,array("des"));
|
||||
translate_array($rs,array("descr"));
|
||||
|
||||
$datacol = array("start_date", "start_time","end","case_id","qd","spl","cpi","opname","descr","casenotes","firstName");
|
||||
$headers = array(T_("Date"), T_("Start time"), T_("End time"),T_("Case ID"),T_("Questionnaire"),T_("Sample"),T_("Phone number"),T_("Operator"),T_("Outcome"),T_("Case notes"),T_("Respondent"));
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -75,7 +75,8 @@ if ($operator_id)
|
||||
|
||||
if (!empty($rs)){
|
||||
print "<h2 class=' '>" . T_("Project") . ": <span class='text-primary'>{$rs['qd']}</span></h2>";
|
||||
if($sample_import_id=intval($_GET['sample_import_id'])){
|
||||
if( isset($_GET['sample_import_id'])){
|
||||
$sample_import_id=intval($_GET['sample_import_id']);
|
||||
$sql = "SELECT si.description as sd
|
||||
FROM `sample_import` as si
|
||||
WHERE si.sample_import_id = '$sample_import_id' ;";
|
||||
@@ -85,7 +86,8 @@ if ($operator_id)
|
||||
}
|
||||
else{$sid = " ";};
|
||||
|
||||
if($oper_id= intval($_GET['oper_id'])){
|
||||
if( isset($_GET['oper_id'])){
|
||||
$oper_id= intval($_GET['oper_id']);
|
||||
$sql = "SELECT CONCAT(op.firstname, op.lastname) as opname
|
||||
FROM `operator` as op
|
||||
WHERE op.operator_id = '$oper_id' ;";
|
||||
|
||||
@@ -15,7 +15,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -110,19 +110,24 @@ function case_status_report($questionnaire_id = false, $sample_id = false, $outc
|
||||
LEFT JOIN outcome as co ON (co.outcome_id = ca.outcome_id)
|
||||
LEFT JOIN case_queue as cq ON (cq.case_id = c.case_id)
|
||||
LEFT JOIN operator as oq ON (cq.operator_id = oq.operator_id)
|
||||
LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
|
||||
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
|
||||
WHERE c.current_operator_id IS NULL $q $o
|
||||
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
|
||||
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
|
||||
ORDER BY c.case_id ASC";
|
||||
|
||||
// print $sql;
|
||||
|
||||
print ("<form method=\"post\" action=\"?questionnaire_id=$questionnaire_id&sample_import_id=$sample_id\">");
|
||||
|
||||
$rs2 = $db->GetAll($sql);
|
||||
translate_array($rs2,array("outcomes"));
|
||||
|
||||
$datacol = array('case_id','samples','timezone','time','nrattempts','nrcalls','outcomes','availableinmin','assignedoperator','ordr','flag');
|
||||
$headers = array(T_("Case id"),T_("Sample"),T_("Timezone"),T_("Time NOW"),T_("Call attempts"),T_("Calls"),T_("Outcome"),T_("Available in"),T_("Assigned to"),T_("Order"),"<i class='fa fa-check-square-o fa-lg'></i>");
|
||||
|
||||
if (isset($_GET['sample_import_id'])){ unset($datacol[1]); unset($headers[1]); }
|
||||
|
||||
xhtml_table($db->GetAll($sql),$datacol,$headers,"tclass",false,false,"bs-table");
|
||||
xhtml_table($rs2,$datacol,$headers,"tclass",false,false,"bs-table");
|
||||
|
||||
$sql = "SELECT operator_id as value,CONCAT(firstName,' ', lastName) as description, '' selected
|
||||
FROM operator
|
||||
@@ -206,7 +211,7 @@ if (isset($_GET['unassign']))
|
||||
$db->CompleteTrans();
|
||||
}
|
||||
|
||||
xhtml_head(T_("Case status and assignment"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js")
|
||||
xhtml_head(T_("Case status and assignment"),true,$css,$js_head);
|
||||
echo "<a href='' onclick='history.back();return false;' class='btn btn-default pull-left' ><i class='fa fa-chevron-left text-primary'></i> " . T_("Go back") . "</a>
|
||||
<i class='fa fa-question-circle fa-3x text-primary pull-right btn' data-toggle='modal' data-target='.inform'></i>";
|
||||
?>
|
||||
@@ -237,7 +242,7 @@ print "<div class='form-group '><h3 class=' col-sm-2 text-right'>" . T_("Questio
|
||||
display_questionnaire_chooser($questionnaire_id, false, "pull-left", "form-control");
|
||||
if ($questionnaire_id){
|
||||
print "<h3 class=' col-sm-2 text-right'>" . T_("Sample") . ":</h3>";
|
||||
display_sample_chooser($questionnaire_id,$sample_import_id,false, "pull-left", "form-control");
|
||||
display_sample_chooser($questionnaire_id,$sample_import_id,false, "pull-left", "form-control", true);
|
||||
print "</div>
|
||||
<div class='clearfix'></div>";
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -47,7 +47,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php /**
|
||||
<?php
|
||||
/**
|
||||
* Display appointments
|
||||
*/
|
||||
|
||||
@@ -15,7 +16,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -58,19 +59,27 @@ $js_foot = array(
|
||||
"../js/bootstrap-confirmation.js",
|
||||
"../js/custom.js"
|
||||
);
|
||||
|
||||
|
||||
//create new or update appointment
|
||||
if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update']))
|
||||
{
|
||||
$start = $db->qstr($_GET['start']);
|
||||
$end = $db->qstr($_GET['end']);
|
||||
$contact_phone_id = bigintval($_GET['contact_phone_id']);
|
||||
$case_id = bigintval($_GET['case_id']);
|
||||
$respondent_id = bigintval($_GET['respondent_id']);
|
||||
$require_operator_id = "NULL";
|
||||
if ($_GET['require_operator_id'] > 1) $require_operator_id = bigintval($_GET['require_operator_id']);
|
||||
|
||||
if ($_GET['new'] == 'create'){
|
||||
$case_id = bigintval($_GET['case_id']);
|
||||
//* add new number to db
|
||||
if ( isset($_GET['addphonenumber']) && !empty($_GET['addphonenumber'])){
|
||||
add_contact_phone($case_id,$_GET['addphonenumber']);
|
||||
$contact_phone_id = $db->Insert_ID();
|
||||
}
|
||||
else {
|
||||
$contact_phone_id = bigintval($_GET['contact_phone_id']);
|
||||
}
|
||||
|
||||
if (isset($_GET['new']) && $_GET['new'] == 'create'){
|
||||
$operator_id = get_operator_id();
|
||||
if ($operator_id == false) die();
|
||||
$sql = "SELECT Time_zone_name FROM respondent WHERE respondent_id = '$respondent_id'";
|
||||
@@ -104,14 +113,15 @@ if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['update']))
|
||||
|
||||
$db->Execute($sql);
|
||||
}
|
||||
unset ($_GET['start'],$_GET['end'],$_GET['appointment_id'],$_GET['case_id'],$_GET['new'],$_GET['update']);
|
||||
unset ($_GET['start'],$_GET['end'],$_GET['new'],$_GET['update'],$_GET['appointment_id'],$_GET['case_id'],$_GET['addphonenumber']); //
|
||||
}
|
||||
|
||||
|
||||
if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET['new']) && isset($_GET['case_id'])))
|
||||
{
|
||||
$appointment_id = bigintval($_GET['appointment_id']);
|
||||
$case_id = bigintval($_GET['case_id']);
|
||||
if (isset($_GET['appointment_id'])) $appointment_id = bigintval($_GET['appointment_id']); else $appointment_id = "";
|
||||
if (isset($_GET['case_id'])) $case_id = bigintval($_GET['case_id']);
|
||||
$require_operator_id = "NULL";
|
||||
|
||||
if (isset($_GET['delete']))
|
||||
{
|
||||
@@ -121,27 +131,61 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
|
||||
|
||||
xhtml_head(T_("Now modify case outcome"),true,$css,$js_head);
|
||||
|
||||
print "<div class='col-sm-6'><p class='well'>" . T_("The appointment has been deleted. Now you must modify the case outcome") . "</p>
|
||||
print "<div class='col-lg-6'><p class='well'>" . T_("The appointment has been deleted. Now you must modify the case outcome") . "</p>
|
||||
<a href='supervisor.php?case_id=$case_id' class='btn btn-default'>" . T_("Modify case outcome") . "</a></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//Display an edit form
|
||||
$lang = DEFAULT_LOCALE ;
|
||||
|
||||
$sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate,
|
||||
CONVERT_TZ(DATE_ADD(NOW(), INTERVAL 10 YEAR),'SYSTEM',r.Time_zone_name) as enddate,
|
||||
r.respondent_id, ca.contact_phone_id
|
||||
FROM `case` as c, `respondent` as r, `call` as ca
|
||||
WHERE c.case_id = '$case_id'
|
||||
AND r.case_id = c.case_id
|
||||
AND c.last_call_id = ca.call_id";
|
||||
$rs = $db->GetRow($sql);
|
||||
|
||||
if ($_GET['new'] == 'new'){$title = T_("Create NEW appointment");} else{$title = T_("Edit appointment"); $subtitle = "ID " . $appointment_id;}
|
||||
$startdate = $rs['startdate'];
|
||||
$enddate = $rs['enddate'];
|
||||
$respondent_id = $rs['respondent_id'];
|
||||
if (!isset($contact_phone_id)) $contact_phone_id = $rs['contact_phone_id'];
|
||||
|
||||
if (isset($_GET['new']) && $_GET['new'] == 'new'){
|
||||
$title = T_("Create NEW appointment");
|
||||
$subtitle ="";
|
||||
$start = $startdate;
|
||||
$end = $enddate;
|
||||
$rtz = $_GET['rtz'];
|
||||
}
|
||||
|
||||
if (isset($_GET['appointment_id'])) {
|
||||
$title = T_("Edit appointment");
|
||||
$subtitle = "ID " . $appointment_id;
|
||||
|
||||
$sql = "SELECT a.contact_phone_id,a.call_attempt_id, CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as `start`, CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as `end`, a.respondent_id, a.require_operator_id, r.Time_zone_name as rtz
|
||||
FROM `appointment` as a, respondent as r
|
||||
WHERE a.appointment_id = '$appointment_id'
|
||||
AND a.case_id = '$case_id'
|
||||
AND r.respondent_id = a.respondent_id";
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
|
||||
if (!empty($rs)){
|
||||
$respondent_id = $rs['respondent_id'];
|
||||
$contact_phone_id = $rs['contact_phone_id'];
|
||||
$require_operator_id = $rs['require_operator_id'];
|
||||
$start = $rs['start'];
|
||||
$end = $rs['end'];
|
||||
$rtz = $rs['rtz'];
|
||||
}
|
||||
else die(T_("ERROR in DB records, Check tables 'appointment' and 'respondent' and Time zone settings"));
|
||||
}
|
||||
|
||||
//Display an edit form
|
||||
xhtml_head($title,true,$css,$js_head,false,false,false,$subtitle);
|
||||
|
||||
$lang = DEFAULT_LOCALE;
|
||||
|
||||
$sql = "SELECT CONVERT_TZ(NOW(),'SYSTEM',r.Time_zone_name) as startdate, CONVERT_TZ(DATE_ADD(NOW(), INTERVAL 10 YEAR),'SYSTEM',r.Time_zone_name) as enddate
|
||||
FROM `case` as c, `respondent` as r
|
||||
WHERE c.case_id = '$case_id' AND r.case_id = c.case_id";
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
$startdate = $rs['startdate'];
|
||||
$enddate = $rs['enddate'];
|
||||
|
||||
print "<script type='text/javascript'>
|
||||
$(document).ready(function() { var startDateTextBox = $('#start'); var endDateTextBox = $('#end');
|
||||
$.timepicker.datetimeRange(
|
||||
@@ -157,60 +201,55 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
|
||||
stepMinute: 5,
|
||||
hourGrid: 2,
|
||||
minuteGrid: 10,
|
||||
minDate: '$startdate',
|
||||
maxDate: '$enddate'
|
||||
minDate: '$startdate',
|
||||
maxDate: '$enddate'
|
||||
});});</script>";
|
||||
|
||||
if ($_GET['new'] =='new'){
|
||||
$start = $startdate;
|
||||
$end = $enddate;
|
||||
$rtz = $_GET['rtz'];
|
||||
}
|
||||
if (isset($_GET['appointment_id'])) {
|
||||
print "<form action='?' method='get' class='form-horizontal form-group'>";
|
||||
print "<label class='pull-left text-right control-label col-lg-2' for='respondent_id'>" . T_("Respondent") . "</label>";
|
||||
|
||||
display_chooser($db->GetAll("SELECT respondent_id as value, CONCAT(firstName,' ',lastName) as description,
|
||||
CASE when respondent_id = '$respondent_id' THEN 'selected=\'selected\'' ELSE '' END as selected
|
||||
FROM respondent
|
||||
WHERE case_id = '$case_id'"),"respondent_id","respondent_id",false,false,false,true,false,true,"pull-left");
|
||||
|
||||
$sql = "SELECT a.contact_phone_id,a.call_attempt_id, CONVERT_TZ(a.start,'UTC',r.Time_zone_name) as `start`, CONVERT_TZ(a.end,'UTC',r.Time_zone_name) as `end`, a.respondent_id, a.require_operator_id, r.Time_zone_name as rtz
|
||||
FROM `appointment` as a, respondent as r
|
||||
WHERE a.appointment_id = '$appointment_id'
|
||||
AND a.case_id = '$case_id'
|
||||
AND r.respondent_id = a.respondent_id";
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
|
||||
if (!empty($rs)){
|
||||
$respondent_id = $rs['respondent_id'];
|
||||
$contact_phone_id = $rs['contact_phone_id'];
|
||||
$require_operator_id = $rs['require_operator_id'];
|
||||
$start = $rs['start'];
|
||||
$end = $rs['end'];
|
||||
$rtz = $rs['rtz'];
|
||||
}
|
||||
}
|
||||
print "<form action='?' method='get' class='form-horizontal'>";
|
||||
print "<label class='pull-left text-right control-label col-sm-2' for='respondent_id'>" . T_("Respondent") . "</label>";
|
||||
print "<br/><br/><label for='contact_phone_id' class='pull-left text-right control-label col-lg-2'>" . T_("Contact phone") . "</label>";
|
||||
|
||||
display_chooser($db->GetAll("SELECT respondent_id as value, CONCAT(firstName,' ',lastName) as description,
|
||||
CASE when respondent_id = '$respondent_id' THEN 'selected=\'selected\'' ELSE '' END as selected
|
||||
FROM respondent
|
||||
WHERE case_id = '$case_id'"),"respondent_id","respondent_id",false,false,false,true,false,true,"pull-left");
|
||||
$sql = "SELECT contact_phone_id as value, phone as description,
|
||||
CASE when contact_phone_id = '$contact_phone_id' THEN 'selected=\'selected\'' ELSE '' END as selected
|
||||
FROM contact_phone
|
||||
WHERE case_id = '$case_id'";
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
//* added option to add new number
|
||||
print "<div class=\"pull-left\"><select class=\"form-control\" id='contact_phone_id' name='contact_phone_id'
|
||||
onchange=\"if($(this).val()=='add'){ $('#addPhone').show(); } else{ $('#addPhone').hide(); } \">";
|
||||
foreach($rs as $l)
|
||||
{
|
||||
print "<option value='{$l['value']}' {$l['selected']} >{$l['description']}</option>";
|
||||
}
|
||||
print "<option value='add'>" . T_("Add new phone number") . "</option></select></div>";
|
||||
|
||||
print "<br/><br/><label for='contact_phone_id' class='pull-left text-right control-label col-sm-2'>" . T_("Contact phone") . "</label>";
|
||||
display_chooser($db->GetAll("SELECT contact_phone_id as value, phone as description,
|
||||
CASE when contact_phone_id = '$contact_phone_id' THEN 'selected=\'selected\'' ELSE '' END as selected
|
||||
FROM contact_phone
|
||||
WHERE case_id = '$case_id'"),
|
||||
"contact_phone_id","contact_phone_id",false,false,false,true,false,true,"pull-left");
|
||||
|
||||
print "<div class='clearfix'></div></br><div class='alert alert-info col-sm-6 '>". T_("ATTENTION! Keep in mind that you're setting 'Start' & 'End' appoinment times in RESPONDENT LOCAL TIME !!!") . "</div><div class='clearfix'></div>";
|
||||
print "<div class='col-lg-4' id='addPhone' style='display:none'>
|
||||
<div class='col-lg-6' id=''>
|
||||
<input type=\"tel\" maxlength=\"10\" pattern=\"[0-9]{10}\" class='form-control col-lg-2 ' name='addphonenumber' />
|
||||
</div>
|
||||
</div>";
|
||||
//*end option
|
||||
|
||||
print "<div class='clearfix'></div></br><div class='alert alert-info col-lg-6 '>". T_("ATTENTION! Keep in mind that you're setting 'Start' & 'End' appoinment times in RESPONDENT LOCAL TIME !!!") . "</div><div class='clearfix'></div>";
|
||||
|
||||
date_default_timezone_set($rtz);
|
||||
print "<label class='text-right col-sm-2 control-label'>" . T_("Respondent TimeZone") . ":</label>
|
||||
<h4 class='col-sm-2 text-danger text-uppercase fa-lg'>" . $rtz . "</h4>
|
||||
|
||||
print "<label class='text-right col-lg-2 control-label'>" . T_("Respondent TimeZone") . ":</label>
|
||||
<h4 class='col-lg-2 text-danger text-uppercase fa-lg'>" . $rtz . "</h4>
|
||||
<label class=''>" . T_("Respondent Time") . ": <b class='fa fa-2x '>" . date("H:i:s") . "</b></label>";
|
||||
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='start'>" . T_("Start time") . "</label>
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='start'>" . T_("Start time") . "</label>
|
||||
<div class='pull-left'><input class='form-control' type='text' value='$start' id='start' name='start'/></div>";
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='end'>" . T_("End time") . "</label>
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='end'>" . T_("End time") . "</label>
|
||||
<div class='pull-left'><input class='form-control' type='text' value='$end' id='end' name='end'/></div>";
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-sm-2' for='require_operator_id'>" . T_("Appointment with") . "</label>";
|
||||
print "<br/><br/><label class='pull-left text-right control-label col-lg-2' for='require_operator_id'>" . T_("Appointment with") . "</label>";
|
||||
$ops = $db->GetAll("SELECT o.operator_id as value,
|
||||
CONCAT(o.firstName, ' ', o.lastName) as description,
|
||||
CASE WHEN o.operator_id = '$require_operator_id' THEN 'selected=\'selected\'' ELSE '' END as selected
|
||||
@@ -225,17 +264,25 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
|
||||
}
|
||||
}
|
||||
array_unshift($ops,array('value'=>0,'description'=>T_("Any operator"),'selected'=>$selected));
|
||||
display_chooser($ops,"require_operator_id","require_operator_id",false,false,false,true,false,true,"pull-left");
|
||||
print "<input type='hidden' value='$appointment_id' id='appointment_id' name='appointment_id'/><input type='hidden' value='update' id='update' name='update'/>";
|
||||
|
||||
if ($_GET['new'] == 'new') { print "<input type='hidden' value='create' id='new' name='new'/><input type='hidden' value='$case_id' id='case_id' name='case_id'/>";}
|
||||
display_chooser($ops,"require_operator_id","require_operator_id",false,false,false,true,false,true,"pull-left");
|
||||
|
||||
print " <input type='hidden' value='$appointment_id' id='appointment_id' name='appointment_id'/>
|
||||
<input type='hidden' value='update' id='update' name='update'/>
|
||||
<input type='hidden' value='$case_id' id='case_id' name='case_id'/>";
|
||||
|
||||
if (isset($_GET['new']) && $_GET['new'] == 'new') {
|
||||
print "<input type='hidden' value='create' id='new' name='new'/>";
|
||||
}
|
||||
|
||||
print "<div class='clearfix'></div><br/><br/>
|
||||
<div class='col-sm-2'><a href='' onclick='history.back();return false;' class='btn btn-default pull-left'><i class='fa fa-ban fa-lg'></i> " . T_("Cancel edit") . "</a></div>";
|
||||
<div class='col-lg-2'><a href='?' class='btn btn-default pull-left'><i class='fa fa-ban fa-lg'></i> " . T_("Cancel edit") . "</a></div>";
|
||||
|
||||
print "<div class='col-sm-2'><button type='submit' class='btn btn-primary btn-block'><i class='fa fa-floppy-o fa-lg'></i> " . T_("Save changes") . "</button></div>";
|
||||
print "<div class='col-lg-2'>
|
||||
<button type='submit' class='btn btn-primary btn-block'><i class='fa fa-floppy-o fa-lg'></i> " . T_("Save changes") . "</button>
|
||||
</div>";
|
||||
|
||||
print "<div class='col-sm-2'><a href='' class='btn btn-default pull-right' toggle='confirmation' data-placement='left' data-href='?delete=delete&appointment_id=$appointment_id&case_id=$case_id' ><i class='fa fa-trash fa-lg text-danger'></i> " . T_("Delete this appointment") . "</a></div>";
|
||||
print "<div class='col-lg-2'><a href='' class='btn btn-default pull-right' toggle='confirmation' data-placement='left' data-href='?delete=delete&appointment_id=$appointment_id&case_id=$case_id' ><i class='fa fa-trash fa-lg text-danger'></i> " . T_("Delete this appointment") . "</a></div>";
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
@@ -243,45 +290,53 @@ if ( (isset($_GET['appointment_id']) && isset($_GET['case_id'])) ||(isset($_GET[
|
||||
else {
|
||||
$operator_id = get_operator_id();
|
||||
$subtitle = T_("Appointments");
|
||||
xhtml_head(T_("Display Appointments"),true,$css,$js_head,false,30); //array("../css/table.css")
|
||||
xhtml_head(T_("Display Appointments"),true,$css,$js_head,false,30);
|
||||
print "<h3>" . T_("All appointments (with times displayed in your time zone)") . "</h3>";
|
||||
|
||||
$sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end,CONCAT(r.firstName, ' ', r.lastName) as resp, IFNULL(ou.description,'" . TQ_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName,
|
||||
$sql = "SELECT q.description, si.description as smpl, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end,CONCAT(r.firstName, ' ', r.lastName) as resp, IFNULL(ou.description,'" . TQ_("Not yet called") . "') as outcome, oo.firstName as makerName, ooo.firstName as callerName,
|
||||
CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id,
|
||||
CONCAT(' <a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&appointment_id=', a.appointment_id, '&delete=delete\' ></i></a> ') as link,
|
||||
CONCAT(' <a href=\'?case_id=', c.case_id, '&appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a> ') as edit,IFNULL(ao.firstName,'" . TQ_("Any operator") . "') as witho
|
||||
FROM appointment as a
|
||||
JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id)
|
||||
JOIN (`case` as c, respondent as r, questionnaire as q, operator as oo, call_attempt as cc, `sample` as s, sample_import as si) on (c.sample_id = s.sample_id and a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and a.call_attempt_id = cc.call_attempt_id and cc.operator_id = oo.operator_id and si.sample_import_id = s.import_id)
|
||||
LEFT JOIN (`call` as ca, outcome as ou, operator as ooo) ON (ca.call_id = a.completed_call_id and ou.outcome_id = ca.outcome_id and ca.operator_id = ooo.operator_id)
|
||||
LEFT JOIN operator AS ao ON ao.operator_id = a.require_operator_id
|
||||
WHERE a.end >= CONVERT_TZ(NOW(),'System','UTC') AND c.current_outcome_id !=10
|
||||
LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
|
||||
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
|
||||
WHERE q.enabled=1 AND si.enabled=1 AND a.end >= CONVERT_TZ(NOW(),'System','UTC') AND c.current_outcome_id !=10
|
||||
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1)
|
||||
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
|
||||
ORDER BY a.start ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
if (!empty($rs)) {
|
||||
translate_array($rs,array("outcome"));
|
||||
xhtml_table($rs,array("description","case_id","start","end","edit","makerName","witho","resp","outcome","callerName","link"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End")," <i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i> ",T_("Created by"),T_("Appointment with"),T_("Respondent"),T_("Current outcome"),T_("Operator who called")," <i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i> "),"tclass",false,false,"bs-table");
|
||||
xhtml_table($rs,array("description","smpl","case_id","start","end","edit","makerName","witho","resp","outcome","callerName","link"),array(T_("Questionnaire"),T_("Sample"),T_("Case ID"),T_("Start"),T_("End")," <i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i> ",T_("Created by"),T_("Appointment with"),T_("Respondent"),T_("Current outcome"),T_("Operator who called")," <i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i> "),"tclass",false,false,"bs-table");
|
||||
|
||||
} else print "<h4 class='well text-info'>" . T_("No future appointments") . "</h4>";
|
||||
|
||||
print "<h3 style='color:red'>" . T_("Missed appointments (with times displayed in your time zone)") . "</h3>";
|
||||
|
||||
$sql = "SELECT q.description, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end, CONCAT(r.firstName, ' ', r.lastName) as resp,
|
||||
$sql = "SELECT q.description, si.description as smpl, CONVERT_TZ(a.start,'UTC',@@session.time_zone) as start, CONVERT_TZ(a.end,'UTC',@@session.time_zone) as end, CONCAT(r.firstName, ' ', r.lastName) as resp,
|
||||
CONCAT('<a href=\'supervisor.php?case_id=', c.case_id, '\'>', c.case_id, '</a>') as case_id,
|
||||
CONCAT(' <a href=\'\'><i class=\'fa fa-trash-o fa-lg text-danger\' toggle=\'confirmation\' data-placement=\'left\' data-href=\'?case_id=', c.case_id, '&appointment_id=', a.appointment_id, '&delete=delete\' ></i></a> ') as link,
|
||||
CONCAT(' <a href=\'?case_id=', c.case_id, '&appointment_id=', a.appointment_id, '\'><i class=\'fa fa-pencil-square-o fa-lg\' ></i></a> ') as edit
|
||||
FROM appointment as a
|
||||
JOIN (`case` as c, respondent as r, questionnaire as q, `sample` as s, sample_import as si) on (a.case_id = c.case_id and a.respondent_id = r.respondent_id and q.questionnaire_id = c.questionnaire_id and s.sample_id = c.sample_id and s.import_id= si.sample_import_id)
|
||||
LEFT JOIN (`call` as ca) ON (ca.call_id = a.completed_call_id)
|
||||
WHERE q.enabled=1 AND si.enabled = 1 AND a.end < CONVERT_TZ(NOW(),'System','UTC') AND a.completed_call_id IS NULL AND c.current_outcome_id !=10
|
||||
LEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)
|
||||
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)
|
||||
WHERE q.enabled=1 AND si.enabled=1 AND a.end < CONVERT_TZ(NOW(),'System','UTC') AND a.completed_call_id IS NULL AND c.current_outcome_id !=10
|
||||
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
|
||||
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
|
||||
GROUP BY c.case_id
|
||||
ORDER BY a.start ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
if (!empty($rs)) {
|
||||
xhtml_table($rs,array("description","case_id","start","end","edit","resp","link"),array(T_("Questionnaire"),T_("Case ID"),T_("Start"),T_("End")," <i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i> ",T_("Respondent")," <i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i> "),"tclass",false,false,"bs-table");
|
||||
xhtml_table($rs,array("description","smpl","case_id","start","end","edit","resp","link"),array(T_("Questionnaire"),T_("Sample"),T_("Case ID"),T_("Start"),T_("End")," <i class='fa fa-pencil-square-o fa-lg' data-toggle='tooltip' title='" . T_("Edit") . "'></i> ",T_("Respondent")," <i class='fa fa-trash-o fa-lg' data-toggle='tooltip' title='" . T_("Delete") . "'></i> "),"tclass",false,false,"bs-table");
|
||||
|
||||
} else print "<h4 class='well text-info'>" . T_("No appointments missed") . "</h4>";
|
||||
} else print "<h4 class='well text-info'>" . T_("No missed appointments") . "</h4>";
|
||||
|
||||
}
|
||||
xhtml_foot($js_foot);
|
||||
|
||||
@@ -41,7 +41,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -185,41 +185,43 @@ if (isset($_GET['edit']) || isset($_GET['addext']))
|
||||
WHERE extension_id = " . intval($_GET['edit']);
|
||||
|
||||
$rs = $db->GetRow($sql);
|
||||
} else $rs = array();
|
||||
|
||||
print "<a href='?' class='btn btn-default pull-left'>" . T_("Go back") . "</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="panel-body ">
|
||||
<h3 class="col-sm-offset-3"><?php if (isset($_GET['edit']))echo T_("Edit extension"); else echo T_("Add an extension");?></h3>
|
||||
<h3 class="col-lg-offset-3"><?php if (isset($_GET['edit']))echo T_("Edit extension"); else echo T_("Add an extension");?></h3>
|
||||
<form enctype="multipart/form-data" action="?" method="post" name="editext" class="form-horizontal">
|
||||
<div class="form-group form-inline">
|
||||
<label class="control-label col-sm-3"><?php echo T_("Extension name: ");?></label>
|
||||
<input name="extension" type="text" placeholder="<?php echo T_("such as SIP/1000");?>" maxlength="12" required value="<?php echo $rs['extension'];?>" class="form-control"/>
|
||||
<label class="control-label col-lg-3"><?php echo T_("Extension name: ");?></label>
|
||||
<input name="extension" type="text" placeholder="<?php echo T_("such as SIP/1000");?>" maxlength="12" required value="<?php if (isset($_GET['edit']))echo $rs['extension'];?>" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<label class="control-label col-sm-3"><?php echo T_("Extension password: ");?></label>
|
||||
<input name="password" type="text" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" style="width:20em;" maxlength="50" value="<?php echo $rs['password'];?>" class="form-control pull-left" placeholder="<?php echo T_("Enter New Password");?>"/>  <?php echo T_(" or ");?> 
|
||||
<label class="control-label col-lg-3"><?php echo T_("Extension password: ");?></label>
|
||||
<input name="password" type="text" required pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" style="width:20em;" maxlength="50" value="<?php if (isset($_GET['edit'])) echo $rs['password'];?>" class="form-control pull-left" placeholder="<?php echo T_("Enter New Password");?>"/>  <?php echo T_(" or ");?> 
|
||||
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" /> <?php echo T_("New password");?> 
|
||||
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" /> <?php echo T_("characters long");?>
|
||||
</div>
|
||||
|
||||
<div class=" col-sm-offset-3 ">
|
||||
<input type="submit" class="btn btn-primary " value="<?php if (isset($_GET['edit'])) echo T_("Save changes"); else echo T_("Add extension"); ?>" />
|
||||
</div>
|
||||
<div class="form-group form-inline">
|
||||
<div class='col-lg-3'>
|
||||
<a href='?' class='btn btn-default'><?php echo T_("Cancel") ;?></a>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-primary pull-left" value="<?php if (isset($_GET['edit'])) echo T_("Save changes"); else echo T_("Add extension"); ?>" />
|
||||
|
||||
<?php if (isset($_GET['edit'])){?>
|
||||
|
||||
<input name="extensionid" type="hidden" value="<?php echo intval($_GET['edit']);?>"/>
|
||||
|
||||
<?php if (empty($rs['current_operator_id'])) { ?>
|
||||
|
||||
<input type="submit" name="delete" class="btn btn-danger " data-toggle="confirmation" value="<?php echo T_("Delete extension"); ?>" />
|
||||
|
||||
<input type="submit" name="delete" class="btn btn-danger col-lg-offset-2 pull-left" data-toggle="confirmation" value="<?php echo T_("Delete extension"); ?>" />
|
||||
|
||||
<?php } else
|
||||
print "</br></br><b class='well text-danger'>" . T_("Unassign the operator from this extension to be able to delete it") . "</b>";
|
||||
}
|
||||
|
||||
print "</form></div>";
|
||||
print "</div></form></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -241,8 +243,10 @@ else
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
print "<div class='panel-body'>";
|
||||
|
||||
if ($msg != "")
|
||||
print "<p>$msg</p>";
|
||||
print "<p class='alert alert-warning'>$msg</p></br>";
|
||||
|
||||
if (!empty($rs))
|
||||
{
|
||||
@@ -258,14 +262,15 @@ else
|
||||
if ($rs[$i]['assignment'] == "list")
|
||||
$rs[$i]['assignment'] = display_chooser($ers,"operator_id_" . $rs[$i]["extension_id"],"operator_id_" . $rs[$i]["extension_id"],true,"extension_id=".$rs[$i]["extension_id"],true,false,false,false);
|
||||
}
|
||||
print "<div class='panel-body'>";
|
||||
|
||||
xhtml_table($rs,array("extension","firstName","assignment","status","case_id","state","calltime"),array(T_("Extension"),T_("Operator"),T_("Assignment"),T_("VoIP Status"),T_("Case ID"),T_("Call state"),T_("Time on call")),"tclass",array("vs" => "1"));
|
||||
print "</div>";
|
||||
print "</br>";
|
||||
}
|
||||
else
|
||||
print "<p>" . T_("No extensions") . "</p>";
|
||||
print "<p class='alert alert-warning'>" . T_("No extensions") . "</p>";
|
||||
|
||||
print "<div class='col-sm-3'><a href='?addext=addext' class='btn btn-default '>" . T_("Add extension") . "</a></div>";
|
||||
print "<a href='?addext=addext' class='btn btn-primary '>" . T_("Add extension") . "</a>
|
||||
</div>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ include ("../config.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -41,7 +41,7 @@ include ("../config.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/*
|
||||
* XHTML file
|
||||
@@ -85,21 +85,21 @@ include ("../functions/functions.operator.php");
|
||||
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li class=" ">
|
||||
<a href="../" class=" " target="_blanc" style="padding-top: 20px; ">
|
||||
<i class="fa fa-lg fa-users"></i><?php print T_("Operator panel");?>
|
||||
<a href="../index.php" class=" " target="_blanc" style="padding-top: 20px; ">
|
||||
<i class="fa fa-sign-in fa-lg fa-fw "></i><?php print T_("Operator panel");?>
|
||||
</a>
|
||||
</li>
|
||||
<li class=" ">
|
||||
</li>
|
||||
<li class=" ">
|
||||
<a href="../client/index.php" class=" " target="_blanc" style="padding-top: 20px; ">
|
||||
<i class="fa fa-user-secret fa-lg fa-fw "></i><?php print T_("Client panel");?>
|
||||
<i class="fa fa-user-secret fa-lg fa-fw "></i><?php print T_("Client panel");?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown pull-right user-data">
|
||||
<li class="dropdown pull-right user-data">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style=" min-width: 160px;">
|
||||
<i class="fa fa-user fa fa-fw "></i><?php print T_("Logged as:") . " " . $username ;?>
|
||||
<i class="fa fa-user fa-fw "></i><?php print T_("Logged as:") . " " . $username ;?>
|
||||
</a>
|
||||
<!--- User menu // not connected to pages so not working yet // could be hidden -->
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="?g=5&page=operatorlist.php?edit=<?php print get_operator_id(); ?>"><i class="fa fa-cogs fa-fw "></i> <?php print T_("Settings"); ?></a></li>
|
||||
<!--- <li><a href="../screenloc.php"><i class="fa fa-lock fa-fw "></i> <?php print T_("Lock Screen"); ?></a></li> -->
|
||||
<li><a href="../include/limesurvey/admin/admin.php?action=logout"><i class="fa fa-sign-out fa-fw "></i> <?php print T_("Logout"); ?> </a></li>
|
||||
|
||||
@@ -14,7 +14,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -195,7 +195,7 @@ function generate() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form-group clearfix"><div class="col-sm-3"><a href='?' class="btn btn-default"><?php echo T_("Go back") ;?></a></div><div class="col-sm-6">
|
||||
<div class="form-group clearfix"><div class="col-lg-3"><a href='?' class="btn btn-default"><?php echo T_("Go back") ;?></a></div><div class="col-lg-6">
|
||||
<?php
|
||||
print "<h3>" . T_("Operator") . ": " . $rs['username'] . "</h3>";
|
||||
echo "</div></div>";
|
||||
@@ -213,78 +213,92 @@ function generate() {
|
||||
?>
|
||||
<form action="?" method="post" class="form-horizontal panel-body" name="operform">
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-sm-3 control-label"><?php echo T_("Username") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='username' class="form-control" value="<?php echo $rs['username'];?>"/></div>
|
||||
<label for="username" class="col-lg-3 control-label"><?php echo T_("Username") . ": "; ?></label>
|
||||
<div class="col-lg-3"><input type='text' name='username' class="form-control" value="<?php echo $rs['username'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-3 control-label"><?php echo T_("Password") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='password' class="form-control" placeholder="<?php echo T_("leave blank to keep existing password");?>"/></div>
|
||||
<div class="col-sm-6 form-inline"> 
|
||||
<label for="password" class="col-lg-3 control-label"><?php echo T_("Password") . ": "; ?></label>
|
||||
<div class="col-lg-3"><input type='text' name='password' class="form-control" placeholder="<?php echo T_("leave blank to keep existing password");?>"/></div>
|
||||
<div class="col-lg-6 form-inline"> 
|
||||
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default"/> <?php echo T_("Password with");?> 
|
||||
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" /> <?php echo T_("characters");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="firstName" class="col-sm-3 control-label"><?php echo T_("First name") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='firstName' class="form-control" value="<?php echo $rs['firstName'];?>"/></div>
|
||||
<label for="firstName" class="col-lg-3 control-label"><?php echo T_("First name") . ": "; ?></label>
|
||||
<div class="col-lg-3"><input type='text' name='firstName' class="form-control" value="<?php echo $rs['firstName'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lastName" class="col-sm-3 control-label"><?php echo T_("Last name") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='lastName' class="form-control" value="<?php echo $rs['lastName'];?>"/></div>
|
||||
<label for="lastName" class="col-lg-3 control-label"><?php echo T_("Last name") . ": "; ?></label>
|
||||
<div class="col-lg-3"><input type='text' name='lastName' class="form-control" value="<?php echo $rs['lastName'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-3 control-label"><?php echo T_("Email") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='email' class="form-control" value="<?php echo $rs['email'];?>"/></div>
|
||||
<label for="email" class="col-lg-3 control-label"><?php echo T_("Email") . ": "; ?></label>
|
||||
<div class="col-lg-3"><input type='text' name='email' class="form-control" value="<?php echo $rs['email'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="timezone" class="col-sm-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
|
||||
<div class="col-sm-3"><?php display_chooser($tz,"timezone","timezone",false,false,false,true,array("value",$rs['Time_zone_name']),true,"form-inline"); ?></div>
|
||||
<div class="col-sm-6 form-inline">
|
||||
<label for="timezone" class="col-lg-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
|
||||
<div class="col-lg-3"><?php display_chooser($tz,"timezone","timezone",false,false,false,true,array("value",$rs['Time_zone_name']),true,"form-inline"); ?></div>
|
||||
<div class="col-lg-6 form-inline">
|
||||
<?php echo T_("Edit") . " ";?>
|
||||
<a href='timezonetemplate.php' class="btn btn-default"><?php echo T_("TimeZones list");?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="extension_id" class="col-sm-3 control-label"><?php echo T_("Extension") . ": "; ?></label>
|
||||
<div class="col-sm-3"><?php echo display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline"); ?> </div>
|
||||
<div class="col-sm-6 form-inline">
|
||||
<?php echo T_("Edit") . " ";?>
|
||||
<a href='extensionstatus.php' class="btn btn-default"><?php echo T_("Extensions");?></a>
|
||||
|
||||
<?php if (FREEPBX_PATH != false) { ?>
|
||||
<div class="form-group">
|
||||
<label for="voip" class="col-lg-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
|
||||
<div class="col-lg-3"><input name="voip" type="checkbox" onchange="if(this.checked==true){show(this,'usesvoip');} else{ hide(this,'usesvoip');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['voip'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
|
||||
</div>
|
||||
<div id="usesvoip" style="display:none" >
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Extension") . ": ";?></label>
|
||||
|
||||
<?php if (!empty($ers) ){ ?>
|
||||
<div class="col-lg-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div>
|
||||
<div class="col-lg-6 form-inline"> <?php echo T_("Edit") . " "; }
|
||||
else{ ?> <div class="col-lg-6 form-inline"> <?php echo T_("Add") . " "; }?>
|
||||
<a href='extensionstatus.php' class="btn btn-default fa"><?php echo T_("Extensions");?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="voip" class="col-sm-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
|
||||
<div class="col-sm-3"><input type="checkbox" name="voip" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['voip'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_enable" type="checkbox" onchange="if(this.checked==true){show(this,'jabdata');} else{ hide(this,'jabdata');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['chat_enable'] == 1) echo "checked=\"checked\"";?> value="1"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="chat_user" class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='chat_user' class="form-control" value="<?php echo $rs['chat_user'];?>"/></div>
|
||||
|
||||
<div id="jabdata" style="display:none" >
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_user" type="text" class="form-control" value="<?php echo $rs['chat_user'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_password" type="text" class="form-control" value="<?php echo $rs['chat_password'];?>"/></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="chat_password" class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": "; ?></label>
|
||||
<div class="col-sm-3"><input type='text' name='chat_password' class="form-control" value="<?php echo $rs['chat_password'];?>"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="admin" class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin'] || ($rs['parent_id'] == 0)) echo " checked=\"checked\" "; if ($rs['parent_id'] == 0) echo " disabled=\"disabled\" "; ?> value="1"/></div>
|
||||
<label for="admin" class="col-lg-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||
<div class="col-lg-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger" <?php if ($rs['superadmin'] || ($rs['parent_id'] == 0)) echo " checked=\"checked\" "; if ($rs['parent_id'] == 0) echo " disabled=\"disabled\" "; ?> value="1"/></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="chat_enable" class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
||||
<div class="col-sm-3"><input type="checkbox" name="chat_enable" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['chat_enable'] == 1) echo "checked=\"checked\"";?> value="1"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="enabled" class="col-sm-3 control-label"><?php echo T_("Enabled") . "? ";?></label>
|
||||
<div class="col-sm-3"><input type="checkbox" name="enabled" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['enabled'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
|
||||
<label for="enabled" class="col-lg-3 control-label"><?php echo T_("Enabled") . "? ";?></label>
|
||||
<div class="col-lg-3"><input type="checkbox" name="enabled" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" <?php if ($rs['enabled'] == 1) echo "checked=\"checked\"";?> value="1" /></div>
|
||||
</div>
|
||||
<div><input type='hidden' name='operator_id' value='<?php echo $operator_id;?>'/></div>
|
||||
<div><input type='hidden' name='existing_username' value="<?php echo $rs['username'];?>"/></div>
|
||||
|
||||
<div class="form-group"><div class="col-sm-3 col-sm-offset-3"><input type="submit" name="submit" class="btn btn-primary btn-block" value="<?php echo T_("Update operator");?>"/></div></div>
|
||||
<div class="form-group"><div class="col-lg-3 col-lg-offset-3"><input type="submit" name="submit" class="btn btn-primary btn-block" value="<?php echo T_("Update operator");?>"/></div></div>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
xhtml_foot();
|
||||
xhtml_foot(array("../js/new.js"));
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -402,11 +416,11 @@ if ($display)
|
||||
$titles[] = T_("Win file");//Windows VoIP
|
||||
$titles[] = T_("*nix flle");//*nix VoIP
|
||||
}
|
||||
echo "<div class='col-sm-9'><div class='panel-body'>";
|
||||
echo "<div class='col-lg-9'><div class='panel-body'>";
|
||||
xhtml_table($rs,$columns,$titles);
|
||||
echo "</div></div>";
|
||||
|
||||
echo "<div class='form-group col-sm-3'>
|
||||
echo "<div class='form-group col-lg-3'>
|
||||
<div class='panel-body'><a href='operators.php?add=add' class='btn btn-default btn-block'><i class='fa fa-lg fa-user-plus'></i> " . T_("Add an operator") . "</a></div>
|
||||
<div class='panel-body'><a href='extensionstatus.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-whatsapp'></i> " . T_("Extensions") . "</a></div>
|
||||
<div class='panel-body'><a href='operatorquestionnaire.php' class='btn btn-default btn-block'><i class='fa fa-lg fa-link'></i> " . T_("Assign to questionnaire") . "</a></div>
|
||||
|
||||
@@ -41,7 +41,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -96,15 +96,11 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
|
||||
$extensionp = "'$extensionnp'";
|
||||
|
||||
}
|
||||
$supervisor = 0;
|
||||
$temporary = 0;
|
||||
|
||||
$admin = 0;
|
||||
$refusal = 0;
|
||||
$voip = 0;
|
||||
$chat = 0;
|
||||
if (isset($_POST['supervisor']) && $_POST['supervisor'] == "on") $supervisor = 1;
|
||||
if (isset($_POST['refusal']) && $_POST['refusal'] == "on") $refusal = 1;
|
||||
if (isset($_POST['temporary']) && $_POST['temporary'] == "on") $temporary = 1;
|
||||
|
||||
if (isset($_POST['admin']) && $_POST['admin'] == "on") $admin = 1;
|
||||
if (isset($_POST['voip']) && $_POST['voip'] == "on") $voip = 1;
|
||||
if (isset($_POST['chat_enable']) && $_POST['chat_enable'] == "on") $chat = 1;
|
||||
@@ -149,26 +145,18 @@ if (isset($_POST['operator']) && isset($_POST['adduser']))
|
||||
|
||||
$a = "<div class='alert alert-info'><h3>" . T_("Added operator :") . " " . $operator . "</h3>";
|
||||
|
||||
if (FREEPBX_PATH !== false)
|
||||
if (FREEPBX_PATH !== false)
|
||||
$a .= "<br/><a href='/voip/admin/'>" . T_("FreePBX needs to be reloaded for the new VoIP extension to take effect") . "</a>";
|
||||
|
||||
print "</div>";
|
||||
$a .= "</div>";
|
||||
|
||||
// set default skills = 1 and 5 for all new operators
|
||||
|
||||
if ($temporary)
|
||||
{
|
||||
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
|
||||
VALUES ('$oid','1')");
|
||||
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
|
||||
VALUES ('$oid','5')"); //and appointment
|
||||
}
|
||||
|
||||
if ($supervisor)
|
||||
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
|
||||
VALUES ('$oid','2')");
|
||||
|
||||
if ($refusal)
|
||||
$db->Execute(" INSERT INTO operator_skill (operator_id,outcome_type_id)
|
||||
VALUES ('$oid','3')");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -242,84 +230,87 @@ function generate() {
|
||||
|
||||
<form enctype="multipart/form-data" action="" method="post" class="form-horizontal panel-body" name="operform">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Username") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="operator" type="text" class="form-control" required /></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Username") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="operator" type="text" class="form-control" required /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Password") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="password" id="password" type="text" class="form-control" required /></div>
|
||||
<div class="col-sm-6 form-inline"> 
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Password") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="password" id="password" type="text" class="form-control" required /></div>
|
||||
<div class="col-lg-6 form-inline"> 
|
||||
<input type="button" onclick="generate();" value="<?php echo T_("Generate");?>" class="btn btn-default fa" /> <?php echo T_("Password with");?> 
|
||||
<input type="number" name="number" value="25" min="8" max="50" style="width:5em;" class="form-control" /> <?php echo T_("characters");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("First name") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="firstname" type="text" class="form-control" required/></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("First name") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="firstname" type="text" class="form-control" required/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Last name") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="lastname" type="text" class="form-control"/></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Last name") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="lastname" type="text" class="form-control"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Email") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="email" type="text" class="form-control"/></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Email") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="email" type="text" class="form-control"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
|
||||
<div class="col-sm-3"><?php display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,true,array("value",get_setting("DEFAULT_TIME_ZONE")),true,"form-inline");?></div>
|
||||
<div class="col-sm-6 form-inline">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Timezone") . ": ";?></label>
|
||||
<div class="col-lg-3"><?php display_chooser($rs,"Time_zone_name","Time_zone_name",false,false,false,true,array("value",get_setting("DEFAULT_TIME_ZONE")),true,"form-inline");?></div>
|
||||
<div class="col-lg-6 form-inline">
|
||||
<?php echo T_("Edit") . " ";?>
|
||||
<a href='timezonetemplate.php' class="btn btn-default fa"><?php echo T_("TimeZones list");?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (FREEPBX_PATH == false) { ?>
|
||||
<?php if (VOIP_ENABLED != false) { ?>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Extension") . ": ";?></label>
|
||||
<div class="col-sm-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div>
|
||||
<div class="col-sm-6 form-inline">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
|
||||
<div class="col-lg-3"><input name="voip" type="checkbox" onchange="if(this.checked==true){show(this,'usesvoip');} else{ hide(this,'usesvoip');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div><!-- checked="checked" -->
|
||||
</div>
|
||||
<div id="usesvoip" style="display:none" >
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Extension") . ": ";?></label>
|
||||
<div class="col-lg-3"><?php display_chooser($ers,"extension_id","extension_id",true,false,false,true,false,true,"form-inline");?></div>
|
||||
<div class="col-lg-6 form-inline">
|
||||
<?php echo T_("Edit") . " ";?>
|
||||
<a href='extensionstatus.php' class="btn btn-default fa"><?php echo T_("Extensions");?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Uses VoIP") . "? ";?></label>
|
||||
<div class="col-sm-3"><input name="voip" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" checked="checked"/></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_enable" type="checkbox" onchange="if(this.checked==true){show(this,'jabdata');} else{ hide(this,'jabdata');}" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div>
|
||||
</div>
|
||||
|
||||
<div id="jabdata" style="display:none" >
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_user" type="text" class="form-control"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
|
||||
<div class="col-lg-3"><input name="chat_password" type="text" class="form-control"/></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat user") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="chat_user" type="text" class="form-control"/></div>
|
||||
<label class="col-lg-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||
<div class="col-lg-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Jabber/XMPP chat password") . ": ";?></label>
|
||||
<div class="col-sm-3"><input name="chat_password" type="text" class="form-control"/></div>
|
||||
|
||||
<br/>
|
||||
<div class="form-group form-inline">
|
||||
<div class='col-lg-3'>
|
||||
<a href='operatorlist.php' class='btn btn-default col-lg-6'><?php echo T_("Cancel") ;?></a>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<input type="submit" name="adduser" class="btn btn-primary btn-block" value="<?php echo T_("Add an operator"); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Uses chat") . "? ";?></label>
|
||||
<div class="col-sm-3"><input name="chat_enable" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a system administrator?");?></label>
|
||||
<div class="col-sm-3"><input name="admin" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="primary" data-onstyle="danger"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a normal interviewer?");?></label>
|
||||
<div class="col-sm-3"><input name="temporary" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-offstyle="danger" checked="checked"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a supervisor?");?></label>
|
||||
<div class="col-sm-3"><input name="supervisor" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger" data-offstyle="primary"/></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label"><?php echo T_("Is the operator a refusal converter?");?></label>
|
||||
<div class="col-sm-3"><input name="refusal" type="checkbox" data-toggle="toggle" data-on="<?php echo T_("Yes"); ?>" data-off="<?php echo T_("No"); ?>" data-onstyle="danger" data-offstyle="primary"/></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"><div class="col-sm-3 col-sm-offset-3"><input type="submit" name="adduser" class="btn btn-primary btn-block" value="<?php echo T_("Add an operator"); ?>" /></div></div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
xhtml_foot();
|
||||
xhtml_foot(array("../js/new.js"));
|
||||
?>
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php /**
|
||||
<?php
|
||||
/**
|
||||
* Display outcomes by questionnaire
|
||||
*/
|
||||
|
||||
@@ -15,7 +16,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -67,7 +68,7 @@ $js_foot = array(
|
||||
"../js/custom.js"
|
||||
);
|
||||
|
||||
xhtml_head(T_("Questionnaire Outcomes"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js")
|
||||
xhtml_head(T_("Questionnaire Outcomes"),true,$css,$js_head);
|
||||
|
||||
|
||||
print "<h3 class='col-sm-4 pull-left text-right'>" . T_("Select a questionnaire") . "</h3>";
|
||||
@@ -84,7 +85,7 @@ if ($questionnaire_id != false)
|
||||
JOIN questionnaire_sample as qs ON (qs.questionnaire_id = '$questionnaire_id' and qs.sample_import_id = s.import_id)
|
||||
LEFT JOIN `case` as c ON (c.questionnaire_id = qs.questionnaire_id and c.sample_id = s.sample_id)
|
||||
GROUP BY (c.sample_id is not null)";
|
||||
if ($db->GetAll($sql)) xhtml_table($db->GetAll($sql),array("drawn","count"),array(T_("Status"),T_("Number")), "table-hover table table-condensed", false, array("count"));
|
||||
if ($db->GetAll($sql)) xhtml_table($db->GetAll($sql),array("drawn","count"),array(T_("Status"),T_("Number")), "tclass", false, array("count"));
|
||||
else print "<div class='alert text-danger'>" . T_("No samples assigned") . ". </div>";
|
||||
print "</div>";
|
||||
|
||||
@@ -143,7 +144,7 @@ group by s.import_id";
|
||||
$a = $db->GetAssoc($sql);
|
||||
$a = aapor_clean($a);
|
||||
|
||||
print "<table class='col-sm-10'><thead><tr><th class='col-sm-8'>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr></thead>"; // table-hover table table-condensed
|
||||
print "<table class='col-sm-10'><thead><tr><th class='col-sm-8'>" . T_("Outcome") . "</th><th>" . T_("Rate") . "</th></tr></thead>";
|
||||
print "<tr><td>" . T_("Response Rate 1") . "</td><td>" . round(aapor_rr1($a),2) . "</td></tr>";
|
||||
print "<tr><td>" . T_("Refusal Rate 1") . "</td><td>" . round(aapor_ref1($a),2) . "</td></tr>";
|
||||
print "<tr><td>" . T_("Cooperation Rate 1") . "</td><td>" . round(aapor_coop1($a),2) . "</td></tr>";
|
||||
@@ -153,7 +154,7 @@ group by s.import_id";
|
||||
$sql = "SELECT count(case_id) FROM `case` WHERE `case`.questionnaire_id = '$questionnaire_id'";
|
||||
$cases = $db->GetOne($sql);
|
||||
|
||||
$sql = "SELECT CONCAT('<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&outcome_id=', o.outcome_id, '\'>', o.description, '</a>') as des, o.outcome_id, count( c.case_id ) as count, ROUND((count( c.case_id ) / $cases) * 100,2) as perc
|
||||
$sql = "SELECT CONCAT(' <a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&outcome_id=', o.outcome_id, '\'><b>', '=>' ,'</b></a> ')as link, o.description as des, o.outcome_id, count(c.case_id) as count, ROUND((count( c.case_id ) / $cases) * 100,2) as perc
|
||||
FROM `case` AS c, `outcome` AS o
|
||||
WHERE c.questionnaire_id = '$questionnaire_id'
|
||||
AND c.current_outcome_id = o.outcome_id
|
||||
@@ -165,7 +166,7 @@ group by s.import_id";
|
||||
{ print "<div class='col-sm-8'><div class='panel panel-body'>";
|
||||
//print "<h4>" . T_("Total cases for questionnaire") . " = <b>$cases</b></h4>";
|
||||
translate_array($rs,array("des"));
|
||||
xhtml_table($rs,array("des","count","perc"),array(T_("Outcome"),T_("Count")," " . T_("%")),"tclass",false,array("count","perc"));//array("des" => "Complete")
|
||||
xhtml_table($rs,array("outcome_id","des","link","count","perc"),array(T_("ID"),T_("Outcome"),"",T_("Count")," " . T_("%")),"tclass",false,array("count","perc"));//array("des" => "Complete")
|
||||
print "</div></div>";
|
||||
|
||||
$sample_import_id = false;
|
||||
@@ -202,7 +203,7 @@ group by s.import_id";
|
||||
print "<div class='col-sm-8'><div class='panel panel-body'>"; //<p>" . T_("Outcomes") . "</p>";
|
||||
|
||||
|
||||
$sql = "SELECT CONCAT('<a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id&outcome_id=', o.outcome_id, '\'>', o.description, '</a>') as des, o.outcome_id, count( c.case_id ) as count,ROUND(count(c.case_id) / (SELECT count(case_id) FROM `case` JOIN sample ON (`case`.sample_id = sample.sample_id AND sample.import_id = '$sample_import_id') WHERE questionnaire_id = '$questionnaire_id' ) * 100,2) as perc
|
||||
$sql = "SELECT CONCAT(' <a href=\'casesbyoutcome.php?questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id&outcome_id=', o.outcome_id, '\'><b>', '=>' ,'</b></a> ')as link, o.description as des, o.outcome_id, count( c.case_id ) as count, ROUND(count(c.case_id) / (SELECT count(case_id) FROM `case` JOIN sample ON (`case`.sample_id = sample.sample_id AND sample.import_id = '$sample_import_id') WHERE questionnaire_id = '$questionnaire_id' ) * 100,2) as perc
|
||||
|
||||
FROM `case` AS c, `outcome` AS o, sample as s
|
||||
WHERE c.questionnaire_id = '$questionnaire_id'
|
||||
@@ -216,7 +217,7 @@ group by s.import_id";
|
||||
if (!empty($rs))
|
||||
{
|
||||
translate_array($rs,array("des"));
|
||||
xhtml_table($rs,array("des","count","perc"),array(T_("Outcome"),T_("Count"),T_("%")),"tclass",array("des" => "Complete"),array("count","perc"));
|
||||
xhtml_table($rs,array("outcome_id","des","link","count","perc"),array(T_("ID"),T_("Outcome"),"",T_("Count")," " . T_("%")),"tclass",array("des" => "Complete"),array("count","perc"));
|
||||
}
|
||||
else
|
||||
print "<p>" . T_("No outcomes recorded for this sample") . "</p>";
|
||||
|
||||
@@ -42,7 +42,7 @@ include("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -563,7 +563,7 @@ else
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-calendar fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
ELSE
|
||||
CONCAT('<a href=\'addshift.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Shifts") . " \n" . TQ_("questionnaire") . " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-calendar fa-2x\'></i></a>')
|
||||
CONCAT('<a href=\'addshift.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Shifts") . " " . TQ_("questionnaire") . " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-calendar fa-2x\'></i></a>')
|
||||
END as shifts,
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-square-o fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
@@ -580,18 +580,22 @@ else
|
||||
ELSE
|
||||
CONCAT('<a href=\'outcomes.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Outcomes for questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-bar-chart fa-2x\'></i></a>')
|
||||
END as outcomes,
|
||||
CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls,
|
||||
CONCAT('<a href=\'set_outcomes.php?qid=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Set outcomes"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-list-ol fa-2x\'></i></a>') as setoutcomes,
|
||||
CONCAT('<a href=\'callhistory.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Call history"). " " . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-phone fa-2x\'></i></a>') as calls,
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-download fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
ELSE
|
||||
CONCAT('<a href=\'dataoutput.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Data output"). " \n" . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-download fa-2x\'></i></a>')
|
||||
CONCAT('<a href=\'dataoutput.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Data output"). " " . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-download fa-2x\'></i></a>')
|
||||
END as dataout,
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-book fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
ELSE
|
||||
CONCAT('<a href=\'assignsample.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . TQ_("Assigned samples"). "\' data-toggle=\'tooltip\'><i class=\'fa fa-book fa-2x\'></i></a>')
|
||||
END as assample,
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-filter fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
ELSE
|
||||
CONCAT('<a href=\'quotareport.php?questionnaire_id=',questionnaire_id,'\' class=\'btn\' title=\'" . T_("Quota report"). " " . TQ_("questionnaire"). " ',questionnaire_id,'\' data-toggle=\'tooltip\'><i class=\'fa fa-filter fa-2x\'></i></a>')
|
||||
END as quotareport,
|
||||
CASE WHEN enabled = 0 THEN
|
||||
CONCAT('<i class=\'btn fa fa-question-circle fa-2x\' style=\'color:lightgrey;\'></i>')
|
||||
ELSE
|
||||
@@ -600,7 +604,7 @@ else
|
||||
FROM questionnaire";
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
$columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","dataout","modify","setoutcomes","inlime","prefill","deletee");
|
||||
$columns = array("qid","description","status","enabledisable","outcomes","calls","casestatus","shifts","assample","quotareport","dataout","modify","inlime","prefill","deletee");
|
||||
xhtml_table($rs,$columns,false,"table-hover table-condensed ");
|
||||
|
||||
print "</div>";
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -101,7 +101,9 @@ if (isset($_GET['questionnaire_id']) && isset($_GET['questionnaire_prefill_id'])
|
||||
$questionnaire_id = false;
|
||||
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
|
||||
|
||||
xhtml_head(T_("Pre fill questionnaire: Set values for questionnaire to prefill"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"));
|
||||
$subtitle = T_("Set values for questionnaire to prefill");
|
||||
|
||||
xhtml_head(T_("Prefill questionnaire:"),true,array("../include/bootstrap/css/bootstrap.min.css","../css/custom.css"),array("../js/window.js"), false, false, false, $subtitle);
|
||||
print "<h3 class='form-inline pull-left'>" . T_("Select a questionnaire") . ": </h3>";
|
||||
|
||||
$sql = "SELECT questionnaire_id as value,description,
|
||||
@@ -182,14 +184,16 @@ if ($questionnaire_id != false)
|
||||
AND sivr.sample_import_id = qs.sample_import_id";
|
||||
?>
|
||||
<form action="" method="get" class="form-inline form-group">
|
||||
<label for="value"><?php echo T_("The value to pre fill"); ?>: </label><input type="text" name="value" id="value" size="50" class="form-control"/>
|
||||
<label for="svar"> <?php echo T_("or: Select pre fill from sample list"); ?> </label>
|
||||
<p><label for="value"><?php echo T_("The value to pre fill"); ?>: </label><input type="text" name="value" id="value" size="50" class="form-control"/></p>
|
||||
<p><label for="svar"><?php echo T_("or: Select pre fill from sample list"); ?> </label>
|
||||
<?php //display a list of possible sample variables for this questionnaire
|
||||
display_chooser($db->GetAll($sql),"svar","svar",true,false,false,true,false,true,"form-group");
|
||||
display_chooser($db->GetAll($sql),"svar","svar",true,false,false,false,false,true,"form-group");
|
||||
?>
|
||||
</p>
|
||||
<input type="hidden" name="questionnaire_id" value="<?php print($questionnaire_id); ?>"/>
|
||||
<input type="hidden" name="sgqa" value="<?php print($sgqa); ?>"/>
|
||||
<input type="submit" name="add_prefill" class="btn btn-primary fa" value="<?php print(T_("Add pre fill")); ?>"/>
|
||||
</br>
|
||||
<p><input type="submit" name="add_prefill" class="btn btn-primary fa" value="<?php print(T_("Add pre fill")); ?>"/></p>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -129,7 +129,8 @@ if ($questionnaire_id != false)
|
||||
$sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
|
||||
FROM sample_import as s, questionnaire_sample as q
|
||||
WHERE q.questionnaire_id = $questionnaire_id
|
||||
AND q.sample_import_id = s.sample_import_id";
|
||||
AND q.sample_import_id = s.sample_import_id
|
||||
AND s.enabled = 1";
|
||||
$s = $db->GetAll($sql);
|
||||
if (!empty($s)){
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -44,7 +44,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -305,7 +305,8 @@ if ($questionnaire_id != false)
|
||||
$sql = "SELECT s.sample_import_id as value,s.description, CASE WHEN s.sample_import_id = '$sample_import_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
|
||||
FROM sample_import as s, questionnaire_sample as q
|
||||
WHERE q.questionnaire_id = $questionnaire_id
|
||||
AND q.sample_import_id = s.sample_import_id";
|
||||
AND q.sample_import_id = s.sample_import_id
|
||||
AND s.enabled = 1";
|
||||
$s = $db->GetAll($sql);
|
||||
if (!empty($s)){
|
||||
print "<h3 class='form-inline pull-left'>   " . T_("Sample") . ": </h3>";
|
||||
@@ -317,9 +318,6 @@ if ($questionnaire_id != false)
|
||||
|
||||
print "<div class='col-sm-2 pull-right'><a href='quotareport.php?questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id' class='btn btn-info btn-block'><i class='fa fa-filter fa-lg'></i> " . T_("To quota report") . "</a></div>";
|
||||
|
||||
print "<div class='clearfix'></div>";
|
||||
|
||||
|
||||
if ($sample_import_id != false)
|
||||
{
|
||||
if (isset($_POST['import_quota']))
|
||||
@@ -387,8 +385,9 @@ if ($questionnaire_id != false)
|
||||
|
||||
if ($qsqri != false)
|
||||
{
|
||||
print "<h2 class='col-sm-2'><a href='?questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id' class='btn btn-default'><i class='fa fa-arrow-up fa-lg text-primary'></i> " . T_("To Row quotas") . "</a></h2>";
|
||||
print "<h2>" . T_("Quota") . ": $qsqrid</h2>";
|
||||
print "<div class='col-lg-3 pull-right'><a href='?questionnaire_id=$questionnaire_id&sample_import_id=$sample_import_id' class='btn btn-default'><i class='fa fa-arrow-up fa-lg text-primary'></i> " . T_("To Row quotas") . "</a></div>";
|
||||
print "<div class='clearfix form-group'></div>";
|
||||
print "<h2 class='col-lg-offset-4'>" . T_("Quota") . ": $qsqrid</h2>";
|
||||
|
||||
?>
|
||||
<div class='panel-body' >
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -121,8 +121,6 @@ function sample_call_attempt_report($questionnaire_id = false, $sample_id = fals
|
||||
|
||||
$outcomes = $db->GetAssoc($sql);
|
||||
|
||||
translate_array($outcomes,array("description"));
|
||||
|
||||
$rep = array("callattempts","sample");
|
||||
$rept = array(T_("Call attempts made"),T_("Number of cases"));
|
||||
$totals = array("sample");
|
||||
@@ -132,7 +130,7 @@ function sample_call_attempt_report($questionnaire_id = false, $sample_id = fals
|
||||
foreach($outcomes as $key => $val)
|
||||
{
|
||||
$rep[] = $key;
|
||||
$rept[] = $val;
|
||||
$rept[] = T_($val);
|
||||
$outcomesfilled[$key] = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ include_once(dirname(__FILE__).'/../db.inc.php');
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -298,16 +298,14 @@ if (isset($_GET['edit']) )
|
||||
$sql = "SELECT type, description
|
||||
FROM sample_var_type";
|
||||
$rd = $db->GetAll($sql);
|
||||
$selected = "selected=\"selected\"";
|
||||
|
||||
$sql = "SELECT sir.var_id,
|
||||
CONCAT('<input type=\"text\" onInput=\"$(this).attr(\'name\',\'var[',sir.var_id,']\');\" value=\"' ,sir.var, '\" required class=\"form-control\" style=\"min-width: 300px;\" $dis />') as var,
|
||||
CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis >
|
||||
<option value=\"' ,svt.type, '\" $selected>' ,svt.description, '</option>";
|
||||
|
||||
CONCAT ('<select name=\"type[',sir.var_id,']\" class=\"form-control\" $dis >";
|
||||
foreach($rd as $r)
|
||||
{
|
||||
$sql .= "<option value=\"{$r['type']}\">" . T_($r['description']) . "</option>";
|
||||
}
|
||||
{
|
||||
$sql .= "<option value=\"{$r['type']}\"', CASE WHEN ( svt.type = {$r['type']}) THEN 'selected=\"selected\"' ELSE '' END , ' >" . T_($r['description']) . "</option>";
|
||||
}
|
||||
$sql .= "</select>') as type, sv.val,
|
||||
CONCAT('<input type=\'checkbox\' ', CASE WHEN (sir.restrict IS NULL || sir.restrict = 0) THEN 'checked=\"checked\"' ELSE '' END ,' name=\"see[]\" value=\'',sir.var_id,'\' data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\"/>') as see,
|
||||
CONCAT('<input type=\'checkbox\' name=\"del[',sir.var_id,']\" value=\'',sir.var_id,'\' $dis data-toggle=\"toggle\" data-size=\"small\" data-style=\"center-block\" data-on=" . TQ_("Yes") . " data-off=" . TQ_("No") . " data-width=\"70\" data-onstyle=\'danger \'/>') as del,
|
||||
|
||||
@@ -44,7 +44,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -16,7 +16,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
@@ -122,7 +122,7 @@ if (isset($_GET['case_note_id']))
|
||||
$db->Execute($sql);
|
||||
}
|
||||
|
||||
xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);//array("../css/table.css"),array("../js/window.js")
|
||||
xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);
|
||||
|
||||
?>
|
||||
|
||||
@@ -137,13 +137,18 @@ xhtml_head(T_("Assign outcomes to cases"),true,$css,$js_head);//array("../css/ta
|
||||
<?php
|
||||
$sql = "SELECT c.case_id as value, c.case_id as description, CASE WHEN c.case_id = '$case_id' THEN 'selected=\'selected\'' ELSE '' END AS selected
|
||||
FROM `case` AS c, `outcome` AS o, `questionnaire` AS q, `sample` AS s, `sample_import` AS si
|
||||
LEFT JOIN (questionnaire_sample_quota as qsq) on (si.sample_import_id = qsq.sample_import_id)
|
||||
LEFT JOIN (questionnaire_sample_quota_row as qsqr) on (si.sample_import_id = qsqr.sample_import_id)
|
||||
WHERE c.current_outcome_id = o.outcome_id
|
||||
AND q.questionnaire_id = c.questionnaire_id
|
||||
AND s.sample_id = c.sample_id
|
||||
AND s.import_id = si.sample_import_id
|
||||
AND q.enabled = 1
|
||||
AND si.enabled =1
|
||||
AND o.outcome_type_id =2";
|
||||
AND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )
|
||||
AND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)
|
||||
AND o.outcome_type_id =2
|
||||
ORDER BY c.case_id ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* Process
|
||||
|
||||
@@ -43,7 +43,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* XHTML functions
|
||||
|
||||
@@ -42,7 +42,7 @@ include ("../db.inc.php");
|
||||
/**
|
||||
* Authentication file
|
||||
*/
|
||||
include ("auth-admin.php");
|
||||
require ("auth-admin.php");
|
||||
|
||||
/**
|
||||
* Process
|
||||
|
||||
Reference in New Issue
Block a user