<?php
session_start();
define('Admin_USER', true);

switch ($_POST['Option']) {

    case "Login":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->loginAdmin();

    break;
    case "Password-Reset":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->resetPass();

    break;
    case "Modify_Your_Account":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->modifyYourAccount();

    break;
    case "Add_Admin":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->insertAdmin();

    break;
    case "Modify_Administrator":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->modifyAdmin();

    break;
    case "Change_Password":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->changePassword();

    break;
    case "Change_Admin_Password":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/adminUtility.php";
        $admin = new adminUtility;
        $result = $admin->changeAdminPassword();

    break;
    case "Add-Navigation-Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/navUtility.php";
        $nav = new navigationUtility;
        $result = $nav->insertOptionCategory();

    break;
    case "Modify-Navigation-Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/navUtility.php";
        $nav = new navigationUtility;
        $result = $nav->modifyAdminCategory();

    break;
    case "Add-Navigation-Option":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/navUtility.php";
        $nav = new navigationUtility;
        $result = $nav->insertCategoryOption();

    break;
    case "Modify-Navigation-Option":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/navUtility.php";
        $nav = new navigationUtility;
        $result = $nav->modifyAdminCategoryOption();

    break;
    case "Add_CMP":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/navUtility.php";
        $nav = new navigationUtility;
        $result = $nav->addContentManagedPage();

    break;
    case "Edit_CMP":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/cmsClass.php";
        $c = new cmsClass;
        $result = $c->updatePageInfo();

    break;      
    /*
     * Everything above this line is default admin abilities and functionality
    */  
    case "Edit_Service":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/serviceClass.php";
        $s = new serviceClass;
        $result = $s->editService();

    break;      
    case "Add_Service":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/serviceClass.php";
        $s = new serviceClass;
        $result = $s->addService();

    break;
    case "Add_Service_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/serviceClass.php";
        $s = new serviceClass;
        $result = $s->addServiceCategory();

    break;
    case "Edit_Service_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/serviceClass.php";
        $s = new serviceClass;
        $result = $s->editServiceCategory();

    break;    
    case "Add_FAQ":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/faqsClass.php";
        $f = new faqClass;
        $result = $f->addFAQ();

    break;  
    case "Edit_FAQ":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/faqsClass.php";
        $f = new faqClass;
        $result = $f->editFAQ();

    break;
    case "Edit_FAQ_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/faqsClass.php";
        $f = new faqClass;
        $result = $f->editCategory();

    break;                        
    case "Add_FAQ_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/faqsClass.php";
        $f = new faqClass;
        $result = $f->addCategory();

    break;
    case "Add-Staff":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/staffClass.php";
        $s = new staffClass;
        $result = $s->addStaffMember();

    break;  
    case "Edit-Staff":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/staffClass.php";
        $s = new staffClass;
        $result = $s->editStaffMember();

    break;
    case "Add_Testimonial":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/testimonialClass.php";
        $t = new testimonialClass;
        $result = $t->addTestimonial();

    break;
    case "Edit_Testimonial":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/testimonialClass.php";
        $t = new testimonialClass;
        $result = $t->editTestimonial();

    break;  
    case "Add_Resource_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/resourceClass.php";
        $r = new resourcesClass;
        $result = $r->addCategory();

    break;
    case "Edit_Resource_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/resourceClass.php";
        $r = new resourcesClass;
        $result = $r->editCategory();

    break;
    case "Add_Resource":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/resourceClass.php";
        $r = new resourcesClass;
        $result = $r->addResPage();

    break;
    case "Edit_Resource":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/resourceClass.php";
        $r = new resourcesClass;
        $result = $r->updateResPageInfo();

    break;   
    case "Add-Document":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/documentClass.php";
        $d = new docClass;
        $result = $d->addDocument();

    break; 
    case "Add_Document_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/documentClass.php";
        $d = new docClass;
        $result = $d->addDocCategory();

    break;
    case "Edit_Document_Category":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/documentClass.php";
        $d = new docClass;
        $result = $d->editDocCategory();

    break; 
    case "Add_Banner":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/bannersClass.php";
        $b = new bannerClass;
        $result = $b->addBanner();

    break;                                  
    case "Edit_Banner_Text":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/bannersClass.php";
        $b = new bannerClass;
        $result = $b->editBannerText();

    break;
    case "Edit_Event":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/eventClass.php";
        $e = new eventClass;
        $result = $e->editEvent();

    break;
    case "Add_Event":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/eventClass.php";
        $e = new eventClass;
        $result = $e->addEvent();

    break;
    case "Add_Link":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/linksClass.php";
        $l = new linksClass;
        $result = $l->addLink();

    break; 
    case "Edit_Link":

        require_once "../../php/defines.php";
        require_once "../../php/classes/mainClass.php";
        require_once "../../php/classes/linksClass.php";
        $l = new linksClass;
        $result = $l->editLink();

    break;
                                                        
    
}

$response = array();
$response['Status'] = $result['Status'];
$response['Msg'] = $result['Msg'];
$response['Class'] = $result['Class'];
$response['ContinuePage'] = $result['ContinuePage'];
$response['Id'] = $result['Id'];
$response['Image'] = $result['Image'];
$response['ImageName'] = $result['ImageName'];
$response['FileName'] = $result['FileName'];

echo json_encode($response);

exit;
