<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php
include('../include/session.php');

include('../include/period_select_date.php');	
	
$table_name2 = $_SESSION['db_prefix']."_quotations";


/* ===== Manase 358   */
$cv_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Manase 358' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$cv_tot_result = mySQL_query($cv_tot_query);
$cv_tot_num = mysql_num_rows($cv_tot_result);

$cv0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Manase 358' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$cv0_result = mySQL_query($cv0_query);
$cv0_num = mysql_num_rows($cv0_result);

$cv1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Manase 358' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$cv1a_result = mySQL_query($cv1a_query);
$cv1a_num = mysql_num_rows($cv1a_result);

$cv1b_query = "SELECT  SUM(value) AS cv1_summed_value FROM $table_name2 WHERE project = 'Manase 358' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$cv1b_result = mySQL_query($cv1b_query);
$cv1b_num = mysql_num_rows($cv1b_result);
if ($cv1b_num!=0) {
$cv1b_summed_value = mysql_result($cv1b_result, 0, "cv1_summed_value"); 
}
else {
$cv1b_summed_value=0;
}

$cv2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Manase 358' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$cv2a_result = mySQL_query($cv2a_query);
$cv2a_num = mysql_num_rows($cv2a_result);

$cv2b_query = "SELECT  SUM(value) AS cv2_summed_value FROM $table_name2 WHERE project = 'Manase 358' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$cv2b_result = mySQL_query($cv2b_query);
$cv2b_num = mysql_num_rows($cv2b_result);
if ($cv2b_num!=0) {
$cv2b_summed_value = mysql_result($cv2b_result, 0, "cv2_summed_value"); 
}
else {
$cv2b_summed_value=0;
}

$cv3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Manase 358' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$cv3a_result = mySQL_query($cv3a_query);
$cv3a_num = mysql_num_rows($cv3a_result);

$cv3b_query = "SELECT  SUM(value) AS cv3_summed_value FROM $table_name2 WHERE project = 'Manase 358' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$cv3b_result = mySQL_query($cv3b_query);
$cv3b_num = mysql_num_rows($cv3b_result);
if ($cv3b_num!=0) {
$cv3b_summed_value = mysql_result($cv3b_result, 0, "cv3_summed_value"); 
}
else {
$cv3b_summed_value=0;
}

/* ===== diamond mesh   */
$dm_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Diamond mesh' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$dm_tot_result = mySQL_query($dm_tot_query);
$dm_tot_num = mysql_num_rows($dm_tot_result);

$dm0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Diamond mesh' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$dm0_result = mySQL_query($dm0_query);
$dm0_num = mysql_num_rows($dm0_result);

$dm1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Diamond mesh' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$dm1a_result = mySQL_query($dm1a_query);
$dm1a_num = mysql_num_rows($dm1a_result);

$dm1b_query = "SELECT  SUM(value) AS dm1_summed_value FROM $table_name2 WHERE project = 'Diamond mesh' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$dm1b_result = mySQL_query($dm1b_query);
$dm1b_num = mysql_num_rows($dm1b_result);
if ($dm1b_num!=0) {
$dm1b_summed_value = mysql_result($dm1b_result, 0, "dm1_summed_value"); 
}
else {
$dm1b_summed_value=0;
}

$dm2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Diamond mesh' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$dm2a_result = mySQL_query($dm2a_query);
$dm2a_num = mysql_num_rows($dm2a_result);

$dm2b_query = "SELECT  SUM(value) AS dm2_summed_value FROM $table_name2 WHERE project = 'Diamond mesh' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$dm2b_result = mySQL_query($dm2b_query);
$dm2b_num = mysql_num_rows($dm2b_result);
if ($dm2b_num!=0) {
$dm2b_summed_value = mysql_result($dm2b_result, 0, "dm2_summed_value"); 
}
else {
$dm2b_summed_value=0;
}

$dm3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Diamond mesh' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$dm3a_result = mySQL_query($dm3a_query);
$dm3a_num = mysql_num_rows($dm3a_result);

$dm3b_query = "SELECT  SUM(value) AS dm3_summed_value FROM $table_name2 WHERE project = 'Diamond mesh' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$dm3b_result = mySQL_query($dm3b_query);
$dm3b_num = mysql_num_rows($dm3b_result);
if ($dm3b_num!=0) {
$dm3b_summed_value = mysql_result($dm3b_result, 0, "dm3_summed_value"); 
}
else {
$dm3b_summed_value=0;
}

/* ===== electric fencing   */
$ef_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Electric fencing' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ef_tot_result = mySQL_query($ef_tot_query);
$ef_tot_num = mysql_num_rows($ef_tot_result);

$ef0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Electric fencing' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ef0_result = mySQL_query($ef0_query);
$ef0_num = mysql_num_rows($ef0_result);

