<form enctype="multipart/form-data" id="upload-form" class="dropzone">
    <div id="customValues"></div>
    <div class="bounceInLeft animated">
        <!-- Social buttons div -->
        <div class="social" id="uploadDivSocial">
            <?php
            if(!empty($social_facebook)) :
                ?>
                <a href="<?php echo $social_facebook; ?>" class="btn btn-social-icon btn-facebook btn-sm" target="_blank"><i class="fa fa-facebook"></i></a>
                <?php
            endif;
            if(!empty($social_twitter)) :
                ?>
                <a href="<?php echo $social_twitter; ?>" class="btn btn-social-icon btn-twitter btn-sm" target="_blank"><i class="fa fa-twitter"></i></a>
                <?php
            endif;
            if(!empty($social_tumblr)) :
                ?>
                <a href="<?php echo $social_tumblr; ?>" class="btn btn-social-icon btn-tumblr btn-sm" target="_blank"><i class="fa fa-tumblr"></i></a>
                <?php
            endif;
            if(!empty($social_google)) :
                ?>
                <a href="<?php echo $social_google; ?>" class="btn btn-social-icon btn-google-plus btn-sm" target="_blank"><i class="fa fa-google"></i></a>
                <?php
            endif;
            if(!empty($social_instagram)) :
                ?>
                <a href="<?php echo $social_instagram; ?>" class="btn btn-social-icon btn-instagram btn-sm" target="_blank"><i class="fa fa-instagram"></i></a>
                <?php
            endif;
            if(!empty($social_github)) :
                ?>
                <a href="<?php echo $social_github; ?>" class="btn btn-social-icon btn-github btn-sm" target="_blank"><i class="fa fa-github"></i></a>
                <?php
            endif;
            if(!empty($social_pinterest)) :
                ?>
                <a href="<?php echo $social_pinterest; ?>" class="btn btn-social-icon btn-google-plus btn-sm" target="_blank"><i class="fa fa-pinterest"></i></a>
                <?php
            endif;
            ?>
        </div>
        <!-- End social buttons div -->

        <div id="uploadSettings" class="uploadSettings" style="display: none;">
            <div style="float: left; margin-left: 20px; margin-top: 7px; width: 130px;">
                <h4><?php echo $site_name; ?></h4><hr style="margin-bottom: 0px;">
                <ul style="list-style-type: none; padding-left: 0;">
                    <li><a id="upload_settings_tab" class="settingsNav" style="font-weight: bold;" onclick="openInlinePage(this.id);"><?php echo $text['upload_settings']; ?></a></li>
                    <li><a id="language_settings_tab" class="settingsNav" onclick="openInlinePage(this.id);"><?php echo $text['change_language']; ?></a></li>
                    <li><a id="terms_tab" class="settingsNav" onclick="openInlinePage(this.id);"><?php echo $text['terms_service']; ?></a></li>
                    <li><a id="about_tab" class="settingsNav" onclick="openInlinePage(this.id);"><?php echo $text['about_us']; ?></a></li>
                </ul>
                <?php
                if(isset($plugin_sidebar_tabs) && !empty($plugin_sidebar_tabs)) {
                    echo '<ul style="list-style-type: none; padding-left: 0;">';
                    // Output the sidebar tabs from the plugins
                    echo $plugin_sidebar_tabs;
                    echo '</ul>';
                }
                ?>
            </div>
            <div class="settingsContent">
                <div style="float: right; padding-top: 5px; padding-right: 5px;">
                    <i class="fa fa-times-circle-o" style="color: #716C6C; font-size: 25px; cursor: pointer; cursor: hand;" onclick="closeSettings();"></i>
                </div>
                <div class="settingsBody">
                    <div id="upload_settings_tab_body" class="settingsBodyContent">
                        <p><b><?php echo $text['share_type']; ?>: <i class="fa fa-question-circle" data-toggle="tooltip" title="<?php echo $text['share_type_text']; ?>"></i></b></p>
                        <div class="btn-group" data-toggle="buttons">
                            <label class="btn btn-default btn-sm <?php if($default_sharetype == 'mail') { echo 'active'; } ?>">
                                <input type="radio" name="options" id="option1" onchange="shareEmail();" <?php if($default_sharetype == 'mail') { echo 'checked=""'; } ?> > <?php echo $text['email']; ?>									  </label>
                            <label class="btn btn-default btn-sm <?php if($default_sharetype == 'link') { echo 'active'; } ?>">
                                <input type="radio" name="options" id="option2" onchange="shareLink();" <?php if($default_sharetype == 'link') { echo 'checked=""'; } ?> > <?php echo $text['link']; ?>									  </label>
                            <input type="hidden" name="share" id="share" value="mail">
                        </div>
                        <p style="padding-top: 15px;"><b><?php echo $text['destruct_file']; ?>:</b> <i class="fa fa-question-circle" data-toggle="tooltip" title="<?php echo $text['destruct_text']; ?>"></i></p>
                        <div class="btn-group" data-toggle="buttons">
                            <?php
                            if($default_destruct == 'no') :
                                ?>
                                <label class="btn btn-default btn-sm active">
                                    <input type="radio" name="options" id="option3" onchange="destructFalse();" checked=""><?php echo $text['no']; ?></label>
                                <label class="btn btn-default btn-sm">
                                    <input type="radio" name="options" id="option4" onchange="destructTrue();"><?php echo $text['yes']; ?>									  </label>
                                <input type="hidden" name="destruct" id="destruct" value="no">
                                <?php
                            else:
                                ?>
                                <label class="btn btn-default btn-sm active">
                                    <input type="radio" name="options" id="option3" onchange="destructTrue();" checked=""><?php echo $text['yes']; ?></label>
                                <label class="btn btn-default btn-sm">
                                    <input type="radio" name="options" id="option4" onchange="destructFalse();"><?php echo $text['no']; ?>									  </label>
                                <input type="hidden" name="destruct" id="destruct" value="yes">
                                <?php
                            endif;
                            ?>
                        </div>
                        <?php
                        if($pm_pass_enabled == 'false' || $password_enabled == 'false') :
                            ?>
                            <p style="padding-top: 15px;"><b><?php echo $text['protect_with_pass']; ?>: <i class="fa fa-question-circle" data-toggle="tooltip" title="<?php echo $text['password_text']; ?>"></i></b></p>
                            <div class="input-group">
                                <input type="text" class="form-control input-sm" name="password" id="password" placeholder="<?php echo $text['not_available_pass']; ?>" readonly>
                            </div>
                            <i style="font-size: 12px;">(<?php echo $text['leave_empty_password']; ?>)</i>
                            <?php
                        else:
                            ?>
                            <p style="padding-top: 15px;"><b><?php echo $text['protect_with_pass']; ?>: <i class="fa fa-question-circle" data-toggle="tooltip" title="<?php echo $text['password_text']; ?>"></i></b></p>
                            <div class="input-group">
                                <input type="password" class="form-control input-sm" name="password" id="password" placeholder="<?php echo $text['password']; ?>">
                            </div>
                            <i style="font-size: 12px;">(<?php echo $text['leave_empty_password']; ?>)</i>
                            <?php
                        endif;
                        if($ad_1_enabled == 'true') :
                            ?>
                            <div style="margin-right: auto; margin-left: auto; margin-top: 70px; width: 468px; height: 60px;">
                                <?php echo $ad_1_code; ?>
                            </div>
                            <?php
                        endif;
                        ?>
                    </div>
                    <div id="language_settings_tab_body" class="settingsBodyContent" style="display: none;">
                        <div style="padding-top: 120px; width: 90%; margin-left: auto; margin-right: auto;">
                            <p><?php echo $text['select_pref_lang']; ?>:</p>
                            <select class="form-control" onchange="changeLanguage()" id="languagePicker">
                                <option disabled selected> -- <?php echo $text['select_language']; ?> -- </option>
                                <?php
                                $get_language = $mysqli->query("SELECT * FROM $table_language");
                                while($lang = $get_language->fetch_assoc())
                                {
                                    echo '<option value="' . $lang['name'] . '">' . $lang['name'] . '</option>';
                                }
                                ?>
                            </select>
                        </div>
                        <?php
                        if($ad_1_enabled == 'true') :
                            ?>
                            <div style="margin-right: auto; margin-left: auto; margin-top: 120px; width: 468px; height: 60px;">
                                <?php echo $ad_1_code; ?>
                            </div>
                            <?php
                        endif;
                        ?>
                    </div>
                    <div id="terms_tab_body" class="settingsBodyContent" style="display: none; overflow: auto; height: 360px; width: 90%;">
                        <?php
                        echo $terms_text;
                        ?>
                    </div>
                    <div id="about_tab_body" class="settingsBodyContent" style="display: none; overflow: auto; height: 360px; width: 90%;">
                        <?php
                        echo $about_text;
                        ?>
                    </div>
                    <?php
                    // Get the premium pages.
                    if(is_array($plugin_pages)) {
                        foreach ($plugin_pages as $page) {
                            foreach ($page as $p) {
                                if ($p['type'] == 'tab_page') {
                                    echo '<div id="customTab_' . $p['id'] . '_body" class="settingsBodyContent" style="display: none; overflow: auto; height: 360px; width: 90%;">';
                                    require_once $p['path'];
                                    echo '</div>';
                                }
                            }
                        }
                    }
                    ?>
                </div>
            </div>
            <div class="headerDivider"></div>
        </div>

        <!-- Normal view div -->
        <div class="main" id="uploadDiv">
            <img src="<?php echo $logo_path; ?>" class="logo" alt="Logo">
            <hr style="margin-top: 10px; margin-bottom: 15px;">
            <div class="FormContent">
                <div class="upload_section" id="upload_section">
                    <div id="upload-form-list">
                        <table id="uploaded-file">
                            <tr>
                                <td><span data-dz-remove class="file-remove-btn"><i class="fa fa-times-circle"></i></span></td>
                                <td><span data-dz-name class="file-title"></span></td>
                            </tr>
                        </table>
                    </div>
                    <button id="files" class="btn btn-default btn-xs" onclick="return false;"><i class="fa fa-plus"></i> <?php echo $text['select_files']; ?> <span id="total_upload_size">(<?php if($max_size < 1024) { echo $text['max'] . ' ' . $max_size . ' MB'; } else { echo $text['max'] . ' ' . round($max_size / 1024, 2) . ' GB'; } ?>)</span></button>
                </div>
                <?php
                if(empty($default_email_to)) :
                    ?>
                    <div class="EmailToSection" id="EmailToSection">
                        <div class="form-group" id="receivers" class="receivers" style="display: none;">
                            <div id="receiverHiddenList"></div>
                            <div id="receiverList" class="receiverList" style="display: none; font-size: 12px;"></div>
                        </div>
                        <input type="email" class="form-control input-sm" id="emailTo" name="email_to[]" placeholder="<?php echo $text['enter_email']; ?>" required="required">
                        <div style="padding-top: 5px;"><a onclick="addReceiver()" class="btn btn-default btn-xs" style="width: 100%;" id="addReceiver"><?php echo $text['add_more']; ?></a></div>
                    </div>
                    <?php
                else:
                    ?>
                    <div class="EmailToSection" id="EmailToSection">
                        <input type="email" class="form-control input-sm" id="emailTo" name="email_to[]" value="<?php echo $default_email_to; ?>" required="required" readonly>
                    </div>
                    <?php
                endif;
                ?>
                <div class="EmailFromSection" id="EmailFromSection">
                    <div class="form-group">
                        <?php
                        if(isset($_SESSION['droppy_user'])) :
                            ?>
                            <input type="email" class="form-control input-sm" id="emailFrom" name="email_from" value="<?php echo $_SESSION['droppy_user']; ?>" required="required" readonly>
                            <?php
                        elseif(isset($_SESSION['droppy_premium'])):
                            ?>
                            <input type="email" class="form-control input-sm" id="emailFrom" name="email_from" value="<?php echo $_SESSION['droppy_premium_email']; ?>" required="required" readonly>
                            <?php
                        else:
                            ?>
                            <input type="email" class="form-control input-sm" id="emailFrom" name="email_from" placeholder="<?php echo $text['enter_own_email']; ?>" required="required">
                            <?php
                        endif;
                        ?>
                    </div>
                </div>
                <div class="MessageSection">
                    <div class="form-group">
                        <textarea class="form-control input-sm" style="resize: none; height: 75px;" name="message" id="message" placeholder="<?php echo $text['message_receiver']; ?>" maxlength="1000"></textarea>
                    </div>
                </div>
                <div class="buttonSection">
                    <div style="width: 72%; float: left;">
                        <button type="button" class="btn btn-info btn-block btn-sm" id="submit_upload"><?php echo $text['share_files']; ?></button>
                    </div>
                    <div style="float: left; padding-left: 24px;">
                        <button type="button" class="btn btn-success btn-sm" id="settingsButton" onclick="openSettings();"><i class="fa fa-cog"></i></button>
                    </div>
                </div>
            </div>
        </div>
    </div>

