<?php
require('application/language/english/translations_lang.php');
require('config.php'); 
if($_POST['test'] == ''){
header("location:".Config::BASE_URL.'/index.php/backend'); 
exit();
}else{
     $str = explode("src", Config::BASE_URL);

$bro = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/waitlistcurrent/index.php';
$bro1 = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/waitlistprevious/index.php';
$bro4 = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/categoryreport/index.php';
$bro2 = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/millietest/index.php';
$bro3 = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/appointment_reminder/index.php';
$bro5 = $str[0].'koolreports/koolreport_pro-5.0.0/examples/reports/inputs/eventsearch/index.php';

?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#35A768">

    <title></title>

    <link rel="stylesheet" type="text/css" href="assets/ext/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="assets/ext/jquery-ui/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="assets/ext/jquery-qtip/jquery.qtip.min.css">
    <link rel="stylesheet" type="text/css" href="assets/ext/cookieconsent/cookieconsent.min.css">
    <link rel="stylesheet" type="text/css" href="assets/css/frontend.css">
    <link rel="stylesheet" type="text/css" href="assets/css/general.css">


    <link rel="icon" type="image/x-icon" href="assets/img/favicon.ico">
    <link rel="icon" sizes="192x192" href="assets/img/logo.png">
    <style> 
    
    #captchamillieerror{
    display: none;
}


    #providermillie{
    display: none;
}

    </style>
</head>

<body>
    <div id="main" class="container">
        <div class="wrapper row">
            <div id="book-appointment-wizard" class="col-xs-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
                <form method="POST" id="reportdirectoryform" name="reportdirectoryform">

                <!-- FRAME TOP BAR -->

                <div id="header">
                    <span id="company-name">Report Directory<br><img class="default_logo" src="amjaylogo1.png" style="!important width:100px; height:100px;"></span>

                
                    <div class="company-name"></div>
                </div>


                <!-- SELECT SERVICE AND PROVIDER -->

                <div id="wizard-frame-1" class="wizard-frame">
                    <div class="frame-container">
                        <h3 class="frame-title">Select Report</h3>

                        <div class="frame-content">
                            <div class="form-group">
                                <label for="select-pharmacy">
                                    <strong>Select Report</strong>
                                </label>
<script> 
function myfunction(){
    
    if(document.getElementById('select-pharmacy').value == "") {
    document.getElementById("command-buttons").style.display = "none";
    }else{
            document.getElementById("command-buttons").style.display = "block";

    }
    
      if(document.getElementById('select-pharmacy').value == "Waitlist 1"){
    document.getElementById("reportdirectoryform").action = "<?= $bro ?>";

}

    if(document.getElementById('select-pharmacy').value == "Waitlist 2"){
    document.getElementById("reportdirectoryform").action = "<?= $bro1 ?>";

    }
    
     if(document.getElementById('select-pharmacy').value == "Reminder Report"){
    document.getElementById("reportdirectoryform").action = "<?= $bro3 ?>";

    }
    
     if(document.getElementById('select-pharmacy').value == "Appt Report"){
    document.getElementById("reportdirectoryform").action = "<?= $bro2?>";

    }
    
     if(document.getElementById('select-pharmacy').value == "Category"){
    document.getElementById("reportdirectoryform").action = "<?= $bro4?>";

    }
    
      if(document.getElementById('select-pharmacy').value == "Event"){
    document.getElementById("reportdirectoryform").action = "<?= $bro5?>";

    }
    
    }
</script>
                                <select id="select-pharmacy" name="select-pharmacy" class="col-xs-12 col-sm-4 form-control" onchange="myfunction()">
                                        <option value="" name="">-----</option>
                                        <option value="Appt Report" name="apptreport">Appointment Report  </option>
                                        <?php
                                        if($_POST['test'] == 'admin'){
                                        ?>
                                        <option value="Category" name="category">Service Category Report </option>
                                       <option value="Event" name="event">Event Search Report </option>

                                        <?php
                                        }
                                        ?>
                                        <option value="Waitlist 1" name="waitlistreport1">Current Waitlist Report </option>
                                        <option value="Waitlist 2" name="waitlistreport2">Previous Waitlist Report  </option>


                                </select>
                                
                                <input type="hidden" name="test" id="test" value="<?php echo $_POST['test']; ?>"> 

                                <h6>Appointment Reports allow you to see appointments in a table format for a specified date range</h6>
 <h6>Current Waitlist report is people who are currently on the waitlist </h6>
                                <h6>Previous Waitlist report are people who were on the waitlist but have been removed as they have been sent an email</h6>
                            </div>



                        </div>
                    </div>
                    
                    <div class="command-buttons" style="padding-top:100px; display: none;" id="command-buttons">
                        <input type="submit" id="button-next-1" class="btn button-next btn-primary" name="Next">
                    </div>                    

                 
            </div>
            </form>
        </div>
    </div>



    <script src="assets/js/general_functions.js"></script>
    <script src="assets/ext/jquery/jquery.min.js"></script>
    <script src="assets/ext/jquery-ui/jquery-ui.min.js"></script>
    <script src="assets/ext/jquery-qtip/jquery.qtip.min.js"></script>
    <script src="assets/ext/cookieconsent/cookieconsent.min.js"></script>
    <script src="assets/ext/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/ext/datejs/date.js"></script>
    <script src="https://www.google.com/recaptcha/api.js" async></script>

    <script src="assets/js/frontend_book_api.js"></script>
    <script src="assets/js/frontend_book.js"></script>
    

</body>
</html>
<?php

}
?>