<?php $__env->startSection('content'); ?>
	<div class="row">
    	<div class="col-lg-12">
    		<h1 class="page-header">Digital Conversion</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">
                            Active Orders <a href="<?php echo e(url('uadmin/conversions/add')); ?>" target="_blank"> <i class="fa fa-plus fa-fw" style="float: right;"></i> </a>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>Name</th>
                                            <th>Account</th>
                                            <th>City</th>
                                            <th>Boxes</th>
                                            <th>Status</th>
                                            <th>Created</th>
                                            <th>Action</th>
                                            <th>Keywords</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $countA = 0; ?>
                                    <?php foreach($conversions as $conversion): ?>
                                    <?php if(Auth::user()->id === 61): ?>
	                                    <?php if($conversion->current == 'Preparing Shipment' || $conversion->current == 'Shipped'): ?>
	                                    <?php $countA++; ?>
	
	                                    <?php if($countA % 2 == 1): ?>
	                                        <tr class="odd">
	                                    <?php else: ?>
	                                    	<tr class="even">
	                                    <?php endif; ?>
	                                            <td>
	                                            	<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->id)); ?>">
	                                            		<?php echo e($conversion->fname . " " . $conversion->lname); ?>

	                                            	</a>
	                                            	&nbsp;
	                                            	<input style="float: right;" type="checkbox" id="Raddresses<?php echo e($countA); ?>" name="Raddresses[[<?php echo e($conversion->id); ?>]]" conversion="<?php echo e($conversion->id); ?>" value="1" onchange="routes()">
	                                            </td>
	                                            <td><?php echo e($conversion->account_num); ?></td>
	                                            <td><?php echo e($conversion->city); ?></td>
	                                            <td style="text-align: center;
	                                            <?php if($conversion->printed == 1): ?>
	                                             background-color: #ffff00;
	                                            <?php endif; ?>
	                                            ">
	                                            	<?php echo e($conversion->boxes); ?>

	                                            	&nbsp;
	                                            	<input type="checkbox" id="boxes<?php echo e($countA); ?>" name="boxes[[<?php echo e($conversion->id); ?>]]" conversion="<?php echo e($conversion->id); ?>" value="<?php echo e($conversion->boxes); ?>" onchange="boxes()">
	                                            </td>
	                                            <td><?php echo e($conversion->current); ?></td>
	                                            <td><?php echo e($conversion->created_at); ?></td>
	                                            <td style="text-align: center;">
	                                            	<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->id)); ?>"><i class="fa fa-edit"></i></a>
	                                            	
	                                            </td>
	                                            <td>
	                                            	<?php echo e($conversion->city); ?>

	                                            	<?php echo e($conversion->zip); ?>

	                                            	
	                                            </td>
	                                        </tr>
	                                    <?php endif; ?>
                                    <?php else: ?>
                                    <?php $countA++; ?>

                                    <?php if($countA % 2 == 1): ?>
                                        <tr class="odd">
                                    <?php else: ?>
                                    	<tr class="even">
                                    <?php endif; ?>
                                            <td>
                                           		<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->id)); ?>">
                                           			<?php echo e($conversion->fname . " " . $conversion->lname); ?>

                                           		</a>
                                            
                                            	&nbsp;
                                            	<input style="float: right;" type="checkbox" id="Raddresses<?php echo e($countA); ?>" name="Raddresses[[<?php echo e($conversion->id); ?>]]" conversion="<?php echo e($conversion->id); ?>" value="1" onchange="routes()">
                                            </td> 
                                            <td><?php echo e($conversion->account_num); ?></td>
                                            <td><?php echo e($conversion->city); ?></td>
                                            <td style="text-align: center;
                                            <?php if($conversion->printed == 1): ?>
                                             background-color: #ffff00;
                                            <?php endif; ?>
                                            ">
                                            	<?php echo e($conversion->boxes); ?>

                                            	&nbsp;
                                            	<input type="checkbox" id="boxes<?php echo e($countA); ?>" name="boxes[[<?php echo e($conversion->id); ?>]]" conversion="<?php echo e($conversion->id); ?>" value="<?php echo e($conversion->boxes); ?>" onchange="boxes()">
                                            </td>
                                            <td><?php echo e($conversion->current); ?></td>
                                            <td><?php echo e($conversion->created_at); ?></td>
                                            <td style="text-align: center;">
                                            	<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->id)); ?>"><i class="fa fa-edit"></i></a>
                                            	
                                            </td>
                                            <td>
                                            	<?php echo e($conversion->city); ?>

                                            	<?php echo e($conversion->zip); ?>

                                            	
                                            </td>
                                        </tr>
                                 
                                    <?php endif; ?>    
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                                <div id="print_container" style="display: none;">
                                	<hr>
                                	<div class="col-md-2">
                                		<label>Print Box Labels</label>
                                	</div>
                                	<div class="col-md-2">
                                		Selected: <i id="selected"></i>
                                	</div>
                                	<div class="col-md-2">
                                		Remaining: <i id="remaining"></i>
                                	</div>
                                	<div class="col-md-6">
                                		<form method="post" action="<?php echo url('admin/conversions/print'); ?>" >
                                			<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                                			<?php foreach($conversions as $conversion): ?>
                                			<input type="hidden" id="orders<?php echo e($conversion->id); ?>" name="orders[<?php echo e($conversion->id); ?>]" value="">
                                			<?php endforeach; ?>
                                			<button type="submit" class="btn btn-primary" style="float: right;">Print</button>
                                		</form>
                                	</div>
                                </div>
                                <div id="route_container" style="display: none;">
                                	<hr>
                                	<div class="col-md-3">
                                		<label>Generate Delivery Information</label>
                                	</div>
                                	<div class="col-md-3">
                                		Selected: <i id="Rselected"></i>
                                	</div>
                                	<div class="col-md-6">
                                		<form method="post" action="<?php echo url('uadmin/conversions/route'); ?>" >
                                			<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                                			<?php foreach($conversions as $conversion): ?>
                                			<input type="hidden" id="routes<?php echo e($conversion->id); ?>" name="routes[<?php echo e($conversion->id); ?>]" value="">
                                			<?php endforeach; ?>
                                			<button type="submit" class="btn btn-primary" style="float: right;">Generate</button>
                                		</form>
                                	</div>
                                </div>
                             </div>

                         </div>
                        <div class="panel panel-default">
                        <div class="panel-heading">
                            Archived Orders
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example2">
                                    <thead>
                                        <tr>
                                            <th>Name</th>
                                            <th>Account</th>
                                            <th>City</th>
                                            
                                            <th>Created</th>
                                            <th>Completed</th>
                                            <th>Action</th>
                                            <th>Keywords</th>
                                            <th>Address</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0; ?>
                                    <?php foreach($archive as $conversion): ?>
                                    <?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/conversions/edit/'.$conversion->id)); ?>"><?php echo e($conversion->fname . " " . $conversion->lname); ?></a></td>
                                            <td><?php echo e($conversion->account_num); ?></td>
                                            <td><?php echo e($conversion->city); ?></td>
                                            
                                            <td><?php echo e($conversion->created_at); ?></td>
                                            <td><?php echo e($conversion->updated_at); ?></td>
                                            <td style="text-align: center;">
                                            	<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->id)); ?>">
                                            		<i class="fa fa-archive" style="text-align: left;"></i>
                                            	</a>
                                            	&nbsp; &nbsp;
                                            	<form style="display: inline;" method="POST" action="<?php echo e(url('admin/conversions/uncomplete')); ?>" onsubmit="confirm('Are you sure you want reactivate order?')">
                                            		<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                                            		<input type="hidden" name="conversionID" value="<?php echo e($conversion->id); ?>">
                                            		<button type="submit" style="border: none; background-color: transparent; padding: 0;">
                                            			<i class="fa fa-recycle" style="color: #337ab7;"></i>
                                            		</button>
                                            	</form>
                                            </td>
                                            <td>
                                            	<?php echo e($conversion->city); ?>

                                            	<?php echo e($conversion->zip); ?>

                                            	
                                            </td>
                                            <td>
                                            	<?php echo e($conversion->address); ?><br>
                                            	<?php echo e($conversion->city); ?>


                                            	
                                            </td>
                                        </tr>
                                         
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                            </div>
                     <div class="panel panel-default">
                        <div class="panel-heading">
                            Expanded Basic Conversion Customers
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example3">
                                    <thead>
                                        <tr>
                                            <th>Account</th>
                                            <th>Information</th>
                                            <th>Phone</th>
                                            <th>Order</th>
                                            <th>Status</th>
                                            <th>Completed</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0; ?>
                                    <?php foreach($todos as $conversion): ?>
                                    <?php $count++; ?>

                                    <?php if($count % 2 == 1): ?>
                                        <tr class="odd">
                                    <?php else: ?>
                                    	<tr class="even">
                                    <?php endif; ?>
											<td><?php echo e($conversion->account_num); ?></td>
											<td><?php echo $conversion->last_name == '' ? "<strong style='color: red;'>".$conversion->customer."</strong>" : $conversion->first_name . ' ' . $conversion->last_name . ' - ' . $conversion->city . ' ' . $conversion->state . ' ' . $conversion->zip; ?></td>
											<td><?php echo e($conversion->phone); ?></td>
											<td>
												<?php if($conversion_object->where('id', '=', $conversion->conversion)->exists()): ?>
													<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->conversion)); ?>" target="_blank">
													
														<?php echo e($conversion_object->find($conversion->conversion)->fname . ' ' . $conversion_object->find($conversion->conversion)->lname); ?>

													</a>
												<?php endif; ?>
											</td>
											<td><?php echo $conversion->current != '' ? $conversion->current : '<i style="color: #e2e2e2;">none</i>'; ?></td>
											<td><?php echo e($conversion->current == 'Completed' ? $conversion->updated_at : ''); ?></td>
                                        </tr>
                                        
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                            </div>
                                                 <div class="panel panel-default">
                        <div class="panel-heading">
                            Expanded Basic w/ Receiver Conversion Customers
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example4">
                                    <thead>
                                        <tr>
                                            <th>Account</th>
                                            <th>Information</th>
                                            <th>Phone</th>
                                            <th>Order</th>
                                            <th>Status</th>
                                            <th>Completed</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0; ?>
                                    <?php foreach($todosEBR as $conversion): ?>
                                    <?php $count++; ?>

                                    <?php if($count % 2 == 1): ?>
                                        <tr class="odd">
                                    <?php else: ?>
                                    	<tr class="even">
                                    <?php endif; ?>
											<td><?php echo e($conversion->account_num); ?></td>
											<td><?php echo $conversion->last_name == '' ? "<strong style='color: red;'>".$conversion->customer."</strong>" : $conversion->first_name . ' ' . $conversion->last_name . ' - ' . $conversion->city . ' ' . $conversion->state . ' ' . $conversion->zip; ?></td>
											<td><?php echo e($conversion->phone); ?></td>
											<td>
												<?php if($conversion_object->where('id', '=', $conversion->conversion)->exists()): ?>
													<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->conversion)); ?>" target="_blank">
													
														<?php echo e($conversion_object->find($conversion->conversion)->fname . ' ' . $conversion_object->find($conversion->conversion)->lname); ?>

													</a>
												<?php endif; ?>
											</td>
											<td><?php echo $conversion->current != '' ? $conversion->current : '<i style="color: #e2e2e2;">none</i>'; ?></td>
											<td><?php echo e($conversion->current == 'Completed' ? $conversion->updated_at : ''); ?></td>
                                        </tr>
                                        
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                            </div>
                                                 <div class="panel panel-default">
                        <div class="panel-heading">
                            Digital Advantage Conversion Customers
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example5">
                                    <thead>
                                        <tr>
                                            <th>Account</th>
                                            <th>Information</th>
                                            <th>Phone</th>
                                            <th>Order</th>
                                            <th>Status</th>
                                            <th>Completed</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0; ?>
                                    <?php foreach($todosDA as $conversion): ?>
                                    <?php $count++; ?>

                                    <?php if($count % 2 == 1): ?>
                                        <tr class="odd">
                                    <?php else: ?>
                                    	<tr class="even">
                                    <?php endif; ?>
											<td><?php echo e($conversion->account_num); ?></td>
											<td><?php echo $conversion->last_name == '' ? "<strong style='color: red;'>".$conversion->customer."</strong>" : $conversion->first_name . ' ' . $conversion->last_name . ' - ' . $conversion->city . ' ' . $conversion->state . ' ' . $conversion->zip; ?></td>
											<td><?php echo e($conversion->phone); ?></td>
											<td>
												<?php if($conversion_object->where('id', '=', $conversion->conversion)->exists()): ?>
													<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->conversion)); ?>" target="_blank">
													
														<?php echo e($conversion_object->find($conversion->conversion)->fname . ' ' . $conversion_object->find($conversion->conversion)->lname); ?>

													</a>
												<?php endif; ?>
											</td>
											<td><?php echo $conversion->current != '' ? $conversion->current : '<i style="color: #e2e2e2;">none</i>'; ?></td>
											<td><?php echo e($conversion->current == 'Completed' ? $conversion->updated_at : ''); ?></td>
                                        </tr>
                                        
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                            </div>
                     <div class="panel panel-default">
                        <div class="panel-heading">
                            Custom Conversion Customers <a href="<?php echo e(url('uadmin/conversions/custom')); ?>" target="_blank"> <i class="fa fa-plus fa-fw" style="float: right;"></i> </a>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example6">
                                    <thead>
                                        <tr>
                                            <th>Account</th>
                                            <th>Information</th>
                                            <th>Phone</th>
                                            <th>Order</th>
                                            <th>Status</th>
                                            <th>Completed</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <?php $count = 0; ?>
                                    <?php foreach($todosC as $conversion): ?>
                                    <?php $count++; ?>

                                    <?php if($count % 2 == 1): ?>
                                        <tr class="odd">
                                    <?php else: ?>
                                    	<tr class="even">
                                    <?php endif; ?>
											<td><?php echo e($conversion->account_num); ?></td>
											<td><?php echo $conversion->last_name == '' ? "<strong style='color: red;'>".$conversion->customer."</strong>" : $conversion->first_name . ' ' . $conversion->last_name . ' - ' . $conversion->city . ' ' . $conversion->state . ' ' . $conversion->zip; ?></td>
											<td><?php echo e($conversion->phone); ?></td>
											<td>
												<?php if($conversion_object->where('id', '=', $conversion->conversion)->exists()): ?>
													<a href="<?php echo e(url('uadmin/conversions/edit/'.$conversion->conversion)); ?>" target="_blank">
													
														<?php echo e($conversion_object->find($conversion->conversion)->fname . ' ' . $conversion_object->find($conversion->conversion)->lname); ?>

													</a>
												<?php endif; ?>
											</td>
											<td><?php echo e($conversion->current); ?></td>
											<td><?php echo e($conversion->current == 'Completed' ? $conversion->updated_at : ''); ?></td>
                                        </tr>
                                        
                                  	<?php endforeach; ?>
                                       </tbody>
                                	</table>
                                </div>
                             </div>
                            </div>
                     </div>
                 </div>


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

