<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">
    			<?php echo e($property->name); ?> <div style="font-size:24px; display: inline;">(<?php echo e($property->type); ?>)</div>
    			<a href='<?php echo e(url('uadmin/properties/edit/'.$property->id)); ?>'>
                	<form style="display: inline; text-align: right; float: right;" role="form" method="POST" action="<?php echo e(url('admin/properties/deactivate')); ?>" 
						onsubmit="return confirm('Are you sure you want to delete property (<?php echo e($property->name); ?>)?')">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
						<input type="hidden" name="propertyID" value="<?php echo e($property->id); ?>">
						<button type="submit" style="border: none; background-color: white; padding: 0;">
                			<i class="fa fa-trash-o fa-fw" style=" font-size: 32px; color: black;"></i>
                		</button>
                	</form>
	                &nbsp
	                <i class="fa fa-edit fa-fw" style="text-align: right; float: right; font-size: 32px; color: black;"></i>
	            </a>
    		</h1>
    	</div>
    </div>
    <div id="app" class="row">
        <div class="col-lg-12">
            <?php if(session('status')): ?>
			<div class="alert alert-success">
				<?php echo e(session('status')); ?>

			</div>
			<?php endif; ?>
			<?php if(count($errors) > 0): ?>
				<div class="alert alert-danger">
					<strong>Whoops!</strong> There were some problems with your input.<br><br>
					<ul>
						<?php foreach($errors->all() as $error): ?>
							<li><?php echo e($error); ?></li>
						<?php endforeach; ?>
					</ul>
				</div>
			<?php endif; ?>
			<div class="content">
				<div class="col-sm-4" style="padding-bottom: 20px;">
					<h4>Location</h4>
					<?php if($property->address): ?>
					<a target='_blank' href='https://www.google.com/maps/place/<?php echo e($property->address); ?>,+<?php echo e($property->city); ?>,+<?php echo e($property->state); ?>+<?php echo e($property->zip); ?>'>
						<p><?php echo e($property->address); ?> <br/> <?php echo e($property->city.', '.$property->state.' '.$property->zip); ?></p>
					</a>
					<?php else: ?>
					<a target='_blank' href='https://www.google.com/maps/place/<?php echo e($property->coordinates); ?>'>
						<p><?php echo e($property->coordinates); ?></p>
					</a>
					<?php endif; ?>
				</div>
				<div class="col-sm-8" style="padding-bottom: 20px;">
					<h4>Images <i class="fa fa-plus-circle" style='color: #01B300; cursor: pointer;' data-toggle="modal" data-target="#addModal" title="Add Image"></i></h4>
					<div class="gallery">
					<?php foreach($attachments as $attachment): ?>
						<div class="gallery-image hover-shadow">
							<img class="img-button" src='<?php echo e(asset('uadmin/properties/images/'.$attachment->id)); ?>' data-toggle="modal" data-id="<?php echo e($attachment->id); ?>" data-target="#viewModal">
						</div>
					<?php endforeach; ?>
					</div>
				</div>
				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Description</h4>
					<?php if($property->description): ?>
						<p><?php echo e($property->description); ?></p>
					<?php else: ?>
						<p>No description</p>
					<?php endif; ?>
				</div>

				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Assigned Employees</h4>
					<?php if(!$users->isEmpty()): ?>
					<p>
						<?php foreach($users as $key => $user): ?>
						<?php if($key==(count($users)-1)): ?>
						<?php echo e(App\User::where('id', '=', $user->user)->select('name')->first()->name); ?>

						<?php else: ?>
						<?php echo e(App\User::where('id', '=', $user->user)->select('name')->first()->name.', '); ?>

						<?php endif; ?>
						<?php endforeach; ?>
					</p>
					<?php else: ?>
						<p>No assigned employees</p>
					<?php endif; ?>
				</div>

				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Inspection Logs</h4>
					<a  class="btn btn-primary" href="<?php echo e(url('uadmin/properties/logs/add/'.$property->id)); ?>" style="color:white; float: left; margin-bottom: 10px;">New Inspection</a>
					<br/>
					<br/>
					<div class="row">
						<div class="col-lg-12">
							<div class="panel panel-default">
							    <?php if(count($errors) > 0): ?>
							    <div class="alert alert-danger">
							        <strong>Whoops!</strong> There were some problems with your input.<br><br>
							        <ul>
							            <?php foreach($errors->all() as $error): ?>
							            <li><?php echo e($error); ?></li>
							            <?php endforeach; ?>
							        </ul>
							    </div>
							    <?php endif; ?>
							    <div class="panel-heading">
							        Archived Inspection Logs
							    </div>
							    <!-- /.panel-heading -->
							    <div class="panel-body">
							        <div class="dataTable_wrapper">
							            <table class="table table-striped table-bordered table-hover display nowrap" width="100%" id="dataTables-example1">
							                <thead>
							                    <tr>
							                        <th data-priority="1">Inspection Date</th>
							                        <th>Completed By</th>
							                        <th>Pass/Fail</th>
							                        <th data-priority="2">Action</th>
							                    </tr>
							                </thead>
							                <tbody>
							                    <?php $count = 0; ?>
							                    <?php foreach($logs as $log): ?>
							                    <?php $count++; ?>
							                    <?php if($count % 2 == 1): ?>
							                    <tr class="odd">
							                    <?php else: ?>
							                    <tr class="even">
							                    <?php endif; ?>
						                            <td>
						                                <a href='<?php echo e(url('uadmin/properties/logs/edit/'.$log->id)); ?>'><?php echo e(date_create($log->visit_date)->format('Y-m-d')); ?>

						                                </a>
						                            </td>
						                            <td>
						                            	<?php echo e(\App\User::where('id',$log->completed_by)->first()->name); ?>

						                            </td>
						                            <td>
						                            <?php if($log->failed_inspection==1): ?>
						                            	Failed
						                            <?php else: ?>
						                            	Passed
						                            <?php endif; ?>
						                            </td>
						                            <td style="text-align: center;">
						                                <a href='<?php echo e(url('uadmin/properties/logs/edit/'.$log->id)); ?>'>
						                                    <i class="fa fa-edit fa-fw" style="text-align: left;"></i>
						                                </a>
						                            </td>
						                        </tr>
						                        <?php endforeach; ?>
							                </tbody>
						                </table>
						            </div>
						        </div>
						    </div>
						</div>
					</div>
				</div>

				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Maintenance Tickets</h4>
					<a class="btn btn-primary" href="<?php echo e(url('uadmin/properties/tickets/add/'.$property->id)); ?>" style="color:white; float: left; margin-bottom: 10px;">New Maintenance Ticket</a>
					<br/>
					<br/>
					<div class="row">
						<div class="col-lg-12">
							<div class="panel panel-default">
							    <?php if(count($errors) > 0): ?>
							    <div class="alert alert-danger">
							        <strong>Whoops!</strong> There were some problems with your input.<br><br>
							        <ul>
							            <?php foreach($errors->all() as $error): ?>
							            <li><?php echo e($error); ?></li>
							            <?php endforeach; ?>
							        </ul>
							    </div>
							    <?php endif; ?>
							    <div class="panel-heading">
							        Maintenance Tickets
							    </div>
							    <!-- /.panel-heading -->
							    <div class="panel-body">
							        <div class="dataTable_wrapper">
							            <table class="table table-striped table-bordered table-hover display nowrap" width="100%" id="dataTables-example2">
							                <thead>
							                    <tr>
							                        <th data-priority="1">Name</th>
							                        <th>Status</th>
							                        <th>Priority</th>
							                        <th>Due Date</th>
							                        <th data-priority="2">Action</th>
							                    </tr>
							                </thead>
							                <tbody>
							                    <?php $count = 0; ?>
							                    <?php foreach($tickets as $ticket): ?>
							                    <?php $count++; ?>
							                    <?php if($count % 2 == 1): ?>
							                    <tr class="odd">
							                    <?php else: ?>
							                    <tr class="even">
							                    <?php endif; ?>
						                            <td>
						                                <a href='<?php echo e(url('uadmin/properties/tickets/view/'.$ticket->id)); ?>'><?php echo e($ticket->name); ?>

						                                </a>
						                            </td>
						                            <td>
						                            <?php if($ticket->completed): ?>
						                            	Completed: <?php echo e($ticket->completed); ?>

						                            <?php else: ?>
						                            	Pending
						                            	<i class="fa fa-flag fa-fw" style="text-align: left; color:red;"></i>
						                            <?php endif; ?>
						                            </td>
						                            <td>
						                                <?php echo e(ucfirst($ticket->priority)); ?>

						                            </td>
						                            <td>
						                            <?php if($ticket->due_date == 0): ?>
						                            	None
						                            <?php else: ?>
						                                <?php echo e(date_create($ticket->due_date)->format('Y-m-d')); ?>

						                            <?php endif; ?>
						                            </td>
						                            <td style="text-align: center;">
						                            	<?php if(!$ticket->completed): ?>
															<a class="btn btn-primary" href="<?php echo e(url('uadmin/properties/tickets/view/'.$ticket->id)); ?>" style="color:white; float: center; margin-right: 10px;">Complete</a>
						                            	<?php endif; ?>
						                                <a href='<?php echo e(url('uadmin/properties/tickets/edit/'.$ticket->id)); ?>'>
						                                    <i class="fa fa-edit fa-fw" style="text-align: left;"></i>
						                                </a>
						                            </td>
						                        </tr>
						                        <?php endforeach; ?>
							                </tbody>
						                </table>
						            </div>
						        </div>
						    </div>
						</div>
					</div>
				</div>

				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Recurring Tickets</h4>
					<div class="row">
						<div class="col-lg-12">
							<div class="panel panel-default">
							    <?php if(count($errors) > 0): ?>
							    <div class="alert alert-danger">
							        <strong>Whoops!</strong> There were some problems with your input.<br><br>
							        <ul>
							            <?php foreach($errors->all() as $error): ?>
							            <li><?php echo e($error); ?></li>
							            <?php endforeach; ?>
							        </ul>
							    </div>
							    <?php endif; ?>
							    <div class="panel-heading">
							        Recurring Tickets <a href="<?php echo e(url('uadmin/properties/schedules/add/'.$property->id)); ?>"><i class="fa fa-plus fa-fw" style='float: right; cursor: pointer;'title="Schedule New Ticket"></i></a>
							    </div>
							    <!-- /.panel-heading -->
							    <div class="panel-body">
							        <div class="dataTable_wrapper">
							            <table class="table table-striped table-bordered table-hover display nowrap" width="100%" id="dataTables-example4">
							                <thead>
							                    <tr>
							                        <th data-priority="1">Name</th>
							                        <th>Previous Time</th>
							                        <th>Next Time</th>
							                        <th data-priority="2">Action</th>
							                    </tr>
							                </thead>
							                <tbody>
							                    <?php $count = 0; ?>
							                    <?php foreach($schedules as $schedule): ?>
							                    <?php $count++; ?>
							                    <?php if($count % 2 == 1): ?>
							                    <tr class="odd">
							                    <?php else: ?>
							                    <tr class="even">
							                    <?php endif; ?>
						                            <td>
						                                <a href='<?php echo e(url('uadmin/properties/schedules/edit/'.$schedule->id)); ?>'><?php echo e($schedule->name); ?>

						                                </a>
						                            </td>
						                            <td>
						                                <?php echo e($schedule->prev_time); ?>

						                            </td>
						                            <td>
						                                <?php echo e($schedule->next_time); ?>

						                            </td>
						                            <td style="text-align: center;">
						                                <a href='<?php echo e(url('uadmin/properties/schedules/edit/'.$schedule->id)); ?>'>
						                                    <i class="fa fa-edit fa-fw" style="text-align: left;"></i>
						                                </a>
						                                &nbsp &nbsp
		                                            	<form style="display: inline;" role="form" method="POST" action="<?php echo e(url('admin/properties/schedule/delete')); ?>" 
															onsubmit="return confirm('Are you sure you want to remove schedule (<?php echo e($schedule->name); ?>)?')">
															<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
															<input type="hidden" name="scheduleID" value="<?php echo e($schedule->id); ?>">
															<input type="hidden" name="propertyID" value="<?php echo e($property->id); ?>">
															<button type="submit" style="border: none; background-color: white; padding: 0;">
		                                            			<i class="fa fa-trash-o fa-fw" style="text-align: right;"></i>
		                                            		</button>
		                                            	</form>
						                            </td>
						                        </tr>
						                        <?php endforeach; ?>
							                </tbody>
						                </table>
						            </div>
						        </div>
						    </div>
						</div>
					</div>
				</div>

				<div class="col-sm-12" style="padding-bottom: 20px;">
					<h4>Contacts</h4>
					<div class="row">
						<div class="col-lg-12">
							<div class="panel panel-default">
							    <?php if(count($errors) > 0): ?>
							    <div class="alert alert-danger">
							        <strong>Whoops!</strong> There were some problems with your input.<br><br>
							        <ul>
							            <?php foreach($errors->all() as $error): ?>
							            <li><?php echo e($error); ?></li>
							            <?php endforeach; ?>
							        </ul>
							    </div>
							    <?php endif; ?>
							    <div class="panel-heading">
							        Contacts <a><i class="fa fa-plus fa-fw" style='float: right; cursor: pointer;' data-toggle="modal" data-target="#addContactModal" title="Add Contact" @click="refresh()"></i></a>
							    </div>
							    <!-- /.panel-heading -->
							    <div class="panel-body">
							        <div class="dataTable_wrapper">
							            <table class="table table-striped table-bordered table-hover display nowrap" width="100%" id="dataTables-example3">
							                <thead>
							                    <tr>
							                        <th data-priority="1">Name</th>
							                        <th>Title</th>
							                        <th>Company</th>
							                        <th data-priority="3">Phone Number</th>
							                        <th data-priority="3">Email</th>
							                        <th data-priority="2">Action</th>
							                    </tr>
							                </thead>
							                <tbody>
							                    <?php $count = 0; ?>
							                    <?php foreach($contacts as $contact): ?>
							                    <?php $count++; ?>
							                    <?php if($count % 2 == 1): ?>
							                    <tr class="odd">
							                    <?php else: ?>
							                    <tr class="even">
							                    <?php endif; ?>
							                        <td>
						                            <?php if($contact->name): ?>
						                                <?php echo e($contact->name); ?>

						                            <?php else: ?>
						                            	--
						                            <?php endif; ?>
						                            </td>
						                            <td>
						                            <?php if($contact->title): ?>
						                                <?php echo e($contact->title); ?>

						                            <?php else: ?>
						                            	--
						                            <?php endif; ?>
						                            </td>
						                            <td>
						                            <?php if($contact->company): ?>
						                                <?php echo e($contact->company); ?>

						                            <?php else: ?>
						                            	--
						                            <?php endif; ?>
						                            </td>
						                            <td>
						                            <?php if($contact->phone_number): ?>
						                                <a href="tel:<?php echo e($contact->phone_number); ?>"><?php echo e($contact->phone_number); ?></a>
						                            <?php else: ?>
						                            	--
						                            <?php endif; ?>
						                            </td>
						                            <td>
						                            <?php if($contact->email): ?>
						                            	<a href="mailto:<?php echo e($contact->email); ?>"><?php echo e($contact->email); ?></a>
						                            <?php else: ?>
						                            	--
						                            <?php endif; ?>
						                            </td>
						                            <td style="text-align: center;">
						                                <a>
						                                    <i class="fa fa-edit fa-fw edit-contact-button" style="text-align: left;" data-toggle="modal" data-id="<?php echo e($contact); ?>" data-target="#editContactModal" @click="refresh()"></i>
						                                </a>
						                                &nbsp &nbsp
		                                            	<form style="display: inline;" role="form" method="POST" action="<?php echo e(url('admin/properties/contactlink/delete')); ?>" 
															onsubmit="return confirm('Are you sure you want to remove contact (<?php echo e($contact->name); ?>)?')">
															<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
															<input type="hidden" name="contactID" value="<?php echo e($contact->id); ?>">
															<input type="hidden" name="propertyID" value="<?php echo e($property->id); ?>">
															<button type="submit" style="border: none; background-color: white; padding: 0;">
		                                            			<i class="fa fa-trash-o fa-fw" style="text-align: right;"></i>
		                                            		</button>
		                                            	</form>
						                            </td>
						                        </tr>
						                        <?php endforeach; ?>
							                </tbody>
						                </table>
						            </div>
						        </div>
						    </div>
						</div>
					</div>
				</div>

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

	<!-- Add Image Modal -->
	<div id="addModal" class="modal fade" role="dialog">
		<div class="modal-dialog">

			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title">Add Property Images</h4>
				</div>
				<form id="theForm" class="form-horizontal" style="margin-bottom: 0px;" role="form" method="POST" enctype="multipart/form-data" action="<?php echo e(url('admin/properties/attachment/add')); ?>">
					<div class="modal-body">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
						<input type="hidden" name="propID" value="<?php echo e($property->id); ?>">

						<div class="form-group">
							<div class="col-sm-12 morePadding morePadding2" onclick="inputFocus('attachment')">
								<input type="file" class="form-control" id="attachments" name="attachments[]" value=""  title="Attachments" multiple>
								<span id="attachments-label" class="xlabel-text hasValue">Attachments</span>
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="submit" class="btn btn-primary" style="float: right;">
							Upload
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>

	<!-- View/Edit Image Modal -->
	<div id="viewModal" class="modal fade" role="dialog">
		<div class="modal-dialog">

			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title">Image</h4>
				</div>
				<div class="modal-body img-fill">
					<img id="imageId" src=''>
				</div>
				<div class="modal-footer">
					<form id="theForm" class="form-horizontal" style="margin-bottom: 0px;" role="form" method="POST" enctype="multipart/form-data" action="<?php echo e(url('admin/properties/attachment/delete')); ?>">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
						<input id="imageId-input" type="hidden" name="id" value="5">
						<button type="submit" class="btn btn-outline-danger" style="color:red;">Delete</button>
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					</form>
				</div>
			</div>

		</div>
	</div>

	<!-- Add Contact Modal -->
	<div id="addContactModal" class="modal fade" role="dialog">
		<div class="modal-dialog">

			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title">Create New Contact</h4>
				</div>
				<form id="theForm" class="form-horizontal" style="margin-bottom: 0px;" role="form" method="POST" enctype="multipart/form-data" action="<?php echo e(url('admin/properties/contact/add')); ?>">
					<div class="modal-body">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
						<input type="hidden" name="propertyID" value="<?php echo e($property->id); ?>">

						<div class="form-group">
							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('name')">
								<input type="text" class="form-control" id="name" name="name" value="<?php echo e(old('name')); ?>" title="Name">
								<span id="name-label" class="label-text">Name*</span>	
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('title')">
								<input type="text" class="form-control" id="title" name="title" value="<?php echo e(old('title')); ?>" title="Title">
								<span id="title-label" class="label-text">Job Title</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('company')">
								<input type="text" class="form-control" id="company" name="company" value="<?php echo e(old('company')); ?>" title="Company">
								<span id="company-label" class="label-text">Company</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-6 morePadding morePadding2" onclick="inputFocus('phone_number')">
								<input type="text" class="form-control" id="phone_number" name="phone_number" value="<?php echo e(old('phone_number')); ?>" title="Phone Number">
								<span id="phone_number-label" class="label-text">Phone Number</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-12 morePadding morePadding2" onclick="inputFocus('email')">
								<input type="text" class="form-control" id="email" name="email" value="<?php echo e(old('email')); ?>" title="Email">
								<span id="email-label" class="label-text">Email</span>	
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="submit" class="btn btn-primary" style="float: right;">
							Create
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>

		<!-- Edit Contact Modal -->
	<div id="editContactModal" class="modal fade" role="dialog">
		<div class="modal-dialog">

			<!-- Modal content-->
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title">Edit Contact</h4>
				</div>
				<form id="theForm" class="form-horizontal" style="margin-bottom: 0px;" role="form" method="POST" enctype="multipart/form-data" action="<?php echo e(url('admin/properties/contact/edit')); ?>">
					<div class="modal-body">
						<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
						<input type="hidden" id="edit-id" name="contactID" value="">

						<div class="form-group">
							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('name')">
								<input type="text" class="form-control" id="edit-name" name="name" value="<?php echo e(old('name')); ?>" title="Name">
								<span id="name-label" class="label-text">Name*</span>	
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('title')">
								<input type="text" class="form-control" id="edit-title" name="title" value="<?php echo e(old('title')); ?>" title="Title">
								<span id="title-label" class="label-text">Job Title</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-8 morePadding morePadding2" onclick="inputFocus('company')">
								<input type="text" class="form-control" id="edit-company" name="company" value="<?php echo e(old('company')); ?>" title="Company">
								<span id="company-label" class="label-text">Company</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-6 morePadding morePadding2" onclick="inputFocus('phone_number')">
								<input type="text" class="form-control" id="edit-phone_number" name="phone_number" value="<?php echo e(old('phone_number')); ?>" title="Phone Number">
								<span id="phone_number-label" class="label-text">Phone Number</span>	
							</div>
						</div>
						<div class="form-group">

							<div class="col-sm-12 col-md-12 morePadding morePadding2" onclick="inputFocus('email')">
								<input type="text" class="form-control" id="edit-email" name="email" value="<?php echo e(old('email')); ?>" title="Email">
								<span id="email-label" class="label-text">Email</span>	
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="submit" class="btn btn-primary" style="float: right;">
							Save
						</button>
					</div>
				</div>
			</form>
		</div>
	</div>

