<link href="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/ui.theme.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/autocomplete/autocomplete.css" rel="stylesheet">
    <script src="<?php echo base_url(); ?>assets/autocomplete/jquery-ui.min.js"></script>
	


<script type="text/javascript">


		$(this).ready( function() {  
            $("#mysupplier").autocomplete({  
 
                minLength: 1,  
                source:   
                function(req, add){  
                    $.ajax({  
                        url: "<?php echo base_url(); ?>Systemusers/customerSaleslookup",  
                        dataType: 'json',  
                        type: 'POST',  
                        data: req,  
                        success:      
                        function(data){  
                            if(data.response =="true"){  
                                add(data.message);  
                                console.log(data);
                            }  
                        },  
                    });  
                },  
                     
            });  
        });










	 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });






     $(document).on("click", "#managebtnreturn", function()
        {
			
			
			     var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid);  	
          var createdate = $(this).data('createdate');
		  $("#createdate").val(createdate); 
		  
		    var category = $(this).data('category');
		   $("#category").val(category); 
		   
		     var code = $(this).data('code');
		   $("#code").val(code); 
		 
		     var status = $(this).data('status');
		   $("#status").val(status);


		     var startdate = $(this).data('startdate');
		   $("#startdate").val(startdate); 

		     var fuel = $(this).data('fuel');
		   $("#fuel").val(fuel); 	


  var millage = $(this).data('millage');
		   $("#millage").val(millage);


		     var trips = $(this).data('trips');
		   $("#trips").val(trips); 

		     var description = $(this).data('description');
		   $("#description").val(description); 	

  var receiver = $(this).data('receiver');
		   $("#receiver").val(receiver);


		     var nextfuel = $(this).data('nextfuel');
		   $("#nextfuel").val(nextfuel); 	   
		   
        });
		
		
	   $(document).on("click", "#editbtn", function()
        {
     	
		     var description = $(this).data('description');
		   $("#description1").val(description); 
		 
		     var subject = $(this).data('subject');
		   $("#subject1").val(subject);


		  
        });
		
	  $(document).on("click", "#viewbtn", function()
        {
     	     var taskid = $(this).data('id');
		  $("#taskid2").val(taskid);  	
          var taskowner = $(this).data('taskowner');
		  $("#taskowner2").val(taskowner); 
		  
		    var subject = $(this).data('subject');
		   $("#subject2").val(subject); 
		   
		     var comments = $(this).data('comments');
		   $("#comments2").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status2").val(status);


		     var fromdate = $(this).data('fromdate');
		   $("#fromdate2").val(fromdate); 

		     var todate = $(this).data('todate');
		   $("#todate2").val(todate); 		
	
		   
 var 	category = $(this).data('category');
		   $("#category2").val(category); 		
 var contact = $(this).data('contact');
		   $("#contact2").val(contact); 		
 var controller = $(this).data('controller');
		   $("#controller2").val(controller); 		
 var priority = $(this).data('priority');
		   $("#priority2").val(priority); 	

 var notification = $(this).data('notification');
		   $("#notification2").val(notification);
		   
		    var repeated = $(this).data('repeated');
		   $("#repeated2").val(repeated);
		   
		   
		  
        });
		
    </script>
 
 <div class="row">
  
   	

   	<div class="col-md-12">
	<?PHP
				$session_data = $this->session->userdata('logged_in');

    $session_data = $this->session->userdata('logged_in');

   
 	$data['id'] = $session_data['id'];
        
		 $userid = $data['id'];


				
				
				$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
 echo $this->session->flashdata('deletemsg'); 

				
					 
	    $addcomplain=$this->usermodel->populatuserpermissionsdataarray('complain','add',$userid);

	 $updatecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','update',$userid);
  $deletecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','delete',$userid);
	 
			    $viewcomplain=$this->usermodel->populatuserpermissionsdataarray('complain','view',$userid);
			    $readallcomplain=$this->usermodel->populatuserpermissionsdataarray('sales','allcompalin',$userid);
				
				
	   
								?>	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				 <span class="pull-right"> View Orders</span>
				 
				 
	  <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">Add Orders  </a>
				 
				 <?php
										if($usertype=="admin"){
											
											?>

		<a href="<?php echo base_url();?>user/downloadcalls" class="btn btn-info">download    Orders </a>	 

										<?php
										}
										
											?>
										
            	</div>
            </div>
			<div class="panel-body">

			
	<div class="widget-content nopadding table_holder table-responsive" >				
			
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
		<div class="col-md-12">
        <?php 
		 echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchcallcenter", $attr);?>
            <div class="form-group">
			
                <div class="col-md-5">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for complains.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
                <div class="col-md-4">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-success" value="Search" />
                    <a href="<?php echo base_url(). "user/openorders"; ?>" class="btn btn-primary">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>
        </div>
					FUEL ORDERS				
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
		    <th>No</th>
     <th>Date</th>
	 <th>Qty</th>
	       <th>Next Fuel</th>
						<th>Adjusted</th>

     <th>Vehicle No</th>
	   <th>Start date</th>
	   	   <th>End Date</th>
		      <th>Previous Date</th>
	   	   <th>Exact Fuel</th>
	   	   <th>Millage</th>
		      <th>Trips</th>
			  		      <th>Previous qty</th>
	   	   <th>Description</th>
	   	   <th>Incharge</th>

	   <th>Status</th>
	    



		   <th>More</th> 

                 </tr>
             </thead>
<?php

 if(!is_array($openorders)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='1'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($openorders as $c): 

		 

             ?>



             <tr>
                
            <?php 
$id=$c->id;
$myinvoice=$c->id;


?>


  
      <td><?php echo $c->id ; ?> 
	  
	  
<a  id="non-printable"  href="<?php echo base_url();?>user/printreadingorder?invoice=<?php   if(isset($myinvoice)) {echo $myinvoice; } ?>&view=user/openorders"> Print   </a>

	  
	  
	  </td>

  
      <td><?php echo $c->createdate ; ?></td>
	        <td><?php echo $c->exactfuel ; ?></td>

	     <td><?php echo $c->nextfuel ; ?></td>
   	  <td><?php echo $c->adjusted ; ?></td>

  <td><?php 

$people = $this->usermodel->populateallarray('people','id',$c->code);
									echo $firstname=$people[0]["firstname"];
									echo " ".$company=$people[0]["company"];

  ?></td>
   <td><?php echo $c->startdate ; ?></td>

      <td><?php echo $c->startdate ; ?></td>
      <td><?php echo $c->previoufueldate ; ?></td>
	     <td><?php echo $c->fuel ; ?></td>

	
	
	  <td><?php echo $c->millage ; ?></td>
   	  <td><?php echo $c->trips ; ?></td>
	  
	   <td><?php echo $c->previousfuelused ; ?></td>

   <td><?php echo $c->description ; ?></td>
      <td><?php echo $c->receiver ; ?></td>

      <td><?php echo $c->status ; ?></td>

   
	   
	   
     		  <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									<?php
										if($deletecomplain==TRUE){
											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										  
                                        
													<li> 
										 <a class="btn btn-warning managebtn" id="managebtnreturn" data-receiver='<?php echo  $c->receiver;?>' data-nextfuel='<?php echo  $c->nextfuel;?>' data-category='<?php echo  $c->category;?>' data-code='<?php echo  $c->code;?>' data-startdate='<?php echo  $c->startdate;?>' data-fuel='<?php echo  $c->fuel;?>' data-millage='<?php echo  $c->millage;?>' data-trips='<?php echo  $c->trips;?>' 	   data-status='<?php echo  $c->status;?>' data-description='<?php echo  $c->description;?>' data-receiver='<?php echo  $c->receiver;?>'	 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#returnModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Change Status
                                                </a>
                                                        </li> 
														                                        <li class="divider"></li>

											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#deleteModel<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
										
                                        
                                        <!-- teacher DELETION LINK -->
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td>
             </tr>

	<?php endforeach;} ?>

         

        </table>
		  <div class="col-md-12 text-center">    <?php echo $links; ?>
					   		<span style="color:red; font-size:20px"><?php  echo $total_rows. "   Records. " ;?>    </span>

        
        </div>
	</div>






	
	
	<div id="returnModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">UPDATE STATUS</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to Update  this  item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/addneworders' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>

<input type="hidden" name="action" value="update" class="form-control" required placeholder="Enter action">

		  		<input type="hidden" id="mycategoryid" name="mycategoryid" value="" class="form-control" required placeholder="Enter mycategoryid">




<div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="category" id="category" required>
	
	<option value=""  >Select Order Category</option>
			<option value="Start" selected="selected"  >Start Order</option>
			<option value="Close"  >Close Order</option>

	
	
</select>
		
						<span class="text-danger"><?php echo form_error('category'); ?>

	</div>
  </div>
  	
	<div class="form-group">
    <label for="inputcode" class="col-sm-2 control-label">Vehicle Number </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="code"  id="code" value="<?php echo set_value('code'); ?>" class="form-control" required placeholder="Enter Vehicle Number">
		 
				
		<span class="text-danger"> <?php echo form_error('code'); ?>
		
		</span>
	</div>
  </div>

<div class="form-group">
    <label for="inputnextfuel" class="col-sm-2 control-label">Next Fuel </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="nextfuel" name="nextfuel" value="<?php echo set_value('nextfuel'); ?>" class="form-control" required placeholder="Enter next fuel to fill">
		 
				
		<span class="text-danger"> <?php echo form_error('nextfuel'); ?>
		
		</span>
	</div>
  </div>


 <div class="form-group">
    <label for="inputstartdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"   id="startdate" name="startdate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('startdate'); ?>
		
		</span>

  	</div>
  </div>
  



 <div class="form-group">
    <label for="inputclosedate" class="col-sm-2 control-label">Close Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  id="closedate"  name="closedate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter close  date">
		 
				
		<span class="text-danger"> <?php echo form_error('closedate'); ?>
		
		</span>

  	</div>
  </div>
  

	<div class="form-group">
    <label for="inputfuel" class="col-sm-2 control-label">Fuel Used  </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="fuel" name="fuel" value="<?php echo set_value('fuel'); ?>" class="form-control" required placeholder="Enter Lts of fuel used">
		 
				
		<span class="text-danger"> <?php echo form_error('fuel'); ?>
		
		</span>
	</div>
  </div>



	<div class="form-group">
    <label for="inputtrips" class="col-sm-2 control-label">Trips Covered </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="trips" name="trips" value="<?php echo set_value('trips'); ?>" class="form-control" required placeholder="Enter trips covered">
		 
				
		<span class="text-danger"> <?php echo form_error('trips'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputmillage" class="col-sm-2 control-label">Millage Covered </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="millage" name="millage" value="<?php echo set_value('millage'); ?>" class="form-control" required placeholder="Enter millage covered">
		 
				
		<span class="text-danger"> <?php echo form_error('millage'); ?>
		
		</span>
	</div>
  </div>

  <div class="form-group">
    <label for="inputreceiver" class="col-sm-2 control-label">Incharge Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="receiver"  name="receiver" value="<?php echo set_value('receiver'); ?>" class="form-control" required placeholder="Enter incharge name.">
		 
				
		<span class="text-danger"> <?php echo form_error('receiver'); ?>
		
		</span>
	</div>
  </div>
  

 
  

  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">
		  		<input type="text" id="description"  name="description" value="<?php echo set_value('description'); ?>" class="form-control" required placeholder="Enter description">

			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
  <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">Status?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status"  id="status" required>
	
	<option value=""  >Select status</option>
			<option value="new" selected  >new</option>
			<option value="Approved"  >approved</option>

	<option value="pending"  >pending</option>
		<option value="rejected"  >rejected</option>

	<option value="served"  >served</option>
	<option value="Other"  >Other</option>

	
	
</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>
  	
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="orders" name="btn_addaddneworders" class="btn btn-primary"> Update Order   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>		
<div id="editModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Read Message</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
$imgid = rand(100, 990000).time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatetask' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="taskid" value=""id="taskid" class="form-control" required placeholder="Enter taskid">

		
		


	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Subject </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="subject" id="subject1"value="<?php echo set_value('subject'); ?>" class="form-control" required placeholder="Enter Subject">
		 
				
		<span class="text-danger"> <?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
  
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="description" readonly id="description1" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter description "></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		



	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="task" name="btn_updatetask" class="btn btn-primary"> Update task   </button>

    </div>
  </div>
  					
								   
				



 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="lease">


 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewlease">
 <input type="hidden" id="returnid"name="itemid" class="returnid" placeholder="returnid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Yes  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>		
	















	<div id="deleteModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('logged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="openorders">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/openorders">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>		
	
	
	
	
	
	
	
	
	
	
	
	
	<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Create Orders</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addneworders' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
		  		<input type="hidden" name="action" value="insert" class="form-control" required placeholder="Enter action">

		  		<input type="hidden" name="mycategoryid" value="" class="form-control" required placeholder="Enter mycategoryid">

  <div class="form-group" style="display:none">
    <label for="inputcategory" class="col-sm-2 control-label">Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="category" required>
	
	<option value=""  >Select Order Category</option>
			<option value="Start" selected="selected"  >Start Order</option>
			<option value="Close"  >Close Order</option>

	
	
</select>
		
						<span class="text-danger"><?php echo form_error('category'); ?>

	</div>
  </div>
  	
	<div class="form-group">
    <label for="inputcode" class="col-sm-2 control-label">Vehicle Number </label>
    <div class="col-sm-10">
	
		 		  		<input type="text" name="code" id="mysupplier" autofocus value="<?php echo set_value('supplier'); ?>" class="form-control" required placeholder="Enter Vehicle Number">

				
		<span class="text-danger"> <?php echo form_error('code'); ?>
		
		</span>
	</div>
  </div>



 <div class="form-group">
    <label for="inputstartdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  name="startdate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('startdate'); ?>
		
		</span>

  	</div>
  </div>
  



 <div class="form-group">
    <label for="inputclosedate" class="col-sm-2 control-label">Close Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  name="closedate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter close  date">
		 
				
		<span class="text-danger"> <?php echo form_error('closedate'); ?>
		
		</span>

  	</div>
  </div>
  

	<div class="form-group" style="display:none">
    <label for="inputfuel" class="col-sm-2 control-label">Exact Fuel Remaining  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fuel" value="<?php echo set_value('fuel',0); ?>" class="form-control"  placeholder="Enter Lts of fuel used">
		 
				
		<span class="text-danger"> <?php echo form_error('fuel'); ?>
		
		</span>
	</div>
  </div>

  <div class="form-group">
    <label for="inputmillage" class="col-sm-2 control-label">Millage Covered </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="millage" value="<?php echo set_value('millage'); ?>" class="form-control" required placeholder="Enter millage covered">
		 
				
		<span class="text-danger"> <?php echo form_error('millage'); ?>
		
		</span>
	</div>
  </div>


	<div class="form-group">
    <label for="inputtrips" class="col-sm-2 control-label">Trips Covered </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="trips" value="<?php echo set_value('trips'); ?>" class="form-control" required placeholder="Enter trips covered">
		 
				
		<span class="text-danger"> <?php echo form_error('trips'); ?>
		
		</span>
	</div>
  </div>


  <div class="form-group">
    <label for="inputreceiver" class="col-sm-2 control-label">Incharge Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="receiver"  value="<?php echo set_value('receiver'); ?>" class="form-control" required placeholder="Enter incharge name.">
		 
				
		<span class="text-danger"> <?php echo form_error('receiver'); ?>
		
		</span>
	</div>
  </div>
  

 
  

  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"   class="form-control"  placeholder="Enter Complain / Message ">N/a</textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
  <div class="form-group"  style="display:none">
    <label for="inputstatus" class="col-sm-2 control-label">Status?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>
	
	<option value=""  >Select status</option>
			<option value="new" selected  >new</option>
			<option value="Approved"  >approved</option>

	<option value="pending"  >pending</option>
		<option value="rejected"  >rejected</option>

	<option value="served"  >served</option>
	<option value="Other"  >Other</option>

	
	
</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>
  	
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="orders" name="btn_addaddneworders" class="btn btn-primary"> Post Order   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>		
<div id="editModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Read Message</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
$imgid = rand(100, 990000).time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatetask' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="taskid" value=""id="taskid" class="form-control" required placeholder="Enter taskid">

		
		


	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Subject </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="subject" id="subject1"value="<?php echo set_value('subject'); ?>" class="form-control" required placeholder="Enter Subject">
		 
				
		<span class="text-danger"> <?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
  
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Description</label>
    <div class="col-sm-10">

				<textarea name="description" readonly id="description1" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter description "></textarea>
			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		



	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="task" name="btn_updatetask" class="btn btn-primary"> Update task   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>
	
	
	
	
	
	
	
	<div id="viewModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update task</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');
$imgid = rand(100, 990000).time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatetask' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
<input type="hidden" name="taskid" value=""id="taskid2" class="form-control" required placeholder="Enter taskid">
		<input type="hidden" name="page" value="<?php echo $page ?>"id="page" class="form-control" required placeholder="Enter bookid">

		
		

  <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="category" readonly  id="category2" required>
	
	<option value="" selected="selected"  ></option>

	
	<?php 
					 
			$mycategory = $this->usermodel->tasktype($userid);
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycategoryrow->id;   ?>"><?=  $mycategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No category available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('category'); ?>

	</div>
  </div>
  	

 <div class="form-group">
    <label for="inputtaskowner" class="col-sm-2 control-label">	Assigned to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="taskowner" readonly id="taskowner2"style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $receiverrow->id;   ?>"><?= $receiverrow->firstname ." ".$receiverrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('taskowner'); ?>

	</div>
  </div>
  

	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Subject </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="subject" readonly id="subject2"value="<?php echo set_value('subject'); ?>" class="form-control" required placeholder="Enter Subject">
		 
				
		<span class="text-danger"> <?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="fromdate"  id="fromdate2"readonly value="<?php echo set_value('fromdate'); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputtodate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="todate"  id="todate2"readonly value="<?php echo set_value('todate'); ?>" class="form-control" required placeholder="Enter due date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="contact" id="contact2"readonly value="<?php echo set_value('contact'); ?>" class="form-control" required placeholder="Enter Your contact">
		 
				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  	<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">	Status	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="status"readonly id="status2" value="<?php echo set_value('status'); ?>" class="form-control"  placeholder="Enter status if any ">
		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
    <div class="form-group">
    <label for="inputpriority" class="col-sm-2 control-label">Priority	?</label>
    <div class="col-sm-10">
	<select class="form-control" id="priority"name="priority"readonly required>
		<option value=""  selected="selected"></option>
	<option value="High"  >High</option>
	<option value="Low"  >Low</option>
		<option value="Medium"  >Medium</option>
</select>
		
						<span class="text-danger"><?php echo form_error('priority'); ?>

	</div>
  </div>
      <div class="form-group">
    <label for="inputnotification" class="col-sm-2 control-label">Email Notification	?</label>
    <div class="col-sm-10">
	<select class="form-control"  id="notification2"name="notification"readonly required>
		<option value=""  selected="selected"></option>
	<option value="Yes"  >Yes</option>
	<option value="No"  >No</option>
</select>
		
						<span class="text-danger"><?php echo form_error('notification'); ?>

	</div>
  </div>
    
  
    <div class="form-group">
    <label for="inputrepeated" class="col-sm-2 control-label">Task repeated?	</label>
    <div class="col-sm-10">
	<select class="form-control"   id="repeated2" name="repeated" readonly required>
		<option value=""  selected="selected"></option>
	<option value="Yes"  >Yes</option>
	<option value="No"  >No</option>
</select>
		
						<span class="text-danger"><?php echo form_error('repeated'); ?>

	</div>
  </div>
 

  
  <div class="form-group">
    <label for="inputcontroller" class="col-sm-2 control-label">	Supervisor?</label>
    <div class="col-sm-10">
	<select class="form-control" id="controller2" readonly name="controller" style ="width: 100%"  required>
	
	<option value=""  ></option>

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $receiverrow->id;   ?>"><?= $receiverrow->firstname ." ".$receiverrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('Supervisor'); ?>

	</div>
  </div>
  
  
 
  
  
 
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Update Progress </label>
    <div class="col-sm-10">

				<textarea name="comments" id="comments" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter your update progress"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
  
  
  	
  
  
  
 

	
<?php
	if($usertype=="admin"){
		

				}else{

				}
	

	?>
	

	

  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>

				<div id="moretModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Task</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addtaskcomments' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
		<input type="hidden" name="taskid" value=""id="taskid1" class="form-control" required placeholder="Enter taskid">
		<input type="hidden" name="page" value="<?php echo $page ?>"id="page" class="form-control" required placeholder="Enter page number">

		
  <div class="form-group">
    <label for="inputtaskowner" class="col-sm-2 control-label">	Assigned to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="taskowner" readonly id="taskowner1"style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $receiverrow->id;   ?>"><?= $receiverrow->firstname ." ".$receiverrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('taskowner'); ?>

	</div>
  </div>
  
    <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="fromdate" id="fromdate1" readonly value="<?php echo set_value('fromdate'); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputtodate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="todate" readonly id="todate1"value="<?php echo set_value('todate'); ?>" class="form-control" required placeholder="Enter End Date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
	<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">	Status	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="status" readonly  id="status1" value="<?php echo set_value('status'); ?>" class="form-control"  placeholder="Enter status if any ">
		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
		<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">	Subject</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="subject" value="<?php echo set_value('subject'); ?>"id="subject1" class="form-control" readonly required placeholder="Enter  Product name">
		 
				
		<span class="text-danger"> <?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
	
	
	
	
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	 	Description</label>
    <div class="col-sm-10">

<textarea name="comments" readonly id="comments1"class="form-control"><?php echo set_value('comments'); ?></textarea>		
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		
	
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	 Progress Report</label>
    <div class="col-sm-10">

<textarea name="description"  class="form-control" placeholder="Enter your progress report"><?php echo set_value('description'); ?></textarea>		
		<span class="text-danger"> Enter description of what you have done so far<?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
	

	
	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="task" name="btn_taskdata" class="btn btn-primary"> Update Task   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>	









	
									
									
					</div>				
									
									
									
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


				<div id="moretModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

  
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update Task</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addtaskcomments' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
		<input type="hidden" name="taskid" value=""id="taskid1" class="form-control" required placeholder="Enter taskid">
		<input type="hidden" name="page" value="<?php echo $page ?>"id="page" class="form-control" required placeholder="Enter page number">

		
  <div class="form-group">
    <label for="inputtaskowner" class="col-sm-2 control-label">	Assigned to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="taskowner" readonly id="taskowner1"style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $receiverrow->id;   ?>"><?= $receiverrow->firstname ." ".$receiverrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('taskowner'); ?>

	</div>
  </div>
  
    <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="fromdate" id="fromdate1" readonly value="<?php echo date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputtodate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="todate" readonly id="todate1"value="<?php echo set_value('todate'); ?>" class="form-control" required placeholder="Enter End Date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
	<div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">	Status	 </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="status" readonly  id="status1" value="<?php echo set_value('status'); ?>" class="form-control"  placeholder="Enter status if any ">
		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
	</div>
  </div>
		<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">	Subject</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="subject" value="<?php echo set_value('subject'); ?>"id="subject1" class="form-control" readonly required placeholder="Enter  Product name">
		 
				
		<span class="text-danger"> <?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
	
	
	
	
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	 	Description</label>
    <div class="col-sm-10">

<textarea name="comments" readonly id="comments1"class="form-control"><?php echo set_value('comments'); ?></textarea>		
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		
	

	

	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	 Progress Report</label>
    <div class="col-sm-10">

<textarea name="description"  class="form-control" placeholder=""><?php echo set_value('description'); ?></textarea>		
		<span class="text-danger"> Enter description of what you have done so far<?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
		
	
	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="task" name="btn_taskdata" class="btn btn-primary"> Update Task   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>	









	
									
									
					</div>				
									
									
									
									
							</div>
						</div>
				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















