

<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", "#editbtn", function()
        {
          var mycallerid = $(this).data('id');
		  $("#mycallerid").val(mycallerid); 
		   
		   		  var calldate = $(this).data('calldate');
		   $("#calldate").val(calldate);   
   var subject = $(this).data('subject');
		   $("#subject").val(subject);
 
		    var callername = $(this).data('callername');
		   $("#callername").val(callername); 
		   
		     var receiver = $(this).data('receiver');
		   $("#receiver").val(receiver); 
		       var category = $(this).data('category');
		   $("#category").val(category); 
		   
		     var email = $(this).data('email');
		   $("#email").val(email);
 
		    var phone = $(this).data('phone');
		   $("#phone").val(phone); 
		   
		     var status = $(this).data('status');
		   $("#status").val(status); 
		 
		   
		     var media = $(this).data('media');
		   $("#media").val(media); 
		 
		          
		     var calldate = $(this).data('calldate');
		   $("#calldate").val(calldate); 
		 
		     var description = $(this).data('description');
		   $("#description").val(description); 
		 
     
	
	
	
		   
		   
        });
		
		





    </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'); 
				echo $this->session->flashdata('msg'); 

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

	 $update=$this->usermodel->populatuserpermissionsdataarray('callcenter','upadate',$userid);
  $delete=$this->usermodel->populatuserpermissionsdataarray('callcenter','delete',$userid);
	 
			    $view=$this->usermodel->populatuserpermissionsdataarray('callcenter','view',$userid);
			    $download=$this->usermodel->populatuserpermissionsdataarray('callcenter','download',$userid);
				
				  $mydate = date('Y-m-d 23:59:59');
   $fromdate=date("Y-m-d 00:00:00");

function formatMoney($number, $fractional=false) {
						if ($fractional) {
							$number = sprintf('%.2f', $number);
						}
						while (true) {
							$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $number);
							if ($replaced != $number) {
								$number = $replaced;
							} else {
								break;
							}
						}
						return $number;
					}
	   
								?>	
  
		<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 History Report</span>
				 
				 				

					<a href="<?php echo base_url();?>user/gatepass" class="btn btn-warning">Create new Visitor (GatePass)</a>	 
						<a href="<?php echo base_url();?>user/viewgatepass" class="btn btn-success">Check-in/Out Visitor /Go back </a>	 
								<a data-toggle='modal' data-target='#issuedtModal' class="btn btn-info">Search for Visitor History  </a>
					<a data-toggle='modal' data-target='#FrequencytModal' class="btn btn-info"> Frequency History  </a>


            	</div>
            </div>
			<div class="panel-body">

			
	<div class="widget-content nopadding table_holder table-responsive" >				
			
					<div class="row">
					
						<div class="col-md-12" style="background:brown">
	<CENTER>
	<BR>
        <?php 
		
        $attr = array("class" => "form-horizontal", "role" => "form", "id" => "search", "name" => "search");
        echo form_open("user/searchallvisitorhistory", $attr);?>
            <div class="form-group">
			
                <div class="col-md-4">
                    <input class="form-control" id="searchterm"  required autofocus name="searchterm" placeholder="Search for Visitor by name, idno,Vehicle No, Email etc.." type="text" value="<?php echo set_value('searchterm'); ?>" />
                
		
				</div>
					
                <div class="col-md-3" style="display:none">
							<select class="form-control" name="status" required>
	
	<option value=""  >-Choose-</option>

				<option  value="Check-in"    >Check-in</option>
				<option   value="Check-Out"   >Check-Out</option>
				<option   value="Status"   selected="selected"   >Check Status/General Search</option>


	
	
