<?php

class customer_points_page extends mainController {

    public function __construct() {
        parent::__construct(false);
        $this->load->model('auth');
        $this->modal = new authModel();
        $registry = Registry::getInstance();
        $registry->product = new Product;
    }

    public function landing() {
        $vars['error'] = false;
        $open_customer_points_page = $this->modal->open_customer_points_page();
        if($open_customer_points_page){
            $this->load->view('customer_points_page', null, true);
        }else{
            header('Refresh: 0; url=' . SITE_LINK . 'smc');
        }
    }
    
    public function get_customer_points_from_phone() {
        $registry = Registry::getInstance();

        $data = $registry->product->get_customer_points_from_phone($_GET['phone']);
        die(json_encode($data));
    }

}
