Jump to content

HEEELP! I can't find what's wrong!


Craptacular

Recommended Posts

I have a shipping quote form that is adding information to a database just fine. Then on the back end I have a reply system for the employees to give the shipping quote. This is where I am having issues. The first part works and shows the replier the users contact info and requested product and quantity wanted, but the second part for the quoting doesn't show any of the form for quoting and says that the user didn't select a model or quantity. (Image included) I can't seem to figure out why. And the weird part is that all the other ones work for the other products, just fine... Any ideas. Oh andthe information from the user does show up in the database. 

 

The issue is with the t8e. Any help would be appreciated. Thanks!

 

This is what the outcome for the T8-E is in the quoting system:

post-129836-0-59107500-1370368178_thumb.png

 

This is what it's supposed to look like:

post-129836-0-16106600-1370369004_thumb.png

require('config.php');
       // from the form newest version
       $id = trim(strip_tags($_POST['reply-id']));
       $status = trim(strip_tags($_POST['status']));   
       
       //SERIES T8
       $t8_quote_terminal = trim(strip_tags($_POST['t8-quote-terminal']));
       $t8_quote_business = trim(strip_tags($_POST['t8-quote-business']));
       $t8_quote_business1 = trim(strip_tags($_POST['t8-quote-business1']));
       $t8_quote_residence = trim(strip_tags($_POST['t8-quote-residence']));

       $t8e_quote_terminal = trim(strip_tags($_POST['t8e-quote-terminal']));//This is the product having issues
       $t8e_quote_business = trim(strip_tags($_POST['t8e-quote-business']));
       $t8e_quote_business1 = trim(strip_tags($_POST['t8e-quote-business1']));
       $t8e_quote_residence = trim(strip_tags($_POST['t8e-quote-residence']));
       
       //SERIES T14
       $t14_quote_terminal = trim(strip_tags($_POST['t14-quote-terminal']));
       $t14_quote_business = trim(strip_tags($_POST['t14-quote-business']));
       $t14_quote_business1 = trim(strip_tags($_POST['t14-quote-business1']));
       $t14_quote_residence = trim(strip_tags($_POST['t14-quote-residence']));
      

       $ups = $_POST['ups'];       
       $conway = $_POST['conway'];
       $yrc = $_POST['yrc'];
       $reddaway = $_POST['reddaway'];
       
       $terminal_name = trim(strip_tags($_POST['terminal_name']));
       $terminal_location = trim(strip_tags($_POST['terminal_location']));
       $estimated_time = trim(strip_tags($_POST['estimated_time']));
       $replier = trim(strip_tags($_POST['replier']));
       $reply_comments = trim(strip_tags($_POST['reply_comments']));
//Functions

function printInvoice($shipping_method, $model, $model_price, $qty, $shipping_amount, $total) {

$shipping_amount = str_replace("$", "", $shipping_amount);
settype($shipping_amount, "float");
	if (empty($shipping_amount)) {
		return false;
	}
	
	if ($shipping_amount === 0.01) {
		$shipping_amount = 0;
	}
	
settype($qty, "integer");
	
$total = $shipping_amount+($model_price*$qty);
settype($total, "float");

return "<tr><td>".$model."</td><td>".$shipping_method."</td><td>$".$model_price."</td><td>".$qty."</td><td>$".$shipping_amount."</td><td>$".$total."</td></tr>";
}

$invoice_header = "<table cellpadding=\"8\" class=\"invoice\"><tr><th><b>Model</b></th><th><b>Delivery Method</b></th><th><b>Price</b></th><th><b>Qty</b></th><th><b>Shipping</b></th><th><b>Total</b></th></tr>";   
       
       date_default_timezone_set('America/Los_Angeles');
       $the_date = date("g:ia, F j, Y");
       $reply_date = date("F j, Y");
       
// Connect to Database to store information
       
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

