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

			<div class="row">
		    	<div class="col-lg-12">
		    		<h4 class="page-header">Edit Order</h4>
		    	</div>
		    </div>
            <div 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>
			</div> 	
		<form class="form-horizontal" method="post" action="<?php echo e(url('admin/orders/edit')); ?>" onsubmit="noDouble(); return true;">
			<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">	
			<input type="hidden" name="orderID" value="<?php echo e($order->id); ?>">
			<div class="row">
				<div class="panel-group col-md-12" id="accordion" role="tablist" aria-multiselectable="true"> 
					<div class="panel panel-default">
					    <div class="panel-heading" role="tab" id="heading1" style="">
					      <h4 class="panel-title">
					        <div id="group_section1" class="accordian-item"  style="color: #317aba; "
					        role="button" data-toggle="collapse" 
					        href="#collapse1" aria-expanded="true" 
					        aria-controls="collapse1" onclick="chevron(1)" ondblclick="chevron(1)">
					          <i id="chevron1" class="fa fa-chevron-circle-down"></i> &nbsp;Customer Information
					        </div>
					      </h4>
					    </div>
					    <div id="collapse1" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading1">
					        <div class="panel-body">
								<div class="col-md-12">
									<div class="rowx">
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('first_name')">
													<input type="text" class="form-control" id="first_name" name="first_name" value="<?php echo e(old('first_name') ? old('first_name') : $order->first_name); ?>" title="First Name"
													<?php if($errors->first('first_name') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="first_name-label" class="label-text">First Name</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('last_name')">
													<input type="text" class="form-control" id="last_name" name="last_name" value="<?php echo e(old('last_name') ? old('last_name') : $order->last_name); ?>" title="Last Name"
													<?php if($errors->first('last_name') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="last_name-label" class="label-text">Last Name</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('spoke_to')">
													<input type="text" class="form-control" id="spoke_to" name="spoke_to" value="<?php echo e(old('spoke_to') ? old('spoke_to') : $order->spoke_to); ?>" title="Spoke To"
													<?php if($errors->first('spoke_to') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="spoke_to-label" class="label-text">Spoke To</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('billing_address')">
													<input type="text" class="form-control" id="billing_address" name="billing_address" value="<?php echo e(old('billing_address') ? old('billing_address') : $order->billing_address); ?>" title="Billing Address"
													<?php if($errors->first('billing_address') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="billing_address-label" class="label-text">Billing Address</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('billing_city')">
													<input type="text" class="form-control" id="billing_city" name="billing_city" value="<?php echo e(old('billing_city') ? old('billing_city') : $order->billing_city); ?>" title="City"
													<?php if($errors->first('billing_city') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="billing_city-label" class="label-text">City</span>	
												</div>
												<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus('billing_state')">
													<input type="text" class="form-control" id="billing_state" name="billing_state" value="<?php echo e(old('billing_state') ? old('billing_state') : $order->billing_state); ?>" title="State"
													<?php if($errors->first('billing_state') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="billing_state-label" class="label-text">State</span>	
												</div>
												<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus('billing_zip')">
													<input type="text" class="form-control" id="billing_zip" name="billing_zip" value="<?php echo e(old('billing_zip') ? old('billing_zip') : $order->billing_zip); ?>" title="Zip Code"
													<?php if($errors->first('billing_zip') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="billing_zip-label" class="label-text">Zip Code</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
									      		<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('contact_phone')">
													<input type="text" class="form-control" id="contact_phone" name="contact_phone" value="<?php echo e(old('contact_phone') ? old('contact_phone') : $order->contact_phone); ?>" title="Contact Phone"
													<?php if($errors->first('contact_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="contact_phone-label" class="label-text">Contact Phone</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('home_phone')">
													<input type="text" class="form-control" id="home_phone" name="home_phone" value="<?php echo e(old('home_phone') ? old('home_phone') : $order->home_phone); ?>" title="Home Phone"
													<?php if($errors->first('home_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="home_phone-label" class="label-text">Home Phone</span>	
												</div>
												
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('work_phone')">
													<input type="text" class="form-control" id="work_phone" name="work_phone" value="<?php echo e(old('work_phone') ? old('work_phone') : $order->work_phone); ?>" title="Work Phone"
													<?php if($errors->first('work_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="work_phone-label" class="label-text">Work Phone</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
									      		<div class="col-md-4 morePadding morePadding2" onclick="inputFocus('type')">
													<select class="form-control" id="type" name="type" onchange="toggleType()"
													<?php if($errors->first('type') != ''): ?>
														style="border: 1px solid red;"
														<?php endif; ?>
														>
														<option value="Residential"
														<?php echo e(old('type') == 'Residential' ? 'selected' : $order->type == 'Residential' ? 'selected' : ''); ?>

														>Residential</option>
														<option value="Business"
														<?php echo e(old('type') == 'Business' ? 'selected' : $order->type == 'Business' ? 'selected' : ''); ?>

														>Business</option>
													</select>
													<span id="type-label" 
													<?php if(old('placed_order')): ?>
													class="xlabel-text hasValue"
													<?php else: ?>
													class="xlabel-text hasValue"
													<?php endif; ?>
													>Customer Type</span>
												</div>
									      		<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('spouse_name')">
													<input type="text" class="form-control" id="spouse_name" name="spouse_name" value="<?php echo e(old('spouse_name') ? old('spouse_name') : $order->spouse_name); ?>" title="Spouse Name"
													<?php if($errors->first('spouse_name') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="spouse_name-label" class="label-text">Alternate Person</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('email')">
													<input type="email" class="form-control" id="email" name="email" value="<?php echo e(old('email') ? old('email') : $order->email); ?>" title="Email"
													<?php if($errors->first('email') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													onblur="confidentialEmailCheck()" 
													>
													<span id="email-label" class="label-text">Email</span>	
												</div>

											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('place_of_employment')">
													<input type="text" class="form-control" id="place_of_employment" name="place_of_employment" value="<?php echo e(old('place_of_employment') ? old('place_of_employment') : $order->place_of_employment); ?>" title="Place of Employment"
													<?php if($errors->first('place_of_employment') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="place_of_employment-label" class="label-text">Place of Employment</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('employer_phone')">
													<input type="text" class="form-control date" id="employer_phone" name="employer_phone" value="<?php echo e(old('employer_phone') ? old('employer_phone') : $order->employer_phone); ?>" title="Employer Phone Number"
													<?php if($errors->first('employer_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="employer_phone-label" class="label-text">Employer Phone</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('confidential_email')">
													<input type="email" class="form-control" id="confidential_email" name="confidential_email" value="<?php echo e(old('confidential_email') ? old('confidential_email') : $order->confidential_email); ?>" title="Confidential Email"
													<?php if($errors->first('confidential_email') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="confidential_email-label" class="label-text">Confidential Email</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
									      		<?php if($order->ssn_last_four != ''): ?>
									      		<input type="hidden" name="ssn_last_four" value="<?php echo e(\Crypt::decrypt($order->ssn_last_four)); ?>">
												<div class="col-xs-11 col-md-5 morePadding morePadding2" onclick="inputFocus('ssn_last_four')">
													<input type="text" class="form-control" id="ssn_last_four" name="ssn_last_fourx" value="<?php echo e(old('ssn_last_four') ? old('ssn_last_four') : '*****'.\Crypt::decrypt($order->ssn_last_four)); ?>" title="Social Security Number"
													<?php if($errors->first('ssn_last_four') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													disabled
													>
													<span id="ssn_last_four-label" class="label-text">Social Security Number</span>	
												</div>
												<div class="col-xs-1 col-md-1 morePadding morePadding2">
													<i 
														class="fa fa-times-circle fa-lg"
														title="Clear Social Security Number"
														style="cursor: pointer; margin-left: -20px; margin-top: 10px; color:#317aba;"
														onclick="clearSSN()"
													></i>
												</div>
												<?php else: ?>
												<div class="col-xs-12 col-md-6 morePadding morePadding2" onclick="inputFocus('ssn')">
													<input type="text" class="form-control" id="ssn" name="ssn" value="<?php echo e(old('ssn') ? old('ssn') : ''); ?>" title="Social Security Number"
													<?php if($errors->first('ssn') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="ssn-label" class="label-text">Social Security Number</span>	
												</div>
												<?php endif; ?>
												<div class="col-xs-12 col-md-6 morePadding morePadding2" id="dob_container" onclick="inputFocus('date_of_birth')">
													<input type="text" class="form-control date" id="date_of_birth" name="date_of_birth" value="<?php echo e(old('date_of_birth') ? old('date_of_birth') : $order->date_of_birth); ?>" title="Date of Birth"
													<?php if($errors->first('date_of_birth') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="date_of_birth-label" class="label-text">Date of Birth</span>	
												</div>
												
											</div>
										</div>
										
									</div>
								</div>
							</div>
						</div>
					</div>

 
					<div class="panel panel-default">
					    <div class="panel-heading" role="tab" id="heading2" style="">
					      <h4 class="panel-title">
					        <div id="group_section2" class="accordian-item"  style="color: #317aba; "
					        role="button" data-toggle="collapse" 
					        href="#collapse2" aria-expanded="false" 
					        aria-controls="collapse2" onclick="chevron(2)" ondblclick="chevron(2)">
					          <i id="chevron2" class="fa fa-chevron-circle-down"></i> &nbsp;Installation Information
					        </div>
					      </h4>
					    </div>
					    <div id="collapse2" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading2">
					        <div class="panel-body">
								<div class="col-md-12">
									<div class="rowx">
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('install_address')">
													<input type="text" class="form-control" id="install_address" name="install_address" value="<?php echo e(old('install_address') ? old('install_address') : $order->install_address); ?>" title="Install Address"
													<?php if($errors->first('install_address') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="install_address-label" class="label-text">Install Address &nbsp; <i class="fa fa-copy" onclick="copyAddress()" style="cursor: pointer;"></i></span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('install_city')">
													<input type="text" class="form-control" id="install_city" name="install_city" value="<?php echo e(old('install_city') ? old('install_city') : $order->install_city); ?>" title="City"
													<?php if($errors->first('install_city') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="install_city-label" class="label-text">City</span>	
												</div>
												<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus('install_state')">
													<input type="text" class="form-control" id="install_state" name="install_state" value="<?php echo e(old('install_state') ? old('install_state') : $order->install_state); ?>" title="State"
													<?php if($errors->first('install_state') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="install_state-label" class="label-text">State</span>	
												</div>
												<div class="col-sm-12 col-md-2 morePadding morePadding2" onclick="inputFocus('install_zip')">
													<input type="text" class="form-control" id="install_zip" name="install_zip" value="<?php echo e(old('install_zip') ? old('install_zip') : $order->install_zip); ?>" title="Zip Code" onchange="checkInstallZip()"
													<?php if($errors->first('install_zip') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="install_zip-label" class="label-text">Zip Code</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('cc_phone')">
													<input type="text" class="form-control" id="cc_phone" name="cc_phone" value="<?php echo e(old('cc_phone') ? old('cc_phone') : $order->cc_phone); ?>" title="CentraCom Phone"
													<?php if($errors->first('cc_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="cc_phone-label" class="label-text">CentraCom Phone</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('alternate_phone')">
													<input type="text" class="form-control" id="alternate_phone" name="alternate_phone" value="<?php echo e(old('alternate_phone') ? old('alternate_phone') : $order->alternate_phone); ?>" title="Alternative Phone"
													<?php if($errors->first('alternate_phone') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="alternate_phone-label" class="label-text">Alternate Phone</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" id="install_date_container" onclick="inputFocus('install_date')">
													<input type="text" class="form-control date" id="install_date" name="install_date" value="<?php echo e(old('install_date') ? old('install_date') : $order->install_date != '' && strtotime($order->install_date) != 0 ? date('Y-m-d', strtotime($order->install_date)) : ''); ?>" title="Install Date"
													<?php if($errors->first('install_date') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="install_date-label" class="label-text">Install Date</span>	
												</div>
											</div>
										</div>
										<div class="form-group">
									      	<div class="row">
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('username')">
													<input type="text" class="form-control" id="username" name="username" value="<?php echo e(old('username') ? old('username') : $order->username); ?>" title="Username"
													<?php if($errors->first('username') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="username-label" class="label-text">Username</span>	
												</div>
												<div class="col-sm-12 col-md-4 morePadding morePadding2" onclick="inputFocus('password')">
													<input type="text" class="form-control" id="password" name="password" value="<?php echo e(old('password') ? old('password') : $order->password); ?>" title="Password"
													<?php if($errors->first('password') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<span id="password-label" class="label-text">Password</span>	
												</div>
												<label class="col-xs-6 col-sm-6 col-md-2 control-label morePadding morePadding2" style="color: #317aba; opacity: .8; font-weight: 400;">Agreement</label>
												<div class="col-xs-6 col-sm-6 col-md-2 morePadding morePadding2"
												<?php if($errors->first('agreement') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>	
													<input type="checkbox" class="form-control" id="agreement" name="agreement" value="1" title="Agreement" <?php echo e(old('agreement') == 1 ? 'checked' : $order->agreement == 1 ? 'checked' : ''); ?>

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


					<div class="panel panel-default">
					    <div class="panel-heading" role="tab" id="heading3" style="">
					      <h4 class="panel-title">
					        <div id="group_section3" class="accordian-item"  style="color: #317aba; "
					        role="button" data-toggle="collapse"  
					        href="#collapse3" aria-expanded="false" 
					        aria-controls="collapse3" onclick="chevron(3)" ondblclick="chevron(3)">
					          <i id="chevron3" class="fa fa-chevron-circle-down"></i> &nbsp;Services
					        </div>
					      </h4>
					    </div>
					    <div id="collapse3" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading3">
					        <div class="panel-body">
										<?php $groupCount1 = 0; ?>
										<div class="panel-group col-md-6">
											<?php foreach($groups as $group): ?>
											<?php if(count($group->services) > 0): ?>
												<?php $groupCount1++; ?>
											  <div class="panel panel-default" onclick="showServiceGroup(<?php echo e($groupCount1); ?>)">
											    <div class="panel-heading" id="groupHeading<?php echo e($groupCount1); ?>">
											      <h4 class="panel-title">
											        <div class="accordian-item"  style="color: #317aba;">
											          <?php echo e($group->name); ?> 
											        </div>
											      </h4>
											    </div>
											    
											     
											    
											  </div>
											<?php endif; ?>
											<?php endforeach; ?>
			
										</div>
										<?php $groupCount2 = 0; 
												$serviceArray = array(); 
										?> 
										<div class="panel-group col-md-6" >
											<?php foreach($groups as $group): ?>
											<?php if(count($group->services) > 0): ?>
												<?php $groupCount2++; ?>
											  <div class="panel panel-default" id="services<?php echo e($groupCount2); ?>" style="display: none;">
											    
											      <div class="panel-body servicesList">
											      	
											      	<?php if($group->name == "Telephone"): ?>
											      		<?php foreach($tel_rates as $key => $value): ?>
												      		<div class="form-group serviceGroup hiddenTel" id="tel<?php echo e($key); ?>"
							      								style="background-color: #f2faff; display: none;"
							      							>

																<label class="col-xs-12 col-sm-12 col-md-12 xcontrol-label XmorePadding serviceItems" style="color: #317aba; opacity: .8; font-weight: 400;">
																	<input type="checkbox" class="xform-control hiddenTelInput" id="service_<?php echo e($group->id); ?>-tel<?php echo e($key); ?>" sid="pots" zip="<?php echo e($key); ?>" name="tel[<?php echo e($key); ?>]" billing="monthly" value="<?php echo e($value); ?>" 
																						priority="1" title="Telephone Service for <?php echo e($key); ?>" onchange="selectedService('service_<?php echo e($group->id); ?>-tel<?php echo e($key); ?>')" <?php echo e($order->install_zip == $key && $pots ? 'checked' : ''); ?>>
																	&nbsp;<i style="color: #666; font-weight: 400;">Telephone Service for <?php echo e($key); ?></i>&nbsp;&mdash;&nbsp;$<?php echo e($value); ?>

																</label>
															</div>
											      		<?php endforeach; ?>
											      	<?php endif; ?>
											      	
											      	<?php $oddCount = 1; ?>
											      	<?php foreach($group->services as $key => $value): ?>
											      
											      	<?php $oddCount++; ?>
											      		<div class="form-group serviceGroup <?php echo e($value->type); ?>"  
											      			<?php if($oddCount % 2 == 1): ?>
						      								style="background-color: #f2faff;"
						      								<?php endif; ?>
						      							>
																
																
																
															
															<label class="col-xs-12 col-sm-12 col-md-12 xcontrol-label XmorePadding serviceItems" style="color: #317aba; opacity: .8; font-weight: 400;">
																<input type="checkbox" class="xform-control" id="service_<?php echo e($group->id); ?>-<?php echo e($key); ?>" sid="<?php echo e($key); ?>" name="services[<?php echo e($key); ?>]" billing="<?php echo e($value->billing_type); ?>" value="<?php echo e($value->price); ?>" 
																					priority="<?php echo e($value->priority); ?>" title="<?php echo e($value->name); ?>" onchange="selectedService('service_<?php echo e($group->id); ?>-<?php echo e($key); ?>')" <?php echo e(old('services.'.$key) ? 'checked' : array_key_exists($key, $ordered_services) ? 'checked' : ''); ?>>
																&nbsp;<i style="color: #666; font-weight: 400;"><?php echo e($value->name); ?></i>&nbsp;&mdash;&nbsp;$<?php echo e($value->price); ?>

																<?php if($key >= 39 && $key <= 40 || $key == 42): ?>
																<input type="number" id="quantity_service_<?php echo e($group->id); ?>-<?php echo e($key); ?>" name="quantity[<?php echo e($key); ?>]" placeholder="Quantity" style="float: right;" value="<?php echo e(old('quantity.'.$key) ? old('quantity.'.$key) : array_key_exists($key, $quantities) ? $quantities[$key] : ''); ?>" min="0" xonchange="selectedService('service_<?php echo e($group->id); ?>-<?php echo e($key); ?>', true)" onkeyup="selectedService('service_<?php echo e($group->id); ?>-<?php echo e($key); ?>', true)">
																<?php endif; ?>
															</label>
														</div>
													<?php 
													if(old('services.'.$key) || array_key_exists($key, $ordered_services))
													{
														array_push($serviceArray, 'service_'.$group->id.'-'.$key);
													}
													
													?>
											      	<?php endforeach; ?>
											      	
											      </div>
											    
											  </div>
											<?php endif; ?>
											<?php endforeach; ?>
											<i id="showing" class="disclaim"></i> &nbsp; &nbsp; <a id="show_all" onclick="toggleServiceType('all')">Show All</a>
										</div>
									</div>
								</div>
							</div>



					<div class="panel panel-default">
					    <div class="panel-heading" role="tab" id="heading4" style="">
					      <h4 class="panel-title">
					        <div id="group_section4" class="accordian-item"  style="color: #317aba; "
					        role="button" data-toggle="collapse" 
					        href="#collapse4" aria-expanded="false" 
					        aria-controls="collapse4" onclick="chevron(4)" ondblclick="chevron(4)">
					          <i id="chevron4" class="fa fa-chevron-circle-down"></i> &nbsp;Notes & Miscellaneous
					        </div>
					      </h4>
					    </div>
					    <div id="collapse4" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading4">
					        <div class="panel-body">
								<div class="col-md-12">
									<div class="rowx">
										<div class="form-group">
											<div class="col-md-3 morePadding morePadding2" onclick="inputFocus('ad_media')">
												<select class="form-control" id="ad_media" name="ad_media"
												<?php if($errors->first('ad_media') != ''): ?>
												style="border: 1px solid red;"
												<?php endif; ?>
													>
													<option></option>
													<option value="Social Media"
													<?php echo e($order->ad_media == 'Social Media' ? 'selected' : ''); ?>

													>Social Media</option>
													<option value="Billboard"
													<?php echo e($order->ad_media == 'Billboard' ? 'selected' : ''); ?>

													>Billboard</option>
													<option value="Service Project"
													<?php echo e($order->ad_media == 'Service Project' ? 'selected' : ''); ?>

													>Service Project</option>
													<option value="CSR"
													<?php echo e($order->ad_media == 'CSR' ? 'selected' : ''); ?>

													>CSR</option>
													<option value="Direct Mail"
													<?php echo e($order->ad_media == 'Direct Mail' ? 'selected' : ''); ?>

													>Direct Mail</option>
													<option value="Email"
													<?php echo e($order->ad_media == 'Email' ? 'selected' : ''); ?>

													>Email</option>
													<option value="Internet"
													<?php echo e($order->ad_media == 'Internet' ? 'selected' : ''); ?>

													>Internet</option>
													<option value="Newspaper"
													<?php echo e($order->ad_media == 'Newspaper' ? 'selected' : ''); ?>

													>Newspaper</option>
													<option value="Other"
													<?php echo e($order->ad_media == 'Other' ? 'selected' : ''); ?>

													>Other</option>
													<option value="Radio"
													<?php echo e($order->ad_media == 'Radio' ? 'selected' : ''); ?>

													>Radio</option>
													<option value="Salesman"
													<?php echo e($order->ad_media == 'Salesman' ? 'selected' : ''); ?>

													>Salesman</option>
													<option value="Telemarket"
													<?php echo e($order->ad_media == 'Telemarket' ? 'selected' : ''); ?>

													>Telemarket</option>
													<option value="Truck"
													<?php echo e($order->ad_media == 'Truck' ? 'selected' : ''); ?>

													>Truck</option>
													<option value="Word of Mouth"
													<?php echo e($order->ad_media == 'Word of Mouth' ? 'selected' : ''); ?>

													>Word of Mouth</option>
													<option value="Yellow Pages"
													<?php echo e($order->ad_media == 'Yellow Pages' ? 'selected' : ''); ?>

													>Yellow Pages</option>
													<option value="Referral"
													<?php echo e($order->ad_media == 'Referral' ? 'selected' : ''); ?>

													>Referral</option>
												</select>
												<span id="ad_media-label" 
												<?php if($order->ad_media): ?>
												class="xlabel-text hasValue"
												<?php else: ?>
												class="label-text"
												<?php endif; ?>
												>Ad Media</span>	
											</div>
											
											<div class="col-md-3 morePadding morePadding2" onclick="inputFocus('media_detail')">
												<input type="text" class="form-control" id="media_detail" name="media_detail" value="<?php echo e(old('media_detail') ? old('media_detail') : $order->media_detail); ?>" title="Media Detail"
												<?php if($errors->first('media_detail') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>	
												<span id="media_detail-label" class="label-text">Media Detail</span>
											</div>
											<div class="col-md-3 morePadding morePadding2" onclick="inputFocus('placed_order')">
												<select class="form-control" id="placed_order" name="placed_order"
												<?php if($errors->first('placed_order') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
													<option></option>
													<option value="Online"
													<?php echo e($order->placed_order == 'Online' ? 'selected' : ''); ?>

													>Online</option>
													<option value="In Person"
													<?php echo e($order->placed_order == 'In Person' ? 'selected' : ''); ?>

													>In Person</option>
													<option value="Phone"
													<?php echo e($order->placed_order == 'Phone' ? 'selected' : ''); ?>

													>Phone</option>
												</select>
												<span id="placed_order-label" 
												<?php if($order->placed_order): ?>
												class="xlabel-text hasValue"
												<?php else: ?>
												class="label-text"
												<?php endif; ?>
												>Placed Order</span>
											</div>
											<div class="col-md-3 morePadding morePadding2" onclick="inputFocus('assigned')">
												<select class="form-control" id="assigned" name="assigned"
												<?php if($errors->first('assigned') != ''): ?>
													style="border: 1px solid red;"
												<?php endif; ?>
													>
													<option></option>
													<?php foreach(\App\User::whereIn('id',\App\Permission::where('action','=',14)->where('allow','=',1)->lists('user'))->orderBy('name','asc')->get() as $user): ?>
														<option value="<?php echo e($user->id); ?>"
														<?php echo e($order->assigned == $user->id ? 'selected' : ''); ?>

														><?php echo e($user->name); ?></option>
													<?php endforeach; ?>
												</select>
												<span id="assigned-label" 
												<?php if($order->assigned): ?>)
												class="xlabel-text hasValue"
												<?php else: ?>
												class="label-text"
												<?php endif; ?>
												>Assigned CSR</span>
											</div>
										</div>
										<div class="form-group">
											<div class="col-md-4 morePadding morePadding2" onclick="inputFocus('account_num')">
												<input type="text" class="form-control" id="account_num" name="account_num" value="<?php echo e(old('account_num') ? old('account_num') : $order->account_num); ?>" title="Account Number"
												<?php if($errors->first('account_num') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>	
												<span id="account_num-label" class="label-text">Account #</span>
											</div>
											<div class="col-md-4 morePadding morePadding2" onclick="inputFocus('credit_score')">
												<input type="text" class="form-control" id="credit_score" name="credit_score" value="<?php echo e(old('credit_score') ? old('credit_score') : $order->credit_score); ?>" title="Credit Score"
												<?php if($errors->first('credit_score') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
												<span id="credit_score-label" class="label-text">Credit Score</span>	
											</div>
											<div class="col-md-4 morePadding morePadding2" onclick="inputFocus('service_order_num')">
												<input type="text" class="form-control" id="service_order_num" name="service_order_num" value="<?php echo e(old('service_order_num') ? old('service_order_num') : $order->service_order_num); ?>"  title="Service Order Number"
												<?php if($errors->first('service_order_num') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													>
												<span id="service_order_num-label" class="label-text">Service Order #</span>	
											</div>
										</div>
										<div class="form-group">
											<div class="col-md-6 morePadding morePadding2" onclick="inputFocus('customer_notes')">
												<textarea rows="3" class="form-control" id="customer_notes" name="customer_notes" placeholder="Customer Notes" title="Customer Notes"
												<?php if($errors->first('customer_notes') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													><?php echo e(old('customer_notes') ? old('customer_notes') : $order->customer_notes); ?></textarea>
											</div>
											<div class="col-md-6 morePadding morePadding2" onclick="inputFocus('internal_notes')">
												<textarea rows="3" class="form-control" id="internal_notes" name="internal_notes" placeholder="Internal Notes" title="Internal Notes"
												<?php if($errors->first('internal_notes') != ''): ?>
													style="border: 1px solid red;"
													<?php endif; ?>
													><?php echo e(old('internal_notes') ? old('internal_notes') : $order->internal_notes); ?></textarea>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="panel-group col-md-12">
					<div class="panelX panel-defaultX" style="border: 0 solid black;">
					    <div class="panel-bodyX">
							<div class="form-group">
								<div class="col-sm-12 col-md-4 morePadding morePadding2">
									<input type="submit" class="btn btn-primary cta" name="submit" value="Save">
									<i class="fa fa-spinner fa-spin fa-3x fa-fw cta-loading" style="display: none;"></i>
								</div>
								
								<div class="panel-group col-sm-12 col-md-4 morePadding morePadding2">
								  <div class="panel panel-default">
								    <div class="panel-heading">
								      <h4 class="panel-title">Selected Services</h4>
								    </div>
								    <div class="panel-body">
								    	<ul class="list-group" id="selectedServices" style="font-size: .8em;">
							
								    	</ul>
								    	<ul class="list-group" id="selectedServicesTotals" style="font-size: .8em;">
								    		<li class="list-group-item noFloat otherStuff" style="text-align: left; float: none; border-radius: 0; border-top: 1px solid #ccc;" id="subX">
								    			<div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left; font-weight: 400;">
													Monthly Subtotal
												</div> 
												<div id="sub_total" class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right; font-weight: 400;">
													$0.00
												</div>
								    		</li>
								    		<li class="list-group-item noFloat otherStuff" style="text-align: left; float: none; border-radius: 0;" id="discountX">
								    			<div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left; font-weight: 400;">
													Bundle Discount
												</div> 
												<div id="discount_total" class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right; font-weight: 400; display: inline;">
													$0.00
												</div>
								    		</li>
								    		<li class="list-group-item noFloat otherStuff" style="text-align: left; float: none; border-radius: 0; border-top: 1px solid #ccc;" id="monthX">
								    			<div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left; font-weight: 600;">
													Monthly Total
												</div> 
												<div id="monthly_total" class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right; font-weight: 600;">
													$0.00
												</div>
								    		</li>
								    		<li class="list-group-item noFloat otherStuff" style="text-align: left; float: none; padding-top: 5px;" id="oneX">
								    			<i><div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left; font-weight: 600;">
													One Time Total
												</div>
												<div id="one_time_total" class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right; font-weight: 600;">
													$0.00
												</div></i>
								    		</li>
								    	</ul>
								    </div>
								  </div>
								</div>
								<div class="col-sm-12 col-md-4 morePadding morePadding2">

									<?php if($order->fixed_wireless === null && $order->hasFixedWireless()): ?>
										<input type="submit" class="btn btn-default" name="submit" value="Request CentraWave Survey" style="float: right;">
									<?php elseif(!$order->hasFixedWireless() || $order->fixed_wireless !== 0): ?>

										<input type="submit" class="btn btn-primary cta" name="submit" value="Complete" style="float: right;">
									<?php endif; ?>

									<?php if($order->fixed_wireless === 1): ?>
                                        <i 
                                            class="fa fa-info-circle" 
                                            style="color: green; cursor: pointer; float: right; margin: 10px;" 
                                            title="CentraWave Available" 
                                            onclick="alert('<?php echo e($order->fixed_wireless_by); ?> has determined that CentraWave is available for this customer.');">     
                                        </i>
                                    <?php elseif($order->fixed_wireless === 0): ?>
                                        <i 
                                            class="fa fa-info-circle" 
                                            style="color: red; cursor: pointer; float: right; margin: 10px;" 
                                            title="CentraWave Unavailable" 
                                            onclick="alert('<?php echo e($order->fixed_wireless_by); ?> has determined that CentraWave is UNAVAILABLE for this customer.');">
                                        </i>
                                    <?php endif; ?>
								</div>
							</div>
						</div>
				    </div>
				</div>
			</div>
		</form>

		<form 
			id="clear-ssn-form"
			method="post" 
			action="<?php echo e(url('admin/orders/clearS')); ?>" 
		>
			<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
			<input type="hidden" name="orderID" value="<?php echo e($order->id); ?>">
		</form>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('extras'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/bootstrap-datepicker3.min.css')); ?>" />
	<meta name="csrf-token" value="<?php echo e(csrf_token()); ?>">
	<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: 1.5rem;
		    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;
		    color: #317aba;
		}
		.hasValue
		{
		    font-weight: normal;
		    padding: 0;
		    padding-left: 20px;
		    -webkit-transform: translateY(-2rem) scale(.7);
		    transform: translateY(-2rem) scale(.7);    
		}
		
		.moveOver
		{
			padding-left: 9px;
			padding-bottom: 5px;
			padding-top: 5px;
			margin-bottom: 15px;
			font-weight: normal;
			border: none;
			border-radius: 10px;
			background-color: #eee;
			width: 100%;
		}
		

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

		@media (min-width: 960px)
		{
			.morePadding {
			    margin-top: 1em;
			}
		}
		
		.accordion-ts {float: right; color: #888; margin-top: -20px; font-weight: normal; font-size: 14px;}
		
		.accordian-item{
			cursor: pointer;
		}
		
		.serviceGroup {
			margin-bottom: 0;
		}
			
		.noFloat{
			clear: left;
			border: none;
		}
		
		.otherStuff {
			padding-top: 0;
			padding-left: 0;
			margin-left: 0;
		}
		
		.servicesList {
			max-height: 500px;
			overflow: scroll;
		}
		
	</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('bottom'); ?>
<script src="<?php echo e(asset('js/bootstrap-datepicker.min.js')); ?>"></script>
<script>
	function inputFocus(id)
	{
		document.getElementById(id).focus();
	}

	function chevron(group_id)
	{
		
		

		var chev = document.getElementById('chevron'+group_id);
		var state = chev.className.indexOf('right');
			
		if(state > -1)
		{
			chev.className = '';
			chev.className = 'fa '+'fa-chevron-circle-down';
		}
		else
		{
			chev.className = '';
			chev.className = 'fa '+'fa-chevron-circle-right';
		}

	}

	function clearSSN()
	{
		if(confirm('Please save all other changes to this order before proceeding. This action will permanently clear the social security number attached to this order. A new social security number will need to be entered before this order can be completed. Continue?'))
		{
			document.getElementById('clear-ssn-form').submit();
		}
	}
</script>

<script>
	$('.form-control').each(function() {
	   var elem = $(this);

	   // Save current value of element
	   elem.data('oldVal', elem.val());

	   // Look for changes in the value
	   elem.bind("propertychange change click keyup input paste", function(event){
	      // If value has changed...
	      if (elem.data('oldVal') != elem.val()) {
	       // Updated stored value
	       elem.data('oldVal', elem.val());
	       var elem2 = $('#'+elem.attr('id')+"-label");
	       elem2.addClass('hasValue');
	       elem2.removeClass('label-text');
	       if(elem.val() == "")
	       {
		       
	    	   elem2.addClass('label-text');
		       elem2.removeClass('hasValue');
	       }
	     }
	   });
	 });

	$('#install_date_container .date').datepicker({
        'format': 'yyyy-mm-dd',
        'autoclose': true
    });

	var monthly = 0.00;
	var onetime = 0.00;

	var selectedServices = {};
	var firstAjax = false;
	function selectedService(id, q)
	{
		
		if (typeof(q)==='undefined') q = false;
		
		var serviceQuantity = document.getElementById('quantity_'+id);
		var serviceCheckbox = document.getElementById(id);
		var sid = serviceCheckbox.getAttribute("sid");

		if(sid == 'pots')
		{
			if(serviceCheckbox.checked)
			{
				selectedServices[sid] = serviceCheckbox.getAttribute("zip");
			}
			else
			{
				delete selectedServices[sid];
			}
		}
		else
		{
			if(serviceQuantity == null && serviceCheckbox.checked)
			{
				selectedServices[sid] = 1;
			}
			else if(serviceQuantity != null && serviceCheckbox.checked)
			{
				var serviceQuantity = document.getElementById('quantity_'+id);
				if(serviceQuantity.value == '')
				{
					serviceQuantity.value = 1;
				}
				selectedServices[sid] = serviceQuantity.value;
			}
			else
			{
				selectedServices[sid] = 0;
			}
		}
		
		
		if(firstAjax)
		{
			ajaxServices();
		}
		//console.log(selectedServices);
		
	}

	function showServiceGroup(num)
	{
		var heading = document.getElementById('groupHeading'+num);
		var services = document.getElementById('services'+num);
		var totalGroups = <?php echo e($groupCount2); ?>;

		for(i = 1; i <= totalGroups; i++)
		{
			document.getElementById('groupHeading'+i).style.background = '#f5f5f5';
			document.getElementById('services'+i).style.display = 'none';
		}
		
		services.style.display = "";
		heading.style.background = '#e6e6e6';
	}

	function sortList(ul){
	    var new_ul = ul.cloneNode(false);

	    var lis = [];
	    for(var i = ul.childNodes.length; i--;){
	        if(ul.childNodes[i].nodeName === 'LI')
	            lis.push(ul.childNodes[i]);
	    }

	    lis.sort(function(b, a){
	      return (a.getAttribute('priority') === b.getAttribute('priority') ? 0 : a.getAttribute('priority') < b.getAttribute('priority') ? 1 : -1); 
	       
	             
	    });



	    for(var i = 0; i < lis.length; i++)
	        new_ul.appendChild(lis[i]);
	    ul.parentNode.replaceChild(new_ul, ul);
	}

	function copyAddress()
	{
		var billing_address = document.getElementById('billing_address');
		var billing_city = document.getElementById('billing_city');
		var billing_state = document.getElementById('billing_state');
		var billing_zip = document.getElementById('billing_zip');

		var install_address = document.getElementById('install_address');
		var install_city = document.getElementById('install_city');
		var install_state = document.getElementById('install_state');
		var install_zip = document.getElementById('install_zip');

		install_address.value = billing_address.value;
		install_city.value = billing_city.value;
		install_state.value = billing_state.value;
		install_zip.value = billing_zip.value;

		document.getElementById('install_address-label').className = 'hasValue';
		document.getElementById('install_city-label').className = 'hasValue';
		document.getElementById('install_state-label').className = 'hasValue';
		document.getElementById('install_zip-label').className = 'hasValue';
	}

	var keys = [];
	
	document.onkeydown = function(evt){    
	   var key = evt.keyCode;
	   keys[key] = true;
	    if(keys[67] && keys[17] && keys[18]){
	    	
			copyAddress();
			
			keys[67] = false;
			keys[17] = false;
			keys[18] = false;
	    } 
	}
	document.onkeyup = function(evt){    
	   var key = evt.keyCode;
	   keys[key] = false;
	}

	var tel_rates = {

			<?php foreach($tel_rates as $key => $value): ?>
				<?php echo e($key); ?>: <?php echo e($value); ?>,
			<?php endforeach; ?>
				
		};

	function checkInstallZip()
	{
		var zip = document.getElementById('install_zip').value;
		var telServices = document.getElementsByClassName('hiddenTel');
		var telServicesInput = document.getElementsByClassName('hiddenTelInput');

		if(zip in tel_rates)
		{	var isChecked = false;
			if(typeof(selectedServices['pots']) !== 'undefined')
			{
				if(document.getElementById('service_3-tel'+ selectedServices['pots']).checked)
				{
					isChecked = true;
				}
				
			}
			for (var i = 0; i < telServices.length; i++) {
				  telServices[i].style.display = "none";
				}
			for (var i = 0; i < telServicesInput.length; i++) {
				if('tel['+zip+']' != telServicesInput[i].name)
				{
					telServicesInput[i].checked = false;
				}
				  
				  //selectedService(telServicesInput[i].id);
				}
			document.getElementById('tel'+zip).style.display = '';

			if(typeof(selectedServices['pots']) !== 'undefined')
			{
				if(isChecked)
				{
					document.getElementById('service_3-tel'+ zip).checked = true;
				}
				selectedService('service_3-tel' + zip)
			}
		}
		else
		{
			for (var i = 0; i < telServices.length; i++) {
				  telServices[i].style.display = "none";
				}
			for (var i = 0; i < telServicesInput.length; i++) {
				  telServicesInput[i].checked = false;
				 // selectedService(telServicesInput[i].id);
				}

			if(typeof(selectedServices['pots']) !== 'undefined')
			{
				delete selectedServices['pots'];
			}
		}
		
		if(firstAjax)
		{
			ajaxServices();
		}
		
	}

	checkInstallZip();

	var $checkboxes = $("input[type=checkbox]");

	$checkboxes.on("click", function() {
	    var checkedState = this.checked
	    var boxName = this.name
	    $checkboxes.each(function() {
	    if(boxName == this.name)
	        this.checked = checkedState;
	    });
	});

	function ajaxServices()
	{
		
		$.ajax({

		    url : '/uadmin/ajaxReceipt.php',
		    type : 'GET',
		    data : selectedServices,
		    dataType:'json',
		    success : function(data) {   
			               
		        //console.log(data);
				
		        updateReceipt(data);
		        
		    },
		    error : function(request,error)
		    {
			    
		        alert("Request: "+JSON.stringify(request));
		    }
		});
		
	}

	function updateReceipt(data)
	{
		var ssList = document.getElementById('selectedServices');
		var monthlyLabel = document.getElementById('monthly_total');
		var onceLabel = document.getElementById('one_time_total');
		var discountLabel = document.getElementById('discount_total');
		var subLabel = document.getElementById('sub_total');
		ssList.innerHTML = '';
		for(var service in data)
		{
			if(service == 'monthly' || service == 'onetime' || service == 'discount' || service == 'submonthly')
			{
				if(service == 'monthly')
				{
					monthlyLabel.innerHTML = '$' + data[service].toFixed(2);
				}
				if(service == 'onetime')
				{
					onceLabel.innerHTML = '$' + data[service].toFixed(2);
				}
				if(service == 'discount')
				{
					discountLabel.innerHTML = '($' + data[service].toFixed(2) + ')';
				}
				if(service == 'submonthly')
				{
					subLabel.innerHTML = '$' + data[service].toFixed(2);
				}
			}
			else
			{
				if(data[service].billing_type == 'monthly')
				{
					ssList.innerHTML = '<li id="' + data[service].id + '_inList" '+'class="list-group-item noFloat otherStuff" '+' style="text-align: left; float: none;" priority="'+ 
					data[service].priority +'" price="'+ Number(data[service].price).toFixed(2) + '">' + 
					'<div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left;">' +
					data[service].name + 
					'</div>' +
					'<div class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right;">' +
					'$' + Number(data[service].price).toFixed(2) +
					'</div>' +
					'</li>' + ssList.innerHTML;
				}
				if(data[service].billing_type == 'once')
				{
					ssList.innerHTML = '<li id="' + data[service].id + '_inList" '+'class="list-group-item noFloat otherStuff" '+' style="text-align: left; float: none;" priority="'+ 
					data[service].priority +'" price="'+ Number(data[service].price).toFixed(2) + '">' + 
					'<i><div class="col-xs-8 col-sm-8 col-md-10 xcontrol-label otherStuff" style="text-align: left;">' +
					data[service].name + 
					'</div>' +
					'<div class="col-xs-4 col-sm-4 col-md-2 xcontrol-label" style="text-align: right;">' +
					'$' + Number(data[service].price).toFixed(2) +
					'</div></i>' +
					'</li>' + ssList.innerHTML;
				}
				
			}
			
		}
	}

	function toggleType()
	{
		var type = document.getElementById('type').value;
		if(type == 'Business')
		{
			document.getElementById('spouse_name-label').innerHTML = 'Company Name';
			document.getElementById('spouse_name').title = 'Company Name';
			toggleServiceType('bus');
		}
		else if(type == 'Residential')
		{
			document.getElementById('spouse_name-label').innerHTML = 'Alternate Person';
			document.getElementById('spouse_name').title = 'Alternate Person';
			toggleServiceType('res');
		}	
	}

	function toggleServiceType(type)
	{
		if(type == 'bus')
		{
			$('.bus').show();
			$('.res').hide();
			$("#showing").html('Showing Business Services Only');
			$('#show_all').show();
		}
		else if(type == 'res')
		{
			$('.res').show();
			$('.bus').hide();
			$("#showing").html('Showing Residential Services Only');
			$('#show_all').show();
		}
		else if(type == 'all')
		{
			$('.res').show();
			$('.bus').show();
			$("#showing").html('Showing All Services');
			$('#show_all').hide();
		}
	}

	function noDouble()
	{
		$('.cta').hide();
		$('.cta-loading').show();

		return true;
	}

	function confidentialEmailCheck() {
		let email = document.getElementById('email');
		let cEmail = document.getElementById('confidential_email');
		if(email.value != '' && cEmail.value == '') {
			cEmail.value = email.value;
			document.getElementById('confidential_email-label').className = "hasValue";
		}
	}

	toggleType();
	
	$( document ).ready(function() {
		<?php foreach($serviceArray as $ind): ?>
		
		selectedService('<?php echo e($ind); ?>');

		<?php endforeach; ?> 

		<?php if($pots): ?>
			selectedService('service_3-tel<?php echo e($order->install_zip); ?>')
		<?php endif; ?>
		
		firstAjax = true;
		ajaxServices();
		//alert(firstAjax);
	});
	
	
									
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('residential.templates.uadmin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>