<!-- begin:: Subheader -->
<div class="kt-subheader   kt-grid__item" id="kt_subheader">
<div class="kt-container  kt-container--fluid ">
    <div class="kt-subheader__main">       
        <div class="kt-subheader__breadcrumbs">
            <a  class="kt-subheader__breadcrumbs-link">
                Leads </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            <a class="kt-subheader__breadcrumbs-link">
                Update Lead </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            
        </div>
    </div>                                        
</div>
</div>
<!-- end:: Subheader -->
<!-- begin:: Content -->
<div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
   <div class="kt-portlet">
      <div class="kt-portlet__body kt-portlet__body--fit">
         <div class="kt-grid  kt-wizard-v1 kt-wizard-v1--white" id="kt_projects_add" data-ktwizard-state="first">            
            <div class="kt-grid__item kt-grid__item--fluid kt-wizard-v1__wrapper">
               <!--begin: Form Wizard Form-->
               <form class="kt-form" id="kt_form" action="<?=base_url();?>leads/process_edit_lead/<?=$get_lead['id']; ?>" method="post" novalidate="novalidate">
                  <!--begin: Form Wizard Step 1-->
                  <div class="kt-wizard-v1__content" data-ktwizard-type="step-content" data-ktwizard-state="current">
                     <div class="kt-heading kt-heading--md">Basic Information:</div>
                     <div class="kt-section kt-section--first">
                        <div class="kt-wizard-v1__form">
                            <?php $validation = \Config\Services::validation(); ?>
                           <div class="row">
                              <div class="col-xl-12">
                                 <div class="kt-section__body">                                    
                                    <div class="form-group row <?= $validation->hasError('full_name') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Name
                                            <span class="required"> * </span>
                                        </label>
                                        <div class="col-lg-9 col-xl-9">
                                            <input type="text" name="full_name" id="full_name" placeholder="Enter Full Name" class="form-control input-height" value="<?=(isset($get_lead['name'])?$get_lead['name']:old('full_name')); ?>" required/> 
                                            <span class="help-block"> <?= $validation->getError('full_name'); ?> </span>
                                            </div>
                                    </div>
                                    <div class="form-group row <?= $validation->hasError('mobile') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Mobile No.
                                            <span class="required"> * </span>
                                        </label>
                                        <div class="col-lg-9 col-xl-9">
                                            <input name="mobile" id="mobile" type="text" placeholder="Mobile Number" maxlength="10" class="form-control input-height" value="<?=(isset($get_lead['phone'])?$get_lead['phone']:old('mobile')); ?>" required/> 
                                            <span class="help-block"> <?= $validation->getError('mobile'); ?> </span>
                                            </div>
                                    </div>                                           
                                    <div class="form-group row <?= $validation->hasError('email') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Email ID
                                        </label>
                                        <div class="col-lg-9 col-xl-9">
                                             <input type="text" class="form-control input-height" name="email" id="email" placeholder="Email Address" value="<?=(isset($get_lead['email'])?$get_lead['email']:old('email')); ?>" required/>
                                        <span class="help-block"> <?= $validation->getError('email'); ?> </span>
                                        </div>
                                    </div>
                                    <?php $courses = get_courses();?>   
                                    <div class="form-group row <?= $validation->hasError('course') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Course
                                            <span class="required"> * </span>
                                        </label>
                                        <div class="col-lg-9 col-xl-9">                                             
                                            <select name="course" id="course" class="form-control input-height" required>
                                                  <option value="">Choose Course</option>
                                                  <?php foreach($courses as $value){ ?>
                                                    <option value="<?= $value['name']; ?>" <?= (old('course', $get_lead['course'] ?? '') == $value['name']) ? 'selected' : ''; ?>> <?= $value['name']; ?>
</option>
                                                <?php } ?>      
                                            </select> 
                                            <span class="help-block"> <?= $validation->getError('course'); ?> </span>
                                        </div>
                                    </div>
                                    <?php $state_list = get_state_list();?>
                                    <div class="form-group row <?= $validation->hasError('state') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">State 
                                            <span class="required"> * </span>
                                        </label>
                                        <div class="col-lg-9 col-xl-9">                                             
                                            <select name="state" id="select_state" class="form-control input-height" required>
                                                  <option value="">Choose State</option>
                                                   <?php foreach($state_list as $value){ ?>
                                                    <option value="<?=$value['state'];?>" <?= (old('state', $get_lead['state'] ?? '') == $value['state']) ? 'selected' : ''; ?>><?=$value['state'];?></option>
                                                <?php } ?>     
                                            </select> 
                                            <span class="help-block"> <?= $validation->getError('state'); ?> </span>
                                        </div>
                                    </div>
                                    <div class="form-group row <?= $validation->hasError('city') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">City  
                                            <span class="required"> * </span>
                                        </label>
                                        <div class="col-lg-9 col-xl-9">                                             
                                            <select name="city" id="select_city" class="form-control input-height" required>
                                                  <option value="">Choose City</option>
                                                   <?php 
                                                  $city_list = get_city_by_state($get_lead['state']);
                                                  foreach($city_list as $value){ ?>
                                                    <option value="<?=$value['city_name'];?>" <?= (old('city', $get_lead['city'] ?? '') == $value['city_name']) ? 'selected' : ''; ?>><?=$value['city_name'];?></option>
                                                <?php } ?>                                                 
                                            </select> 
                                            <span class="help-block"> <?= $validation->getError('city'); ?> </span>
                                        </div>
                                    </div>
                                    <div class="form-group row <?= $validation->hasError('lead_source') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Lead Source  
                                        </label>
                                        <div class="col-lg-9 col-xl-9">                                             
                                            <select name="lead_source" id="select_city" class="form-control input-height">
                                                  <option value="">Choose Lead Source</option>
                                                  <?php 
                                                  $lead_source = get_lead_source_list();
                                                  foreach($lead_source as $value){ ?>
                                                    <option value="<?=$value['name']?>" <?= (old('lead_source', $get_lead['lead_source'] ?? '') == $value['name']) ? 'selected' : ''; ?>><?=$value['name'];?></option>
                                                <?php } ?>                                                        
                                            </select> 
                                            <span class="help-block"> <?= $validation->getError('lead_source'); ?> </span>
                                        </div>
                                    </div>
                                    <div class="form-group row <?= $validation->hasError('remarks') ? 'has-error' : ''; ?>">
                                        <label class="col-xl-3 col-lg-3 col-form-label">Remarks
                                        </label>
                                        <div class="col-lg-9 col-xl-9">
                                            <textarea  name="remarks" id="remarks" placeholder="Choose Date" class="form-control input-height" ><?=(isset($get_lead['remarks'])?$get_lead['remarks']:old('remarks')); ?> </textarea>
                                            <span class="help-block"> <?= $validation->getError('remarks'); ?> </span>
                                        </div>
                                    </div>               
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                  </div>
                  <!--end: Form Wizard Step 1-->         
                 <!--begin: Form Actions -->
                  <div class="kt-form__actions">                    
                     <button type="Submit" class="btn btn-brand btn-md btn-tall btn-wide kt-font-bold kt-font-transform-u" data-ktwizard-type="action-next">
                        Submit
                     </button>
                  </div>
                  <!--end: Form Actions -->
               </form>
               <!--end: Form Wizard Form-->
            </div>
         </div>
      </div>
   </div>
</div>