<?php $__env->startSection('content'); ?>
<div class="card card-outline-info">
  <div class="card-header">
      <h4 class="m-b-0 text-white">Create Lead - New User Customer</h4>
  </div>
  <div class="card-body">
    <div class="x_content">
      <form id="demo-form2" action="<?php echo e(url('/admin/doUpdateLeadStatus/'.$customer->id)); ?>" method="post" enctype="multipart/form-data" data-parsley-validate class="form-horizontal form-label-left">
        <?php echo e(csrf_field()); ?>

            <?php if($customer->lead_type=='New'): ?>
            <h3 class="card-title">Personal Detail</h3>
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                      <?php echo Form::label('placement', 'Tracking No.*', ['class' => 'control-label']); ?>

                      <input type="text" class="form-control" value="<?php echo e($customer->ack_number); ?>" id="copyInput" readonly>  
                      <!-- Copy Button with Icon -->
                      <button class="btn btn-outline-secondary" type="button" id="button-copy" onclick="copyText()">
                        <i class="fa fa-clipboard"></i> <!-- Bootstrap Icon -->
                      </button>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('placement', 'Placement*', ['class' => 'control-label']); ?>

                        <?php echo Form::select('placement',array('l'=>'Left', 'r'=>'Right'), $customer->placement, ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('placement')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('placement')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-8">
                    <div class="form-group">
                        <?php echo Form::label('full_name', 'Full Name*', ['class' => 'control-label', 'required']); ?>

                        <?php echo Form::text('full_name', $customer->full_name, ['class' => 'form-control form-control-normal','id'=>'full_name', 'placeholder' => 'Full Name here']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('full_name')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('full_name')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('gender', 'Gender*', ['class' => 'control-label']); ?>

                        <?php echo Form::select('gender', array('Male', 'Female'), !empty($customer->gender) ? $customer->gender : 0, ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('gender')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('gender')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('mobileno', 'Mobile no.*', ['class' => 'control-label']); ?>

                        <?php echo Form::number('mobileno', $customer->mobileno, ['class' => 'form-control form-control-normal', 'id'=>'mobileno', 'placeholder' => 'Mobile No.', 'maxlength' => '10', 'required', 'disabled']); ?>

                        <p class="help-block">Do not enter 0 or +91 before the mobile number</p>
                        <?php if($errors->has('mobileno')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('mobileno')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                    <?php echo Form::label('email', 'Email*', ['class' => 'control-label']); ?>

                    <?php echo Form::email('email', $customer->email, ['class' => 'form-control form-control-normal', 'id' => 'email', 'placeholder' => 'Email', 'required', 'disabled']); ?>

                    <p class="help-block"></p>
                    <?php if($errors->has('email')): ?>
                        <p class="help-block">
                            <?php echo e($errors->first('email')); ?>

                        </p>
                    <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('panno', 'Pan no.*', ['class' => 'control-label']); ?>

                        <?php echo Form::text('panno', $customer->panno, ['class' => 'form-control form-control-normal', 'placeholder' => 'Pan No.', 'disabled']); ?>

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

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('dob', 'Date of Birth*', ['class' => 'control-label']); ?>

                        <?php echo Form::text('dob', $customer->dob, ['class' => 'form-control form-control-normal mydatepicker', 'placeholder' => 'Date of birth']); ?>


                        <p class="help-block"></p>
                        <?php if($errors->has('dob')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('dob')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                    <?php echo Form::label('address', 'Address', ['class' => 'control-label']); ?>

                    <?php echo Form::textarea('address', $customer->address, ['class' => 'form-control form-control-normal', 'placeholder' => 'Address', 'rows'=> '2']); ?>



                    <p class="help-block"></p>
                    <?php if($errors->has('address')): ?>
                        <p class="help-block">
                            <?php echo e($errors->first('address')); ?>

                        </p>
                    <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                    <?php echo Form::label('pincode', 'Pincode', ['class' => 'control-label']); ?>

                    <?php echo Form::text('pincode', $customer->pincode, ['class' => 'form-control form-control-normal', 'placeholder' => 'pincode']); ?>



                    <p class="help-block"></p>
                    <?php if($errors->has('pincode')): ?>
                        <p class="help-block">
                            <?php echo e($errors->first('pincode')); ?>

                        </p>
                    <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                    <?php echo Form::label('state', 'State*', ['class' => 'control-label']); ?>


                    <select class="form-control form-control-normal" name="state" id="state-dropdown" required="">
                        <option value="">Select State</option>
                        <?php $__currentLoopData = $states; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
                        <option value="<?php echo e($state->id); ?>" <?php if($customer->state==$state->id): ?> selected  <?php endif; ?>>
                        <?php echo e($state->name); ?>

                        </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    <p class="help-block"></p>
                    <?php if($errors->has('state')): ?>
                        <p class="help-block">
                            <?php echo e($errors->first('state')); ?>

                        </p>
                    <?php endif; ?>
                    </div>
                </div>
                <?php
                    if(!empty($customer->state)){
                        $cities = \App\City::where('state_id', $customer->state)->get();
                    }
                ?>
                <div class="col-md-4">
                    <div class="form-group">
                    <?php echo Form::label('city', 'City*', ['class' => 'control-label']); ?>

                    <select class="form-control form-control-normal" name="city" id="city-dropdown" required="">
                        <?php if(isset($cities)): ?>
                            <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($city->id); ?>" <?php echo e($customer->city == $city->id ? 'selected' : ''); ?>><?php echo e($city->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                    </select>
                    <p class="help-block"></p>
                    <?php if($errors->has('city')): ?>
                        <p class="help-block">
                            <?php echo e($errors->first('city')); ?>

                        </p>
                    <?php endif; ?>
                    </div>
                </div>                
            </div>
            <?php endif; ?>
            <h3 class="card-title">Solar And Connection</h3>
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('bank_name', 'Bank Name', ['class' => 'control-label']); ?>

                        <?php echo Form::text('bank_name', $customer->bank_name, ['class' => 'form-control form-control-normal', 'placeholder' => 'Bank Name']); ?>


                        <p class="help-block">Nationalised Bank Only</p>
                        <?php if($errors->has('bank_name')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('bank_name')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('econn_no', 'Monthly Avg Electric Bill Amount*', ['class' => 'control-label']); ?>

                        <?php echo Form::text('econn_no', $customer->econn_no, ['class' => 'form-control form-control-normal', 'placeholder' => 'Monthly Avg Electric Bill Amount', 'required']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('econn_no')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('econn_no')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('solar_conn_type', 'Solar Connection Type*', ['class' => 'control-label']); ?>

                        <?php echo Form::select('solar_conn_type', array('Off-Grid'=>'Off-Grid', 'On-Grid'=>'On-Grid', 'Hybrid'=>'Hybrid'), !empty($customer->solar_conn_type) ? $customer->solar_conn_type : 'Off-Grid', ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('solar_conn_type')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('solar_conn_type')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                      <div class="form-group">
                      <label for="ev_ev_solar_model_id" class="control-label">Select KW<span class="required">*</span></label>                  
                      <select name="ev_ev_solar_model_id" class="form-control form-control-normal" id="ev_ev_solar_model_id" required>
                          <?php $__currentLoopData = $ev_ev_solar_model_ids; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ev_ev_solar_model_id): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                          <option value="<?php echo e($ev_ev_solar_model_id->id); ?>" amount="<?php echo e($ev_ev_solar_model_id->amount); ?>" <?php echo e($customer->ev_ev_solar_model_id == $ev_ev_solar_model_id->id ? 'selected' : ''); ?>><?php echo e($ev_ev_solar_model_id->title); ?></option>
                          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      </select>
                      <?php if($errors->has('ev_ev_solar_model_id')): ?>
                          <p class="help-block error">
                              <?php echo e($errors->first('ev_ev_solar_model_id')); ?>

                          </p>
                      <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('property_type', 'Property Type*', ['class' => 'control-label']); ?>

                        <?php echo Form::select('property_type', array('Residential'=>'Residential', 'Commercial'=>'Commercial', 'Industrial'=>'Industrial', 'Government'=>'Government'), !empty($customer->property_type) ? $customer->property_type : 'Residential', ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('property_type')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('property_type')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('monthly_elecbill', 'Electricity Connection No.', ['class' => 'control-label']); ?>

                        <?php echo Form::number('monthly_elecbill', $customer->monthly_elecbill, ['class' => 'form-control form-control-normal', 'placeholder' => 'Electricity Connection No.']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('monthly_elecbill')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('monthly_elecbill')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('payment_type', 'Payment Type*', ['class' => 'control-label']); ?>

                        <?php echo Form::select('payment_type', array('loan'=>'Loan', 'self'=>'Self'), !empty($customer->payment_type) ? $customer->payment_type : 'loan', ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select', 'id'=>'payment_type']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('payment_type')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('payment_type')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4" id="loan_amount_con">
                    <div class="form-group">
                        <?php echo Form::label('loan_amount', 'Loan Amount', ['class' => 'control-label']); ?>

                        <?php echo Form::number('loan_amount', $customer->loan_amount, ['class' => 'form-control form-control-normal loan_amount', 'placeholder' => 'Loan Amount']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('loan_amount')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('loan_amount')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <h3 class="card-title">Upload Documents</h3>
            <div class="row">
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('aadhar_front', 'Aadhaar Front*', ['class' => 'control-label']); ?>

                        <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->aadhar_front)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->aadhar_front)); ?>" style="width: 200px;"></a></p>
                        <?php if($errors->has('aadhar_front')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('aadhar_front')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('aadhar_back', 'Aadhaar Back*', ['class' => 'control-label']); ?>

                        <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->aadhar_back)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->aadhar_back)); ?>" style="width: 200px;"></a></p>
                        <?php if($errors->has('aadhar_back')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('aadhar_back')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('pan_image', 'Pan Card*', ['class' => 'control-label']); ?>

                        <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->pan_image)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->pan_image)); ?>" style="width: 200px;"></a></p>
                        <?php if($errors->has('pan_image')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('pan_image')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('elect_bill_image', 'Electricity Bill*', ['class' => 'control-label']); ?>

                        <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->elect_bill_image)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->elect_bill_image)); ?>" style="width: 200px;"></a></p>
                        <?php if($errors->has('elect_bill_image')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('elect_bill_image')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <?php echo Form::label('pass_cheque_book', 'Bank Passbook or Cheque*', ['class' => 'control-label']); ?>

                        <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->pass_cheque_book)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->pass_cheque_book)); ?>" style="width: 200px;"></a></p>
                        <?php if($errors->has('pass_cheque_book')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('pass_cheque_book')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <h3 class="card-title">Payment</h3>
            <div class="row">
                <div class="col-md-6 col-sm-12 col-xs-12">
                    <img src="<?php echo e(url('/MerchantQRCode.png')); ?>" style="width: 537px;">
                </div>
                <div class="col-md-6 col-sm-6 col-xs-12">
                    <div class="row">
                        
                        <div class="col-md-12">
                            <div class="form-group">
                                <?php echo Form::label('payment_proof', 'Screenshot of UPI payment', ['class' => 'control-label']); ?>

                                <p class="help-block"><a href="<?php echo e(url('/uploads/proofs/'.$customer->payment_proof)); ?>" target="_blank"><img src="<?php echo e(url('/uploads/proofs/'.$customer->payment_proof)); ?>" style="width: 200px;"></a></p>
                                <?php if($errors->has('payment_proof')): ?>
                                    <p class="help-block error">
                                        <?php echo e($errors->first('payment_proof')); ?>

                                    </p>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="form-group">
                                <?php echo Form::label('payment_reference', 'Payment Reference/UTR No.*', ['class' => 'control-label']); ?>

                                <?php echo Form::text('payment_reference', $customer->payment_reference, ['class' => 'form-control form-control-normal', 'placeholder' => 'Payment Reference/UTR No.', 'required']); ?>

                                <p class="help-block"></p>
                                <?php if($errors->has('payment_reference')): ?>
                                    <p class="help-block error">
                                        <?php echo e($errors->first('payment_reference')); ?>

                                    </p>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="form-group">
                                <?php echo Form::label('sponsor_comment', 'Any Comment Optional', ['class' => 'control-label']); ?>

                                <?php echo Form::text('sponsor_comment', $customer->sponsor_comment, ['class' => 'form-control form-control-normal', 'placeholder' => 'Any Comment Optional']); ?>

                                <p class="help-block"></p>
                                <?php if($errors->has('sponsor_comment')): ?>
                                    <p class="help-block error">
                                        <?php echo e($errors->first('sponsor_comment')); ?>

                                    </p>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <?php if($customer->status==0 || $customer->status==1): ?>
            <h3 class="card-title">Payment</h3>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <?php echo Form::label('status', 'Status*', ['class' => 'control-label']); ?>

                        <?php if($customer->status==0): ?>
                        <?php echo Form::select('status', array(1=>'approved', 4=>'cancelled'), !empty($customer->status) ? $customer->status : '', ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <?php endif; ?>
                        <?php if($customer->status==1 && $customer->payment_type=='loan'): ?>
                        <?php echo Form::select('status', array(2=>'loanApproved', 3=>'loanDeclined'), !empty($customer->status) ? $customer->status : '', ['class' => 'form-control form-control-normal', 'required', 'placeholder' => 'Select']); ?>

                        <?php endif; ?>
                        <p class="help-block"></p>
                        <?php if($errors->has('status')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('status')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <?php echo Form::label('admin_comment', 'Admin Comment*', ['class' => 'control-label']); ?>

                        <?php echo Form::text('admin_comment', $customer->admin_comment, ['class' => 'form-control form-control-normal', 'placeholder' => 'Admin Comment', 'required']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('admin_comment')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('admin_comment')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <?php endif; ?>
        </div>
        <div class="ln_solid"></div>
        <div class="form-group">
          <div class="col-md-12 col-sm-12 col-xs-12 col-md-offset-3 text-center">
            <button type="submit" class="btn btn-lg btn-success">Submit</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<!-- /page content -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('javascript'); ?>
    <!-- Date picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <!-- Date Picker Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
    <!-- Date range Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/jqBootstrapValidation.js"></script>
    <link href="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/easy-autocomplete.min.css" rel="stylesheet">
    <script src="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/jquery.easy-autocomplete.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/typeahead.bundle.js"></script>
    <!-- Parsley -->
    <script>
    $(document).ready(function() {
      jQuery('.mydatepicker, #datepicker').datepicker({format: 'dd-mm-yyyy'});
      $('#state-dropdown').on('change', function() {
            var state_id = this.value;
            $("#city-dropdown").html('');
            $.ajax({
                url:"<?php echo e(url('get-cities-by-state')); ?>",
                type: "POST",
                data: {
                state_id: state_id,
                _token: '<?php echo e(csrf_token()); ?>' 
                },
                dataType : 'json',
                success: function(result){
                $('#city-dropdown').html('<option value="">Select City</option>'); 
                $.each(result.cities,function(key,value){
                $("#city-dropdown").append('<option value="'+value.id+'">'+value.name+'</option>');
                });
                }
            });
        });
    });

    payment_type
    loan_amount

    $(document).ready(function() {
        $('#payment_type').on('change', function() {
            var selectedValue = $(this).val();
            if(selectedValue=="self"){
                $("#loan_amount_con").hide();
            }else{
                $("#loan_amount_con").show();
            }            
        });

        $('#ev_ev_solar_model_id').on('change', function() {
            var selectedValue = $(this).find(':selected').attr('amount');            
            $("input#loan_amount").val(selectedValue);
            
        });
        const form = document.getElementById('demo-form2');

        form.addEventListener('submit', function(event) {
          const amount = $('#ev_ev_solar_model_id').find(':selected').attr('amount');
          
          if ($("input#loan_amount").val() > amount && $('#payment_type').val()=='loan') {
            // Prevent the form from submitting
            event.preventDefault();
            alert('Loan Amount must be less or equal to '+amount);
          }
        });
    });
    
    function copyText() {
      var copyText = document.getElementById("copyInput");
      navigator.clipboard.writeText(copyText.value).then(() => {
        alert("Text copied: " + copyText.value);
      });
    }
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/justsolar/public_html/resources/views/admin/leads/edit_lead.blade.php ENDPATH**/ ?>