public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 1/4/2016
 * Time: 2:45 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Controller/CountryController.php';
$data = array();
if (isset($_POST['countryId']) && isset($_POST['cityId'])) {
    $countryId = $_POST['countryId'];
    $cityId = $_POST['cityId'];
    if (intval($countryId) > 0 && intval($cityId) > 0) {
        $Object = new CountryController();
        $data = $Object->updateUserState($countryId, $cityId);
    } else {
        array_push($data, ["Status" => "error", "Message" => "Incorrect fields detected"]);
    }
} else {
    array_push($data, ["Status" => "error", "Message" => "Something went wrong"]);
}
echo json_encode($data);
Example #3
0
 function editKeyword($keywordId, $listInfo = '')
 {
     $userId = isLoggedIn();
     $websiteController = new WebsiteController();
     $this->set('websiteList', $websiteController->__getAllWebsites($userId, true));
     $langController = new LanguageController();
     $this->set('langList', $langController->__getAllLanguages());
     $this->set('langNull', true);
     $countryController = new CountryController();
     $this->set('countryList', $countryController->__getAllCountries());
     $this->set('countryNull', true);
     $seController = new SearchEngineController();
     $this->set('seList', $seController->__getAllSearchEngines());
     if (!empty($keywordId)) {
         if (empty($listInfo)) {
             $listInfo = $this->__getKeywordInfo($keywordId);
             $listInfo['oldName'] = $listInfo['name'];
             $listInfo['searchengines'] = explode(':', $listInfo['searchengines']);
         }
         $this->set('post', $listInfo);
         $this->render('keyword/edit');
         exit;
     }
     $this->listKeywords();
 }
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 12/28/2015
 * Time: 4:49 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Entity/Country.php';
$data = array();
if (isset($_POST['id'])) {
    $id = $_POST['id'];
    if (strlen($id) > 0) {
        $Object = new CountryController();
        $data = $Object->getUserCountry($id);
    } else {
        array_push($data, ["Status" => "error", "Message" => "user identification can't be empty"]);
    }
} else {
    array_push($data, ["Status" => "error", "Message" => "Please provide user identification id"]);
}
echo json_encode($data);
Example #5
0
            break;
        default:
            echo json_encode(['err' => 1, 'message' => 'invalid action']);
    }
} elseif (isset($_GET['p1']) && $_GET['p1'] != 'index') {
    switch (strtolower($_GET['p1'])) {
        case 'hotels':
            //list all hotels
        //list all hotels
        case 'hotel':
            $htl = new HotelController();
            if (!isset($_GET['page'], $_GET['per_page'])) {
                $htl->Hotels();
            } else {
                $htl->Hotels($_GET['page'], $_GET['per_page']);
            }
            break;
        case 'countrys':
            //list all country
        //list all country
        case 'countries':
        case 'country':
            $ctry = new CountryController();
            $ctry->Countries();
            break;
        default:
            echo json_encode(['err' => 1, 'message' => 'invalid action']);
    }
} else {
    echo json_encode(['err' => 1, 'message' => 'invalid params']);
}
Example #6
0
 function quickRankChecker()
 {
     $seController = new SearchEngineController();
     $seList = $seController->__getAllSearchEngines();
     $this->set('seList', $seList);
     $this->set('seStyle', 230);
     $seId = empty($searchInfo['se_id']) ? '' : $searchInfo['se_id'];
     $this->set('seId', $seId);
     $langController = new LanguageController();
     $this->set('langNull', true);
     $this->set('langStyle', 230);
     $this->set('langList', $langController->__getAllLanguages());
     $countryController = new CountryController();
     $this->set('countryList', $countryController->__getAllCountries());
     $this->set('countryNull', true);
     $this->set('countryStyle', 230);
     $this->render('report/quickrankchecker');
 }
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 12/5/2015
 * Time: 10:21 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Controller/CountryController.php';
$Object = new CountryController();
echo json_encode($Object->getCountries(true));
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 1/4/2016
 * Time: 2:45 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Controller/CountryController.php';
if (!session_start()) {
    session_start();
}
$data = array();
if (!isset($_SESSION['id']) || !empty($_SESSION['id'])) {
    if (isset($_POST['cell'])) {
        $cell = $_POST['cell'];
        $id = $_SESSION['id'];
        if (strlen($cell) > 7 && strlen($cell) < 20) {
            $Object = new CountryController();
            $data = $Object->updateUserCell($cell, $id);
        } else {
            array_push($data, ["Status" => "error", "Message" => "Incorrect fields detected"]);
        }
    } else {
        array_push($data, ["Status" => "error", "Message" => "Something went wrong"]);
    }
} else {
    array_push($data, ["Status" => "error", "Message" => "Authorization error occurred"]);
}
echo json_encode($data);
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 12/5/2015
 * Time: 10:26 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Controller/CountryController.php';
$Object = new CountryController();
echo json_encode($Object->getCountries(false));
Example #10
0
<?php

/**
 * Created by PhpStorm.
 * User: Haziq
 * Date: 12/6/2015
 * Time: 1:32 PM
 */
require_once $_SERVER['DOCUMENT_ROOT'] . '/matrimonialweb/Controller/CountryController.php';
$data = array();
if (isset($_POST['country']) && $_POST['country'] > 0) {
    $Object = new CountryController();
    $result = $Object->getStates($_POST['country']);
    echo json_encode($result);
} else {
    array_push($data, ["Status" => "error", "Message" => "Some error occurred"]);
    echo json_encode($data);
}