

<script type="text/javascript">

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






     $(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 comments = $(this).data('comments');
		   $("#comments1").val(comments); 
		 
		     var status = $(this).data('status');
		   $("#status1").val(status);


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

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


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


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

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

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

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

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

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


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

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

	 $updatecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','update',$userid);
  $deletecomplain=$this->usermodel->populatuserpermissionsdataarray('complain','delete',$userid);
	 
			    $viewcomplain=$this->usermodel->populatuserpermissionsdataarray('complain','view',$userid);
			    $readallcomplain=$this->usermodel->populatuserpermissionsdataarray('sales','allcompalin',$userid);
							
	 $finalendate=date("Y-m-d H:59:59");
  $finalstartdate=date("Y-m-d 00:00:00");	
				
	   
								?>	
  
		<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 Message</span>
				 
				 	
	  <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">	Post Message </a>
				 <a data-toggle='modal' data-target='#viewattendanceModal' class="btn btn-primary">View Suggestions Report </a>
				 
 						 <a href="<?php echo base_url();?>user/viewproductcategorybox" class="btn btn-info"> View/ Create suggestions Categories
						 </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">
		<div class="col-md-12">
        <?php 
		 echo $this->session->flashdata('msg'); 
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchalltasks", $attr);?>
            <div class="form-group">
			
                <div class="col-md-5">
                    <input class="form-control" id="searchterm" name="searchterm" placeholder="Search for complains.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                </div>
                <div class="col-md-4">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-success" value="Search" />
                    <a href="<?php echo base_url(). "user/complain"; ?>" class="btn btn-primary">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>
        </div>
									
						<table class="tablesorter table table-bordered  table-hover" id="printablepart">			
			

             <thead>
			 	<?php
				if(isset($fromdate)) {
					?>
				
			 <tr>
			 <td colspan="6" width="100%">
	<center>
					<b>
										<?php



										$bussinessname=$configuration[0]['businessname']; if(isset($bussinessname)) {echo   $bussinessname; }?>
										</b>
										<BR><B>SUGGESTION REPORT FOR
										<?php
			
			$mysubject="";
						 if(($subject !="")){
				echo "  ".strtoupper($subject)." ";


						}else{
			echo $mysubject=" ALL CATEGORIES " ;
	
						}
						
					echo "BETWEEN ". $fromdate ." AND ". $todate ."" 	 
						 
							?>
							 </B>
		</center>	
		</td>
		</tr>
			 
			<?php
			
				}


?>				
			 
			 
			 
			 
			 
			 
         <tr>
     <th>Date</th>
	 	     <th>Message</th>
     <th>Subject</th>
	 	   <th>Name</th>
	 	   <th>Phone</th>
		   
		   
		       <th>Apartment</th>
	 	   <th>Room</th>
	 	   <th>Location</th>
		   
		   
		   
		   
		   
		   

	   <th>Status</th>
	   <th>Action</th>

	     

<th id="non-printable">View</th>
<th id="non-printable">Reply/Update</th>



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

                 </tr>
             </thead>
<?php

 if(!is_array($complain)) 

 {


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

		 

             ?>



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


?>

              
 
  

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

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

	
		  <td><?php echo $c->name ; ?></td>
		  <td><?php echo $c->serial ; ?></td>
		  
		  
		     <td><?php echo $c->itemname ; ?></td>
		   <td><?php echo $c->number ; ?></td>
		  <td><?php echo $c->location ; ?></td>

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



   
   
                 <td id="non-printable">
				

<a class="btn btn-primary editbtn" id="editbtn" data-subject='<?php echo  $c->subject;?>'  data-description='<?php echo  $c->description;?>'    data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editModel'>
View Message </a>	 

				 
				 
									
				 	

	
	
	   </td>   
	   
	   
	   <td id="non-printable">
	   					   <a  id="more" target="blank" class="btn btn-primary" href="<?php echo base_url();?>user/viewmorecomplains?randomitemidentifier=<?php   {echo  $id;}  ?>">Reply  </a>

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

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        Delete <span class="caret"></span>
                                    </button>
								
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										<!--
											  <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>
									-->
									
                                        <li class="divider"></li>
                                        
                                        <!-- teacher DELETION LINK -->
                                        
                                    </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. "   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="complain">

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

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

  </div>

  </div>		
	
	
	
	
	
	
	
	

<div id="viewattendanceModal" 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">Suggestions Report</h4>
      </div>
      <div class="modal-body">
      
	  	

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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/searchacomplains' , 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;?>

		
  <div class="form-group">
    <label for="inputdisplaytype" class="col-sm-2 control-label">Display type</label>
    <div class="col-sm-10">
	<select class="form-control" name="displaytype"  id="displaytype" required>
	<option value="all"   >-Select one</option>
	<option value="Display"  selected="selected"  >Display Report   </option>
		<option value="Download"  >Download Report   </option>

	

</select>
		

		
	</div>
  </div>
  

    
  <div class="form-group">
    <label for="inputattype" class="col-sm-2 control-label">Action Type</label>
    <div class="col-sm-10">
	<select class="form-control" name="type"  id="type" required>
	<option value="all" selected="selected"   >All</option>
	<option value="Pending"  >	Pending </option>
	<option value="New"  >	New </option>
	<option value="Completed"  >	Completed </option>

	

</select>
		

		
	</div>
  </div>
  
  
  
   <div class="form-group">
    <label for="inputstatus" class="col-sm-2 control-label">SMS status</label>
    <div class="col-sm-10">
	<select class="form-control" name="status"  id="status" required>
	<option value="all" selected="selected"   >All</option>
	<option value="Sent"  >	Sent sms </option>
	<option value="New"  >	New/Pending sms </option>


	

</select>
		

		
	</div>
  </div>
  
  
  
  
  

  <div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Category</label>
    <div class="col-sm-10">
	<select class="form-control" name="subject"  id="subject" required>
	
	
	<option value="all" selected="selected" >---Select All category--</option>

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


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

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

		
	</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="suggestion" name="btn_viewsuggestion" class="btn btn-primary"> View Suggestions  </button>

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

    

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

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



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

		  		<input type="hidden" name="mycategoryid" value="" class="form-control" required placeholder="Enter mycategoryid">
<input type="hidden" name="view" value="user/complain"id="view" class="form-control" required placeholder="Enter status">

  <div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">Category?</label>
    <div class="col-sm-10">
	<select class="form-control" name="type" required>
	
	<option value=""  >Select Category</option>
		<option value="Suggestion"  >Suggestion/Upgrade</option>

	<option value="Complain"  >Complain</option>
	<option value="Message"  >Message</option>
	<option value="Announcement"  >Announcement</option>

		<option value="Innovation"  >Innovation</option>

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

	</div>
  </div>
  	

  <div class="form-group">
    <label for="inputmessageid" class="col-sm-2 control-label">	Send  to?</label>
    <div class="col-sm-10">
	<select class="form-control" name="messageid" style ="width: 100%"  required>
	
	<option value=""  >---Select Select Receiver---</option>
	<option value="na"  selected="selected">General</option>
		<option value="All">All/Everyone</option>


	
	<?php 
					 			$allusers = $this->usermodel->populatealldatanoarray('people', 'companyid',$companyid,'status',1);

	


if(is_array($allusers)) {

   foreach($allusers as $allusersrow){

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



	<?php

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

	</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'); ?>" 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="inputcreateddate" class="col-sm-2 control-label">Created Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" readonly name="createddate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('createddate'); ?>
		
		</span>
	</div>
  </div>
  
  
  

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

				<textarea name="description" value="<?php echo set_value('description'); ?>"  required class="form-control"  placeholder="Enter Complain / Message "></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="addcomplain" name="btn_addcomplain" class="btn btn-primary"> Post Message   </button>

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

    

				</div>

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

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

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


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

		
		


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

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



	
	 <div class="form-group">

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

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

    

				</div>

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

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

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


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

		
		

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

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


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

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



	<?php

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

	</div>
  </div>
  	

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

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

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



	<?php

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

	</div>
  </div>
  

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

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

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

	</div>
  </div>
 

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

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

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



	<?php

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

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

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

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

				}else{

				}
	

	?>
	

	

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

    

				</div>

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

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

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

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



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

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

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

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



	<?php

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

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

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

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

	
	
	
	 <div class="form-group">

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

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

    

				</div>

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









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

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

 
</div>


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

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

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



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

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

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

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



	<?php

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

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

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

	

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

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

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

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

    

				</div>

		</div>
	 




















