Help Needed Parse error: syntax error

Reply

Join Date: Jun 2007
Posts: 2
Reputation: Ciscoguy is an unknown quantity at this point 
Solved Threads: 0
Ciscoguy Ciscoguy is offline Offline
Newbie Poster

Help Needed Parse error: syntax error

 
0
  #1
Jun 18th, 2007
I am getting the following error coming up and cant figeur it out

Parse error: syntax error, unexpected T_CASE in /mnt/w0505/d37/s36/b0252bde/www/HorizonMarketing/nfoscomm/catalog/admin/orders.php on line 99

here is my code hope someone can help me

  1. <?php
  2. /*
  3.   $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $
  4.  
  5.   osCommerce, Open Source E-Commerce Solutions
  6.   http://www.oscommerce.com
  7.  
  8.   Copyright (c) 2003 osCommerce
  9.  
  10.   Released under the GNU General Public License
  11. */
  12.  
  13. require('includes/application_top.php');
  14.  
  15. require(DIR_WS_CLASSES . 'currencies.php');
  16. $currencies = new currencies();
  17.  
  18. $orders_statuses = array();
  19. $orders_status_array = array();
  20. $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
  21. while ($orders_status = tep_db_fetch_array($orders_status_query)) {
  22. $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
  23. 'text' => $orders_status['orders_status_name']);
  24. $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
  25. }
  26.  
  27. $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
  28.  
  29. if (tep_not_null($action)) {
  30. switch ($action) {
  31. case 'update_order':
  32. $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  33. $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
  34. $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
  35. /*Tracking contribution begin*/
  36. $CP_track_num = tep_db_prepare_input($HTTP_POST_VARS['CP_track_num']);
  37. /*Tracking contribution end*/
  38.  
  39. $order_updated = false;
  40. /*Tracking contribution begin*/
  41. $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, CP_track_num, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");
  42. /*Tracking contribution end*
  43.   $check_status = tep_db_fetch_array($check_status_query);
  44.  
  45.   if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
  46.   tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
  47.  
  48.   /*Tracking contribution begin*/
  49. $customer_notified = '0';
  50. if ($HTTP_POST_VARS['notify'] == 'on' & $CP_track_num == '' ) {
  51. $notify_comments = '';
  52. if ($HTTP_POST_VARS['notify_comments'] == 'on') {
  53. $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
  54. }
  55. $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
  56. tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  57. $customer_notified = '1';
  58. }elseif ($HTTP_POST_VARS['notify'] == 'on' & tep_not_null($CP_track_num) ) {
  59. $notify_comments = '';
  60. if ($HTTP_POST_VARS['notify_comments'] == 'on') {
  61. $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
  62. }
  63. $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" .
  64.  
  65. EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . EMAIL_TEXT_TRACKING_NUMBER . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" . $notify_comments .
  66.  
  67. sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
  68. tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  69. $customer_notified = '1';
  70. }
  71. /*Tracking contribution end*/
  72.  
  73.  
  74. tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  75.  
  76. $customer_notified = '1';
  77. }
  78.  
  79. tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");
  80.  
  81. $order_updated = true;
  82. }
  83. /*Tracking contribution begin*/
  84. if (tep_not_null($CP_track_num)) {
  85. tep_db_query("update " . TABLE_ORDERS . " set CP_track_num = '" . tep_db_input($CP_track_num) . "' where orders_id = '" . tep_db_input($oID) . "'");
  86. $order_updated = true;
  87. }
  88. /*Tracking contribution end*/
  89.  
  90. if ($order_updated == true)
  91. {
  92. $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
  93. } else {
  94. $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
  95. }
  96.  
  97. tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
  98. break;
  99. case 'deleteconfirm':
  100. $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  101.  
  102. tep_remove_order($oID, $HTTP_POST_VARS['restock']);
  103.  
  104. tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
  105. break;
  106. }
  107. }
  108.  
  109. if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
  110. $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  111.  
  112. $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  113. $order_exists = true;
  114. if (!tep_db_num_rows($orders_query)) {
  115. $order_exists = false;
  116. $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
  117. }
  118. }
  119.  
  120. include(DIR_WS_CLASSES . 'order.php');
  121. ?>
  122. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  123. <html <?php echo HTML_PARAMS; ?>>
  124. <head>
  125. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  126. <title><?php echo TITLE; ?></title>
  127. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  128. <script language="javascript" src="includes/general.js"></script>
  129. </head>
  130. <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
  131. <!-- header //-->
  132. <?php
  133. require(DIR_WS_INCLUDES . 'header.php');
  134. ?>
  135. <!-- header_eof //-->
  136.  
  137. <!-- body //-->
  138. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  139. <tr>
  140. <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
  141. <!-- left_navigation //-->
  142. <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
  143. <!-- left_navigation_eof //-->
  144. </table></td>
  145. <!-- body_text //-->
  146. <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  147. <?php
  148. if (($action == 'edit') && ($order_exists == true)) {
  149. $order = new order($oID);
  150. ?>
  151. <tr>
  152. <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  153. <tr>
  154. <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  155. <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
  156. <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  157. </tr>
  158. </table></td>
  159. </tr>
  160. <tr>
  161. <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
  162. <tr>
  163. <td colspan="3"><?php echo tep_draw_separator(); ?></td>
  164. </tr>
  165. <tr>
  166. <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
  167. <tr>
  168. <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
  169. <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
  170. </tr>
  171. <tr>
  172. <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
  173. </tr>
  174. <tr>
  175. <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
  176. <td class="main"><?php echo $order->customer['telephone']; ?></td>
  177. </tr>
  178. <tr>
  179. <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
  180. <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
  181. </tr>
  182. </table></td>
  183. <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
  184. <tr>
  185. <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
  186. <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
  187. </tr>
  188. </table></td>
  189. <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
  190. <tr>
  191. <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
  192. <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>
  193. </tr>
  194. </table></td>
  195. </tr>
  196. </table></td>
  197. </tr>
  198. <tr>
  199. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  200. </tr>
  201. <tr>
  202. <td><table border="0" cellspacing="0" cellpadding="2">
  203. <tr>
  204. <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
  205. <td class="main"><?php echo $order->info['payment_method']; ?></td>
  206. </tr>
  207. <?php
  208. if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
  209. ?>
  210. <tr>
  211. <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  212. </tr>
  213. <tr>
  214. <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
  215. <td class="main"><?php echo $order->info['cc_type']; ?></td>
  216. </tr>
  217. <tr>
  218. <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
  219. <td class="main"><?php echo $order->info['cc_owner']; ?></td>
  220. </tr>
  221. <tr>
  222. <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
  223. <td class="main"><?php echo $order->info['cc_number']; ?></td>
  224. </tr>
  225. <tr>
  226. <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
  227. <td class="main"><?php echo $order->info['cc_expires']; ?></td>
  228. </tr>
  229. <?php
  230. }
  231. ?>
  232. </table></td>
  233. </tr>
  234. <tr>
  235. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  236. </tr>
  237. <tr>
  238. <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  239. <tr class="dataTableHeadingRow">
  240. <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
  241. <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
  242. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
  243. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
  244. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
  245. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
  246. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
  247. </tr>
  248. <?php
  249. for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
  250. echo ' <tr class="dataTableRow">' . "\n" .
  251. ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
  252. ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
  253.  
  254. if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
  255. for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
  256. echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
  257. if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
  258. echo '</i></small></nobr>';
  259. }
  260. }
  261.  
  262. echo ' </td>' . "\n" .
  263. ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
  264. ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
  265. ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
  266. ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
  267. ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
  268. ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
  269. echo ' </tr>' . "\n";
  270. }
  271. ?>
  272. <tr>
  273. <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
  274. <?php
  275. for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
  276. echo ' <tr>' . "\n" .
  277. ' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
  278. ' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
  279. ' </tr>' . "\n";
  280. }
  281. ?>
  282. </table></td>
  283. </tr>
  284. </table></td>
  285. </tr>
  286. <tr>
  287. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  288. </tr>
  289. <tr>
  290. <td class="main"><table border="1" cellspacing="0" cellpadding="5">
  291. <tr>
  292. <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
  293. <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
  294. <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
  295. <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
  296. </tr>
  297. <?php
  298. $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
  299. if (tep_db_num_rows($orders_history_query)) {
  300. while ($orders_history = tep_db_fetch_array($orders_history_query)) {
  301. echo ' <tr>' . "\n" .
  302. ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
  303. ' <td class="smallText" align="center">';
  304. if ($orders_history['customer_notified'] == '1') {
  305. echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
  306. } else {
  307. echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
  308. }
  309. echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .
  310. ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . '&nbsp;</td>' . "\n" .
  311. ' </tr>' . "\n";
  312. }
  313. } else {
  314. echo ' <tr>' . "\n" .
  315. ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
  316. ' </tr>' . "\n";
  317. }
  318. ?>
  319. </table></td>
  320. </tr>
  321. <tr>
  322. <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
  323. </tr>
  324. <tr>
  325. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
  326. </tr>
  327. <!--- Tracking contribution begin -->
  328. <?php
  329. ?>
  330. <tr>
  331. <td class="main"><b><?php echo TABLE_HEADING_CP_TRACKING; ?></b>&nbsp;&nbsp;<?php echo tep_draw_textbox_field('CP_track_num', '20', '18', '', $order->info['CP_track_num']); ?></td>
  332. </tr>
  333. <tr>
  334. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  335. </tr>
  336. <?php
  337. ?>
  338. <!--- Tracking contribution end -->
  339. <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>
  340. <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
  341. </tr>
  342. <tr>
  343. <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  344. </tr>
  345. <tr>
  346. <td><table border="0" cellspacing="0" cellpadding="2">
  347. <tr>
  348. <td><table border="0" cellspacing="0" cellpadding="2">
  349. <tr>
  350. <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
  351. </tr>
  352. <tr>
  353. <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
  354. <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
  355. </tr>
  356. </table></td>
  357. <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
  358. </tr>
  359. </table></td>
  360. </form></tr>
  361. <tr>
  362. <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
  363. </tr>
  364. <?php
  365. } else {
  366. ?>
  367. <tr>
  368. <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  369. <tr>
  370. <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  371. <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
  372. <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  373. <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>
  374. <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
  375. </form></tr>
  376. <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
  377. <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
  378. </form></tr>
  379. </table></td>
  380. </tr>
  381. </table></td>
  382. </tr>
  383. <tr>
  384. <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  385. <tr>
  386. <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  387. <tr class="dataTableHeadingRow">
  388. <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
  389. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
  390. <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
  391. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
  392. <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  393. </tr>
  394. <?php
  395. if (isset($HTTP_GET_VARS['cID'])) {
  396. $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  397. $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, 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";
  398. } elseif (isset($HTTP_GET_VARS['status'])) {
  399. $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  400. $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, 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";
  401. } else {
  402. $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, 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";
  403. }
  404. $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
  405. $orders_query = tep_db_query($orders_query_raw);
  406. while ($orders = tep_db_fetch_array($orders_query)) {
  407. if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
  408. $oInfo = new objectInfo($orders);
  409. }
  410.  
  411. if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
  412. 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";
  413. } else {
  414. 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";
  415. }
  416. ?>
  417. <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $orders['customers_name']; ?></td>
  418. <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>
  419. <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
  420. <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
  421. <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
  422. </tr>
  423. <?php
  424. }
  425. ?>
  426. <tr>
  427. <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  428. <tr>
  429. <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
  430. <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
  431. </tr>
  432. </table></td>
  433. </tr>
  434. </table></td>
  435. <?php
  436. $heading = array();
  437. $contents = array();
  438.  
  439. switch ($action) {
  440. case 'delete':
  441. $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');
  442.  
  443. $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
  444. $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
  445. $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
  446. $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  447. break;
  448. default:
  449. if (isset($oInfo) && is_object($oInfo)) {
  450. $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');
  451.  
  452. $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
  453. $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
  454. $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
  455. if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
  456. $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);
  457. }
  458. break;
  459. }
  460.  
  461. if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
  462. echo ' <td width="25%" valign="top">' . "\n";
  463.  
  464. $box = new box;
  465. echo $box->infoBox($heading, $contents);
  466.  
  467. echo ' </td>' . "\n";
  468. }
  469. ?>
  470. </tr>
  471. </table></td>
  472. </tr>
  473. <?php
  474. }
  475. ?>
  476. </table></td>
  477. <!-- body_text_eof //-->
  478. </tr>
  479. </table>
  480. <!-- body_eof //-->
  481.  
  482. <!-- footer //-->
  483. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  484. <!-- footer_eof //-->
  485. <br>
  486. </body>
  487. </html>
  488. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2