<?php $__env->stopSection(); ?>
	<style>
		input:focus+.label-text, input:not([value=" "])+.label-text, select+.label-text {
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);
		}
		input+.label-text, select+.label-text, .hasValue{
		    font-size: 20px;
		    font-weight: 400;
		    position: absolute;
		    top: 0;
		    left: 0;
		    display: block;

		    padding-left: 20px;
		    padding-top: 5px;
		    padding-bottom: 5px;
		    opacity: .8;
		    transition: all .3s ease-out,opacity 150ms ease .3s;
		    -webkit-transform: translateY(0) scale(1);
		    transform: translateY(0) scale(1);
		    -webkit-transform-origin: left top;
		    transform-origin: left top;
		}
		span {
		    font-size: 1rem;
		    font-weight: 600;
		    display: block;
		    padding-top: .25rem;
		    padding-bottom: .25rem;
		    margin-left: 1rem;
		}
		.hasValue
		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);
		}
		

		@media (max-width: 959px)
		{
			.morePadding {
			    margin-top: 1.5em;
			}
		}

		@media (min-width: 960px)
		{
			.morePadding {
			    margin-top: 1em;
			}
		}

.modal{
	padding-top: 100px;
}

.gallery img {
	height: 100%;
	width: auto;
	cursor: pointer;
}

