<?php 
$user_data =  array(1,2,3,5,9,11);
if(in_array($userId,$user_data)){
	$vocher = '';
	$invoice = '';
	$remark = '';	
}else{
	$vocher = 'readonly';
	$invoice = 'readonly';
	$remark = 'required="required"';
}

$cretae_of_date = date("d-m-Y", strtotime("".$report->CreatedDate."+10 days"));
$cretae_of_date_invoice = date("d-m-Y", strtotime("".$report->CreatedDate."+60 days"));

$now_of_date = new DateTime("now");
$cretae_of_date = new DateTime($cretae_of_date);
$cretae_of_date_invoice = new DateTime($cretae_of_date_invoice);

if($now_of_date < $cretae_of_date){
	$vocher = '';			
}else{
	$vocher = 'readonly';
}

if($now_of_date < $cretae_of_date_invoice){
	$invoice = '';			
}else{
	$invoice = 'readonly';
}
?>

<div class="content-wrapper"> 
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1> Channellimo <small>Preview</small> </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
      <li><a href="#">Forms</a></li>
      <li class="active"> CLSERVICE</li>
    </ol>
  </section>
  <section class="content">
     <div class="box">
     	<div class="box-header">
        	<h3 class="box-title">SERVICES REPORT</h3>
      	</div>
      	<div class="box-body">
        	<div class="col-lg-10">
        	<?php echo validation_errors('<div class="error">', '</div>'); ?> 
			<?php echo form_open('');?>
            <div class="form-group col-lg-4">
              <label>Date Service</label>
              <input class="form-control" name="date" id="date0" placeholder="Enter Date Service" value="<?php echo $report->Date;?>" readonly>
            </div>
            <div class="form-group col-lg-4">
              <label>Company Name</label>
              <input class="form-control" name="company" id="company" placeholder="Enter Company Name" value="<?php echo $report->Company;?>" readonly>
            </div>
            <div class="form-group col-lg-4">
              <label>Guest Name</label>
              <input class="form-control" name="guset" id="guset" placeholder="Enter Guest Name" value="<?php echo $report->GuestName;?>" readonly>
            </div>
            <div class="form-group col-lg-4">
              <label>Driver Name</label>
              <input class="form-control" name="driver" id="driver" placeholder="Enter Driver Name" value="<?php echo $report->DriverName;?>" readonly>
            </div>
            <div class="form-group col-lg-4">
              <label>Seller Name</label>
              <input class="form-control" name="sellerName" id="sellerName" placeholder="Enter Seller Name" value="<?php echo $report->Seller;?>" >
            </div>
            <div class="form-group col-lg-4">
              <label>Car Type</label>
              <input class="form-control" name="cartype" id="cartype" placeholder="Enter Car Type" value="<?php echo $report->CarType;?>" readonly>
            </div>
            <div class="form-group col-lg-4">
              <label>Vocher Number</label>
              <input class="form-control" name="vochernumber" id="vochernumber" placeholder="Enter Vocher Number" value="<?php echo $report->VocherNumber;?>" <?php echo $vocher;?>>
            </div>
            <div class="form-group col-lg-4">
              <label>Invoice Number</label>
              <input class="form-control" name="invoicenumber" id="invoicenumber" placeholder="Enter Invoice Number" value="<?php echo $report->InvoiceNumber;?>" <?php echo $invoice;?>>
            </div>
            <div class="form-group col-lg-12">
              <label>Service Detail</label>
              <textarea class="form-control" rows="3" name="servicedetail" id="servicedetail" placeholder="Service Detail" readonly><?php echo $report->ServiceDetail;?></textarea>
            </div>
            <div class="form-group col-lg-12">
              <label>Remark</label>
              <textarea class="form-control" rows="3" name="remark" id="remark" placeholder="Remark" <?php echo $remark;?>><?php echo $report->Remark;?></textarea>
            </div>
            
            <div class="form-group col-lg-12">
              <label>Reason</label>
              <textarea class="form-control" rows="3" name="reason" id="reason" placeholder="Reason" required="required"></textarea>
            </div>
            <div class="form-group col-lg-12">
              <br></br>
              <input type="submit" name="update_report" value="Update" class="btn btn-primary save"/>
              <button type="reset" class="btn btn-danger">Reset</button>
            </div>
			<?php echo form_close();?>
            </div>
        <div>   
     </div>
  </section>
</div>

<?php 
if ($this->session->flashdata('errors')){ 
	echo "<div class='error'>";
	echo $this->session->flashdata('errors');
	echo "</div>";
}
?>
<?php echo validation_errors('<div class="error">', '</div>'); ?> <?php echo form_open('');?>