Пример #1
0
 function index()
 {
     $idu = isset($_SESSION['idu']) ? $_SESSION['idu'] : 0;
     $section = isset($_GET['i']) ? htmlspecialchars($_GET['i']) : "";
     $idoperator = intval(isset($_GET['o']) ? htmlspecialchars($_GET['o']) : 0);
     unset($_GET['i']);
     unset($_GET['o']);
     $utils = new Utilz();
     $operator = $utils->parseIdOperator($idoperator);
     if ($section == "offer") {
         $description = file_get_contents("./resources/footer/offer_{$operator}.txt", true);
     }
     if ($section == "price") {
         $description = file_get_contents("./resources/footer/footer_{$operator}.txt", true);
     }
     if (!empty($description)) {
         $this->template->vars('description', $description);
         $this->template->view('index', $idu > 0);
     } else {
         header('Location:' . WEB_APP);
     }
 }
Пример #2
0
 function index()
 {
     $idu = isset($_SESSION['idu']) ? $_SESSION['idu'] : 0;
     $msisdn = empty($_POST['msisdn']) ? '' : $_POST['msisdn'];
     unset($_POST['msisdn']);
     $telco = isset($_GET['o']) ? htmlspecialchars($_GET['o']) : "";
     unset($_GET['o']);
     $this->stat->saveStat($idu, "unsubscribe/index [{$msisdn}, {$telco}]");
     if (!empty($msisdn)) {
         $telco = isset($_POST['o']) ? htmlspecialchars($_POST['o']) : "";
         unset($_POST['o']);
         if (!empty($telco)) {
             $model = new Model_Profile();
             $utilz = new Utilz();
             $result = $utilz->unsubscribe($msisdn, $telco);
             if ($result === '1') {
                 $model->removeProfile($msisdn);
             }
             unset($_SESSION['idu']);
             header('Location:' . WEB_APP);
         } else {
             $this->template->view('error', $idu > 0);
         }
     } else {
         $model = new Model_Profile();
         $profiles = $model->getProfile($idu);
         if (count($profiles) > 0) {
             $profile = $profiles[0];
             if (!empty($profile)) {
                 $msisdn = $profile['msisdn'];
             }
         }
         $this->template->vars('msisdn', $msisdn);
         $this->template->vars('telco', $telco);
         $this->template->view('index', $idu > 0);
     }
 }