Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error: Unexpected T_elseif


inalilbubble

Recommended Posts

Hi I am getting the following error but I can't seem to figure out why.

 

Parse error: parse error, unexpected T_ELSEIF in /home/woodluck/public_html/admin/orders.php on line 376

 

 

Heres the bit of code thats causing the error. Line 376 is red.

 

 

 

<?phpif (isset($HTTP_GET_VARS['cID'])); {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

}

elseif (isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))

{

$status = tep_db_prepare_input($HTTP_GET_VARS['status']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";

} else {

$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

} $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

$orders_query = tep_db_query($orders_query_raw);

while ($orders = tep_db_fetch_array($orders_query)) {

if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {

$oInfo = new objectInfo($orders);

}

 

if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";

}

?>

Link to comment
Share on other sites

elseif (isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))

 

you have many )

 

elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))

Sugiartha

------------------------------------------

concept of life: enjoy aja!

Link to comment
Share on other sites

<?phpif (isset($HTTP_GET_VARS['cID'])); {

 

should be

 

<?php if (isset($HTTP_GET_VARS['cID'])) {

Sugiartha

------------------------------------------

concept of life: enjoy aja!

Link to comment
Share on other sites

while ($orders = tep_db_fetch_array($orders_query)) {
if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
$oInfo = new objectInfo($orders);
}

 

I might be wrong , but it seems like not enough brackets here

Link to comment
Share on other sites

Thanks for the responses but it seems as though nothing is helping I am still getting the exact same error. Below is the line that is causing the error. It looks fine to me but I just don't know.

 

	  elseif (isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) 	{

Link to comment
Share on other sites

<?php
if (isset($HTTP_GET_VARS['cID'])) {
$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
}
elseif (isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))
{
$status = tep_db_prepare_input($HTTP_GET_VARS['status']);
$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.shipdate, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
$orders_query = tep_db_query($orders_query_raw);
while ($orders = tep_db_fetch_array($orders_query)) {
if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID'])) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']) && !isset($oInfo)) {
$oInfo = new objectInfo($orders);
}

if ((isset($oInfo)) && (is_object($oInfo)) && ($orders['orders_id'] == $oInfo->orders_id)) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
}
?>

Link to comment
Share on other sites

okay that seemed to correct the elseif issue but now I get this:

 

Parse error: parse error, unexpected T_BOOLEAN_AND in /home/woodluck/public_html/admin/orders.php on line 378

 

Line 387 (as you may have guessed it)

 

elseif (isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))

 

AHHHHHHHHH! This is becoming extremely frustrating! Thanks for all the help guys!

Link to comment
Share on other sites

Ok nevermind, fixed the previous issue, one to many ) anyways now I get this:

 

Parse error: parse error, unexpected '{' in /home/woodluck/public_html/admin/orders.php on line 387

 

Line 387:

if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID'])) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']) && !isset($oInfo)) {

Link to comment
Share on other sites

Ok nevermind, fixed the previous issue, one to many ) anyways now I get this:

 

Parse error: parse error, unexpected '{' in /home/woodluck/public_html/admin/orders.php on line 387

 

Line 387:

if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID'])) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']) && !isset($oInfo)) {

 

EDIT: Figured it out. I love compare it! software I just compared my modified file to the original and found many many ) where the werent supposed to be.

 

Again, thanks for all the help

Link to comment
Share on other sites

My mistake

 

} elseif ((isset($HTTP_GET_VARS['status'])) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0))

Link to comment
Share on other sites

if ( (!isset($HTTP_GET_VARS['oID'])) || (isset($HTTP_GET_VARS['oID'])) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']) && (!isset($oInfo)) ) {

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...