function modals($function = null, $selected = 1) { $this->root = dirname(ROOT) . DS . 'uploaded'; $dgClass = new dg(); $this->url = $dgClass->url(); $this->url .= 'tshirtecommerce/'; $data = array(); $data['title'] = 'Media'; $data['sub_title'] = 'Manage'; $data['root'] = 'uploaded'; $data['imgURL'] = $this->url; include_once ROOT . DS . 'includes' . DS . 'file.php'; $file = new File(); $data['folders'] = $file->folders($this->root); $data['files'] = $file->files($this->root); $data['selected'] = $selected; $data['function'] = $function; $this->modal('modals', $data); }
if (isset($data['vectors']) || isset($data['vector'])) { if (isset($data['vector'])) { $vectors = json_decode($data['vector']); } else { $vectors = json_decode($data['vectors']); } if (isset($vectors->{$position})) { $views = (array) $vectors->{$position}; if (count($views) == 0) { $data = array(); } } else { $data = array(); } } $file = $dg->url() . 'tshirtecommerce/' . $file; if (count($data) > 0) { $download_pdf = file_get_contents($file . '?key=' . $key . '&view=' . $position . '&type=pdf&is_admin=' . $is_admin); ?> <div class="col-sm-6 col-md-6"> <?php if (isset($data['images'][$position])) { ?> <center> <img src="<?php echo $data['images'][$position]; ?> " width="400" class="img-responsive" alt="Responsive image"> </center> <?php } else {
if (!file_exists($path)) { mkdir($path, 0755); } $setting = $dg->getSetting(); include_once ROOT . DS . 'includes' . DS . 'addons.php'; $addons = new addons(); $addons->view('hooks' . DS . 'download'); $file_name = $position . '-' . rand() . '.svg'; $dg->WriteFile($path . DS . $file_name, $svg); if ($file == 'svg') { if (!empty($_GET['download'])) { // zip files if (count($files)) { $ij = 0; foreach ($files as $file) { $string = str_replace($dg->url(), '', $file); $string = str_replace('/', DS, $string); $string = dirname(ROOT) . DS . $string; $array[$ij] = $string; $ij++; } $files = $array; } $files[] = $path . DS . $file_name; // zip all file $zipname = $path . DS . $position . '-' . $tempPath[1] . '.zip'; $zip = new ZipArchive(); if ($zip->open($zipname, ZipArchive::CREATE) === TRUE) { foreach ($files as $file_oput) { $string = explode(DS, $file_oput); $file_name = $string[count($string) - 1];
/** * @author tshirtecommerce - www.tshirtecommerce.com * @date: 2015-09-03 * * @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE * */ error_reporting(0); define('ROOT', dirname(__FILE__)); define('DS', DIRECTORY_SEPARATOR); include_once ROOT . DS . 'includes' . DS . 'functions.php'; $dg = new dg(); $lang = $dg->lang(); $settings = $dg->getSetting(); $base_url = $dg->url(); $params = explode('sharing.php/', $_SERVER['REQUEST_URI']); if (count($params) > 1) { $design_id = $params[1]; $url = $base_url . 'tshirtecommerce/sharing.php/' . $design_id; } else { $design_id = ''; $url = $base_url; } if ($design_id != '') { $cache = $dg->cache('design'); $params = explode(':', $design_id); $user_id = $cache->get($params[0]); if ($user_id != false && count($user_id[$params[1]]) > 0) { $data = $user_id[$params[1]]; }
public function modal($view, $data) { // call language $segments = $this->params; // call language $dg = new dg(); $lang = $dg->lang(); $site_url = $dg->url(); $GLOBALS['lang'] = $lang; $GLOBALS['site_url'] = $site_url . '/tshirtecommerce/admin/'; // call add-ons include ROOT . DS . 'includes' . DS . 'addons.php'; $addons = new addons(); if (file_exists(ROOT . DS . 'theme' . DS . $view . '.php')) { require_once ROOT . DS . 'theme' . DS . $view . '.php'; } elseif (file_exists(ROOT . DS . 'views' . DS . $view . '.php')) { require_once ROOT . DS . 'views' . DS . $view . '.php'; } else { echo 'View not found'; } }
* * API * * @copyright Copyright (C) 2015 tshirtecommerce.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE * */ error_reporting(0); session_start(); define('ROOT', dirname(__FILE__)); define('DS', DIRECTORY_SEPARATOR); include_once ROOT . DS . 'includes' . DS . 'functions.php'; // call language $dg = new dg(); $lang = $dg->lang(); $site_url = $dg->url(); // get design $cache = $dg->cache('admin'); $path = ROOT . DS . 'cache' . DS . 'admin'; $files = $dg->getFiles($path); $designs = array(); if ($files !== false) { $i = 0; foreach ($files as $file) { $key = str_replace('.txt', '', $file); $designs[$key] = $cache->get($key); } } // Paginition. $url = $_SERVER['REQUEST_URI']; $params = explode('admin.php/', $url);
// get attribute if (isset($product->attributes->name)) { $product->attribute = $dg->getAttributes($product->attributes); } else { $product->attribute = ''; } $product->attribute .= $dg->quantity($product->min_order, lang('quantity', true), lang('min_quantity', true)); // get getSetting $settings = $dg->getSetting(); // check cookie if (!isset($_COOKIE['design'])) { $user = 0; } else { $user = $_COOKIE['design']; } $settings->site_url = $dg->url(); // load add-on $addons = new addons(); ?> <!DOCTYPE html> <html lang="en"> <head> <title><?php echo setValue($settings, 'site_name', 'T-Shirt eCommerce'); ?> </title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1, minimum-scale=0.5, maximum-scale=1.0"/> <meta content="<?php echo setValue($settings, 'meta_description', 'T-Shirt eCommerce'); ?>
jQuery('.add-link').click(function(){ app.admin.add(this); }); </script> <?php if (!isset($_GET['page'])) { ?> </div> <script type="text/javascript"> function pagination(segment, page) { jQuery.ajax({ type: "GET", url: '<?php echo $dg->url(); ?> tshirtecommerce/admin.php/'+segment+'?page='+page, dataType: 'html', beforeSend: function(){ jQuery('#product-design').css('opacity', '0.1'); }, success: function(data){ if(data != '') { jQuery('#products-admin').html(data); } jQuery('#product-design').css('opacity', '1'); app.admin.ini(); }, });