55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\CustomerModel;
|
|
|
|
|
|
|
|
class Address extends BaseController
|
|
{
|
|
public function index()
|
|
{
|
|
helper('session');
|
|
$customerModel = new CustomerModel();
|
|
$data['page_name'] = 'Customer Listing';
|
|
$data['customers'] = $customerModel->findAll();
|
|
return view('address_list', $data);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// public function generatePdf()
|
|
// {
|
|
// $customerModel = new CustomerModel();
|
|
|
|
// $customer_id = $this->request->getPost('customer_id');
|
|
// $customerData = $customerModel->find($customer_id);
|
|
|
|
// if ($customerData) {
|
|
|
|
// $options->set('isHtml5ParserEnabled', true);
|
|
// $options->set('isPhpEnabled', true);
|
|
// $dompdf = new Dompdf($options);
|
|
|
|
|
|
// $html = view('address_list', ['customerData' => $customerData]);
|
|
|
|
|
|
// $dompdf->loadHtml($html);
|
|
|
|
|
|
// $dompdf->setPaper('A4', 'portrait');
|
|
|
|
// $dompdf->render();
|
|
|
|
|
|
// $dompdf->stream('customer_information.pdf', ['Attachment' => 0]);
|
|
// } else {
|
|
|
|
// return redirect()->to('index');
|
|
// }
|
|
// }
|
|
// }
|