<!-- 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>
<?php
$rows = $get_info->fetch_assoc();
if($check_id == 1 && $rows['status'] == 'ready') :
    if($get_email->num_rows > 0 && $get_downloads->num_rows == 0 && $rows['destruct'] == 'YES' || $check_receiver->num_rows == 0 && $rows['share'] == 'link' || $get_email->num_rows > 0 && $rows['share'] == 'mail' && $rows['destruct'] == 'NO' || $get_uploader->num_rows > 0 && $rows['share'] == 'mail') :
        if($rows['password'] != 'EMPTY') :
        ?>
        <!-- No password download screen -->
        <div class="main" id="downloadDiv">
            <img src="<?php echo $logo_path; ?>" class="logo" alt="Logo"><hr>
            <div style="width: 70%; margin-left: auto; margin-right: auto; text-align:center;" id="downloadForm">
                <div id="downloadLogo"><i class="fa fa-lock fa-5x" style="padding-top: 35px;"></i></div>
                <p id="statusDownload" style="padding-top: 30px;"><?php echo $text['fill_password']; ?>:</p>
                <form id="downloadPassword" action="src/action.php" method="post">
                    <div class="form-group">
                        <input type="hidden" name="action" id="action" value="download">
                        <input type="hidden" name="secret_code" id="secret_code" value="<?php echo $rows['secret_code']; ?>">
                        <input type="hidden" name="download_id" id="download_id" value="<?php echo $download_id; ?>">
                        <input type="hidden" name="private_id" id="private_id" value="<?php echo $_GET['p']; ?>">
                        <input type="password" class="form-control input-sm" id="password" name="password" placeholder="<?php echo $text['password']; ?>" autocomplete="off" required>
                    </div>
                    <?php
                    if($rows['destruct'] == 'YES') :
                        ?>
                        <input type="submit" class="btn btn-default btn-block btn-sm" id="submitpass" value="<?php echo $text['download']; ?> & <?php echo $text['destruct']; ?>">
                        <?php
                    else :
                        ?>
                        <input type="submit" class="btn btn-default btn-block btn-sm" id="submitpass" value="<?php echo $text['download']; ?>">
                        <?php
                    endif;
                    ?>
                </form>
            </div>
            <div id="downloadSuccess">
                <div style="text-align:center; padding-top: 25px;"><i class="fa fa-check-circle-o fa-5x"></i></div>
                <div style="padding-top: 15px;">
                    <p><?php echo $text['download_started']; ?></p>
                </div>
                <div class="buttonSection" style="width: 70%;">
                    <a class="btn btn-default btn-block btn-sm" href="<?php echo $site_url; ?>"><?php echo $text['ok']; ?></a>
                </div>
            </div>
        </div>
        <?php
        else :
        ?>
            <!-- Password download screen -->
        <div class="main" id="downloadDiv">
            <img src="<?php echo $logo_path; ?>" class="logo" alt="Logo"><hr>
            <div style="width: 70%; margin-left: auto; margin-right: auto; font-size: 13px;" id="downloadForm">
                <form id="downloadItems" action="src/action.php" method="post">
                    <input type="hidden" name="action" id="action" value="download">
                    <input type="hidden" name="secret_code" id="secret_code" value="<?php echo $rows['secret_code']; ?>">
                    <input type="hidden" name="download_id" id="download_id" value="<?php echo $download_id; ?>">
                    <input type="hidden" name="private_id" id="private_id" value="<?php echo $_GET['p']; ?>">
                    <div style="text-align:center;"><i class="fa fa-cloud-download fa-3x"></i></div>
                    <div style="padding-top: 5px;">
                        <table>
                            <tr>
                                <td><b><?php echo $text['total_size']; ?>:</b></td>
                                <td class="td_2"><?php echo (($rows['size'] < 1048576)? round($rows['size'] / 1024, 2) . ' KB' : round($rows['size'] / 1048576, 2) . ' MB'); ?></td>
                            </tr>
                            <tr>
                                <td><b><?php echo $text['total_files']; ?>:</b></td>
                                <td class="td_2"><?php echo $rows['count']; ?></td>
                            </tr>
                            <tr>
                                <td><b><?php echo $text['destructed_on']; ?>:</b></td>
                                <td class="td_2"><?php echo date("Y-m-d", $rows['time_expire']); ?></td>
                            </tr>
                            <tr>
                                <td><b><?php echo $text['download_id']; ?>:</b></td>
                                <td class="td_2"><?php echo $download_id; ?></td>
                            </tr>
                        </table>
                        <b><?php echo $text['files']; ?>:</b>
                        <div style="height: 50px; overflow-x: hidden;">
                            <ul>
                                <?php
                                $get_files = $mysqli->query("SELECT * FROM $table_files WHERE upload_id='$download_id'");
                                while($row = $get_files->fetch_assoc()) {
                                echo '<li>' . $row['file'] . '</li>';
                                }
                                ?>
                            </ul>
                        </div>
                        <?php
                        if(!empty($rows['message'])) :
                        ?>
                        <b><?php echo $text['message']; ?>:</b>
                        <div style="height: 50px; overflow: auto;">
                            <?php echo $rows['message']; ?>
                        </div>
                        <?php else: ?>
                            <div style="height: 70px; display: invisible;"></div>
                        <?php
                        endif;
                        ?>
                    </div>
                    <div class="buttonSection" style="width: 80%;">
                        <div style="float: left; width: 70%;">
                            <?php
                            if($rows['destruct'] == 'YES') :
                            ?>
                            <input type="submit" class="btn btn-default btn-block btn-sm" id="submitdownload" value="<?php echo $text['download']; ?> & <?php echo $text['destruct']; ?>">
                            <?php
                            else :
                            ?>
                            <input type="submit" class="btn btn-default btn-block btn-sm" id="submitdownload" value="<?php echo $text['download']; ?>">
                            <?php
                            endif;
                            ?>
                        </div>
                        <div style="float: left; width: 20%; padding-left: 10px;">
                            <a class="btn btn-danger btn-block btn-sm" data-toggle="modal" data-target="#flagModal"><i class="fa fa-flag"></i></a>
                        </div>
                    </div>
                </form>
            </div>
            <div id="downloadSuccess" style="width: 70%; margin-left: auto; margin-right: auto; display: none;">
                <div style="text-align:center; padding-top: 20px;"><i class="fa fa-check-circle-o fa-3x"></i></div>
                <div style="padding-top: 10px;">
                    <p><?php echo $text['download_started']; ?></p>
                </div>
                <div class="buttonSection" style="width: 70%;">
                    <a class="btn btn-default btn-block btn-sm" href="<?php echo $site_url; ?>"><?php echo $text['ok']; ?></a>
                </div>
            </div>
        </div>
        <?php
        endif;
    else:
    ?>
    <div class="main" id="downloadDiv">
        <div id="downloadError" style="width: 70%; margin-left: auto; margin-right: auto;">
            <div style="text-align:center; padding-top: 110px;"><i class="fa fa-exclamation-triangle fa-4x"></i></div>
            <div style="padding-top: 15px;">
                <p><?php echo $text['not_allowed']; ?></p>
            </div>
            <div class="buttonSection" style="width: 70%;">
                <a class="btn btn-default btn-block btn-sm" href="<?php echo $site_url; ?>"><?php echo $text['ok']; ?></a>
            </div>
        </div>
    </div>
    <?php
    endif;
elseif($check_id == 1 && $rows['status'] == 'processing') :
?>
<div class="main" id="downloadDiv">
    <div id="downloadError">
        <div class="progressImage"><i class="fa fa-clock-o fa-5x"></i></div>
        <div class="progressMessage">
            <p><?php echo $text['upload_processing']; ?></p>
        </div>
        <div class="buttonSection" style="width: 70%;">
            <a class="btn btn-default btn-block btn-sm" href="<?php echo $site_url; ?>"><?php echo $text['ok']; ?></a>
        </div>
    </div>
</div>
<?php
elseif($check_id == 0 || $rows['status'] == 'destroyed'):
?>
<div class="main" id="downloadDiv">
    <div id="downloadError" style="width: 70%; margin-left: auto; margin-right: auto;">
        <div style="text-align:center; padding-top: 110px;"><i class="fa fa-question-circle fa-5x"></i></div>
        <div style="padding-top: 15px; font-size: 14px;">
            <p><?php echo $text['upload_not_found']; ?></p>
        </div>
        <div class="buttonSection" style="width: 70%;">
            <a class="btn btn-default btn-block btn-sm" href="<?php echo $site_url; ?>"><?php echo $text['ok']; ?></a>
        </div>
    </div>
</div>
<?php
endif;