182 lines
4.4 KiB
PHP
182 lines
4.4 KiB
PHP
<?php
|
|
|
|
namespace app\controllers;
|
|
|
|
use app\models\UserPublic;
|
|
use app\services\Cart;
|
|
use app\services\JWT;
|
|
|
|
class MobileApiController extends BaseController
|
|
{
|
|
public function beforeAction($action)
|
|
{
|
|
/*
|
|
header("Access-Control-Expose-Headers: Access-Control-*");
|
|
header("Access-Control-Allow-Headers: Access-Control-*, Origin, X-Requested-With, Content-Type, Accept, Auth");
|
|
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD');
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Allow', 'GET, POST, PUT, DELETE, OPTIONS, HEAD');
|
|
*/
|
|
|
|
Header('Access-Control-Allow-Origin: *'); //for allow any domain, insecure
|
|
Header('Access-Control-Allow-Headers: *'); //for allow any headers, insecure
|
|
Header('Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'); //method allowed
|
|
|
|
return parent::beforeAction($action);
|
|
}
|
|
|
|
public function actionArticles()
|
|
{
|
|
return $this->renderPartial('articles');
|
|
}
|
|
|
|
public function actionArticle()
|
|
{
|
|
return $this->renderPartial('article');
|
|
}
|
|
|
|
public function actionCollections()
|
|
{
|
|
return $this->renderPartial('collections');
|
|
}
|
|
|
|
public function actionCollection()
|
|
{
|
|
return $this->renderPartial('collection');
|
|
}
|
|
|
|
public function actionExpositions()
|
|
{
|
|
return $this->renderPartial('expositions');
|
|
}
|
|
|
|
public function actionExposition()
|
|
{
|
|
return $this->renderPartial('exposition');
|
|
}
|
|
|
|
public function actionObject()
|
|
{
|
|
return $this->renderPartial('object');
|
|
}
|
|
|
|
public function actionBrowserClose()
|
|
{
|
|
Cart::clearCartOnly();
|
|
exit;
|
|
}
|
|
|
|
public function actionBrowserCloseCompleteOrder()
|
|
{
|
|
Cart::clearCartOnly();
|
|
exit;
|
|
}
|
|
|
|
public function actionBrowserRegisterClose() {
|
|
exit;
|
|
}
|
|
|
|
public function actionGetAccessToken()
|
|
{
|
|
return $this->renderPartial('access-token');
|
|
}
|
|
|
|
|
|
public function actionGetAccessTokenByDeviceId()
|
|
{
|
|
return $this->renderPartial('access-token-by-device-id');
|
|
}
|
|
|
|
public function actionGenerateUserUid()
|
|
{
|
|
return $this->renderPartial('generate-user-uid');
|
|
}
|
|
|
|
public function actionGetRemoteAddress()
|
|
{
|
|
echo '<html><head><title>Remote address</title></head><body>' . $_SERVER['REMOTE_ADDR'] . '</body></html>';
|
|
exit;
|
|
}
|
|
|
|
|
|
public function actionGetMapPointData()
|
|
{
|
|
return $this->renderPartial('map-point-data');
|
|
}
|
|
|
|
public function actionExploreObjectsMap()
|
|
{
|
|
return $this->renderPartial('explore-objects-map');
|
|
}
|
|
|
|
public function actionExploreObjectsList()
|
|
{
|
|
return $this->renderPartial('explore-objects-list');
|
|
}
|
|
|
|
public function actionExploreObjectVisitByUser()
|
|
{
|
|
return $this->renderPartial('explore-object-visit-by-user');
|
|
}
|
|
|
|
public function actionFavorites() {
|
|
return $this->render('favorites');
|
|
}
|
|
|
|
public function actionUpdateFavorites() {
|
|
return $this->render('update-favorites');
|
|
}
|
|
|
|
public function actionVisitedplaces() {
|
|
return $this->render('visited-places');
|
|
}
|
|
|
|
public function actionGetProfile() {
|
|
return $this->render('get-profile');
|
|
}
|
|
|
|
public function actionUpdateCardStatus() {
|
|
return $this->render('update-cart-status');
|
|
}
|
|
|
|
public function actionMaintab() {
|
|
return $this->render('main-tab');
|
|
}
|
|
|
|
public function actionCollectionFilter(){
|
|
if(empty($_GET['parent_value_id'])) {
|
|
return $this->renderPartial('collection-filter');
|
|
} else {
|
|
return $this->render('collection-filter-dynamic');
|
|
}
|
|
}
|
|
|
|
public function actionExpositionFilter(){
|
|
return $this->renderPartial('exposition-filter');
|
|
}
|
|
|
|
public function actionOrders() {
|
|
return $this->renderPartial('orders');
|
|
}
|
|
|
|
public function actionOrdersForQrValidator() {
|
|
return $this->renderPartial('orders-for-qr-validator');
|
|
}
|
|
|
|
public function actionOrder() {
|
|
return $this->renderPartial('order');
|
|
}
|
|
|
|
public function actionValidateTickets() {
|
|
return $this->renderPartial('validate-tickets');
|
|
}
|
|
|
|
public function actionGetEventsByQrValidator() {
|
|
return $this->renderPartial('get-events-by-validator');
|
|
}
|
|
|
|
public function actionQrCodeScanner() {
|
|
return $this->renderPartial('qr-scanner');
|
|
}
|
|
}
|