Hello KoolReports team, I have a challenge I cannot seem to figure out where that error is coming from. Your assistance will be greatly appreciated.
I developed a receipt like template to display in a table. My database spits out a table layout already formatted as I want it. Having challenge with 1. The records come duplicated but in the database it is not duplicated
There is also an error which shows after the first layout load which is ">. I have checked my code but cannot find any missing tags as seen in the image.
The code spit out by the database is for each row :
<style>
table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%;}
td, th {border: 1px solid #dddddd; text-align: left; padding: 8px;}
tr:nth-child(even) { background-color: #dddddd;}
</style>
<table >
<tr>
<td rowspan="3"><img src="thumb.jpg" style="width:100px;"></td>
<td><b>UID :</b>ID-15188</td>
<td><b>NAME :</b>GIFTY PEPRAH WADIE</td>
<td><b>SEX : </b>Female</td>
</tr>
<tr>
<td><b>DATE OF BIRTH :</b>12-06-1999</td>
<td><b>COMMUNITY : </b>ODUASE I</td>
<td><b>CONTACT NO. :</b>548744547</td>
</tr>
<tr>
<td><b>CONTACT ADDRESS : </b>NO 4 LAGOS</td>
<td><b>IDENTIFICATION :</b>NID 09184947595</td>
<td><b>TRADITIONAL AUTHORITY : </b>YES</td>
</tr>
</table>
Now the code for the main file is :
<?php
require_once "../koolreport/autoload.php";
use \koolreport\KoolReport;
class StakeholderIndex extends KoolReport
{
//use \koolreport\clients\Bootstrap;
use \koolreport\inputs\Bindable;
// use \koolreport\inputs\POSTBinding;
// use \koolreport\export\Exportable;
protected function defaultParamValues()
{
return array(
"person_id"=>"3565"
);
}
protected function bindParamsToInputs()
{
return array(
"person_id"
);
}
public function settings()
{
$config = include "config.php";
return array(
"dataSources"=>array(
"pace"=>$config["postdb"]
),
);
}
protected function setup()
{
$this->src('pace')
->query("
SELECT
header_display_tag
FROM
engagements.stakeholder_html_table
where stakeholder_id=:pstakeholder
")
->params(array(
":pstakeholder"=>$this->params["person_id"],
))
->pipe($this->dataStore("result"));
$this->src("pace")->query("
SELECT
stakeholder_id,
concat(uid_person,' ',name_persons) as name
FROM
engagements.stakeholder
ORDER BY name_persons asc
")
->pipe($this->dataStore("IndexList"));
}
}
?>
Code for view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\inputs\Select2;
?>
<!DOCTYPE >
<html>
<head>
<title>Index Report</title>
</head>
<body style="margin:0.5in 1in 0.5in 1in">
<link rel="stylesheet" href="../../../assets/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="../../../assets/bootstrap/css/bootstrap.theme.min.css" />
<form method="post" id="parameterForm">
<div class="col-md-12 form-group">
<?php
Select2::create(array(
"name"=>"person_id",
"dataStore"=>$this->dataStore("IndexList"),
"dataBind"=>array(
"text"=>"name",
"value"=>"stakeholder_id"
),
"display"=>"horizontal"
));
?>
</div>
<div class="form-group">
<button class="btn btn-primary">Submit</button>
</div>
</form>
<div class="page-header" style="text-align:Left"><b><i>Index Report</i></b></div>
<?php
Table::create(array(
"dataStore"=>$this->dataStore("result"),
"showHeader"=>false,
"columns"=>array(
"header_display_tag"
)
));
?>
</body>
</html>