This is my Controller
coding in zend framework
public function homeAction() {
$storage = new Zend_Auth_Storage_Session();
$data = $storage->read();
if (!$data) {
$this->_redirect('admin/login');
}
$this->view->storeid = $data->storeid;
$iExtStoreId = $data->storeid; // admin storeid
$db = Zend_Db_Table::getDefaultAdapter();
$sql = "SELECT storeId FROM stores where extStoreId= '$iExtStoreId' ";
$result = $db->fetchAll($sql);
$sStoreId = $result[0]['storeId'];
if (strlen($sStoreId) >= 32) {
$sql = "select * from voucherRedemptions where storeId='$sStoreId'";
$result2 = $db->fetchAll($sql);
} else {
$result2 = array();
}
echo "<table border='1'>
<tr>
<th>redemptionId</th>
<th>voucherId</th>
<th>storeId</th>
<th>redemptionTime</th>
</tr>";
if (count($result2) > 0) {
foreach ($result2 as $row) {
echo "<tr>";
echo "<td>" . $row['redemptionId'] . "</td>";
echo "<td>" . $row['voucherId'] . "</td>";
echo "<td>" . $row['storeId'] . "</td>";
echo "<td>" . $row['redemptionTime'] . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='4'>Data not found </td></tr>";
}
echo "</table>";
}
now I want to keep the view code
in view
folder home.html
what i can do ?