</form>
<div class="social" id="uploadingDivSocial" style="display: none;">
    <?php
    if(!empty($social_facebook)) :
        ?>
        <a href="<?php echo $social_facebook; ?>" class="btn btn-social-icon btn-facebook btn-sm" target="_blank"><i class="fa fa-facebook"></i></a>
        <?php
    endif;
    if(!empty($social_twitter)) :
        ?>
        <a href="<?php echo $social_twitter; ?>" class="btn btn-social-icon btn-twitter btn-sm" target="_blank"><i class="fa fa-twitter"></i></a>
        <?php
    endif;
    if(!empty($social_tumblr)) :
        ?>
        <a href="<?php echo $social_tumblr; ?>" class="btn btn-social-icon btn-tumblr btn-sm" target="_blank"><i class="fa fa-tumblr"></i></a>
        <?php
    endif;
    if(!empty($social_google)) :
        ?>
        <a href="<?php echo $social_google; ?>" class="btn btn-social-icon btn-google-plus btn-sm" target="_blank"><i class="fa fa-google"></i></a>
        <?php
    endif;
    if(!empty($social_instagram)) :
        ?>
        <a href="<?php echo $social_instagram; ?>" class="btn btn-social-icon btn-instagram btn-sm" target="_blank"><i class="fa fa-instagram"></i></a>
        <?php
    endif;
    if(!empty($social_github)) :
        ?>
        <a href="<?php echo $social_github; ?>" class="btn btn-social-icon btn-github btn-sm" target="_blank"><i class="fa fa-github"></i></a>
        <?php
    endif;
    if(!empty($social_pinterest)) :
        ?>
        <a href="<?php echo $social_pinterest; ?>" class="btn btn-social-icon btn-google-plus btn-sm" target="_blank"><i class="fa fa-pinterest"></i></a>
        <?php
    endif;
    ?>