.gallery{
    padding-bottom: 10px;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
}

.gallery-image{
	display: inline-block;
	width:140px;
	height:140px;
	margin: 5px;
	overflow:hidden;
	text-align: center;
	image-orientation: from-image;
}

.hover-shadow:hover {
	box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
	transition: 0.3s;
}

.img-fill{
	display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#imageId{
	flex-shrink: 0;
    height: 100%;
    max-height: 500px;
    width: auto;
	image-orientation: from-image;
}

</style>

<?php $__env->startSection('extras'); ?>
	<!-- DataTables CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/t/bs/pdfmake-0.1.18,dt-1.10.11,b-1.1.2,b-flash-1.1.2,b-html5-1.1.2,b-print-1.1.2/datatables.min.css"/>

    <!-- DataTables Responsiveness CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.2.3/css/responsive.dataTables.min.css"/>   
    
    <style>
    	a:hover{
    		text-decoration: none;
    	}
    	.odd .subBack {
    		background-color: #f0fcff;
    	}
    	.even .subBack {
    		background-color: #ecf7fa;
    	}
    	.floatLeft
    	{
    		float: left;
    	}

        .dtr-data{
            display: block;
        }
    </style>
<?php $__env->stopSection(); ?>


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

    <!-- DataTables JavaScript -->
	<script type="text/javascript" src="https://cdn.datatables.net/t/bs/pdfmake-0.1.18,dt-1.10.11,b-1.1.2,b-flash-1.1.2,b-html5-1.1.2,b-print-1.1.2/datatables.min.js"></script>
       
    <!-- DataTables Responsiveness JavaScript -->
    <script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.3/js/dataTables.responsive.min.js"></script>

    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script>
    $(document).ready(function() {
    var table1 =    $('#dataTables-example1').dataTable( {
					"pageLength": 10,
					"order": [ 0, 'desc' ],
					"stateSave" : false,
					"scrollX" : window.innerWidth < 800 ? true : false,
                    "responsive": true
        } );
    var table2 =    $('#dataTables-example2').dataTable( {
					"pageLength": 10,
					"order": [[ 1, 'desc' ],[ 2, 'desc']],
					"stateSave" : false,
					"scrollX" : window.innerWidth < 800 ? true : false,
                    "responsive": true
        } );  
    var table3 =    $('#dataTables-example3').dataTable( {
					"pageLength": 10,
					"order": [ 0, 'desc' ],
					"stateSave" : false,
					"scrollX" : window.innerWidth < 800 ? true : false,
                    "responsive": true
        } );
    var table4 =    $('#dataTables-example4').dataTable( {
					"pageLength": 10,
					"order": [ 2, 'asc' ],
					"stateSave" : false,
					"scrollX" : window.innerWidth < 800 ? true : false,
                    "responsive": true
        } );  
    });
    
    if ( typeof $.fn.dataTable == "function" && typeof $.fn.dataTableExt.fnVersionCheck == "function" && $.fn.dataTableExt.fnVersionCheck('1.9.2')/*older versions should work too*/ )
    {
        $.fn.dataTableExt.oApi.clearSearch = function ( oSettings )
        {
            var table = this;
             
            //no image file needed, css embedding must be supported by browser
            var clearSearch = $('<i class="fa fa-times-circle-o fa-fw" style="vertical-align:text-bottom;cursor:pointer;color: gray;"></i>');
            $(clearSearch).click( function ()
                    {
                          table.fnFilter('');
                    });
            $(oSettings.nTableWrapper).find('div.dataTables_filter').append(clearSearch);
            $(oSettings.nTableWrapper).find('div.dataTables_filter label').css('margin-right', '-16px');//16px the image width
            $(oSettings.nTableWrapper).find('div.dataTables_filter input').css('padding-right', '16px');
        }
     
        //auto-execute, no code needs to be added
        $.fn.dataTable.models.oSettings['aoInitComplete'].push( {
            "fn": $.fn.dataTableExt.oApi.clearSearch,
            "sName": 'whatever'
        } );
    }
    </script> 

