s2dotemplates.php /// Art: Online Auftragsverwaltung /// Inhalt: Digitale Güter /// Beschreibung: Alle Funktionen zu digitalen Gütern /// Benötigt: Alle, siehe init /// CCML-Parsing: notwendig /// ////////////////////////////////////////////////////////////////////////////////////////// /// /// Letzte Änderungen: /// 10.02.2009 Variable für Encryption geändert /// ////////////////////////////////////////////////////////////////////////////////////////// ///<10.02.2009/6.0.3.8/> define('ROOT', './'); define('ASSETS', ROOT.'assets/'); require(ASSETS.'s2diconf.php'); require(CC_INCLUDE_INIT); if (!$session->is_shopadmin()) { $session->unset_client(); redirect(CC_URL_LOGIN, CC_URL_OSDOWNLOADS.'?'.$_SERVER['QUERY_STRING']); } require(CC_BLOGIC_CONFIG); require(CC_INCLUDE_OSFUNCTIONS); //////////////////////////////////////////////////////////////////////////// // Kundenübersicht über einen Download if ($uid = get(PARAMETER_ID, CHECK_ALPHANUM)) { // Template vorbereiten $template = new template(CC_TPL_OSDOWNLOADORDERS, true); $template->ressources(CC_INCLUDE_OSLANG); $template->show('viewmenu'); $template->show('downloadorders'); $template->show('pagination'); $config = new config('downloadorders'); $downloadproduct = new abstractdb(TABLE_DOWNLOADPRODUCTS, $uid); if (!isset($downloadproduct->filename)) die(CC_RESSOURCE_FORBIDDEN); myperpage($config, $template); mypage($config); $item = new item(); $count = $item->db_numrows(array('download_uid' => $uid, "order_status != ''")); $max_page = max(1, ceil($count / $config->perpage)); pagination($config, $template, $max_page); // Downloads einlesen while($d = $item->get(array('order_id', 'download_count'), array('download_uid' => $uid, "order_status != ''"), null, $config->page, $config->perpage)) { $order = new order($d->order_id); $count_ok = 0; $count_pending = 0; if ($downloadproduct->pid) { $licenses = new abstractdb(TABLE_ESDLICENSES); while ($lic = $licenses->get(array('license_pending'), array('id' => $downloadproduct->id, 'order_id' => $order->order_id))) { if ($lic->license_pending == LICENSE_PENDING) $count_pending++; if ($lic->license_pending == LICENSE_OK) $count_ok++; } } $template->loop('download', array( 'firstname' => $order->client->firstname, 'lastname' => $order->client->lastname, 'license_count' => $count_ok, 'order_id' => $order->order_id, 'client_id' => $order->client->client_id, 'pid' => $downloadproduct->pid, 'icon' => $count_pending ? CC_ICON_LICENSESPENDING : CC_ICON_NOLICENSESPENDING, 'iconalt' => $count_pending ? $template->vars['licensespending'] : $template->vars['nolicensespending'], ), $d); } if ($order_id = get(PARAMETER_ORDER, CHECK_NUM)) $template->show('open_licenses'); // Template befüllen und fertig $template->assign(array( '_headline1' => $template->vars['download'], '_uid' => $uid, '_order_id' => isset($order_id) ? $order_id : '', '_more' => PARAMETER_ID."=$uid&", '_downloads_selected' => 'selected', '_selected_entry' => $config->selected, '_downloadorder_x' => $config->x, '_downloadorder_y' => $config->y, '_download' => $downloadproduct->caption, '_ordercount' => $downloadproduct->order_count, '_downloadcount' => $downloadproduct->download_count, '_filename' => $downloadproduct->filename, '_fileok' => file_exists(ROOT.$downloadproduct->url) ? $template->vars['yes'] : $template->vars['no'], '_licenses' => $downloadproduct->pid ? $template->vars['yes'] : $template->vars['no'], )); // Downloadübersicht } else { // Template vorbereiten $template = new template(CC_TPL_OSDOWNLOADS, true); $template->ressources(CC_INCLUDE_OSLANG); $template->show('viewmenu'); $template->show('downloads'); $template->show('pagination'); $config = new config('downloads'); $download = new abstractdb(TABLE_DOWNLOADPRODUCTS); myperpage($config, $template); mypage($config); $count = $download->db_numrows(); $max_page = max(1, ceil($count / $config->perpage)); pagination($config, $template, $max_page); // Downloads einlesen while ($d = $download->get(array('*'), null, array('caption asc'), $config->page, $config->perpage)) { $filename = md5($d->filename.$d->id.CC_SITE_FILEKEY); $template->loop('download', array( 'fileok' => file_exists(DOWNLOADS.$filename) ? $template->vars['yes'] : $template->vars['no'], 'licenses' => $d->pid ? $template->vars['yes'] : $template->vars['no'], ), $d); } // Template befüllen und fertig $template->assign(array( '_headline1' => $template->vars['downloads'], '_downloads_selected' => 'selected', '_selected_entry' => $config->selected, '_totaldownloadcount' => $config->overallcount, '_totalnoclientcount' => $config->noclient, '_totalfilegonecount' => $config->filegone, '_totalnoaccesscount' => $config->noaccess, )); } $template->out(); ?>