$ef1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Electric fencing' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ef1a_result = mySQL_query($ef1a_query);
$ef1a_num = mysql_num_rows($ef1a_result);

$ef1b_query = "SELECT  SUM(value) AS ef1_summed_value FROM $table_name2 WHERE project = 'Electric fencing' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ef1b_result = mySQL_query($ef1b_query);
$ef1b_num = mysql_num_rows($ef1b_result);
if ($ef1b_num!=0) {
$ef1b_summed_value = mysql_result($ef1b_result, 0, "ef1_summed_value"); 
}
else {
$ef1b_summed_value=0;
}

$ef2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Electric fencing' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ef2a_result = mySQL_query($ef2a_query);
$ef2a_num = mysql_num_rows($ef2a_result);

$ef2b_query = "SELECT  SUM(value) AS ef2_summed_value FROM $table_name2 WHERE project = 'Electric fencing' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ef2b_result = mySQL_query($ef2b_query);
$ef2b_num = mysql_num_rows($ef2b_result);
if ($ef2b_num!=0) {
$ef2b_summed_value = mysql_result($ef2b_result, 0, "ef2_summed_value"); 
}
else {
$ef2b_summed_value=0;
}

$ef3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Electric fencing' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ef3a_result = mySQL_query($ef3a_query);
$ef3a_num = mysql_num_rows($ef3a_result);

$ef3b_query = "SELECT  SUM(value) AS ef3_summed_value FROM $table_name2 WHERE project = 'Electric fencing' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ef3b_result = mySQL_query($ef3b_query);
$ef3b_num = mysql_num_rows($ef3b_result);
if ($ef3b_num!=0) {
$ef3b_summed_value = mysql_result($ef3b_result, 0, "ef3_summed_value"); 
}
else {
$ef3b_summed_value=0;
}

/* ===== Farm fence   */
$ff_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Farm fence' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ff_tot_result = mySQL_query($ff_tot_query);
$ff_tot_num = mysql_num_rows($ff_tot_result);

$ff0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Farm fence' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ff0_result = mySQL_query($ff0_query);
$ff0_num = mysql_num_rows($ff0_result);

$ff1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Farm fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ff1a_result = mySQL_query($ff1a_query);
$ff1a_num = mysql_num_rows($ff1a_result);

$ff1b_query = "SELECT  SUM(value) AS ff1_summed_value FROM $table_name2 WHERE project = 'Farm fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ff1b_result = mySQL_query($ff1b_query);
$ff1b_num = mysql_num_rows($ff1b_result);
if ($ff1b_num!=0) {
$ff1b_summed_value = mysql_result($ff1b_result, 0, "ff1_summed_value"); 
}
else {
$ff1b_summed_value=0;
}

$ff2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Farm fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ff2a_result = mySQL_query($ff2a_query);
$ff2a_num = mysql_num_rows($ff2a_result);

$ff2b_query = "SELECT  SUM(value) AS ff2_summed_value FROM $table_name2 WHERE project = 'Farm fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ff2b_result = mySQL_query($ff2b_query);
$ff2b_num = mysql_num_rows($ff2b_result);
if ($ff2b_num!=0) {
$ff2b_summed_value = mysql_result($ff2b_result, 0, "ff2_summed_value"); 
}
else {
$ff2b_summed_value=0;
}

$ff3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Farm fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ff3a_result = mySQL_query($ff3a_query);
$ff3a_num = mysql_num_rows($ff3a_result);

$ff3b_query = "SELECT  SUM(value) AS ff3_summed_value FROM $table_name2 WHERE project = 'Farm fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ff3b_result = mySQL_query($ff3b_query);
$ff3b_num = mysql_num_rows($ff3b_result);
if ($ff3b_num!=0) {
$ff3b_summed_value = mysql_result($ff3b_result, 0, "ff3_summed_value"); 
}
else {
$ff3b_summed_value=0;
}

/* ===== Free standing electric fence   */
$fs_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Free standing electric fence' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$fs_tot_result = mySQL_query($fs_tot_query);
$fs_tot_num = mysql_num_rows($fs_tot_result);

$fs0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$fs0_result = mySQL_query($fs0_query);
$fs0_num = mysql_num_rows($fs0_result);

$fs1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$fs1a_result = mySQL_query($fs1a_query);
$fs1a_num = mysql_num_rows($fs1a_result);

$fs1b_query = "SELECT  SUM(value) AS fs1_summed_value FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$fs1b_result = mySQL_query($fs1b_query);
$fs1b_num = mysql_num_rows($fs1b_result);
if ($fs1b_num!=0) {
$fs1b_summed_value = mysql_result($fs1b_result, 0, "fs1_summed_value"); 
}
else {
$fs1b_summed_value=0;
}

$fs2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$fs2a_result = mySQL_query($fs2a_query);
$fs2a_num = mysql_num_rows($fs2a_result);

