

 
 <div class="row">
  
   	 	<div class="col-md-4">
				<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >
			
	
				
	<?PHP
	
$mydate=date('Y-m-d');

				echo $this->session->flashdata('msg'); 

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

 echo $this->session->flashdata('groupmsg'); 
                  echo form_open('user/adddocuments' , array('class' => 'form-horizontal form-groups-bordered validate',  'id' => 'signup','enctype' => 'multipart/form-data'));

		 if(validation_errors()):?>

<?php endif;?>
<input type="hidden" name="view" value="<?php echo base_url();?>user/viewmydocuments?randomitemidentifier=<?php   {echo  $itemid;}  ?>&image_id=<?php   {echo  $image_id;}  ?>"id="view" class="form-control" required placeholder="Enter status">

 <div class="form-group">
    <label for="inputphoto" class="col-sm-2 control-label">	Upload Document</label>
    <div class="col-sm-10">
	<input type="hidden" name="mydocuments"   value="<?php if(isset($image_id)) {echo $image_id; }?>"  class="form-control">
	<input type="hidden" name="img_id"   value="<?php if(isset($currentimg_id)) {echo $currentimg_id; }?>"  class="form-control">


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





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

  
  	<div class="form-group">
    <label for="inputidno" class="col-sm-2 control-label">	Doc Number/ code </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="idno" value="<?php echo set_value('idno'); ?>" class="form-control"  placeholder="Enter idno/ code/ transaction code if any">
		 
				
		<span class="text-danger"> <?php echo form_error('idno'); ?>
		
		</span>
	</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 Category-</option>
	
	
	<?php 
					 
					 		$maincategory = $this->usermodel->populateall('documentcategory','companyid',$companyid);


							


if(is_array($maincategory)) {

   foreach($maincategory as $maincategoryrow){

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



	<?php

}} else {
    echo 'No Branch/Counter.';
}
	
?>
</select>
		

		
	</div>
  </div>
  
  
  
  
  
  
  
  
  
 
  
   	<div class="form-group">
    <label for="inputentrydate" class="col-sm-2 control-label">	Entry Date </label>
    <div class="col-sm-10">

		  		<input type="date" name="entrydate" value="<?php echo set_value('entrydate',$mydate); ?>" class="form-control"  required placeholder="Enter entrydate">
		 
				
		<span class="text-danger"> <?php echo form_error('entrydate'); ?>
		
		</span>
	</div>
  </div>
  
  
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	Comment</label>
    <div class="col-sm-10">

				<textarea name="description" value="<?php echo set_value('description'); ?>"  class="form-control"  placeholder="Enter Comment "></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="documents" name="btn_adddocuments" class="btn btn-primary"> Add documents   </button>
<a class="btn btn-primary" href="<?php echo base_url(); ?>user/viewmember"> Back?</a>

    </div>
  </div>
  
  

 

			<?PHP
		echo form_close();
		
		?>
		
		</div>
</div>
</div>
   	<div class="col-md-8">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
							

				View category/group
            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	<?PHP
				echo $this->session->flashdata('activemsg'); 								?>	
										
					<div class="row">
						<div class="col-md-12">
							
										<div class="panel-body">
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
         <tr>
    
     <th>Name/title</th>
	 <th>Date Posted</th>
	 <th>No</th>
	  <th>Category</th>
	     <th>Comment</th>
		 <th>Added By?</th>
<th>View</th>		 
		 
	

                 </tr>
             </thead>
<?php
 if(!is_array($viewdocuments)) {
				    echo '<div class="alert alert-danger text-center">There was no document found in the system. Feel free to add many documents.</div>';

			 }else{
 if(!is_array($viewdocuments)) 

 {


   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 ($viewdocuments as $c): 

		 

             ?>



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

?>

              

  <td><?php echo $c->documentname ; ?></td>
  <td><?php echo $c->entrydate ; ?></td>
    <td><?php echo $c->idno ; ?></td>
	   <td><?php echo $c->category ; ?></td>
     <td><?php echo $c->description ; ?></td>
   <td><?php ; 
   $userid=$c->userid;
   if($userid!=""){
	  
      $myname = $this->usermodel->geteuser($userid);
  
     $fname=$myname[0]['firstname']; 
echo $names= $fname; 
	
   }else{
	    echo "No Sender";  
   }
  
  
  ?></td>
 
	  <td>
	 <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmoredocuments?randomitemidentifier=<?php   {echo  $img_id;}  ?>&type=document">Document  </a>

	  </td>
	  	  <td>

	  </td>
			
             </tr>

	<?php endforeach;} ?>

              <?php }?>

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

        
        </div>
									
									
									
					</div>




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

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

 
</div>


















