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



<script type="text/javascript">
 $(document).ready(function() { 
				$("#mybankname1").hide();
               $("#mybankname2").hide();
        

					});
					

			
		         $(function () {
        $("#type").change(function () {
            if ($(this).val() == "FeedbackOnly") {
            
				$("#mybankname1").hide();
               $("#mybankname2").hide();
        
              		 
              

            } else if ($(this).val() == "DocumentOnly") {
            
		$("#mybankname2").show();
               $("#mybankname1").show();
              

            } else if ($(this).val() == "FeedbackImage") {
					$("#mybankname2").show();
               $("#mybankname1").show();
              
				
			}else {
               
$("#mybankname1").hide();
               $("#mybankname2").hide();
            
			
            }
        });
    });
		











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

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

        });




     $(document).on("click", "#managebtn", function()
        {
			
		     var taskid = $(this).data('id');
		  $("#taskid1").val(taskid);  	
          var taskowner = $(this).data('taskowner');
		  $("#taskowner1").val(taskowner); 
		  
		    var subject = $(this).data('subject');
		   $("#subject1").val(subject); 
		   
		   
		    var notification = $(this).data('notification');
		   $("#notification1").val(notification); 
		   
		      
		    var measurements = $(this).data('measurements');
		   $("#measurements1").val(measurements); 
		   
	
		     var comments = $(this).data('comments');
		   $("#comments1").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status1").val(status);

 var controller = $(this).data('controller');
		   $("#controller1").val(controller);
		     var fromdate = $(this).data('fromdate');
		   $("#fromdate1").val(fromdate); 

		     var todate = $(this).data('todate');
		   $("#todate1").val(todate); 	
     var target1 = $(this).data('target1');
		   $("#target1").val(target1); 	
		   
		       var latestdate = $(this).data('latestdate');
		   $("#latestdate").val(latestdate); 			   
		   
   
        });
		
		
	   $(document).on("click", "#editbtn", function()
        {
     	     var taskid = $(this).data('id');
		  $("#taskid").val(taskid);  	
          var mytaskowner = $(this).data('taskowner');
		  $("#mytaskowner").val(mytaskowner); 
		  
		    var subject = $(this).data('subject');
		   $("#subject").val(subject); 
		   
		     var comments = $(this).data("comments");
		   $("#comments").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status").val(status);

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

		     var todate = $(this).data('todate');
		   $("#todate").val(todate); 		
	  var dateposted = $(this).data('dateposted');
		   $("#dateposted").val(dateposted); 	
		   
 var 	category = $(this).data('category');
		   $("#category").val(category); 		
 var contact = $(this).data('contact');
		   $("#contact").val(contact); 		
 var controller = $(this).data('controller');
		   $("#controller").val(controller); 		
 var priority = $(this).data('priority');
		   $("#priority").val(priority); 	

 var notification = $(this).data('notification');
		   $("#notification").val(notification);
		   
		    var repeated = $(this).data('repeated');
		   $("#repeated").val(repeated);
		   
		   
		    var latestdate = $(this).data('latestdate');
		   $("#latestdate").val(latestdate); 			   
		    var target1 = $(this).data('target1');
		   $("#target").val(target1); 	
		  
        });
		
	  $(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 comments2 = $(this).data("comments");
			 

		   $("#comments2").val(comments2); 
		 
		     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 dateposted = $(this).data('dateposted');
		   $("#dateposted2").val(dateposted); 	
		   
 var mycategory = $(this).data('category');
		   $("#mycategory").val(mycategory); 		
 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);
		   
		   
		    var measurements = $(this).data('measurements');
		   $("#measurements2").val(measurements); 
		    var target1 = $(this).data('target1');
		   $("#target2").val(target1); 	
		  
        });
		
    </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'];


				 $mydate=date("Y-m-d");
				
				$data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
	 
				$data['branchid'] = $session_data['branchid'];
	 $branchid = $data['branchid'];
	 
	 

		 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
			    $viewalltasks=$this->usermodel->populatuserpermissionsdataarray('task','viewall',$userid);
				$postspecifictask=$this->usermodel->populatuserpermissionsdataarray('task','postspecifictask',$userid);
			    $postgeneraltask=$this->usermodel->populatuserpermissionsdataarray('task','postgeneraltask',$userid);
			    $viewothersspecifictask=$this->usermodel->populatuserpermissionsdataarray('task','viewothersspecifictask',$userid);
			    $viewothersgeneraltask=$this->usermodel->populatuserpermissionsdataarray('task','viewothersgeneraltask',$userid);
							    $postemployeenoteforothers=$this->usermodel->populatuserpermissionsdataarray('task','postemployeenoteforothers',$userid);

			    $assigntask=$this->usermodel->populatuserpermissionsdataarray('task','assigntask',$userid);
			    $posttaskforothers=$this->usermodel->populatuserpermissionsdataarray('task','posttaskforothers',$userid);
			    $overalclearingpendingtasks=$this->usermodel->populatuserpermissionsdataarray('task','overalclearingpendingtasks',$userid);

				$smsconfig = $this->usermodel->populateallarray('smsconfig','id',$companyid);
	  $starttime=$smsconfig[0]['starttime'];
		 $duetime=$smsconfig[0]['duetime'];
 echo $this->session->flashdata('deletemsg'); 

				echo $this->session->flashdata('msg'); 
						?>	
  
		<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 tasks</span>
				 				 	  <a  id="more"  class="btn btn-warning" href="<?php echo base_url();?>user/pendingtasks"> Pending Tasks </a>
                    <a href="<?php echo base_url(). "user/viewtasks"; ?>" class="btn btn-default">All My tasks</a>

				 			<?php
		
		 if($postgeneraltask==true){
			?> 


	<?php
		 }
		?>
				 
				 
				 
					 			<?php
		
		 if($postgeneraltask==true){

			 ?> 
			 			  <a data-toggle='modal' data-target='#addModal' class="btn btn-default">Create New  Task(General) </a>

				 	  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewtasks"> My History(General) </a>

		<?php
		 }
		?>
						 			  <a data-toggle='modal' data-target='#addticketModal' class="btn btn-info">  Support Ticket </a>
	 
				 
					 
				 			<?php
		
		 if($postspecifictask==true){
			?> 
 				 	  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewmydailyupdates"> My History(Core Task) </a>

	  	  					  <a data-toggle='modal' data-target='#addmyModal' class="btn btn-default">Post Core  Task </a>
	  				 	  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/myassigedntask"> My Core task </a>

	<?php
		 }
		?>	 
				 
				 
				 
				 
				 		 			<?php
		
		 if($viewothersspecifictask==true){
			?> 

			  			  				 	  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewallotherdailyupdates"> Feedback(Core Task)  </a>

	<?php
		 }
		?>
				 
			


	 		 			<?php
		
		 if($viewothersgeneraltask==true){
			?> 

	  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewotherfeedback"> Feedback(General) </a>
									  			  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewothertasks">  All History(General) </a>

	<?php
		 }
		?>
				 
			

	  
  			<?php
		
		 if($assigntask==true){
			?> 
									  			 			  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/assigntask"> Assign Core tasks    </a>

	<?php
		 }
		?>
		
		
			<?php
		
		 if($postgeneraltask==true){
			?> 
										  			 			  <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/viewsupervisortasks">General Task Given(By Me)   </a>

	<?php
		 }
		?>
			