$fs2b_query = "SELECT  SUM(value) AS fs2_summed_value FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$fs2b_result = mySQL_query($fs2b_query);
$fs2b_num = mysql_num_rows($fs2b_result);
if ($fs2b_num!=0) {
$fs2b_summed_value = mysql_result($fs2b_result, 0, "fs2_summed_value"); 
}
else {
$fs2b_summed_value=0;
}

$fs3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$fs3a_result = mySQL_query($fs3a_query);
$fs3a_num = mysql_num_rows($fs3a_result);

$fs3b_query = "SELECT  SUM(value) AS fs3_summed_value FROM $table_name2 WHERE project = 'Free standing electric fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$fs3b_result = mySQL_query($fs3b_query);
$fs3b_num = mysql_num_rows($fs3b_result);
if ($fs3b_num!=0) {
$fs3b_summed_value = mysql_result($fs3b_result, 0, "fs3_summed_value"); 
}
else {
$fs3b_summed_value=0;
}

/* ===== Gate   */
$ga_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ga_tot_result = mySQL_query($ga_tot_query);
$ga_tot_num = mysql_num_rows($ga_tot_result);

$ga0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ga0_result = mySQL_query($ga0_query);
$ga0_num = mysql_num_rows($ga0_result);

$ga1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ga1a_result = mySQL_query($ga1a_query);
$ga1a_num = mysql_num_rows($ga1a_result);

$ga1b_query = "SELECT  SUM(value) AS ga1_summed_value FROM $table_name2 WHERE project = 'Gate' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ga1b_result = mySQL_query($ga1b_query);
$ga1b_num = mysql_num_rows($ga1b_result);
if ($ga1b_num!=0) {
$ga1b_summed_value = mysql_result($ga1b_result, 0, "ga1_summed_value"); 
}
else {
$ga1b_summed_value=0;
}

$ga2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ga2a_result = mySQL_query($ga2a_query);
$ga2a_num = mysql_num_rows($ga2a_result);

$ga2b_query = "SELECT  SUM(value) AS ga2_summed_value FROM $table_name2 WHERE project = 'Gate' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ga2b_result = mySQL_query($ga2b_query);
$ga2b_num = mysql_num_rows($ga2b_result);
if ($ga2b_num!=0) {
$ga2b_summed_value = mysql_result($ga2b_result, 0, "ga2_summed_value"); 
}
else {
$ga2b_summed_value=0;
}

$ga3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ga3a_result = mySQL_query($ga3a_query);
$ga3a_num = mysql_num_rows($ga3a_result);

$ga3b_query = "SELECT  SUM(value) AS ga3_summed_value FROM $table_name2 WHERE project = 'Gate' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ga3b_result = mySQL_query($ga3b_query);
$ga3b_num = mysql_num_rows($ga3b_result);
if ($ga3b_num!=0) {
$ga3b_summed_value = mysql_result($ga3b_result, 0, "ga3_summed_value"); 
}
else {
$ga3b_summed_value=0;
}

/* ===== Gate motor  */
$gm_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate motor' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$gm_tot_result = mySQL_query($gm_tot_query);
$gm_tot_num = mysql_num_rows($gm_tot_result);

$gm0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate motor' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$gm0_result = mySQL_query($gm0_query);
$gm0_num = mysql_num_rows($gm0_result);

$gm1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate motor' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$gm1a_result = mySQL_query($gm1a_query);
$gm1a_num = mysql_num_rows($gm1a_result);

$gm1b_query = "SELECT  SUM(value) AS gm1_summed_value FROM $table_name2 WHERE project = 'Gate motor' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$gm1b_result = mySQL_query($gm1b_query);
$gm1b_num = mysql_num_rows($gm1b_result);
if ($gm1b_num!=0) {
$gm1b_summed_value = mysql_result($gm1b_result, 0, "gm1_summed_value"); 
}
else {
$gm1b_summed_value=0;
}

$gm2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate motor' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$gm2a_result = mySQL_query($gm2a_query);
$gm2a_num = mysql_num_rows($gm2a_result);

$gm2b_query = "SELECT  SUM(value) AS gm2_summed_value FROM $table_name2 WHERE project = 'Gate motor' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$gm2b_result = mySQL_query($gm2b_query);
$gm2b_num = mysql_num_rows($gm2b_result);
if ($gm2b_num!=0) {
$gm2b_summed_value = mysql_result($gm2b_result, 0, "gm2_summed_value"); 
}
else {
$gm2b_summed_value=0;
}

$gm3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Gate motor' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$gm3a_result = mySQL_query($gm3a_query);
$gm3a_num = mysql_num_rows($gm3a_result);

