Update plan.php
This commit is contained in:
parent
73e85a97ce
commit
0eb900ffd6
@ -615,6 +615,17 @@ switch ($action) {
|
|||||||
->left_outer_join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
|
->left_outer_join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
|
||||||
->where('tbl_voucher.status', '0');
|
->where('tbl_voucher.status', '0');
|
||||||
}
|
}
|
||||||
|
if (!empty($selected_datetime)) {
|
||||||
|
$v = ORM::for_table('tbl_plans')
|
||||||
|
->left_outer_join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
|
||||||
|
->where('tbl_voucher.status', '0')
|
||||||
|
->where('tbl_voucher.created_at', $selected_datetime)
|
||||||
|
->limit($limit);
|
||||||
|
$vc = ORM::for_table('tbl_plans')
|
||||||
|
->left_outer_join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
|
||||||
|
->where('tbl_voucher.status', '0');
|
||||||
|
|
||||||
|
}
|
||||||
if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||||
$v = $v->find_many();
|
$v = $v->find_many();
|
||||||
$vc = $vc->count();
|
$vc = $vc->count();
|
||||||
@ -628,7 +639,6 @@ switch ($action) {
|
|||||||
$v = $v->where_in('generated_by', $sales)->find_many();
|
$v = $v->where_in('generated_by', $sales)->find_many();
|
||||||
$vc = $vc->where_in('generated_by', $sales)->count();
|
$vc = $vc->where_in('generated_by', $sales)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = file_get_contents("pages/Voucher.html");
|
$template = file_get_contents("pages/Voucher.html");
|
||||||
$template = str_replace('[[company_name]]', $config['CompanyName'], $template);
|
$template = str_replace('[[company_name]]', $config['CompanyName'], $template);
|
||||||
|
|
||||||
@ -648,7 +658,7 @@ switch ($action) {
|
|||||||
'created_datetime'
|
'created_datetime'
|
||||||
)
|
)
|
||||||
->where_not_equal('created_at', '0')
|
->where_not_equal('created_at', '0')
|
||||||
->select_expr('COUNT(*)', 'voucher_count')
|
->select_expr('COUNT(*)', 'voucher_count')
|
||||||
->group_by('created_datetime')
|
->group_by('created_datetime')
|
||||||
->order_by_desc('created_datetime')
|
->order_by_desc('created_datetime')
|
||||||
->find_array();
|
->find_array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user