<?php
$pt->config->ffmpeg  = is_executable($pt->config->ffmpeg_binary_file);
function isEnabled($func) {
    return is_callable($func) && false === stripos(ini_get('disable_functions'), $func);
}
$enabled = true;
if (!isEnabled('shell_exec')) {
    $enabled = false;
}


?>
<div class="container-fluid">
    <div>
        <h3>Import & Upload Configuration</h3>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="#">Admin Panel</a>
                </li>
                <li class="breadcrumb-item">
                    <a href="#">Settings</a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Import & Upload Configuration</li>
            </ol>
        </nav>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Upload & File Sharing Configuration</h6>
                    <div class="upload_settings-alert"></div>
                    <form class="upload-settings" method="POST">
                        <div class="float-left">
                            <label for="upload_system" class="main-label">Upload Videos System</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_upload" id="who_can_upload-admin" onchange="SelectProModel('can_use_upload',this)" value="admin" <?php echo ($pt->config->who_can_upload == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_upload-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_upload" id="who_can_upload-all" onchange="SelectProModel('can_use_upload',this)" value="all" <?php echo ($pt->config->who_can_upload == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_upload-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_upload" id="who_can_upload-pro" onchange="SelectProModel('can_use_upload',this)" value="pro" <?php echo ($pt->config->who_can_upload == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_upload-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Allow users to upload videos to your site.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="upload_system" value="off" />
                            <input type="checkbox" name="upload_system" id="chck-upload_system" value="on" <?php echo ($pt->config->upload_system == 'on') ? 'checked': '';?>>
                            <label for="chck-upload_system" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div id="all_users_" <?php if($pt->config->upload_system_type == 1){ ?> class="hidden" <?php } ?>>
                            <label for="max_upload_all_users">"All Users" Upload Limit</label>
                            <br><small class="admin-info">Set the allowed disk size and limit for "All Users"</small>
                            <div class="form-group">
                                <select class="form-control show-tick" id="max_upload_all_users" name="max_upload_all_users">
                                    <option value="2000000" <?php if($pt->config->max_upload_all_users == '2000000'){ echo "selected";} ?>>2MB</option>
                                    <option value="6000000" <?php if($pt->config->max_upload_all_users == '6000000'){ echo "selected";} ?>>6MB</option>
                                    <option value="12000000" <?php if($pt->config->max_upload_all_users == '12000000'){ echo "selected";} ?>>12MB</option>
                                    <option value="24000000" <?php if($pt->config->max_upload_all_users == '24000000'){ echo "selected";} ?>>24MB</option>
                                    <option value="48000000" <?php if($pt->config->max_upload_all_users == '48000000'){ echo "selected";} ?>>48MB</option>
                                    <option value="96000000" <?php if($pt->config->max_upload_all_users == '96000000'){ echo "selected";} ?>>96MB</option>
                                    <option value="256000000" <?php if($pt->config->max_upload_all_users == '256000000'){ echo "selected";} ?>>256MB</option>
                                    <option value="512000000" <?php if($pt->config->max_upload_all_users == '512000000'){ echo "selected";} ?>>512MB</option>
                                    <option value="1000000000" <?php if($pt->config->max_upload_all_users == '1000000000'){ echo "selected";} ?>>1GB</option>
                                    <option value="10000000000" <?php if($pt->config->max_upload_all_users == '10000000000'){ echo "selected";} ?>>10GB</option>
                                    <option value="0" <?php if($pt->config->max_upload_all_users == '0'){ echo "selected";} ?>>Unlimited</option>
                                </select>
                            </div>
                            <hr>
                        </div>

                         <label for="max_upload">Max Upload Size (APPLIED TO ALL)</label>
                        <br><small class="admin-info">Set the max upload size, applied to all users, pro & free.</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="max_upload" name="max_upload">
                              <option value="2000000" <?php echo ($pt->config->max_upload == '2000000') ? 'selected': '';?>>2MB</option>
                              <option value="6000000" <?php echo ($pt->config->max_upload == '6000000') ? 'selected': '';?>>6MB</option>
                              <option value="12000000" <?php echo ($pt->config->max_upload == '12000000') ? 'selected': '';?>>12MB</option>
                              <option value="24000000" <?php echo ($pt->config->max_upload == '24000000') ? 'selected': '';?>>24MB</option>
                              <option value="48000000" <?php echo ($pt->config->max_upload == '48000000') ? 'selected': '';?>>48MB</option>
                              <option value="96000000" <?php echo ($pt->config->max_upload == '96000000') ? 'selected': '';?>>96MB</option>
                              <option value="256000000" <?php echo ($pt->config->max_upload == '256000000') ? 'selected': '';?>>256MB</option>
                              <option value="512000000" <?php echo ($pt->config->max_upload == '512000000') ? 'selected': '';?>>512MB</option>
                              <option value="1000000000" <?php echo ($pt->config->max_upload == '1000000000') ? 'selected': '';?>>1GB</option>
                              <option value="10000000000" <?php echo ($pt->config->max_upload == '10000000000') ? 'selected': '';?>>10GB</option>
                              <option value="0" <?php echo ($pt->config->max_upload == '0') ? 'selected': '';?>>Unlimited</option>
                            </select>
                        </div>
                        <hr>
                         <label for="chunk_size">Max Chunk Upload Size (SERVER UPLOAD LIMIT: <?php echo ini_get('upload_max_filesize')?>)</label>
                        <br><small class="admin-info">The chunk limit should not exceed the server upload limit.</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="chunk_size" name="chunk_size">
                              <option value="1MB" <?php echo ($pt->config->chunk_size == '1MB') ? 'selected': '';?>>1MB</option>
                              <option value="1900KB" <?php echo ($pt->config->chunk_size == '1900KB') ? 'selected': '';?>>2MB</option>
                              <option value="3MB" <?php echo ($pt->config->chunk_size == '3MB') ? 'selected': '';?>>3MB</option>
                              <option value="6MB" <?php echo ($pt->config->chunk_size == '6MB') ? 'selected': '';?>>6MB</option>
                              <option value="12MB" <?php echo ($pt->config->chunk_size == '12MB') ? 'selected': '';?>>12MB</option>
                              <option value="24MB" <?php echo ($pt->config->chunk_size == '24MB') ? 'selected': '';?>>24MB</option>
                            </select>
                        </div>
                        <hr>
                        <label for="who_upload">Admin Upload Restriction</label>
                        <br><small class="admin-info">Choose if only admin can upload videos or all users. </small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="who_upload" name="who_upload">
                              <option value="all" <?php echo ($pt->config->who_upload == 'all') ? 'selected': '';?>>All Users</option>
                              <option value="admin" <?php echo ($pt->config->who_upload == 'admin') ? 'selected': '';?>>Admin Only</option>
                            </select>
                        </div>
                    </form>
                </div>
            </div>
            <div class="alert alert-warning">In case you want to use YouTube Shorts or TikTok import feature, you need to create an account in <a href="https://rapidapi.com/" target="_blank">Rapid API</a> and subscribe to these libraries <a href="https://rapidapi.com/yi005/api/tiktok-video-no-watermark2" target="_blank">TikTok</a> , <a href="https://rapidapi.com/DataFanatic/api/youtube-media-downloader" target="_blank">YouTube Shorts</a>.</div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Import Configuration</h6>
                    <div class="upload_settings-alert"></div>
                    <form class="upload-settings" method="POST">
                        <div class="float-left">
                            <label for="import_system" class="main-label">Import Videos System</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_import" id="who_can_import-admin" onchange="SelectProModel('can_use_import',this)" value="admin" <?php echo ($pt->config->who_can_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_import" id="who_can_import-all" onchange="SelectProModel('can_use_import',this)" value="all" <?php echo ($pt->config->who_can_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_import" id="who_can_import-pro" onchange="SelectProModel('can_use_import',this)" value="pro" <?php echo ($pt->config->who_can_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Allow users to import videos to your site.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="import_system" value="off" />
                            <input type="checkbox" name="import_system" id="chck-import_system" value="on" <?php echo ($pt->config->import_system == 'on') ? 'checked': '';?>>
                            <label for="chck-import_system" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="youtube_short" class="main-label">Import YouTube Short Videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_youtube_short" id="who_can_youtube_short-admin" onchange="SelectProModel('can_use_youtube_short',this)" value="admin" <?php echo ($pt->config->who_can_youtube_short == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_youtube_short-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_youtube_short" id="who_can_youtube_short-all" onchange="SelectProModel('can_use_youtube_short',this)" value="all" <?php echo ($pt->config->who_can_youtube_short == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_youtube_short-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_youtube_short" id="who_can_youtube_short-pro" onchange="SelectProModel('can_use_youtube_short',this)" value="pro" <?php echo ($pt->config->who_can_youtube_short == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_youtube_short-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Allow users to import YouTube Short Videos to your site.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="youtube_short" value="off" />
                            <input type="checkbox" name="youtube_short" id="chck-youtube_short" value="on" <?php echo ($pt->config->youtube_short == 'on') ? 'checked': '';?>>
                            <label for="chck-youtube_short" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">YouTube API key</label>
                                <input type="text" name="yt_api" class="form-control" value="<?php echo ($pt->config->yt_api);?>">
                                <small class="admin-info">Your YouTube API key</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">RapidAPI Key</label>
                                <input type="text" name="rapid_api" class="form-control" value="<?php echo ($pt->config->rapid_api);?>">
                                <small class="admin-info">The API key from RapidAPI used to import YouTube shorts and TikTok videos.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="float-left">
                            <label for="ok_import" class="main-label">Import ok.ru videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_ok_import" id="who_can_ok_import-admin" onchange="SelectProModel('can_use_ok_import',this)" value="admin" <?php echo ($pt->config->who_can_ok_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_ok_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_ok_import" id="who_can_ok_import-all" onchange="SelectProModel('can_use_ok_import',this)" value="all" <?php echo ($pt->config->who_can_ok_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_ok_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_ok_import" id="who_can_ok_import-pro" onchange="SelectProModel('can_use_ok_import',this)" value="pro" <?php echo ($pt->config->who_can_ok_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_ok_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import videos from ok.ru</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="ok_import" value="off" />
                            <input type="checkbox" name="ok_import" id="chck-ok_import" value="on" <?php echo ($pt->config->ok_import == 'on') ? 'checked': '';?>>
                            <label for="chck-ok_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                         <div class="float-left">
                            <label for="facebook_import" class="main-label">Import Facebook videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_facebook_import" id="who_can_facebook_import-admin" onchange="SelectProModel('can_use_facebook_import',this)" value="admin" <?php echo ($pt->config->who_can_facebook_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_facebook_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_facebook_import" id="who_can_facebook_import-all" onchange="SelectProModel('can_use_facebook_import',this)" value="all" <?php echo ($pt->config->who_can_facebook_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_facebook_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_facebook_import" id="who_can_facebook_import-pro" onchange="SelectProModel('can_use_facebook_import',this)" value="pro" <?php echo ($pt->config->who_can_facebook_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_facebook_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import videos from Facebook</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="facebook_import" value="off" />
                            <input type="checkbox" name="facebook_import" id="chck-facebook_import" value="on" <?php echo ($pt->config->facebook_import == 'on') ? 'checked': '';?>>
                            <label for="chck-facebook_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Facebook Application Client ID</label>
                                <input type="text" name="fb_api_id" class="form-control" value="<?php echo ($pt->config->fb_api_id);?>">
                                <small class="admin-info">Your Facebook Application Client ID</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Facebook Application Client Secret</label>
                                <input type="text" name="fb_api_sc" class="form-control" value="<?php echo ($pt->config->fb_api_sc);?>">
                                <small class="admin-info">Your Facebook Application Client Secret</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                         <div class="float-left">
                            <label for="instagram_import" class="main-label">Import Instagram videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_instagram_import" id="who_can_instagram_import-admin" onchange="SelectProModel('can_use_instagram_import',this)" value="admin" <?php echo ($pt->config->who_can_instagram_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_instagram_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_instagram_import" id="who_can_instagram_import-all" onchange="SelectProModel('can_use_instagram_import',this)" value="all" <?php echo ($pt->config->who_can_instagram_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_instagram_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_instagram_import" id="who_can_instagram_import-pro" onchange="SelectProModel('can_use_instagram_import',this)" value="pro" <?php echo ($pt->config->who_can_instagram_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_instagram_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import videos from Instagram</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="instagram_import" value="off" />
                            <input type="checkbox" name="instagram_import" id="chck-instagram_import" value="on" <?php echo ($pt->config->instagram_import == 'on') ? 'checked': '';?>>
                            <label for="chck-instagram_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="twitch_import" class="main-label">Import Twitch videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_twitch_import" id="who_can_twitch_import-admin" onchange="SelectProModel('can_use_twitch_import',this)" value="admin" <?php echo ($pt->config->who_can_twitch_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_twitch_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_twitch_import" id="who_can_twitch_import-all" onchange="SelectProModel('can_use_twitch_import',this)" value="all" <?php echo ($pt->config->who_can_twitch_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_twitch_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_twitch_import" id="who_can_twitch_import-pro" onchange="SelectProModel('can_use_twitch_import',this)" value="pro" <?php echo ($pt->config->who_can_twitch_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_twitch_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import videos from Twitch</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="twitch_import" value="off" />
                            <input type="checkbox" name="twitch_import" id="chck-twitch_import" value="on" <?php echo ($pt->config->twitch_import == 'on') ? 'checked': '';?>>
                            <label for="chck-twitch_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Twitch Client Id</label>
                                <input type="text" name="twitch_api" class="form-control" value="<?php echo ($pt->config->twitch_api);?>">
                                <small class="admin-info">Your Twitch Client Id</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="tiktok_import" class="main-label">Import TikTok videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_tiktok_import" id="who_can_tiktok_import-admin" onchange="SelectProModel('can_use_tiktok_import',this)" value="admin" <?php echo ($pt->config->who_can_tiktok_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_tiktok_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_tiktok_import" id="who_can_tiktok_import-all" onchange="SelectProModel('can_use_tiktok_import',this)" value="all" <?php echo ($pt->config->who_can_tiktok_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_tiktok_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_tiktok_import" id="who_can_tiktok_import-pro" onchange="SelectProModel('can_use_tiktok_import',this)" value="pro" <?php echo ($pt->config->who_can_tiktok_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_tiktok_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import videos from TikTok</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="tiktok_import" value="off" />
                            <input type="checkbox" name="tiktok_import" id="chck-tiktok_import" value="on" <?php echo ($pt->config->tiktok_import == 'on') ? 'checked': '';?>>
                            <label for="chck-tiktok_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="m3u8_import" class="main-label">Import m3u8 videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_m3u8_import" id="who_can_m3u8_import-admin" onchange="SelectProModel('can_use_m3u8_import',this)" value="admin" <?php echo ($pt->config->who_can_m3u8_import == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_m3u8_import-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_m3u8_import" id="who_can_m3u8_import-all" onchange="SelectProModel('can_use_m3u8_import',this)" value="all" <?php echo ($pt->config->who_can_m3u8_import == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_m3u8_import-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_m3u8_import" id="who_can_m3u8_import-pro" onchange="SelectProModel('can_use_m3u8_import',this)" value="pro" <?php echo ($pt->config->who_can_m3u8_import == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_m3u8_import-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Import m3u8 videos</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="m3u8_import" value="off" />
                            <input type="checkbox" name="m3u8_import" id="chck-m3u8_import" value="on" <?php echo ($pt->config->m3u8_import == 'on') ? 'checked': '';?>>
                            <label for="chck-m3u8_import" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="embed_videos" class="main-label">Embed videos</label>
                            <div class="dropdown user_filter_drop">
                                <button class="btn btn-light" data-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M8 13C6.14 13 4.59 14.28 4.14 16H2V18H4.14C4.59 19.72 6.14 21 8 21S11.41 19.72 11.86 18H22V16H11.86C11.41 14.28 9.86 13 8 13M8 19C6.9 19 6 18.1 6 17C6 15.9 6.9 15 8 15S10 15.9 10 17C10 18.1 9.1 19 8 19M19.86 6C19.41 4.28 17.86 3 16 3S12.59 4.28 12.14 6H2V8H12.14C12.59 9.72 14.14 11 16 11S19.41 9.72 19.86 8H22V6H19.86M16 9C14.9 9 14 8.1 14 7C14 5.9 14.9 5 16 5S18 5.9 18 7C18 8.1 17.1 9 16 9Z"></path></svg>
                                </button>
                                <ul class="dropdown-menu">
                                    <div class="dropdown-menu-innr">
                                        <b>Who can use this feature?</b>
                                        <div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_embed_videos" id="who_can_embed_videos-admin" onchange="SelectProModel('can_use_embed_videos',this)" value="admin" <?php echo ($pt->config->who_can_embed_videos == 'admin')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_embed_videos-admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M17.13,17C15.92,18.85 14.11,20.24 12,20.92C9.89,20.24 8.08,18.85 6.87,17C6.53,16.5 6.24,16 6,15.47C6,13.82 8.71,12.47 12,12.47C15.29,12.47 18,13.79 18,15.47C17.76,16 17.47,16.5 17.13,17Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_embed_videos" id="who_can_embed_videos-all" onchange="SelectProModel('can_use_embed_videos',this)" value="all" <?php echo ($pt->config->who_can_embed_videos == 'all')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_embed_videos-all" data-toggle="tooltip" data-placement="bottom" title="All Users"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"></path></svg></label> 
                                            </div>
                                            <div class="round_check">
                                                <input type="radio" name="who_can_embed_videos" id="who_can_embed_videos-pro" onchange="SelectProModel('can_use_embed_videos',this)" value="pro" <?php echo ($pt->config->who_can_embed_videos == 'pro')   ? ' checked' : '';?>>
                                                <label class="radio-inline" for="who_can_embed_videos-pro" data-toggle="tooltip" data-placement="bottom" title="Pro Users Only"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></path></svg></label> 
                                            </div>
                                        </div>
                                    </div>
                                </ul>
                            </div>
                            <br><small class="admin-info">Allow users to embed videos to your site.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="embed_videos" value="off" />
                            <input type="checkbox" name="embed_videos" id="chck-embed_videos" value="on" <?php echo ($pt->config->embed_videos == 'on') ? 'checked': '';?>>
                            <label for="chck-embed_videos" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="review_embed_videos" class="main-label">Review Embed videos</label>
                            <br><small class="admin-info">Review the embeded video by admin before publishing.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="review_embed_videos" value="off" />
                            <input type="checkbox" name="review_embed_videos" id="chck-review_embed_videos" value="on" <?php echo ($pt->config->review_embed_videos == 'on') ? 'checked': '';?>>
                            <label for="chck-review_embed_videos" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-6 col-md-6">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">FFMPEG Configuration</h6>
                    <div class="ffmpeg-settings-alert"></div>
                    <form class="ffmpeg-settings" method="POST">
                        <div class="float-left">
                            <label for="ffmpeg_system" class="main-label">FFMPEG System</label>
                            <br><small class="admin-info">This system will compress, convert, and optimzise videos to mp4. <br>
                            This system require "ffmpeg" to be installed in your server.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="ffmpeg_system" value="off" />
                            <input type="checkbox" name="ffmpeg_system" id="chck-ffmpeg_system" value="on" <?php echo ($pt->config->ffmpeg_system == 'on') ? 'checked': '';?>>
                            <label for="chck-ffmpeg_system" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <?php if (!$pt->config->ffmpeg): ?>
                                <label class="form-label" style="color: red;">
                                    FFmpeg binary does not exist on path: {{CONFIG ffmpeg_binary_file}} <br>
                                    Make sure the file <?php echo ($pt->config->ffmpeg_binary_file);?> is set to permission: 777.
                                </label>
                                <?php else: ?>
                                <label class="form-label">
                                    FFmpeg Binary File Path
                                </label>
                                <?php endif; ?>
                                <input type="text" name="ffmpeg_binary_file" class="form-control" value="<?php echo ($pt->config->ffmpeg_binary_file);?>">
                                <small class="admin-info">Example: Linux(/usr/bin/ffmpeg) or Windows(C:\\ffmpeg\bin\ffmpeg.exe)</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">
                                    Max Processes Allowed
                                </label>
                                <input type="text" name="queue_count" class="form-control" value="<?php echo ($pt->config->queue_count);?>">
                                <small class="admin-info">How many videos can be converted at the same time? Leave 0 for unlimited. </small>
                                <small class="admin-info" style="color: red">If you set max allowed processes, make sure you have added cronjob.php to your server's cronjob, that should run once every 5 minutes.</small>
                            </div>
                        </div>
                        <hr>
                        <?php if ($pt->config->ffmpeg && $enabled == true): ?>
                        <label for="convert_speed">Video Conversation Speed</label>
                        <br><small class="admin-info">This affect the encoding speed. Using a slower preset gives you better compression, or quality per filesize, whereas faster presets give you worse compression and higher filesize.</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="convert_speed" name="convert_speed">
                              <option value="ultrafast" <?php echo ($pt->config->convert_speed == 'ultrafast') ? 'selected': '';?>>Ultrafast</option>
                            <option value="superfast" <?php echo ($pt->config->convert_speed == 'superfast') ? 'selected': '';?>>Superfast</option>
                            <option value="veryfast" <?php echo ($pt->config->convert_speed == 'veryfast') ? 'selected': '';?>>Veryfast</option>
                            <option value="faster" <?php echo ($pt->config->convert_speed == 'faster') ? 'selected': '';?>>Faster</option>
                            <option value="fast" <?php echo ($pt->config->convert_speed == 'fast') ? 'selected': '';?>>Fast</option>
                            <option value="medium" <?php echo ($pt->config->convert_speed == 'medium') ? 'selected': '';?>>Medium</option>
                            <option value="slow" <?php echo ($pt->config->convert_speed == 'slow') ? 'selected': '';?>>Slow</option>
                            <option value="slower" <?php echo ($pt->config->convert_speed == 'slower') ? 'selected': '';?>>Slower</option>
                            <option value="veryslow" <?php echo ($pt->config->convert_speed == 'veryslow') ? 'selected': '';?>>Veryslow</option>
                            </select>
                        </div>
                        <hr>
                        <?php endif; ?>

                        <!-- <div class="float-left">
                            <label for="p240" class="">Convert To 240p</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p240" value="off" />
                            <input type="checkbox" name="p240" id="chck-p240" value="on" <?php echo ($pt->config->p240 == 'on') ? 'checked': '';?>>
                            <label for="chck-p240" class="check-trail"><span class="check-handler"></span></label>
                        </div> -->
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="p360" class="">Convert To 360p</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p360" value="off" />
                            <input type="checkbox" name="p360" id="chck-p360" value="on" <?php echo ($pt->config->p360 == 'on') ? 'checked': '';?>>
                            <label for="chck-p360" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="p480" class="">Convert To 480p</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p480" value="off" />
                            <input type="checkbox" name="p480" id="chck-p480" value="on" <?php echo ($pt->config->p480 == 'on') ? 'checked': '';?>>
                            <label for="chck-p480" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="p720" class="">Convert To 720p (If video resolution is 720p or above)</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p720" value="off" />
                            <input type="checkbox" name="p720" id="chck-p720" value="on" <?php echo ($pt->config->p720 == 'on') ? 'checked': '';?>>
                            <label for="chck-p720" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="p1080" class="">Convert To 1080p (If video resolution is 1080p or above)</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p1080" value="off" />
                            <input type="checkbox" name="p1080" id="chck-p1080" value="on" <?php echo ($pt->config->p1080 == 'on') ? 'checked': '';?>>
                            <label for="chck-p1080" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="p2048" class="">Convert To 2048p (If video resolution is 2048p or above)</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p2048" value="off" />
                            <input type="checkbox" name="p2048" id="chck-p2048" value="on" <?php echo ($pt->config->p2048 == 'on') ? 'checked': '';?>>
                            <label for="chck-p2048" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <div class="float-left">
                            <label for="4096" class="">Convert To 4096p (If video resolution is 4096p or above)</label>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="p4096" value="off" />
                            <input type="checkbox" name="p4096" id="chck-p4096" value="on" <?php echo ($pt->config->p4096 == 'on') ? 'checked': '';?>>
                            <label for="chck-p4096" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="float-left">
                            <label for="gif_system" class="main-label">GIF System</label>
                            <br><small class="admin-info">Create gifs from videos, activated on hovering.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="gif_system" value="off" />
                            <input type="checkbox" name="gif_system" id="chck-gif_system" value="on" <?php echo ($pt->config->gif_system == 'on') ? 'checked': '';?>>
                            <label for="chck-gif_system" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>

                        <div class="alert alert-info">
                           <strong>Info: </strong> For more information on how to setup FFMPEG, please visit our <a href="https://docs.playtubescript.com/#idocs_ffmpeg" target="_blank">Documentation</a> page.
                       </div>
                        <?php if ($enabled == false): ?>
                            <p style="color: red">shell_exec() has been disabled for security reasons, please contact your host provider to enable it. shell_exec is required to enable this system.</p><br>
                        <?php endif; ?>




                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Debug FFMPEG</h6>
                    <div class="alert alert-info">This feature will test the FFMPEG Configuration and make sure the system is working fine.</div>
                    <form class="debug-settings" method="POST">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Debug Log</label>
                                <textarea name="debug_ffmpeg" id="debug_ffmpeg" class="form-control" cols="30" rows="5" style="height: 700px !important;" disabled>Click on Debug FFMPEG to show test results.</textarea>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Please upload video for test</label>
                                <input type="file" name="video" accept="video/*" class="form-control" required>
                            </div>
                        </div>
                        <div class="debug-settings-alert"></div>
                        <button type="submit" class="btn btn-success m-t-15 waves-effect">Debug FFMPEG</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-12 col-md-12">
            <h3>Storage & CDN Configuration <br><hr></h3>

             <div class="alert alert-warning">
                <i class="fa fa-fw fa-exclamation-triangle"></i> <strong>Important:</strong> You can't enable two or three storages at the same time, if you enable FTP, amazon s3 will be automatically disabled, same for amazon s3, Digitalocean and Google.
            </div>
            <div class="alert alert-info">
               <strong>Info: </strong> For more information on how to setup third party storage, please visit our <a href="https://docs.playtubescript.com/#idocs_amazon_s3" target="_blank">Documentation</a> page.
           </div>
        </div>
        <div class="col-lg-6 col-md-6 pull-left">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Configure Amazon S3</h6>
                    <?php if ($pt->config->server == 'nodejs') { ?>
                    <div class="alert alert-info "><?php echo ($pt->config->server == 'nodejs') ? "Note: If you are using node.js as messaging system, please restart your node.js (./nodejs/server.js) application after saving the changes." : '';?></div>
                    <?php } ?>
                    <div class="s3-settings-alert"></div>
                    <form class="s3-settings" method="POST">
                        <div class="float-left">
                            <label for="s3_upload" class="main-label">Amazon S3 Storage</label>
                            <br><small class="admin-info">Enable Amazon Storage to store your files in Amazon S3.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="s3_upload" value="off" />
                            <input type="checkbox" name="s3_upload" id="chck-s3_upload" value="on" <?php echo ($pt->config->s3_upload == 'on') ? 'checked': '';?>>
                            <label for="chck-s3_upload" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Amazon Bucket Name</label>
                                <input type="text" name="s3_bucket_name" class="form-control" value="<?php echo ($pt->config->s3_bucket_name);?>">
                                <small class="admin-info">Your Amazon S3 Bucket Name</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Amazon S3 Key</label>
                                <input type="text" name="amazone_s3_key" class="form-control" value="<?php echo ($pt->config->amazone_s3_key);?>">
                                <small class="admin-info">Your Amazon Key from AWS credentials</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Amazon S3 Secret Key</label>
                                <input type="text" name="amazone_s3_s_key" class="form-control" value="<?php echo ($pt->config->amazone_s3_s_key);?>">
                                <small class="admin-info">Your Amazon Secret from AWS credentials</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Amazon S3 Custom Endpoint (Optional)</label>
                                <input type="text" name="amazon_endpoint" class="form-control" value="<?php echo ($pt->config->amazon_endpoint);?>">
                                <small class="admin-info">Your Amazon custom domain name, e.g: https://customCDNdomain.com</small>
                            </div>
                        </div>
                        <hr>
                        <label for="region">Amazon S3 bucket Region</label>
                        <br><small class="admin-info">Your Amazon's S3 Region</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="region" name="region">
                              <option value="us-east-2" <?php echo ($pt->config->region == 'us-east-2')   ? ' selected' : '';?> >US East (Ohio) [us-east-2]</option>
                              <option value="us-east-1" <?php echo ($pt->config->region == 'us-east-1')   ? ' selected' : '';?> >US East (N. Virginia) [us-east-1]</option>
                              <option value="us-west-1" <?php echo ($pt->config->region == 'us-west-1')   ? ' selected' : '';?> >US West (N. California) [us-west-1]</option>
                              <option value="us-west-2" <?php echo ($pt->config->region == 'us-west-2')   ? ' selected' : '';?> >US West (Oregon) [us-west-2]</option>
                              <option value="af-south-1" <?php echo ($pt->config->region == 'af-south-1')   ? ' selected' : '';?> >Africa (Cape Town) [af-south-1]</option>
                              <option value="ap-east-1" <?php echo ($pt->config->region == 'ap-east-1')   ? ' selected' : '';?> >Asia Pacific (Hong Kong) [ap-east-1]</option>
                              <option value="ap-south-1" <?php echo ($pt->config->region == 'ap-south-1')   ? ' selected' : '';?> >Asia Pacific (Mumbai) [ap-south-1]</option>
                              <option value="ap-northeast-3" <?php echo ($pt->config->region == 'ap-northeast-3')   ? ' selected' : '';?> >Asia Pacific (Osaka) [ap-northeast-3]</option>
                              <option value="ap-northeast-2" <?php echo ($pt->config->region == 'ap-northeast-2')   ? ' selected' : '';?> >Asia Pacific (Seoul) [ap-northeast-2]</option>
                              <option value="ap-southeast-1" <?php echo ($pt->config->region == 'ap-southeast-1')   ? ' selected' : '';?> >Asia Pacific (Singapore) [ap-southeast-1]</option>
                              <option value="ap-southeast-2" <?php echo ($pt->config->region == 'ap-southeast-2')   ? ' selected' : '';?> >Asia Pacific (Sydney) [ap-southeast-2]</option>
                              <option value="ap-northeast-1" <?php echo ($pt->config->region == 'ap-northeast-1')   ? ' selected' : '';?> >Asia Pacific (Tokyo) [ap-northeast-1]</option>
                              <option value="ca-central-1" <?php echo ($pt->config->region == 'ca-central-1')   ? ' selected' : '';?> >Canada (Central) [ca-central-1]</option>
                              <option value="cn-northwest-1" <?php echo ($pt->config->region == 'cn-northwest-1')   ? ' selected' : '';?> >China (Ningxia) [cn-northwest-1]</option>
                              <option value="eu-central-1" <?php echo ($pt->config->region == 'eu-central-1')   ? ' selected' : '';?> >Europe (Frankfurt) [eu-central-1]</option>
                              <option value="eu-west-1" <?php echo ($pt->config->region == 'eu-west-1')   ? ' selected' : '';?> >Europe (Ireland) [eu-west-1]</option>
                              <option value="eu-west-2" <?php echo ($pt->config->region == 'eu-west-2')   ? ' selected' : '';?> >Europe (London) [eu-west-2]</option>
                              <option value="eu-south-1" <?php echo ($pt->config->region == 'eu-south-1')   ? ' selected' : '';?> >Europe (Milan) [eu-south-1]</option>
                              <option value="eu-west-3" <?php echo ($pt->config->region == 'eu-west-3')   ? ' selected' : '';?> >Europe (Paris) [eu-west-3]</option>
                              <option value="eu-north-1" <?php echo ($pt->config->region == 'eu-north-1')   ? ' selected' : '';?> >Europe (Stockholm) [eu-north-1]</option>
                              <option value="ap-southeast-3" <?php echo ($pt->config->region == 'ap-southeast-3')   ? ' selected' : '';?> >Asia Pacific (Jakarta) [ap-southeast-3]</option>
                              <option value="me-south-1" <?php echo ($pt->config->region == 'me-south-1')   ? ' selected' : '';?> >Middle East(Bahrain) [me-south-1]</option>
                              <option value="sa-east-1" <?php echo ($pt->config->region == 'sa-east-1')   ? ' selected' : '';?> >South America (São Paulo) [sa-east-1]</option>
                              <option value="us-gov-east-1" <?php echo ($pt->config->region == 'us-gov-east-1')   ? ' selected' : '';?> >AWS GovCloud (US-East) [us-gov-east-1]</option>
                              <option value="us-gov-west-1" <?php echo ($pt->config->region == 'us-gov-west-1')   ? ' selected' : '';?> >AWS GovCloud (US-West) [us-gov-west-1]</option>
                            </select>
                        </div>
                        <hr>
                        <div class="clearfix"></div>
                        <br>
                        <div class="alert alert-info">
                           Before enabling Amazon S3, make sure you upload the whole "upload/" folder to your bucket. <br><br>
                            Before disabling Amazon S3, make sure you download the whole "upload/" folder to your server.<br><br>
                            If your site is still brand new, you can escape the upload step, but make sure to click on "Test Connection".<br>
                        </div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect test-con" onclick="pt_test_s3();">Test Connection</button>
                        <a href="<?php echo PT_LoadAdminLinkSettings('upload-to-storage?storage=amazon'); ?>" class="btn btn-success m-t-15 waves-effect">Upload Files To Amazon</a>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Digitalocean Spaces Configuration</h6>
                    <div class="spaces-settings-alert"></div>
                    <form class="spaces-settings" method="POST">
                        <div class="float-left">
                            <label for="spaces" class="main-label">Digitalocean Spaces Storage</label>
                            <br><small class="admin-info">Enable Digitalocean Storage to store your files in Digitalocean Spaces.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="spaces" value="off" />
                            <input type="checkbox" name="spaces" id="chck-spaces" value="on" <?php echo ($pt->config->spaces == 'on') ? 'checked': '';?>>
                            <label for="chck-spaces" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Digitalocean Space Name</label>
                                <input type="text" name="space_name" class="form-control" value="<?php echo ($pt->config->space_name);?>">
                                <small class="admin-info">Your Digitalocean Space Bucket name.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Digitalocean Key</label>
                                <input type="text" name="spaces_key" class="form-control" value="<?php echo ($pt->config->spaces_key);?>">
                                <small class="admin-info">Your Digitalocean Space credentials key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Digitalocean Secret</label>
                                <input type="text" name="spaces_secret" class="form-control" value="<?php echo ($pt->config->spaces_secret);?>">
                                <small class="admin-info">Your Digitalocean Space credentials secret key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Digitalocean Custom Endpoint (Optional)</label>
                                <input type="text" name="spaces_endpoint" class="form-control" value="<?php echo ($pt->config->spaces_endpoint);?>">
                                <small class="admin-info">Your Digitalocean custom domain name, e.g: https://customCDNdomain.com</small>
                            </div>
                        </div>
                        <hr>
                        <label for="space_region">Digitalocean bucket region</label>
                        <br><small class="admin-info">Your Digitalocean's S3 Region</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="space_region" name="space_region">

                                <option value="nyc1" <?php echo ($pt->config->space_region == 'nyc1')   ? ' selected' : '';?> >New York [NYC1]</option>
                          <option value="nyc2" <?php echo ($pt->config->space_region == 'nyc2')   ? ' selected' : '';?> >New York [NYC2]</option>
                          <option value="nyc3" <?php echo ($pt->config->space_region == 'nyc3')   ? ' selected' : '';?> >New York [NYC3]</option>

                          <option value="sfo1" <?php echo ($pt->config->space_region == 'sfo1')   ? ' selected' : '';?> >SAN FRANCISCO [SFO1]</option>
                          <option value="sfo2" <?php echo ($pt->config->space_region == 'sfo2')   ? ' selected' : '';?> >SAN FRANCISCO [SFO2]</option>

                          <option value="tor1" <?php echo ($pt->config->space_region == 'tor1')   ? ' selected' : '';?> >TORONTO [TOR1]</option>

                          <option value="lon1" <?php echo ($pt->config->space_region == 'lon1')   ? ' selected' : '';?> >LONDON [LON1]</option>

                          <option value="FRA1" <?php echo ($pt->config->space_region == 'FRA1')   ? ' selected' : '';?> >Frankfurt [FRA1]</option>


                          <option value="ams2" <?php echo ($pt->config->space_region == 'ams2')   ? ' selected' : '';?> >Amsterdam [AMS2]</option>
                          <option value="ams3" <?php echo ($pt->config->space_region == 'ams3')   ? ' selected' : '';?> >Amsterdam [AMS3]</option>
                          <option value="sgp1" <?php echo ($pt->config->space_region == 'sgp1')   ? ' selected' : '';?> >Singapore [SGP1]</option>
                          <option value="blr1" <?php echo ($pt->config->space_region == 'blr1')   ? ' selected' : '';?> >Bangalore [BLR1]</option>
                            </select>
                        </div>
                        <hr>
                        <div class="clearfix"></div>
                        <br>
                        <div class="alert alert-info">
                            Before enabling Digitalocean, make sure you upload the whole "upload/" folder to your bucket. <br><br>
                            Before disabling Digitalocean, make sure you download the whole "upload/" folder to your server. <br><br>
                            If your site is still brand new, you can escape the upload step, but make sure to click on "Test Connection". <br>
                        </div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect" onclick="Wo_TestSpaces()">Test Connection</button>
                        <a href="<?php echo PT_LoadAdminLinkSettings('upload-to-storage?storage=digitalocean'); ?>" class="btn btn-success m-t-15 waves-effect">Upload Files To Digitalocean</a>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Backblaze Configuration</h6>
                    <form class="backblaze_storage-settings" method="POST">
                         <div class="float-left">
                            <label for="backblaze_storage" class="main-label">Backblaze Storage</label>
                            <br><small class="admin-info">Enable Backblaze Storage to store your files in Backblaze Spaces.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="backblaze_storage" value="off" />
                            <input type="checkbox" name="backblaze_storage" id="chck-backblaze_storage" value="on" <?php echo ($pt->config->backblaze_storage == 'on') ? 'checked': '';?>>
                            <label for="chck-backblaze_storage" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Backblaze Bucket ID</label>
                                <input type="text" id="backblaze_bucket_id" name="backblaze_bucket_id" class="form-control" value="<?php echo $pt->config->backblaze_bucket_id?>">
                                <small class="admin-info">Your Backblaze Bucket ID.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Backblaze Bucket Name</label>
                                <input type="text" id="backblaze_bucket_name" name="backblaze_bucket_name" class="form-control" value="<?php echo $pt->config->backblaze_bucket_name?>">
                                <small class="admin-info">Your Backblaze Bucket Name.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Backblaze Bucket Region</label>
                                <input type="text" id="backblaze_region" name="backblaze_region" class="form-control" value="<?php echo $pt->config->backblaze_region?>">
                                <small class="admin-info">Your Backblaze Bucket Region.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Backblaze Access Key ID</label>
                                <input type="text" id="backblaze_access_key_id" name="backblaze_access_key_id" class="form-control" value="<?php echo $pt->config->backblaze_access_key_id ?>">
                                <small class="admin-info">Your Backblaze Access Key ID.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Backblaze Access Key</label>
                                <input type="text" id="backblaze_access_key" name="backblaze_access_key" class="form-control" value="<?php echo $pt->config->backblaze_access_key ?>">
                                <small class="admin-info">Your Backblaze Access Key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">BackBlaze Custom Endpoint (Optional)</label>
                                <input type="text" name="backblaze_endpoint" class="form-control" value="<?php echo ($pt->config->backblaze_endpoint);?>">
                                <small class="admin-info">Your BackBlaze custom domain name, e.g: https://customCDNdomain.com</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <br>
                        <div class="alert alert-info">
                            Before enabling Backblaze, make sure you upload the whole "upload/" folder to your bucket. <br><br>
                            Before disabling Backblaze, make sure you download the whole "upload/" folder to your server. <br><br>
                        </div>
                        <div class="backblaze_storage_alert"></div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect" onclick="Wo_TestBackblaze()">Test & Verify Connection</button>
                        <a href="<?php echo PT_LoadAdminLinkSettings('upload-to-storage?storage=backblaze'); ?>" class="btn btn-success m-t-15 waves-effect">Upload Files To BackBlaze</a>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-6 col-md-6 pull-right">
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">FTP Settings</h6>
                    <small>You can upload files directly from your server to another FTP server and load them from there.</small><br>
                    <small>Impotant: This may slow down your site's upload/delete speed, make sure to use fast FTP server.</small><br><br>
                    <div class="clearfix"></div>
                    <br>
                    <div class="ftp-settings-alert"></div>
                    <form class="ftp-settings" method="POST">
                        <div class="float-left">
                            <label for="ftp_upload" class="main-label">FTP Storage</label>
                            <br><small class="admin-info">Enable FTP Storage to store your files in your own FTP server.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="ftp_upload" value="off" />
                            <input type="checkbox" name="ftp_upload" id="chck-ftp_upload" value="on" <?php echo ($pt->config->ftp_upload == 'on') ? 'checked': '';?>>
                            <label for="chck-ftp_upload" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Hostname</label>
                                <input type="text" name="ftp_host" class="form-control" value="<?php echo ($pt->config->ftp_host);?>">
                                <small class="admin-info">Your FTP hostname, could be IP or domain name.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Username</label>
                                <input type="text" name="ftp_username" class="form-control" value="<?php echo ($pt->config->ftp_username);?>">
                                <small class="admin-info">Your FTP account's username.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Password</label>
                                <input type="text" name="ftp_password" class="form-control" value="<?php echo ($pt->config->ftp_password);?>">
                                <small class="admin-info">Your FTP account's password.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Port</label>
                                <input type="text" name="ftp_port" class="form-control" value="<?php echo ($pt->config->ftp_port);?>">
                                <small class="admin-info">Your FTP server's port.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Path</label>
                                <input type="text" name="ftp_path" class="form-control" value="<?php echo ($pt->config->ftp_path);?>">
                                <small class="admin-info">The path to /upload files.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">FTP Endpoint</label>
                                <input type="text" name="ftp_endpoint" class="form-control" value="<?php echo ($pt->config->ftp_endpoint);?>">
                                <small class="admin-info">IP or domain where the FTP server is pointed to, example: playtubeftpstorage.com</small>
                            </div>
                        </div>
                        <hr>
                        <div class="clearfix"></div>
                        <div class="alert alert-info">
                            Before enabling FTP, make sure you upload the whole "upload/" folder to your FTP server.<br><br>
                        Before disabling FTP, make sure you download the whole "upload/" folder to your server.<br><br>
                        If your site is still brand new, you can escape the upload step, but make sure to click on "Test Connection".<br>
                        </div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect" onclick="Wo_TestFTP()">Test FTP Connection</button>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Wasabi Configuration</h6>
                    <form class="wasabi_storage-settings" method="POST">
                        <div class="alert alert-warning">Please note that if your account is in trial mode, the files will be uploaded but not loaded, you need to have billing actiivated.</div>
                         <div class="float-left">
                            <label for="wasabi_storage" class="main-label">Wasabi Storage</label>
                            <br><small class="admin-info">Enable Wasabi Storage to store your files in Wasabi Spaces.</small>

                        </div>

                        <div class="form-group float-right switcher">
                            <input type="hidden" name="wasabi_storage" value="off" />
                            <input type="checkbox" name="wasabi_storage" id="chck-wasabi_storage" value="on" <?php echo ($pt->config->wasabi_storage == 'on') ? 'checked': '';?>>
                            <label for="chck-wasabi_storage" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Wasabi Bucket Name</label>
                                <input type="text" id="wasabi_bucket_name" name="wasabi_bucket_name" class="form-control" value="<?php echo $pt->config->wasabi_bucket_name?>">
                                <small class="admin-info">Your Wasabi Bucket Name.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Wasabi Access Key</label>
                                <input type="text" id="wasabi_access_key" name="wasabi_access_key" class="form-control" value="<?php echo $pt->config->wasabi_access_key?>">
                                <small class="admin-info">Your Wasabi Access Key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Wasabi Secret Key</label>
                                <input type="text" id="wasabi_secret_key" name="wasabi_secret_key" class="form-control" value="<?php echo $pt->config->wasabi_secret_key?>">
                                <small class="admin-info">Your Wasabi Secret Key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Wasabi Custom Endpoint (Optional)</label>
                                <input type="text" name="wasabi_endpoint" class="form-control" value="<?php echo ($pt->config->wasabi_endpoint);?>">
                                <small class="admin-info">Your Wasabi custom domain name, e.g: https://customCDNdomain.com</small>
                            </div>
                        </div>
                        <hr>
                        <label for="wasabi_bucket_region">Wasabi bucket region</label>
                        <select class="form-control show-tick" id="wasabi_bucket_region" name="wasabi_bucket_region">
                            <option value="us-east-1" <?php echo ($pt->config->wasabi_bucket_region == 'us-east-1')   ? ' selected' : '';?> >us-east-1</option>
                            <option value="us-east-2" <?php echo ($pt->config->wasabi_bucket_region == 'us-east-2')   ? ' selected' : '';?> >us-east-2</option>
                            <option value="us-central-1" <?php echo ($pt->config->wasabi_bucket_region == 'us-central-1')   ? ' selected' : '';?> >us-central-1</option>
                            <option value="us-west-1" <?php echo ($pt->config->wasabi_bucket_region == 'us-west-1')   ? ' selected' : '';?> >us-west-1</option>
                            <option value="ca-central-1" <?php echo ($pt->config->wasabi_bucket_region == 'ca-central-1')   ? ' selected' : '';?> >ca-central-1</option>
                            <option value="eu-central-1" <?php echo ($pt->config->wasabi_bucket_region == 'eu-central-1')   ? ' selected' : '';?> >eu-central-1</option>
                            <option value="eu-central-2" <?php echo ($pt->config->wasabi_bucket_region == 'eu-central-2')   ? ' selected' : '';?> >eu-central-2</option>
                            <option value="eu-west-1" <?php echo ($pt->config->wasabi_bucket_region == 'eu-west-1')   ? ' selected' : '';?> >eu-west-1</option>
                            <option value="eu-west-2" <?php echo ($pt->config->wasabi_bucket_region == 'eu-west-2')   ? ' selected' : '';?> >eu-west-2</option>
                            <option value="ap-northeast-1" <?php echo ($pt->config->wasabi_bucket_region == 'ap-northeast-1')   ? ' selected' : '';?> >ap-northeast-1</option>
                            <option value="ap-northeast-2" <?php echo ($pt->config->wasabi_bucket_region == 'ap-northeast-2')   ? ' selected' : '';?> >ap-northeast-2</option>
                            <option value="ap-southeast-1" <?php echo ($pt->config->wasabi_bucket_region == 'ap-southeast-1')   ? ' selected' : '';?> >ap-southeast-1</option>
                            <option value="ap-southeast-2" <?php echo ($pt->config->wasabi_bucket_region == 'ap-southeast-2')   ? ' selected' : '';?> >ap-southeast-2</option>
                        </select>
                        <div class="clearfix"></div>
                        <br>
                        <div class="alert alert-info">
                            Before enabling Wasabi, make sure you upload the whole "upload/" folder to your bucket. <br><br>
                            Before disabling Wasabi, make sure you download the whole "upload/" folder to your server. <br><br>
                        </div>
                        <div class="wasabi_storage_alert"></div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect" onclick="Wo_TestWasabi()">Test & Verify Connection</button>
                        <a href="<?php echo PT_LoadAdminLinkSettings('upload-to-storage?storage=wasabi'); ?>" class="btn btn-success m-t-15 waves-effect">Upload Files To Wasabi</a>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Google Cloud Settings</h6>

                    <form class="drive-settings" method="POST">
                         <div class="float-left">
                            <label for="cloud_upload" class="main-label">Google Cloud Storage</label>
                            <br><small class="admin-info">Enable Google Cloud Storage to store your files in Google Cloud.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="cloud_upload" value="off" />
                            <input type="checkbox" name="cloud_upload" id="chck-cloud_upload" value="on" <?php echo ($pt->config->cloud_upload == 'on') ? 'checked': '';?>>
                            <label for="chck-cloud_upload" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Google Cloud Bucket Name</label>
                                <input type="text" id="cloud_bucket_name" name="cloud_bucket_name" class="form-control" value="<?php echo $pt->config->cloud_bucket_name ?>">
                                <small class="admin-info">Your Google Cloud Bucket Name.</small>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line focused">
                                <label class="form-label">Google Cloud File</label>
                                <input type="file" id="cloud_file" name="cloud_file" class="form-control">
                                <small class="admin-info">Should be a JSON file.</small>
                            </div>
                        </div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Google Cloud File Path</label>
                                <input type="text" id="cloud_file_path" class="form-control" value="<?php echo $pt->config->cloud_file_path ?>" readonly>
                                <small class="admin-info">Path to your Google Cloud File in your server.</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Google Cloud Custom Endpoint (Optional)</label>
                                <input type="text" name="cloud_endpoint" class="form-control" value="<?php echo ($pt->config->cloud_endpoint);?>">
                                <small class="admin-info">Your Google Cloud custom domain name, e.g: https://customCDNdomain.com</small>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="alert alert-info">
                            Make sure you upload the whole "upload/" folder to your bucket.<br><br>
                            Make sure to keep (Google Cloud File) on your server. in Google Cloud File Path (<?php echo $pt->config->cloud_file_path ?>)<br>
                        </div>
                        <div class="drive-settings-alert"></div>
                        <button type="button" class="btn btn-success m-t-15 waves-effect" onclick="TestCloud()">Test Cloud Connection</button>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h6 class="card-title">Yandex Configuration</h6>
                    <div class="yandex-settings-alert"></div>
                    <form class="yandex-settings" method="POST">
                        <div class="float-left">
                            <label for="yandex_storage" class="main-label">Yandex Storage</label>
                            <br><small class="admin-info">Enable Yandex Storage to store your files in Yandex.</small>
                        </div>
                        <div class="form-group float-right switcher">
                            <input type="hidden" name="yandex_storage" value="off" />
                            <input type="checkbox" name="yandex_storage" id="chck-yandex_storage" value="on" <?php echo ($pt->config->yandex_storage == 'on') ? 'checked': '';?>>
                            <label for="chck-yandex_storage" class="check-trail"><span class="check-handler"></span></label>
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Yandex Bucket Name</label>
                                <input type="text" name="yandex_name" class="form-control" value="<?php echo ($pt->config->yandex_name);?>">
                                <small class="admin-info">Your Yandex Bucket name.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Yandex Key</label>
                                <input type="text" name="yandex_key" class="form-control" value="<?php echo ($pt->config->yandex_key);?>">
                                <small class="admin-info">Your Yandex credentials key.</small>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group form-float">
                            <div class="form-line">
                                <label class="form-label">Yandex Secret</label>
                                <input type="text" name="yandex_secret" class="form-control" value="<?php echo ($pt->config->yandex_secret);?>">
                                <small class="admin-info">Your Yandex credentials secret key.</small>
                            </div>
                        </div>
                        <hr>
                        <label for="yandex_region">Yandex bucket region</label>
                        <br><small class="admin-info">Your Yandex's S3 Region</small>
                        <div class="form-group">
                            <select class="form-control show-tick" id="yandex_region" name="yandex_region">
                                <option value="ru-central1-a" <?php echo ($pt->config->yandex_region == 'ru-central1-a')   ? ' selected' : '';?> >ru-central1-a</option>
                                <option value="ru-central1-b" <?php echo ($pt->config->yandex_region == 'ru-central1-b')   ? ' selected' : '';?> >ru-central1-b</option>
                                <option value="ru-central1-c" <?php echo ($pt->config->yandex_region == 'ru-central1-c')   ? ' selected' : '';?> >ru-central1-c</option>
                            </select>
                        </div>
                        <hr>
                        <div class="clearfix"></div>
                        <br>
                        <div class="alert alert-info">
                            Before enabling Yandex, make sure you upload the whole "upload/" folder to your bucket. <br><br>
                            Before disabling Yandex, make sure you download the whole "upload/" folder to your server. <br><br>
                            If your site is still brand new, you can escape the upload step, but make sure to click on "Test Connection". <br>
                        </div>
                        <button type="button" class="btn btn-warning m-t-15 waves-effect" onclick="TestYandex()">Test Connection</button>
                        <a href="<?php echo PT_LoadAdminLinkSettings('upload-to-storage?storage=digitalocean'); ?>" class="btn btn-success m-t-15 waves-effect">Upload Files To Yandex</a>
                    </form>
                </div>
            </div>
            
        </div>

    </div>
<script type="text/javascript">
function TestYandex() {
    $('form.yandex-settings').find('.btn-warning').text('Please wait..');
    $('.yandex-settings-alert').empty();
    $.get('{{LINK aj/ap/test_yandex}}', function (data) {
        if (data.status == 200) {
            $('.yandex-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection established!</div>');
            setTimeout(function () {
                $('.yandex-settings-alert').empty();
            }, 5000);
        } else {
            $('.yandex-settings-alert').html('<div class="alert alert-danger">'+data.message+'</div>');
        }
        $('form.yandex-settings').find('.btn-warning').text('Test Cloud Connection');
    });
}
function TestCloud() {
    $('form.drive-settings').find('.btn-success').text('Please wait..');
    $('.drive-settings-alert').empty();
    $.get('{{LINK aj/ap/test_cloud}}', function (data) {
        if (data.status == 200) {
            $('.drive-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection established!</div>');
            setTimeout(function () {
                $('.drive-settings-alert').empty();
            }, 5000);
        } else {
            $('.drive-settings-alert').html('<div class="alert alert-danger">'+data.message+'</div>');
            // setTimeout(function () {
            //     $('.drive-settings-alert').empty();
            // }, 2000);
        }
        $('form.drive-settings').find('.btn-success').text('Test Cloud Connection');
    });
}

function Wo_TestBackblaze() {
    $('form.backblaze_storage-settings').find('.btn-warning').text('Please wait..');
    $.get('{{LINK aj/ap/test_backblaze}}', function (data) {
        if (data.status == 200) {
            $('.backblaze_storage_alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection established!</div>');
            setTimeout(function () {
                $('.backblaze_storage_alert').empty();
            }, 2000);
        } else if (data.status == 300) {
            $('.backblaze_storage_alert').html('<div class="alert alert-danger">Bucket doesn\'t exists</div>');
            setTimeout(function () {
                $('.backblaze_storage_alert').empty();
            }, 5000);
        } else if (data.status == 500) {
            $('.backblaze_storage_alert').html('<div class="alert alert-danger">Your s3 account doesn\'t have any buckets, please create one.</div>');
            setTimeout(function () {
                $('.backblaze_storage_alert').empty();
            }, 5000);
        } else if (data.status == 400) {
            $('.backblaze_storage_alert').html('<div class="alert alert-danger">'+data.message+'</div>');
            setTimeout(function () {
                $('.backblaze_storage_alert').empty();
            }, 5000);
        } else  {
            $('.backblaze_storage_alert').html('<div class="alert alert-danger">Error while connecting to BackBlaze, please check your details</div>');
            setTimeout(function () {
                $('.backblaze_storage_alert').empty();
            }, 5000);
        }
        $('form.backblaze_storage-settings').find('.btn-warning').text('Test & Verify Connection');
    });
}
    

function Wo_TestWasabi() {
    $('form.wasabi_storage-settings').find('.btn-warning').text('Please wait..');
    $.get('{{LINK aj/ap/test_wasabi}}', function (data) {
        if (data.status == 200) {
            $('.wasabi_storage_alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection established!</div>');
            setTimeout(function () {
                $('.wasabi_storage_alert').empty();
            }, 2000);
        } else if (data.status == 300) {
            $('.wasabi_storage_alert').html('<div class="alert alert-danger">Bucket doesn\'t exists</div>');
            setTimeout(function () {
                $('.wasabi_storage_alert').empty();
            }, 5000);
        } else if (data.status == 500) {
            $('.wasabi_storage_alert').html('<div class="alert alert-danger">Your s3 account doesn\'t have any buckets, please create one.</div>');
            setTimeout(function () {
                $('.wasabi_storage_alert').empty();
            }, 5000);
        } else if (data.status == 400) {
            $('.wasabi_storage_alert').html('<div class="alert alert-danger">'+data.message+'</div>');
            setTimeout(function () {
                $('.wasabi_storage_alert').empty();
            }, 5000);
        } else  {
            $('.wasabi_storage_alert').html('<div class="alert alert-danger">Error while connecting to Wasabi, please check your details</div>');
            setTimeout(function () {
                $('.wasabi_storage_alert').empty();
            }, 5000);
        }
        $('form.wasabi_storage-settings').find('.btn-warning').text('Test & Verify Connection');
    });
}
$(function() {
    var debug_settings = $('form.debug-settings');
    debug_settings.ajaxForm({
        url: '{{LINK aj/ap/ffmpeg_debug}}',
        beforeSend: function() {
            debug_settings.find('.waves-effect').text("Please wait..");
        },
        success: function(data) {
            if (data.status == 200) {
                debug_settings.find('.waves-effect').text('Debug');
                $('#debug_ffmpeg').val(data.data);
                if (data.video_url) {
                    $('.debug-settings-alert').html('<div class="alert alert-success"><a href="'+data.video_url+'" target="_blank">You can check the converted video test_240p_converted.mp4</a></div>');
                }
            }
            else{
                debug_settings.find('.waves-effect').text('Debug');
                if (data.message) {
                    $('.debug-settings-alert').html('<div class="alert alert-danger">'+data.message+'</div>');
                }
            }
        }
    });
    $('input[type=file]').on('change', function(){
        var objData = new FormData();
        var thisElement = $(this);
        var file = $(this)[0].files[0];
        var hash_id = $('input[name=hash_id]').val();
        objData.append('cloud_file', file);
        objData.append('hash_id', hash_id);
        thisElement.addClass('warning');
        $('.drive-settings-alert').html(' ');
        if (file.type == 'application/json') {
            $.ajax({
              url: '{{LINK aj/ap/upload_cloud_file}}',
              type: 'post',
              data: objData,
              contentType: false,
              processData: false,
              success: function(response){
                thisElement.removeClass('warning');
                thisElement.addClass('success');
                var setTimeOutColor = setTimeout(function () {
                    thisElement.removeClass('success');
                    thisElement.removeClass('warning');
                    thisElement.removeClass('error');
                }, 2000);
              },
           });
        } else {
            thisElement.addClass('error');
            var setTimeOutColor = setTimeout(function () {
                thisElement.removeClass('error');
            }, 2000);
            $('.drive-settings-alert').html('<div class="alert alert-danger"><i class="fa fa-check"></i> File format should be .json</div>');
        }
    });
    $('.switcher input[type=checkbox]').click(function () {
        var configName = $(this).attr('name');
        var hash_id = $('input[name=hash_id]').val();
        var objData = {};
        if ($(this).is(":checked") === true) {
            objData[configName] = $(this).val();
        }
        else{
            if ($('input[name='+configName+']')[0]) {
                objData[configName] = $($('input[name='+configName+']')[0]).val();
            }
        }
        objData['hash_id'] = hash_id;
        $.post('{{LINK aj/ap/save-settings}}', objData);
    });

    var setTimeOutColor = setTimeout(function (){});
    $('select').on('change', function() {
         clearTimeout(setTimeOutColor);
        var thisElement = $(this);
        var configName = thisElement.attr('name');
        var hash_id = $('input[name=hash_id]').val();
        var objData = {};
        objData[configName] = this.value;
        objData['hash_id'] = hash_id;
        thisElement.addClass('warning');
        $.post("{{LINK aj/ap/save-settings}}", objData, function (data) {
            if (data.status == 200) {
                thisElement.removeClass('warning');
                thisElement.addClass('success');
            } else {
                thisElement.addClass('error');
            }
            var setTimeOutColor = setTimeout(function () {
                thisElement.removeClass('success');
                thisElement.removeClass('warning');
                thisElement.removeClass('error');
            }, 2000);
        });
    });
    $('input[type=text], input[type=number] , textarea').on('input', delay(function() {
            clearTimeout(setTimeOutColor);
            var thisElement = $(this);
            var configName = thisElement.attr('name');
            var hash_id = $('input[name=hash_id]').val();
            var objData = {};
            objData[configName] = this.value;
            objData['hash_id'] = hash_id;
            thisElement.addClass('warning');
            $.post("{{LINK aj/ap/save-settings}}", objData, function (data) {
                if (data.status == 200) {
                    thisElement.removeClass('warning');
                    thisElement.addClass('success');
                } else {
                    thisElement.addClass('error');
                }
                var setTimeOutColor = setTimeout(function () {
                    thisElement.removeClass('success');
                    thisElement.removeClass('warning');
                    thisElement.removeClass('error');
                }, 2000);
                //thisElement.focus();
            });
    }, 500));
});


function Wo_TestSpaces() {
    $('form.spaces-settings').find('.btn-warning').text('Please wait..');
    $.get('{{LINK aj/ap/test_spaces}}', {f:'admin_setting', s: 'test_spaces'}, function (data) {
        if (data.status == 200) {
            $('.spaces-settings-alert').html("<div class='alert alert-success'>Connection established!</div>");
            setTimeout(function () {
                $('.spaces-settings-alert').empty();
            }, 2000);
        } else if (data.status == 300) {
            $('.spaces-settings-alert').html("<div class='alert alert-danger'>Bucket doesn\'t exists</div>");
            setTimeout(function () {
                $('.spaces-settings-alert').empty();
            }, 2000);
        } else if (data.status == 500) {
            $('.spaces-settings-alert').html("<div class='alert alert-danger'>Your s3 account doesn\'t have any buckets, please create one.</div>");
            setTimeout(function () {
                $('.spaces-settings-alert').empty();
            }, 2000);
        } else if (data.status == 400) {
            $('.spaces-settings-alert').html("<div class='alert alert-danger'>"+data.message+"</div>");
            setTimeout(function () {
                $('.spaces-settings-alert').empty();
            }, 2000);
        } else  {
            $('.spaces-settings-alert').html("<div class='alert alert-danger'>Error while connecting to amazone, please check your details</div>");
            setTimeout(function () {
                $('.spaces-settings-alert').empty();
            }, 2000);
        }
        $('form.spaces-settings').find('.btn-warning').text('Test Connection');
    });
}
function Wo_TestFTP() {
    $('form.ftp-settings').find('.btn-warning').text('Please wait..');
    $.get('{{LINK aj/ap/test_ftp}}', function (data) {
        if (data.status == 200) {
            $('.ftp-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection established!</div>');
            setTimeout(function () {
                $('.ftp-settings-alert').empty();
            }, 2000);
        } else if (data.status == 400) {
            $('.ftp-settings-alert').html('<div class="alert alert-danger">'+data.message+'</div>');
            setTimeout(function () {
                $('.ftp-settings-alert').empty();
            }, 2000);
        }
        $('form.ftp-settings').find('.btn-warning').text('Test FTP Connection');
    });
}

function pt_test_s3() {
    $('.test-con').text('Please wait..');
    $.get('{{LINK aj/ap/testS3}}',function (data) {
        if (data.status == 200) {
            $('.s3-settings-alert').html('<div class="alert alert-success"><i class="fa fa-check"></i> Connection successfully established!</div>');
            setTimeout(function () {
                $('.s3-settings-alert').empty();
            }, 2000);
        }

    else if (data.status == 300) {
        $('.s3-settings-alert').html("<div class='alert alert-danger'>Bucket doesn\'t exists!</div>");
        setTimeout(function () {
            $('.s3-settings-alert').empty();
        }, 2000);
    }

    else if (data.status == 500) {
        $('.s3-settings-alert').html("<div class='alert alert-danger'>Your s3 account doesn\'t have any buckets, please create one.</div>");
        setTimeout(function () {
            $('.s3-settings-alert').empty();
        }, 2000);

        }

    else if (data.status == 400) {
        $('.s3-settings-alert').html("<div class='alert alert-danger'>"+data.message+"</div>");
        setTimeout(function () {
            $('.s3-settings-alert').empty();
        }, 2000);
        }

    else  {
        $('.s3-settings-alert').html("<div class='alert alert-danger'>Error while connecting to amazone, please check your details</div>");
        setTimeout(function () {
            $('.s3-settings-alert').empty();
        }, 2000);
        }
        $('.test-con').text('Test Connection');
    });
}

</script>
