<?php
header("Expires: 0");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");


define("HOME", '../resource/php/page/');
define("FUNCTION_SYSTEM", '../resource/php/function/');
require_once '../core/DAL/DAL.php';
require_once '../core/DAL/DAL2.php';
require_once '../core/WebServiceSystem.php';
require_once '../core/DAL/public-function.php';
require_once '../core/DAL/sms/SendMessage.php';


$package_name = "com.android.kashancard.v2.com";
$SMS = new SendMessage();
$DLA = $DAL = new DAL("constant.php");
$DLA2 = $DAL2 = new DAL2("constant2.php");
$WS = new WebServiceSystem();
if (true) {
    $request = null;
    if (isset($_GET["request"])) {
        $getHandel = $_GET;
        $request = $getHandel;
    }
    if (isset($_POST["request"])) {
        $postHandel = $_POST;
        $request = $postHandel;
    }


    if (isset($getHandel) or isset($postHandel)) {
        switch ($request['request']) {
            case "payment":
                require_once 'PaymentSystem.php';
                (new PaymentSystem($request['object']))->PayToCompany();
                break;
            case "android.application":
                require_once 'ApplicationSystem.php';
                (new ApplicationSystem($request))->run();
                break;
            case 'test':
                var_dump($request);
                break;
            case 'proxy':
                switch ($request['action']) {
                    //page start
                    case 'blank':
                        require_once HOME . 'blank/index.php';
                        break;
                    /*** page start ***/
                    case 'page-404':
                        require_once HOME . '404/404.php';
                        break;
                    /*** Top Bar Page ***/
                    case 'notification-page':
                        require_once HOME . 'TopBar/Notification.php';
                        break;
                    case 'request-page':
                        require_once HOME . 'TopBar/Request.php';
                        break;
                    /*** page start ***/
                    case 'application':
                        require_once HOME . 'application/application_page.php';
                        break;
                    case 'client':
                        require_once HOME . 'client/client_page.php';
                        break;
                    case 'acceptor':
                        require_once HOME . 'acceptor/acceptor_page.php';
                        break;
                    case 'category':
                        require_once HOME . 'category/category_page.php';
                        break;
                    case 'comment':
                        require_once HOME . 'comment/comments.php';
                        break;
                    case 'robot':
                        require_once HOME . 'bot/bot_page.php';
                        break;
                    case 'add-client':
                        require_once HOME . 'AddClient/AddClient.php';
                        break;
                    case 'report':
                        require_once HOME . 'AddClient/ReportTransaction.php';
                        break;
                    case 'upload':
                        require_once HOME . 'upload/upload.php';
                        break;
                    case 'profile':
                        require_once HOME . 'profile/profile.php';
                        break;
                    case 'recycling':
                        require_once HOME . 'recycling/index.php';
                        break;
                    case '137':
                        require_once HOME . '137/index.php';
                        break;
                    /*mobile page*/
                    case 'mobile-services':
                        require_once HOME . 'mobile/mobile_page.php';
                        break;
                    /*** page end ***/
                    //page end


                    //function start
                    //SignIn
                    case 'SessionController':
                        require_once FUNCTION_SYSTEM . 'SignIn/SessionController.php';
                        break;
                    //SignIn
                    case 'mail-help-count':
                        require_once FUNCTION_SYSTEM . 'home/help_mail_count.php';
                        break;
                    case 'mail-count':
                        require_once FUNCTION_SYSTEM . 'home/mail_count.php';
                        break;
                    /**
                     * application page function
                     */
                    case "app_load_image_slider":
                        require_once FUNCTION_SYSTEM . 'application/app_load_image_slider.php';
                        break;
                    case "app_update_slide_show":
                        require_once FUNCTION_SYSTEM . 'application/app_update_slide_show.php';
                        break;
                    case 'app_state_controller':
                        require_once FUNCTION_SYSTEM . 'application/app_state_controller.php';
                        break;
                    case 'app_notification_controller':
                        require_once FUNCTION_SYSTEM . 'application/app_notification_controller.php';
                        break;


                    case "app_slide_controller":
                        require_once FUNCTION_SYSTEM . 'application/app_slide_controller.php';
                        break;


                    /**
                     * comments page function
                     */
                    case 'commentsController':
                        require_once FUNCTION_SYSTEM . 'comment/commentsController.php';
                        break;
                    /**
                     * Reports page function
                     */
                    case 'notificationController':
                        require_once FUNCTION_SYSTEM . 'notification/notificationController.php';
                        break;
                    /**
                     * category page function
                     */
                    case "load-category":
                        require_once FUNCTION_SYSTEM . 'category/category_load.php';
                        break;
                    case "remove-category":
                        require_once FUNCTION_SYSTEM . 'category/category_remove.php';
                        break;
                    case "active-category":
                        require_once FUNCTION_SYSTEM . 'category/category_active.php';
                        break;
                    case "add-category":
                        require_once FUNCTION_SYSTEM . 'category/category_add.php';
                        break;
                    case "edit-category":
                        require_once FUNCTION_SYSTEM . 'category/category_edit.php';
                        break;
                    /**
                     * acceptor page function
                     **/
                    case 'acceptorController':
                        require_once FUNCTION_SYSTEM . 'acceptor/acceptorController.php';
                        break;
                    case "acceptor-terminal":
                        require_once FUNCTION_SYSTEM . 'acceptor/acceptor_terminal.php';
                        break;
                    /* case "add-acceptor":
                         require_once FUNCTION_SYSTEM . 'acceptor/acceptor_add.php';
                         break;
                     case "load-acceptor":
                         require_once FUNCTION_SYSTEM . 'acceptor/acceptor_load.php';
                         break;
                     case 'delete-acceptor':
                         require_once FUNCTION_SYSTEM . 'acceptor/acceptor_remove.php';
                         break;
                     case 'active-acceptor':
                         require_once FUNCTION_SYSTEM . 'acceptor/acceptor_active.php';
                         break;
                     case 'edit-acceptor':
                         require_once FUNCTION_SYSTEM . 'acceptor/acceptor_edit.php';
                         break;
                     case 'edit-document-acceptor':
                         require_once FUNCTION_SYSTEM . 'acceptor/edit_document_acceptor.php';
                         break;
                     case 'edit-slide-acceptor':
                         require_once FUNCTION_SYSTEM . 'acceptor/edit_slide_acceptor.php';
                         break;*/
                    case 'requestController':
                        require_once FUNCTION_SYSTEM . 'request/requestController.php';
                        break;
                    case 'clientController':
                        require_once FUNCTION_SYSTEM . 'client/clientController.php';
                        break;
                    case 'WebServicesController':
                        require_once FUNCTION_SYSTEM . 'AddClient/WebServicesController.php';
                        break;
                    case 'agency-report-full':
                        require_once FUNCTION_SYSTEM . 'AddClient/agency_report.php';
                        break;
                    case 'UploadCenter':
                        require_once FUNCTION_SYSTEM . 'upload/upload.php';
                        break;
                    case 'recyclingController':
                        require_once FUNCTION_SYSTEM . 'recycling/recyclingController.php';
                        break;
                    case '137Controller':
                        require_once FUNCTION_SYSTEM . '137/137Controller.php';
                        break;
                    //function end
                    default:
                        require_once HOME . '404/404.php';
                        break;
                }
                break;
            default:
                require_once HOME . '404/404.php';
                break;
        }
    } else {
        require_once HOME . '404/404.php';
    }
} else {
    require_once HOME . '404/404.php';
}