<?php
/* --------------------------------------------------------------
GMGPrintProductManager.php 2009-11-25 mb
Gambio GmbH
http://www.gambio.de
Copyright (c) 2009 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
?><?php
class GMGPrintProductManager
{
function GMGPrintProductManager()
{
//
}
function get_surfaces_groups_id($p_products_id)
{
$c_products_id = (int)$p_products_id;
$t_surfaces_groups_id = false;
$t_get_surfaces_groups_id = xtc_db_query("SELECT gm_gprint_surfaces_groups_id
FROM " . TABLE_GM_GPRINT_SURFACES_GROUPS_TO_PRODUCTS . "
WHERE products_id = '" . $c_products_id . "'");
if(xtc_db_num_rows($t_get_surfaces_groups_id) == 1)
{
$t_gprint_data = xtc_db_fetch_array($t_get_surfaces_groups_id);
$t_surfaces_groups_id = $t_gprint_data['gm_gprint_surfaces_groups_id'];
}
return $t_surfaces_groups_id;
}
function add($p_surfaces_groups_id, $p_products_id)
{
$c_surfaces_groups_id = (int)$p_surfaces_groups_id;
$c_products_id = (int)$p_products_id;
$t_delete = xtc_db_query("DELETE FROM " . TABLE_GM_GPRINT_SURFACES_GROUPS_TO_PRODUCTS . "
WHERE products_id = '" . $c_products_id . "'");
$t_insert = xtc_db_query("INSERT INTO " . TABLE_GM_GPRINT_SURFACES_GROUPS_TO_PRODUCTS . "
SET gm_gprint_surfaces_groups_id = '" . $c_surfaces_groups_id . "',
products_id = '" . $c_products_id . "'");
}
function remove($p_products_id)
{
$c_products_id = (int)$p_products_id;
$t_delete = xtc_db_query("DELETE FROM " . TABLE_GM_GPRINT_SURFACES_GROUPS_TO_PRODUCTS . "
WHERE products_id = '" . $c_products_id . "'");
}
function get_surfaces_groups()
{
$t_surfaces_groups = array();
$t_get_surfaces_groups = xtc_db_query("SELECT
gm_gprint_surfaces_groups_id,
name
FROM " . TABLE_GM_GPRINT_SURFACES_GROUPS . "
ORDER BY name");
while($t_surfaces_groups_data = xtc_db_fetch_array($t_get_surfaces_groups))
{
$t_surfaces_groups[] = array('ID' => $t_surfaces_groups_data['gm_gprint_surfaces_groups_id'],
'NAME' => $t_surfaces_groups_data['name']);
}
return $t_surfaces_groups;
}
function save_category($p_categories_id, $p_surfaces_groups_id, $p_include_subcategories = false, $p_remove = false)
{
$c_categories_id = (int)$p_categories_id;
$c_surfaces_groups_id = (int)$p_surfaces_groups_id;
$t_get_products = xtc_db_query("SELECT products_id
FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "
WHERE categories_id = '" . $c_categories_id . "'");
while($t_products = xtc_db_fetch_array($t_get_products))
{
if(!$p_remove && $c_surfaces_groups_id > 0)
{
$this->add($c_surfaces_groups_id, $t_products['products_id']);
}
elseif($p_remove)
{
$this->remove($t_products['products_id']);
}
}
if($p_include_subcategories)
{
$t_gm_gprint_categories = $this->get_categories($c_categories_id);
for($i = 0; $i < count($t_gm_gprint_categories); $i++)
{
$t_get_products = xtc_db_query("SELECT products_id
FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "
WHERE categories_id = '" . (int)$t_gm_gprint_categories[$i] . "'");
while($t_products = xtc_db_fetch_array($t_get_products))
{
if(!$p_remove && $c_surfaces_groups_id > 0)
{
$this->add($c_surfaces_groups_id, $t_products['products_id']);
}
elseif($p_remove)
{
$this->remove($t_products['products_id']);
}
}
}
}
}
function get_categories($p_parent_id, $p_categories_array = false)
{
$c_parent_id = (int)$p_parent_id;
if (!is_array($p_categories_array))
{
$t_categories_array = array();
}
else
{
$t_categories_array = $p_categories_array;
}
$t_get_categories = xtc_db_query("SELECT
categories_id
FROM " . TABLE_CATEGORIES . "
WHERE parent_id = '" . $c_parent_id . "'");
while($t_categories = xtc_db_fetch_array($t_get_categories))
{
$t_categories_array[] = $t_categories['categories_id'];
if($t_categories['categories_id'] != $c_parent_id)
{
$t_categories_array = $this->get_categories($t_categories['categories_id'], $t_categories_array);
}
}
return $t_categories_array;
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| csstidy/ | 2013-11-12 21:03 | 125.89 KB | 76129f60960:kunden | dxwrx-rx-r | |
| lib/ | 2013-11-12 21:03 | 601.96 KB | 76129f60960:kunden | dxwrx-rx-r | |
| ErrorHandler.php | 2013-11-12 21:03 | 10.34 KB | 76129f60960:kunden | -xw-x----- | |
| FileLog.php | 2013-11-12 21:02 | 2.93 KB | 76129f60960:kunden | -xw-x----- | |
| GMAltText.php | 2013-11-12 21:03 | 2.94 KB | 76129f60960:kunden | -xw-x----- | |
| GMAttributesCalculator.php | 2013-11-12 21:03 | 4.65 KB | 76129f60960:kunden | -xw-x----- | |
| GMCSSMonitor.php | 2013-11-12 21:03 | 13.19 KB | 76129f60960:kunden | -xw-x----- | |
| GMCSSOptimizer.php | 2013-11-12 21:03 | 32.87 KB | 76129f60960:kunden | -xw-x----- | |
| GMCat.php | 2013-11-12 21:03 | 9.08 KB | 76129f60960:kunden | -xw-x----- | |
| GMCounter.php | 2013-11-12 21:03 | 17.05 KB | 76129f60960:kunden | -xw-x----- | |
| GMEbay.php | 2013-11-12 21:02 | 9.16 KB | 76129f60960:kunden | -xw-x----- | |
| GMGMotion.php | 2013-11-12 21:02 | 24.31 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintCartManager.php | 2013-11-12 21:03 | 14.66 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintConfiguration.php | 2013-11-12 21:03 | 2.17 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintContentManager.php | 2013-11-12 21:02 | 8.79 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintElements.php | 2013-11-12 21:03 | 15.79 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintFileManager.php | 2013-11-12 21:02 | 6.06 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderElements.php | 2013-11-12 21:03 | 7.46 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderManager.php | 2013-11-12 21:03 | 6.27 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderSurfaces.php | 2013-11-12 21:03 | 6.41 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintOrderSurfacesManager.php | 2013-11-12 21:03 | 4.86 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintProductManager.php | 2013-11-12 21:02 | 4.55 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfaces.php | 2013-11-12 21:03 | 9.99 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfacesGroupsManager.php | 2013-11-12 21:03 | 1.96 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintSurfacesManager.php | 2013-11-12 21:03 | 9.62 KB | 76129f60960:kunden | -xw-x----- | |
| GMGPrintWishlistManager.php | 2013-11-12 21:03 | 14.81 KB | 76129f60960:kunden | -xw-x----- | |
| GMJSON.php | 2013-11-12 21:03 | 2.44 KB | 76129f60960:kunden | -xw-x----- | |
| GMJanolaw.php | 2013-11-12 21:03 | 3.76 KB | 76129f60960:kunden | -xw-x----- | |
| GMLangFileMaster.php | 2013-11-12 21:03 | 965 B | 76129f60960:kunden | -xw-x----- | |
| GMLightboxControl.php | 2013-11-12 21:03 | 691 B | 76129f60960:kunden | -xw-x----- | |
| GMLogoManager.php | 2013-11-12 21:03 | 6.78 KB | 76129f60960:kunden | -xw-x----- | |
| GMMeta.php | 2013-11-12 21:02 | 8.29 KB | 76129f60960:kunden | -xw-x----- | |
| GMProduct.php | 2013-11-12 21:03 | 2.37 KB | 76129f60960:kunden | -xw-x----- | |
| GMSEOBoost.php | 2013-11-12 21:03 | 25.63 KB | 76129f60960:kunden | -xw-x----- | |
| GMSitemap.php | 2013-11-12 21:03 | 5.32 KB | 76129f60960:kunden | -xw-x----- | |
| GMStatusbar.php | 2013-11-12 21:02 | 2.46 KB | 76129f60960:kunden | -xw-x----- | |
| GMTSWidget.php | 2013-11-12 21:03 | 4.93 KB | 76129f60960:kunden | -xw-x----- | |
| GMTabTokenizer.php | 2013-11-12 21:03 | 2.81 KB | 76129f60960:kunden | -xw-x----- | |
| GMTracker.php | 2013-11-12 21:03 | 3.49 KB | 76129f60960:kunden | -xw-x----- | |
| JSON.php | 2013-11-12 21:03 | 39.98 KB | 76129f60960:kunden | -xw-x----- | |
| application_top.php | 2013-11-12 21:03 | 34.02 KB | 76129f60960:kunden | -xw-x----- | |