forked from kevinowino869/mitrobill
Widget For Customer
This commit is contained in:
14
system/widgets/customer/account_info.php
Normal file
14
system/widgets/customer/account_info.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
|
||||
class account_info
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
|
||||
$abills = User::getAttributes("Bill");
|
||||
$ui->assign('abills', $abills);
|
||||
return $ui->fetch('widget/customers/account_info.tpl');
|
||||
}
|
||||
}
|
20
system/widgets/customer/active_internet_plan.php
Normal file
20
system/widgets/customer/active_internet_plan.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
|
||||
class active_internet_plan
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui, $user;
|
||||
$_bill = User::_billing();
|
||||
$ui->assign('_bills', $_bill);
|
||||
$tcf = ORM::for_table('tbl_customers_fields')
|
||||
->where('customer_id', $user['id'])
|
||||
->find_many();
|
||||
$vpn = ORM::for_table('tbl_port_pool')
|
||||
->find_one();
|
||||
$ui->assign('cf', $tcf);
|
||||
$ui->assign('vpn', $vpn);
|
||||
return $ui->fetch('widget/customers/active_internet_plan.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/announcement.php
Normal file
11
system/widgets/customer/announcement.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
class announcement
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
return $ui->fetch('widget/customers/announcement.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/balance_transfer.php
Normal file
11
system/widgets/customer/balance_transfer.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
class balance_transfer
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
return $ui->fetch('widget/customers/balance_transfer.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/button_order_internet_plan.php
Normal file
11
system/widgets/customer/button_order_internet_plan.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
class button_order_internet_plan
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
return $ui->fetch('widget/customers/button_order_internet_plan.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/html_only.php
Normal file
11
system/widgets/customer/html_only.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class html_only
|
||||
{
|
||||
|
||||
public function getWidget($data = null)
|
||||
{
|
||||
global $ui;
|
||||
return $data['content'];
|
||||
}
|
||||
}
|
22
system/widgets/customer/html_php.php
Normal file
22
system/widgets/customer/html_php.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
class html_php
|
||||
{
|
||||
|
||||
public function getWidget($data = null)
|
||||
{
|
||||
global $ui;
|
||||
$ui->assign('card_header', $data['title']);
|
||||
ob_start();
|
||||
try{
|
||||
eval('?>'. $data['content']);
|
||||
}catch(Exception $e){
|
||||
echo $e->getMessage();
|
||||
echo "<br>";
|
||||
echo $e->getTraceAsString();
|
||||
}
|
||||
$content = ob_get_clean();
|
||||
$ui->assign('card_body', $content);
|
||||
return $ui->fetch('widget/card_html.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/recharge_a_friend.php
Normal file
11
system/widgets/customer/recharge_a_friend.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
class recharge_a_friend
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
return $ui->fetch('widget/customers/recharge_a_friend.tpl');
|
||||
}
|
||||
}
|
39
system/widgets/customer/unpaid_order.php
Normal file
39
system/widgets/customer/unpaid_order.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
|
||||
class unpaid_order
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui, $user;
|
||||
$unpaid = ORM::for_table('tbl_payment_gateway')
|
||||
->where('username', $user['username'])
|
||||
->where('status', 1)
|
||||
->find_one();
|
||||
|
||||
// check expired payments
|
||||
if ($unpaid) {
|
||||
try {
|
||||
if (strtotime($unpaid['expired_date']) < time()) {
|
||||
$unpaid->status = 4;
|
||||
$unpaid->save();
|
||||
$unpaid = [];
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
try {
|
||||
if (strtotime($unpaid['created_date'], "+24 HOUR") < time()) {
|
||||
$unpaid->status = 4;
|
||||
$unpaid->save();
|
||||
$unpaid = [];
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
$ui->assign('unpaid', $unpaid);
|
||||
return $ui->fetch('widget/customers/unpaid_order.tpl');
|
||||
}
|
||||
}
|
11
system/widgets/customer/voucher_activation.php
Normal file
11
system/widgets/customer/voucher_activation.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
class voucher_activation
|
||||
{
|
||||
public function getWidget()
|
||||
{
|
||||
global $ui;
|
||||
return $ui->fetch('widget/customers/voucher_activation.tpl');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user