<div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <div class="img-profile ml-3">
           
            </div>
            <h1 class="m-0 text-dark"><?php echo (isset($driverdetails)) ? 'Edit Rent Request Form' : 'Add Rent Request Form' ?>
            </h1>

          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="<?= base_url(); ?>/rent">Rent</a></li>
              <li class="breadcrumb-item active"><?php echo (isset($driverdetails)) ? 'Add Rent Request' : 'Add Rent Request' ?></li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <form method="post" id="addrent" class="card" action="<?php echo base_url() . "rent/updaterent/".$id; ?>" enctype="multipart/form-data">
      <!-- Main content -->
      <section class="content">
        <div class="container-fluid">
          <div class="card-body">


            <div class="row">
              <input type="hidden" name="r_id" id="r_id" value="<?php echo (isset($driverdetails)) ? $driverdetails['d_id'] : '' ?>">

              <div class="col-sm-6 col-md-3">
                <label class="form-label">Full Name<span class="form-required">*</span></label>
                <div class="form-group">
                  <input type="text" name="r_fullName" id="fullName" class="form-control" placeholder="Full Name" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_fullName'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <div class="form-group">
                  <label class="form-label">Father Name<span class="form-required">*</span></label>
                  <input type="text" name="r_fatherName" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_fatherName'] : '' ?>" class="form-control" placeholder="Father Name">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <div class="form-group">
                  <label class="form-label">Id Card<span class="form-required">*</span></label>
                  <input type="number" name="r_idcard" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_idcard'] : '' ?>" class="form-control" placeholder="ID Card#">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <div class="form-group">
                  <label class="form-label">Phone Number<span class="form-required">*</span></label>
                  <input type="number" name="r_phoneNumber" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_phoneNumber'] : '' ?>" class="form-control" placeholder="Phone Number">
                </div>
              </div>
              <div class="col-sm-12 col-md-12">
                <div class="form-group">
                  <label class="form-label">Address<span class="form-required">*</span></label>
                  <input type="text" name="r_address" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_address'] : '' ?>" class="form-control" placeholder="Address">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <div class="form-group">
                  <label class="form-label">Car No<span class="form-required">*</span></label>
                  <input type="text" name="r_carno" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_carno'] : '' ?>" class="form-control" placeholder="Car Number">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <div class="form-group">
                  <label class="form-label">Chassis No<span class="form-required">*</span></label>
                  <input type="text" name="r_chassisno" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_chassisno'] : '' ?>" class="form-control" placeholder="Chassis Number">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <div class="form-group">
                  <label class="form-label">Engine No<span class="form-required">*</span></label>
                  <input type="text" name="r_engineno" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_engineno'] : '' ?>" class="form-control" placeholder="Engine Number">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Make</label>
                <div class="form-group">
                  <input type="text" name="r_make" id="make" class="form-control" placeholder="Make" 
                  value="<?php echo (isset($driverdetails)) ? $driverdetails['r_make'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Model</label>
                <div class="form-group">
                  <input type="text" name="r_model" id="model" class="form-control" placeholder="Model" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_model'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Color</label>
                <div class="form-group">
                  <input type="text" name="r_color" id="color" class="form-control" placeholder="Color" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_color'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Car Value</label>
                <div class="form-group">
                  <input type="text" name="r_carvalue" id="carvalue" class="form-control" placeholder="Car value" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_carvalue'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <label class="form-label">Metar Out</label>
                <div class="form-group">
                  <input type="text" name="r_metarout" id="metarout" class="form-control" placeholder="Metar Out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_metarout'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <label class="form-label">Date Out</label>
                <div class="form-group">
                  <input type="date" name="r_dateout" id="dateout" class="form-control" placeholder="Date out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_dateout'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <label class="form-label">Time Out</label>
                <div class="form-group">
                  <input type="time" name="r_timeout" id="timeout" class="form-control" placeholder="Time Out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_timeout'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-6">
                <label class="form-label">Date In</label>
                <div class="form-group">
                  <input type="date" name="r_datein" id="datein" class="form-control" placeholder="Date out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_datein'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-6">
                <label class="form-label">Time In</label>
                <div class="form-group">
                  <input type="time" name="r_timein" id="timein" class="form-control" placeholder="Time Out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_timein'] : '' ?>">
                </div>
              </div>
             <div class="col-sm-6 col-md-4">
                <label class="form-label">Metar IN</label>
                <div class="form-group">
                  <input type="text" name="r_metarin" id="metarin" class="form-control" placeholder="Metar In" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_metarin'] : '' ?>">
                </div>
              </div>
              <!-- <div class="col-sm-6 col-md-4">
                <label class="form-label">Date Out</label>
                <div class="form-group">
                  <input type="date" name="r_dateout" id="dateout" class="form-control" placeholder="Date out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_dateout'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <label class="form-label">Time Out</label>
                <div class="form-group">
                  <input type="time" name="r_timeout" id="timeout" class="form-control" placeholder="Time Out" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_timeout'] : '' ?>">
                </div>
              </div>
               -->
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Rent P-Day</label>
                <div class="form-group">
                  <input type="text" name="r_rentperday" id="r_rentperday" class="form-control" placeholder="Rent P-Day" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_rentperday'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Rent P-Month</label>
                <div class="form-group">
                  <input type="text" name="r_rentpermonth" id="r_rentpermonth" class="form-control" placeholder="Rent P-Month" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_rentpermonth'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Advance</label>
                <div class="form-group">
                  <input type="text" name="r_advance" id="r_advance" class="form-control" placeholder="Advance" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_advance'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-3">
                <label class="form-label">Balance</label>
                <div class="form-group">
                  <input type="text" name="r_balance" id="r_balance" class="form-control" placeholder="Balance" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_balance'] : '' ?>">
                </div>
              </div>

              <div class="col-sm-6 col-md-4">
                <label class="form-label">Duration</label>
                <div class="form-group">
                  <input type="text" name="r_duration" id="r_duration" class="form-control" placeholder="Duration" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_duration'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-4">
                <label class="form-label">Type</label>
                <div class="form-group">
                    <select name="r_type" id="r_type" class="form-control">
                        <option <?php if($driverdetails['r_type']=="driver"){echo 'selected';} ?> value="driver">Driver</option>
                        <option <?php if($driverdetails['r_type']=="self"){echo 'selected';} ?> value="self">Self</option>
                    </select>
                 
                </div>
              </div>

              <div class="col-sm-6 col-md-4">
                <div class="form-group">
                  <label class="form-label">Driver License <span class="form-required">*</span></label>
                  <input type="text" name="d_driverlicense" value="<?php echo (isset($driverdetails)) ? $driverdetails['d_driverlicense'] : '' ?>" class="form-control" placeholder="Driver License">
                </div>
              </div>

            </div>

          </div>

        </div>
      </section>
      <!-- /.content -->

      <!-- Main content -->
      <section class="content">
        <div class="container-fluid">
          <div class="card-body">

            <hr>
            <div class="row">
            <div class="col-sm-12 col-md-12" style="text-align: center;">
                    <h4> Guarantor</h4>
                </div>
            </div>
            <div class="row">
            <div class="col-sm-6 col-md-6">
                <label class="form-label">Guarantor Name</label>
                <div class="form-group">
                  <input type="text" name="r_guarantorname" id="r_guarantorname" class="form-control" placeholder="Guarantor Name" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_guarantorname'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-6">
                <label class="form-label">Father Name</label>
                <div class="form-group">
                  <input type="text" name="r_gfathername" id="r_fathername" class="form-control" placeholder="Father Name" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_gfathername'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-6">
                <label class="form-label">NIC Number</label>
                <div class="form-group">
                  <input type="text" name="r_gnicnumber" id="r_gnicnumber" class="form-control" placeholder="NIC Number" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_gnicnumber'] : '' ?>">
                </div>
              </div>
              <div class="col-sm-6 col-md-6">
                <label class="form-label">Phone Number</label>
                <div class="form-group">
                  <input type="text" name="r_gphonenumber" id="r_gphonenumber" class="form-control" placeholder="NIC Number" value="<?php echo (isset($driverdetails)) ? $driverdetails['r_gphonenumber'] : '' ?>">
                </div>
              </div>
            </div>
          </div>
          <input type="hidden" id="created_by" name="v_createdBy" value="<?php echo output($this->session->userdata['session_data']['u_id']); ?>">
          <input type="hidden" id="created_date" name="v_createdDate" value="<?php echo date('Y-m-d h:i:s'); ?>">
          <div class="card-footer text-right">
            <button type="submit" class="btn btn-primary"> <?php echo (isset($driverdetails) && isset($driverdetails)) ? 'Update' : 'Update' ?></button>
          </div>
        </div>
      </section>
      <!-- /.content -->
    </form>