<?php
		
		 if($posttaskforothers==true){
			?> 
		 <a  id="more"  class="btn btn-default" href="<?php echo base_url();?>user/assigntask"> Post tasks for Others  </a>

	<?php
		 }
		?>
														  			 			  <a  id="more"  class="btn btn-info" href="<?php echo base_url();?>user/viewemployeenote">Employee Note  </a>

												  			 			  <a  id="more"  class="btn btn-info" href="<?php echo base_url();?>user/viewupgrade">Post New Upgrade   </a>

												  			 			  <a  id="more"  class="btn btn-info" href="<?php echo base_url();?>user/taskhome">Task dashboard  </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="panel-body">
							
<?php 
			 				echo $this->session->flashdata('deletemsg'); 

		 echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchallactivities", $attr);?>
	

            <div class="form-group">
			
                <div class="col-md-9">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for deals, by name,conatct etc.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
                 <div class="col-md-3">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-default" value="Search" />
                    <a href="<?php echo base_url(). "user/searchalltasks"; ?>" class="btn btn-default">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>
							
							
							
							<div class="col-md-12">
        <?php 
		
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchalltasks", $attr);?>
            <div class="form-group">
			
                <div class="col-md-3">
				
				

     <div class="form-group">
    <label for="inputsearchterm" class="col-sm-2 control-label">Staff?</label>
    <div class="col-sm-10">
	<select class="chzn-select" name="searchterm" required style="width:300px">
				<option  value="" selected="selected" >Select employee</option>
	

<?php 
 if($viewalltasks==true){
	?>
			<option value="all"  selected="selected" >All employees</option>


<?php 
 }
	?>
	
	
	
	<?php 
				
				
	
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

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



	<?php

}} else {
   // echo 'No user available.';
}
	