$gm3b_query = "SELECT  SUM(value) AS gm3_summed_value FROM $table_name2 WHERE project = 'Gate motor' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$gm3b_result = mySQL_query($gm3b_query);
$gm3b_num = mysql_num_rows($gm3b_result);
if ($gm3b_num!=0) {
$gm3b_summed_value = mysql_result($gm3b_result, 0, "gm3_summed_value"); 
}
else {
$gm3b_summed_value=0;
}

/* ===== Miscelaneous  */
$mc_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Miscelaneous' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$mc_tot_result = mySQL_query($mc_tot_query);
$mc_tot_num = mysql_num_rows($mc_tot_result);

$mc0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Miscelaneous' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$mc0_result = mySQL_query($mc0_query);
$mc0_num = mysql_num_rows($mc0_result);

$mc1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Miscelaneous' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$mc1a_result = mySQL_query($mc1a_query);
$mc1a_num = mysql_num_rows($mc1a_result);

$mc1b_query = "SELECT  SUM(value) AS mc1_summed_value FROM $table_name2 WHERE project = 'Miscelaneous' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$mc1b_result = mySQL_query($mc1b_query);
$mc1b_num = mysql_num_rows($mc1b_result);
if ($mc1b_num!=0) {
$mc1b_summed_value = mysql_result($mc1b_result, 0, "mc1_summed_value"); 
}
else {
$mc1b_summed_value=0;
}

$mc2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Miscelaneous' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$mc2a_result = mySQL_query($mc2a_query);
$mc2a_num = mysql_num_rows($mc2a_result);

$mc2b_query = "SELECT  SUM(value) AS mc2_summed_value FROM $table_name2 WHERE project = 'Miscelaneous' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$mc2b_result = mySQL_query($mc2b_query);
$mc2b_num = mysql_num_rows($mc2b_result);
if ($mc2b_num!=0) {
$mc2b_summed_value = mysql_result($mc2b_result, 0, "mc2_summed_value"); 
}
else {
$mc2b_summed_value=0;
}

$mc3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Miscelaneous' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$mc3a_result = mySQL_query($mc3a_query);
$mc3a_num = mysql_num_rows($mc3a_result);

$mc3b_query = "SELECT  SUM(value) AS mc3_summed_value FROM $table_name2 WHERE project = 'Miscelaneous' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$mc3b_result = mySQL_query($mc3b_query);
$mc3b_num = mysql_num_rows($mc3b_result);
if ($mc3b_num!=0) {
$mc3b_summed_value = mysql_result($mc3b_result, 0, "mc3_summed_value"); 
}
else {
$mc3b_summed_value=0;
}

/* ===== Palisade standard  */
$ps_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade standard' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ps_tot_result = mySQL_query($ps_tot_query);
$ps_tot_num = mysql_num_rows($ps_tot_result);

$ps0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade standard' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ps0_result = mySQL_query($ps0_query);
$ps0_num = mysql_num_rows($ps0_result);

$ps1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade standard' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ps1a_result = mySQL_query($ps1a_query);
$ps1a_num = mysql_num_rows($ps1a_result);

$ps1b_query = "SELECT  SUM(value) AS ps1_summed_value FROM $table_name2 WHERE project = 'Palisade standard' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ps1b_result = mySQL_query($ps1b_query);
$ps1b_num = mysql_num_rows($ps1b_result);
if ($ps1b_num!=0) {
$ps1b_summed_value = mysql_result($ps1b_result, 0, "ps1_summed_value"); 
}
else {
$ps1b_summed_value=0;
}

$ps2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade standard' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ps2a_result = mySQL_query($ps2a_query);
$ps2a_num = mysql_num_rows($ps2a_result);

$ps2b_query = "SELECT  SUM(value) AS ps2_summed_value FROM $table_name2 WHERE project = 'Palisade standard' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ps2b_result = mySQL_query($ps2b_query);
$ps2b_num = mysql_num_rows($ps2b_result);
if ($ps2b_num!=0) {
$ps2b_summed_value = mysql_result($ps2b_result, 0, "ps2_summed_value"); 
}
else {
$ps2b_summed_value=0;
}

$ps3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade standard' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ps3a_result = mySQL_query($ps3a_query);
$ps3a_num = mysql_num_rows($ps3a_result);

$ps3b_query = "SELECT  SUM(value) AS ps3_summed_value FROM $table_name2 WHERE project = 'Palisade standard' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ps3b_result = mySQL_query($ps3b_query);
$ps3b_num = mysql_num_rows($ps3b_result);
if ($ps3b_num!=0) {
$ps3b_summed_value = mysql_result($ps3b_result, 0, "ps3_summed_value"); 
}
else {
$ps3b_summed_value=0;
}

/* ===== Palisade fencing  */
$pf_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade fencing' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$pf_tot_result = mySQL_query($pf_tot_query);
$pf_tot_num = mysql_num_rows($pf_tot_result);

