  <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		     
	
			  <script src="<?php echo base_url(); ?>assets/select/jquery-1.7.2.min.js"></script>

		  <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>


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

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


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



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


		  
        });
		
	 
	  $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
	function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

    // document.body.innerHTML = printContents.fontsize(12);
     window.print();

	 if( window.print()) {
         window.location.href = "../user/viewtimer";
		alert(" printing...........");
    }else {

	
		      return      window.location.href = "../user/viewtimer";

		    // document.body.innerHTML = originalContents;

	}
}
		
    </script>
 <style type="text/css">
  
  

    #myprint { display: none; }
#print{  	


    background-repeat: no-repeat;
	font-size;20px;
  
    width:100%; 


}

#sale{  	


    background-repeat: no-repeat;
  
    width:100px; height:50px;


}
    @media print
    {
    	#non-printable { display: none; }
    	#printableArea { display: block; font-size:16; width:100%; }
		    	#myprint { display: block; font-size:16; width:100%; }

    }
    </style>
 <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'];
	 $new_date=date("Y-m-d H:i:s");		
			 $myinvoice = $userid.time();

 $finalstartdate=date("Y-m-d 00:00:00");
					  $finalendate=date("Y-m-d H:i:s");
				  
  
function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}

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

							    $makesale=$this->usermodel->populatuserpermissionsdataarray('timer','sale',$userid);

					 
	    $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" id="non-printable">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
				 <span class="pull-right"> View transaction</span>
	<a href="<?php echo base_url();?>user/viewtimer" class="btn btn-info"> Go back Timer </a>	 
	<a href="<?php echo base_url();?>user/viewsales" class="btn btn-info"> Go back </a>	 

				 
				 						<a data-toggle='modal' data-target='#userModal' class="btn btn-default">Search Report   </a>

				 
										
            	</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="col-md-12" id="non-printable">
        <?php 
		 echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/starttimer", $attr);?>
            <div class="form-group">
			<input type="hidden" name="invoice"   value="<?php if(isset($myinvoice)) {echo $myinvoice; }?>"  class="form-control">
		  		<input type="hidden" name="hour" value="0.00" class="form-control" required placeholder="Enter hour">

		  		<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">
				 <input type="hidden" name="status" value="ongoing" class="form-control" required placeholder="Enter status">

  						  		<input type="hidden" readonly name="enddate" value="n/a" class="form-control" required placeholder="Enter end time">

                <div class="col-sm-3">
	
	<select class="chzn-select" name="product"  required>
	
	<option value="" selected="selected"  >---Select  product-</option>

	
	<?php 
					 
					 		$uom = $this->usermodel->populateall('productlist','companyid',$companyid);


							


if(is_array($uom)) {

   foreach($uom as $uomrow){

   //echo $courserow->coursename;
    ?>
					<option  value="<?=  $uomrow->code;   ?>"><?=  $uomrow->name; ?></option>



	<?php

}} else {
    echo 'No uom.';
}
	
?>
</select>
		 
				
		
				</div>
                <div class="col-md-2">
                   		  		<input type="text" name="station" value="<?php echo set_value('station'); ?>" class="form-control" required placeholder="Enter station">

				
				</div>
				
				 <div class="col-md-2">
		  		<input type="startdate"  name="startdate" value="<?php echo  $new_date ?>" class="form-control" required placeholder="Enter station name">

				
				</div>
				
				 <div class="col-md-3">
<input type="text" name="description" value="<?php echo set_value('description'); ?>" class="form-control" required placeholder="Enter Description">


				
				</div>
				
				 <div class="col-md-2">
				 
				 
				 				<?php
		
		 if($makesale==true){
			 ?>

<a id="non-printable"  href="<?php echo base_url(); ?>user/mysales" >  <span class="btn btn-default"> Cashier sales</span>
</a>
		 
<?php
		 }							
?>
	         <button type="submit"  value="timer" name="btn_addtimer" class="btn btn-info"> Start Now </button>

				
				</div>
				
            </div>
        <?php echo form_close(); ?>
        </div>
							<div class="panel-body">
		<div class="col-md-12" id="non-printable">
        <?php 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchtimer", $attr);?>
            <div class="form-group">
			
                <div class="col-md-5">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for data.." 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-info" value="Search" />
                    <a href="<?php echo base_url(). "user/viewtimer"; ?>" class="btn btn-info">Refresh</a>
                </div>
				         <?php echo form_close(); ?>

		<div class="col-md-2">
			 
<form name="print" method="post" action="">
 <input type="submit" id="print"  accesskey="p" class="btn btn-info"  name="print"onclick="printDiv('sortable_table')" value="print Report!" />
</form></div>
		
            </div>
        </div>
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
		 	      <th>Id</th>

	      <th>Station</th>

     <th>Start Date</th>
	   <th>End Date</th>
	     <th>Duration</th>
	   	   <th>Time</th>
	   	  	   	   <th>Unit</th>
	   	  	   	   <th>Total</th>

	   	   <th>Description</th>

	   <th>Status</th>
	    


		   		   		   <th>User</th> 

		   <th id="non-printable">End</th> 

		   		   <th id="non-printable">More</th> 


                 </tr>
             </thead>