</select>
				
					</div>
                <div class="col-md-4">
                    <input id="btn_search" name="btn_search" type="submit" class="btn btn-primary" value="Click here to View" />
                    <a href="<?php echo base_url(). "user/viewallgatepassandcheckins"; ?>" class="btn btn-primary">Refresh</a>
                </div>
				 
            </div>
        <?php echo form_close(); ?>
	</CENTER>

        </div>
		</br>	</br>
					
		
		
						<div class="col-md-12">

							<div class="panel-body">
	<B> CHECKIN HISTORY</B>
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
		    <th>Print</th>
			    <th>Check-out</th>
     <th>Checkin-Date</th>
	      <th>Check-in/Out</th>
		  	   <th>Status</th>
		  	

	      <th>Name</th>
  <th>Id No</th>
     <th>Phone</th>
  <th>Reason</th>
	   	  	   <th>Membership No</th>
			     <th>Booked By</th>
	   	   <th>category</th>
		     <th>From</th>
			   
			   
			   
			   
			   	 		   	   	   <th>Email</th>

   <th>Location To</th>

		  	   	   <th>Vehicle No</th>
	   	   <th>Model</th>
	   	   <th>Color</th>

	    
			<th>Remarks</th>
	   	   <th>Gate</th>

    <th>$</th>

<th>By</th>
                 </tr>
             </thead>
<?php
$TTAMOUNT=0;
 if(!is_array($callcenter)) 

 {


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

		 

             ?>



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


?>

   <td>
			    <a id="non-printable" class="btn btn-primary" href="<?php echo base_url();?>user/printgatepass?invoice=<?php   if(isset($myinvoice)) {echo $myinvoice; } ?>">View/Print   </a>
			   
			   
			   </td>
   <td>
  	  				<a  id="more"  class="btn btn-warning" href="<?php echo base_url();?>user/checkinoutgatepasshistory?passid=<?php   {echo  $c->id;}  ?>&status=Check-Out&userpassid=<?php   {echo  $c->visitorid;}  ?>"> Check-Out</a>

</td>
  
      <td><?php echo $c->checkindate ; ?>
	  
	        <td><?php echo $c->checkoutdate ; ?></td>

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




  <td><?php echo $c->name ; ?></td>
   <td><?php echo $c->idno ; ?></td>

      <td><?php echo $c->phone ; ?></td>
	  
	     <td><?php  $c->category ;
  $servicesdetails = $this->usermodel->populateallarray('services','id',$c->category);
	 	echo$servicesdetails[0]['name'];	


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


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

   <td><?php echo $c->membership ; ?></td>
      <td><?php //echo $c->business 
	  $clubs = $this->usermodel->populateallarray('clubs','id',$c->business);
	  if($clubs==false){
		  $c->business ;
	  }else{
		 echo$clubs[0]['name'];	 
		  
	  }
	 	

	  
	  
	  ; ?></td>

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

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

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

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

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

   <td><?php echo $c->messageid ; 
   $TTAMOUNT=$TTAMOUNT+(double)$c->messageid ;

   
   ?></td>


 <td><?php  $userids= $c->receiver ;

$myuser=$this->usermodel->geteuser($userids);
if($myuser==false){
	echo $c->receiver;
}else{
 echo $myname=$myuser[0]['firstname'];	
}
  

  ?></td>
	   
	   
             </tr>

	<?php endforeach;} ?>

         	  
			  <tr border="1" background="green">
			<td colspan="14"><b>TT</b></td>
		<td colspan="3"><b>
		<?php if(isset($TTAMOUNT)) {echo   formatMoney($TTAMOUNT, true); }?>
		</b></td>

							
</tr>

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

        
        </div>
	</div>




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

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

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


