Hello, I am new to php learning it for oscommerce.
I can't spot the syntax error in this file. I will have to split it into 2 posts as even after paring most of the HTML it doesn't fit.
<?php
require('includes/application_top.php');
require(DIR_WS_FUNCTIONS . 'dynamic_mopics.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link rel="stylesheet" type="text/css" href="dynamic_mopics.css">
<script language="javascript" type="text/javascript"><!--
function popupImage(url, imageHeight, imageWidth) {
var newImageHeight = (parseInt(imageHeight) + 40);
var yPos = ((screen.height / 2) - (parseInt(newImageHeight) / 2));
var xPos = ((screen.width / 2) - (parseInt(imageWidth) / 2));
imageWindow = window.open(url,'popupImages','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + imageWidth + ',height=' + newImageHeight + ',screenY=' + yPos + ',screenX=' + xPos + ',top=' + yPos + ',left=' + xPos);
imageWindow.moveTo(xPos, yPos);
imageWindow.resizeTo(parseInt(imageWidth), parseInt(newImageHeight));
if (window.focus) {
imageWindow.focus();
}
}
//--></script>
</head>
<body>
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<table><tr><td>
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</td>
<td>
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
</td>
<td>
<?php panel_top();?>
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
<table>
<?php
if ($product_check['total'] < 1) {
?>
<tr><td>
<?php tep_draw_heading_top(); ?>
<?php echo tep_draw_title_top();?>
<?php echo TEXT_PRODUCT_NOT_FOUND;?>
<?php echo tep_draw_title_bottom();?>
<?php tep_draw_heading_top_1(); ?>
<table><tr><td>
<?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td>
<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td>
<?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr></table>
<?php tep_draw_heading_bottom_1(); ?>
<?php tep_draw_heading_bottom(); ?>
<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
$products_price = '<span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> <s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s>';
} else {
$products_price = '<span class="productSpecialPrice">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])).'</span>';
}
if (tep_not_null($product_info['products_model'])) {
$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
$products_name = $product_info['products_name'];
}
?>
<tr><td>