$pf0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade fencing' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$pf0_result = mySQL_query($pf0_query);
$pf0_num = mysql_num_rows($pf0_result);

$pf1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade fencing' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$pf1a_result = mySQL_query($pf1a_query);
$pf1a_num = mysql_num_rows($pf1a_result);

$pf1b_query = "SELECT  SUM(value) AS pf1_summed_value FROM $table_name2 WHERE project = 'Palisade fencing' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$pf1b_result = mySQL_query($pf1b_query);
$pf1b_num = mysql_num_rows($pf1b_result);
if ($pf1b_num!=0) {
$pf1b_summed_value = mysql_result($pf1b_result, 0, "pf1_summed_value"); 
}
else {
$pf1b_summed_value=0;
}

$pf2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade fencing' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$pf2a_result = mySQL_query($pf2a_query);
$pf2a_num = mysql_num_rows($pf2a_result);

$pf2b_query = "SELECT  SUM(value) AS pf2_summed_value FROM $table_name2 WHERE project = 'Palisade fencing' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$pf2b_result = mySQL_query($pf2b_query);
$pf2b_num = mysql_num_rows($pf2b_result);
if ($pf2b_num!=0) {
$pf2b_summed_value = mysql_result($pf2b_result, 0, "pf2_summed_value"); 
}
else {
$pf2b_summed_value=0;
}

$pf3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Palisade fencing' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$pf3a_result = mySQL_query($pf3a_query);
$pf3a_num = mysql_num_rows($pf3a_result);

$pf3b_query = "SELECT  SUM(value) AS pf3_summed_value FROM $table_name2 WHERE project = 'Palisade fencing' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$pf3b_result = mySQL_query($pf3b_query);
$pf3b_num = mysql_num_rows($pf3b_result);
if ($pf3b_num!=0) {
$pf3b_summed_value = mysql_result($pf3b_result, 0, "pf3_summed_value"); 
}
else {
$pf3b_summed_value=0;
}

/* ===== Pool fence  */
$po_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Pool fence' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$po_tot_result = mySQL_query($po_tot_query);
$po_tot_num = mysql_num_rows($po_tot_result);

$po0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Pool fence' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$po0_result = mySQL_query($po0_query);
$po0_num = mysql_num_rows($po0_result);

$po1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Pool fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$po1a_result = mySQL_query($po1a_query);
$po1a_num = mysql_num_rows($po1a_result);

$po1b_query = "SELECT  SUM(value) AS po1_summed_value FROM $table_name2 WHERE project = 'Pool fence' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$po1b_result = mySQL_query($po1b_query);
$po1b_num = mysql_num_rows($po1b_result);
if ($po1b_num!=0) {
$po1b_summed_value = mysql_result($po1b_result, 0, "po1_summed_value"); 
}
else {
$po1b_summed_value=0;
}

$po2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Pool fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$po2a_result = mySQL_query($po2a_query);
$po2a_num = mysql_num_rows($po2a_result);

$po2b_query = "SELECT  SUM(value) AS po2_summed_value FROM $table_name2 WHERE project = 'Pool fence' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$po2b_result = mySQL_query($po2b_query);
$po2b_num = mysql_num_rows($po2b_result);
if ($po2b_num!=0) {
$po2b_summed_value = mysql_result($po2b_result, 0, "po2_summed_value"); 
}
else {
$po2b_summed_value=0;
}

$po3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Pool fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$po3a_result = mySQL_query($po3a_query);
$po3a_num = mysql_num_rows($po3a_result);

$po3b_query = "SELECT  SUM(value) AS po3_summed_value FROM $table_name2 WHERE project = 'Pool fence' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$po3b_result = mySQL_query($po3b_query);
$po3b_num = mysql_num_rows($po3b_result);
if ($po3b_num!=0) {
$po3b_summed_value = mysql_result($po3b_result, 0, "po3_summed_value"); 
}
else {
$po3b_summed_value=0;
}

/* ===== Razor wire  */
$rw_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Razor wire' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$rw_tot_result = mySQL_query($rw_tot_query);
$rw_tot_num = mysql_num_rows($rw_tot_result);

$rw0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Razor wire' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$rw0_result = mySQL_query($rw0_query);
$rw0_num = mysql_num_rows($rw0_result);

$rw1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Razor wire' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$rw1a_result = mySQL_query($rw1a_query);
$rw1a_num = mysql_num_rows($rw1a_result);

$rw1b_query = "SELECT  SUM(value) AS rw1_summed_value FROM $table_name2 WHERE project = 'Razor wire' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$rw1b_result = mySQL_query($rw1b_query);
$rw1b_num = mysql_num_rows($rw1b_result);
if ($rw1b_num!=0) {
$rw1b_summed_value = mysql_result($rw1b_result, 0, "rw1_summed_value"); 
}
else {
$rw1b_summed_value=0;
}

