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

date_default_timezone_set('Africa/Gaborone');
$entryDate = date("Y-m-d H:i:s"); 

$today = date("Y-m-d");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'Exchange rate' ";
$preset_result = mySQL_query($preset_query);
$exchange_rate_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'VAT' ";
$preset_result = mySQL_query($preset_query);
$vat_rate_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'Pallets' ";
$preset_result = mySQL_query($preset_query);
$pallets_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m1 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m1_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m1 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m1_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m2 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m2_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m2 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m2_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss no' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_no_saved = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m2 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m2_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m2 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m2_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m1' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m1_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m3' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m3_saved = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote inspection' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_inspection_saved = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m1 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m1_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m1 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m1_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m2 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m2_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m2 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m2_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss no' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_no_saved = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m2 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m2_low_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m2 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m2_high_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m1' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m1_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m3' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m3_saved = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote inspection' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_inspection_saved = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$follow_up_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'follow_up' ";
$follow_up_result = mySQL_query($follow_up_query);
$follow_up_saved = mysql_result($preset_result, 0, "preset_value");

$exchange_rate = $_GET['exchange_text'];
$vat_rate = $_GET['vat_text'];
$pallets = $_GET['pallets_text'];
$gab_install_quote_truss_m1_low = $_GET['gab_install_quote_text_2'];
$gab_install_quote_truss_m1_high = $_GET['gab_install_quote_text_2d'];
$gab_install_quote_truss_m2_low = $_GET['gab_install_quote_text_1'];
$gab_install_quote_truss_m2_high = $_GET['gab_install_quote_text_1d'];
$gab_install_quote_truss_no = $_GET['gab_install_quote_text_3'];
$gab_install_quote_tiles_m2_low = $_GET['gab_install_quote_text_4'];
$gab_install_quote_tiles_m2_high = $_GET['gab_install_quote_text_4d'];
$gab_install_quote_tiles_m1 = $_GET['gab_install_quote_text_5'];
$gab_install_quote_tiles_m3 = $_GET['gab_install_quote_text_6'];
$gab_install_quote_inspection = $_GET['gab_install_quote_text_7'];

$ftw_install_quote_truss_m1_low = $_GET['ftw_install_quote_text_2'];
$ftw_install_quote_truss_m1_high = $_GET['ftw_install_quote_text_2d'];
$ftw_install_quote_truss_m2_low = $_GET['ftw_install_quote_text_1'];
$ftw_install_quote_truss_m2_high = $_GET['ftw_install_quote_text_1d'];
$ftw_install_quote_truss_no = $_GET['ftw_install_quote_text_3'];
$ftw_install_quote_tiles_m2_low = $_GET['ftw_install_quote_text_4'];
$ftw_install_quote_tiles_m2_high = $_GET['ftw_install_quote_text_4d'];
$ftw_install_quote_tiles_m1 = $_GET['ftw_install_quote_text_5'];
$ftw_install_quote_tiles_m3 = $_GET['ftw_install_quote_text_6'];
$ftw_install_quote_inspection = $_GET['ftw_install_quote_text_7'];

$follow_up = $_GET['follow_up_text'];

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$exchange_rate."' WHERE preset_name = 'Exchange rate' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$vat_rate."' WHERE preset_name = 'VAT' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$pallets."' WHERE preset_name = 'Pallets' ";
execsql($edit_query);


$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_truss_m1_low."' WHERE preset_name = 'gab install quote truss m1 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_truss_m1_high."' WHERE preset_name = 'gab install quote truss m1 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_truss_m2_low."' WHERE preset_name = 'gab install quote truss m2 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_truss_m2_high."' WHERE preset_name = 'gab install quote truss m2 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_truss_no."' WHERE preset_name = 'gab install quote truss no' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_tiles_m2_low."' WHERE preset_name = 'gab install quote tiles m2 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_tiles_m2_high."' WHERE preset_name = 'gab install quote tiles m2 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_tiles_m1."' WHERE preset_name = 'gab install quote tiles m1' ";
execsql($edit_query);


$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_tiles_m3."' WHERE preset_name = 'gab install quote tiles m3' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$gab_install_quote_inspection."' WHERE preset_name = 'gab install quote inspection' ";
execsql($edit_query);


$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_truss_m1_low."' WHERE preset_name = 'ftw install quote truss m1 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_truss_m1_high."' WHERE preset_name = 'ftw install quote truss m1 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_truss_m2_low."' WHERE preset_name = 'ftw install quote truss m2 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_truss_m2_high."' WHERE preset_name = 'ftw install quote truss m2 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_truss_no."' WHERE preset_name = 'ftw install quote truss no' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_tiles_m2_low."' WHERE preset_name = 'ftw install quote tiles m2 low' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_tiles_m2_high."' WHERE preset_name = 'ftw install quote tiles m2 high' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_tiles_m1."' WHERE preset_name = 'ftw install quote tiles m1' ";
execsql($edit_query);


$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_tiles_m3."' WHERE preset_name = 'ftw install quote tiles m3' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$ftw_install_quote_inspection."' WHERE preset_name = 'ftw install quote inspection' ";
execsql($edit_query);