?>

	<?php 
				
					 if($viewalltasks==true){
	?>


<?php 
			//$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'id >',0);
						$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');

	
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('searchterm'); ?>

	</div>
  </div>
				
                </div>
					    <div class="col-md-1">
<select class="form-control" name="status" required>

			<option value="all"  selected="selected">-All status-</option>

			
	<option value="New"  >New</option>
	<option value="Pending"  >Pending</option>
			<option value="Ongoing"  >Ongoing</option>

		<option value="Completed"  >Completed</option>
				<option value="Verified"  >Verified</option>

</select>
		<select class="form-control2" name="datetype"  id="datetype" required>
	
	
	<option value=""  >--Date type--</option>

									
					<option value="Start" selected >Start Date</option>
												<option value="Created"  >Created Date</option>
	

</select>
					</div>
				
				
				
				 <div class="col-md-2">



   
	    <div class="col-md-12">
				<div class="col-sm-7">
					<div class="form-group">

                     		  		<input type="date" name="startdate" value="<?php echo set_value('fromdate',date("Y-m-d", strtotime($mydate))); ?>" class="form-control2" required placeholder="Enter start date">

					</div>
				</div>
				<div class="col-sm-5">
					<div class="form-group">
					

							  		<input type="time"  name="frotime" value="<?php echo set_value('frotime',$starttime.":00"); ?>" class="form-control2" required placeholder="Enter start time">

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







					</div>
				
				
				
				  <div class="col-md-2">
				
				
				
			

				<div class="col-sm-6">
					<div class="form-group">

		  		<input type="date" name="closedate" value="<?php echo set_value('closedate',date("Y-m-d", strtotime($mydate))); ?>" class="form-control2" required placeholder="Enter End date">

					</div>
				</div>
				<div class="col-sm-4">
					<div class="form-group">
					

							  		<input type="time"  name="totime" value="<?php echo set_value('totime',$duetime.":00"); ?>" class="form-control2" required placeholder="Enter stop time">

					</div>
				</div>
  
				
				
				
					</div>
				
				
				
				
				
				
				
				
				
				
				
				
				
			
					  <div class="col-md-2">
					  
					  <select class="chzn-select" name="category" required style="width:300px">
	
	<option value=""  >---Select Task Category---</option>

			<option value="all" selected="selected"  >All Types</option>

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


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>
		







</select>
		
<select class="form-control" name="branchid"  id="branchid" required>
	
	
	<option value=""  >---Select Branch/Counter to Open--</option>

									
					<option value="all"  >All branches/Counters</option>
								

	
	
	<?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 class="col-md-3">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-info" value="Search" />
                    <a href="<?php echo base_url(). "user/viewtasks"; ?>" class="btn btn-default">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>

        </div>	
							
							
							
							
							
							
							
							
							

									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
		 		   <th>Task No.</th>

		   <th>Start Date</th>
	   <th>Due Date</th>
	
   	   <th>Target </br>/
	   Achived
	   </th>
     <th>Days</br>
	 Due</th>
     <th>Assigned to?</th>
     <th>Subject</th>
	
	     <th>Supervisor</th>
<th>status</th>	
 
<th>Category</th> 
		

<th>View/Edit</th>

<th>Progress</th>

<th>View Progress</th>
		   <th>Delete</th> 

                 </tr>
             </thead>
<?php
$latestdate="";
 if(!is_array($viewtasks)) 

 {


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

		 $img_id=$c->notification;

             ?>



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



	 $latestfeedback= $this->usermodel->getlastfeedback($c->notification,$companyid);


if($latestfeedback[0]["date"]!=""){
		$latestdate=$latestfeedback[0]["date"];

}else{
	
	 		  $latestdate = date('Y-m-d H:i:s');

}



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

   <td><?php echo $c->fromdate."<br>";echo $c->dateposted  ; ?></td>
  
    <td><?php echo $c->todate ; ?></td>
    <td><?php

$finalachieved=0;
	 $correctdata= $this->usermodel->calculatetasktarget($c->notification,$companyid);

if( $correctdata!=false){
	$achieved=$correctdata[0]["achieved"];
	
$finalachieved=$achieved;
}else{
	
$finalachieved=0;
	
	
}


	echo "(".$c->measurements.")".$finalachieved ."/". $c->target; 
	
	
	
	
	
	
	
	
	
	?></td>
             <td><?php 

$endate=$c->todate;

	  $newDate = date("Y-m-d");
$mycurrentdate="";
$finaldate="";

if($endate>$newDate ){
	
	$mycurrentdate = strtotime(date($c->todate));
}else{
		$mycurrentdate = strtotime(date($newDate));

}



if($newDate > $c->todate){
		$finaldate = strtotime(date($c->todate));
			$secs = $mycurrentdate-$finaldate;

	
}else{

	$finaldate = strtotime(date($newDate));
			$secs = $finaldate-$mycurrentdate;

}



//echo $mycurrentdate;
//$finaldate = strtotime(date($c->todate));
$exactdate = strtotime(date($c->exactdate));




	

									// == <seconds between the two times>
									$days = ($secs / 86400)+1;
							 $finaldays=round($days,0);

if(($c->status=="Completed") || ($c->status=="Verified")){
		?>
			<div class="btn-success">
			<?php 
$myfromdate = strtotime(date($c->todate));
	$secs2 = $myfromdate-$finaldate;// == <seconds between the two times>
									$days2 = $secs2 / 86400;
							 $finaldays2=round($days2,0);
							 if( $finaldays2<1){
								  $finaldays2=1;
							 }else{
							  $finaldays2= $finaldays2;
 
							 }


$mysecs = $exactdate-$finaldate;// == <seconds between the two times>
									$mydays = $mysecs / 86400;
							 $myfinaldays=round($mydays,0);

	 if( $myfinaldays<1){
								  $myfinaldays=1;
							 }else{
							  $myfinaldays= $myfinaldays;
 
							 }

			echo $c->status ."</br>(".$myfinaldays."/".$finaldays2."Days)"; 	?>
			</div>
			<?php
	
	
}else{

			 ?>
			 
			 
			<?php 
			
			if($finaldays <= 0){
			
			?>
			<div class="btn-success">
			<?php  echo $finaldays ; 	?>
			</div>
			<?php
			}else if(($finaldays > 0) && ($finaldays <3)) {
		?>
			<div class="btn-warning">
			<?php  echo $finaldays." Overdue"  ; 	?>
			</div>
			<?php
			
			}else if($finaldays >=3){
			?>
			<div class="btn-danger">
			<?php  echo $finaldays." Overdue" ; 	?>
			</div>
			<?php
			}
}
			?>	
			 
			 
			 
			 
			 
			 
			 
			 </td>
    
 
  
      <td><?php 
	$owner=$c->taskowner;
			$myowner = $this->usermodel->populateall('people', 'id',$owner);


	


if(is_array($myowner)) {

   foreach($myowner as $myowneryrow){
		echo $myowneryrow->firstname;


}} else {
    echo 'No Owner .';
}
	
?>
</td>
  
  
  <td><?php echo $c->subject ; ?></td>

	<td><?php 
	$controller=$c->controller;
			$mycontroller = $this->usermodel->populateall('people', 'id',$controller);


	


if(is_array($mycontroller)) {

   foreach($mycontroller as $mycontrollerrow){
		echo $mycontrollerrow->firstname;


}} else {
    echo 'No Supervisor .';
}
	
?>
</td>

  <td >
  <?php
  if($c->status=="Completed"){
		?>
			  <span style="color:green"><b><?php echo $c->status ; ?></b></span>

			<?php
	
	
}else{
	?>
	
  
  <span style="color:blue"><b><?php echo $c->status ; ?></b></span>
  <?php
}
  ?>
  </td>
   
	
	    <td><?php 
	$category=$c->category;
	
	$mycategory = $this->usermodel->populatecategorybytasktype($category);
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){
		echo $mycategoryrow->name;


}} else {
    echo 'No Category .';
}
	