$rw2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Razor wire' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$rw2a_result = mySQL_query($rw2a_query);
$rw2a_num = mysql_num_rows($rw2a_result);

$rw2b_query = "SELECT  SUM(value) AS rw2_summed_value FROM $table_name2 WHERE project = 'Razor wire' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$rw2b_result = mySQL_query($rw2b_query);
$rw2b_num = mysql_num_rows($rw2b_result);
if ($rw2b_num!=0) {
$rw2b_summed_value = mysql_result($rw2b_result, 0, "rw2_summed_value"); 
}
else {
$rw2b_summed_value=0;
}

$rw3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Razor wire' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$rw3a_result = mySQL_query($rw3a_query);
$rw3a_num = mysql_num_rows($rw3a_result);

$rw3b_query = "SELECT  SUM(value) AS rw3_summed_value FROM $table_name2 WHERE project = 'Razor wire' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$rw3b_result = mySQL_query($rw3b_query);
$rw3b_num = mysql_num_rows($rw3b_result);
if ($rw3b_num!=0) {
$rw3b_summed_value = mysql_result($rw3b_result, 0, "rw3_summed_value"); 
}
else {
$rw3b_summed_value=0;
}

/* ===== Wall spikes  */
$ws_tot_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Wall spikes' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ws_tot_result = mySQL_query($ws_tot_query);
$ws_tot_num = mysql_num_rows($ws_tot_result);

$ws0_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Wall spikes' AND status='request' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ws0_result = mySQL_query($ws0_query);
$ws0_num = mysql_num_rows($ws0_result);

$ws1a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Wall spikes' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ws1a_result = mySQL_query($ws1a_query);
$ws1a_num = mysql_num_rows($ws1a_result);

$ws1b_query = "SELECT  SUM(value) AS ws1_summed_value FROM $table_name2 WHERE project = 'Wall spikes' AND status='quoted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ws1b_result = mySQL_query($ws1b_query);
$ws1b_num = mysql_num_rows($ws1b_result);
if ($ws1b_num!=0) {
$ws1b_summed_value = mysql_result($ws1b_result, 0, "ws1_summed_value"); 
}
else {
$ws1b_summed_value=0;
}

$ws2a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Wall spikes' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ws2a_result = mySQL_query($ws2a_query);
$ws2a_num = mysql_num_rows($ws2a_result);

$ws2b_query = "SELECT  SUM(value) AS ws2_summed_value FROM $table_name2 WHERE project = 'Wall spikes' AND status='accepted' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ws2b_result = mySQL_query($ws2b_query);
$ws2b_num = mysql_num_rows($ws2b_result);
if ($ws2b_num!=0) {
$ws2b_summed_value = mysql_result($ws2b_result, 0, "ws2_summed_value"); 
}
else {
$ws2b_summed_value=0;
}

$ws3a_query = "SELECT quote_no FROM $table_name2 WHERE project = 'Wall spikes' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' ";
$ws3a_result = mySQL_query($ws3a_query);
$ws3a_num = mysql_num_rows($ws3a_result);

$ws3b_query = "SELECT  SUM(value) AS ws3_summed_value FROM $table_name2 WHERE project = 'Wall spikes' AND status='unsuccessful' AND request_date BETWEEN '".$start."' AND '".$end."' GROUP BY project ";
$ws3b_result = mySQL_query($ws3b_query);
$ws3b_num = mysql_num_rows($ws3b_result);
if ($ws3b_num!=0) {
$ws3b_summed_value = mysql_result($ws3b_result, 0, "ws3_summed_value"); 
}
else {
$ws3b_summed_value=0;
}

$total_total = $cv_tot_num +  $dm_tot_num + $ef_tot_num + $ff_tot_num + $fs_tot_num + $ga_tot_num + $gm_tot_num + $mc_tot_num + $ps_tot_num + $pf_tot_num + $po_tot_num + $rw_tot_num + $ws_tot_num;

$enquiry_total = $cv0_num +  $dm0_num + $ef0_num + $ff0_num + $fs0_num + $ga0_num + $gm0_num + $mc0_num + $ps0_num + $pf0_num + $po0_num + $rw0_num + $ws0_num; 

$quoted_total = $cv1a_num +  $dm1a_num + $ef1a_num + $ff1a_num + $fs1a_num + $ga1a_num + $gm1a_num + $mc1a_num + $ps1a_num + $pf1a_num + $po1a_num + $rw1a_num + $ws1a_num;

$quoted_value = $cv1b_summed_value +  $dm1b_summed_value + $ef1b_summed_value + $ff1b_summed_value + $fs1b_summed_value + $ga1b_summed_value + $gm1b_summed_value + $mc1b_summed_value + $ps1b_summed_value + $pf1b_summed_value + $po1b_summed_value + $rw1b_summed_value + $ws1b_summed_value;

