Hey guys!
I'm trying to create a module, but some piece of code doesn't working and I don't know why, because doesn't have error.
See:
module.zpm
I tried replace <~ and ~> for <& and &>, but doesn't worked too.
The module displays until this piece: <h3><: Alerts list :></h3>.
The controller.ext.php corresponding code:
The database exists, the table and column names is correct. I verified.
Any ideas? :/
Thanks,
I'm trying to create a module, but some piece of code doesn't working and I don't know why, because doesn't have error.
See:
module.zpm
Code:
<h3><: Alerts list :></h3>
<% if AlertsList %>
<table class="table table-striped">
<tr>
<th><: ID :></th>
<th><: Title :></th>
<th><: Message :></th>
</tr>
<% loop AlertsList %>
<tr>
<td><~ alert_id ~></td>
<td><~ alert_title ~></td>
<td><~ alert_message ~></td>
</tr>
<% endloop %>
</table>
<@ CSFR_Tag @>
<% else %>
<p><: There are currently no alerts to display! :></p>
<% endif %>
The module displays until this piece: <h3><: Alerts list :></h3>.
The controller.ext.php corresponding code:
Code:
/*
* The 'worker' methods.
*/
static function ListAlerts() {
global $zdbh;
$sql = "SELECT * FROM sentora_alerts";
$numrows = $zdbh->prepare($sql);
$numrows->execute();
if ($numrows->fetchColumn() <> 0) {
$sql = $zdbh->prepare($sql);
$res = array();
$sql->execute();
while ($rowalerts = $sql->fetch()) {
array_push($res, array('alert_id' => $rowalerts['alert_id'], 'alert_title' => runtime_xss::xssClean($rowalerts['alert_title']), 'alert_message' =>runtime_xss::xssClean($rowalerts['alert_message'])));
}
return $res;
} else {
return false;
}
}
/*
* End 'worker' methods.
*/
static function getAlertsList() {
global $zdbh;
return self::ListAlerts();
}
The database exists, the table and column names is correct. I verified.
Any ideas? :/
Thanks,