...

View Full Version : unexpected $end



swilkins
06-21-2006, 06:50 PM
I know that this error is usually a result of a missing }, but I can't find it anywhere! I have used Match Brackets in my editor and it looks like all of the matches are there. Could someone else please look and see if something is missing - I know that it is a lot of code, but I have included almost everything because I don't know what section is missing the bracket.



$page_title='Pricing!';
// Connect to the db code goes here.

$custfilter = 'all';
$collfilter = 'all';

if (isset($_COOKIE['customer']))
{
$custfilter = $_COOKIE['customer'];
}

if (isset($_COOKIE['collection']))
{
$collfilter = $_COOKIE['collection'];
}

if(isset($_POST['customer']))
{
setcookie ('customer', $_POST['customer']);
$custfilter = $_POST['customer'];
}
if(isset($_POST['collection']))
{
setcookie ('collection', $_POST['collection']);
$collfilter = $_POST['collection'];
}

if (isset($_COOKIE['user_id']))
{
include ('./dalynincludes/header.html');

$query = "SELECT cuname from cust WHERE cukey=$custfilter";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);

echo "<BR><BR><BR><H2 ALIGN='left'>Salesman: {$_COOKIE['first_name']} &nbsp {$_COOKIE['last_name']}</H2><H1 ALIGN='center'>{$row['cuname']} &nbsp Price Sheet</H1>";
echo "<FORM ACTION='dalynordfiltered.php' method='post'><P ALIGN='center'><SELECT NAME='customer' SIZE='1'><OPTION VALUE='all'>All Customers";
$query = "SELECT cukey, cunbr, cushipto, cuname, cuadd1, cucity, custate, cuphoneac, cuphonepre, cuphonenbr from cust ORDER BY cuname ASC, cunbr ASC";
$result = mysql_query($query);
$lastcust = '';
$lastcustnbr = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if ($lastcust != $row['cuname'] OR $lastcustnbr != $row['cunbr'])
{
$cunb = $row['cunbr'];
$query3 = "SELECT cukey from cust WHERE cunbr = $cunb AND cushipto = 'ALL'";
$result3 = mysql_query($query3);
$row3 = mysql_fetch_array($result3, MYSQL_ASSOC);
if ($row3)
{
$cukeyall = $row3['cukey'];
}
else
{
$cukeyall = $row['cukey'];
}
echo '<OPTION VALUE='.$cukeyall.'';
if ($row['cunbr'] != $selcust)
{
echo '>'.$cuname.'';
}
else
{
echo ' SELECTED>'.$cuname.'';
}
$lastcust = $row['cuname'];
$lastcustnbr = $row['cunbr'];
}
}
echo "</SELECT><BR>";


echo "<SELECT NAME='collection' SIZE='1'><OPTION VALUE='all'>All Collections";
$query = "SELECT collhdcode, collhddesc from colhd ORDER BY collhddesc";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if ($lastcoll != $row['collhddesc'])
{
echo '<OPTION VALUE='.$row['collhdcode'].'';
if ($row['collhdcode'] != $collfilter)
{
echo '>'.$row['collhddesc'].'';
}
else
{
echo ' SELECTED>'.$row['collhddesc'].'';
}
$lastcoll = $row['collhddesc'];
}
}
echo "</SELECT>";

echo "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<INPUT TYPE='submit' VALUE='Submit'>";
echo "</P></FORM>";

if ($collfilter != 'all')
{
$whereby = "AND coldet.collhdcode = '".$collfilter."'";
}
else
{
$whereby = '';
}

