853 lines
40 KiB
PHP
853 lines
40 KiB
PHP
<?php
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| CubeCart 4
|
|
| ========================================
|
|
| CubeCart is a registered trade mark of Devellion Limited
|
|
| Copyright Devellion Limited 2006. All rights reserved.
|
|
| Devellion Limited,
|
|
| 5 Bridge Street,
|
|
| Bishops Stortford,
|
|
| HERTFORDSHIRE.
|
|
| CM23 2JU
|
|
| UNITED KINGDOM
|
|
| http://www.devellion.com
|
|
| UK Private Limited Company No. 5323904
|
|
| ========================================
|
|
| Web: http://www.cubecart.com
|
|
| Email: info (at) cubecart (dot) com
|
|
| License Type: CubeCart is NOT Open Source Software and Limitations Apply
|
|
| Licence Info: http://www.cubecart.com/site/faq/license.php
|
|
+--------------------------------------------------------------------------
|
|
| index.inc.php
|
|
| ========================================
|
|
| Add/Edit/Delete Products
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
|
|
if(!defined('CC_INI_SET')){ die("Access Denied"); }
|
|
|
|
$lang = getLang("admin".CC_DS."admin_products.inc.php");
|
|
require("classes".CC_DS."gd".CC_DS."gd.inc.php");
|
|
require($glob['adminFolder'].CC_DS."includes".CC_DS."currencyVars.inc.php");
|
|
|
|
permission('products', 'read', true);
|
|
|
|
$productsPerPage = 25;
|
|
|
|
if (isset($_POST['DeleteSelected']) && is_array($_POST['product'])) {
|
|
$query = sprintf("DELETE FROM %sCubeCart_inventory WHERE `productId` IN (%s)", $glob['dbprefix'], implode(',', $_POST['product']));
|
|
$db->misc($query);
|
|
}
|
|
|
|
|
|
if (isset($_POST['EditSelected']) && is_array($_POST['product']) && !empty($_POST['MoveTo'])) {
|
|
$i=0;
|
|
foreach ($_POST['product'] as $key => $product_id) {
|
|
|
|
if ($_POST['current'][$product_id] == $_POST['MoveTo']) break;
|
|
|
|
## Update primary category
|
|
$query = sprintf("UPDATE %sCubeCart_inventory SET `cat_id`='%d' WHERE `productId`='%d';", $glob['dbprefix'], $_POST['MoveTo'], $product_id);
|
|
$db->misc($query);
|
|
|
|
## Check if target category was added as an extra for product before
|
|
$query = sprintf("SELECT cat_id FROM %sCubeCart_cats_idx WHERE `cat_id` = '%d' AND productId = '%d' LIMIT 1;", $glob['dbprefix'], $_POST['MoveTo'], $product_id);
|
|
$previous = $db->select($query);
|
|
|
|
if ($previous) {
|
|
|
|
## Delete old primary category record only, new category already there
|
|
$query = sprintf("DELETE FROM %sCubeCart_cats_idx WHERE cat_id = '%d' AND productId = '%d'", $glob['dbprefix'], $_POST['current'][$product_id], $product_id );
|
|
$db->misc($query);
|
|
|
|
## Product counted before we dont need it for target category product count
|
|
unset($_POST['product'][$key]);
|
|
} else {
|
|
## Update secondary categories
|
|
$query = sprintf("UPDATE %1\$sCubeCart_cats_idx SET cat_id = '%2\$d' WHERE productId = '%3\$d' AND cat_id = '%4\$d' LIMIT 1;", $glob['dbprefix'], $_POST['MoveTo'], $product_id, $_POST['current'][$product_id]);
|
|
$db->misc($query);
|
|
}
|
|
## Update category product count
|
|
$db->categoryNos($_POST['current'][$product_id], '-', 1);
|
|
$db->categoryNos($_POST['MoveTo'], '+', 1);
|
|
$i++;
|
|
}
|
|
|
|
$cache = new cache();
|
|
$cache->clearCache();
|
|
}
|
|
|
|
|
|
if(isset($_POST['normPer']) && isset($_POST['salePer']))
|
|
{
|
|
|
|
$cache = new cache();
|
|
$cache->clearCache();
|
|
|
|
$sqlUpdateWhere = "";
|
|
|
|
if(is_array($_POST['cat_id_price']))
|
|
{
|
|
for ($n=0; $n<count($_POST['cat_id_price']); $n++)
|
|
{
|
|
if($_POST['cat_id_price'][$n]>0)
|
|
{
|
|
if($n==0)
|
|
{
|
|
$sqlUpdateWhere .= " WHERE cat_id = ".$db->mySQLSafe($_POST['cat_id_price'][$n]);
|
|
}
|
|
else
|
|
{
|
|
$sqlUpdateWhere .= " OR cat_id = ".$db->mySQLSafe($_POST['cat_id_price'][$n]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(is_numeric($_POST['normPer']))
|
|
{
|
|
|
|
if($_POST['normPerMethod']=="percent" && $_POST['normPer']>0)
|
|
{
|
|
$sum = " * ".($_POST['normPer']/100);
|
|
}
|
|
elseif($_POST['normPerMethod']=="value" && $_POST['normPer']<0)
|
|
{
|
|
$sum = $_POST['normPer'];
|
|
}
|
|
elseif($_POST['normPerMethod']=="value")
|
|
{
|
|
$sum = " + ".$_POST['normPer'];
|
|
}
|
|
|
|
$query = "UPDATE ".$glob['dbprefix']."CubeCart_inventory SET `price` = `price` ".$sum.$sqlUpdateWhere;
|
|
|
|
$result = $db->misc($query);
|
|
}
|
|
|
|
if (is_numeric($_POST['salePer'])) {
|
|
|
|
if ($_POST['salePerMethod']=="percent" && $_POST['normPer']>0) {
|
|
$sum = " * ".($_POST['salePer']/100);
|
|
|
|
} else if ($_POST['salePerMethod']=="value" && $_POST['salePer']<0) {
|
|
$sum = $_POST['salePer'];
|
|
|
|
} else if ($_POST['salePerMethod']=="value") {
|
|
$sum = " + ".$_POST['salePer'];
|
|
}
|
|
|
|
$query = "UPDATE ".$glob['dbprefix']."CubeCart_inventory SET `sale_price` = `sale_price` ".$sum.$sqlUpdateWhere;
|
|
$result = $db->misc($query);
|
|
}
|
|
|
|
if ($result) {
|
|
$msg2 = "<p class='infoText'>".$lang['admin']['products_price_upd_successful']."</p>";
|
|
} else {
|
|
$msg2 = "<p class='warnText'>".$lang['admin']['products_price_upd_fail']."</p>";
|
|
}
|
|
|
|
} else if (isset($_GET['delete']) && $_GET["delete"]>0) {
|
|
$cache = new cache();
|
|
$cache->clearCache();
|
|
|
|
// delete product
|
|
$where = "productId=".$db->mySQLSafe($_GET["delete"]);
|
|
$delete = $db->delete($glob['dbprefix']."CubeCart_inventory", $where);
|
|
|
|
// set categories -1
|
|
$cats = $db->select("SELECT cat_id FROM ".$glob['dbprefix']."CubeCart_cats_idx WHERE productId=".$db->mySQLSafe($_GET["delete"]));
|
|
if ($cats == true) {
|
|
for ($i=0;$i<count($cats);$i++) {
|
|
$db->categoryNos($cats[$i]['cat_id'], "-");
|
|
}
|
|
}
|
|
|
|
// delete category index
|
|
$where = "productId=".$db->mySQLSafe($_GET["delete"]);
|
|
$deleteIdx = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where);
|
|
unset($record);
|
|
|
|
// delete product options
|
|
$record['product'] = $db->mySQLSafe($_GET["delete"]);
|
|
$where = "product=".$db->mySQLSafe($_GET["delete"]);
|
|
$deleteOps = $db->delete($glob['dbprefix']."CubeCart_options_bot", $where);
|
|
unset($record);
|
|
|
|
if ($delete == true) {
|
|
$msg = "<p class='infoText'>".$lang['admin']['products_delete_success']."</p>";
|
|
} else {
|
|
$msg = "<p class='warnText'>".$lang['admin']['products_delete_fail']."</p>";
|
|
}
|
|
|
|
} else if (isset($_POST['productId'])) {
|
|
|
|
$cache = new cache();
|
|
$cache->clearCache();
|
|
|
|
$allowedFields = $db->getFields($glob['dbprefix'].'CubeCart_inventory');
|
|
|
|
foreach ($_POST as $name => $value) {
|
|
if (in_array($name, $allowedFields) && (!empty($value) || $value == '0')) {
|
|
$record[$name] = $db->mySQLSafe($value);
|
|
}
|
|
}
|
|
|
|
## Custom field translation
|
|
$record['image'] = $db->mySQLSafe(imgPath($_POST['imageName'], false, ''));
|
|
$record['tax_inclusive'] = ($_POST['tax_inclusive'] == 1) ? '1' : '0';
|
|
$record['cat_id'] = $db->mySQLSafe($_POST['cat_id']);
|
|
|
|
$description = (detectSSL() && !$config['force_ssl'] && $config['rootRel'] != CC_DS) ? str_replace($config['rootRel_SSL'], $glob['rootRel'], $_POST['FCKeditor']) : $_POST['FCKeditor'];
|
|
$record['description'] = (!empty($description)) ? $db->mySQLSafe($description) : 'NULL';
|
|
|
|
## Generate product code
|
|
if (empty($_POST['productCode'])) {
|
|
$chars = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N",
|
|
"O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3",
|
|
"4","5","6","7","8","9","0");
|
|
$max_chars = count($chars) - 1;
|
|
srand((double)microtime()*1000000);
|
|
for ($i = 0; $i < 5; $i++) {
|
|
$randChars = ($i == 0) ? $chars[rand(0, $max_chars)] : $randnum . $chars[rand(0, $max_chars)];
|
|
}
|
|
$record["productCode"] = $db->mySQLSafe(strtoupper(substr($_POST['name'],0,3)).$randChars.$_POST['cat_id']);
|
|
} else {
|
|
$record["productCode"] = $db->mySQLSafe($_POST['productCode']);
|
|
}
|
|
|
|
// if image is a JPG check thumbnail doesn't exist and if not make one
|
|
|
|
/*
|
|
$imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_POST['imageName']));
|
|
|
|
if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)) {
|
|
|
|
$rootThumbFile = imgPath($_POST['imageName'],$thumb=1,$path="root");
|
|
$rootMasterFile = imgPath($_POST['imageName'],$thumb=0,$path="root");
|
|
|
|
if(file_exists($rootThumbFile)) {
|
|
@unlink($rootThumbFile);
|
|
}
|
|
|
|
$img = new gd($rootMasterFile);
|
|
$img->size_auto($config['gdthumbSize']);
|
|
$img->save($rootThumbFile);
|
|
}
|
|
*/
|
|
|
|
if (isset($_POST['productId']) && $_POST['productId']>0) {
|
|
|
|
$where = "productId=".$db->mySQLSafe($_POST['productId']);
|
|
$update = $db->update($glob['dbprefix']."CubeCart_inventory", $record, $where);
|
|
unset($record, $where);
|
|
|
|
// update category count
|
|
if($_POST['oldCatId']!==$_POST['cat_id'])
|
|
{
|
|
|
|
// set old category -1 IF IT WAS IN THERE BEFORE
|
|
$numOldCat = $db->numrows("SELECT * FROM ".$glob['dbprefix']."CubeCart_cats_idx WHERE cat_id = ".$db->mySQLSafe($_POST['oldCatId'])." AND productId = ".$db->mySQLSafe($_POST['productId']));
|
|
|
|
if($numOldCat>0){
|
|
$db->categoryNos($_POST['oldCatId'], "-");
|
|
}
|
|
|
|
// set new category +1 IF IT WAS NOT IN THERE BEFORE
|
|
$numNewCat = $db->numrows("SELECT * FROM ".$glob['dbprefix']."CubeCart_cats_idx WHERE cat_id = ".$db->mySQLSafe($_POST['cat_id'])." AND productId = ".$db->mySQLSafe($_POST['productId']));
|
|
|
|
if($numNewCat == 0)
|
|
{
|
|
$db->categoryNos($_POST['cat_id'], "+");
|
|
}
|
|
|
|
|
|
// delete old idx
|
|
$where = "productId = ".$db->mySQLSafe($_POST['productId'])." AND cat_id = ".$db->mySQLSafe($_POST['oldCatId']);
|
|
$deleteIdx = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where);
|
|
unset($record);
|
|
|
|
// delete new index if it was added as an extra before
|
|
$where = "productId = ".$db->mySQLSafe($_POST['productId'])." AND cat_id = ".$db->mySQLSafe($_POST['cat_id']);
|
|
$deleteIdx = $db->delete($glob['dbprefix']."CubeCart_cats_idx", $where);
|
|
unset($record);
|
|
|
|
// add new idx
|
|
$record['productId'] = $db->mySQLSafe($_POST['productId']);
|
|
$record['cat_id'] = $db->mySQLSafe($_POST['cat_id']);
|
|
$insertIdx = $db->insert($glob['dbprefix']."CubeCart_cats_idx", $record);
|
|
unset($record);
|
|
|
|
}
|
|
|
|
if ($update == TRUE) {
|
|
$msg = "<p class='infoText'>'".$_POST['name']."' ".$lang['admin']['products_update_successful']."</p>";
|
|
} else {
|
|
$msg = "<p class='warnText'>".$lang['admin']['products_update_fail']."</p>";
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
$insert = $db->insert($glob['dbprefix']."CubeCart_inventory", $record);
|
|
unset($record);
|
|
|
|
$record['cat_id'] = $db->mySQLSafe($_POST['cat_id']);
|
|
$record['productId'] = $db->insertid();
|
|
$insertIdx = $db->insert($glob['dbprefix']."CubeCart_cats_idx", $record);
|
|
unset($record);
|
|
|
|
if($insert == TRUE)
|
|
{
|
|
|
|
$msg = "<p class='infoText'>'".$_POST['name']."' ".$lang['admin']['products_add_success']."</p>";
|
|
|
|
// notch up amount of products in category
|
|
$db->categoryNos($_POST['cat_id'], "+");
|
|
|
|
}
|
|
else
|
|
{
|
|
$msg = "<p class='warnText'>".$lang['admin']['products_add_fail']."</p>";
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!isset($_GET['mode'])) {
|
|
## Build the SQL Query
|
|
if (isset($_GET['edit']) && $_GET['edit']>0) {
|
|
|
|
$query = sprintf("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE productId = %s", $db->mySQLSafe($_GET['edit']));
|
|
} else {
|
|
if (isset($_GET['orderCol']) && isset($_GET['orderDir'])) {
|
|
$orderBy = "I.".$_GET['orderCol']." ".$_GET['orderDir'];
|
|
} else {
|
|
$orderBy = "I.productId ASC";
|
|
}
|
|
|
|
$whereClause = '';
|
|
|
|
if (isset($_GET['searchStr']) && !empty($_GET['searchStr'])) {
|
|
$searchwords = split ( "[ ,]", $_GET['searchStr']);
|
|
|
|
foreach ($searchwords as $word) {
|
|
$searchArray[]=$word;
|
|
}
|
|
|
|
$noKeys = count($searchArray);
|
|
for ($i=0; $i<$noKeys;$i++) {
|
|
|
|
$ucSearchTerm = strtoupper($searchArray[$i]);
|
|
if (($ucSearchTerm !== "AND") && ($ucSearchTerm !== "OR")) {
|
|
$like .= "(I.name LIKE '%".$searchArray[$i]."%' OR I.description LIKE '%".$searchArray[$i]."%' OR I.productCode LIKE '%".$searchArray[$i]."%') OR ";
|
|
} else {
|
|
$like = substr($like,0,strlen($like)-3);
|
|
$like .= $ucSearchTerm;
|
|
}
|
|
}
|
|
$like = substr($like,0,strlen($like)-3);
|
|
$whereClause .= "WHERE ".$like;
|
|
}
|
|
|
|
if (isset($_GET['category']) && $_GET['category']>0) {
|
|
$whereClause .= (isset($like)) ? ' AND ' : ' WHERE ';
|
|
$whereClause .= "I.cat_id = ".$_GET['category'];
|
|
}
|
|
|
|
$query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory AS I INNER JOIN ".$glob['dbprefix']."CubeCart_category AS C ON I.cat_id = C.cat_id ".$whereClause." ORDER BY ".$orderBy;
|
|
}
|
|
|
|
// query database
|
|
$page = (isset($_GET['page'])) ? $_GET['page'] : 0;
|
|
|
|
$results = $db->select($query, $productsPerPage, $page);
|
|
$numrows = $db->numrows($query);
|
|
$pagination = paginate($numrows, $productsPerPage, $page, "page", "txtLink", 7, array('delete'));
|
|
|
|
}
|
|
|
|
$query = "SELECT cat_id, cat_name, cat_father_id, cat_desc FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id ASC";
|
|
$categoryArray = $db->select($query);
|
|
require($glob['adminFolder'].CC_DS."includes".CC_DS."header.inc.php");
|
|
?>
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
<tr>
|
|
<td nowrap='nowrap' class="pageTitle"><?php echo $lang['admin']['products_prod_inventory'];?></td>
|
|
<?php if(!isset($_GET["mode"])){ ?><td align="right" valign="middle"><a <?php if(permission("products","write")==TRUE){ ?>href="<?php echo $glob['adminFile']; ?>?_g=products/index&mode=new" class="txtLink" <?php } else { echo $link401; } ?>><img src="<?php echo $glob['adminFolder']; ?>/images/buttons/new.gif" alt="" hspace="4" border="0" title="" /><?php echo $lang['admin_common']['add_new'];?></a></td><?php } ?>
|
|
</tr>
|
|
</table>
|
|
|
|
<?php
|
|
if (isset($msg)) echo msg($msg);
|
|
|
|
if(!isset($_GET['mode']) && !isset($_GET['edit'])){
|
|
if ($results == true) {
|
|
?>
|
|
<p class="copyText"><?php echo $lang['admin']['products_current_prods_in_db'];?></p>
|
|
<form name="filter" method="get" action="<?php echo $glob['adminFile']; ?>">
|
|
<input type="hidden" name="_g" value="products/index" />
|
|
<p align="right" class="copyText">
|
|
<select name="category" class="textbox">
|
|
<option value="All" <?php if(isset($_GET['category']) && $_GET['category']=="All") echo "selected='selected'"; ?>><?php echo $lang['admin']['products_all_cats'];?></option>
|
|
<?php for ($i=0; $i<count($categoryArray); $i++){ ?>
|
|
<option value="<?php echo $categoryArray[$i]['cat_id']; ?>" <?php if(isset($_GET['category']) && $categoryArray[$i]['cat_id']==$_GET['category']) echo "selected='selected'"; ?>><?php echo getCatDir($categoryArray[$i]['cat_name'],$categoryArray[$i]['cat_father_id'], $categoryArray[$i]['cat_id']); ?></option>
|
|
<?php } ?>
|
|
</select>
|
|
<?php echo $lang['admin']['products_in']; ?>
|
|
<select name="orderCol" class="textbox">
|
|
<option value="name" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="name") echo "selected='selected'";?>><?php echo $lang['admin']['products_prod_name'];?></option>
|
|
<option value="productId" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="productId") echo "selected='selected'";?>><?php echo $lang['admin']['products_prod_id'];?></option>
|
|
<option value="productCode" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="productCode") echo "selected='selected'";?>><?php echo $lang['admin']['products_prod_code'];?></option>
|
|
<option value="cat_id" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="cat_id") echo "selected='selected'";?>><?php echo $lang['admin']['products_master_cat2'];?></option>
|
|
<option value="title" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="title") echo "selected='selected'";?>><?php echo $lang['admin']['products_title'];?></option>
|
|
<option value="stock_level" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="stock_level") echo "selected='selected'";?>><?php echo $lang['admin']['products_stock_level'];?></option>
|
|
<option value="price" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="price") echo "selected='selected'";?>><?php echo $lang['admin']['products_normal_price'];?></option>
|
|
<option value="sale_price" <?php if(isset($_GET['orderCol']) && $_GET['orderCol']=="sale_price") echo "selected='selected'";?>><?php echo $lang['admin']['products_sale_price'];?></option>
|
|
</select>
|
|
<?php echo $lang['admin']['products_by']; ?>
|
|
<select name="orderDir" class="textbox">
|
|
<option value="ASC" <?php if(isset($_GET['orderDir']) && $_GET['orderDir']=="ASC") echo "selected='selected'";?>><?php echo $lang['admin']['products_asc'];?></option>
|
|
<option value="DESC" <?php if(isset($_GET['orderDir']) && $_GET['orderDir']=="DESC") echo "selected='selected'";?>><?php echo $lang['admin']['products_desc'];?></option>
|
|
</select>
|
|
<?php echo $lang['admin']['products_containing_text'];?>
|
|
|
|
<input type="text" name="searchStr" class="textbox" value="<?php if(isset($_GET['searchStr']))echo $_GET['searchStr']; ?>" />
|
|
<input name="submit" type="submit" class="submit" value="<?php echo $lang['admin']['products_filter'];?>" />
|
|
<input name="Button" type="button" onclick="goToURL('parent','<?php echo $glob['adminFile']; ?>?_g=products/index');return document.returnValue" value="<?php echo $lang['admin']['products_reset'];?>" class="submit" />
|
|
</p>
|
|
</form>
|
|
<?php } ?>
|
|
<p class="copyText" style="text-align: right;"><?php echo $pagination; ?></p>
|
|
<form method="post" id="moveProducts" enctype="multipart/form-data">
|
|
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="mainTable">
|
|
<tr>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"> </td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_id'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_type'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_prod_code'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_name'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_master_cat2'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_image'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_price_sale_price'];?></td>
|
|
<td align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_in_stock'];?></td>
|
|
<td width="20%" colspan="3" align="center" nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['products_action'];?></td>
|
|
</tr>
|
|
<?php
|
|
if ($results == true) {
|
|
|
|
for ($i=0; $i<count($results); $i++){
|
|
|
|
$cellColor = "";
|
|
$cellColor = cellColor($i);
|
|
?>
|
|
<tr>
|
|
<td align="center" class="<?php echo $cellColor; ?>">
|
|
<input type="checkbox" name="product[]" class="productCheckbox" id="product_<?php echo $results[$i]['productId']; ?>" value="<?php echo $results[$i]['productId']; ?>" />
|
|
<input type="hidden" name="current[<?php echo $results[$i]['productId']; ?>]" value="<?php echo $results[$i]['cat_id']; ?>" />
|
|
</td>
|
|
<td align="center" class="<?php echo $cellColor; ?>"><span class="copyText"><?php echo $results[$i]['productId']; ?></span></td>
|
|
<td align="center" class="<?php echo $cellColor; ?>"><img src="<?php echo $glob['adminFolder']; ?>/images/productIcon<?php echo $results[$i]['digital'];?>.gif" alt="" width="16" height="16" title="" /></td>
|
|
<td align="left" class="<?php echo $cellColor; ?>"><span class="copyText"><?php echo $results[$i]['productCode']; ?></span></td>
|
|
<td align="left" class="<?php echo $cellColor; ?>"><span class="copyText"><?php echo $results[$i]['name']; ?></span></td>
|
|
<td class="<?php echo $cellColor; ?>"><span class="txtDir"><?php echo getCatDir($results[$i]['cat_name'], $results[$i]['cat_father_id'], $results[$i]['cat_id']);?></span><br />
|
|
<a href="javascript:;" <?php if (permission("products","edit")==TRUE){ ?>onclick="openPopUp('<?php echo $glob['adminFile'];?>?_g=products/extraCats&productId=<?php echo $results[$i]['productId']; ?>&cat_id=<?php echo $results[$i]['cat_id']; ?>&cat_father_id=<?php echo $results[$i]['cat_father_id']; ?>&cat_name=<?php echo urlencode($results[$i]['cat_name']); ?>&name=<?php echo urlencode($results[$i]['name']); ?>','extraCats',500,450,1);" class="txtLink"<?php } else { echo $link401; } ?>><?php echo $lang['admin']['products_manage_cats'];?></a></td>
|
|
|
|
<td align="center" valign="middle" class="<?php echo $cellColor; ?>">
|
|
<?php
|
|
$thumbPathRoot = imgPath($results[$i]['image'],$thumb=1,$path="root");
|
|
$thumbPathRel = imgPath($results[$i]['image'],$thumb=1,$path="rel");
|
|
|
|
$masterPathRoot = imgPath($results[$i]['image'],$thumb=0,$path="root");
|
|
$masterPathRel = imgPath($results[$i]['image'],$thumb=0,$path="rel");
|
|
|
|
if (file_exists($thumbPath) && !empty($results[$i]['image'])) {
|
|
$imgSize = getimagesize($thumbPath);
|
|
$imgFile = $thumbPathRel;
|
|
} else if (file_exists($masterPathRoot) && !empty($results[$i]['image'])) {
|
|
$imgSize = getimagesize($masterPathRoot);
|
|
$imgFile = $masterPathRel;
|
|
}
|
|
|
|
if (isset($imgFile) && !empty($imgFile)) {
|
|
?>
|
|
<img src="<?php echo $imgFile; ?>" alt="<?php echo $results[$i]['name']; ?>" title="" height="50" />
|
|
<div>
|
|
<?php
|
|
if (permission("products","edit") == true) {
|
|
$link = 'javascript:openPopUp(\'?_g=products/extraImgs&productId='.$results[$i]['productId'].'&img='.urlencode($results[$i]['image']).'\',\'extraImgs\',550,450,1);" class="txtLink"';
|
|
} else {
|
|
$link = $link401;
|
|
}
|
|
echo sprintf('<a href="%s">%s</a>', $link, $lang['admin']['products_manage_images']);
|
|
/*
|
|
<a href="#" <?php if(permission("products","edit")==TRUE){ ?>onclick="openPopUp('<?php echo $glob['adminFile'];?>?_g=products/extraImgs&productId=<?php echo $results[$i]['productId']; ?>&img=<?php echo urlencode($results[$i]['image']); ?>','extraImgs',550,450,1);" class="txtLink"<?php } else { echo $link401; } ?>><?php echo $lang['admin']['products_manage_images'];?></a></div>
|
|
<?php
|
|
*/
|
|
unset($imgFile);
|
|
} else {
|
|
echo " ";
|
|
}
|
|
?>
|
|
</td>
|
|
<td align="center" class="<?php echo $cellColor; ?>">
|
|
<span class="copyText"><?php echo priceFormat($results[$i]['price'], true); ?></span>
|
|
|
|
<?php
|
|
$salePrice = salePrice($results[$i]['price'], $results[$i]['sale_price']);
|
|
if ($salePrice) { ?>
|
|
<br />
|
|
<span class="txtRed">
|
|
<?php
|
|
echo priceFormat($salePrice,true);
|
|
?>
|
|
</span>
|
|
<?php } ?>
|
|
</td>
|
|
<td align="center" class="<?php echo $cellColor; ?>"><span class="copyText"><?php if($results[$i]['useStockLevel']==1) { echo $results[$i]['stock_level']; } else { echo "n/a"; }?></span></td>
|
|
<td align="center" width="5%" class="<?php echo $cellColor; ?>"><a <?php if(permission("products","edit")==TRUE){ ?>href="<?php echo $glob['adminFile']; ?>?_g=products/index&edit=<?php echo $results[$i]['productId']; ?>" class="txtLink"<?php } else { echo $link401; } ?>><?php echo $lang['admin_common']['edit'];?></a></td>
|
|
<td align="center" width="5%" class="<?php echo $cellColor; ?>"><a <?php if(permission("products","delete")==TRUE){ ?>href="<?php echo $glob['adminFile']; ?>?_g=products/index&delete=<?php echo $results[$i]['productId']; ?>&cat_id=<?php echo $results[$i]['cat_id']; ?>" onclick="return confirm('<?php echo str_replace("\n", '\n', $lang['admin_common']['delete_q']);?>')" class="txtLink"<?php } else { echo $link401; } ?>><?php echo $lang['admin_common']['delete'];?></a></td>
|
|
<td align="center" width="5%" class="<?php echo $cellColor; ?>"><a <?php if(permission("products","edit")==TRUE){ ?>href="<?php echo $glob['adminFile']; ?>?_g=products/languages&prod_master_id=<?php echo $results[$i]['productId']; ?>" class="txtLink"<?php } else { echo $link401; } ?>><?php echo $lang['admin']['products_languages'];?></a></td>
|
|
</tr>
|
|
<?php } // end loop ?>
|
|
<tr>
|
|
<td><img src="admin/images/selectAll.gif" alt="" width="16" height="11" /></td>
|
|
<td colspan="9" class="tdText">
|
|
<a href="#" class="txtLink" onclick="return checkUncheck('moveProducts', 'productCheckbox');"><?php echo $lang['admin']['products_check_uncheck_all'];?></a>
|
|
<select name="MoveTo" class="textbox">
|
|
<option value="" selected="selected"><?php echo $lang['admin']['products_move_selected_to'];?>
|
|
<?php
|
|
## ADD CATEGORY CACHING HERE
|
|
$catCache = new cache('menu.category.'.$config['defaultLang']);
|
|
if ($catCache->cacheStatus) {
|
|
$catList = $catCache->readCache();
|
|
$catList = str_replace('selected="selected"', '', $catList);
|
|
$catList = str_replace('value="'.$results[0]['cat_id'].'"', 'value="'.$results[0]['cat_id'].'" selected="selected"', $catList);
|
|
echo $catList;
|
|
} else {
|
|
for ($i=0; $i<count($categoryArray); $i++){
|
|
if ($categoryArray[$i]['cat_desc'] != '##HIDDEN##') {
|
|
$cat_id = $categoryArray[$i]['cat_id'];
|
|
$selected = (isset($results[0]['cat_id']) && $categoryArray[$i]['cat_id']==$results[0]['cat_id']) ? ' selected="selected"' : '';
|
|
$cat_dir = getCatDir($categoryArray[$i]['cat_name'],$categoryArray[$i]['cat_father_id'], $categoryArray[$i]['cat_id']);
|
|
$catList[] = sprintf('<option value="%d"%s>%s</option>', $cat_id, $selected, $cat_dir);
|
|
}
|
|
}
|
|
$catCache->writeCache(implode("\n", $catList));
|
|
echo implode("\n", $catList);
|
|
}
|
|
?>
|
|
</select>
|
|
<input type="submit" name="EditSelected" class="submit" value="<?php echo $lang['admin']['products_go'];?>" />
|
|
<input type="submit" name="DeleteSelected" class="submit" value="Delete Selected" />
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
} else { ?>
|
|
<tr>
|
|
<td colspan="10" class="tdText"><?php echo $lang['admin']['products_no_products_exist'];?></td>
|
|
</tr>
|
|
<?php } ?>
|
|
</table>
|
|
|
|
</form>
|
|
|
|
<p class="copyText" style="text-align: right;"><?php echo $pagination; ?></p>
|
|
|
|
<?php
|
|
if(isset($msg2))
|
|
{
|
|
echo msg($msg2);
|
|
}
|
|
?>
|
|
<form id="update_prices" name="update_prices" method="post" action="<?php echo $glob['adminFile']; ?>?_g=products/index">
|
|
<table border="0" cellspacing="1" cellpadding="3" class="mainTable">
|
|
<tr>
|
|
<td colspan="3" class="tdTitle"><?php echo $lang['admin']['products_update_prices_by_cat']; ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" class="tdText" width="100"><strong><?php echo $lang['admin']['products_normal_price2']; ?></strong></td>
|
|
<td colspan="2" align="left" class="tdText"><strong>
|
|
<input name="normPer" type="text" size="5" maxlength="5" />
|
|
<select name="normPerMethod">
|
|
<option value="percent"><?php echo $lang['admin']['products_val_percent']; ?></option>
|
|
<option value="value"><?php echo $lang['admin']['products_val_amount']; ?></option>
|
|
</select>
|
|
<?php echo $lang['admin']['products_sale_price2']; ?></strong>
|
|
<input name="salePer" type="text" size="5" maxlength="5" /> <select name="salePerMethod">
|
|
<option value="percent"><?php echo $lang['admin']['products_val_percent']; ?></option>
|
|
<option value="value"><?php echo $lang['admin']['products_val_percent']; ?></option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" class="tdText" width="100"><strong><?php echo $lang['admin']['products_category']; ?></strong><br />
|
|
|
|
<?php echo $lang['admin']['products_hold_ctrl']; ?></td>
|
|
<td align="left" valign="top" class="tdText"><select name="cat_id_price[]" size="5" multiple="multiple" class="textbox">
|
|
<option value="0">-- <?php echo $lang['admin_common']['all']; ?> --</option>
|
|
<?php
|
|
|
|
## ADD CATEGORY CACHING HERE
|
|
$catCache = new cache('menu.category.'.$config['defaultLang']);
|
|
if ($catCache->cacheStatus) {
|
|
$catList = $catCache->readCache();
|
|
$catList = str_replace('selected="selected"', '', $catList);
|
|
$catList = str_replace('value="'.$results[0]['cat_id'].'"', 'value="'.$results[0]['cat_id'].'" selected="selected"', $catList);
|
|
echo $catList;
|
|
} else {
|
|
for ($i=0; $i<count($categoryArray); $i++){
|
|
if ($categoryArray[$i]['cat_desc'] != '##HIDDEN##') {
|
|
$cat_id = $categoryArray[$i]['cat_id'];
|
|
$selected = (isset($results[0]['cat_id']) && $categoryArray[$i]['cat_id']==$results[0]['cat_id']) ? ' selected="selected"' : '';
|
|
$cat_dir = getCatDir($categoryArray[$i]['cat_name'],$categoryArray[$i]['cat_father_id'], $categoryArray[$i]['cat_id']);
|
|
$catList[] = sprintf('<option value="%d"%s>%s</option>', $cat_id, $selected, $cat_dir);
|
|
}
|
|
}
|
|
$catCache->writeCache(implode("\n", $catList));
|
|
echo implode("\n", $catList);
|
|
}
|
|
?>
|
|
</select></td>
|
|
<td align="right" valign="bottom" class="tdText"><input type="submit" name="submit_prices" value="<?php echo $lang['admin']['products_update_prices']; ?>" class="submit" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" align="left" class="tdText">
|
|
<?php echo $lang['admin']['products_eg_1']; ?><br />
|
|
<?php echo $lang['admin']['products_eg_2']; ?></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<?php
|
|
} else if ($_GET["mode"] == "new" || $_GET["edit"]>0) {
|
|
|
|
if(isset($_GET["edit"]) && $_GET["edit"]>0){ $modeTxt = $lang['admin_common']['edit']; } else { $modeTxt = $lang['admin_common']['add']; }
|
|
?>
|
|
<p class="copyText"><?php echo $lang['admin']['products_add_prod_desc'];?></p>
|
|
<form action="<?php echo $glob['adminFile']; ?>?_g=products/index" method="post" enctype="multipart/form-data" name="form1" language="javascript">
|
|
<table border="0" cellspacing="1" cellpadding="3" class="mainTable">
|
|
<tr>
|
|
<td colspan="2" class="tdTitle"><?php if(isset($_GET["edit"]) && $_GET["edit"]>0){ echo $modeTxt; } else { echo $modeTxt; } echo " ".$lang['admin']['products_product'];?> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_prod_name2'];?></strong></td>
|
|
<td>
|
|
<input name="name" type="text" class="textbox" value="<?php if(isset($results[0]['name'])) echo validHTML($results[0]['name']); ?>" maxlength="255" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_disable'];?></strong></td>
|
|
<td>
|
|
<select name="disabled" class="textbox">
|
|
<option value="1" <?php if (isset($results[0]['disabled']) && $results[0]['disabled']==1) echo 'selected="selected"'; ?>><?php echo $lang['admin_common']['yes'];?></option>
|
|
<option value="0" <?php if (!isset($results[0]['disabled']) || $results[0]['disabled']==0) echo 'selected="selected"'; ?>><?php echo $lang['admin_common']['no'];?></option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_prod_stock_no'];?></strong> <br />
|
|
<?php echo $lang['admin']['products_auto_generated'];?>
|
|
</td>
|
|
<td><input name="productCode" type="text" class="textbox" value="<?php if(isset($results[0]['productCode'])) echo $results[0]['productCode']; ?>" maxlength="255" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_ean_upc'];?></strong>
|
|
</td>
|
|
<td><input name="eanupcCode" type="text" class="textbox" value="<?php if(isset($results[0]['eanupcCode'])) echo $results[0]['eanupcCode']; ?>" maxlength="17" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" class="tdRichText"><span class="tdText"><strong><?php echo $lang['admin']['products_description'];?></strong> <?php echo $lang['admin']['products_primary_lang'];?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" class="tdRichText">
|
|
<?php
|
|
require($glob['adminFolder']."/includes".CC_DS."rte".CC_DS."fckeditor.php");
|
|
|
|
$oFCKeditor = new FCKeditor('FCKeditor');
|
|
$oFCKeditor->BasePath = $GLOBALS['rootRel'].$glob['adminFolder'].'/includes/rte/' ;
|
|
$oFCKeditor->Value = (isset($results[0]['description'])) ? $results[0]['description'] : '';
|
|
|
|
if (!$config['richTextEditor']) $oFCKeditor->off = true;
|
|
$oFCKeditor->Create();
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_category'];?></strong></td>
|
|
<td>
|
|
<select name="cat_id" class="textbox">
|
|
<?php
|
|
## ADD CATEGORY CACHING HERE
|
|
$catCache = new cache('menu.category.'.$config['defaultLang']);
|
|
if ($catCache->cacheStatus) {
|
|
$catList = $catCache->readCache();
|
|
$catList = str_replace('selected="selected"', '', $catList);
|
|
$catList = str_replace('value="'.$results[0]['cat_id'].'"', 'value="'.$results[0]['cat_id'].'" selected="selected"', $catList);
|
|
echo $catList;
|
|
} else {
|
|
for ($i=0; $i<count($categoryArray); $i++){
|
|
if ($categoryArray[$i]['cat_desc'] != '##HIDDEN##') {
|
|
$cat_id = $categoryArray[$i]['cat_id'];
|
|
$selected = (isset($results[0]['cat_id']) && $categoryArray[$i]['cat_id']==$results[0]['cat_id']) ? ' selected="selected"' : '';
|
|
$cat_dir = getCatDir($categoryArray[$i]['cat_name'],$categoryArray[$i]['cat_father_id'], $categoryArray[$i]['cat_id']);
|
|
$catList[] = sprintf('<option value="%d"%s>%s</option>', $cat_id, $selected, $cat_dir);
|
|
}
|
|
}
|
|
$catCache->writeCache(implode("\n", $catList));
|
|
echo implode("\n", $catList);
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['products_image2'];?></strong> <br />
|
|
<?php echo $lang['admin']['products_opt_and_thumbs'];?></td>
|
|
<td valign="top">
|
|
<?php
|
|
$imgSrc = (!empty($results[0]['image'])) ? imgPath($results[0]['image'], 0, 'rel') : $glob['rootRel'].'images/admin/blank.gif';
|
|
?>
|
|
<img src="<?php echo $imgSrc; ?>" alt="" id="previewImage" title="" />
|
|
<div>
|
|
|
|
<input name="upload" class="submit" type="button" id="upload" onclick="openPopUp('<?php echo $glob['adminFolder']; ?>/includes/rte/editor/filemanager/browser/default/browser.php?Type=uploads&Connector=connectors/php/connector.php','filemanager',700,600)" value="<?php echo $lang['admin']['products_browse_upload_image'];?>" />
|
|
<input type="button" class="submit" value="<?php echo $lang['admin']['product_remove_image'];?>" onclick="findObj('previewImage').src='<?php echo $glob['adminFolder']; ?>/images/general/px.gif';findObj('imageName').value = '';" />
|
|
<input type="hidden" name="imageName" id="imageName" value="<?php if(isset($results[0]['image'])) echo $results[0]['image']; ?>" />
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
<?php
|
|
// Flexible Taxes, by Estelle Winterflood
|
|
$config_tax_mod = fetchDbConfig("Multiple_Tax_Mod");
|
|
?>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_normal_price2']; if ($config_tax_mod['status']) echo $lang['admin']['settings_excl_tax']; ?> </strong>
|
|
</td>
|
|
<td><input name="price" value="<?php if(isset($results[0]['price'])) echo $results[0]['price']; ?>" type="text" class="textbox" size="10" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%" class="tdText"><strong><?php echo $lang['admin']['products_sale_price2']; if ($config_tax_mod['status']) echo $lang['admin']['settings_excl_tax']; ?> </strong><br />
|
|
<?php echo $lang['admin']['products_sale_mode_desc'];?> </td>
|
|
<td><input name="sale_price" value="<?php if(isset($results[0]['sale_price'])) echo $results[0]['sale_price']; ?>" type="text" class="textbox" size="10" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td><strong><?php echo $lang['admin']['products_tax_inclusive'];?></strong></td>
|
|
<td><input name="tax_inclusive" value="1" type="checkbox" <?php if ($results[0]['tax_inclusive']) echo 'checked="checked" '; ?>/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_tax_class'];?></strong></td>
|
|
<td class="tdText">
|
|
<select name="taxType">
|
|
<?php
|
|
$taxTypes = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_taxes");
|
|
for($i=0; $i<count($taxTypes);$i++){ ?>
|
|
<option value="<?php echo $taxTypes[$i]['id']; ?>" <?php if(isset($results[0]['taxType']) && $taxTypes[$i]['id'] == $results[0]['taxType']) echo "selected='selected'"; ?>><?php echo $taxTypes[$i]['taxName']; if (! $config_tax_mod['status']) echo "(".$taxTypes[$i]['percent']."%)"; ?></option>
|
|
<?php } ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_prod_weight'];?></strong></td>
|
|
<td class="tdText"><input name="prodWeight" type="text" class="textbox" size="10" value="<?php if(isset($results[0]['prodWeight'])) echo $results[0]['prodWeight']; ?>" /> <?php echo $config['weightUnit']; ?></td>
|
|
</tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_stock_level2'];?><br />
|
|
</strong><?php echo $lang['admin']['products_reduce_stock_level'];?> </td>
|
|
<td class="tdText"><input name="stock_level" value="<?php if(isset($results[0]['stock_level'])) echo $results[0]['stock_level']; ?>" type="text" class="textbox" size="10" /></td>
|
|
</tr>
|
|
<?php
|
|
if ($config['stock_warn_type']) {
|
|
?>
|
|
<tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_stock_level_warn'];?><br />
|
|
</strong> </td>
|
|
<td class="tdText"><input name="stockWarn" value="<?php if(isset($results[0]['stockWarn'])) echo $results[0]['stockWarn']; ?>" type="text" class="textbox" size="10" /></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_use_stock_q'];?></strong></td>
|
|
<td class="tdText">
|
|
<?php echo $lang['admin_common']['yes'];?>
|
|
<input name="useStockLevel" type="radio" value="1" <?php if(isset($results[0]['useStockLevel']) && $results[0]['useStockLevel'] || !isset($results[0]['useStockLevel'])) echo "checked='checked'"; ?> />
|
|
<?php echo $lang['admin_common']['no'];?>
|
|
<input name="useStockLevel" type="radio" value="0" <?php if(isset($results[0]['useStockLevel']) && !$results[0]['useStockLevel']) echo "checked='checked'"; ?> /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdText" valign="top"><strong><?php echo $lang['admin']['products_product_type'];?></strong>
|
|
</td>
|
|
<td class="tdText"><?php echo $lang['admin']['products_tangible'];?><span class="tdText">
|
|
<input name="digital" onclick="digitalDir.className='hiddenTextbox';digitalDir.value=''" type="radio" value="0" <?php if(isset($results[0]['digital']) && !$results[0]['digital'] || !isset($results[0]['digital'])) echo "checked='checked'"; ?> />
|
|
</span> <?php echo $lang['admin']['products_digital'];?><span class="tdText">
|
|
<input name="digital" onclick="digitalDir.className='dirTextbox'" type="radio" value="1" <?php if(isset($results[0]['digital']) && $results[0]['digital']) echo "checked='checked'"; ?> />
|
|
|
|
<input name="digitalDir" type="text" id="digitalDir" value="<?php if(isset($results[0]['digitalDir'])) echo $results[0]['digitalDir']; ?>" maxlength="255" <?php if(isset($results[0]['digitalDir']) && $results[0]['digital']==1) { echo "class='dirTextbox'"; } else { ?>class="hiddenTextbox" <?php } ?> />
|
|
<br />
|
|
<?php echo $lang['admin']['products_digi_path'];?></span></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="tdText"><strong><?php echo $lang['admin']['products_show_featured'];?></strong></td>
|
|
<td class="tdText">
|
|
<select name="showFeatured" class="textbox">
|
|
<option value="1" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==1) echo "selected='selected'"; ?>><?php echo $lang['admin_common']['yes'];?></option>
|
|
<option value="0" <?php if(isset($results[0]['showFeatured']) && $results[0]['showFeatured']==0) echo "selected='selected'"; ?>><?php echo $lang['admin_common']['no'];?></option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%"> </td>
|
|
<td>
|
|
<input type="hidden" name="oldCatId" value="<?php if(isset($results[0]['cat_id'])) echo $results[0]['cat_id']; ?>" />
|
|
<input type="hidden" name="productId" value="<?php if(isset($results[0]['productId'])) echo $results[0]['productId']; ?>" />
|
|
<input name="Submit" type="submit" class="submit" value="<?php echo $modeTxt." ".$lang['admin']['products_product'];?>" /></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<?php
|
|
if($config['seftags'])
|
|
{
|
|
?>
|
|
<br />
|
|
<table border="0" cellspacing="1" cellpadding="3" class="mainTable" width="100%">
|
|
<tr>
|
|
<td colspan="2" class="tdTitle"><strong><?php echo $lang['admin']['products_meta_data'];?></strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30%" class="tdText"><strong><?php echo $lang['admin']['products_browser_title'];?></strong></td>
|
|
<td align="left"><input name="prod_metatitle" type="text" size="35" class="textbox" value="<?php if(isset($results[0]['prod_metatitle'])) echo $results[0]['prod_metatitle']; ?>" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['products_meta_desc'];?></strong></td>
|
|
<td align="left"><textarea name="prod_metadesc" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['prod_metadesc'])) echo $results[0]['prod_metadesc']; ?></textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30%" align="left" valign="top" class="tdText"><strong><?php echo $lang['admin']['products_meta_keywords'];?></strong> <?php echo $lang['admin']['settings']['comma_separated'];?></td>
|
|
<td align="left"><textarea name="prod_metakeywords" cols="35" rows="3" class="textbox"><?php if(isset($results[0]['prod_metakeywords'])) echo $results[0]['prod_metakeywords']; ?></textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="25%"> </td>
|
|
<td>
|
|
<input name="Submit" type="submit" class="submit" value="<?php echo $modeTxt." ".$lang['admin']['products_product'];?>" /></td>
|
|
</tr>
|
|
</table>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<br />
|
|
|
|
<div class="tdText"><em><u><strong><?php echo $lang['admin']['products_digi_info'];?></strong></u></em>
|
|
<?php echo $lang['admin']['products_digi_desc'];?>
|
|
</div>
|
|
</form>
|
|
<?php
|
|
}
|
|
?>
|