
<!-- end app-header -->
<!-- begin app-container -->
<div class="app-container">
    <!-- begin app-nabar -->
    <aside class="app-navbar">
        <? include "application/views/template/menu/sidemain.php"; ?>
    </aside>
    <!-- end app-navbar -->
    <!-- begin app-main -->
    <div class="app-main" id="main">
        <!-- begin container-fluid -->
        <div class="container-fluid">

            <? include "application/views/template/topstrip.php"; ?>
            <!-- begin row -->

            <div class="row">
                <div class="col-lg-6 col-xxl-4 m-b-30">

                    <div class="card card-statistics h-100 mb-0">
                        <div class="card-header d-flex justify-content-between">
                            <div class="card-heading">
                                <h4 class="card-title">New Patient -  <?= $account_message ?> </h4>
                            </div>
                            <div class="dropdown">
                                <!-- a class="btn btn-round btn-inverse-primary btn-xs" href="#">View all </a -->
                            </div>
                        </div>
                        <div class="card-body">


                            <div class="card-body">
                                <form method="POST" action="/patient/addnew">
                                    <div class="form-row">
                                        <div class="form-group col-md-6">
                                            <label for="inputEmail4">Firstname</label>
                                            <input type="text" class="form-control" id="firstname" name="firstname" value="<?= $firstname ?>" placeholder="Firstname">
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="inputPassword4">Lastname</label>
                                            <input type="text" class="form-control" id="lastname" name="lastname" value="<?= $lastname ?>" placeholder="Lastname">
                                        </div>
                                    </div>



                                    <div class="form-row">
                                        <div class="form-group col-md-6">
                                            <label for="inputEmail4">DOB</label>
                                            <input type="text" class="form-control date-picker-default" value="" name="dob">
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="inputPassword4">Gender</label>

                                            <select class="form-control" aria-label="Select Gender" name ="gender">
                                                <option selected>Select</option>
                                                <option value="M">Male</option>
                                                <option value="F">Female</option>
                                                <option value="U">Unknown</option>
                                            </select>

                                        </div>
                                    </div>



                                    <!-- div class="form-row">
                                        <div class="form-group col-md-6">
                                            <label for="inputEmail4">Email</label>
                                            <input type="email" class="form-control" id="inputEmail4" placeholder="Email">
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="inputPassword4">Password</label>
                                            <input type="password" class="form-control" id="password" value="<?= $password ?>" placeholder="Password">
                                        </div>
                                    </div -->

                                    <div class="form-group">
                                        <label for="inputAddress">Email</label>
                                        <input type="email" class="form-control" id="inputEmail4" name ="email" placeholder="Email">
                                    </div>

                                    <div class="form-group">
                                        <label for="inputAddress">Address</label>
                                        <input type="text" class="form-control" id="street1" name="street1" value="<?= $street1 ?>" placeholder="1234 Main St">
                                    </div>
                                    <div class="form-group">
                                        <label for="inputAddress2">Address 2</label>
                                        <input type="text" class="form-control" id="street2" name="street2" value="<?= $street2 ?>" placeholder="Apartment, studio, or floor">
                                    </div>
                                    <div class="form-row">
                                        <div class="form-group col-md-6">
                                            <label for="inputCity">City</label>
                                            <input type="text" class="form-control" id="city" name="city" value="<?= $city ?>">
                                        </div>
                                        <div class="form-group col-md-4">
                                            <label for="inputState">State</label>
                                            <select id="inputState" class="form-control" name="state">
                                                <option selected>Select State</option>
                                                <option value="OGUN">Ogun</option>
                                                <option value="OYO">Oyo</option>
                                                <option value="OSUN" selected>Osun</option>
                                            </select>
                                        </div>
                                        <div class="form-group col-md-2">
                                            <label for="inputZip">Zip</label>
                                            <input type="text" class="form-control" id="zipcode" name="zipcode" value="<?= $zipcode ?>">
                                        </div>
                                    </div>
                                    <!-- div class="form-group">
                                        <div class="form-check">
                                            <label class="form-check-label">
                                    <?= $account_message ?>
                                            </label>
                                        </div>
                                    </!-->

                                    <div class="form-row">
                                        <div class="form-group col-md-9">

                                        </div>
                                        <div class="form-group col-md-3">
                                            <button type="submit" class="btn btn-primary  btn-sm">Add Patient</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xxl-3 m-b-30">
                    <div class="card card-statistics h-40 mb-0">
                        <div class="card-header d-flex justify-content-between">
                            <div class="card-heading">
                                <h4 class="card-title">New Patient Link ID</h4>
                            </div>
                            <div class="dropdown">
                                <!-- a class="btn btn-round btn-inverse-primary btn-xs" href="#">View all </a -->
                            </div>
                        </div>
                        <div class="card-body">
                            <div class="card-body">
                                <form name="linkform">
                                    <div class="form-row">
                                        <div class="form-group col-md-12">
                                            <label for="inputLinkID">Enter Link ID</label>
                                            <input type="text" class="form-control" id="patient_link_id" name="patient_link_id" value="<?= isset($patient_link_id) ? $patient_link_id : '' ?>" placeholder="Link ID : WE34RTH587">
                                        </div>                                        
                                    </div>  
                                    <div class="form-row">
                                        <div class="form-group col-md-6">
                                            <div id="link_result">[]</div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <button type="submit" id="link_submit" class="btn btn-primary btn-block btn-sm" onclick="return connectLinkID()">Link Patient</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="col-xxl-5 m-b-30">
                    <? include 'application/views/provider/components/patient_listing.php'; ?>
                </div>

            </div>






        </div>
        <!-- end container-fluid -->
    </div>
    <!-- end app-main -->
</div>
<!-- end app-container -->
<!-- begin footer -->

<script type="text/javascript">
<!--

    function connectLinkID() {
        var patient_link_id = document.linkform.patient_link_id.value;
        // alert(patient_link_id);

        if (patient_link_id === '') {
            alert('You must enter valid linkID to continue!');
            return false;
        }

        // alert(job_description);
        $('#link_result').html('Processing...');
        $('#link_submit').prop('disabled', true);
        $.ajax({
            url: "/patient/linkpatient?patient_link_id=" + patient_link_id
        }).done(function (data) {
            $('#link_result').html(data);
            document.linkform.patient_link_id.value = '';
            $('#link_submit').prop('disabled', false);
        });
        return false;
    }

    // -->    
</script>