if (mysqli_connect_errno()) {
	printf("Connect Failed: %s\n", mysqli_connect_error());
	} else {
	
		$query = "SELECT * FROM tracker WHERE ID = $id";
	$fullres = mysqli_query($mysqli, $query);
	$newArray = mysqli_fetch_array($fullres, MYSQL_ASSOC);

			$name = $newArray['Name'];
			$email = $newArray['Email'];
			$address = $newArray['Address'];
			$city = $newArray['City'];
			$state = $newArray['State'];
			$zip = $newArray['Zip'];
			$telephone = $newArray['Telephone'];
			$source = $newArray['Source'];
						
			//SERIES T8
			$t8 = $newArray['t8'];
			$qt8 = $newArray['QT8'];
            $t8e = $newArray['t8e'];
			$qt8e = $newArray['QT8e'];
						
			//SERIES T14
			$t14 = $newArray['t14'];
			$qt14 = $newArray['QT14'];

			
			$local = $newArray['LocalPickup'];
			$terminal = $newArray['Terminal'];
			$business1 = $newArray['Business1'];
			$business2 = $newArray['Business2'];
			$curbside = $newArray['Curbside'];
			$comments = $newArray['Comments'];		
			$reply = $newArray['Reply'];
			$date = $newArray['Date'];


		
	mysqli_close($mysqli);
}


$model = "";
$model_quote = "";

//Begin Quote form						
//SERIES T8
	
if (!empty($t8e)) 
	{$model = "Shipping quote for $qt8e of Model T8-E.<br />";
	$model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);
	$model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);
	$model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);
	$model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);
	$model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);
	$model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";
	}
if (!empty($t8)) 
	{$model = "Shipping quote for $qt8 of Model T8.<br />";//This part works, the rest for this part of the script for the t8e does not work
	$model_quote = printInvoice("Residential - Curbside/Garage", "T8", 399, $qt8, $t8_quote_residence, $total);
	$model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8", 399, $qt8, $t8_quote_business1, $total);
	$model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8", 399, $qt8, $t8_quote_business, $total);
	$model_quote = $model_quote . printInvoice("Truck Terminal*", "T8", 399, $qt8, $t8_quote_terminal, $total);
	$model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8", 399, $qt8, 0.01, $total);
	$model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";
	}
	
	
//SERIES T14
							if (!empty($t14)) 
								{$model = $model . "Shipping quote for $qt14 of Model T14.<br />";
								$model_quote = $model_quote . printInvoice("Residential - Curbside/Garage", "T14", 479, $qt14, $t14_quote_residence, $total);
								$model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T14", 479, $qt14, $t14_quote_business1, $total);
								$model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T14", 479, $qt14, $t14_quote_business, $total);
								$model_quote = $model_quote . printInvoice("Truck Terminal*", "T14", 479, $qt14, $t14_quote_terminal, $total);
								$model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T14", 479, $qt14, 0.01, $total);
								$model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";
}
if ($model == "")
	{$model = "$name did not specify a model or quantity.<br />";}
	$model_quote = $model_quote . "</table>";
	
$shipping = "";

if (!empty($local))
	{$shipping = "<br />Local Pickup";}
if (!empty($terminal))
	{$shipping = $shipping . "<br />Terminal Pickup";}
if (!empty($business1))
	{$shipping = $shipping . "<br />Business Delivery (Lift Gate Not Required)";}
if (!empty($business2))
	{$shipping = $shipping . "<br />Business Delivery (Lift Gate Required)";}
if (!empty($curbside))
	{$shipping = $shipping . "<br />Residential Delivery (Curbside)";}
if (!empty($house))
	{$shipping = $shipping . "<br />In-House Delivery";}
if ($shipping == "")
	{$shipping = "<br />No Shipping Method Selected.";}
	
if ($terminal_name !== "" && $terminal_location !== "") {
	$terminal_info = "<p>*The quoted terminal price is for the $terminal_name terminal in $terminal_location.</p>";
} else {
	$terminal_info = "";
}
Edited by Craptacular
Link to comment
Share on other sites

awful lot of code for a "stranger" to your appl to wade thru.

 