$table_name = $_SESSION['db_prefix']."_presets";
$edit_query = "UPDATE $table_name SET preset_value = '".$follow_up."' WHERE preset_name = 'follow_up' ";
execsql($edit_query);



$table_name = $_SESSION['db_prefix']."_tracking_admin";

if ($exchange_rate_saved!=$exchange_rate) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$exchange_rate_saved."','".$exchange_rate."','', 'Exchange rate' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($vat_rate_saved!=$vat_rate) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$vat_rate_saved."','".$vat_rate."','', 'VAT rate' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($pallets_saved!=$pallets) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$pallets_saved."','".$pallets."','', 'Pallet price' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_truss_m1_low_saved!=$gab_install_quote_truss_m1_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_truss_m1_low_saved."','".$gab_install_quote_truss_m1_low."','', 'Truss install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_truss_m1_high_saved!=$gab_install_quote_truss_m1_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_truss_m1_high_saved."','".$gab_install_quote_truss_m1_high."','', 'Truss install charge double (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_truss_m2_low_saved!=$gab_install_quote_truss_m2_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_truss_m2_low_saved."','".$gab_install_quote_truss_m2_low."','', 'Fascia install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_truss_m2_high_saved!=$gab_install_quote_truss_m2_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_truss_m2_high_saved."','".$gab_install_quote_truss_m2_high."','', 'Fascia install charge double (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_truss_no_saved!=$gab_install_quote_truss_no) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_truss_no_saved."','".$gab_install_quote_truss_no."','', 'Truss hanger install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}


if ($gab_install_quote_tiles_m2_low_saved!=$gab_install_quote_tiles_m2_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_tiles_m2_low_saved."','".$gab_install_quote_tiles_m2_low."','', 'Tiles install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_tiles_m2_high_saved!=$gab_install_quote_tiles_m2_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_tiles_m2_high_saved."','".$gab_install_quote_tiles_m2_high."','', 'Tiles install charge double (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_tiles_m1_saved!=$gab_install_quote_tiles_m1) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_tiles_m1_saved."','".$gab_install_quote_tiles_m1."','', 'Accessories install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_tiles_m3_saved!=$gab_install_quote_tiles_m3) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_tiles_m3_saved."','".$gab_install_quote_tiles_m3."','', 'Valley gutters install charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($gab_install_quote_inspection_saved!=$gab_install_quote_inspection) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$gab_install_quote_inspection_saved."','".$gab_install_quote_inspection."','', 'Inspection charge single (Gab)' )";
$trackingResult = mySQL_query($trackingQuery);
}


if ($ftw_install_quote_truss_m1_low_saved!=$ftw_install_quote_truss_m1_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_truss_m1_low_saved."','".$ftw_install_quote_truss_m1_low."','', 'Truss install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_truss_m1_high_saved!=$ftw_install_quote_truss_m1_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_truss_m1_high_saved."','".$ftw_install_quote_truss_m1_high."','', 'Truss install charge double (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_truss_m2_low_saved!=$ftw_install_quote_truss_m2_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_truss_m2_low_saved."','".$ftw_install_quote_truss_m2_low."','', 'Fascia install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_truss_m2_high_saved!=$ftw_install_quote_truss_m2_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_truss_m2_high_saved."','".$ftw_install_quote_truss_m2_high."','', 'Fascia install charge double (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_truss_no_saved!=$ftw_install_quote_truss_no) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_truss_no_saved."','".$ftw_install_quote_truss_no."','', 'Truss hanger install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}


if ($ftw_install_quote_tiles_m2_low_saved!=$ftw_install_quote_tiles_m2_low) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_tiles_m2_low_saved."','".$ftw_install_quote_tiles_m2_low."','', 'Tiles install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_tiles_m2_high_saved!=$ftw_install_quote_tiles_m2_high) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_tiles_m2_high_saved."','".$ftw_install_quote_tiles_m2_high."','', 'Tiles install charge double (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_tiles_m1_saved!=$ftw_install_quote_tiles_m1) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_tiles_m1_saved."','".$ftw_install_quote_tiles_m1."','', 'Accessories install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_tiles_m3_saved!=$ftw_install_quote_tiles_m3) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_tiles_m3_saved."','".$ftw_install_quote_tiles_m3."','', 'Valley gutters install charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($ftw_install_quote_inspection_saved!=$ftw_install_quote_inspection) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$ftw_install_quote_inspection_saved."','".$ftw_install_quote_inspection."','', 'Inspection charge single (Ftw)' )";
$trackingResult = mySQL_query($trackingQuery);
}

if ($follow_up_saved!=$follow_up) {
	    $trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entryDate."' ,'".$_SESSION['username']."', '120', '".$follow_up_saved."','".$follow_up."','', 'Follow up period' )";
$trackingResult = mySQL_query($trackingQuery);
}

	if (isset($_GET['save_close_button']) )
	   { ?>
       <script>
	 		 window.location="user_list.php";
		</script>
        <?php		 
	   }
	   
	   if (isset($_GET['save_button']) )
	   {  ?>
       <script>
	          window.location="presets.php";
	   </script>
        <?php		 
	   }
	   ?>