$imgid = $userid.time();

				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addnewcalls' , 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="mycategoryid" value=""id="mycallerid" class="form-control" required placeholder="Enter mycategoryid">
			  		<input type="hidden" name="imgid" value="<?php echo $imgid ?>"id="imgid" class="form-control" required placeholder="Enter bookid">
	
	<input type="hidden" name="action" value="update" class="form-control" required placeholder="Enter action">


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

	<option value=""  >Select Category</option>
			<option value="Sales"  >Sales</option>
			<option value="Inquiry"  >Inquiry</option>

	<option value="Complain"  >Complain</option>
		<option value="Support"  >Support</option>

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

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

	</div>
  </div>
  	
	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Call 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="inputcallername" class="col-sm-2 control-label">Caller Names </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="callername" name="callername" value="<?php echo set_value(''); ?>" class="form-control" required placeholder="Enter caller name">
		 
				
		<span class="text-danger">Name of the person who called?  <?php echo form_error('callername'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">Caller Number </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="phone"  name="phone" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter phone  number">
		 
				
		<span class="text-danger"> <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">Caller Email </label>
    <div class="col-sm-10">
	
		  		<input type="email" id="email" name="email" value="<?php echo set_value('email'); ?>" class="form-control" required placeholder="Enter caller email">
		 
				
		<span class="text-danger">  <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputreceiver" class="col-sm-2 control-label">Receiver Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" id="receiver" name="receiver" value="<?php echo set_value('receiver'); ?>" class="form-control" required placeholder="Enter receiver name.">
		 
				
		<span class="text-danger">Who received the call? <?php echo form_error('receiver'); ?>
		
		</span>
	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputmedia" class="col-sm-2 control-label">Media / Mode</label>
    <div class="col-sm-10">
	
		  		<input type="text" id="media" name="media" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="How did customer know us  e.g Tv adverts">
		 
				
		<span class="text-danger">How did customer know us <?php echo form_error('media'); ?>
		
		</span>
	</div>
  </div>

	
  <div class="form-group">
    <label for="inputcalldate" class="col-sm-2 control-label">Call Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  id="calldate" name="calldate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter call date">
		 
				
		<span class="text-danger"> <?php echo form_error('calldate'); ?>
		
		</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" id="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">
    <label for="inputstatus" class="col-sm-2 control-label">Status?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" id="status" required>
		<option value="" selected="selected" ></option>

	<option value=""  >Select status</option>
			<option value="new"  >new</option>
			<option value="attended"  >attended</option>

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

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

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

	</div>
  </div>
  	
	
	
	 <div class="form-group">

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

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

    

				</div>

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








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

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

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

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

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

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

  </div>

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

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

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



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

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

  <div class="form-group">
    <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>
			<option value="Sales"  >Sales</option>
			<option value="Inquiry"  >Inquiry</option>

	<option value="Complain"  >Complain</option>
		<option value="Support"  >Support</option>

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

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

	</div>
  </div>
  	
	<div class="form-group">
    <label for="inputsubject" class="col-sm-2 control-label">Call 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="inputcallername" class="col-sm-2 control-label">Caller Names </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="callername" value="<?php echo set_value(''); ?>" class="form-control" required placeholder="Enter caller name">
		 
				
		<span class="text-danger">Name of the person who called?  <?php echo form_error('callername'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label">Caller Number </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="Enter phone  number">
		 
				
		<span class="text-danger"> <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">Caller Email </label>
    <div class="col-sm-10">
	
		  		<input type="email" name="email" value="<?php echo set_value('email'); ?>" class="form-control"  placeholder="Enter caller email">
		 
				
		<span class="text-danger">  <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputreceiver" class="col-sm-2 control-label">Receiver Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="receiver" value="<?php echo set_value('receiver'); ?>" class="form-control" required placeholder="Enter receiver name.">
		 
				
		<span class="text-danger">Who received the call? <?php echo form_error('receiver'); ?>
		
		</span>
	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputmedia" class="col-sm-2 control-label">Media / Mode</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="media" value="<?php echo set_value('phone'); ?>" class="form-control" required placeholder="How did customer know us  e.g Tv adverts">
		 
				
		<span class="text-danger">How did customer know us <?php echo form_error('media'); ?>
		
		</span>
	</div>
  </div>

	
  <div class="form-group">
    <label for="inputcalldate" class="col-sm-2 control-label">Call Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  name="calldate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter call date">
		 
				
		<span class="text-danger"> <?php echo form_error('calldate'); ?>
		
		</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">
    <label for="inputstatus" class="col-sm-2 control-label">Status?</label>
    <div class="col-sm-10">
	<select class="form-control" name="status" required>
	
	<option value=""  >Select status</option>
			<option value="new"  >new</option>
			<option value="attended"  >attended</option>

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

	<option value="completed"  >Completed</option>
	<option value="Other"  >Other</option>

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

	</div>
  </div>
  	
	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="calls" name="btn_addaddnewcalls" class="btn btn-primary"> Add calls   </button>

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

    

				</div>

		</div>
	    </div>
    </div>		
	
	
	
	
	
	
	
	
	
	
	<div id="addvisitorModal" 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 Visitor</h4>
      </div>
      <div class="modal-body">
      
	  	

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



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

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

  	
	<div class="form-group">
    <label for="inputcallername" class="col-sm-2 control-label">Visitor Name </label>
    <div class="col-sm-10">
	
		  		<input type="text" autofocus name="callername" value="<?php echo set_value(''); ?>" class="form-control" required placeholder="Enter Visitor name">
		 
				
		<span class="text-danger">Name of the visitor or customer  <?php echo form_error('callername'); ?>
		
		</span>
	</div>
  </div>
  
  
    	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Business Name </label>
    <div class="col-sm-10">
		  		<input type="text" name="description" value="<?php echo set_value('description'); ?>"   class="form-control"  placeholder="Enter business name">

			
		<span class="text-danger"> <?php echo form_error('description'); ?>
		
		</span>
	</div>
  </div>
  
  
  	<div class="form-group">
    <label for="inputphone" class="col-sm-2 control-label"> Phone No. </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="phone" value="<?php echo set_value('phone',"2547"); ?>" class="form-control" required placeholder="Enter phone  number">
		 
				
		<span class="text-danger"> <?php echo form_error('phone'); ?>
		
		</span>
	</div>
  </div>

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

  
    <div class="form-group">
    <label for="inputemail" class="col-sm-2 control-label">Visitor Email </label>
    <div class="col-sm-10">
	
		  		<input type="email" name="email" value="<?php echo set_value('email'); ?>" class="form-control"  placeholder="Enter Visitor email">
		 
				
		<span class="text-danger">  <?php echo form_error('email'); ?>
		
		</span>
	</div>
  </div>

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

 
  
  
  
  
  <div class="form-group">
    <label for="inputcalldate" class="col-sm-2 control-label">Visitor Date </label>
    <div class="col-sm-10">
	
		  		<input type="date"  name="calldate" value="<?php echo  date("Y-m-d"); ?>" class="form-control" required placeholder="Enter Visitor date">
		 
				
		<span class="text-danger"> <?php echo form_error('calldate'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  <div class="form-group">
    <label for="inputmedia" class="col-sm-2 control-label">Media / Mode / Location</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="media" value="<?php echo set_value('media',"Office"); ?>" class="form-control" required placeholder="How did customer know us  e.g Tv adverts">
		 
				
		<span class="text-danger">How did customer know us <?php echo form_error('media'); ?>
		
		</span>
	</div>
  </div>
    	
	 <div class="form-group">
    <label for="inputcategory" class="col-sm-2 control-label">Send Sms?</label>
    <div class="col-sm-10">
	<select class="form-control" name="sendsms" required>
	
	<option value=""  >Do you want Send thank you Sms?</option>
				<option selected value="yes"  >Yes</option>
				<option  value="no"  >No</option>


	
	
</select>
		

	</div>
  </div>
	 
  <?php
  
   $getmessage= $this->usermodel->populateallarray('smstemplate','status',"visitor");
	 $currentmessage=$getmessage[0]['description'];
  if(isset($currentmessage)) { $currentmessage; }
  
  ?>
  
  
  
  
  
		<div class="form-group" >
    <label for="inputsms" class="col-sm-2 control-label">Text sms </label>
    <div class="col-sm-10">
	<textarea name="sms"   value="<?php echo set_value('sms'); ?>"  required class="form-control"  placeholder="Enter sms "><?php if(isset($currentmessage)) {echo$currentmessage; }  ?></textarea>
			
		<span class="text-danger"> <?php echo form_error('sms'); ?>
		
		</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=""  >Select status</option>
			<option value="new" selected >new</option>
						<option value="intrested"  >intrested</option>
						<option value="Not Intrested"  > Not intrested</option>
			<option value="General Visitor"  >General Visitor</option>

			<option value="attended"  >attended</option>

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

	<option value="completed"  >Completed</option>
	<option value="Other"  >Other</option>

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

	</div>
  </div>

	
	
  <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 Visitor Category</option>
				<option value="OfficeVisitor"  >Office Visitor</option>
				<option selected value="EventVisitor"  >Event Visitor</option>

			<option value="Sales"  >Sales</option>
			<option value="Inquiry"  >Inquiry</option>

	<option value="Complain"  >Complain</option>
		<option value="Support"  >Support</option>

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

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

	</div>
  </div>
	
	
	
	
	
	
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="calls" name="btn_addaddnewcalls" class="btn btn-primary"> Add Vistor   </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 id="issuedtModal" 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">View visitor history</h4>
      </div>
      <div class="modal-body">
      
	  	




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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/searchvisitorcheckins' , 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="inputbranch" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-10">
	<select class="form-control" name="branch"  id="branch" required>
	
	
	<option value=""  >---Select Branch/Counter-</option>
						<option value="Main"  >Main Store</option>
					
						<option value="all"  selected="selected" >--All/Any--</option>

	
	<?php //
					 
					 		$maincategory = $this->usermodel->populateall('branch','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="inputmethod" class="col-sm-2 control-label">Search By?</label>
    <div class="col-sm-10">
	<select class="form-control" name="method"  id="method" required>
	
	
	<option value=""  >---Select One-</option>
							<option value="all"  >ALL</option>

						<option value="idno"  >Id No</option>
						<option value="Vehicleno"  >Vehicle No</option>
						<option value="phone"  >Phone</option>
						<option value="email"  >Email</option>


</select>
		

		
	</div>
  </div>




    <div class="form-group">
    <label for="inputfromdate" class="col-sm-2 control-label">Enter Details </label>
    <div class="col-sm-10">

   <input type="text" name="type" value="all" class="form-control" required placeholder="Enter all">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</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',$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">	To Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$mydate); ?>" 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="inputdownload" class="col-sm-2 control-label">Download?</label>
    <div class="col-sm-10">
	<select class="form-control" name="download"  id="download" required>
	
	
	<option value=""  >---Select One-</option>
							<option value="yes"  >yes</option>

						<option value="no" select >No</option>
					


</select>
		

		
	</div>
  </div>




	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="event" name="btn_addevent" class="btn btn-primary"> View   </button>

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

    

				</div>

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

				<div id="FrequencytModal" 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">View visitor history</h4>
      </div>
      <div class="modal-body">
      
	  	




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



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/searchvisitorfequency' , 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="inputbranch" class="col-sm-2 control-label">Branch</label>
    <div class="col-sm-10">
	<select class="form-control" name="branch"  id="branch" required>
	
	
	<option value=""  >---Select Branch/Counter-</option>
					
						<option value="all"  >--All/Any--</option>

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


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

   //echo $courserow->coursename;
    ?>
					<option selected  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',$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">	To Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="todate" value="<?php echo set_value('todate',$mydate); ?>" 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="inputdownload" class="col-sm-2 control-label">Download?</label>
    <div class="col-sm-10">
	<select class="form-control" name="download"  id="download" required>
	
	
	<option value=""  >---Select One-</option>
							<option value="yes"  >yes</option>

						<option value="no" selected="selected" >No</option>
					


</select>
		

		
	</div>
  </div>




	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="event" name="btn_viewvisitorfrequency" class="btn btn-primary"> View Report   </button>

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

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

	

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

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

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

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

    

				</div>

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









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

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

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

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

</div>
</div>
















