<div class="livewire-component-wrapper">
	<!-- Add Modal -->
          <div wire:ignore.self class="modal fade" id="addModal" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog" role="document">
              <div class="modal-content">
                <form class="needs-validation" novalidate>
				<?php echo csrf_field(); ?>
                <div class="modal-header">
                  <h5 class="modal-title" id="editModalLabel1">Add Revenue Location</h5>
                  <button type="button" class="btn-close rmv_modal_backdrop" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                  <div class="row">
				  
                    <div class="col-md-12 mb-3">
                      <label for="addRevenueLocation" class="form-label">Revenue Location Name</label>
                      <input type="text" name="LocationName" wire:model="LocationName" class="form-control LocationName" placeholder="Revenue Location Name" value="<?php echo e(old('LocationName')); ?>" required>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['LocationName'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Revenue location name is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
					  <label for="addSubCounty" class="form-label">SubCounty</label>
					  <select class="form-select SubCountyID" name="SubCountyID" wire:model.live="SubCountyID">
						<option value="" selected hidden>Select SubCounty</option>
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $subcounties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<option value="<?php echo e($item->SubCountyID); ?>"><?php echo e($item->SubCountyName); ?></option>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['SubCountyID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">SubCounty is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
                      <label for="addWard" class="form-label">Ward</label>
                      <select class="form-select WardID" name="WardID"  wire:model="WardID" required>
					  <option value="" hidden>Select Ward</option>
					  <?php if($this->SubCountyID): ?>
					  <!--[if BLOCK]><![endif]--><?php if(count($wards) > 0): ?>
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $wards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<option value="<?php echo e($item->WardID); ?>" wire:key="item-<?php echo e($item->WardID); ?>"><?php echo e($item->WardName); ?></option>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
						<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
						<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['WardID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Ward is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
					  <label for="addZone" class="form-label">Zone</label>
					  <select class="form-select" name="ZoneID" wire:model="ZoneID">
						<option value="" selected hidden>Select Zone</option>
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $zones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<option value="<?php echo e($item->ZoneID); ?>"><?php echo e($item->ZoneName); ?></option>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['ZoneID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Zone is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
					  <label for="addLocationType" class="form-label">Location Type</label>
					  <select class="form-select" name="LocationType" wire:model="LocationType">
						<option value="" selected hidden>Select Location Type</option>
						<option value="Town">Town</option>
						<option value="Market">Market</option>
						<option value="Other">Other</option>
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['LocationType'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Location type is required</div>
                    </div>
			
                  </div>	
                </div>
                <div class="modal-footer">
				  <button type="button" class="btn btn-kco-green" wire:click="saveRevenueLocation">Save</button>
                  <button type="button" class="btn btn-outline-kco rmv_modal_backdrop" data-bs-dismiss="modal">Close</button>
                </div>
			  </form>
              </div>
            </div>
          </div>

		<!-- edit Modal -->
          <div wire:ignore.self class="modal fade" id="editModal" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog" role="document">
              <div class="modal-content">
                <form class="needs-validation" novalidate>
				<?php echo csrf_field(); ?>
                <div class="modal-header">
                  <h5 class="modal-title" id="editModalLabel1">Edit Revenue Location</h5>
                  <button type="button" class="btn-close rmv_modal_backdrop" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                  <div class="row">
			
                    <div class="col-md-12 mb-3">
                      <label for="editRevenueLocation" class="form-label">Revenue Location Name</label>
                      <input type="text" name="LocationName" wire:model="LocationName" class="form-control" required>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['LocationName'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Revenue location name is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
                      <label for="editSubCounty" class="form-label">SubCounty</label>
                      <select class="form-select" name="SubCountyID" wire:model.live="SubCountyID">
						<!--[if BLOCK]><![endif]--><?php if(!$this->SubCountyID): ?>
						<option value=null hidden>Select SubCounty</option>
						<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $subcounties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<option value="<?php echo e($item->SubCountyID); ?>"><?php echo e($item->SubCountyName); ?></option>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['SubCountyID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">SubCounty is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
                      <label for="editWard" class="form-label">Ward</label>
                      <select class="form-select WardID" name="WardID"  wire:model="WardID">
					  
					    <!--[if BLOCK]><![endif]--><?php if($this->getwards==0): ?>
						  <!--[if BLOCK]><![endif]--><?php if(count($wards) > 0): ?>
								<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $wards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
								<option value="<?php echo e($item->WardID); ?>" wire:key="item-<?php echo e($item->WardID); ?>" <?php if($item->WardID==$this->WardID): ?> <?php echo e('selected=selected'); ?> <?php endif; ?>><?php echo e($item->WardName); ?></option>
								<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
							<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
						<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
						
						<!--[if BLOCK]><![endif]--><?php if($this->getwards==1): ?>
							<option value=null hidden selected>Select Ward</option>
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $wards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<option value="<?php echo e($item->WardID); ?>" wire:key="item-<?php echo e($item->WardID); ?>"><?php echo e($item->WardName); ?></option>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
						<?php endif; ?><!--[if ENDBLOCK]><![endif]-->
						
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['WardID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Ward is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
					  <label for="editZone" class="form-label">Zone</label>
					  <select class="form-select" name="ZoneID" wire:model="ZoneID">
						<option value=null hidden>Select Zone</option>
						<!--[if BLOCK]><![endif]--><?php $__currentLoopData = $zones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<option value="<?php echo e($item->ZoneID); ?>"><?php echo e($item->ZoneName); ?></option>
						<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['ZoneID'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Zone is required</div>
                    </div>
					
					<div class="col-md-12 mb-3">
					  <label for="editLocationType" class="form-label">Location Type</label>
					  <select class="form-select" name="LocationType" wire:model="LocationType">
						<option value=null hidden>Select Location Type</option>
						<option value="Town">Town</option>
						<option value="Market">Market</option>
						<option value="Other">Other</option>
					  </select>
					  <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['LocationType'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-danger alert-sm"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
					      <div class="invalid-feedback">Location type is required</div>
                    </div>
					
                  </div>	
                </div>
                <div class="modal-footer">
				  <button type="button" class="btn btn-kco-green" wire:click="updateRevenueLocation">Update</button>
                  <button type="button" class="btn btn-outline-kco rmv_modal_backdrop" data-bs-dismiss="modal">Close</button>
                </div>
			  </form>
              </div>
            </div>
          </div>
		  
</div><?php /**PATH C:\xampp\htdocs\kcofbms3\resources\views/livewire/revenuelocations.blade.php ENDPATH**/ ?>