Quick Search:

View

Revision:

Diff

Diff from 1763 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/frank/osc_trunk/admin/includes/modules/summary/products.php

Annotated File View

hpdl
1
1 <?php
2 /*
hpdl
121
3   $Id: products.php 1763 2007-12-27 21:27:48Z frank $
hpdl
1
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
1371
8   Copyright (c) 2007 osCommerce
hpdl
1
9
hpdl
1498
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
1
13 */
14
hpdl
1371
15   if ( !class_exists('osC_Summary') ) {
hpdl
1
16     include('includes/classes/summary.php');
17   }
18
19   class osC_Summary_products extends osC_Summary {
20
21 /* Class constructor */
22
23     function osC_Summary_products() {
hpdl
1492
24       global $osC_Language;
25
26       $osC_Language->loadIniFile('modules/summary/products.php');
27
28       $this->_title = $osC_Language->get('summary_products_title');
hpdl
1076
29       $this->_title_link = osc_href_link_admin(FILENAME_DEFAULT, 'products');
hpdl
1
30
hpdl
1371
31       if ( osC_Access::hasAccess('products') ) {
hpdl
1078
32         $this->_setData();
33       }
hpdl
1
34     }
35
36 /* Private methods */
37
38     function _setData() {
hpdl
755
39       global $osC_Database, $osC_Language, $osC_Currencies;
hpdl
1
40
hpdl
1371
41       if ( !isset($osC_Currencies) ) {
42         if ( !class_exists('osC_Currencies') ) {
hpdl
1
43           include('../includes/classes/currencies.php');
44         }
45
46         $osC_Currencies = new osC_Currencies();
47       }
48
49       $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' .
50                      '  <thead>' .
51                      '    <tr>' .
hpdl
1492
52                      '      <th>' . $osC_Language->get('summary_products_table_heading_products') . '</th>' .
53                      '      <th>' . $osC_Language->get('summary_products_table_heading_price') . '</th>' .
54                      '      <th>' . $osC_Language->get('summary_products_table_heading_date') . '</th>' .
55                      '      <th>' . $osC_Language->get('summary_products_table_heading_status') . '</th>' .
hpdl
1
56                      '    </tr>' .
57                      '  </thead>' .
58                      '  <tbody>';
59
60       $Qproducts = $osC_Database->query('select p.products_id, pd.products_name, p.products_price, greatest(p.products_date_added, p.products_last_modified) as date_last_modified, p.products_status from :table_products p, :table_products_description pd where p.products_id = pd.products_id and pd.language_id = :language_id order by date_last_modified desc, pd.products_name limit 6');
61       $Qproducts->bindTable(':table_products', TABLE_PRODUCTS);
62       $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
hpdl
121
63       $Qproducts->bindInt(':language_id', $osC_Language->getID());
hpdl
1
64       $Qproducts->execute();
65
hpdl
1371
66       while ( $Qproducts->next() ) {
hpdl
365
67         $this->_data .= '    <tr onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' .
hpdl
1492
68                         '      <td>' . osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'products&pID=' . $Qproducts->valueInt('products_id') . '&action=save'), osc_icon('products.png') . '&nbsp;' . $Qproducts->value('products_name')) . '</td>' .
hpdl
1
69                         '      <td>' . $osC_Currencies->format($Qproducts->value('products_price')) . '</td>' .
frank
1763
70                         '      <td>' . osC_DateTime::getShort($Qproducts->value('date_last_modified')) . '</td>' .
hpdl
755
71                         '      <td align="center">' . osc_icon(($Qproducts->valueInt('products_status') === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null) . '</td>' .
hpdl
1
72                         '    </tr>';
73       }
74
75       $this->_data .= '  </tbody>' .
76                       '</table>';
hpdl
1371
77
78       $Qproducts->freeResult();
hpdl
1
79     }
80   }
81 ?>