<?php

 if(!is_array($timer)) 

 {


   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 
  $total=0;
  	foreach ($timer as $c): 

		 

             ?>



             <tr>
                
            <?php 
			$invoice=$c->invoice;

$id=$c->id;
  $total=  $total+$c->amount;

$productname = $this->usermodel->geteproductbyid($c->product);
			$name=$productname[0]['name']; 

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


       
  
      <td><?php echo $name."-".$c->station ; ?></td>


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

  <td><?php echo $c->hour ; ?></td>
    <td><?php echo $c->unit ; ?></td>

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

	  <td><?php  $customer=$c->userid ;

$mycustomer=$this->usermodel->populateallarray('people','id', $customer);


			echo$myname=$mycustomer[0]['firstname'];

 ?></td>
<td id="non-printable">

 <a class="btn btn-danger  managebtnstop" id="managebtnstop"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#stopModel<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Stop
                                                </a>
												</td>
   
	   
	   
     		  

 <td id="non-printable"> 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
                                        Delete <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-info pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
											<?php
										if($usertype=="admin"){
											
											?>
											  <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>
									
									
										<?php
										
										}
											
											?>
									
                                        <li class="divider"></li>
                                        
										  <li> 
																			 <a  id="non-printable" class=" btn btn-info" href="<?php echo base_url();?>user/printtimer?invoice=<?php   if(isset($invoice)) {echo $invoice; } ?> ">Print   </a>

                                                        </li>
                                        <!-- teacher DELETION LINK -->
                                        
                                    </ul>
										
                                </div>
</td>
             </tr>

	<?php endforeach;} ?>

          <tr>
		  <td colspan="6"><h2>Total amount</h2></td>
		  		  <td colspan="5"><b><h2>
				  <?php if(isset($total)) {echo  formatMoney($total,true); }?>
				 </h2> </b>
				  </td>

 </tr>
        </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="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="timer">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewtimer">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-info" 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="stopModel" 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">Stop</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to stop/end the program? </h3>
      </div>
      <div class="modal-footer">
	  	

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

		
                 echo form_open('user/postendtime' , 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="timer">

 	
  <div class="form-group">
    <label for="inputenddate" class="col-sm-2 control-label">Close time  </label>
    <div class="col-sm-10">
	
		  		<input type="enddate"  name="enddate" value="<?php echo  $new_date ?>" class="form-control" required placeholder="Enter end time">
		 
				
		<span class="text-danger"> <?php echo form_error('enddate'); ?>
		
		</span>
	</div>
  </div>
   <input type="hidden" id="action"name="update" class="update" placeholder="update" value=""><br>

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewtimer">
 <input type="hidden" id="timeid" name="endtimeid"  placeholder="endtimeid" value=""><br>
 <button type="button" class="btn btn-info" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_addtimer" value="timer" class="btn btn-danger"> Stop  </button>

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

  </div>

  </div>		
	
	
	
	
			<div id="userModal" 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">Sales Report per user</h4>
      </div>
      <div class="modal-body">
      


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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/viewtimerreportbyuser' , 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="type" value="all" class="form-control"  placeholder="Enter type">

  <div class="form-group">
    <label for="inputbranchname" class="col-sm-2 control-label">Counter</label>
    <div class="col-sm-10">
	<select class="form-control" name="branchname"  id="branchname" required>
	
	
	<option value=""  >---Select Branch/Counter Name--</option>
<?php
									 if( $viewallaction==true){
										 ?>
					<option value="all"  >All branches/Counters</option>
									<?php
									 }
							
	?>
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('branch','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

}} else {
    echo 'No main counter available.';
}
	
?>
</select>
		

		
	</div>
  </div>
	
	
				  		<input type="hidden" name="view" value="viewgroupreceiptreport" class="form-control" required placeholder="Enter sales type">

     <div class="form-group">
    <label for="inputuser" class="col-sm-2 control-label">User?</label>
    <div class="col-sm-10">
	<select class="form-control" name="user" required>
	
	<option value=""  >---Select user---</option>

						<?php
	
		
		
		 if($cashiersales==true){
			$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');
	?>
		<option value="all"  >-All users-</option>

	<?php

 }else{
				 			$allusers = $this->usermodel->populatealldatanoarraythree('people', 'userid',$userid,'status',1,'category','user');

 
  
 }
  ?>

	
	
	
	<?php 
				
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $userrow->id;   ?>"><?=  $userrow->firstname ."- ".$userrow->surname ."(". $userrow->email.")"; ?></option>



	<?php

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

	</div>
  </div>
  
  
  
  
  
  
  
  
  
	
	
	
	
	
  <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">From Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="fromdate" value="<?php echo set_value('fromdate',$finalstartdate); ?>" 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">	To Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$finalendate); ?>" class="form-control" required placeholder="Enter End date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
    
     
   
   

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="event" name="btn_addevent" class="btn btn-default"> View Sales  </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-info"> 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-info"> 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-info"> 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>


