<?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"/>
    
    <style>
    	a:hover{
    		text-decoration: none;
    	}
    	    	.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() {
        $('#dataTables-example').dataTable( {
					"paging": false,
					"order": [ 5, 'desc' ],
					"stateSave": false,
					"columnDefs": [
					               {
					                   "targets": [ 7 ],
					                   "visible": false,
					                   "searchable": true
					               },
					           ]
        } );   
    });
    $(document).ready(function() {
        $('#dataTables-example2').dataTable( {
        			"dom":"<'floatLeft'B>fti<'floatLeft'l>p",
					"pageLength": 10,
					"order": [ 4, 'desc' ],
					"stateSave": false,
					"columnDefs": [
					               {
					                   "targets": [ 6 ],
					                   "visible": false,
					                   "searchable": true
					               },
					               {
					                   "targets": [ 7 ],
					                   "visible": false,
					                   "searchable": true
					               },
					           ],
				    "buttons": [

				              {
				                  extend: 'pdf',
				                  text: '<i class="fa fa-file-pdf-o"></i>',
				                  title: 'Conversions Archive Report',
				                  filename: 'uAdmin_Conversion_report_'+ (Math.floor(new Date().getTime()/1000)),
				                  exportOptions: {
				                      columns: [0,1,7,4]
				                  }
				              },
				              
				          ]
        } );   
    });
	var eb_table;
    $(document).ready(function() {
        $('#dataTables-example3').dataTable( {
					"pageLength": 10,
					"order": [ 5, 'desc' ],
					"stateSave": false
        } ); 
        eb_table = $('#dataTables-example3').DataTable(); 
        eb_table.on( 'search.dt', function () {
            	
        	 updateRemaining();
        } );
       
    });
    $(document).ready(function() {
        $('#dataTables-example4').dataTable( {
					"pageLength": 10,
					"order": [ 5, 'desc' ],
					"stateSave": false
        } );   
    });
    $(document).ready(function() {
        $('#dataTables-example5').dataTable( {
					"pageLength": 10,
					"order": [ 5, 'desc' ],
					"stateSave": false
        } );   
    });
    $(document).ready(function() {
        $('#dataTables-example6').dataTable( {
					"pageLength": 10,
					"order": [ 5, 'desc' ],
					"stateSave": false
        } );   
    });
    function updateRemaining()
    {
    	var completed = eb_table
        .column( 4 )
        .data()
        .filter( function ( value, index ) {
            return value == 'Completed' ? true : false;
        } );  
        var none = eb_table
        .column( 4 )
        .data()
        .filter( function ( value, index ) {
            return value == '<i style="color: #e2e2e2;">none</i>' ? true : false;
        } );  
        console.log(completed.length);
        console.log(none.length);
    }
    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'
        } );
    }

    function boxes()
    {
        var totalOrders = <?php echo e($countA); ?>;
        var selected = 0;
        var remaining = 10;
		document.getElementById('print_container').style.display = "";

		for(var i = 1; i <= totalOrders; i++)
		{
			var order = document.getElementById('boxes'+i);
			if(order.checked)
			{
				selected += +order.value;
				remaining -= +order.value;
				document.getElementById('orders' + order.getAttribute('conversion')).value = 1;
				
			}
			else
			{
				document.getElementById('orders' + order.getAttribute('conversion')).value = '';
				
			}
			
		}

		document.getElementById('selected').innerHTML = selected;
		document.getElementById('remaining').innerHTML = remaining;

		return;
    }

    function routes()
    {
        var totalOrders = <?php echo e($countA); ?>;
        var selected = 0;

		document.getElementById('route_container').style.display = "";

		for(var i = 1; i <= totalOrders; i++)
		{
			var order = document.getElementById('Raddresses'+i);
			if(order.checked)
			{
				selected += +order.value;
				
				document.getElementById('routes' + order.getAttribute('conversion')).value = 1;
				
			}
			else
			{
				document.getElementById('routes' + order.getAttribute('conversion')).value = '';
				
			}
			
		}

		document.getElementById('Rselected').innerHTML = selected;


		return;
    }


    var element = document.querySelector("form");
    element.addEventListener("submit", function(event) {
      event.preventDefault();
      var selected = document.getElementById('selected').innerHTML;
		
		if(selected > 10)
		{
			alert('No more than 10 box labels can be printed at once.');
			return false;
		}
		else
		{
			element.submit();
			return true;
		}
    });
    </script> 

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




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