<?php
require_once("db/functions.php");
require_once("db/db-const.php");

$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$mysqli->set_charset("utf8");
?>


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php include 'includes/head.php'; ?>
<body>
<?php include 'includes/header.php';?>
<!-- LOGO HEADER END-->
<?php include 'includes/navbar.php';?>
<!-- MENU SECTION END-->

<div class="tab-content">
    <div class="container">
        <div class="row" style="margin-top:15px">
            <div class="col-md-3"></div>
            <div class="col-md-6">
                <div class="well well-sm">
                    <form class="form-horizontal" enctype="multipart/form-data" action="db/presentationUpload.php" method="post" >
                        <input type="hidden" name="MAX_FILE_SIZE" value="5120000" />
                        <fieldset>
                            <legend class="text-center header">Transférer une présentation pdf</legend>
                            <!--Titre-->
                            <div class="form-group">
                                <div class="col-md-10 col-md-offset-1">
                                    <input id="titre" name="titre" type="text" placeholder="Titre"
                                           required minlength="3" maxlength="30" class="form-control">
                                </div>
                            </div>
                            <!--Description-->
                            <div class="form-group">
                                <div class="col-md-10 col-md-offset-1">
                                    <textarea class="form-control" id="description" name="description"
                                              placeholder="Entrez une description de la présentation" rows="8"
                                              required minlength="3" maxlength="200"></textarea>
                                </div>
                            </div>

                            <!--UPLOADER-->
                            <div class="form-group">
                                <div class="col-md-10 col-md-offset-1">
                                    <div class="fileinput fileinput-new" data-provides="fileinput">
                                         <div>
                                            <span class="btn btn-default btn-file">
                                                <span class="fileinput-new">Cliquez ici pour selectionner une presentation</span>
                                                <span class="fileinput-exists">Changer</span>
                                                <input type="file" name="mypresentation" id="mypresentation"></span>
                                            <a href="#" class="btn btn-default fileinput-exists" data-dismiss="fileinput">Supprimer</a>
                                        </div>
                                        <div class="fileinput-preview thumbnail" data-trigger="fileinput"></div>

                                    </div>
                                </div>
                            </div>
                            <!-- /UPLOADER-->



                            <!--Radio to choose category-->

                            <!--Button-->
                            <div class="form-group ">
                                <div class="col-md-12 text-center">
                                    <button type="submit" class="btn btn-primary btn-lg">Envoyer</button>
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
            <div class="col-md-3"></div>
        </div>
    </div>

    <script src="js/jquery.min.js"></script>

</div>

<?php include 'includes/footer-scripts.php';?>
<script>
    $(document).ready(function() {
        $("input:radio[name=radioPhototheque]").change(function() {
            var value = $(this).val();

            if (value == 'Pathologie') {
                $(".typePathologieSelect").css({"display":"block","visibility":"visible"});
                $(".typeOrganeSelect").css({"display":"none","visibility":"hidden"});

            }
            if (value == 'Organe') {
                $(".typePathologieSelect").css({"display":"none","visibility":"hidden"});
                $(".typeOrganeSelect").css({"display":"block","visibility":"visible"});
            }
        });
    });
</script>
</body>
</html>


