<!DOCTYPE html>
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);

$env = "";
if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'boasearch' ) {
    $env = "dev";
}

require_once '../lib/Licensees.php';
$ldb = new Licensees($env);
$effectiveDate = $ldb->getEffectiveDate();
$statusList = $ldb->getStatusList();
?>
<head>
    <?php
    // todo: fix these CDN links and make them local
    ?>

    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet" href="css/picnic.min.css">

    <link rel="stylesheet" href="css/simplePagination.css">
    <link rel="stylesheet" href="css/styles.css">
    <script src="js/jquery-1.11.1.min.js"></script>
    <!--    <script src="js/jquery-ui.min.js"></script>-->
    <script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
    <script src="js/jquery.simplePagination.js"></script>
    <script src="js/search.js"></script>
</head>
<body>

<div id="form-div">
    <p>Data last updated: <?=$effectiveDate?></p>
    <h3>Board of Accountancy Licensee Search</h3>
    <table id="table-forms">
        <tbody>
        <tr>
            <td>
                <div>Type individual/firm name, license number or location:</div>
                <div id="search-term-form-element" class="form-field">
                    <input id="search-term"> <input type="button" id="search-licensees-button" value='Search'>
                    <span id="loading"><img src="css/ajax-loader.gif"></span>
                </div>
            </td>
            <td>
                <div>Filter by type:</div>
                <div id="type-form-element" class="form-field">
                    <label class="select">
                        <select id="license-type">
                            <option value="" selected>[ All ]</option>
                            <option value="Firm">Firm</option>
                            <option value="Individual">Individual</option>
                        </select>
                    </label>
                </div>
            </td>
            <td>
                <div>Filter by status:</div>
                <div  id="status-form-element" class="form-field">
                    <label class="select">
                        <select id="license-status">
                            <option value="" selected>[ All ]</option>
                            <?php foreach ($statusList as $status) { ?>
                                <option value="<?php echo $status['status'];?>"><?php echo $status['status'];?></option>
                            <?php } ?>
                        </select>
                    </label>
                </div>
            </td>
        </tr>
        </tbody>
    </table>

</div>
<div id="search-results-description" style="display:none">
    <p>
        <span id="search-results-count"></span> <span id="search-results-count-records"></span> found.<br />
        <span id="more-info">For information regarding licensing status call <strong>503-378-4181</strong>.
        For information regarding disciplinary action call <strong>503-378-2262</strong>.</span>
    </p>
</div>
<div class="search-results-pagination"></div>


<div id="search-results"></div>
<div class="search-results-pagination"></div>

<?php /*
<div id="dialog-form" title="Send Licensee Search Results">
    <p class="validateTips">Enter in a valid email address.</p>
    <form>
        <label for="email">Email</label>
        <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all">

        <!-- Allow form submission with keyboard without duplicating the dialog button -->
        <input type="submit" tabindex="-1" style="position:absolute; top:-1000px">
    </form>
</div>
*/ ?>

<div id="dialog-show-detail" title="View Detail">
    <div id="detail-data"></div>
</div>

</body>
</html>
