<?php

/**
 * @author Pratik Dev <webmaster.pratik@gmail.com>
 */
require_once '../header.php';
require_once $RootPath . '/config/language.php';
?>
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-3">
            <div class="card card-body shadow-sm">
                <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
                    <a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">General</a>
                    <a class="nav-link" id="v-pills-other-tab" data-toggle="pill" href="#v-pills-other" role="tab" aria-controls="v-pills-other" aria-selected="false">Other</a>
                    <a class="nav-link" id="v-pills-notification-tab" data-toggle="pill" href="#v-pills-notification" role="tab" aria-controls="v-pills-notification" aria-selected="false">Notification</a>
                    <a class="nav-link" id="v-pills-loginsetup-tab" data-toggle="pill" href="#v-pills-loginsetup" role="tab" aria-controls="v-pills-loginsetup" aria-selected="false">Login Setup</a>
                </div>
            </div>
        </div>
        <div class="col-lg-9">
            <form id="settingform" action="process.php" method="POST" enctype="multipart/form-data">
                <div class="tab-content" id="v-pills-tabContent">
                    <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <div class="d-flex justify-content-between">
                                    <h6 class="m-0 font-weight-bold text-primary">General</h6>
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="app_name">App Name:</label>
                                        <input type="text" name="app_name" value="<?php echo APP_NAME; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="thumb">Logo: (200w x 85h)</label>
                                        <div class="custom-file">
                                            <label for="thumb" class="custom-file-label">Choose File</label>
                                            <input type="file" name="logo" class="custom-file-input" />
                                        </div>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="app_name">Template:</label>
                                        <select name="tplname" id="tplname" class="form-control">
                                            <?php
                                            $dirlist  = scandir($RootPath . '/templates');
                                            foreach ($dirlist as $dir) {
                                                if (!(pathinfo($dir, PATHINFO_EXTENSION)) && !in_array($dir, ['.', '..', 'ads', 'pages', 'widget', 'amp'])) {
                                                    if ($dir == TEMPLATE) {
                                                        echo '<option value="' . $dir . '" selected>' . $dir . '</option>';
                                                    } else {
                                                        echo '<option value="' . $dir . '">' . $dir . '</option>';
                                                    }
                                                }
                                            } ?>
                                        </select>
                                    </div>
                                    <div class="form-group col-12">
                                        <label for="app_name">SITE HTTPS:</label>
                                        <input type="checkbox" class="form-control align-self-center" data-toggle="switch" name="site_https" value="1" <?php echo (APP_HTTPS == 1) ? ' checked' : '' ?> />
                                        <label for="app_name">OG IMAGE (<small>If turn off All Page set default ogimage</small>):</label>
                                        <input type="checkbox" class="form-control align-self-center" data-toggle="switch" name="thumbog" value="1" <?php echo (THUMB_OGIMAGE == 1) ? ' checked' : '' ?> />
                                        <label for="app_name">Web Push:</label>
                                        <input type="checkbox" class="form-control align-self-center" data-toggle="switch" name="webpush" value="1" <?php echo (WEBPUSH == 1) ? ' checked' : '' ?> />
                                    </div>
                                    <div class="form-group col-12">
                                        <label>Site Title:</label>
                                        <input type="text" name="home_title" value="<?php echo $title; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-12">
                                        <label>Site Description:</label>
                                        <input type="text" name="home_des" value="<?php echo $metadescription; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-12">
                                        <label>Site Keywords:</label>
                                        <input type="text" name="home_keywords" value="<?php echo $metakeywords; ?>" class="form-control">
                                    </div>
                                    <div class="col-12 alert alert-warning" role="alert">
                                        Note: If You Want To Change PAGE META TITLE, PAGE META DESCRIPTION, PAGE META KEYWORDS <br>
                                        Edit : <?php echo realpath($RootPath . '/config/language.php'); ?><br>
                                        Free Support WhatsApp No: 8617879613
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="v-pills-other" role="tabpanel" aria-labelledby="v-pills-other-tab">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <div class="d-flex justify-content-between">
                                    <h6 class="m-0 font-weight-bold text-primary">Other</h6>
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="form-row">

                                    <div class="form-group col-md-4">
                                        <label>User Max Upload Size:</label>
                                        <div class="input-group">
                                            <input type="text" name="user_max_upload" value="<?php echo USER_MAX_UPLOAD; ?>" class="form-control">
                                            <div class="input-group-append">
                                                <span class="input-group-text" id="basic-addon2">MB</span>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>User Upload Auto Approve:</label>
                                        <select name="user_upload_auto_approve" class="form-control">
                                            <?php
                                            $Size = explode(',', 'ON, OFF');
                                            foreach ($Size as $s) {
                                                if ($s == USER_UPLOAD_APPROVE) {
                                                    echo '<option value="' . $s . '" selected>' . $s . '</option>';
                                                } else {
                                                    echo '<option value="' . $s . '">' . $s . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>URL END:<small>.html</small></label>
                                        <input type="text" name="route_end" value="<?php echo ROUTE_END; ?>" class="form-control">
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>Files Per Page:</label>
                                        <input type="text" name="files_per_page" value="<?php echo FILES_PER_PAGE; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label>Category Per Page:</label>
                                        <input type="text" name="cat_per_page" value="<?php echo CATEGORY_PER_PAGE; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label>Releted Files Limit:</label>
                                        <input type="text" name="releted_limit" value="<?php echo RELETED_FILES_LIMIT; ?>" class="form-control">
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label for="thumb">Thumbnail Watermark:</label>
                                        <div class="custom-file">
                                            <label for="thumb" class="custom-file-label">Choose File</label>
                                            <input type="file" name="thumb_watermark" class="custom-file-input" />
                                        </div>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="thumb">Default Mp3 Cover:</label>
                                        <div class="custom-file">
                                            <label for="thumb" class="custom-file-label">Choose File</label>
                                            <input type="file" name="mp3_cover" class="custom-file-input" />
                                        </div>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="thumb">Mp3 Cover Watermark:</label>
                                        <div class="custom-file">
                                            <label for="thumb" class="custom-file-label">Choose File</label>
                                            <input type="file" name="mp3_watermark" class="custom-file-input" />
                                        </div>
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="thumb">META OG IMAGE:</label>
                                        <div class="input-group">
                                            <input type="text" name="ogimageurl" class="form-control" value="<?php echo $metaogimage; ?>">
                                            <div class="input-group-append">
                                                <span class="input-group-text">OR</span>
                                                <div class="custom-file">
                                                    <label for="thumb" class="custom-file-label">Choose File</label>
                                                    <input type="file" name="ogimage" class="custom-file-input" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label>Default Ads Network:</label>
                                        <select name="ads_network" class="form-control">
                                            <?php
                                            $Size = explode(',', ADS_NETWORK);
                                            foreach ($Size as $s) {
                                                if ($s == DEFAULT_ADS) {
                                                    echo '<option value="' . $s . '" selected>' . $s . '</option>';
                                                } else {
                                                    echo '<option value="' . $s . '">' . $s . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>Thumbnail Format:</label>
                                        <select name="thumbnail_format" class="form-control">
                                            <?php
                                            $Size = ['png', 'jpg', 'webp'];
                                            foreach ($Size as $s) {
                                                if ($s == THUMB_FORMAT) {
                                                    echo '<option value="' . $s . '" selected>' . $s . '</option>';
                                                } else {
                                                    echo '<option value="' . $s . '">' . $s . '</option>';
                                                }
                                            }
                                            ?>
                                        </select>
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>Thumbnail Quality:</label>
                                        <input type="text" name="thumb_quality" value="<?php echo THUMB_QUALITY; ?>" class="form-control">
                                    </div>

                                    <div class="form-group col-md-4">
                                        <label>ADVT EACH LIST:</label>
                                        <input type="text" name="advt_each" value="<?php echo ADVT_EACH; ?>" class="form-control">
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="v-pills-notification" role="tabpanel" aria-labelledby="v-pills-notification-tab">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <div class="d-flex justify-content-between">
                                    <h6 class="m-0 font-weight-bold text-primary">Notification Setup</h6>
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="form-row">
                                    <div class="form-group col-6">
                                        <label>OneSignal App ID:</label>
                                        <input type="text" name="onesignalid" value="<?php echo WEBPUSH_SENDER_ID; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-6">
                                        <label>OneSignal REST API Key:</label>
                                        <input type="text" name="onesignalrest" value="<?php echo WEBPUSH_REST_KEY; ?>" class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="v-pills-loginsetup" role="tabpanel" aria-labelledby="v-pills-loginsetup-tab">
                        <div class="card shadow mb-4">
                            <div class="card-header py-3">
                                <div class="d-flex justify-content-between">
                                    <h6 class="m-0 font-weight-bold text-primary">Login Setup</h6>
                                </div>
                            </div>
                            <div class="card-body">
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label>Google Sign In Client ID:</label>
                                        <input type="text" name="google_app_id" value="<?php echo GOOGLE_APP_ID; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label>Google Sign In Client Secret:</label>
                                        <input type="text" name="google_app_secret" value="<?php echo GOOGLE_APP_SECRET; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label>Facebok Sign In App ID:</label>
                                        <input type="text" name="facebook_app_id" value="<?php echo FACEBOOK_APP_ID; ?>" class="form-control">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label>Facebok Sign In App Secret:</label>
                                        <input type="text" name="facebook_app_secret" value="<?php echo FACEBOOK_APP_SECRET; ?>" class="form-control">
                                    </div>
                                    <p><strong>Note: Read Documention Callback (Redirect) URL:</strong><?php echo APP_URL . '/account'; ?></p>
                                </div>
                            </div>
                        </div>
                    </div>



                    <div class="row justify-content-center">
                        <button type="submit" id="submit" class="btn btn-success">Submit</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<?php
require_once '../footer.php';
?>