<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
    <h4 class="card-title">Create Payment Plan</h4>
    <h6 class="card-subtitle"></h6>
      <div class="x_content">
        <form id="demo-form2" action="<?php echo e(url('/admin/paymentplan/create')); ?>" method="post" data-parsley-validate class="form-horizontal form-label-left">
          <?php echo e(csrf_field()); ?>

          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Title <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="name" name="name" required="required" class="form-control col-md-7 col-xs-12" value="">
              <?php if($errors->has('name')): ?>
                  <span class="help-block">
                      <strong><?php echo e($errors->first('name')); ?></strong>
                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group" id="project_id">
              <label class="control-label col-md-3 col-sm-3 col-xs-12" for="project_id">Project<span class="required">*</span></label>
              <div class="col-md-6 col-sm-6 col-xs-12">
              <?php echo Form::select('project_id', $projects, old('project_id'), ['class' => 'form-control col-md-7 col-xs-12']); ?>

              <?php if($errors->has('project_id')): ?>
                  <span class="help-block error alert">
                      <?php echo e($errors->first('project_id')); ?>

                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group" id="perc_fixed">
              <label class="control-label col-md-3 col-sm-3 col-xs-12" for="perc_fixed">Project<span class="required">*</span></label>
              <div class="col-md-6 col-sm-6 col-xs-12">
              <?php echo Form::select('perc_fixed', ['fixed'=>'Fixed', 'perc'=>'Percentage'], old('perc_fixed'), ['class' => 'form-control col-md-7 col-xs-12']); ?>

              <?php if($errors->has('perc_fixed')): ?>
                  <span class="help-block error alert">
                      <?php echo e($errors->first('perc_fixed')); ?>

                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="rate">Payment Plan Type<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <select id="payment_plan_type" name="payment_plan_type" required="required" class="form-control col-md-7 col-xs-12">
                <option value="0" selected="selected">Full Payment Plan</option>
                <option value="1">EMI Payment Plan</option>
              </select>
              <?php if($errors->has('payment_plan_type')): ?>
                  <span class="help-block">
                      <strong><?php echo e($errors->first('payment_plan_type')); ?></strong>
                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="booking">Booking<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="booking" name="booking" required="required" class="form-control col-md-7 col-xs-12" value="">
              <?php if($errors->has('booking')): ?>
                  <span class="help-block">
                      <strong><?php echo e($errors->first('booking')); ?></strong>
                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="allotment">Allotment<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="allotment" name="allotment" required="required" class="form-control col-md-7 col-xs-12" value="">
              <?php if($errors->has('allotment')): ?>
                  <span class="help-block">
                      <strong><?php echo e($errors->first('allotment')); ?></strong>
                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="emi">Registry/EMI<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="emi" name="emi" required="required" class="form-control col-md-7 col-xs-12" value="">
              <?php if($errors->has('emi')): ?>
                  <span class="help-block">
                      <strong><?php echo e($errors->first('emi')); ?></strong>
                  </span>
              <?php endif; ?>
            </div>
          </div>
          <div class="ln_solid"></div>
          <div class="form-group">
            <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
              <button type="submit" class="btn btn-success">Submit</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
<div class="card">
  <div class="card-body">
    <h4 class="card-title">Projects</h4>
      <div class="x_content">
        <table id="datatable-fixed-header" class="table table-striped table-bordered">
          <thead>
            <tr>
              <th>Title</th>
              <th>Type</th>
              <th>Booking</th>
              <th>Allotment</th>
              <th>Registry/EMI</th>
              <th>Project</th>
              <th>Created at</th>
              <th>Action</th>
            </tr>
          </thead>


          <tbody>
          <?php $__currentLoopData = $paymentPlans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $paymentPlan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
              <td><?php echo e($paymentPlan->name); ?></td>
              <td><?php if($paymentPlan->type==1): ?> EMI Payment Plan <?php else: ?> Full Payment Plan <?php endif; ?></td>
              <td><?php echo e($paymentPlan->booking); ?></td>
              <td><?php echo e($paymentPlan->allotment); ?></td>
              <td><?php echo e($paymentPlan->emi); ?></td>
              <td><?php echo e($paymentPlan->projectName); ?></td>
              <td><?php echo e($paymentPlan->created_at); ?></td>
              <td>
                <a type="button" class="btn btn-success" href="<?php echo e(url('/admin/paymentplan'.'/'.$paymentPlan->id)); ?>">Edit</a>
                <a type="button" class="btn btn-danger" href="<?php echo e(url('/admin/deletepaymentplan'.'/'.$paymentPlan->id)); ?>">Delete</a>
              </td>
            </tr>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('javascript'); ?>
<script>
  jQuery(document).ready(function() {
   jQuery('#datatable-fixed-header').DataTable({
      fixedHeader: true
    });
  });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\xampp\htdocs\yespropmart2.loc\resources\views/admin/projects/add_payment_plan.blade.php ENDPATH**/ ?>