 
<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">CentraWave</h1>
    	</div>
    </div>
    <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
	                    <?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="panel-heading">
                            Pending Orders
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-active">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Name</th>
                                            <th>Phone</th>
                                            <th>Address</th>
                                            <th>City</th>
                                            <th>Order Date</th>
                                            <th>CSR</th>
                                            <th>Action</th>
                                            <th>Keywords</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0;  ?>
                                    <?php foreach($active_orders as $order): ?>
                                        <?php if($order->fixed_wireless === null): ?>
                                            <?php $count++; ?>
                                            <?php if($count % 2 == 1): ?>
                                                <tr class="odd">
                                            <?php else: ?>
                                            	<tr class="even">
                                            <?php endif; ?>
        											<td><?php echo e($order->id); ?></td>
        											<td>
        												<?php if($order->type == 'Business' && $order->spouse_name): ?>
        													<?php echo e($order->spouse_name); ?>

        												<?php else: ?>
        													<?php echo e($order->first_name . ' ' . $order->last_name); ?>

        												<?php endif; ?>
        											</td>
                                                    <td>
                                                        <?php if($order->contact_phone): ?>
                                                            <a href="tel:<?php echo e($order->contact_phone); ?>">
                                                                <?php echo e($order->contact_phone); ?>

                                                            </a>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td>
                                                        <?php echo e($order->install_address); ?>

                                                    </td>
        											<td><?php echo e($order->install_city); ?></td>
                                                    <td><?php echo e($order->created_at); ?></td>
                                                    <td>
                                                        <?php if($order->assigned): ?>
                                                            <a href="mailto:<?php echo e(\App\User::find($order->assigned)->email); ?>?Subject=CentraWave%20Order%20<?php echo e($order->id); ?>">
                                                                <?php echo e(\App\User::find($order->assigned)->name); ?>

                                                            </a>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td style="text-align: center;">
 
                                                        <a href="<?php echo e(url('uadmin/orders/receipt/'.$order->id)); ?>" target="_blank" title="Customer Receipt">
                                                            <i class="fa fa-file-text-o fa-fw" style="text-align: left; cursor: pointer;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <?php if($order->internal_notes): ?>
                                                            <a onclick="alert('-- Internal Notes -- \n<?php echo e($order->internal_notes); ?>');" style="cursor: pointer;" title="CSR Notes">
                                                                <i class="fa fa-info-circle"></i>
                                                            </a>
                                                        <?php else: ?>
                                                            <i class="fa fa-info-circle" style="opacity: 0;"></i>
                                                        <?php endif; ?>
                                                        &nbsp;
                                                        <form 
                                                            method="POST" 
                                                            action="<?php echo e(url('admin/fixed-wireless/decision')); ?>" 
                                                            style="display: inline;"
                                                            onsubmit="return confirm('You are indicating that CentraWave is available for this customer. Do you wish to continue?');"
                                                        >
                                                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                                                            <input type="hidden" name="orderID" value="<?php echo e($order->id); ?>">
                                                            <input type="hidden" name="decision" value="1">

                                                            <button type="submit" style="border: none; background-color: transparent;">
                                                                <i class="fa fa-check-circle" style="color: green; cursor: pointer;" title="Available"></i>
                                                            </button>
                                                        </form>
                                                        <form 
                                                            method="POST" 
                                                            action="<?php echo e(url('admin/fixed-wireless/decision')); ?>" 
                                                            style="display: inline;"
                                                            onsubmit="return confirm('You are indicating that CentraWave is UNAVAILABLE for this customer. Do you wish to continue?');"
                                                        >
                                                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                                                            <input type="hidden" name="orderID" value="<?php echo e($order->id); ?>">
                                                            <input type="hidden" name="decision" value="0">

                                                            <button type="submit" style="border: none; background-color: transparent;">
                                                                <i class="fa fa-times-circle" style="color: red; cursor: pointer;" title="Unavailable"></i>
                                                            </button>
                                                        </form>
                                                    </td>
                                                    <td>
                                                    	<?php echo e($order->spoke_to); ?> &nbsp;
                                                    	<?php echo e($order->spouse_name); ?> &nbsp;
                                                    	<?php echo e($order->email); ?> &nbsp;
                                                    	<?php echo e($order->signature); ?> &nbsp;
                                                    	<?php echo e($order->cc_phone); ?> &nbsp;
                                                    	<?php echo e($order->service_order_num); ?> &nbsp;
                                                    	<?php echo e($order->account_num); ?> &nbsp;
                                                    </td>
                                                </tr>
                                        <?php endif; ?>
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                         </div>
                     </div>
                   <div class="col-lg-12"
                   <?php if(count($awaiting_signature) == 0): ?>
                   style="display: none;"
                   <?php endif; ?>
                   >
                    <div class="panel panel-default">
                      <div class="panel-heading">
                            Awaiting Signature
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-waiting">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Name</th>
                                            <th>Address</th>
                                            <th>City</th>
                                            <th>Order Date</th>
                                            <th>CSR</th>
                                            <th>Appointment</th>
                                            <th>Action</th>
                                            <th>Keywords</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0;  ?>
                                    <?php foreach($awaiting_signature as $order): ?>
                                        
                                            <?php $count++; ?>
                                            <?php if($count % 2 == 1): ?>
                                                <tr class="odd">
                                            <?php else: ?>
                                                <tr class="even">
                                            <?php endif; ?>
                                                    <td><?php echo e($order->id); ?></td>
                                                    <td>
                                                        <a href="<?php echo e(url('uadmin/signatures/add/'.$order->id)); ?>" target="_blank">
                                                            <?php if($order->type == 'Business' && $order->spouse_name): ?>
                                                                <?php echo e(substr($order->spouse_name, 0, 28)); ?>

                                                            <?php else: ?>
                                                                <?php echo e(substr($order->first_name . ' ' . $order->last_name,0,28)); ?>

                                                            <?php endif; ?>
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <?php echo e($order->install_address); ?>

                                                    </td>
                                                    <td><?php echo e($order->install_city); ?></td>
                                                    <td><?php echo e($order->created_at); ?></td>
                                                    <td>
                                                        <?php if($order->assigned): ?>
                                                            <a href="mailto:<?php echo e(\App\User::find($order->assigned)->email); ?>?Subject=CentraWave%20Order%20<?php echo e($order->id); ?>">
                                                                <?php echo e(\App\User::find($order->assigned)->name); ?>

                                                            </a>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td>
                                                        <?php if(array_key_exists($order->id, $appointments)): ?>
                                                            <?php if($appointments[$order->id]): ?>
                                                                <?php echo e($appointments[$order->id]); ?>

                                                            <?php else: ?>
                                                                Completed <i class="fa fa-check" style="color: green;"></i>
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td style="text-align: center;">
                                                        <a href="<?php echo e(url('uadmin/signatures/add/'.$order->id)); ?>" target="_blank">
                                                            <i class="fa fa-pencil fa-fw" style="text-align: left;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <a href="<?php echo e(url('uadmin/orders/report/'.$order->id)); ?>" target="_blank">
                                                            <i class="fa fa-file-pdf-o fa-fw" style="text-align: left;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <a href="<?php echo e(url('uadmin/orders/receipt/'.$order->id)); ?>" target="_blank" title="Customer Receipt">
                                                            <i class="fa fa-file-text-o fa-fw" style="text-align: left; cursor: pointer;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <?php if($order->internal_notes): ?>
                                                            <a onclick="alert('-- Internal Notes -- \n<?php echo e($order->internal_notes); ?>');" style="cursor: pointer;" title="CSR Notes">
                                                                <i class="fa fa-info-circle"></i>
                                                            </a>
                                                        <?php else: ?>
                                                            <i class="fa fa-info-circle" style="opacity: 0;"></i>
                                                        <?php endif; ?>
                                                        

                                                    </td>
                                                    <td>
                                                        <?php echo e($order->spoke_to); ?> &nbsp;
                                                        <?php echo e($order->spouse_name); ?> &nbsp;
                                                        <?php echo e($order->email); ?> &nbsp;
                                                        <?php echo e($order->signature); ?> &nbsp;
                                                        <?php echo e($order->cc_phone); ?> &nbsp;
                                                        <?php echo e($order->service_order_num); ?> &nbsp;
                                                        <?php echo e($order->account_num); ?> &nbsp;
                                                    </td>
                                                </tr>
                                        
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                     </div>
                 </div>
                 
                 <div class="col-lg-12"
                   <?php if(count($recently_signed) == 0): ?>
                   style="display: none;"
                   <?php endif; ?>
                   >
                    <div class="panel panel-default">
                      <div class="panel-heading">
                            Recently Signed
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-signed">
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Name</th>
                                            <th>Address</th>
                                            <th>City</th>
                                            <th>Signature Date</th>
                                            <th>Witness</th>
                                            <th>Appointment</th>
                                            <th>Action</th>
                                            <th>Keywords</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0;  ?>
                                    <?php foreach($recently_signed as $order): ?>
                                        
                                            <?php $count++; ?>
                                            <?php if($count % 2 == 1): ?>
                                                <tr class="odd">
                                            <?php else: ?>
                                                <tr class="even">
                                            <?php endif; ?>
                                                    <td><?php echo e($order->id); ?></td>
                                                    <td>
                                                        <a href="<?php echo e(url('uadmin/signatures/add/'.$order->id)); ?>" target="_blank">
                                                            <?php if($order->type == 'Business' && $order->spouse_name): ?>
                                                                <?php echo e(substr($order->spouse_name,0,28)); ?>

                                                            <?php else: ?>
                                                                <?php echo e(substr($order->first_name . ' ' . $order->last_name,0,28)); ?>

                                                            <?php endif; ?>
                                                        </a>
                                                    </td>
                                                    <td>
                                                        <?php echo e($order->install_address); ?>

                                                    </td>
                                                    <td><?php echo e($order->install_city); ?></td>
                                                    <td><?php echo e($order->jsignature_at); ?></td>
                                                    <td>
                                                        <?php echo e($order->jsignature_user); ?>

                                                    </td>
                                                    <td>
                                                        <?php if(array_key_exists($order->id, $appointments)): ?>
                                                            <?php if($appointments[$order->id]): ?>
                                                                <?php echo e($appointments[$order->id]); ?>

                                                            <?php else: ?>
                                                                Completed <i class="fa fa-check" style="color: green;"></i>
                                                            <?php endif; ?>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td style="text-align: center;">
                                                        <a href="<?php echo e(url('uadmin/orders/report/'.$order->id)); ?>" target="_blank">
                                                            <i class="fa fa-file-pdf-o fa-fw" style="text-align: left;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <a href="<?php echo e(url('uadmin/orders/receipt/'.$order->id)); ?>" target="_blank" title="Customer Receipt">
                                                            <i class="fa fa-file-text-o fa-fw" style="text-align: left; cursor: pointer;"></i>
                                                        </a>
                                                        &nbsp;
                                                        <?php if($order->internal_notes): ?>
                                                            <a onclick="alert('-- Internal Notes -- \n<?php echo e($order->internal_notes); ?>');" style="cursor: pointer;" title="CSR Notes">
                                                                <i class="fa fa-info-circle"></i>
                                                            </a>
                                                        <?php else: ?>
                                                            <i class="fa fa-info-circle" style="opacity: 0;"></i>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td>
                                                        <?php echo e($order->spoke_to); ?> &nbsp;
                                                        <?php echo e($order->spouse_name); ?> &nbsp;
                                                        <?php echo e($order->email); ?> &nbsp;
                                                        <?php echo e($order->signature); ?> &nbsp;
                                                        <?php echo e($order->cc_phone); ?> &nbsp;
                                                        <?php echo e($order->service_order_num); ?> &nbsp;
                                                        <?php echo e($order->account_num); ?> &nbsp;
                                                    </td>
                                                </tr>
                                    <?php endforeach; ?>
                                       </tbody>
                                    </table>
                                </div>
                             </div>
                     </div>
                 </div>


             </div>

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

<?php $__env->startSection('extras'); ?>
	<!-- DataTables CSS -->
    <!-- <link href="<?php echo e(asset('uad/css/plugins/dataTables.bootstrap.css')); ?>" rel="stylesheet">  -->
    <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"/>
    
    
    <style>
    	a:hover{
    		text-decoration: none;
    	}
    	.odd .subBack {
    		background-color: #f0fcff;
    	}
    	.even .subBack {
    		background-color: #ecf7fa;
    	}
    	.floatLeft
    	{
    		float: left;
    	}

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

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

    <!-- DataTables JavaScript 
    <script src="<?php echo e(asset('uad/js/plugins/dataTables/jquery.dataTables.js')); ?>"></script>
    <script src="<?php echo e(asset('uad/js/plugins/dataTables/dataTables.bootstrap.js')); ?>"></script> -->
	<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>

	
    
    <!-- Page-Level Demo Scripts - Tables - Use for reference -->
    <script>
    $(document).ready(function() {
     

    var table3 =    $('#dataTables-waiting').dataTable( {
					"pageLength": 100,
					"order": [ 4, 'desc' ],
					"stateSave" : false,
					"scrollX" : window.innerWidth < 800 ? true : false,
					"columnDefs": [
					               {
					                   "targets": [ 8 ],
                                        "visible": false,
                                        "searchable": true
					               },
					           ]
					
			} ); 
    var table1 =    $('#dataTables-active').dataTable( {
		"pageLength": 100,
		"order": [ 5, 'asc' ],
		"stateSave" : false,
		"scrollX" : window.innerWidth < 800 ? true : false,
		"columnDefs": [
		               {
		                   "targets": [ 8 ],
		                   "visible": false,
		                   "searchable": true
		               },
		           ]
		
			} ); 
    var table4 =    $('#dataTables-signed').dataTable( {
        "pageLength": 100,
        "order": [ 4, 'asc' ],
        "stateSave" : false,
        "scrollX" : window.innerWidth < 800 ? true : false,
        "columnDefs": [
                       {
                           "targets": [ 8 ],
                           "visible": false,
                           "searchable": 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;
             
            //any browser, must include your own file
            //var clearSearch = $('<img src="/images/delete.png" style="vertical-align:text-bottom;cursor:pointer;" alt="Delete" title="Delete"/>');
             
            //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'
        } );
    }

var keys = [];
	
	document.onkeydown = function(evt){    
	   var key = evt.keyCode;
	   keys[key] = true;
	    if(keys[17] && keys[18] && keys[82]){
	    	
			$('.uncomplete').css('display', 'inline');
			
			keys[17] = false;
			keys[18] = false;
			keys[82] = false;
	    } 
		if(keys[17] && keys[18] && keys[68]){
	    	
			$('.delete').css('display', 'inline');
			
			keys[17] = false;
			keys[18] = false;
			keys[68] = false;
	    } 
	}
	document.onkeyup = function(evt){    
	   var key = evt.keyCode;
	   keys[key] = false;
	}

    </script> 

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




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