<div class="row">
    
<div class="span12" style="margin-top:10px;">
   <?php $this->load->view('includes/userheader.php');?>  
     <h3>Your Inquiries
     <?php if(!isset($allenq)){ $listing=$this->postings_model->getDetails($listid);
     echo ' - <a href="'.base_url().'/details/'.  formatText($listing->title).'/'.$listing->id.'">'.$listing->title.'</a>';
     }else{ echo ' - All Inquiries'; }?>
     </h3>
<table class="table table-bordered">
	<thead>
		<tr>
                   <?php if(isset($allenq)){?> <th>Ad Title</th> <?php } ?>
                    <th>Contact Name</th>
                    <th>Contact Email</th>
                    <th>Contact Number</th>
                    <!--<th>Comment</th>-->
                    <th>Date</th>
                    <th>Status</th>
		    <th>&nbsp;</th>
		</tr>
	</thead>
	<tbody>
<?php foreach($enquiries as $enquiry){ 
		$listing=$this->postings_model->getDetails($enquiry->listing_id);
		?>
		<tr>
                 <?php if(empty($listid)){?>
                    <td><a title="<?php echo $listing->title;?>" href="<?php echo base_url();?>details/<?php echo formatText($listing->title);?>/<?php echo $listing->id;?>" ><?php echo substr($listing->title,0,15).'...';?></a></td>
                        <?php } ?>
                    <td><?php echo $enquiry->cname;?></td>
                    <td><?php echo $enquiry->cemail;?></td>
                    <td><?php echo $enquiry->contact;?></td>
                    <!--<td><?php echo $enquiry->comment;?></td>-->
                    <td><?php echo formatDate($enquiry->dt_created);?></td>
                    <td><?php if($enquiry->view_status==0){ echo 'Unread';}else{ echo 'Read';};?></td>
        <td class="action">
        	<a class="btn btn-primary viewEnquiry" title="View / Reply Inquiry" href="" id="<?php echo $enquiry->id;?>">
            	<i class="icon-edit icon-white"></i>
            </a>
             <!--           <a class="btn btn-warning" onclick="return confirm('Deactivate?');" href="#deactivate">
            	<i class="icon-remove icon-white"></i>
            </a> -->
            
                        <a class="btn btn-danger" title="Delete Inquiry" onclick="return deleteEnquiry(<?php echo $enquiry->id;?>);" 
            	href="#delete">
            	<i class="icon-trash icon-white"></i>
            </a>
        </td>
        	
	</tr>
 <?php } ?>
	    </tbody>
</table>
</div>
</div>