if ($custfilter != 'all')
{
$query1 = "SELECT cupricelev FROM cust WHERE cukey=$custfilter";
$result1 = @mysql_query ($query1); // Run the query.
$row1 = mysql_fetch_array ($result1, MYSQL_NUM); // Return a record, if applicable.
$cpl = $row1['cupricelev'];

$query2 = "SELECT * from prgrid ORDER BY pgclass, pgsizeclass";
$result2 = mysql_query($query2);

// Create the table.

echo '<TABLE ALIGN="center" BORDER="1" BORDERCOLOR="#dad6d8" WIDTH=100%>';

// Print all records.
$lastcol = '';
$firstrec = "Y";
$x = 1;
$bg = '#eeeced';
while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC))
{
$col = $row2['pgclass'];
$query3 = "SELECT * from colhd WHERE collhdcode = $col;
$result3 = mysql_query($query3);
$row3 = mysql_fetch_array ($result3, MYSQL_NUM);

if ($col != $lastcol)
{
if ($firstrec != 'Y')
{
echo '</TR><TR>';
for ($i = 1; $i <= $x; $i++)
{
echo '<TD>'.$price.'.'.$i.'</TD>';
}
echo '</TR><TR><TD COLSPAN='.$x.'>&nbsp</TD>';

if ({$row3['collhdbull10']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull6']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull7']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull8']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull9']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull10']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull9']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull6']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull7']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull8']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull9']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull8']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull6']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull7']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull8']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull7']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull6']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull7']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull6']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull6']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull5']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull5']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull4']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull4']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull13']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull3']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull2']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR>';
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull2']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else if ({$row3['collhdbull1']} != '')
{
echo '<TR><TD COLSPAN='.$x.'>'.{$row3['collhdbull1']}.'</TD></TR></TABLE><BR><BR>';
$x = 1;
}
else
{
echo '</TABLE><BR><BR>';
$x = 1;
}
}
echo '<TABLE><TR><TD ALIGN='center'>'.{$row2['pgclass']}.'<BR>'.{$row2['pgsizeclass']}.'</TD>';
if ($cpl = 1)
{
{$price}.{$x} = {$row2['pglev1']};
$x = $x +1;
}
else if ($cpl = 2)
{
{$price}.{$x} = {$row2['pglev2']};
$x = $x +1;
}
else if ($cpl = 3)
{
{$price}.{$x} = {$row2['pglev3']};
$x = $x +1;
}
else if ($cpl = 4)
{
{$price}.{$x} = {$row2['pglev4']};
$x = $x +1;
}
else if ($cpl = 5)
{
{$price}.{$x} = {$row2['pglev5']};
$x = $x +1;
}
else if ($cpl = 6)
{
{$price}.{$x} = {$row2['pglev6']};
$x = $x +1;
}
else if ($cpl = 7)
{
{$price}.{$x} = {$row2['pglev7']};
$x = $x +1;
}
else if ($cpl = 8)
{
{$price}.{$x} = {$row2['pglev8']};
$x = $x +1;
}
else if ($cpl = 9)
{
{$price}.{$x}x = {$row2['pglev9']};
$x = $x +1;
}
else if ($cpl = 10)
{
{$price}.{$x} = {$row2['pglev10']};
$x = $x +1;
}
else if ($cpl = 11)
{
{$price}.{$x} = {$row2['pglev11']};
$x = $x +1;
}
else if ($cpl = 12)
{
{$price}.{$x} = {$row2['pglev12']};
$x = $x +1;
}
else if ($cpl = 13)
{
{$price}.{$x} = {$row2['pglev13']};
$x = $x +1;
}
else if ($cpl = 14)
{
{$price}.{$x} = {$row2['pglev14']};
$x = $x +1;
}
else if ($cpl = 15)
{
{$price}.{$x} = {$row2['pglev15']};
$x = $x +1;
}
else if ($cpl = 16)
{
{$price}.{$x} = {$row2['pglev16']};
$x = $x +1;
}
else if ($cpl = 17)
{
{$price}.{$x} = {$row2['pglev17']};
$x = $x +1;
}
else if ($cpl = 18)
{
{$price}.{$x} = {$row2['pglev18']};
$x = $x +1;
}
else if ($cpl = 19)
{
{$price}.{$x} = {$row2['pglev19']};
$x = $x +1;
}
else if ($cpl = 20)
{
{$price}.{$x} = {$row2['pglev20']};
$x = $x +1;
}
else if ($cpl = 21)
{
{$price}.{$x} = {$row2['pglev21']};
$x = $x +1;
}
else if ($cpl = 22)
{
{$price}.{$x} = {$row2['pglev22']};
$x = $x +1;
}
else if ($cpl = 23)
{
{$price}.{$x} = {$row2['pglev23']};
$x = $x +1;
}
else if ($cpl = 24)
{
{$price}.{$x} = {$row2['pglev24']};
$x = $x +1;
}
else if ($cpl = 25)
{
{$price}.{$x} = {$row2['pglev25']};
$x = $x +1;
}
else if ($cpl = 26)
{
{$price}.{$x} = {$row2['pglev26']};
$x = $x +1;
}
else if ($cpl = 27)
{
{$price}.{$x} = {$row2['pglev27']};
$x = $x +1;
}
else if ($cpl = 28)
{
{$price}.{$x} = {$row2['pglev28']};
$x = $x +1;
}
else if ($cpl = 29)
{
{$price}.{$x} = {$row2['pglev29']};
$x = $x +1;
}
else if ($cpl = 30)
{
{$price}.{$x} = {$row2['pglev30']};
$x = $x +1;
}
else if ($cpl = 31)
{
{$price}.{$x} = {$row2['pglev31']};
$x = $x +1;
}
else if ($cpl = 32)
{
{$price}.{$x} = {$row2['pglev32']};
$x = $x +1;
}
else if ($cpl = 33)
{
{$price}.{$x} = {$row2['pglev33']};
$x = $x +1;
}
else if ($cpl = 34)
{
{$price}.{$x} = {$row2['pglev34']};
$x = $x +1;
}
else if ($cpl = 35)
{
{$price}.{$x} = {$row2['pglev35']};
$x = $x +1;
}
else if ($cpl = 36)
{
{$price}.{$x} = {$row2['pglev36']};
$x = $x +1;
}
}
else
{
echo '<TD ALIGN='center'>'.{$row2['pgclass']}.'<BR>'.{$row2['pgsizeclass']}.'</TD>';
if ($cpl = 1)
{
{$price}.{$x} = {$row2['pglev1']};
$x = $x +1;
}
else if ($cpl = 2)
{
{$price}.{$x} = {$row2['pglev2']};
$x = $x +1;
}
else if ($cpl = 3)
{
{$price}.{$x} = {$row2['pglev3']};
$x = $x +1;
}
else if ($cpl = 4)
{
{$price}.{$x} = {$row2['pglev4']};
$x = $x +1;
}
else if ($cpl = 5)
{
{$price}.{$x} = {$row2['pglev5']};
$x = $x +1;
}
else if ($cpl = 6)
{
{$price}.{$x} = {$row2['pglev6']};
$x = $x +1;
}
else if ($cpl = 7)
{
{$price}.{$x} = {$row2['pglev7']};
$x = $x +1;
}
else if ($cpl = 8)
{
{$price}.{$x} = {$row2['pglev8']};
$x = $x +1;
}
else if ($cpl = 9)
{
{$price}.{$x} = {$row2['pglev9']};
$x = $x +1;
}
else if ($cpl = 10)
{
{$price}.{$x} = {$row2['pglev10']};
$x = $x +1;
}
else if ($cpl = 11)
{
{$price}.{$x} = {$row2['pglev11']};
$x = $x +1;
}
else if ($cpl = 12)
{
{$price}.{$x} = {$row2['pglev12']};
$x = $x +1;
}
else if ($cpl = 13)
{
{$price}.{$x} = {$row2['pglev13']};
$x = $x +1;
}
else if ($cpl = 14)
{
{$price}.{$x} = {$row2['pglev14']};
$x = $x +1;
}
else if ($cpl = 15)
{
{$price}.{$x} = {$row2['pglev15']};
$x = $x +1;
}
else if ($cpl = 16)
{
{$price}.{$x} = {$row2['pglev16']};
$x = $x +1;
}
else if ($cpl = 17)
{
{$price}.{$x} = {$row2['pglev17']};
$x = $x +1;
}
else if ($cpl = 18)
{
{$price}.{$x} = {$row2['pglev18']};
$x = $x +1;
}
else if ($cpl = 19)
{
{$price}.{$x} = {$row2['pglev19']};
$x = $x +1;
}
else if ($cpl = 20)
{
{$price}.{$x} = {$row2['pglev20']};
$x = $x +1;
}
else if ($cpl = 21)
{
{$price}.{$x} = {$row2['pglev21']};
$x = $x +1;
}
else if ($cpl = 22)
{
{$price}.{$x} = {$row2['pglev22']};
$x = $x +1;
}
else if ($cpl = 23)
{
{$price}.{$x} = {$row2['pglev23']};
$x = $x +1;
}
else if ($cpl = 24)
{
{$price}.{$x} = {$row2['pglev24']};
$x = $x +1;
}
else if ($cpl = 25)
{
{$price}.{$x} = {$row2['pglev25']};
$x = $x +1;
}
else if ($cpl = 26)
{
{$price}.{$x} = {$row2['pglev26']};
$x = $x +1;
}
else if ($cpl = 27)
{
{$price}.{$x} = {$row2['pglev27']};
$x = $x +1;
}
else if ($cpl = 28)
{
{$price}.{$x} = {$row2['pglev28']};
$x = $x +1;
}
else if ($cpl = 29)
{
{$price}.{$x} = {$row2['pglev29']};
$x = $x +1;
}
else if ($cpl = 30)
{
{$price}.{$x} = {$row2['pglev30']};
$x = $x +1;
}
else if ($cpl = 31)
{
{$price}.{$x} = {$row2['pglev31']};
$x = $x +1;
}
else if ($cpl = 32)
{
{$price}.{$x} = {$row2['pglev32']};
$x = $x +1;
}
else if ($cpl = 33)
{
{$price}.{$x} = {$row2['pglev33']};
$x = $x +1;
}
else if ($cpl = 34)
{
{$price}.{$x} = {$row2['pglev34']};
$x = $x +1;
}
else if ($cpl = 35)
{
{$price}.{$x} = {$row2['pglev35']};
$x = $x +1;
}
else if ($cpl = 36)
{
{$price}.{$x} = {$row2['pglev36']};
$x = $x +1;
}
}
}
mysql_free_result($result);
mysql_free_result($result1);
mysql_free_result($result2);
mysql_free_result($result3);
}
else
{
echo '<P ALIGN='center'><BIG><BIG>You must select a customer.</BIG></BIG></P>';
}
mysql_close();
include('./dalynincludes/footer.html');
}

Kid Charming
06-21-2006, 07:03 PM
$query3 = "SELECT * from colhd WHERE collhdcode = $col;

swilkins
06-21-2006, 08:18 PM
Thank You! Thank You! Thank You!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum