<?php $page_title="Settings App UI";
    include("includes/header.php");
    require("includes/lb_helper.php");
    require("language/language.php");
    
    if(!isset($_SESSION['admin_type'])){
        if($_SESSION['admin_type'] == 0){
            session_destroy();
            header( "Location:index.php");
            exit;
        }
    }
    
    $qry="SELECT * FROM tbl_settings where id='1'";
    $result=mysqli_query($mysqli,$qry);
    $settings_data=mysqli_fetch_assoc($result);
    
    if(isset($_POST['app_theme'])){
        
        $data = array('is_theme'  =>  $_POST['is_theme']);
        
        $settings_edit=Update('tbl_settings', $data, "WHERE id = '1'");
        
        $_SESSION['msg']="11";
        $_SESSION['class']='success'; 
        header( "Location:settings_app_ui.php");
        exit;
    } else if(isset($_POST['app_theme_category'])){
        
        $data = array('is_category'  =>  $_POST['is_category']);
        
        $settings_edit=Update('tbl_settings', $data, "WHERE id = '1'");
        
        $_SESSION['msg']="11";
        $_SESSION['class']='success'; 
        header( "Location:settings_app_ui.php");
        exit;
    }
     
?>

<!-- Start: main -->
<main id="nsofts_main">
    <div class="nsofts-container">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb align-items-center">
                <li class="breadcrumb-item d-inline-flex"><a href="dashboard.php"><i class="ri-home-4-fill"></i></a></li>
                <li class="breadcrumb-item d-inline-flex active" aria-current="page"><?php echo (isset($page_title)) ? $page_title : "" ?></li>
            </ol>
        </nav>
            
        <div class="card">
            <div class="card-body p-0">                    
                <div class="nsofts-setting">
                    <div class="nsofts-setting__sidebar">
                        <a class="d-inline-flex align-items-center text-decoration-none fw-semibold mb-4">
                            <span class="ps-2 lh-1"><?php echo (isset($page_title)) ? $page_title : "" ?></span>
                        </a>
                        <div class="nav flex-column nav-pills" id="nsofts_setting" role="tablist" aria-orientation="vertical">
                            
                            <button class="nav-link active" id="nsofts_setting_1" data-bs-toggle="pill" data-bs-target="#nsofts_setting_content_1" type="button" role="tab" aria-controls="nsofts_setting_1" aria-selected="true">
                                <i class="ri-pencil-ruler-2-line"></i>
                                <span>App Themes</span>
                            </button>
                            
                            <button class="nav-link" id="nsofts_setting_2" data-bs-toggle="pill" data-bs-target="#nsofts_setting_content_2" type="button" role="tab" aria-controls="nsofts_setting_2" aria-selected="false">
                                <i class="ri-book-shelf-line"></i>
                                <span>App Category</span>
                            </button>
                        
                        </div>
                    </div>
                    <div class="nsofts-setting__content">
                        <div class="tab-content">
                            
                            <!--App Themes-->
                            <div class="tab-pane fade show active" id="nsofts_setting_content_1" role="tabpanel" aria-labelledby="nsofts_setting_1" tabindex="0">
                                <form action="" name="settings_theme" method="POST" enctype="multipart/form-data">
                                    <h4 class="mb-4">App Themes</h4>
                                    <div class="mb-3 row">
                                        <label for="" class="col-sm-2 col-form-label">App UI</label>
                                        <div class="col-sm-10">
                                            <select name="is_theme" id="is_theme" class="nsofts-select " required>
                                                <option value="">-- Select App UI --</option>
                                                <option value="1" <?php if ($settings_data['is_theme'] == '1') { ?>selected<?php } ?>>OneUI - coming soon</option>
                                                <option value="2" <?php if ($settings_data['is_theme'] == '2') { ?>selected<?php } ?>>Glossy - coming soon</option>
                                            </select>
                                        </div>
                                    </div>
                                    <button type="submit" name="app_theme" class="btn btn-primary" style="min-width: 120px;">Save</button>
                                    <div class="row g-4 mb-3 mt-3">
                                        <!--
                                        <div class="col-lg-6 col-sm-6 col-xs-12">
                                            <div class="nsofts-image-card">
                                                <div class="nsofts-image-card__cover" style="width: 100%; height: 250px; min-width: 100%; min-height: 100%; max-width: 100%;">
                                                    <img src="assets/images/themes/OneUI.png" alt="" >
                                                </div>
                                                <div class="nsofts-image-card__content">
                                                    <div class="position-relative">
                                                        <div class="d-flex align-items-center justify-content-between nsofts-image-card__content__text">
                                                            <span class="d-block text-truncate fs-6 fw-semibold pe-2">OneUI</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-lg-6 col-sm-6 col-xs-12">
                                            <div class="nsofts-image-card">
                                                <div class="nsofts-image-card__cover" style="width: 100%; height: 250px; min-width: 100%; min-height: 100%; max-width: 100%;">
                                                    <img src="assets/images/themes/Glossy.png" alt="" >
                                                </div>
                                                <div class="nsofts-image-card__content">
                                                    <div class="position-relative">
                                                        <div class="d-flex align-items-center justify-content-between nsofts-image-card__content__text">
                                                            <span class="d-block text-truncate fs-6 fw-semibold pe-2">Glossy</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        -->
                                    </div>
                                </form>
                            </div>
                            
                            <!--App Category-->
                            <div class="tab-pane fade" id="nsofts_setting_content_2" role="tabpanel" aria-labelledby="nsofts_setting_2" tabindex="0">
                                <form action="" name="settings_category" method="POST" enctype="multipart/form-data">
                                    <h4 class="mb-4">App Category</h4>
                                    <div class="mb-3 row">
                                        <label for="" class="col-sm-2 col-form-label">App UI</label>
                                        <div class="col-sm-10">
                                            <select name="is_category" id="is_category" class="nsofts-select " required>
                                                <option value="">-- Select Page UI --</option>
                                                <option value="1" <?php if ($settings_data['is_category'] == '1') { ?>selected<?php } ?>>UI NETFLIX</option>
                                                <option value="2" <?php if ($settings_data['is_category'] == '2') { ?>selected<?php } ?>>UI LIST</option>
                                            </select>
                                        </div>
                                    </div>
                                    <button type="submit" name="app_theme_category" class="btn btn-primary" style="min-width: 120px;">Save</button>
                                    <div class="row g-4 mb-3 mt-3">
                                        <div class="col-lg-6 col-sm-6 col-xs-12">
                                            <div class="nsofts-image-card">
                                                <div class="nsofts-image-card__cover" style="width: 100%; height: 250px; min-width: 100%; min-height: 100%; max-width: 100%;">
                                                    <img src="assets/images/themes/category_one.jpg" alt="" >
                                                </div>
                                                <div class="nsofts-image-card__content">
                                                    <div class="position-relative">
                                                        <div class="d-flex align-items-center justify-content-between nsofts-image-card__content__text">
                                                            <span class="d-block text-truncate fs-6 fw-semibold pe-2">UI NETFLIX</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-lg-6 col-sm-6 col-xs-12">
                                            <div class="nsofts-image-card">
                                                <div class="nsofts-image-card__cover" style="width: 100%; height: 250px; min-width: 100%; min-height: 100%; max-width: 100%;">
                                                    <img src="assets/images/themes/category_two.jpg" alt="" >
                                                </div>
                                                <div class="nsofts-image-card__content">
                                                    <div class="position-relative">
                                                        <div class="d-flex align-items-center justify-content-between nsofts-image-card__content__text">
                                                            <span class="d-block text-truncate fs-6 fw-semibold pe-2">UI LIST</span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<!-- End: main -->
<?php include("includes/footer.php");?>