<?php $__env->startSection('jsPageBottom'); ?>
<script>$('.popover-content').popover();</script>
<?php echo HTML::script('admin/template/js/lien.index.js'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('pageContent'); ?>

<div id="center-body">
    <div id="title-background">
        <div id="title-body-check-status">
            <div id="title-check-lien">CHECK STATUS HOA</div>
            <p class="href-text-right-body-check-lien">If your order was placed BEFORE the 7th of January 2012, <a id="href-text-right-body-check-lien" class="click-here" href="<?php echo URL::route('order.lienhoaboth.index'); ?>">click here</a> to check status of your order.</p>
        </div>
    </div>
    <div id="container-center-check-status">
        <div id="container-form-check-status">
            <div class="href-text-right-body-check-lien">
                <p>SEARCH</p>
            </div>
            <div id="column" class="row">
                <?php echo Form::open(['route'=>'order.hoa.postindex']); ?>

                <div class="col-sm-3">
                    <p>File Number:</p>
                    <?php echo Form::text('file_number', Input::old('file_number'), ['id'=>"file_number", 'class'=>"form-control"]); ?>

                    <?php /* Form::select('file_number', ["" => "Select"] + $file_number, Input::old('file_number'), ['id'=>"file_number", 'class'=>"form-control"]) */ ?>
                </div>
                <div class="col-sm-4">
                    <p>Address:</p>
                    <?php echo Form::select('address', ["" => "Select"] + $properties, Input::old('address'), ['id'=>"address", 'class'=>"form-control"]); ?>

                </div>
                <div class="col-sm-1">
                    <p>&nbsp;</p>
                    <button id="button-submit-form" name="button-submit-form" type="submit" class="btn btn-default go">GO</button>
                </div>
                <?php echo Form::close(); ?>

            </div>
        </div>
        <div id="show-table">
            <div id="show-table">
                <span id="block" style="<?php echo (isset($orders))?'display:block':'display:none'; ?>">
                    <?php if(isset($orders)): ?>
                    <?php if(sizeof($orders)): ?>
                    <?php foreach($orders as $order): ?>
                    <table id="table-results" class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th id="table-top" width="165">FILE NUMBER: <?php echo $order->file_number; ?></th>
                                <th colspan="5" width="600px"></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="97">FILE#: </td>
                                <td width="50"><?php echo $order->file_number; ?></td>
                                <td width="80">INVOICE NUMBER:</td>
                                <td width="97"><?php echo (!is_null($order->Invoice))?$order->Invoice->number:null; ?></td>
                                <td width="50">STATUS:</td>
                                <td width="97">
                                    <?php if($order->order_status_id == HoaOrderStatus::COMPLETED || $order->order_status_id == HoaOrderStatus::CANCEL): ?>
                                    <?php echo $order->OrderStatus->name; ?>

                                    <?php else: ?>
                                    <a class="popover-content" href="<?php echo route('order.hoa.getInformationForPopUp',[$order->id]); ?>" onclick="return false" tabindex="0"  data-toggle="popover" data-trigger="hover"  data-content="<?php echo $__env->make('site.modal-windows.check-hoa-popup', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>">
                                        <?php echo 'Pending<br>View Status'; ?>

                                    </a>
                                    <?php endif; ?>
                                </td>
                            </tr>
                            <tr>
                                <td>DATE REQUESTED: </td>
                                <td><?php echo $order->requestDate(); ?></td>
                                <td>DATE COMPLETED:</td>
                                <td><?php echo $order->completedDate(); ?></td>
                                <td>ETA:</td>
                                <td><?php echo null; ?></td>
                            </tr>
                            <tr>
                                <td colspan="1" id="" width="97">PROPERTY ADDRESS:</td>
                                <td colspan="5"><?php echo strtoupper($order->Property->address.", ".$order->Property->City->name.", ".$order->Property->County->State->state." ".$order->Property->zipcode); ?><?php echo ($order->is_update)?" (UPDATE)":""; ?> </td>
                            </tr>
                            <?php if((!is_null($order->getProcessor()->Entity))): ?>
                            <tr>
                                <td colspan="6">
                                    <a href="mailto:<?php echo strtoupper($order->getProcessor()->Entity->firstname)."@ONESTEPLIEN.COM"; ?>"><b>E-mail Processor:</b> <b><?php echo strtoupper($order->getProcessor()->Entity->firstname)."@ONESTEPLIEN.COM"; ?></b></a>
                                </td>
                            </tr>
                            <?php endif; ?>
                            <?php if($order->order_status_id == HoaOrderStatus::COMPLETED): ?>
                            <tr>
                                <td>
                                    <a target="_blank" href="http://hoa.onesteplien.com:8080/files/orders/<?php echo $order->id; ?>/FinalDocument.pdf"><b>Download Final Document</b></a></td>
                                </td>
                            </tr>
                            <?php endif; ?>
                            <tr>
                                <td colspan="6">
                                    <a href="mailto:order@onesteplien.com?subject=Estoppel Status on File Number: <?php echo $order->file_number; ?>" class="button-link"><b>Contact Us About This File</b></a>
                                </td>
                            </tr>
                            <?php if($order->order_status_id == HoaOrderStatus::CANCEL): ?>
                            <tr>
                                <td colspan="6" align="center"><?php echo HTML::linkRoute('order.hoa.create', 'Reactivate', [$order->id, $order->property_id], array('id'=>'button-submit-form','class' => 'btn btn-default reactivateHOA')); ?></td>
                            </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                    <?php endforeach; ?>
                    <?php else: ?>
                    <table class="table table-striped table-bordered table-hover">
                        <tbody>
                            <tr>
                                <td>
                                    <p class="text-danger">We apologize nothing was found using that info. Please try again.</p>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <?php endif; ?>
                    <?php endif; ?>
                </span>
            </div>
        </div>
    </div>
</div>
<?php echo $__env->make('helpers.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('helpers.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>