<?php

/*Import data into specific Template*/
global $wpdb;
$tablename = $wpdb->prefix.'geek_pricing_estimator_estimate_form_data'; 

?>

<div class="container" style="width:90%;">
	<div class="NoticeCtr"></div>
	<h1>Print Estimate Request</h1>

	
<!----------------Container Start ----------------------->	
<div id="EstimateajaxLoder"><img src="<?php echo plugins_url(); ?>/geek-price-estimator/images/loder.gif" /></div>
	
	<table class="EstimateTable" style="text-align:center;">
		<thead>
			<tr>
				<th>Date</th>
				<th>Quote</th>
				<th>Estimate No.</th>
				<th>Name</th>
				<th>Email</th>
				<th>Phone</th>
				<th>Address</th>
				<th>Action</th>					
			</tr>			
		</thead>
		<tfoot>
		<tr>
			<th>Date</th>
			<th>Quote</th>
			<th>Estimate No.</th>
			<th>Name</th>
			<th>Email</th>
			<th>Phone</th>
			<th>Address</th>
			<th>Action</th>				
		</tr>
			<td colspan="8">
				<div class="pager"> <span class="left">
					# per page:
					<a href="#">10</a> |
					<a href="#">50</a> |
					<a href="#">100</a> |
					<a href="#">500</a> |
					<a href="#">1000</a> 
				</span>
				<span class="right">
					<span class="prev">
						<img src="<?php echo plugins_url();?>/geek-price-estimator/includes/ppc-tablesorter/pager/icons/prev.png" /> Prev &nbsp;
					</span>
					<span class="pagecount"></span>
					&nbsp;<span class="next">Next
						<img src="<?php echo plugins_url();?>/geek-price-estimator/includes/ppc-tablesorter/pager/icons/next.png" />
					</span>
				</span>
				</div>
			</td>
		</tr>
	</tfoot>
		<tbody>
			<?php
				$results = $wpdb->get_results("SELECT * FROM $tablename ORDER BY id ASC");

				foreach($results as $Queries){				

					$FormHtml = $Queries->form_html;

					echo '<tr>	
							<td><strong>'.date('m/d/Y', $Queries->time).'</strong></td>
							<td><div class="FormEstimateHtml">'.$FormHtml.' <span class="ClosePopUpQouteFormCtr"> X </span></div> <div date="'.date('m/d/Y', $Queries->time).'" estno="'.$Queries->estimate_no.'" custaddress="'.$Queries->caddress.'" custname="'.$Queries->cname.'" class="AdminSectionFormPrintHtmlCtr"><span class="dashicons dashicons-pdf"></span></div></td>				
							<td><strong>'.$Queries->estimate_no.'</strong></td> 
							<td><strong>'.$Queries->cname.'</strong></td>
							<td><strong>'.$Queries->cemail.'</strong></td>
							<td><strong>'.$Queries->cphone.'</strong></td>
							<td><strong>'.$Queries->caddress.'</strong></td>							
							<td><a DBName="'.$tablename.'" dbID="'.$Queries->id.'" class="button EstimateSingledel"><span class="dashicons dashicons-trash"></span></a></td>										
						</tr>';
				}
			
			?>
			
		</tbody>
	</table>	
</div>