$accepted_total = $cv2a_num +  $dm2a_num + $ef2a_num + $ff2a_num + $fs2a_num + $ga2a_num + $gm2a_num + $mc2a_num + $ps2a_num + $pf2a_num + $po2a_num + $rw2a_num + $ws2a_num;

$accepted_value = $cv2b_summed_value +  $dm2b_summed_value + $ef2b_summed_value + $ff2b_summed_value + $fs2b_summed_value + $ga2b_summed_value + $gm2b_summed_value + $mc2b_summed_value + $ps2b_summed_value + $pf2b_summed_value + $po2b_summed_value + $rw2b_summed_value + $ws2b_summed_value;

$unsuccessful_total = $cv3a_num +  $dm3a_num + $ef3a_num + $ff3a_num + $fs3a_num + $ga3a_num + $gm3a_num + $mc3a_num + $ps3a_num + $pf3a_num + $po3a_num + $rw3a_num + $ws3a_num;

$unsuccessful_value = $cv3b_summed_value +  $dm3b_summed_value + $ef3b_summed_value + $ff3b_summed_value + $fs3b_summed_value + $ga3b_summed_value + $gm3b_summed_value + $mc3b_summed_value + $ps3b_summed_value + $pf3b_summed_value + $po3b_summed_value + $rw3b_summed_value + $ws3b_summed_value;

?>
<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />

<!--jscript-->
<script language="javascript" src="../jscript/calendar.js"></script>
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>
<body>
<?php
include ("../navigation/header.php");
$page_name = "Sales-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/sales_sidebar.php");
?>
<div class="main_frame">
  <div class="page_head_frame">
          <table width="809" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="385"><label class="label_page_head">Sales summary</label></td>
              <td width="253">&nbsp;</td>
              <td width="171" align="right">&nbsp;</td>
            </tr>
          </table>
        </div>
        <br />
        
        <br />
        <br />
        <div class="page_middle_frame">
        <?php