</div>
<!-- Progress and succes div -->
<div class="main" id="uploadingDiv" style="display: none; text-align: center;">
    <div id="uploadProcess" class="progressround">
        <input type="text" value="" class="progressCircle" id="progresscircle">
        <div id="progressMb" style="padding-top: 10px; text-align: center; font-size: 13px;"></div>
        <a class="btn btn-default btn-xs" id="cancelUpload" style="width: 200px; margin-top: 10px;">Cancel</a>
    </div>
    <div id="uploadSuccess" class="progresssuccess" style="display: none; padding-top: 40px;">
        <img src="<?php echo $theme_path; ?>images/loader.gif" alt="Upload success" width="180" height="180">
        <h2 style="text-align: center;"><?php echo $text['success']; ?></h2>
        <div id="linkMessage" style="display: none; font-size: 14px;">
            <p><?php echo $text['success_link']; ?></p>
            <div id="downloadLink"></div>
        </div>
        <div id="emailMessage" style="display: none; font-size: 14px; margin-left: 15px;">
            <p><?php echo $text['success_email']; ?></p>
        </div>
        <div class="buttonSection" style="bottom: -55px;">
            <div id="copyButton"></div>
            <div id="okButton" style="display: none;">
                <a href="<?php echo $site_url; ?>" class="btn btn-success btn-block btn-sm"><?php echo $text['ok']; ?></a>
            </div>
        </div>
    </div>
</div>