Have you tried adding some debugging echo statements intermittently to see what's happening at various points with the data that you are having problems with?

Link to comment
Share on other sites

I have a suggestion for you for starters. These variable names

//SERIES T8

$t8 = $newArray['t8'];

$qt8 = $newArray['QT8'];

$t8e = $newArray['t8e'];

$qt8e = $newArray['QT8e'];

seem way too similar and could easily lead to hard-to-find bugs.

 

I found your formatting a bit unnerving so I re-indented it.

require('config.php');

// from the form newest version

$id = trim(strip_tags($_POST['reply-id']));

$status = trim(strip_tags($_POST['status']));   



//SERIES T8

$t8_quote_terminal = trim(strip_tags($_POST['t8-quote-terminal']));

$t8_quote_business = trim(strip_tags($_POST['t8-quote-business']));

$t8_quote_business1 = trim(strip_tags($_POST['t8-quote-business1']));

$t8_quote_residence = trim(strip_tags($_POST['t8-quote-residence']));



$t8e_quote_terminal = trim(strip_tags($_POST['t8e-quote-terminal']));//This is the product having issues

$t8e_quote_business = trim(strip_tags($_POST['t8e-quote-business']));

$t8e_quote_business1 = trim(strip_tags($_POST['t8e-quote-business1']));

$t8e_quote_residence = trim(strip_tags($_POST['t8e-quote-residence']));



//SERIES T14

$t14_quote_terminal = trim(strip_tags($_POST['t14-quote-terminal']));

$t14_quote_business = trim(strip_tags($_POST['t14-quote-business']));

$t14_quote_business1 = trim(strip_tags($_POST['t14-quote-business1']));

$t14_quote_residence = trim(strip_tags($_POST['t14-quote-residence']));





$ups = $_POST['ups'];       

$conway = $_POST['conway'];

$yrc = $_POST['yrc'];

$reddaway = $_POST['reddaway'];



$terminal_name = trim(strip_tags($_POST['terminal_name']));

$terminal_location = trim(strip_tags($_POST['terminal_location']));

$estimated_time = trim(strip_tags($_POST['estimated_time']));

$replier = trim(strip_tags($_POST['replier']));

$reply_comments = trim(strip_tags($_POST['reply_comments']));

//Functions



function printInvoice($shipping_method, $model, $model_price, $qty, $shipping_amount, $total) {



    $shipping_amount = str_replace("$", "", $shipping_amount);

        settype($shipping_amount, "float");

    if (empty($shipping_amount)) {

        return false;

    }



    if ($shipping_amount === 0.01) {

        $shipping_amount = 0;

    }



    settype($qty, "integer");



    $total = $shipping_amount+($model_price*$qty);

    settype($total, "float");



    return "<tr><td>".$model."</td><td>".$shipping_method."</td><td>$".$model_price."</td><td>".$qty."</td><td>$".$shipping_amount."</td><td>$".$total."</td></tr>";

}



$invoice_header = "<table cellpadding=\"8\" class=\"invoice\"><tr><th><b>Model</b></th><th><b>Delivery Method</b></th><th><b>Price</b></th><th><b>Qty</b></th><th><b>Shipping</b></th><th><b>Total</b></th></tr>";   



date_default_timezone_set('America/Los_Angeles');

$the_date = date("g:ia, F j, Y");

$reply_date = date("F j, Y");



// Connect to Database to store information



$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);



