本文整理汇总了PHP中xhtml_table函数的典型用法代码示例。如果您正苦于以下问题:PHP xhtml_table函数的具体用法?PHP xhtml_table怎么用?PHP xhtml_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xhtml_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: case_status_report
/**
* Generate the case status report
*
* @param mixed $questionnaire_id The quesitonnaire, if specified
* @param string $sample_id The sample, if speified
* @param mixed $outcome_id THe outcome id, if specified
*
* @return false if empty otherwise true if table drawn
* @author Adam Zammit <adam.zammit@acspri.org.au>
* @since 2012-10-02
*/
function case_status_report($questionnaire_id = false, $sample_id = false, $outcome_id = false)
{
global $db;
$q = "";
if ($questionnaire_id !== false) {
$q = "AND c.questionnaire_id = {$questionnaire_id}";
}
$s = "";
if ($sample_id !== false) {
$s = "AND s.import_id = '{$sample_id}'";
}
$o = "";
if ($outcome_id !== false) {
$o = "AND c.current_outcome_id = {$outcome_id}";
}
$sql = "SELECT \tCONCAT('<a href=\\'supervisor.php?case_id=', c.case_id, '\\'>', c.case_id, '</a>') as case_id,\r\n\t\t\to.description as outcomes,\r\n\t\t\tsi.description as samples, s.Time_zone_name as timezone, TIME_FORMAT(CONVERT_TZ(NOW(),@@session.time_zone,s.Time_zone_name),'" . TIME_FORMAT . "') as time, (SELECT COUNT(*) FROM `call` WHERE `call`.case_id = c.case_id) as nrcalls, (SELECT COUNT(*) FROM call_attempt WHERE call_attempt.case_id = c.case_id) as nrattempts, \t\r\n\t\t\tCASE WHEN ca.end IS NULL THEN '" . TQ_("Available") . "'\r\n\t\t\t\tWHEN TIME_TO_SEC(TIMEDIFF(ca.end,CONVERT_TZ(DATE_SUB(NOW(), INTERVAL co.default_delay_minutes MINUTE),'System','UTC'))) < 0 THEN '" . TQ_("Available") . "'\r\n\t\t\t\tELSE CONCAT(ROUND(TIME_TO_SEC(TIMEDIFF(ca.end,CONVERT_TZ(DATE_SUB(NOW(), INTERVAL co.default_delay_minutes MINUTE),'System','UTC'))) / 60),' " . TQ_("minutes") . "')\r\n\t\t\tEND AS availableinmin,\r\n\t\t\tCASE WHEN oq.operator_id IS NULL THEN \r\n\t\t\t\tCONCAT('')\r\n\t\t\tELSE CONCAT('<span class=\\'text-info\\'>', oq.firstName,' ',oq.lastName,'</span>')\r\n\t\t\tEND AS assignedoperator,\r\n\t\t\tCASE WHEN oq.operator_id IS NULL THEN \r\n\t\t\t\tCONCAT('')\r\n\t\t\tELSE CONCAT('   ', cq.sortorder ,' ')\r\n\t\t\tEND AS ordr,\r\n\t\t\tCASE WHEN oq.operator_id IS NULL THEN \r\n\t\t\t\tCONCAT('<span data-toggle=\\'tooltip\\' title=\\'" . TQ_("Not assigned, select to assign") . "\\'><input type=\\'checkbox\\' name=\\'c', c.case_id, '\\' value=\\'', c.case_id, '\\' /></span>')\r\n\t\t\tELSE CONCAT('<a href=\"?questionnaire_id={$questionnaire_id}&sample_import_id={$sample_id}&unassign=', cq.case_queue_id, '\" data-toggle=\\'tooltip\\' title=\\'" . TQ_("Click to unassign") . "\\'><i class=\\'fa fa-trash-o fa-lg text-danger\\'></i></a>')\r\n\t\t\tEND AS flag\t\r\n\t\tFROM `case` as c\r\n\t\tJOIN questionnaire as q ON (q.questionnaire_id = c.questionnaire_id and q.enabled = 1)\r\n\t\tJOIN outcome as o ON (o.outcome_id = c.current_outcome_id AND o.outcome_type_id = 1)\r\n\t\tJOIN sample as s ON (s.sample_id = c.sample_id {$s})\r\n\t\tJOIN sample_import as si ON (s.import_id = si.sample_import_id AND si.enabled = 1)\r\n\t\tJOIN questionnaire_sample as qs ON (qs.questionnaire_id = {$questionnaire_id} AND qs.sample_import_id = s.import_id)\r\n\t\tLEFT JOIN `call` as ca ON (ca.call_id = c.last_call_id)\r\n\t\tLEFT JOIN outcome as co ON (co.outcome_id = ca.outcome_id)\r\n\t\tLEFT JOIN case_queue as cq ON (cq.case_id = c.case_id)\r\n\t\tLEFT JOIN operator as oq ON (cq.operator_id = oq.operator_id)\r\n\t\tLEFT JOIN (questionnaire_sample_quota as qsq) on (s.import_id = qsq.sample_import_id and c.questionnaire_id = qsq.questionnaire_id)\r\n\t\tLEFT JOIN (questionnaire_sample_quota_row as qsqr) on (s.import_id = qsqr.sample_import_id and c.questionnaire_id = qsqr.questionnaire_id)\r\n\t\tWHERE c.current_operator_id IS NULL {$q} {$o}\r\n\t\tAND (qsq.quota_reached IS NULL OR qsq.quota_reached != 1 )\r\n\t\tAND (qsqr.quota_reached IS NULL OR qsqr.quota_reached != 1)\r\n\t\tGROUP BY c.case_id ORDER BY c.case_id ASC";
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($rs2, $datacol, $headers, "tclass", false, false, "bs-table");
$sql = "SELECT operator_id as value,CONCAT(firstName,' ', lastName) as description, '' selected\r\n\t\tFROM operator\r\n\t\tWHERE enabled = 1";
$rs3 = $db->GetAll($sql);
print "<h4 class='col-sm-offset-5 pull-left text-right control-label'>" . T_("Assign selected cases to") . " " . T_("operator") . " : </h4> ";
display_chooser($rs3, "operator_id", "operator_id", true, false, false, true, false, true, "pull-left");
print " <button class='btn btn-default' type='submit' data-toggle='tooltip' title='" . T_("Assign cases to operator queue") . "'><i class='fa fa-link fa-lg text-primary'></i> " . T_("Assign") . "</button>";
print "</form></br>";
return true;
}
示例2: unset
unset($_POST['dtzph']);
$db->CompleteTrans();
}
xhtml_foot($js_foot);
exit;
}
if (isset($_GET['sampledisable'])) {
$id = intval($_GET['sampledisable']);
$sql = "UPDATE sample_import\r\n\t\tSET enabled = 0\r\n\t\tWHERE sample_import_id = '{$id}'";
$db->Execute($sql);
}
if (isset($_GET['sampleenable'])) {
$id = intval($_GET['sampleenable']);
$sql = "UPDATE sample_import\r\n\t\tSET enabled = 1\r\n\t\tWHERE sample_import_id = '{$id}'";
$db->Execute($sql);
}
$sql = "SELECT\r\n\tCONCAT(' <b class=\\'badge\\'>',sample_import_id,'</b> ') as id,\r\n\tCASE WHEN enabled = 0 THEN\r\n\t\tCONCAT('  <span class=\\'btn label label-default\\'>" . TQ_("Disabled") . "</span> ') \r\n\tELSE\r\n\t\tCONCAT('  <span class=\\'btn label label-primary\\'>" . TQ_("Enabled") . "</span> ') \r\n\tEND as status,\r\n\tCASE WHEN enabled = 0 THEN\r\n\t\tCONCAT('<a href=\\'?sampleenable=',sample_import_id,'\\' class=\\'btn btn-default col-sm-12\\'>" . TQ_("Enable") . " <i class=\\'fa fa-play fa-lg\\' style=\\'color:blue;\\'></i></a>') \r\n\tELSE\r\n\t\tCONCAT('<a href=\\'\\' class=\\'btn btn-default col-sm-12\\' data-toggle=\\'confirmation\\' data-href=\\'?sampledisable=',sample_import_id,'\\' data-title=\\'" . TQ_("ARE YOU SURE?") . "\\' data-btnOkLabel=\\'" . TQ_("Yes") . "\\' data-btnCancelLabel=\\'" . TQ_("Cancel") . "\\'><i class=\\'fa fa-ban fa-lg\\' style=\\'color:red;\\'></i>  " . TQ_("Disable") . "</a> ') \r\n\tEND\r\n\tas enabledisable,\r\n\tCASE WHEN enabled = 1 THEN\r\n\t\tCONCAT('<a href=\\'?edit=',sample_import_id,'\\' class=\\'btn btn-default btn-block\\' data-toggle=\\'tooltip\\' title=\\'" . TQ_("Edit") . " " . TQ_("Viewing permissions") . "\\'><i class=\\'fa fa-eye fa-lg fa-fw \\'></i></a>')\r\n\tELSE\r\n\t\tCONCAT('<a href=\\'?edit=',sample_import_id,'\\' class=\\'btn btn-default \\' data-toggle=\\'tooltip\\' title=\\'" . TQ_("Edit sample parameters") . "\\'><i class=\\'fa fa-eye fa-lg fa-fw text-primary\\'></i> + <i class=\\'fa fa-edit fa-lg fa-fw text-primary\\'></i> + <i class=\\'fa fa-minus-circle fa-lg fa-fw text-danger \\'></i></a>')\r\n\tEND as did,\r\n\tCASE WHEN enabled = 1 THEN\r\n\t\tCONCAT('<a href=\\'\\' class=\\'btn btn-default disabled\\'><i class=\\'fa fa-trash fa-lg fa-fw\\' style=\\'color:grey;\\'></i></a>')\r\n\tELSE\r\n\t\tCONCAT('<a href=\\'\\' class=\\'btn btn-default \\' data-toggle=\\'confirmation\\' data-href=\\'?delete_sample=',sample_import_id,'\\' data-title=\\'" . TQ_("ARE YOU SURE?") . "\\' data-btnOkLabel=\\'" . TQ_("Yes") . "\\' data-btnCancelLabel=\\'" . TQ_("Cancel") . "\\' ><i class=\\'fa fa-trash fa-lg fa-fw text-danger \\' data-toggle=\\'tooltip\\' title=\\'" . TQ_("DELETE SAMPLE") . "\\'></i></a>')\r\n\tEND as delsample,\r\n\tCONCAT('<a href=\\'samplesearch.php?sample_import_id=',sample_import_id,'\\' class=\\'btn btn-default\\' data-toggle=\\'tooltip\\' title=\\'" . TQ_("Search the sample") . "',sample_import_id,'\\'><i class=\\'fa fa-search fa-lg fa-fw text-primary\\'></i></a>') as ssearch,\r\n\tCONCAT('<a href=\\'callhistory.php?sample_import_id=',sample_import_id,'\\' class=\\'btn btn-default\\' data-toggle=\\'tooltip\\' title=\\'" . TQ_("Call history") . " \n" . TQ_("sample") . " ',sample_import_id,'\\'><i class=\\'fa fa-phone fa-lg text-primary\\'></i></a>') as calls,\r\n\tCONCAT('<h4>',description,' </h4>') as description,\r\n\tCONCAT('<h4 class=\\'fa fa-lg text-primary pull-right\\'>',(SELECT COUNT( DISTINCT`sample_var`.sample_id) FROM `sample_var`, `sample` WHERE `sample`.sample_id = `sample_var`.sample_id AND `sample`.import_id = sample_import_id ),' </h4>') as cnt\r\n\tFROM sample_import ORDER BY sample_import_id DESC";
$rs = $db->GetAll($sql);
$subtitle = T_("Sample list");
xhtml_head(T_("Sample management"), true, $css, $js_head, false, false, false, $subtitle);
echo "<div class='form-group'>\r\n\t\t<a href='' onclick='history.back();return false;' class='btn btn-default'><i class='fa fa-chevron-left fa-lg text-primary'></i> " . T_("Go back") . "</a>\r\n\t\t<a href='import.php' class='btn btn-default col-sm-offset-4' ><i class='fa fa-upload fa-lg'></i> " . T_("Import a sample file") . "</a>\r\n\t</div>";
$columns = array("id", "description", "cnt", "status", "enabledisable", "calls", "did", "ssearch", "delsample");
//"vp","rname",
//$titles = array(T_("ID"),T_("Sample"),T_("Records"), T_("Call History"),T_("Enable/Disable"), T_("Status"), T_("Deidentify"), T_("View"), T_("Rename"), T_("Search"), T_("Delete sample"));
xhtml_table($rs, $columns, false, "table-hover table-condensed ");
xhtml_foot($js_foot);
?>
<script type="text/javascript">
$('[data-toggle="confirmation"]').confirmation();
</script>
示例3: T_
// print "<p><a href=\"" . $_SERVER['PHP_SELF'] . "?assign=assign\" onclick=\"document.getElementById('links').style.visibility='hidden'; document.getElementById('wait').style.visibility='visible';\">" . T_("Assign next form") . "</a></p>";
print "<form name=\"form1\" action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\"><input type=\"submit\" name=\"assign\" onclick=\"document.getElementById('links').style.visibility='hidden'; document.getElementById('wait').style.visibility='visible';\" value=\"" . T_("Assign next form") . "\"/></form>";
print "</div>";
print "<div id=\"wait\" style=\"visibility: hidden;\">\r\n<p>" . T_("Assigning next form: Please wait...") . "</p>\r\n</div>";
//display performance information for each assigned questionnaire
$sql = "SELECT vq.qid, q.description \r\n\t\tFROM verifierquestionnaire as vq, questionnaires as q\r\n\t\tWHERE vq.vid = '{$vid}'\r\n\t\tAND q.qid = vq.qid";
$prs = $db->GetAll($sql);
foreach ($prs as $pr) {
$pqid = $pr['qid'];
$pdes = $pr['description'];
$sql = "SELECT count(*) as rem\r\n\t\t\tFROM forms\r\n\t\t\tWHERE qid = '{$pqid}'\r\n\t\t\tAND done = 0";
$remain = $db->GetOne($sql);
$sql = "SELECT q.description as qu, v.description as ve,f.qid,f.assigned_vid as vid , count( * ) AS c, count( * ) / ( SUM( TIMESTAMPDIFF(\r\n\t\t\tSECOND , f.assigned, f.completed ) ) /3600 ) AS CPH, (\r\n\t\t\t(\r\n\t\t\t\r\n\t\t\tSELECT count( pid )\r\n\t\t\tFROM pages\r\n\t\t\tWHERE qid = f.qid\r\n\t\t\t) * count( * )\r\n\t\t\t) / ( SUM( TIMESTAMPDIFF(\r\n\t\t\tSECOND , f.assigned, f.completed ) ) /3600 ) AS PPH\r\n\t\t\tFROM forms AS f\r\n\t\t\tJOIN questionnaires as q on (f.qid = q.qid)\r\n\t\t\tJOIN verifiers as v on (v.vid = f.assigned_vid)\r\n\t\t\tWHERE f.qid = '{$pqid}'\r\n\t\t\tGROUP BY f.qid, f.assigned_vid\r\n\t\t\tORDER BY CPH DESC";
$prss = $db->GetAll($sql);
print "<h3>{$pdes}</h3>";
xhtml_table($prss, array('ve', 'c', 'CPH', 'PPH'), array(T_("Operator"), T_("Completed Forms"), T_("Completions Per Hour"), T_("Pages Per Hour")), "tclass", array("vid" => $vid));
print "<p>" . T_("Remain to verify") . ": {$remain}</p>";
}
xhtml_foot();
exit;
}
$qid_desc = get_qid_description($fid);
$qid = $qid_desc['qid'];
$description = $qid_desc['description'];
if (!isset($_SESSION['boxes'])) {
//nothing yet known about this form
$sql = "SELECT b.bid as bid, b.tlx as tlx, b.tly as tly, b.brx as brx, b.bry as bry, b.pid as pid, bg.btid as btid, b.bgid as bgid, {$fid} as fid, bg.sortorder as sortorder, fb.filled, c.val as val\r\n\t\tFROM boxes AS b\r\n\t\tJOIN boxgroupstype as bg ON (bg.bgid = b.bgid AND bg.btid > 0 AND bg.btid != 5)\r\n JOIN pages as p ON (p.pid = b.pid AND p.qid = '{$qid}')\r\n LEFT JOIN formboxes as fb ON (fb.bid = b.bid AND fb.fid = '{$fid}')\r\n\t\tLEFT JOIN formboxverifychar AS c ON (c.fid = '{$fid}' AND c.vid = 0 AND c.bid = b.bid)\r\n\t\tORDER BY bg.sortorder ASC";
$sql2 = "SELECT b.bgid,0 as done,b.pid,bg.varname,bg.btid\r\n\t\tFROM boxes as b, boxgroupstype as bg, pages as p\r\n\t\tWHERE p.pid = b.pid\r\n\t\tAND bg.bgid = b.bgid\r\n\t\tAND p.qid = '{$qid}' \r\n\t\tAND bg.btid > 0\r\n\t\tAND bg.btid != 5\r\n\t\tGROUP BY bg.bgid\r\n\t\tORDER BY bg.sortorder ASC";
$sql3 = "SELECT b.pid,b.bgid,0 as done, fp.width, fp.height, fp.fid\r\n\t\tFROM boxes as b\r\n\t\tJOIN pages as p ON (p.qid = '{$qid}' AND b.pid = p.pid)\r\n\t\tJOIN boxgroupstype as bg ON (bg.bgid = b.bgid)\r\n\t\tLEFT JOIN formpages as fp ON (fp.fid = '{$fid}' AND fp.pid = p.pid)\r\n\t\tGROUP BY b.pid\r\n\t\tORDER BY bg.sortorder ASC";
$a = $db->GetAssoc($sql);
if (empty($a)) {
示例4: intval
* queXF is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* queXF is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with queXF; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
include_once "../config.inc.php";
include_once "../db.inc.php";
include "../functions/functions.database.php";
include "../functions/functions.xhtml.php";
if (isset($_GET['fpnid'])) {
$fpnid = intval($_GET['fpnid']);
$db->StartTrans();
$sql = "DELETE FROM formpagenote\r\n\t\tWHERE fpnid = '{$fpnid}'";
$db->Execute($sql);
$db->CompleteTrans();
}
xhtml_head(T_("Listing of forms"), true, array("../css/table.css"));
$sql = "SELECT f.fid, f.pid, v.description as name, q.description as quest, CONCAT('<a href=\"?fpnid=', f.fpnid ,'\">" . T_("Delete note") . "</a>') as link, f.note\r\n\tFROM formpagenote as f\r\n\tJOIN forms ON (forms.fid = f.fid)\r\n\tJOIN questionnaires AS q ON (forms.qid = q.qid)\r\n\tLEFT JOIN verifiers AS v ON (v.vid = f.vid)\r\n\tORDER BY f.fid,f.pid ASC";
$fs = $db->GetAll($sql);
xhtml_table($fs, array('fid', 'pid', 'name', 'quest', 'note', 'link'), array(T_('Form ID'), T_('Page ID'), T_('Operator'), T_('Questionnaire'), T_('Note'), T_('Delete note')));
xhtml_foot();
示例5: xhtml_head
/* Copyright Deakin University 2007,2008,2009
* Written by Adam Zammit - adam.zammit@deakin.edu.au
* For the Deakin Computer Assisted Research Facility: http://www.deakin.edu.au/dcarf/
*
* This file is part of queXF
*
* queXF is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* queXF is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with queXF; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
include_once "../config.inc.php";
include_once "../db.inc.php";
include "../functions/functions.database.php";
include "../functions/functions.xhtml.php";
xhtml_head(T_("Listing of duplicate forms"), true, array("../css/table.css"));
$sql = "SELECT q.description, f.fid, f.pfid\n\tFROM forms as f\n\tLEFT JOIN questionnaires as q on (f.qid = q.qid)\n\tWHERE f.pfid\n\tIN (\n\t\tSELECT pfid\n\t\tFROM forms\n\t\tGROUP BY pfid\n\t\tHAVING COUNT( * ) >1\n\t)\n\tORDER BY f.qid,f.pfid";
$fs = $db->GetAll($sql);
print "<h1>" . T_("Duplicate form listing") . "</h1><p>" . T_("Forms with the same PFID are duplicates") . "</p>";
xhtml_table($fs, array('description', 'fid', 'pfid'), array(T_("Questionnaire"), T_("Formid"), T_("PFID")));
xhtml_foot();
示例6: T_
if (substr($key, 0, 4) == 'vid_') {
print "<input type='hidden' name='{$key}' value='{$val}'/>";
}
}
print "<input type='hidden' name='vid' value='{$qid}'/>";
print "<input type='submit' name='submit' value='" . T_("Start training process in background") . "'/>";
print "</form>";
} else {
if (isset($_GET['qid'])) {
//select verifiers
$qid = intval($_GET['qid']);
$sql = "SELECT v.vid, v.description, count( * ) AS c, CONCAT('<input type=\"checkbox\" name=\"vid_', v.vid, '\" value=\"',v.vid,'\"/>') as checkbox\r\n\t\tFROM `forms` AS f\r\n\t\tJOIN verifiers AS v ON ( v.vid = f.assigned_vid )\r\n\t\tWHERE f.qid = '{$qid}'\r\n\t\tGROUP BY f.assigned_vid";
$rs = $db->GetAll($sql);
print "<p>" . T_("Please choose which verifiers to include in training") . "</p>";
print "<form action='?' method='get'>";
xhtml_table($rs, array('description', 'c', 'checkbox'), array(T_("Verifier"), T_("Number of forms"), T_("Include in training?")));
print "<input type='hidden' name='qid' value='{$qid}'/>";
print "<input type='hidden' name='vid' value='{$qid}'/>";
print "<input type='submit' name='submitc' value='" . T_("Continue training") . "'/>";
print "</form>";
} else {
//select a questionnaire
//form to choose a questionnaire/form
$sql = "SELECT qid,description\r\n FROM questionnaires\r\n ORDER BY qid DESC";
$qs = $db->GetAll($sql);
foreach ($qs as $q) {
print "<a href=\"?qid={$q['qid']}\">" . T_("ICR Train") . ": {$q['description']}</a>";
print "<br/>";
}
}
}
示例7: operator_process
if (substr($g, 0, 3) == "pid") {
$auto_code = 0;
if (isset($_POST["auto" . $v])) {
$auto_code = 1;
}
$sql = "INSERT INTO operator_process (operator_id,process_id,auto_code)\r\n\t\t\t\tVALUES ({$operator_id},{$v},{$auto_code})";
$db->Execute($sql);
}
}
$db->CompleteTrans();
}
xhtml_head(T_("Assign operators to processes"), true, array("../css/table.css"), array("../js/display.js"));
$operator_id = 0;
if (isset($_GET['operator_id'])) {
$operator_id = intval($_GET['operator_id']);
}
//Select operator
$sql = "SELECT operator_id as value, description, CASE WHEN operator_id = '{$operator_id}' THEN 'selected=\\'selected\\'' ELSE '' END AS selected\r\n\tFROM operator";
print "<div>" . T_("Select operator:") . "</div>";
display_chooser($db->GetAll($sql), 'operator_id', 'operator_id');
if ($operator_id != 0) {
print "<div>" . T_("Select processes available to this operator") . "</div>";
print "<form action='' method='post'>";
//display a checkbox of all processes
$sql = "SELECT p.process_id,p.description, CONCAT('<input type=\\'checkbox\\' name=\\'pid', p.process_id, '\\' value=\\'', p.process_id, '\\' ', CASE WHEN op.process_id IS NOT NULL THEN 'checked=\\'checked\\'' ELSE '' END , '/>') as cbox, CONCAT('<input type=\\'checkbox\\' name=\\'auto', p.process_id, '\\' value=\\'', p.process_id, '\\' ', CASE WHEN (op.process_id IS NOT NULL AND op.auto_code = 1) THEN 'checked=\\'checked\\'' ELSE '' END , '/>') as abox \r\n\r\n\t\tFROM process as p\r\n\t\tLEFT JOIN operator_process AS op ON (op.operator_id = {$operator_id} AND op.process_id = p.process_id)";
$rs = $db->GetAll($sql);
translate_array($rs, array("description"));
xhtml_table($rs, array('description', 'cbox', 'abox'), array(T_("Process"), T_("Select"), T_("Allow queXC to auto guess code")));
print "<div><input type='submit' name='submit' value='" . T_("Assign processes") . "'/></div></form>";
}
xhtml_foot();
示例8: outputdata
exit;
}
if (isset($_GET['data'])) {
outputdata(intval($_GET['data']));
exit;
}
if (isset($_GET['csvlabel'])) {
outputdatacsv(intval($_GET['csvlabel']), "", true);
exit;
}
if (isset($_GET['csv'])) {
outputdatacsv(intval($_GET['csv']));
exit;
}
if (isset($_GET['csvmerged'])) {
outputdatacsv(intval($_GET['csvmerged']), "", false, false, false, true);
exit;
}
if (isset($_GET['banding'])) {
export_banding(intval($_GET['banding']));
exit;
}
if (isset($_GET['pspp'])) {
export_pspp(intval($_GET['pspp']));
exit;
}
xhtml_head(T_("Output data"), true, array("../css/table.css"));
$sql = "SELECT description,\n\t\tCONCAT('<a href=\"?data=', qid, '\">" . T_("Data") . "</a>') as data,\n\t\tCONCAT('<a href=\"?ddi=', qid, '\">" . T_("DDI") . "</a>') as ddi,\n\t\tCONCAT('<a href=\"?csv=', qid, '\">" . T_("CSV") . "</a>') as csv,\n\t\tCONCAT('<a href=\"?csvmerged=', qid, '\">" . T_("CSV Merged") . "</a>') as csvmerged,\n\t\tCONCAT('<a href=\"?csvlabel=', qid, '\">" . T_("CSV Labelled") . "</a>') as csvlabel,\n\t\tCONCAT('<a href=\"?pspp=', qid, '\">" . T_("PSPP (SPSS)") . "</a>') as pspp,\n\t\tCONCAT('<a href=\"?banding=', qid, '\">" . T_("Banding XML") . "</a>') as banding\n\tFROM questionnaires\n\tORDER BY qid ASC";
$qs = $db->GetAll($sql);
xhtml_table($qs, array('description', 'data', 'ddi', 'csv', 'csvmerged', 'csvlabel', 'pspp', 'banding'), array(T_("Questionnaire"), T_("Data"), T_("DDI"), T_("CSV"), T_("CSV Merged"), T_("CSV Labelled"), T_("PSPP (SPSS)"), T_("Banding XML")));
xhtml_foot();
示例9: count
$questionnaire_id = $q['questionnaire_id'];
$qsid = $q['lime_sid'];
$sql = "SELECT o.calc, count( c.case_id )\r\n\t\t\t\tFROM `case` AS c, `outcome` AS o\r\n\t\t\t\tWHERE c.questionnaire_id = '{$questionnaire_id}'\r\n\t\t\t\tAND c.current_outcome_id = o.outcome_id\r\n\t\t\t\tGROUP BY o.calc";
$a = $db->GetAssoc($sql);
$a = aapor_clean($a);
print "<table class='table-hover table-condensed tclass'><thead class=\"highlight\"><tr><th>" . 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>";
print "<tr><td>" . T_("Contact Rate 1") . "</td><td>" . round(aapor_con1($a), 2) . "</td></tr>";
print "</table></br>";
$sql = "SELECT o.description as des, o.outcome_id, count( c.case_id ) as count\r\n\t\t\t\tFROM `case` AS c, `outcome` AS o\r\n\t\t\t\tWHERE c.questionnaire_id = '{$questionnaire_id}'\r\n\t\t\t\tAND c.current_outcome_id = o.outcome_id\r\n\t\t\t\tGROUP BY o.outcome_id";
$rs = $db->GetAll($sql);
if (!empty($rs)) {
translate_array($rs, array("des"));
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></div>";
}
if (isset($_GET['qsid'])) {
$qsid = intval($_GET['qsid']);
$page = LIME_URL . "admin/admin.php?action=browse&sid={$qsid}";
} else {
$page = '';
}
if ($page) {
?>
<div class="col-lg-10 pull-right" id=" " style="height:820px;">
示例10: intval
if (isset($_GET['qid'])) {
$qid = intval($_GET['qid']);
$sql = "SELECT q.description as qu, v.description as ve,f.qid,w.vid , count( * ) AS c, count( * ) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS CPH, (\n\t(\n\t\n\tSELECT count( pid )\n\tFROM pages\n\tWHERE qid = f.qid\n\t) * count( * )\n\t) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS PPH\n\tFROM worklog AS w\n\tJOIN forms AS f ON ( f.fid = w.fid )\n\tJOIN questionnaires as q on (f.qid = q.qid)\n\tJOIN verifiers as v on (v.vid = w.vid)\n\tWHERE f.qid = '{$qid}'\n\tGROUP BY f.qid, w.vid\n\tORDER BY CPH DESC";
$rs = $db->GetAll($sql);
if (!empty($rs)) {
print "<h1>{$rs[0]['qu']}</h1>";
xhtml_table($rs, array('ve', 'c', 'CPH', 'PPH'), array(T_("Operator"), T_("Completed Forms"), T_("Completions Per Hour"), T_("Pages Per Hour")));
}
} else {
if (isset($_GET['vid'])) {
$vid = intval($_GET['vid']);
$sql = "SELECT q.description as qu, v.description as ve,f.qid,w.vid , count( * ) AS c, count( * ) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS CPH, (\n\t(\n\t\n\tSELECT count( pid )\n\tFROM pages\n\tWHERE qid = f.qid\n\t) * count( * )\n\t) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS PPH\n\tFROM worklog AS w\n\tJOIN forms AS f ON ( f.fid = w.fid )\n\tJOIN questionnaires as q on (f.qid = q.qid)\n\tJOIN verifiers as v on (v.vid = w.vid)\n\tWHERE w.vid = '{$vid}'\n\tGROUP BY f.qid, w.vid\n\tORDER BY CPH DESC";
$rs = $db->GetAll($sql);
if (!empty($rs)) {
print "<h1>{$rs[0]['ve']}</h1>";
xhtml_table($rs, array('qu', 'c', 'CPH', 'PPH'), array(T_("Questionnaire"), T_("Completed Forms"), T_("Completions Per Hour"), T_("Pages Per Hour")));
}
} else {
$sql = "SELECT CONCAT( f.qid, '_', w.vid ) AS qv, count( * ) AS c, count( * ) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS CPH, (\n\t(\n\t\n\tSELECT count( pid )\n\tFROM pages\n\tWHERE qid = f.qid\n\t) * count( * )\n\t) / ( SUM( TIMESTAMPDIFF(\n\tSECOND , w.assigned, w.completed ) ) /3600 ) AS PPH\n\tFROM worklog AS w\n\tJOIN forms AS f ON ( f.fid = w.fid )\n\tGROUP BY f.qid, w.vid\n\tORDER BY qid ASC , CPH DESC , qid ASC\t";
$qs = $db->GetAssoc($sql);
$sql = "SELECT qid,description\n\t\tFROM questionnaires\n\t\tORDER by qid ASC";
$questionnaires = $db->GetAll($sql);
$sql = "SELECT vid,description\n\t\tFROM verifiers\n\t\tORDER by vid ASC";
$verifiers = $db->GetAll($sql);
print "<table class='tclass'><tr><th></th>";
foreach ($questionnaires as $q) {
print "<th><a href='?qid={$q['qid']}'>{$q['description']}</a></th>";
}
print "</tr>";
$odd = 1;
foreach ($verifiers as $v) {
示例11: T_
"/>
<input type="text" class="textclass form-control" name="note" id="note" style="width: 70%;"/> 
<button class="submitclass btn btn-default" type="submit" name="submit"><i class="fa fa-file-text"></i> <?php
echo T_("Add note");
?>
</button>
</form>
<?php
print "</div>";
//view timeslots
$sql = "SELECT count(*)\r\n FROM questionnaire_timeslot as q, `case` as c\r\n WHERE c.case_id = {$case_id}\r\n AND c.questionnaire_id = q.questionnaire_id";
if ($db->GetOne($sql) >= 1) {
$sql = "SELECT ag.description, (SELECT COUNT(*) FROM availability as a, `call_attempt` as ca \r\n\t\t\tWHERE ca.case_id = c.case_id \r\n\t\t\tAND a.availability_group_id = ag.availability_group_id\r\n\t\t\tAND (a.day_of_week = DAYOFWEEK(CONVERT_TZ(ca.start,'UTC',s.Time_zone_name)) \r\n\t\t\tAND TIME(CONVERT_TZ(ca.start, 'UTC' , s.Time_zone_name)) >= a.start \r\n\t\t\tAND TIME(CONVERT_TZ(ca.start, 'UTC' , s.Time_zone_name)) <= a.end)) as cou\r\n FROM availability_group as ag, `case` as c, `questionnaire_timeslot` as qt, sample as s\r\n WHERE c.case_id = '{$case_id}'\r\n AND s.sample_id = c.sample_id\r\n AND qt.questionnaire_id = c.questionnaire_id AND ag.availability_group_id = qt.availability_group_id";
if (array("cou") >= 1) {
print "<div class='panel-body col-sm-6'><h4 class=''><i class='fa fa-list'></i> " . T_("Call attempts by timeslot") . "</h4>";
xhtml_table($db->GetAll($sql), array('description', 'cou'), array(T_("Time slot"), T_("Call attempts")));
//,"tclass",false,array("cou")
print "</div>";
}
} else {
print "<b class=' text-info col-sm-6'>" . T_("Time slots NOT defined") . "</b>";
}
print "<div class='clearfix '></div><div class='col-sm-6'>";
if (isset($r[0]['sample_id'])) {
//if sample data exists assign this to an operator for their next case
print "<div class='panel-body'><h4><i class='fa fa-link'></i> " . T_("Assign this case to operator (will appear as next case for them)") . "</h4>";
?>
<form method="get" action="?" class="form-inline">
<?php
$sql = "SELECT operator_id as value,CONCAT(firstName,' ', lastName) as description, CASE WHEN next_case_id = '{$case_id}' THEN 'selected=\\'selected\\'' ELSE '' END AS selected\r\n\t\t\t\tFROM operator\r\n\t\t\t\tWHERE enabled = 1";
$rs3 = $db->GetAll($sql);
示例12: array
/**
* XHTML functions
*/
include "functions/functions.xhtml.php";
/**
* Operator functions
*/
include "functions/functions.operator.php";
$js = false;
if (AUTO_LOGOUT_MINUTES !== false) {
$js = array("include/jquery/jquery-1.4.2.min.js", "js/childnap.js");
}
xhtml_head(T_("Case History List"), false, array("css/table.css"), $js, false, 60);
//List the case call history
// display in respondent time so that the operator will be able to
// quote verbatim to the respondent if necessary
$operator_id = get_operator_id();
if ($operator_id) {
global $db;
$sql = "SELECT DATE_FORMAT(CONVERT_TZ(c.start,'UTC',op.Time_zone_name),'" . DATE_TIME_FORMAT . "') as start,CONVERT_TZ(c.end,'UTC',op.Time_zone_name) as end, o.description as des, c.case_id as case_id, r.firstName as firstName\r\n\t\tFROM `call` as c\r\n\t\tJOIN (operator as op, outcome as o, respondent as r) on (c.operator_id = op.operator_id and c.outcome_id = o.outcome_id and r.respondent_id = c.respondent_id)\r\n\t\tWHERE c.operator_id = '{$operator_id}'\r\n\t\tORDER BY c.start DESC\r\n\t\tLIMIT 25";
$rs = $db->GetAll($sql);
if (empty($rs)) {
print "<p>" . T_("No calls ever made") . "</p>";
} else {
translate_array($rs, array("des"));
xhtml_table($rs, array("start", "case_id", "des", "firstName"), array(T_("Date/Time"), T_("Case ID"), T_("Outcome"), T_("Respondent")));
}
} else {
print "<p>" . T_("No operator") . "</p>";
}
xhtml_foot();
示例13: intval
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with queXF; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
include_once "../config.inc.php";
include_once "../db.inc.php";
include "../functions/functions.database.php";
include "../functions/functions.xhtml.php";
if (isset($_GET['fid'])) {
$fid = intval($_GET['fid']);
$db->StartTrans();
$sql = "SELECT pfid \r\n\t\tFROM forms\r\n\t\tWHERE fid = '{$fid}'";
$rs = $db->GetRow($sql);
$pfid = $rs['pfid'];
$sql = "DELETE FROM formpages\r\n\t\tWHERE fid = '{$fid}'";
$db->Execute($sql);
$sql = "DELETE FROM forms\r\n\t\tWHERE fid = '{$fid}'";
$db->Execute($sql);
$sql = "UPDATE processforms\r\n\t\tSET allowanother = 1\r\n\t\tWHERE pfid = '{$pfid}'";
$db->Execute($sql);
$db->CompleteTrans();
}
xhtml_head(T_("Pages missing from scan"), true, array("../css/table.css"));
$sql = "SELECT f.fid AS fid, f.description, q.description as qdesc, \r\n\tCASE WHEN EXISTS (SELECT mpid FROM missingpages WHERE fid = f.fid) THEN CONCAT('<a href=\\'missingpages.php?missingfid=',f.fid,'\\'>" . T_("Handle undetected pages") . "</a>') ELSE CONCAT('<a href=\\'?fid=' , f.fid , '\\'>" . T_("Delete form and allow importing again") . "</a>') END as link\r\n\tFROM forms AS f\r\n\tLEFT JOIN questionnaires as q on (f.qid = q.qid)\r\n\tWHERE f.done =0\r\n\tAND f.assigned_vid IS NULL\r\n\tAND EXISTS(\r\n SELECT p.pid\r\n FROM pages AS p\r\n WHERE p.qid = f.qid\r\n AND NOT EXISTS \r\n (SELECT fp.fid \r\n FROM formpages AS fp \r\n WHERE fp.fid = f.fid \r\n AND fp.pid = p.pid))\r\n\tORDER BY f.fid ASC";
$fs = $db->GetAll($sql);
xhtml_table($fs, array('fid', 'description', 'qdesc', 'link'), array(T_('Form ID'), T_('Form'), T_('Questionnaire'), T_('Delete form and allow importing again')));
xhtml_foot();
示例14: import_icr
$xmlname = $_FILES['icrxml']['tmp_name'];
$r = import_icr(file_get_contents($xmlname));
if ($a) {
if ($r) {
print "<h2>" . T_("Successfully loaded ICR XML file") . "</h2>";
} else {
print "<h2>" . T_("Failed to load ICR XML file") . "</h2>";
}
}
}
print "<h2>" . T_("Import ICR KB from XML") . "</h2>";
$sql = "SELECT CONCAT('<a href=\"?kb=',IFNULL(kb,'KB'),'\">', description,'</a>') as link\r\n\tFROM ocrkb";
$rs = $db->GetAll($sql);
?>
<form enctype="multipart/form-data" action="" method="post">
<p><input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /></p>
<p><?php
echo T_("Select ICR KB XML file");
?>
: <input name="icrxml" type="file" /></p>
<p><input type="submit" value="<?php
echo T_("Upload XML");
?>
" /></p>
</form>
<?php
print "<h2>" . T_("Export ICR KB to XML") . "</h2>";
xhtml_table($rs, array("link"), array(T_("ICR KB")));
xhtml_foot();
示例15: T_
$fdesc[] = T_("Case ID");
$sql = "SELECT var,var_id\r\n\t\t\t\tFROM sample_import_var_restrict\r\n\t\t\t\tWHERE sample_import_id = {$sample_import_id}\r\n\t\t\t\tORDER by var ASC";
$rs = $db->GetAll($sql);
foreach ($rs as $rsw) {
$fnames[] = $rsw['var_id'];
$fdesc[] = $rsw['var'];
}
foreach ($r as &$rw) {
$sql = "SELECT var_id,val\r\n\t\t\t\t\tFROM sample_var\r\n\t\t\t\t\tWHERE sample_id = {$rw['sample_id']}";
$rs = $db->GetAll($sql);
foreach ($rs as $rsw) {
$rw[$rsw['var_id']] = $rsw['val'];
}
}
print "<div class='form-group'>";
xhtml_table($r, $fnames, $fdesc, "tclass", false, false, "bs-table");
print "</div>";
} else {
print "<div class='alert alert-info col-sm-6 ' role='alert'><h4>" . T_("There's no data in this sample.") . "</h4></div>";
}
}
xhtml_foot($js_foot);
?>
<script type="text/javascript">
$('#bs-table').bdt();
/* $('#bs-table').bootgrid({
ajax: true,
post: "$sample_import_id",
url: "?sample_import_id=\"$sample_import_id\"",
}); */