?>
</td>
                 <td>
				 
				 	
<?php
$mycontroller="";
$mycontroller=$c->controller;
			if(($mycontroller==$userid) ||($overalclearingpendingtasks==true)) {
		?>
									 	 <a class="btn btn-default editbtn" id="editbtn"     data-target1 ='<?php echo  $c->target;?>'   data-latestdate ='<?php echo  $latestdate; ?>'   data-measurements ='<?php echo  $c->measurements ;?>'  data-dateposted='<?php echo  $c->dateposted;?>' data-notification='<?php echo  $c->notification;?>' data-repeated='<?php echo  $c->repeated;?>' data-priority='<?php echo  $c->priority;?>' data-controller='<?php echo  $c->controller;?>'	data-category='<?php echo  $c->category;?>'  data-contact='<?php echo  $c->contact;?>'data-subject='<?php echo  $c->subject;?>' data-todate='<?php echo  $c->todate;?>' data-status='<?php echo  $c->status;?>'	data-comments="<?php echo  htmlspecialchars($c->comments);?>" data-taskowner='<?php echo  $c->taskowner;?>'	data-fromdate='<?php echo  $c->fromdate;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editModel'>View/ Edit  </a>	 
	

					<?php

				}else{
					?>
									 	 <a class="btn btn-default viewbtn" id="viewbtn"  data-latestdate ='<?php echo  $latestdate; ?>'   data-target1 ='<?php echo  $c->target;?>'   data-measurements ='<?php echo  $c->measurements ;?>'  data-dateposted='<?php echo  $c->dateposted;?>' data-notification='<?php echo  $c->notification;?>' data-repeated='<?php echo  $c->repeated;?>' data-priority='<?php echo  $c->priority;?>' data-controller='<?php echo  $c->controller;?>'	data-category='<?php echo  $c->category;?>'  data-contact='<?php echo  $c->contact;?>'data-subject='<?php echo  $c->subject;?>' data-todate='<?php echo  $c->todate;?>' data-status='<?php echo  $c->status;?>'	data-comments="<?php echo  htmlspecialchars($c->comments);  ?>" data-taskowner='<?php echo  $c->taskowner;?>'	data-fromdate='<?php echo  $c->fromdate;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#viewModel'> View  </a>	 

					<?php
				}
	

	?>
	   </td>   <td>
	   <?php
	  
if($c->status!="Completed"){
		?>
	 <a class="btn btn-info managebtn" id="managebtn"  data-latestdate ='<?php echo  $latestdate; ?>'    data-target1 ='<?php echo  $c->target;?>' data-measurements ='<?php echo  $c->measurements;?>' data-notification='<?php echo  $c->notification;?>'  data-controller='<?php echo  $c->controller;?>'	data-subject='<?php echo  $c->subject;?>' data-todate='<?php echo  $c->todate;?>' data-status='<?php echo  $c->status;?>'	data-comments="<?php echo  htmlspecialchars($c->comments);?>" data-taskowner='<?php echo  $c->taskowner;?>'	data-fromdate='<?php echo  $c->fromdate;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#moretModal'> Post Report  </a>	 
                   	  
   <?php
}
		?>
					  </td>   <td>    
					   <a  id="more" target="_blank" class="btn btn-default" href="<?php echo base_url();?>user/viewmoretasks?randomitemidentifier=<?php   {echo  $id;}  ?>&owner=<?php   {echo  $c->taskowner;}  ?>">All Feedbacks  </a>



		 </td>
     		  <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                       -More- <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-primary 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="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmoredocuments?randomitemidentifier=<?php   {echo  $img_id;}  ?>&type=task">View documents </a>

                                                        </li>   



   <li class="divider"></li>
                                        
			  <li> 
										 <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmoreassessment?randomitemidentifier=<?php   {echo  $img_id;}  ?>&type=task">View Assessment </a>

                                                        </li>   


 <li class="divider"></li>
                                        
			  <li> 
										 <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmoreevaluation?randomitemidentifier=<?php   {echo  $img_id;}  ?>&type=task">View Evaluation </a>

                                                        </li>   










														
                                    </ul>
                                </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. "   Tasks in the system. " ;?>    </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" name="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">

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

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewtasks">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-default" 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">Add new Task</h4>
      </div>
      <div class="modal-body">
      
	  	

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