if (mysqli_connect_errno()) {

    printf("Connect Failed: %s\n", mysqli_connect_error());

} else {



    $query = "SELECT * FROM tracker WHERE ID = $id";

    $fullres = mysqli_query($mysqli, $query);

    $newArray = mysqli_fetch_array($fullres, MYSQL_ASSOC);



    $name = $newArray['Name'];

    $email = $newArray['Email'];

    $address = $newArray['Address'];

    $city = $newArray['City'];

    $state = $newArray['State'];

    $zip = $newArray['Zip'];

    $telephone = $newArray['Telephone'];

    $source = $newArray['Source'];



    //SERIES T8

    $t8 = $newArray['t8'];

    $qt8 = $newArray['QT8'];

    $t8e = $newArray['t8e'];

    $qt8e = $newArray['QT8e'];



    //SERIES T14

    $t14 = $newArray['t14'];

    $qt14 = $newArray['QT14'];





    $local = $newArray['LocalPickup'];

    $terminal = $newArray['Terminal'];

    $business1 = $newArray['Business1'];

    $business2 = $newArray['Business2'];

    $curbside = $newArray['Curbside'];    

    $comments = $newArray['Comments'];        

    $reply = $newArray['Reply'];

    $date = $newArray['Date'];







    mysqli_close($mysqli);

}





$model = "";

$model_quote = "";



//Begin Quote form                        

//SERIES T8



if (!empty($t8e)) {

    $model = "Shipping quote for $qt8e of Model T8-E.<br />";

    $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}



if (!empty($t8)) {

    $model = "Shipping quote for $qt8 of Model T8.<br />";//This part works, the rest for this part of the script for the t8e does not work

    $model_quote = printInvoice("Residential - Curbside/Garage", "T8", 399, $qt8, $t8_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8", 399, $qt8, $t8_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8", 399, $qt8, $t8_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8", 399, $qt8, $t8_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8", 399, $qt8, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}





//SERIES T14

if (!empty($t14)) {

    $model = $model . "Shipping quote for $qt14 of Model T14.<br />";

    $model_quote = $model_quote . printInvoice("Residential - Curbside/Garage", "T14", 479, $qt14, $t14_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T14", 479, $qt14, $t14_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T14", 479, $qt14, $t14_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T14", 479, $qt14, $t14_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T14", 479, $qt14, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}



if ($model == "") {

    $model = "$name did not specify a model or quantity.<br />";

}

$model_quote = $model_quote . "</table>";



$shipping = "";



if (!empty($local)) {

    $shipping = "<br />Local Pickup";

}

if (!empty($terminal)) {

    $shipping = $shipping . "<br />Terminal Pickup";

}

if (!empty($business1)) {

    $shipping = $shipping . "<br />Business Delivery (Lift Gate Not Required)";

}

if (!empty($business2)) {

    $shipping = $shipping . "<br />Business Delivery (Lift Gate Required)";

}

if (!empty($curbside)) {

    $shipping = $shipping . "<br />Residential Delivery (Curbside)";

}

if (!empty($house)) {

    $shipping = $shipping . "<br />In-House Delivery";

}

if ($shipping == "") {

    $shipping = "<br />No Shipping Method Selected.";

}



if ($terminal_name !== "" && $terminal_location !== "") {

    $terminal_info = "<p>*The quoted terminal price is for the $terminal_name terminal in $terminal_location.</p>";

} else {

    $terminal_info = "";

}



but the second part for the quoting doesn't show any of the form for quoting and says that the user didn't select a model or quantity. (Image included) I can't seem to figure out why

 

 

Well the obvious answer to that would be that the code in this block

if (!empty($t8e)) {



    $model = "Shipping quote for $qt8e of Model T8-E.<br />";



    $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);



    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);



    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);



    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);



    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);



    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";



}

is not executing, meaning that $t8e is in fact empty. So you need to determine if for this record the t8e field is empty in the database.

Link to comment
Share on other sites

I have a suggestion for you for starters. These variable names

//SERIES T8

$t8 = $newArray['t8'];

$qt8 = $newArray['QT8'];

$t8e = $newArray['t8e'];

$qt8e = $newArray['QT8e'];

seem way too similar and could easily lead to hard-to-find bugs.

 

I found your formatting a bit unnerving so I re-indented it.

require('config.php');

// from the form newest version

$id = trim(strip_tags($_POST['reply-id']));

$status = trim(strip_tags($_POST['status']));   



//SERIES T8

$t8_quote_terminal = trim(strip_tags($_POST['t8-quote-terminal']));

$t8_quote_business = trim(strip_tags($_POST['t8-quote-business']));

