<?php $__env->startSection('page_title'); ?>
	Manage Supplier/Contractor
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_header_title'); ?>
	Manage Supplier/Contractor
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_body'); ?>
<?php echo e(Breadcrumbs::render('supplier')); ?>


<div class="row row-cards row-deck" style="background: white; ">
	<div class="col-12">

		<ul class="nav nav-tabs" id="myTab" role="tablist" style="padding-left: 2%;">
		  <li class="nav-item">
		    <a class="nav-link active" id="supplierdiv-tab" data-toggle="tab" href="#supplierdiv" role="tab" aria-controls="supplierdiv" aria-selected="true">Suppliers / Vendors</a>
		  </li>
		  <li class="nav-item">
		    <a class="nav-link" id="contractordiv-tab" data-toggle="tab" href="#contractordiv" role="tab" aria-controls="contractordiv" aria-selected="false">Contractors</a>
		  </li>

		</ul>

				<div class="tab-content">


                <div class="tab-pane fade show active" id="supplierdiv" role="tabpanel" aria-labelledby="supplierdiv-tab">
                	  <div class="card-header">

											<?php if(Auth::user()->hasAnyPermission(['All','Add Supplier'])): ?>

									     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_supplier" ><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
				             <?php endif; ?>

					     <h3 class="card-title">Add Supplier</h3>
					  </div>
                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
										<table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>

                          <th>#</th>
                          <th>Name</th>
                          <th>Father Name</th>
                          <th>Cnic #</th>
													<th>NTN #</th>
                          <th>Email </th>
                          <th>Contact #</th>
                          <th>Type</th>
                          <th>Reg Date</th>
                   <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php if(isset($user_list)): ?>
                         <?php ($pass_data = []); ?>
                        <?php $__currentLoopData = $user_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                         <?php ($branch_curr = $rows->branch); ?>

                            <?php (
                              $pass_data = array(
                                  'user_id'              => Crypt::encrypt($rows->id),
                                  'full_name'            => $rows->name,
                                  'father_name'          => $rows->fname,
                                  'dob'                  => str_replace('1970-01-01','',date('Y-m-d',strtotime($rows->dob))),
                                  'cnic'                 => ($rows->cnic),
                                  'email'                => $rows->email,
                                  'contact'              => $rows->contact,
                                  'relation'             => $rows->relation,
                                  'gender'               => $rows->gender,
                                  'nationality'          => $rows->nationality,
                                  'occupation'           => $rows->occupation,
                                  'temporary_address'    => $rows->temp_address,
                                  'permanent_address'    => $rows->per_address,
																	'ntn'    => $rows->ntn,
																	'strn'    => $rows->strn,
																	'incometax_date'    => $rows->incometax_date,
																	'saletax_date'    => $rows->saletax_date,
                                  'user_image'           => $rows->dp,
                                  EF::branchWhiteLabel()['module']               => $branch_curr->code.' '.$branch_curr->name,
                                  'vendor_type'         => $rows->vendorType->name,
                                )
                            ); ?>
                    <tr>
                      <td><?php echo e($loop->iteration); ?></td>
                      <td><?php echo e($rows->name); ?></td>
                      <td><?php echo e($rows->fname); ?></td>
                      <td><?php echo e($rows->cnic); ?></td>
					  <td><?php echo e($rows->ntn); ?></td>
                      <td><?php echo e(EF::filterEmail($rows->email)); ?></td>
                      <td><?php echo e($rows->contact); ?></td>
                      <td><?php echo e($rows->type); ?></td>
                      <td><?php echo e(EF::dateFormat($rows->created_at)); ?></td>
                      <td class="text-center">

						<div class="item-action dropdown">
						<a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
						<div class="dropdown-menu dropdown-menu-right">

						<?php if(Auth::user()->hasAnyPermission(['All','Update Supplier'])): ?>
							<a onclick="update(event,'<?php echo e(json_encode($pass_data)); ?>','form_update_supplier','md_update_supplier')" href="#" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
						<?php endif; ?>
						<a  href="<?php echo e(route('vendor.qoutations', Crypt::encrypt($rows->id))); ?>" class="dropdown-item"><i class="dropdown-icon fa fa-paper"></i> Qoutations </a>

						<?php if(Auth::user()->hasAnyPermission(['All','View Ledger'])): ?>
                            <a href="<?php echo e(route('user.viewledger',['id'=>Crypt::encrypt($rows->id)])); ?>" class="dropdown-item " ><i class="dropdown-icon fa fa-eye"></i> View Ledger</a>
                        <?php endif; ?>
						</div>
						</div>
						</td>
					</tr>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                      </tbody>
                    </table>
                  </div>
                </div>





												  <div class="tab-pane fade" id="contractordiv" role="tabpanel" aria-labelledby="contractordiv-tab">
														<div class="card-header">

															<?php if(Auth::user()->hasAnyPermission(['All','Add Contractor'])): ?>
													     <button  class="float-right btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_add_contractor" ><i class="fa fa-plus"></i></button> &nbsp;&nbsp;
								             <?php endif; ?>

											 <h3 class="card-title">Add Contractor</h3>
										</div>
													<div class="card-status card-status-left bg-blue"></div>
													<div class="table-responsive table-height">
														<table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
				                      <thead>
				                        <tr>
				                          <th>#</th>
				                          <th>Name</th>
				                          <th>Father Name</th>
				                          <th>Cnic #</th>
																	<th>NTN #</th>
				                          <th>Email </th>
				                          <th>Contact #</th>
				                          <th>Type</th>
				                          <th>Reg Date</th>
				                   <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
				                        </tr>
				                      </thead>
				                      <tbody>
				                        <?php if(isset($user_list_contractor)): ?>
				                         <?php ($pass_data_contractor = []); ?>
				                        <?php $__currentLoopData = $user_list_contractor; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
				                         <?php ($branch_curr = $rows->branch); ?>
				                            <?php (
				                              $pass_data_contractor = array(
				                                  'user_id'              => Crypt::encrypt($rows->id),
				                                  'full_name'            => $rows->name,
				                                  'father_name'          => $rows->fname,
				                                  'dob'                  => str_replace('1970-01-01','',date('Y-m-d',strtotime($rows->dob))),
				                                  'cnic'                 => ($rows->cnic),
				                                  'email'                => $rows->email,
				                                  'contact'              => $rows->contact,
				                                  'relation'             => $rows->relation,
				                                  'gender'               => $rows->gender,
				                                  'nationality'          => $rows->nationality,
				                                  'occupation'           => $rows->occupation,
				                                  'temporary_address'    => $rows->temp_address,
				                                  'permanent_address'    => $rows->per_address,
				                                  'user_image'           => $rows->dp,
				                                  EF::branchWhiteLabel()['module']               => $branch_curr->code.' '.$branch_curr->name,
				                                )
				                            ); ?>
				                    <tr>
				                      <td><?php echo e($loop->iteration); ?></td>
				                      <td><?php echo e($rows->name); ?></td>
				                      <td><?php echo e($rows->fname); ?></td>
				                      <td><?php echo e($rows->cnic); ?></td>
															<td><?php echo e($rows->ntn); ?></td>
				                      <td><?php echo e(EF::filterEmail($rows->email)); ?></td>
				                      <td><?php echo e($rows->contact); ?></td>
				                      <td><?php echo e($rows->type); ?></td>
				                      <td><?php echo e(EF::dateFormat($rows->created_at)); ?></td>
				                      <td class="text-center">
				                                  <div class="item-action dropdown">
				                                    <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
				                                    <div class="dropdown-menu dropdown-menu-right">

				                                    <?php if(Auth::user()->hasAnyPermission(['All','Update Contractor'])): ?>
				                                      <a onclick="update(event,'<?php echo e(json_encode($pass_data_contractor)); ?>','form_update_contractor','md_update_contractor')" href="#" class="dropdown-item"><i class="dropdown-icon fa fa-edit"></i> Update </a>
				                                      <?php endif; ?>
																							<a  href="<?php echo e(route('vendor.qoutations', Crypt::encrypt($rows->id))); ?>" class="dropdown-item"><i class="dropdown-icon fa fa-paper"></i> Qoutations </a>
				                                    </div>
				                                  </div>
				                               </td>
				                               </tr>

				                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				                        <?php endif; ?>
				                      </tbody>
				                    </table>
													</div>
												</div>


											</div>
									</div>