$img_id = rand(100, 9900000).time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addtasks' , 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="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">


  <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" required>
	
	<option value=""  >--Select Category--</option>

	
	<?php 
					 
			//$mycategory = $this->usermodel->tasktype($companyid);
			$mycategory  = $this->usermodel->populatealldatanoarrayorderby('tasktype','name',"asc",'id >', 0,'companyid', $companyid);



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" style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>
						<?php
		
		if($usertype=="admin"){
			///$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'status',1);
			//$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');
			$allusers  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

			?>
						
<?php


 }else{
	 		//$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');
			$allusers  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

			///$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$myuserid,'status',1);

 
  
 }
  ?>

	
	
	
	<?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('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"  maxlength="20" name="subject" value="<?php echo set_value('subject'); ?>" class="form-control" required placeholder="Enter Subject">
		 
				
		<span class="text-danger">Maximum length  is 20<?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="TEXT" name="fromdate" value="<?php echo  date("Y-m-d H:i:s"); ?>" 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="TEXT" name="todate" value="<?php echo  date("Y-m-d 17:00:00"); ?>" class="form-control" required placeholder="Enter due date">
		 
				
		<span class="text-danger"> <?php echo form_error('todate'); ?>
		
		</span>
	</div>
  </div>
  
   
  
  
  
  
  
  
  
  
  
  
  
    	<div class="form-group" style="display:none">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="contact" readonly value="<?php echo set_value('contact'); ?>" class="form-control"  placeholder="Contact is automatic">
		 
				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</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="New"  selected="selected">New</option>
	<option value="Pending"  >Pending</option>
		<option value="Ongoing"  >Ongoing</option>
		<option value="Completed"  >Completed</option>
		
</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>
  
  
 
    <div class="form-group" style="display:none">
    <label for="inputpriority" class="col-sm-2 control-label">Priority	?</label>
    <div class="col-sm-10">
	<select class="form-control" name="priority" required>
		<option value=""  >Select Priority</option>
	<option value="High"  selected="selected">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="inputrepeated" class="col-sm-2 control-label">Send Sms?	</label>
    <div class="col-sm-10">
	<select class="form-control" name="repeated" required>
			<option value=""   >-Select sms action </option>

	<option value="Yes" selected="selected"   >Send SMS   </option>
	<option value="No"  >Don't send SMS Notification</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" name="controller" style ="width: 100%"  required>
	
	<option value=""  >---Select task Supervisor---</option>
<?php 
					 
	
			$mytask = $this->usermodel->populateall('people', 'id',$userid);


if(is_array($mytask)) {

   foreach($mytask as $mytaskrow){

    ?>
					<option  selected="selected" value="<?=  $mytaskrow->id;   ?>"><?= $mytaskrow->firstname ." ".$mytaskrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
	
	
	<?php 
					 
	
			//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
						$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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">	Description</label>
    <div class="col-sm-10">

				<textarea name="comments" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter task Description"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		
<div class="form-group" >
    <label for="inputmeasurements" class="col-sm-2 control-label"> Mode	</label>
    <div class="col-sm-10">
	<select class="form-control2" name="measurements" required style="width:30%">
			<option value=""    >-Select Measurements Mode-- </option>

	<option value="Pc"  selected="selected" >Percentage(%) </option>
	<option value="No"  >Numbers</option>
</select>
		
		Value expected:  		<input type="TEXT"  style="width:40%"name="target" value="100.0" class="form-control2" required placeholder="Target in Numbers or % ">

						<span class="text-danger">Select Measurements   type(No/Percentage) then enter the value e,g 100% or The number expected to be achieved                 <?php echo form_error('measurements'); ?>
	</div>
  </div>
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     	<input type="hidden" name="notification"   value="<?php if(isset($img_id)) {echo $img_id; }?>"  class="form-control">

	         <button type="submit"  value="task" name="btn_addtask" class="btn btn-info"> Post Task   </button>

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

    

				</div>

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






	
	<div id="addticketModal" 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">Add new Ticket</h4>
      </div>
      <div class="modal-body">
      
	  	

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

$img_id = rand(100, 9900000).time();


				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addtickettasks' , 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="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">


  <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" required>
	
	<option value=""  >--Select Category--</option>

	
	<?php 
					 
			//$mycategory = $this->usermodel->tasktype($companyid);
			$mycategory  = $this->usermodel->populatealldatanoarrayorderby('tasktype','name',"asc",'id >', 0,'companyid', $companyid);



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" style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>
						<?php
		
		if($usertype=="admin"){
			///$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'status',1);
			//$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');
			$allusers  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

			?>
						
<?php


 }else{
	 		//$allusers = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');
			$allusers  = $this->usermodel->populatealldatanoarrayorderby('people','firstname',"asc",'status', 1,'category', 'user');

			///$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$myuserid,'status',1);

 
  
 }
  ?>

	
	
	
	<?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('taskowner'); ?>

	</div>
  </div>
  
	
	

	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Business Name -Contact Name  </label>
    <div class="col-sm-10">
	
		  		<input type="text"  maxlength="30" name="subject" value="<?php echo set_value('subject'); ?>" class="form-control" required placeholder="Enter Business Name - Contact person Name">
		 
				
		<span class="text-danger">Maximum length  is 30<?php echo form_error('subject'); ?>
		
		</span>
	</div>
  </div>
  
  
    	<div class="form-group">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact Details </label>
    <div class="col-sm-10">
	
		 
			<textarea name="contact" required value="<?php echo set_value('contact'); ?>"  class="form-control"  placeholder="Enter Phone-Bussiness-Incharge-Location"></textarea>

		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Support Challanges</label>
    <div class="col-sm-10">

				<textarea name="comments" required  value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter task Description"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</span>
	</div>
  </div>
		  <div class="form-group">
    <label for="inputpriority" class="col-sm-2 control-label">Feedback / Recomendations</label>
    <div class="col-sm-10">
				<textarea name="priority"  required value="<?php echo set_value('priority'); ?>"  class="form-control"  placeholder="Enter Enter feedback/ comments/ recommendations"></textarea>


	</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="TEXT" name="fromdate" value="<?php echo  date("Y-m-d H:i:s"); ?>" 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="TEXT" name="todate" value="<?php echo  date("Y-m-d 17:00:00"); ?>" 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="inputstatus" class="col-sm-2 control-label">Status	?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>

		
			
	<option value="New"  selected="selected">New</option>
	<option value="Pending"  >Pending</option>
		<option value="Ongoing"  >Ongoing</option>
		
</select>
		
						<span class="text-danger"><?php echo form_error('status'); ?>

	</div>
  </div>
  
  
 
  
     
    
  
    <div class="form-group" >
    <label for="inputrepeated" class="col-sm-2 control-label">Send Sms?	</label>
    <div class="col-sm-10">
	<select class="form-control" name="repeated" required>
			<option value=""  >-Select sms action </option>

	<option value="Yes"   >Send SMS   </option>
	<option value="No"  selected="selected"  >Don't send SMS Notification</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" name="controller" style ="width: 100%"  required>
	
	<option value=""  >---Select task Supervisor---</option>
<?php 
					 
	
			$mytask = $this->usermodel->populateall('people', 'id',$userid);


if(is_array($mytask)) {

   foreach($mytask as $mytaskrow){

    ?>
					<option  selected="selected" value="<?=  $mytaskrow->id;   ?>"><?= $mytaskrow->firstname ." ".$mytaskrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
	
	
	<?php 
					 
	
			//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
						$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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="inputmeasurements" class="col-sm-2 control-label"> Mode	</label>
    <div class="col-sm-10">
	<select class="form-control2" name="measurements" required style="width:30%">
			<option value=""    >-Select Measurements Mode-- </option>

	<option value="Pc"   >Percentage(%) </option>
	<option value="No" selected="selected"  >Numbers</option>
</select>
		
		Value expected:  		<input type="TEXT"  style="width:40%"name="target" value="100.0" class="form-control2" required placeholder="Target in Numbers or % ">

						<span class="text-danger">Select Measurements   type(No/Percentage) then enter the value e,g 100% or The number expected to be achieved                 <?php echo form_error('measurements'); ?>
	</div>
  </div>
  
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     	<input type="hidden" name="notification"   value="<?php if(isset($img_id)) {echo $img_id; }?>"  class="form-control">

	         <button type="submit"  value="task" name="btn_addtask" class="btn btn-info"> Post Task   </button>

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

    

				</div>

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








	
	
	<div id="addmyModal" 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">Post your daily  Task</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/postdailytask' , 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="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewtasks">



<div class ="form-inline">

<table width="100%" border="1">
<tr>
<td width="30%">Task</td>
<td>Achived Target</td>
<td>Status</td>
<td>Comment</td>

</tr>
</table>
 <div class="col-sm-12">
<?php	

					 

$mytask = $this->usermodel->populatealldatanoarraythree('assigntask', 'companyid',$companyid,'defaulttype','yes','employeeid',$userid);



if(is_array($mytask)) {

   foreach($mytask as $mytaskrow){
    ?>

<p>

     <div class="form-group">
	     <label for="inputmytaskid" class="col-sm-1 control-label">	Task?</label>

    <div class="col-sm-3">
	<select class="form-control" style="width:90%" name="mytaskid[]" required>
	
	<option value=""  >-Select task-</option>

	
	<?php 
					 

					// $mytask= $this->usermodel->populateall('assigntask','employeeid',$userid);

//$mytask = $this->usermodel->populatealldatanoarraythree('assigntask', 'companyid',$companyid,'defaulttype','yes','employeeid',$userid);



  $mytasks= $this->usermodel->populateallarray('tasktype','id',$mytaskrow->taskid);
			echo$taskname=$mytasks[0]['name'];
    ?>
					<option selected="selected" value="<?=  $mytaskrow->taskid;   ?>"><?=  $taskname; ?></option>




</select>


	</div>
	
		 <div class="col-sm-2" style="margin:0px;">	
		 <input type="text" style="width:100%; margin:0px;" autofocus  name="achieved[]" value="0"  id="achieved" class="form-control" required placeholder="Enter total achived">
		 </div>

<div class="col-sm-2" style="margin:0px;">	
	<select class="form-control" style="width:90px" name="status[]" required>
		<option value=""  >-select task status-</option>

	<option value="new"  >new</option>
	<option value="pending"  >pending</option>
		<option value="ongoing"  >ongoing</option>
		<option value="closed" selected="selected" >closed</option>
</select>
				 </div>
				 		 <div class="col-sm-4">	
						 		 <input type="text" style="width:100%; margin:0px;" autofocus  name="comment[]" value="n/a"  id="comment" class="form-control" required placeholder="Enter task comments">


						 </div>


  </div>


		 
</p>
  	<?php

}} else {
    echo 'No branch available.';
}
	
?>

	  </div>
	  </div>




 <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
			$allusers = $this->usermodel->populatealldatanoarray('people', 'id',$userid,'id >',0);

 		
				
	

	
if(is_array($allusers)) {

   foreach($allusers as $userrow){

   //echo $courserow->coursename;
    ?>
						<option selected="selected" 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('user'); ?>

	</div>
  </div>
  



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

				<textarea name="challanges" id="challanges" required value="<?php echo set_value('challanges'); ?>"  class="form-control"  placeholder="Enter task challanges"></textarea>
			
		<span class="text-danger"> <?php echo form_error('challanges'); ?>
		
		</span>
	</div>
  </div>
		<div class="form-group">
    <label for="inputrecommendation" class="col-sm-2 control-label">To list </label>
    <div class="col-sm-10">

				<textarea name="recommendation" id="recommendation" required value="<?php echo set_value('recommendation'); ?>"  class="form-control"  placeholder="Enter your todo list for next day"></textarea>
			
		<span class="text-danger"> <?php echo form_error('recommendation'); ?>
		
		</span>
	</div>
  </div>
		

	
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="task" name="btn_postdailytask" class="btn btn-default"> Add Task   </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">Edit 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'); 
				  $exactdate = date('Y-m-d H:i:s');
                 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">
		<input type="hidden" name="page" value="<?php echo $page ?>"id="page" class="form-control" required placeholder="Enter bookid">
		<input type="hidden" name="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">

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

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


  <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="" selected="selected"  ></option>

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


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="mytaskowner"style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>

	
	<?php 
					 
		//	$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
					$taskreceiver  = $this->usermodel->populatealldatanoarray('people','companyid', $companyid,'branchid',$branchid );



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" id="subject"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="text" name="fromdate"  id="fromdate" 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="text" name="todate"  id="todate" 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="inputdateposted" class="col-sm-2 control-label">	 Date  Posted</label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="dateposted"  id="dateposted" value="<?php echo set_value('dateposted'); ?>" class="form-control" required placeholder="Enter date posted">
		 
				
		<span class="text-danger"> <?php echo form_error('dateposted'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
   	<div class="form-group">
    <label for="inputmeasurements" class="col-sm-2 control-label">Measurements</label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="measurements"  id="measurements" value="<?php echo set_value('measurements'); ?>" class="form-control2" required placeholder="Enter measurements">
		 
				Target
						 		 			  		/<input type="text" name="target" readonly id="target" style="width:20%"  value="<?php echo set_value('target'); ?>" class="form-control2" required placeholder="Enter target achieved in No/Pc %">

		<span class="text-danger"> <?php echo form_error('measurements'); ?>
		
		</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="contact" 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">
	
	
	
	<select class="form-control2" name="status" id="status" required style="width:25%">
	
	<option value="New"  selected="selected">New</option>
	<option value="Pending"  >Pending</option>
		<option value="Completed"  >Completed</option>
				<option value="Verified"  >Verified</option>

</select>
		
		 
				
		<span class="text-danger"> <?php echo form_error('status'); ?>
		
		</span>
		
		
				  Exact Completed Date		<input readonly type="text" name="exactdate"  id="latestdate" style="width:40%" value="" class="form-control2" required placeholder="Enter start date">

	</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" required>
		<option value="" ></option>
	<option value="High" selected="selected"  >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="inputrepeated" class="col-sm-2 control-label">Sms Notification?	</label>
    <div class="col-sm-10">
	<select class="form-control"   id="repeated" name="repeated" 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="controller" name="controller" style ="width: 100%"  required>
	
	<option value="" selected  ></option>

	
	<?php 
					 
	
			//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
			$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',"1",'category','user');


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">	Feedback / Description .</label>
    <div class="col-sm-10">

				<textarea name="comments" id="comments" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter task description"></textarea>
			
		<span class="text-danger"> <?php echo form_error('comments'); ?>
		
		</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-default"> 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">View task details</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">
		<input type="hidden" name="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">

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


  
  <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="mycategory" required>
	
	<option value="" selected="selected"  ></option>

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


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 
					 
				//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);

			$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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="text" 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="inputdateposted" class="col-sm-2 control-label">	 Date  Posted</label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="dateposted"  id="dateposted2" value="<?php echo set_value('dateposted'); ?>" class="form-control" required placeholder="Enter date posted">
		 
				
		<span class="text-danger"> <?php echo form_error('dateposted'); ?>
		
		</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="text" 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="priority2"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="inputrepeated" class="col-sm-2 control-label">Sms Notification?	</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 
					 
				//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);

			$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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="inputmeasurements" class="col-sm-2 control-label">Measurements </label>
    <div class="col-sm-10">
	
		  		<input type="text" readonly name="measurements"  id="measurements2" value="<?php echo set_value('measurements'); ?>" class="form-control2" required placeholder="Enter measurements">
				 			  Target/		<input type="text" name="target" id="target2" style="width:20%"  value="<?php echo set_value('target'); ?>" class="form-control2" required placeholder="Enter target achieved in No/Pc %">

		<span class="text-danger"> <?php echo form_error('measurements'); ?>
		
		</span>
	</div>
  </div>
  
  
   
	<div class="form-group">
    <label for="inputcomments" class="col-sm-2 control-label">	Task details </label>
    <div class="col-sm-10">
	
				<textarea name="comments" readonly id="comments2" value="<?php echo set_value('comments'); ?>"  class="form-control"  placeholder="Enter task description"></textarea>

			
		
	</div>
  </div>
  

  	
  
  
  
 

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

				}else{

				}
	

	?>
	

	

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

    

				</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">Post the report</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				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">

		<input type="hidden" name="myview" value="<?php echo $myview ?>"id="myview" class="form-control" required placeholder="Enter myview number">
		<input type="hidden" name="mydate"  id="mydate" value=""  class="form-control" required placeholder="Enter myview number">



<div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">Feedback type?</label>
    <div class="col-sm-10">
	<select class="form-control" name="type" id="type"  required>
	
	<option value=""  selected="selected">-Select Feedback type-</option>
	<option value="FeedbackOnly"  >I Want to post feedback Only</option>
	<option value="FeedbackImage"  >I Want to post feedback and Document</option>
	<option value="DocumentOnly"  >I Want upload Document Only</option>


	
</select>
		

	</div>
  </div>
  






  <div class="form-group">
    <label for="inputtaskowner" class="col-sm-2 control-label">	Assigned to?</label>
				<input type="hidden" name="notification"  id="notification1" value=""  class="form-control">

    <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 
					 
	
			//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
			$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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="inputcontroller" class="col-sm-2 control-label">	Supervisor?</label>
    <div class="col-sm-10">
	<select class="form-control" id="controller1" name="controller" style ="width: 100%"  required>
	
	<option value=""  ></option>

	
	<?php 
					 
	
			//$taskreceiver = $this->usermodel->populateall('people', 'companyid',$companyid);
			$taskreceiver = $this->usermodel->populatealldatanoarraythree('people', 'companyid',$companyid,'status',1,'category','user');


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" style="display:none">
    <label for="inputfromdate" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" 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="text" 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="inputachieved" class="col-sm-2 control-label">Taget Achived           </label>
    <div class="col-sm-10">
			  		<input type="text" name="achieved" style="width:30%"  value="<?php echo set_value('achieved'); ?>" class="form-control2" required placeholder="Enter target achieved in No/Pc %">
		 		 			  		/<input type="text" name="target" readonly id="target1" style="width:20%"  value="<?php echo set_value('target'); ?>" class="form-control2" required placeholder="Enter target achieved in No/Pc %">

		  		Measurements   <input type="text" name="measurements" id="measurements1"  readonly style="width:20%"  value="<?php echo set_value('measurements'); ?>" class="form-control2" required placeholder="Enter target achieved in No/Pc %">

				
		<span class="text-danger"> <?php echo form_error('achieved'); ?>
		
		</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">
	
		  		<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>		
	
	</div>
  </div>
		
	
	  <div class="form-group">
    <label for="inputexactdate" class="col-sm-2 control-label">Exact Task Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="exactdate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('exactdate'); ?>
		
		</span>
	</div>
  </div>
  
	
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">Feedback</label>
    <div class="col-sm-10">

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


	<div class="form-group">
    <label for="inputchallanges" class="col-sm-2 control-label">	Challanges and Recommendation  </label>
    <div class="col-sm-10">

				<textarea name="challanges" id="challanges" placeholder="Enter Challanges and Recommendation" required value="<?php echo set_value('challanges'); ?>"  class="form-control"  placeholder="Enter task challanges"></textarea>
			
		<span class="text-danger"> <?php echo form_error('challanges'); ?>
		
		</span>
	</div>
  </div>
  
 
		<div class="form-group" id="mybankname1">
    <label for="inputphoto" class="col-sm-2 control-label">	Upload Document </label>
    <div class="col-sm-10">
	<input type="hidden" name="img_id"   value="<?php if(isset($img_id)) {echo $img_id; }?>"  class="form-control">


	<input type="file" name="photo" value="<?php echo set_value('photo'); ?>"id="photo" class="form-control"  multiple="multiple" placeholder="Please upload image if any">
			<span class="text-danger"> Upload Document if any..<?php echo form_error('photo'); ?>
		
		</span>
	</div>		
</div>

		<div class="form-group" id="mybankname2">
    <label for="inputrecommendation" class="col-sm-2 control-label">Document Description </label>
    <div class="col-sm-10">

				<textarea name="recommendation" id="recommendation"  value="<?php echo set_value('recommendation'); ?>"  class="form-control"  placeholder="Enter short description of the document. E.g name or what it contains.."></textarea>
			
		<span class="text-danger"> <?php echo form_error('recommendation'); ?>
		
		</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-default"> Post  Task  Feedback  </button>

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

    

				</div>

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









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

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

 
</div>






	
									
	
		
  