$page='quotations_summary_list.php';
$reference_name='';
$reference='';
include('../include/period_select_block.php');
?>

        
        <div  class="page_inside_frame">
          
            <table width="662" id="table_display">
              <tr>
                <td width="154">Project</td>
                <td width="31" align="center">Total</td>
                <td width="46" align="center">Enquiry</td>
                <td width="55" align="center">Quoted</td>
                <td width="63" align="center">Value</td>
                <td width="59" align="center">Accepted</td>
                <td width="66" align="center">Value</td>
                <td width="86" align="center">Unsuccessful</td>
                <td width="62" align="center">Value</td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Manase 358&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Manase 358  </a></td>
                <td align="center"><?php echo $cv_tot_num ?></td>
                <td align="center"><?php echo $cv0_num ?></td>
                <td align="center"><?php echo $cv1a_num ?></td>
                <td align="right"><?php echo number_format($cv1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $cv2a_num ?></td>
                <td align="right"><?php echo number_format($cv2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $cv3a_num ?></td>
                <td align="right"><?php echo number_format($cv3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Diamond mesh&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Diamond mesh  </a></td>
                <td align="center"><?php echo $dm_tot_num ?></td>
                <td align="center"><?php echo $dm0_num ?></td>
                <td align="center"><?php echo $dm1a_num ?></td>
                <td align="right"><?php echo number_format($dm1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $dm2a_num ?></td>
                <td align="right"><?php echo number_format($dm2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $dm3a_num ?></td>
                <td align="right"><?php echo number_format($dm3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Electric fencing&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Electric fencing  </a></td>
                <td align="center"><?php echo $ef_tot_num ?></td>
                <td align="center"><?php echo $ef0_num ?></td>
                <td align="center"><?php echo $ef1a_num ?></td>
                <td align="right"><?php echo number_format($ef1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ef2a_num ?></td>
                <td align="right"><?php echo number_format($ef2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ef3a_num ?></td>
                <td align="right"><?php echo number_format($ef3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Farm fence&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Farm fence  </a></td>
                <td align="center"><?php echo $ff_tot_num ?></td>
                <td align="center"><?php echo $ff0_num ?></td>
                <td align="center"><?php echo $ff1a_num ?></td>
                <td align="right"><?php echo number_format($ff1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ff2a_num ?></td>
                <td align="right"><?php echo number_format($ff2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ff3a_num ?></td>
                <td align="right"><?php echo number_format($ff3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Free standing electric fence&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Free standing electric fence  </a></td>
                <td align="center"><?php echo $fs_tot_num ?></td>
                <td align="center"><?php echo $fs0_num ?></td>
                <td align="center"><?php echo $fs1a_num ?></td>
                <td align="right"><?php echo number_format($fs1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $fs2a_num ?></td>
                <td align="right"><?php echo number_format($fs2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $fs3a_num ?></td>
                <td align="right"><?php echo number_format($fs3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Gate&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Gate  </a></td>
                <td align="center"><?php echo $ga_tot_num ?></td>
                <td align="center"><?php echo $ga0_num ?></td>
                <td align="center"><?php echo $ga1a_num ?></td>
                <td align="right"><?php echo number_format($ga1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ga2a_num ?></td>
                <td align="right"><?php echo number_format($ga2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ga3a_num ?></td>
                <td align="right"><?php echo number_format($ga3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Gate motor&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Gate motor  </a></td>
                <td align="center"><?php echo $gm_tot_num ?></td>
                <td align="center"><?php echo $gm0_num ?></td>
                <td align="center"><?php echo $gm1a_num ?></td>
                <td align="right"><?php echo number_format($gm1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $gm2a_num ?></td>
                <td align="right"><?php echo number_format($gm2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $gm3a_num ?></td>
                <td align="right"><?php echo number_format($gm3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Miscelaneous&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Miscelaneous  </a></td>
                <td align="center"><?php echo $mc_tot_num ?></td>
                <td align="center"><?php echo $mc0_num ?></td>
                <td align="center"><?php echo $mc1a_num ?></td>
                <td align="right"><?php echo number_format($mc1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $mc2a_num ?></td>
                <td align="right"><?php echo number_format($mc2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $mc3a_num ?></td>
                <td align="right"><?php echo number_format($mc3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Palisade standard&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Palisade standard  </a></td>
                <td align="center"><?php echo $ps_tot_num ?></td>
                <td align="center"><?php echo $ps0_num ?></td>
                <td align="center"><?php echo $ps1a_num ?></td>
                <td align="right"><?php echo number_format($ps1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ps2a_num ?></td>
                <td align="right"><?php echo number_format($ps2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ps3a_num ?></td>
                <td align="right"><?php echo number_format($ps3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Palisade fencing&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Palisade fencing  </a></td>
                <td align="center"><?php echo $pf_tot_num ?></td>
                <td align="center"><?php echo $pf0_num ?></td>
                <td align="center"><?php echo $pf1a_num ?></td>
                <td align="right"><?php echo number_format($pf1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $pf2a_num ?></td>
                <td align="right"><?php echo number_format($pf2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $pf3a_num ?></td>
                <td align="right"><?php echo number_format($pf3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Pool fence&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Pool fence  </a></td>
                <td align="center"><?php echo $po_tot_num ?></td>
                <td align="center"><?php echo $po0_num ?></td>
                <td align="center"><?php echo $po1a_num ?></td>
                <td align="right"><?php echo number_format($po1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $po2a_num ?></td>
                <td align="right"><?php echo number_format($po2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $po3a_num ?></td>
                <td align="right"><?php echo number_format($po3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Razor wire&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Razor wire  </a></td>
                <td align="center"><?php echo $rw_tot_num ?></td>
                <td align="center"><?php echo $rw0_num ?></td>
                <td align="center"><?php echo $rw1a_num ?></td>
                <td align="right"><?php echo number_format($rw1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $rw2a_num ?></td>
                <td align="right"><?php echo number_format($rw2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $rw3a_num ?></td>
                <td align="right"><?php echo number_format($rw3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td><a href="quotations_project_list.php?project=Wall spikes&date=1&date1=<?php echo $start ?>&date2=<?php echo $end ?> " onMouseover="ddrivetip('Click for details', 150)"; onMouseout="hideddrivetip()"> Wall spikes  </a></td>
                <td align="center"><?php echo $ws_tot_num ?></td>
                <td align="center"><?php echo $ws0_num ?></td>
                <td align="center"><?php echo $ws1a_num ?></td>
                <td align="right"><?php echo number_format($ws1b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ws2a_num ?></td>
                <td align="right"><?php echo number_format($ws2b_summed_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $ws3a_num ?></td>
                <td align="right"><?php echo number_format($ws3b_summed_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td align="right">Totals:</td>
                <td align="center"><?php echo $total_total ?>&nbsp;</td>
                <td align="center"><?php echo $enquiry_total ?></td>
                <td align="center"><?php echo $quoted_total ?></td>
                <td align="right"><?php echo number_format($quoted_value, 2, '.', ',') ?>&nbsp;</td>
                <td align="center"><?php echo $accepted_total ?></td>
                <td align="right"><?php echo number_format($accepted_value, 2, '.', ',') ?></td>
                <td align="center"><?php echo $unsuccessful_total ?></td>
                <td align="right"><?php echo number_format($unsuccessful_value, 2, '.', ',') ?></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
            
          
</div>
</div>  
</div>
<?php include ('../navigation/side_bar.php'); ?>
</body>
<?php } else {
$_SESSION['denied_return'] = "sales/sales_main.php";	
include ("../navigation/sales_sidebar.php");?>
<body onload="accessdenied(); return false">
</body>
<?php }
?>
</html>