IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card">
<div class="header">
<h2><strong><?php if(isset($class)): ?>Edit <?php else: ?> Add <?php endif; ?></strong> Customer</h2>
</div>
<div class="body">
<?php if(isset($class)): ?>
<?php echo Form::model($class, ['method' => 'PATCH', 'action' => ['BillCustomerController@update', $class->idCustomer], 'class' => 'form-horizontal']); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'admin/customers', 'class' => 'form-horizontal']); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Party Name</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('customerName',null,['class' => 'form-control']); ?>
<?php if($errors->has('customerName')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('customerName')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Party Number</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::number('customerNumber',null,['class' => 'form-control','maxlength' => '10' , 'oninput'=>"javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"]); ?>
<?php if($errors->has('customerNumber')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('customerNumber')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Opening Balance</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::number('openBalance',null,['class' => 'form-control']); ?>
<?php if($errors->has('openBalance')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('openBalance')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">GSTIN</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('gstin',null,['class' => 'form-control','style'=>'text-transform: uppercase;']); ?>
<?php if($errors->has('gstin')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('gstin')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<b>Shipping Address</b>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Flat/Building Number</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('address_line',null,['class' => 'form-control','style'=>'text-transform: uppercase;']); ?>
<?php if($errors->has('address_line')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('address_line')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Area/Locality</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('area',null,['class' => 'form-control','style'=>'text-transform: uppercase;']); ?>
<?php if($errors->has('area')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('area')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Pincode</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::number('pincode',null,['class' => 'form-control','style'=>'text-transform: uppercase;','maxlength' => '6', 'oninput'=>"javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"]); ?>
<?php if($errors->has('pincode')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('pincode')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">City</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('city',null,['class' => 'form-control','style'=>'text-transform: uppercase;']); ?>
<?php if($errors->has('city')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('city')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">State</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php if(isset($class)): ?>
<?php echo Form::select('stateName',$states,$class->stateName,['class' => 'form-control show-tick ms','style'=>'text-transform: uppercase;']); ?>
<?php else: ?>
<?php echo Form::select('stateName',$states,null,['class' => 'form-control show-tick ms','style'=>'text-transform: uppercase;']); ?>
<?php endif; ?>
<?php if($errors->has('stateName')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('stateName')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($class)): ?>
<?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php else: ?>
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php endif; ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-7">
<div class="card">
<div class="header">
<h2><strong>List Of Customers</strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example">
<thead>
<tr>
<th>S. No.</th>
<th>Name</th>
<th>Phone Number</th>
<th>GSTIN</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $class): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($i); ?></td>
<td style="text-transform: uppercase;"><?php echo e($class->customerName); ?></td>
<td><?php echo e($class->customerNumber); ?></td>
<td style="text-transform: uppercase;"><?php echo e($class->gstin); ?></td>
<td>
<a href="<?php echo e(url('admin/customers/' . $class->idCustomer . '/edit')); ?>" class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($class->idCustomer); ?>" data-type="confirm">DELETE</button>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).on('click', '.js-sweetalert', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
swal({
title: "Are you sure?",
text: "Are You sure you want to delete this customer!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "DELETE",
url: "<?php echo e(url('/admin/customers/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Class has been successfully deleted",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('superadmin.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -