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

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

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

<div id="central-body">
    <div id="title-background">
        <div id="title-body-update">
            <p id="text-left-body-update">UPDATE HOA ORDER</p>
            <p id="text-right-body-update"> If original order was placed prior to 1/7/2012 Please <a href="/orders/hoa/create">click here</a> </p>
        </div>
    </div>
    <div id="slider-central-update">
        <div id="form-container-update">
            <?php echo Form::open(['route'=>'order.hoa.postSearchcomplete']); ?>

            <div id="form-basic-information-update">
                <!-- INICIO primer campo de inputs -->
                <div id="column" class="row">
                    <div class="col-md-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_numbers), Input::old('file_number'), ['id'=>"file_number", 'class'=>"form-control"]) */ ?>
                    </div>
                    <div class="col-md-6">
                        <p>Address:</p>
                        <?php /* Form::text('address', Input::old('address'), ['id'=>"address", 'class'=>"form-control"]) */ ?>
                        <?php echo Form::select('address', ["" => "SELECT"] + $properties, Input::old('address'), ['id'=>"address", 'class'=>"form-control"]); ?>

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

        </div>
    </div>
    <div id="container-center">
        <div id="container-table">
            <div id="show-table">
                <span id="block" style="<?php echo (isset($orders))?'display:block':'display:none'; ?>">
                    <table class="table table-striped table-bordered table-hover" id="update-hoa-table">
                        <thead>
                            <tr>
                                <th id="table-top">Date / Requested</th>
                                <th id="table-top">Order Type</th>
                                <th id="table-top">Address</th>
                                <th id="table-top">Completed Date</th>
                                <th id="table-top">Download</th>
                                <th id="table-top">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if(isset($orders)): ?>
                            <?php if(sizeof($orders)): ?>
                            <?php foreach($orders as $order): ?>
                            <tr>
                                <td id="" width="97"><?php echo $order->requestDate(); ?></td>
                                <td id="" width="97"><?php echo ($order->is_update=='0')?'HOA New':'HOA Update'; ?></td>
                                <td id="" width="97"><?php echo strtoupper($order->Property->address.", ".$order->Property->City->name.", ".$order->Property->County->State->state." ".$order->Property->zipcode); ?></td>
                                <td id="" width="97"><?php echo $order->completedDate(); ?></td>
                                <td id="" width="97">
                                    <?php if($order->order_status_id == HoaOrderStatus::COMPLETED): ?>
                                    <a target="_blank" href="http://hoa.onesteplien.com:8086/files/orders/<?php echo $order->id; ?>/FinalDocument.pdf">Download</a></td>
                                <?php endif; ?>
                                <td id="" width="97">
                                    <?php if($order->order_status_id == HoaOrderStatus::COMPLETED): ?>
                                    <a href="<?php echo route('order.hoa.edit', [$order->id]); ?>">Update</a>
                                    <?php endif; ?>
                                </td>
                            </tr>
                            <?php endforeach; ?>
                            <?php endif; ?>
                            <?php endif; ?>

                            <?php if(isset($ordersAccess)): ?>
                            <?php if(sizeof($ordersAccess)): ?>
                            <?php foreach($ordersAccess as $order): ?>
                            <tr>
                                <td id="" width="97"><?php echo $order->date; ?></td>
                                <td id="" width="97"><?php echo 'HOA Order'; ?></td>
                                <td id="" width="97"><?php echo strtoupper($order->property_address); ?></td>
                                <td id="" width="97"><?php echo $order->completed; ?></td>
                                <td id="" width="97">
                                    <?php if(!is_null($order->invoice) && file_exists(public_path('access/'.$order->invoice.'.pdf'))): ?>
                                    <a target="_blank" href="<?php echo asset('access/'.$order->invoice.'.pdf'); ?>">Download</a></td>
                                    <?php endif; ?>
                                </td>
                                <td id="" width="97">
                                    <a href="<?php echo route('order.hoa.create', [0]); ?>">Update</a>
                                </td>
                            </tr>
                            <?php endforeach; ?>
                            <?php endif; ?>
                            <?php endif; ?>
                        </tbody>
                        <?php if(isset($orders) && sizeof($orders)): ?>
                        <?php echo $orders->links(); ?>

                        <?php endif; ?>
                    </table>
                </span>
            </div>
        </div>
    </div>
    <?php echo $__env->make('helpers.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <?php $__env->stopSection(); ?>
</div>
<?php echo $__env->make('helpers.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>