</div>

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

<?php $__env->startSection('page_modal'); ?>
  <?php echo $__env->make('inventory_module.supplier.modals.add_supplier', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('inventory_module.supplier.modals.update_supplier', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
	<?php echo $__env->make('inventory_module.supplier.modals.add_contractor', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  <?php echo $__env->make('inventory_module.supplier.modals.update_contractor', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div class="modal fade" id="md_add_vendor_type" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <?php echo e(Form::open(array('route' => 'vendor_type.store' , 'id' => 'form_add_vendor_type', 'class' => 'cls_form' , 'method' => 'POST' , 'enctype'=>'multipart/form-data'
))); ?>

  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Add Vendor Type</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true"></span>
        </button>
      </div>
      <div class="modal-body ">
        <div class ="card">
          <div class = "card-body form-fieldset">
          <div class="row">
            <div class="col-sm-12">
            <label class="label-color"> Type: <i style = "color:red;">*</i></label>
            <div class="input-group mb-3">
              <input type="text" name="name" class="form-control cls_required " required id="type" />
            </div>
            </div>
        </div>
          </div>
        </div>
      </div>
      <div class="modal-footer">

        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="submit" onClick="storeVenderType(event,this)" class="btn btn-primary"   content="add category">Add Type</button>

      </div>
      <?php echo e(Form::close()); ?>

    </div>
  </div>

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

<?php $__env->startSection('page_script'); ?>
 <?php echo $__env->make('inventory_module.scripts.users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

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

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/inventory_module/supplier/manage_supplier.blade.php ENDPATH**/ ?>