<?php
$title = 'Testimonial';
require_once('header-links.php');

$current_pg = 9;

$user_details = $basicFunctn->selectWhereDlt($user->user_details, 'user_unique_id', $user_logged['unique_id'])[0];
$full_name = explode('++', $user_logged['full_name']);
$first_name = $full_name[0];
$last_name = $full_name[1];
$date_joined = explode(',', $user_logged['created_at']);

// print_r($user_details);
// die();



?>

<body>
    <!-- BEGIN LOADER -->
    <div id="load_screen">
        <div class="loader">
            <div class="loader-content">
                <div class="spinner-grow align-self-center"></div>
            </div>
        </div>
    </div>
    <!--  END LOADER -->
    <!-- ajax loader -->
    <div style="display: none;" id="the_load_screen">
        <div class="loader">
            <div class="loader-content">
                <div class="spinner-grow align-self-center"></div>
            </div>
        </div>
    </div>
    <!-- ajax loader -->

    <!--  BEGIN NAVBAR  -->
    <?php require_once('header.php'); ?>
    <!--  END NAVBAR  -->

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container" id="container">

        <div class="overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN SIDEBAR  -->
        <?php require_once('sidebar.php'); ?>
        <!--  END SIDEBAR  -->

        <!--  BEGIN CONTENT AREA  -->
        <div id="content" class="main-content">
            <div class="layout-px-spacing">

                <div class="row layout-spacing">
                    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 layout-top-spacing">
                        <div class="widget-content widget-content-area">
                            <!-- <form id="contact" class="section contact edit_user_form"> -->
                            <div class="info">
                                <div class="row">
                                    <div class="col-md-11 mx-auto">
                                        <div class="row">
                                            <div class="col-md-12 mb-3">
                                                <h5 class="">Please, upload a 1 min video about your experience on our platform. <br> If confirmed, this will be displayed on our testimonial page.</h5>
                                            </div>
                                            <!-- <div class="col-md-12 mb-5">
                                                <select class="form-control" id="kyc_label">
                                                    <option value="">--Which are you uploading--</option>
                                                    <option value="id_card">ID Card</option>
                                                    <option value="selfie">Two Selfies</option>
                                                </select>
                                            </div> -->
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12 text-right mb-5">
                                                <form style="background: #060818;" action="" method="post" class="dropzone" id="review_docs" enctype="multipart/form-data">
                                                </form>
                                                <!-- <button id="add-work-platforms" class="btn btn-primary edit_user_btn">Save Changes</button> -->
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- </form> -->
                        </div>
                    </div>

                </div>
            </div>
            <?php require_once('footer.php'); ?>
        </div>
        <!--  END CONTENT AREA  -->
    </div>
    <?php require_once('footer-links.php'); ?>
    <script>
        $('.edit_user_btn').click(async function(e) {
            e.preventDefault();
            let edit_user_form = $('.edit_user_form').serializeArray();
            let form_data = set_form_data(edit_user_form);
            // console.log(edit_user_form);return;
            let returned = await ajaxRequest('ajax.php', form_data);
            // console.log(returned);return;
            throwSweetalert(returned, 'profile', 1);
        });
        $("#review_docs").dropzone({
            paramName: "testimonial_file",
            maxFiles: 1,
            url: "ajax.php",
            init: function() {
                this.on("sending", function(file, xhr, formData) {
                    // console.log($('#review_docs')[0].files[0]);return;
                });
            },
            success: (file, response) => {
                // console.log(response);
                // return;
                var returned = JSON.parse(response);
                throwSweetalert(returned, 'testimonial', 1);
            }
        });
    </script>