2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Fix notices when using call history

This commit is contained in:
Adam Zammit
2015-08-31 12:35:43 +10:00
parent 20bbfef4e6
commit cccf37ed0d

View File

@@ -100,7 +100,7 @@ if ($operator_id)
if (!isset($_GET['csv']))
$sql .= " LIMIT 500";
else $sql .= " LIMIT 5000";
// else $sql .= " LIMIT 5000"; no limit when using CSV
$rs = $db->Execute($sql);
if (empty($rs))
@@ -110,8 +110,10 @@ if ($operator_id)
else
{
if (isset($_GET['csv']))
{
$qds = str_replace(' ','_',$_GET['dq']); $smpds = str_replace(' ','_',$_GET['ds']);
{
$qds = $smpds = "";
if (isset($_GET['dq'])) $qds = str_replace(' ','_',$_GET['dq']);
if (isset($_GET['ds'])) $smpds = str_replace(' ','_',$_GET['ds']);
$fn = "callhistory-" . $qds . $smpds . date("_d-M-Y_H-i") . ".csv";
header("Content-Type: text/csv");
@@ -160,7 +162,17 @@ if ($operator_id)
print "<h3><small>" . T_("Sample") . "&emsp;ID: $sid</small>&emsp;" . $ds . "</h3>";
unset($datacol[5]); unset($headers[5]); }
print "&nbsp;<a href='?csv=csv&amp;questionnaire_id=$qid&amp;dq=" . $dq . "&amp;sample_import_id=$sid&amp;ds=" . $ds . "' class='btn btn-default pull-right'><i class='fa fa-download fa-lg text-primary'></i>&emsp;" . T_("Download Call History List") . "</a>
print "&nbsp;<a href='?csv=csv";
if (isset($qid))
print "&amp;questionnaire_id=$qid";
if (isset($dq))
print "&amp;dq=" . $dq;
if (isset($sid))
print "&amp;sample_import_id=$sid";
if (isset($ds))
print "&amp;ds=" . $ds;
print "' class='btn btn-default pull-right'><i class='fa fa-download fa-lg text-primary'></i>&emsp;" . T_("Download Call History List") . "</a>
"; //<a href='../../admin/config.php' target='_blank' class='btn btn-default col-sm-offset-6 '><i class='fa fa-link fa-lg text-primary'></i>&emsp;" . T_("Go to Call History Report") . "</a>&nbsp;
xhtml_table($rs,$datacol,$headers,"tclass",false,false,"bs-table");