You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
<?php if ( !defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
// use app\core\auth\Subscription as UserSubscription;
|
|
class Subscription extends MY_Controller {
|
|
|
|
protected $subscription;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->my_parent_controller();
|
|
$this->load->model('User_subscription_model');
|
|
// $this->subscription = new UserSubscription();
|
|
}
|
|
|
|
/**
|
|
* Get latest subscription by user id
|
|
*/
|
|
public function get_subscription() {
|
|
$user_id = $this->input->get('user_id');
|
|
$result=$this->User_subscription_model->get_subscription($user_id);
|
|
return output_to_json($this, $result);
|
|
}
|
|
|
|
/**
|
|
* Update subscription by user id
|
|
*/
|
|
public function update_subscription() {
|
|
$subscriptionId = $this->input->post('id');
|
|
$data = array(
|
|
'transactionDateTime' => $this->input->post('transactionDateTime'),
|
|
'expirationDate' => $this->input->post('expirationDate')
|
|
);
|
|
$result = $this->User_subscription_model->update_subscription($subscriptionId, $data);
|
|
return output_to_json($this, $data);
|
|
}
|
|
}
|