$t8_quote_business1 = trim(strip_tags($_POST['t8-quote-business1']));

$t8_quote_residence = trim(strip_tags($_POST['t8-quote-residence']));



$t8e_quote_terminal = trim(strip_tags($_POST['t8e-quote-terminal']));//This is the product having issues

$t8e_quote_business = trim(strip_tags($_POST['t8e-quote-business']));

$t8e_quote_business1 = trim(strip_tags($_POST['t8e-quote-business1']));

$t8e_quote_residence = trim(strip_tags($_POST['t8e-quote-residence']));



//SERIES T14

$t14_quote_terminal = trim(strip_tags($_POST['t14-quote-terminal']));

$t14_quote_business = trim(strip_tags($_POST['t14-quote-business']));

$t14_quote_business1 = trim(strip_tags($_POST['t14-quote-business1']));

$t14_quote_residence = trim(strip_tags($_POST['t14-quote-residence']));





$ups = $_POST['ups'];       

$conway = $_POST['conway'];

$yrc = $_POST['yrc'];

$reddaway = $_POST['reddaway'];



$terminal_name = trim(strip_tags($_POST['terminal_name']));

$terminal_location = trim(strip_tags($_POST['terminal_location']));

$estimated_time = trim(strip_tags($_POST['estimated_time']));

$replier = trim(strip_tags($_POST['replier']));

$reply_comments = trim(strip_tags($_POST['reply_comments']));

//Functions



function printInvoice($shipping_method, $model, $model_price, $qty, $shipping_amount, $total) {



    $shipping_amount = str_replace("$", "", $shipping_amount);

        settype($shipping_amount, "float");

    if (empty($shipping_amount)) {

        return false;

    }



    if ($shipping_amount === 0.01) {

        $shipping_amount = 0;

    }



    settype($qty, "integer");



    $total = $shipping_amount+($model_price*$qty);

    settype($total, "float");



    return "<tr><td>".$model."</td><td>".$shipping_method."</td><td>$".$model_price."</td><td>".$qty."</td><td>$".$shipping_amount."</td><td>$".$total."</td></tr>";

}



$invoice_header = "<table cellpadding=\"8\" class=\"invoice\"><tr><th><b>Model</b></th><th><b>Delivery Method</b></th><th><b>Price</b></th><th><b>Qty</b></th><th><b>Shipping</b></th><th><b>Total</b></th></tr>";   



date_default_timezone_set('America/Los_Angeles');

$the_date = date("g:ia, F j, Y");

$reply_date = date("F j, Y");



// Connect to Database to store information



$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);



if (mysqli_connect_errno()) {

    printf("Connect Failed: %s\n", mysqli_connect_error());

} else {



    $query = "SELECT * FROM tracker WHERE ID = $id";

    $fullres = mysqli_query($mysqli, $query);

    $newArray = mysqli_fetch_array($fullres, MYSQL_ASSOC);



    $name = $newArray['Name'];

    $email = $newArray['Email'];

    $address = $newArray['Address'];

    $city = $newArray['City'];

    $state = $newArray['State'];

    $zip = $newArray['Zip'];

    $telephone = $newArray['Telephone'];

    $source = $newArray['Source'];



    //SERIES T8

    $t8 = $newArray['t8'];

    $qt8 = $newArray['QT8'];

    $t8e = $newArray['t8e'];

    $qt8e = $newArray['QT8e'];



    //SERIES T14

    $t14 = $newArray['t14'];

    $qt14 = $newArray['QT14'];





    $local = $newArray['LocalPickup'];

    $terminal = $newArray['Terminal'];

    $business1 = $newArray['Business1'];

    $business2 = $newArray['Business2'];

    $curbside = $newArray['Curbside'];    

    $comments = $newArray['Comments'];        

    $reply = $newArray['Reply'];

    $date = $newArray['Date'];







    mysqli_close($mysqli);

}





$model = "";

$model_quote = "";



//Begin Quote form                        

//SERIES T8



if (!empty($t8e)) {

    $model = "Shipping quote for $qt8e of Model T8-E.<br />";

    $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}



