<?php $this->load->view('includes/header'); ?>
<div class="page-title">                    
  <h2><span ></span><?php echo $heading_title; ?></h2>
</div>
<div class="page-content-wrap"> 
  <div class="fix"></div>
  <div class="row">
    <div class="col-md-12">
      <?php if ($this->session->flashdata('success')) { ?>
        <div class="alert alert-info">
          <?php echo $this->session->flashdata('success'); ?>
        </div>
      <?php } ?>
      <div class="panel panel-default">
        <div class="panel-body">
          <?php //echo validation_message(); ?>
          <?php echo form_open_multipart('sitepanel/kisans/edit_profile/', 'class="form-horizontal"'); ?> 
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required">*</span>Name</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="admin_name" id="admin_name" value="<?php echo set_value("admin_name",$mres['admin_name']);?>"> 
              <?php echo form_error("admin_name");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Upload Photo</label>
            <div class="col-md-2 col-xs-12">
              <a class="file-input-wrapper btn btn-default  fileinput btn-primary"><span>Browse file</span><input type="file" class="fileinput btn-primary" name="image1" id="image1" title="Browse file" accept="image/*"></a>
              <?php if($mres['admin_image']){
                $product_path = "kisan_sahayak/" . $mres['admin_image']; ?>                                
              <a href="#" data-toggle="modal" data-target=".image_pop" class="pull-right">
                <img src="<?php echo base_url() . 'uploaded-files/' . $product_path; ?>" width="50" class="img-responsive img-rounded center-block" alt="">
              </a>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required">*</span>Mobile Number</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="phone" id="phone" value="<?php echo set_value("phone",$mres['phone']);?>"> 
              <?php echo form_error("phone");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Alt Mobile Number</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="contact_phone" id="contact_phone" value="<?php echo set_value("contact_phone",$mres['contact_phone']);?>"> 
              <?php echo form_error("contact_phone");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required">*</span>Personal Email ID</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="admin_email" id="admin_email" value="<?php echo set_value("admin_email",$mres['admin_email']);?>"> 
              <?php echo form_error("admin_email");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Official Email ID</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="contact_email" id="contact_email" value="<?php echo set_value("contact_email",$mres['contact_email']);?>"> 
              <?php echo form_error("contact_email");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required">*</span>Address</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="address" id="address" value="<?php echo set_value("address",$mres['address']);?>"> 
              <?php echo form_error("address");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>PIN Code</label>
            <div class="col-md-6">                                     
              <input type="text" class="form-control" name="pincode" id="pincode" value="<?php echo set_value("pincode",$mres['pincode']);?>"> 
              <?php echo form_error("pincode");?>
            </div>
          </div>
          <div class="form-group" style="background:#eee">
                <label class="col-md-3 control-label"><strong>KYC Docs</strong></label>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Aadhar Card</label>
            <div class="col-md-2 col-xs-12">
              <a class="file-input-wrapper btn btn-default  fileinput btn-primary"><span>Browse file</span><input type="file" class="fileinput btn-primary" name="aadhar_card" id="aadhar_card" title="Browse file" accept="image/*"></a>
              <?php if($mres['aadhar_card']){
                $product_path = "kisan_sahayak/" . $mres['aadhar_card']; ?>                                
              <a href="#" data-toggle="modal" data-target=".image_pop" class="pull-right">
              <img src="<?php echo base_url() . 'uploaded-files/' . $product_path; ?>" width="50" class="img-responsive img-rounded center-block" alt="">
              </a>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>PAN Card</label>
            <div class="col-md-2 col-xs-12">
              <a class="file-input-wrapper btn btn-default  fileinput btn-primary"><span>Browse file</span><input type="file" class="fileinput btn-primary" name="pan_card" id="pan_card" title="Browse file" accept="image/*"></a>
              <?php if($mres['pan_card']){
                $product_path = "kisan_sahayak/" . $mres['pan_card']; ?>                                
              <a href="#" data-toggle="modal" data-target=".image_pop" class="pull-right">
              <img src="<?php echo base_url() . 'uploaded-files/' . $product_path; ?>" width="50" class="img-responsive img-rounded center-block" alt="">
              </a>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Cancelled Cheque</label>
            <div class="col-md-2 col-xs-12">
              <a class="file-input-wrapper btn btn-default  fileinput btn-primary"><span>Browse file</span><input type="file" class="fileinput btn-primary" name="cancelled_Cheque" id="cancelled_Cheque" title="Browse file" accept="image/*"></a>
              <?php if($mres['cancelled_Cheque']){
                $product_path = "kisan_sahayak/" . $mres['cancelled_Cheque']; ?>                                
              <a href="#" data-toggle="modal" data-target=".image_pop" class="pull-right">
              <img src="<?php echo base_url() . 'uploaded-files/' . $product_path; ?>" width="50" class="img-responsive img-rounded center-block" alt="">
              </a>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required"></span>Address Proof</label>
            <div class="col-md-2 col-xs-12">
              <a class="file-input-wrapper btn btn-default  fileinput btn-primary"><span>Browse file</span><input type="file" class="fileinput btn-primary" name="address_proof" id="address_proof" title="Browse file" accept="image/*"></a>
              <?php if($mres['address_proof']){
                $product_path = "kisan_sahayak/" . $mres['address_proof']; ?>                                
              <a href="#" data-toggle="modal" data-target=".image_pop" class="pull-right">
                <img src="<?php echo base_url() . 'uploaded-files/' . $product_path; ?>" width="50" class="img-responsive img-rounded center-block" alt="">
              </a>
              <?php } ?>
            </div>
          </div>

          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label">Has Laptop?</label>
            <?php $has_laptops=set_value("has_laptop",$mres['has_laptop']);?>
            <div class="col-md-6">                                     
              <input type="radio" name="has_laptop" value="No" checked="checked"> No &nbsp;&nbsp;
              <input type="radio" name="has_laptop" value="Yes" <?php if($has_laptops=='Yes'){ echo 'checked="checked"';}?>> Yes
              <?php //echo form_error("has_laptop");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label">Has Smartphone?</label>
            <?php $has_smartphones=set_value("has_smartphone",$mres['has_smartphone']);?>
            <div class="col-md-6">                                     
              <input type="radio" name="has_smartphone" value="No" checked="checked"> No &nbsp;&nbsp;
              <input type="radio" name="has_smartphone" value="Yes" <?php if($has_smartphones=='Yes'){ echo 'checked="checked"';}?>> Yes
              <?php //echo form_error("has_laptop");?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label">Has Vehicle?</label>
            <?php $has_vehicles=set_value("has_vehicle",$mres['has_vehicle']);?>
            <div class="col-md-1">                                     
              <input type="radio" name="has_vehicle" class="has_vehicle" value="No" checked="checked"> No &nbsp;&nbsp;
              <input type="radio" name="has_vehicle" class="has_vehicle" value="Yes" <?php if($has_vehicles=='Yes'){ echo 'checked="checked"';}?>> Yes
            </div>
            <div class="col-md-1" id="has_vehicles">
              <?php $which_vehicles=array();?>
              <?php if($this->input->post()){$which_vehicles=$this->input->post("which_vehicle");}else{$which_vehicles=@explode(",",$mres['which_vehicle']);}   ?>
              <input type="checkbox" name="which_vehicle[]" value="Bike" <?php if(!empty($which_vehicles) && in_array("Bike", $which_vehicles)){ echo 'checked="checked"';} ?> > Bike &nbsp;&nbsp;
              <input type="checkbox" name="which_vehicle[]" value="Car" <?php if(!empty($which_vehicles) && in_array("Car", $which_vehicles)){ echo 'checked="checked"';} ?> > Car
            </div>
          </div>
          <?php /*
          <div class="form-group">
            <label class="col-md-3 col-xs-12 control-label"><span class="required">**</span>WhatsApp Number</label>
            <div class="col-md-6">
              <input type="text" name="whatsapp" class="form-control" value="<?php echo set_value('whatsapp', $admin_info->whatsapp); ?>" />                                                    
            </div>
          </div>*/ ?>

          <div class="form-group">
            <div class="col-md-8">
              <input type="submit" class="btn bg-red pull-right" value="Update Info"  />
            </div>
          </div>
          <?php echo form_close(); ?>
        </div>
      </div>
    </div>
  </div>
</div>
<?php $this->load->view('includes/footer'); ?>
<script>
  $(document).ready(function () {
    if($(".has_vehicle:checked").val()=='No'){
        $("#has_vehicles").hide();
      }
    $(".has_vehicle").click(function(){
      var hasval=$(".has_vehicle:checked").val();
      if(hasval=='Yes'){
        $("#has_vehicles").show();
      }else{
        $("#has_vehicles").hide();
      }
    });
    
  });
</script>