<script>
	$(document).on("click", ".edit-contact-button", function () {
    	var myContact = $(this).data('id');
    	if(myContact.name)
    		document.getElementById("edit-name").value = myContact.name;
    	else
    		document.getElementById("edit-name").value = '';

    	if(myContact.title)
    		document.getElementById("edit-title").value = myContact.title;
    	else
    		document.getElementById("edit-title").value = '';

    	if(myContact.company)
    		document.getElementById("edit-company").value = myContact.company;
    	else
    		document.getElementById("edit-company").value = '';

    	if(myContact.phone_number)
    		document.getElementById("edit-phone_number").value = myContact.phone_number;
    	else
    		document.getElementById("edit-phone_number").value = '';

    	if(myContact.email)
    		document.getElementById("edit-email").value = myContact.email;
    	else
    		document.getElementById("edit-email").value = '';

    	document.getElementById("edit-id").value = myContact.id;
    	
    	app.populate(myContact.property_ids);
	});
</script>

<script>
	$(window).load(function(){
	 $('.container').find('img').each(function(){
	  var imgClass = (this.width/this.height > 1) ? 'wide' : 'tall';
	  $(this).addClass(imgClass);
	 })
	})

	$(document).on("click", ".img-button", function () {
    	var myImageId = $(this).data('id');
    	document.getElementById("imageId-input").value = myImageId;
    	document.getElementById("imageId").src = window.location.origin+'/uadmin/properties/images/'+myImageId;
    	console.log(document.getElementById("imageId").src);
	});
</script>
<?php $__env->stopSection(); ?>






<?php echo $__env->make('residential.templates.uadmin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>