Reputation: Ciscoguy is an unknown quantity at this point 
Solved Threads: 0
Ciscoguy Ciscoguy is offline Offline
Newbie Poster

Re: Help Needed Parse error: syntax error

 
0
  #2
Jun 18th, 2007
this is the section from lines 80 - 120
  1.  
  2. $order_updated = true;
  3. }
  4. /*Tracking contribution begin*/
  5. if (tep_not_null($CP_track_num)) {
  6. tep_db_query("update " . TABLE_ORDERS . " set CP_track_num = '" . tep_db_input($CP_track_num) . "' where orders_id = '" . tep_db_input($oID) . "'");
  7. $order_updated = true;
  8. }
  9. /*Tracking contribution end*/
  10.  
  11. if ($order_updated == true)
  12. {
  13. $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
  14. } else {
  15. $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
  16. }
  17.  
  18. tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
  19. break;
  20. case 'deleteconfirm':
  21. $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  22.  
  23. tep_remove_order($oID, $HTTP_POST_VARS['restock']);
  24.  
  25. tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
  26. break;
  27. }
  28. }
  29.  
  30. if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
  31. $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  32.  
  33. $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
  34. $order_exists = true;
  35. if (!tep_db_num_rows($orders_query)) {
  36. $order_exists = false;
  37. $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
  38. }
  39. }
  40.  
  41. include(DIR_WS_CLASSES . 'order.php');
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Help Needed Parse error: syntax error

 
0
  #3
Jun 20th, 2007
You may have too many closed blocks before the case. One of the }'s may be closing your switch statement before it's truely at the end.
Last edited by Puckdropper; Jun 20th, 2007 at 7:07 am.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 142
Reputation: einfoway is an unknown quantity at this point 
Solved Threads: 2
einfoway's Avatar
einfoway einfoway is offline Offline
Junior Poster

Re: Help Needed Parse error: syntax error

 
0
  #4
Jun 21st, 2007
Got it....

Check on line 30

  1. switch ($action) {

your switch "{" starts on line 30 and ends at line 82. So your switch ends on line 82 itself.

Where as on line 98/99

  1. break;
  2. case 'deleteconfirm':

you are refering to already closed switch and thats why you are getting this error .. Hope that help you..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC