Example #1
0
function showInvoices($fk_company, $dtStart, $dtEnd, $idCountry)
{
    $country = new country();
    $country->open($idCountry);
    $pay = new payment();
    $data = array();
    $i = 0;
    $list_invoices = $pay->getByDate($fk_company, $dtStart, $dtEnd);
    $html .= '<table id="datatables" class="table table-bordered table-striped responsive">';
    $html .= '   <thead>';
    $html .= '       <tr>';
    $html .= '           <th class="head0">#</th>';
    $html .= '           <th class="head1">Date Start</th>';
    $html .= '           <th class="head0">Date End</th>';
    $html .= '           <th class="head1">Lessons</th>';
    $html .= '           <th class="head0">Invoice</th>';
    $html .= '           <th class="head1">Actions</th>';
    $html .= '       </tr>';
    $html .= '   </thead>';
    $html .= '   <tbody>';
    foreach ($list_invoices as $value) {
        $i = $i + 1;
        $html .= '       <tr src="stays">';
        $html .= '           <td>' . $value->sequence . '</td>';
        $html .= '           <td>' . date('Y-m-d', strtotime($value->date_start)) . '</td>';
        $html .= '           <td>' . date('Y-m-d', strtotime($value->date_end)) . '</td>';
        $html .= '           <td>' . $value->lessons . '</td>';
        $html .= '           <td>(' . $country->currency . ') ' . $value->invoice . '</td>';
        $html .= '           <td><a href="/pages/invoice-detail.php?id=' . $value->id . '" role="button" class="btn btn-link">View</a></td>';
        $html .= '       </tr>';
    }
    $html .= '   </tbody>';
    $html .= '</table>';
    $data['html'] = $html;
    $data['count'] = $i;
    echo json_encode($data);
}