if (!empty($t8)) {

    $model = "Shipping quote for $qt8 of Model T8.<br />";//This part works, the rest for this part of the script for the t8e does not work

    $model_quote = printInvoice("Residential - Curbside/Garage", "T8", 399, $qt8, $t8_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8", 399, $qt8, $t8_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8", 399, $qt8, $t8_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8", 399, $qt8, $t8_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8", 399, $qt8, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}





//SERIES T14

if (!empty($t14)) {

    $model = $model . "Shipping quote for $qt14 of Model T14.<br />";

    $model_quote = $model_quote . printInvoice("Residential - Curbside/Garage", "T14", 479, $qt14, $t14_quote_residence, $total);

    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T14", 479, $qt14, $t14_quote_business1, $total);

    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T14", 479, $qt14, $t14_quote_business, $total);

    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T14", 479, $qt14, $t14_quote_terminal, $total);

    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T14", 479, $qt14, 0.01, $total);

    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";

}



if ($model == "") {

    $model = "$name did not specify a model or quantity.<br />";

}

$model_quote = $model_quote . "</table>";



$shipping = "";



if (!empty($local)) {

    $shipping = "<br />Local Pickup";

}

if (!empty($terminal)) {

    $shipping = $shipping . "<br />Terminal Pickup";

}

if (!empty($business1)) {

    $shipping = $shipping . "<br />Business Delivery (Lift Gate Not Required)";

}

if (!empty($business2)) {

    $shipping = $shipping . "<br />Business Delivery (Lift Gate Required)";

}

if (!empty($curbside)) {

    $shipping = $shipping . "<br />Residential Delivery (Curbside)";

}

if (!empty($house)) {

    $shipping = $shipping . "<br />In-House Delivery";

}

if ($shipping == "") {

    $shipping = "<br />No Shipping Method Selected.";

}



if ($terminal_name !== "" && $terminal_location !== "") {

    $terminal_info = "<p>*The quoted terminal price is for the $terminal_name terminal in $terminal_location.</p>";

} else {

    $terminal_info = "";

}



Well the obvious answer to that would be that the code in this block

if (!empty($t8e)) {



    $model = "Shipping quote for $qt8e of Model T8-E.<br />";



    $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);



    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);



    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);



    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);



    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);



    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>";



}

is not executing, meaning that $t8e is in fact empty. So you need to determine if for this record the t8e field is empty in the database.

Thanks for the response. Yes all of the information is populating in the database. The weird thing is is that the first part: 

$model = "Shipping quote for $qt8e of Model T8-E.<br />";

is bringing all of the quantity and model and displaying it (left side of the page in the first image). 

 

But the second part of that part of the script:

    $model_quote = printInvoice("Residential - Curbside/Garage", "T8-E", 399, $qt8e, $t8e_quote_residence, $total);



    $model_quote = $model_quote . printInvoice("Business - Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business1, $total);



    $model_quote = $model_quote . printInvoice("Business - No Lift Gate Required", "T8-E", 399, $qt8e, $t8e_quote_business, $total);



    $model_quote = $model_quote . printInvoice("Truck Terminal*", "T8-E", 399, $qt8e, $t8e_quote_terminal, $total);



    $model_quote = $model_quote . printInvoice("Warehouse Pickup - Vancouver, WA", "T8-E", 399, $qt8e, 0.01, $total);



    $model_quote = $model_quote . "<tr><td> </td><td> </td><td> </td><td> </td><td> </td></tr>"; 

isn't displaying the same data. That's what I don't get.  :confused:

Thanks for the help, though!

(right side in the first image)

Link to comment
Share on other sites

awful lot of code for a "stranger" to your appl to wade thru.

 

Have you tried adding some debugging echo statements intermittently to see what's happening at various points with the data that you are having problems with?

I know it's a lot, but I wanted to make sure everyone had the required information to maybe see what I'm doing. Thanks for the response! The problem with debugging is that it just says it's empty but the data is in the database. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.