<?php
/* --------------------------------------------------------------
GMGPrintContentManager.php 2009-12-10 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 GMGPrintContentManager
{
function GMGPrintContentManager()
{
//
}
function get_content($p_product, $p_source, $p_format = false)
{
$t_content = array();
switch($p_source)
{
case 'cart':
if(isset($_SESSION['coo_gprint_cart']->v_elements[$p_product]))
{
foreach($_SESSION['coo_gprint_cart']->v_elements[$p_product] AS $p_elements_id => $p_value)
{
$c_elements_id = (int)$p_elements_id;
$t_content_name = '';
$c_languages_id = (int)$_SESSION['languages_id'];
$c_value = mysql_real_escape_string(stripslashes($p_value));
$t_get_name = xtc_db_query("SELECT
v.name
FROM
" . TABLE_GM_GPRINT_ELEMENTS . " e,
" . TABLE_GM_GPRINT_ELEMENTS_GROUPS . " g,
" . TABLE_GM_GPRINT_ELEMENTS_VALUES. " v
WHERE
(e.gm_gprint_elements_id = '" . $c_elements_id . "'
AND e.gm_gprint_elements_groups_id = v.gm_gprint_elements_groups_id
AND e.gm_gprint_elements_groups_id = g.gm_gprint_elements_groups_id
AND g.group_type != 'dropdown'
AND languages_id = '" . $c_languages_id . "')
OR
(e.gm_gprint_elements_id = '" . $c_elements_id . "'
AND e.gm_gprint_elements_groups_id = g.gm_gprint_elements_groups_id
AND g.group_type = 'dropdown'
AND e.gm_gprint_elements_groups_id = v.gm_gprint_elements_groups_id
AND languages_id = '" . $c_languages_id . "'
AND elements_value = '" . $c_value . "')
GROUP BY e.gm_gprint_elements_id");
if(xtc_db_num_rows($t_get_name) == 1)
{
$t_name = xtc_db_fetch_array($t_get_name);
$t_content_name = $t_name['name'];
$coo_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
$t_character_length = (int)$coo_configuration->get_configuration('CHARACTER_LENGTH');
if(strlen($p_value) > $t_character_length && $t_character_length > 0)
{
$t_value = substr($p_value, 0, $t_character_length) . '...';
}
else
{
$t_value = $p_value;
}
if(isset($_SESSION['coo_gprint_cart']->v_files[$p_product][$p_elements_id]))
{
$t_uploads_id = (int)$_SESSION['coo_gprint_cart']->v_files[$p_product][$p_elements_id];
$t_get_key = xtc_db_query("SELECT download_key
FROM " . TABLE_GM_GPRINT_UPLOADS . "
WHERE gm_gprint_uploads_id = '" . $t_uploads_id . "'");
if(xtc_db_num_rows($t_get_key) == 1)
{
$t_key = xtc_db_fetch_array($t_get_key);
$t_value = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'gm_gprint_download.php?key=' . $t_key['download_key'] . '"><u>' . $t_value . '</u></a>';
}
}
$t_content[] = array('NAME' => $t_content_name, 'VALUE' => $t_value);
}
}
}
break;
case 'wishlist':
if(isset($_SESSION['coo_gprint_wishlist']->v_elements[$p_product]))
{
foreach($_SESSION['coo_gprint_wishlist']->v_elements[$p_product] AS $p_elements_id => $p_value)
{
$c_elements_id = (int)$p_elements_id;
$t_content_name = '';
$c_languages_id = (int)$_SESSION['languages_id'];
$c_value = mysql_real_escape_string(stripslashes($p_value));
$t_get_name = xtc_db_query("SELECT
v.name
FROM
" . TABLE_GM_GPRINT_ELEMENTS . " e,
" . TABLE_GM_GPRINT_ELEMENTS_GROUPS . " g,
" . TABLE_GM_GPRINT_ELEMENTS_VALUES. " v
WHERE
(e.gm_gprint_elements_id = '" . $c_elements_id . "'
AND e.gm_gprint_elements_groups_id = v.gm_gprint_elements_groups_id
AND e.gm_gprint_elements_groups_id = g.gm_gprint_elements_groups_id
AND g.group_type != 'dropdown'
AND languages_id = '" . $c_languages_id . "')
OR
(e.gm_gprint_elements_id = '" . $c_elements_id . "'
AND e.gm_gprint_elements_groups_id = g.gm_gprint_elements_groups_id
AND g.group_type = 'dropdown'
AND e.gm_gprint_elements_groups_id = v.gm_gprint_elements_groups_id
AND languages_id = '" . $c_languages_id . "'
AND elements_value = '" . $c_value . "')
GROUP BY e.gm_gprint_elements_id");
if(xtc_db_num_rows($t_get_name) == 1)
{
$t_name = xtc_db_fetch_array($t_get_name);
$t_content_name = $t_name['name'];
$coo_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
$t_character_length = (int)$coo_configuration->get_configuration('CHARACTER_LENGTH');
if(strlen($p_value) > $t_character_length && $t_character_length > 0)
{
$t_value = substr($p_value, 0, $t_character_length) . '...';
}
else
{
$t_value = $p_value;
}
if(isset($_SESSION['coo_gprint_wishlist']->v_files[$p_product][$p_elements_id]))
{
$t_uploads_id = (int)$_SESSION['coo_gprint_wishlist']->v_files[$p_product][$p_elements_id];
$t_get_key = xtc_db_query("SELECT download_key
FROM " . TABLE_GM_GPRINT_UPLOADS . "
WHERE gm_gprint_uploads_id = '" . $t_uploads_id . "'");
if(xtc_db_num_rows($t_get_key) == 1)
{
$t_key = xtc_db_fetch_array($t_get_key);
$t_value = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'gm_gprint_download.php?key=' . $t_key['download_key'] . '"><u>' . $t_value . '</u></a>';
}
}
$t_content[] = array('NAME' => $t_content_name, 'VALUE' => $t_value);
}
}
}
break;
}
if($p_format)
{
$t_content_html = '';
for($i = 0; $i < count($t_content); $i++)
{
$t_content_html .= '<strong>' . $t_content[$i]['NAME'] . '</strong>: ' . $t_content[$i]['VALUE'] . '<br />';
}
$t_content = $t_content_html;
}
return $t_content;
}
function get_orders_products_content($p_order_products_id, $p_shorten = false)
{
$c_order_products_id = (int)$p_order_products_id;
$t_content = array();
$t_get_elements_data = xtc_db_query("SELECT
e.name,
e.elements_value,
e.gm_gprint_uploads_id,
u.download_key
FROM
" . TABLE_GM_GPRINT_ORDERS_SURFACES_GROUPS . " g,
" . TABLE_GM_GPRINT_ORDERS_SURFACES . " s,
" . TABLE_GM_GPRINT_ORDERS_ELEMENTS . " e
LEFT JOIN " . TABLE_GM_GPRINT_UPLOADS . " AS u ON (e.gm_gprint_uploads_id = u.gm_gprint_uploads_id)
WHERE
g.orders_products_id = '" . $c_order_products_id . "'
AND g.gm_gprint_orders_surfaces_groups_id
AND g.gm_gprint_orders_surfaces_groups_id = s.gm_gprint_orders_surfaces_groups_id
AND s.gm_gprint_orders_surfaces_id = e.gm_gprint_orders_surfaces_id
AND e.group_type IN ('text_input', 'textarea', 'file', 'dropdown')");
while($t_elements_data = xtc_db_fetch_array($t_get_elements_data))
{
$t_value = $t_elements_data['elements_value'];
if($p_shorten)
{
$coo_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
$t_character_length = (int)$coo_configuration->get_configuration('CHARACTER_LENGTH');
if(strlen($t_value) > $t_character_length && $t_character_length > 0)
{
$t_value = substr($t_value, 0, $t_character_length) . '...';
}
}
$t_content[] = array('NAME' => $t_elements_data['name'],
'VALUE' => $t_value,
'UPLOADS_ID' => $t_elements_data['gm_gprint_uploads_id'],
'DOWNLOAD_KEY' => $t_elements_data['download_key']);
}
return $t_content;
}
function get_content_by_orders_id($p_orders_id, $p_shorten = false)
{
$t_content = array();
$c_orders_id = (int)$p_orders_id;
$t_get_orders_products_ids = xtc_db_query("SELECT orders_products_id
FROM " . TABLE_ORDERS_PRODUCTS . "
WHERE orders_id = '" . $c_orders_id . "'");
while($_orders_data = xtc_db_fetch_array($t_get_orders_products_ids))
{
$t_content_array = $this->get_orders_products_content($_orders_data['orders_products_id'], $p_shorten);
if(!empty($t_content_array))
{
$t_content[$_orders_data['orders_products_id']] = $t_content_array;
}
}
return $t_content;
}
}
?>| 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----- | |