AJAX_servers/                                                                                       0000755 0001012 0001007 00000000000 11434761612 013523  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               AJAX_servers/AJAX_image_swapper_server.php                                                          0000755 0001012 0001007 00000015075 11001121136 021240  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* AJAX_image_swapper_server.php
 * PI = Product_Info
 * Made by Jaycode / Jay T (teguhwpurwanto@gmail.com)
 * 21 Oct 2007
*/
?>
<?php

if (isset($_GET['action'])) {
	chdir('../');
	include('includes/application_top.php');
	header('Content-Type: text/xml');
	$action = $_GET['action'];
	switch ($action) {
		case 'loadImages':
			$products_id = (is_numeric($_GET['products_id'])) ? ($_GET['products_id']) : (0);
			if (empty($_GET['options_id'])) {
				$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
									 FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
									 WHERE products_attributes_id = 0 
									 AND products_id_no_attribute = '" . $products_id . "'";
				$products = $db->Execute($sqlStr);
			}
			else {
				$options_id = (is_numeric($_GET['options_id'])) ? ($_GET['options_id']) : (0);
				$options_values_id = (is_numeric($_GET['options_values_id'])) ? ($_GET['options_values_id']) : (0);
				$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
						   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " i, " . TABLE_PRODUCTS_ATTRIBUTES . " a
						   WHERE i.products_attributes_id = a.products_attributes_id 
						   AND a.options_values_id = " . $options_values_id . " 
						   AND a.options_id = " . $options_id . " 
						   AND a.products_id = " . $products_id . "
							 ORDER BY i.image_sort_order";
				$products = $db->Execute($sqlStr);
			}
			
			$items_array = array();
			$items_array = getItemsArray($products);
			
			$xml = array_to_xml($action, $items_array);
			echo $xml->saveXML();
			break;
		case 'showMedium':
			$image_id = (is_numeric($_GET['image_id'])) ? ($_GET['image_id']) : (0);
			$sqlStr = "SELECT image_id, image_path, image_title
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " i 
					   WHERE i.image_id = " . $image_id;
			$products = $db->Execute($sqlStr);
			
			$items_array = array();
			$items_array = getItemsArray($products);
			
			$xml = array_to_xml($action, $items_array);
			echo $xml->saveXML();
			break;
	}
}
?>

<?php
function getItemsArray($products) {
	$items_array = array();
	if ($products->recordCount() > 0) {
		while (!$products->EOF) {
			$item_array = array();
			$item_array['image_id'] = $products->fields['image_id'];
			$image_path = $products->fields['image_path'];
			
			$image_path_medium = get_image_filename($image_path, 'medium');
			$image_path_large = get_image_filename($image_path, 'large');
			
			$item_array['image_path_small'] = $image_path;
			$small_size = getSize($image_path,IMAGE_VIEWER_SMALL_IMAGE_WIDTH, IMAGE_VIEWER_SMALL_IMAGE_HEIGHT);
			$item_array['image_width_small'] = $small_size['width'];
			$item_array['image_height_small'] = $small_size['height'];
			
			$item_array['image_path_medium'] = $image_path_medium;
			$medium_size = getSize($image_path_medium,IMAGE_VIEWER_MEDIUM_IMAGE_WIDTH, IMAGE_VIEWER_MEDIUM_IMAGE_HEIGHT);
			$item_array['image_width_medium'] = $medium_size['width'];
			$item_array['image_height_medium'] = $medium_size['height'];
			
			$item_array['image_path_large'] = $image_path_large;
			$image_size = @getimagesize($image_path_large);
			$item_array['image_width_large'] = $image_size[0];
			$item_array['image_height_large'] = $image_size[1];
			
			$item_array['image_title'] = $products->fields['image_title'];
			$item_array['image_sort_order'] = $products->fields['image_sort_order'];
			$items_array[] = $item_array;
			$products->MoveNext();
		}
	}
	return $items_array;
}
?>

<?php
/* Function array_to_xml($action, $items)
$action = the name of action, returned as the value of attribute "action" of node "items"
$items = associative array
example:
$action="loadImages" and $items = <see below>
Array
([0] => Array
        ( [image_id] => 20
          [image_path_small] => images/Hyperlite_Boards/BYERLY_52.jpg)
 [1] => Array
        ( [image_id] => 25
          [image_path_small] => images/Hyperlite_Boards/Cartel141S.jpg) 
)

is converted into this:
<items action="loadImages">
	<item>
		<image_id>20</image_id>
		<image_path_small>images/Hyperlite_Boards/BYERLY_52.jpg</image_path_small>
	</item>
	<item>
		<image_id>25</image_id>
		<image_path_small>images/Hyperlite_Boards/Cartel141S.jpg</image_path_small>
	</item>
</items>

*/
function array_to_xml($action, $items) {
	if (count($items) > 0) {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		for($i=0; $i < count($items); $i++) {
			$itemNode = $doc->createElement('item');
			$itemNode = $itemsNode->appendChild($itemNode);
			$item = $items[$i];
			foreach($item as $value) {
				$elementNode = $doc->createElement(key($item));
				$elementNode = $itemNode->appendChild($elementNode);
				$valueNode = $doc->createTextNode($value);
				$valueNode = $elementNode->appendChild($valueNode);
				next($item);
			}
		}
		return $doc;
	}
	else {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		$itemNode = $doc->createElement('item');
		$itemNode = $itemsNode->appendChild($itemNode);

		return $doc;
	}
}
?>

<?php
/*
getXML function
$action = the name of action, returned as the value of attribute "action" of node "items"
$items = result of $db->Execute($sqlStr)
$elements = array of returned node tagNames
*/
function getXML($action, $items, $elements) {
	if ($items->recordCount() > 0) {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		while (!$items->EOF) {
			$itemNode = $doc->createElement('item');
			$itemNode = $itemsNode->appendChild($itemNode);
			for($i = 0; $i < count($elements); $i++) {
				$elementNode = $doc->createElement($elements[$i]);
				$elementNode = $itemNode->appendChild($elementNode);
				$valueNode = $doc->createTextNode($items->fields[$elements[$i]]);
				$valueNode = $elementNode->appendChild($valueNode);
			}
			$items->MoveNext();
		}
		//$xmlStr = $doc->saveXML();
		return $doc;
	}
	else {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		$itemNode = $doc->createElement('item');
		$itemNode = $itemsNode->appendChild($itemNode);

		//$xmlStr = $doc->saveXML();
		return $doc;
	}
}
?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Crypt/                                                                                              0000755 0001012 0001007 00000000000 11434761612 012330  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               Crypt/Crypt.tar                                                                                     0000744 0001012 0001007 00000170000 11434756427 014150  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               Blowfish/                                                                                           0000755 0000767 0000764 00000000000 11377500064 012205  5                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 Blowfish/CBC.php                                                                                    0000644 0000767 0000764 00000010603 11377500060 013301  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * PHP implementation of the Blowfish algorithm in CBC mode
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: CBC.php,v 1.8 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Required parent class
 */
require_once 'Crypt/Blowfish/PHP.php';

/**
 * Example
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123@%';
 * $bf->setKey('My secret key', $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey('My secret key', $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * <code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_CBC extends Crypt_Blowfish_PHP
{
    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_CBC($key = null, $iv = null)
    {
        $this->__construct($key, $iv);
    }

    /**
     * Class constructor
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv_required = true;
        parent::__construct($key, $iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        } elseif (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $cipherText = '';
        $len = strlen($plainText);
        $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        list(, $Xl, $Xr) = unpack('N2', substr($plainText, 0, 8) ^ $this->_iv);
        $this->_encipher($Xl, $Xr);
        $cipherText .= pack('N2', $Xl, $Xr);

        for ($i = 8; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($plainText, $i, 8) ^ substr($cipherText, $i - 8, 8));
            $this->_encipher($Xl, $Xr);
            $cipherText .= pack('N2', $Xl, $Xr);
        }

        return $cipherText;
    }

    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }
        if (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $plainText = '';
        $len = strlen($cipherText);
        $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        list(, $Xl, $Xr) = unpack('N2', substr($cipherText, 0, 8));
        $this->_decipher($Xl, $Xr);
        $plainText .= (pack('N2', $Xl, $Xr) ^ $this->_iv);

        for ($i = 8; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($cipherText, $i, 8));
            $this->_decipher($Xl, $Xr);
            $plainText .= (pack('N2', $Xl, $Xr) ^ substr($cipherText, $i - 8, 8));
        }

        return $plainText;
    }
}

?>                                                                                                                             Blowfish/DefaultKey.php                                                                             0000644 0000767 0000764 00000043246 11377500061 014761  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
 * PHP extension, it uses only PHP.
 * Crypt_Blowfish support encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: DefaultKey.php,v 1.82 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 */


/**
 * Class containing default key
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 */
class Crypt_Blowfish_DefaultKey
{
    var $P = array();
    
    var $S = array();
    
    function Crypt_Blowfish_DefaultKey()
    {
        $this->P = array(
            0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
            0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
            0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,
            0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,
            0x9216D5D9, 0x8979FB1B
        );
        
        $this->S = array(
            array(
                0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,
                0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,
                0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,
                0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,
                0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,
                0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,
                0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,
                0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,
                0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
                0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,
                0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,
                0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,
                0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,
                0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,
                0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
                0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,
                0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,
                0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,
                0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,
                0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,
                0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,
                0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,
                0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,
                0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,
                0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,
                0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,
                0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,
                0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,
                0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,
                0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
                0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,
                0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,
                0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,
                0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,
                0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,
                0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,
                0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,
                0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,
                0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,
                0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,
                0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,
                0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,
                0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,
                0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,
                0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
                0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,
                0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,
                0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,
                0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,
                0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,
                0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,
                0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,
                0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,
                0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,
                0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,
                0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,
                0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,
                0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,
                0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,
                0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
                0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,
                0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,
                0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,
                0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A
            ),
            array(
                0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,
                0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,
                0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,
                0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,
                0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
                0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,
                0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,
                0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,
                0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,
                0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,
                0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,
                0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,
                0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,
                0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,
                0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,
                0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,
                0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,
                0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,
                0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,
                0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
                0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,
                0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,
                0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,
                0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,
                0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,
                0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,
                0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,
                0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,
                0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,
                0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,
                0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,
                0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,
                0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,
                0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,
                0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
                0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,
                0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,
                0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,
                0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,
                0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,
                0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,
                0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,
                0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,
                0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,
                0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,
                0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,
                0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,
                0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,
                0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,
                0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
                0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,
                0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,
                0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,
                0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,
                0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,
                0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,
                0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,
                0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,
                0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,
                0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,
                0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,
                0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,
                0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,
                0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7
            ),
            array(
                0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,
                0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,
                0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,
                0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,
                0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,
                0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,
                0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,
                0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,
                0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,
                0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
                0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,
                0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,
                0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,
                0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,
                0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,
                0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,
                0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,
                0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,
                0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,
                0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,
                0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,
                0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,
                0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,
                0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,
                0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
                0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,
                0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,
                0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,
                0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,
                0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,
                0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,
                0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,
                0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,
                0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,
                0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,
                0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,
                0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,
                0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,
                0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,
                0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
                0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,
                0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,
                0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,
                0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,
                0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,
                0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,
                0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,
                0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,
                0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,
                0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,
                0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,
                0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,
                0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,
                0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,
                0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
                0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,
                0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,
                0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,
                0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,
                0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,
                0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,
                0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,
                0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,
                0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0
            ),
            array(
                0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,
                0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,
                0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,
                0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,
                0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,
                0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,
                0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,
                0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,
                0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
                0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,
                0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,
                0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,
                0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,
                0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,
                0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
                0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,
                0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,
                0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,
                0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,
                0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,
                0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,
                0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,
                0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,
                0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,
                0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,
                0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,
                0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,
                0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,
                0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,
                0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
                0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,
                0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,
                0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,
                0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,
                0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,
                0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,
                0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,
                0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,
                0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,
                0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,
                0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,
                0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,
                0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,
                0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,
                0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
                0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,
                0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,
                0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,
                0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,
                0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,
                0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,
                0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,
                0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,
                0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,
                0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,
                0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,
                0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,
                0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,
                0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,
                0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
                0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,
                0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,
                0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,
                0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6
            )
        );
    }
    
}

?>
                                                                                                                                                                                                                                                                                                                                                          Blowfish/ECB.php                                                                                    0000644 0000767 0000764 00000007673 11377500062 013322  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * PHP implementation of the Blowfish algorithm in ECB mode
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: ECB.php,v 1.7 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Required parent class
 */
require_once 'Crypt/Blowfish/PHP.php';

/**
 * Example
 * <code>
 * $bf =& Crypt_Blowfish::factory('ecb');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $bf->setKey('My secret key');
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_ECB extends Crypt_Blowfish_PHP
{
    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_ECB($key = null, $iv = null)
    {
        $this->__construct($key, $iv);
    }

    /**
     * Class constructor
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv_required = false;
        parent::__construct($key, $iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        } elseif (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $cipherText = '';
        $len = strlen($plainText);
        $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        for ($i = 0; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($plainText, $i, 8));
            $this->_encipher($Xl, $Xr);
            $cipherText .= pack('N2', $Xl, $Xr);
        }

        return $cipherText;
    }

    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }
        if (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $plainText = '';
        $len = strlen($cipherText);
        $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        for ($i = 0; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($cipherText, $i, 8));
            $this->_decipher($Xl, $Xr);
            $plainText .= pack('N2', $Xl, $Xr);
        }

        return $plainText;
    }
}

?>                                                                     Blowfish/MCrypt.php                                                                                 0000644 0000767 0000764 00000012144 11377500063 014135  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * MCrypt PHP extension wrapper for Crypt_Blowfish package
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: MCrypt.php,v 1.4 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Include base class
 */
require_once 'Crypt/Blowfish.php';

/**
 * Example using the factory method in CBC mode and forcing using
 * the MCrypt library.
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc', null, null, CRYPT_BLOWFISH_MCRYPT);
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123+=';
 * $key = 'My secret key';
 * $bf->setKey($key, $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey($key, $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_MCrypt extends Crypt_Blowfish
{
    /**
     * Mcrypt td resource
     *
     * @var resource
     * @access private
     */
    var $_td = null;

    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets the secret key
     *
     * @param string $key
     * @param string $mode operating mode 'ecb', 'cbc'...
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_MCrypt($key = null, $mode = 'ecb', $iv = null)
    {
        $this->_iv = $iv . ((strlen($iv) < 8)
                            ? str_repeat(chr(0), 8 - strlen($iv)) : '');

        $this->_td = mcrypt_module_open(MCRYPT_BLOWFISH, '', $mode, '');
        if (is_null($iv)) {
            $this->_iv = mcrypt_create_iv(8, MCRYPT_RAND);
        }

        switch (strtolower($mode)) {
            case 'ecb':
                $this->_iv_required = false;
                break;

            case 'cbc':
            default:
                $this->_iv_required = true;
                break;
        }

        $this->setKey($key, $this->_iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success,
     *                           or PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        }

        return mcrypt_generic($this->_td, $plainText);
    }


    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success,
     *                           or PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }

        return mdecrypt_generic($this->_td, $cipherText);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP mcrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @param string $iv 8-char initialization vector (required for CBC mode)
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     */
    function setKey($key, $iv = null)
    {
        static $keyHash = null;

        if (!is_string($key)) {
            return PEAR::raiseError('Key must be a string', 2);
        }

        $len = strlen($key);

        if ($len > 56 || $len == 0) {
            return PEAR::raiseError('Key must be less than 56 characters (bytes) and non-zero. Supplied key length: ' . $len, 3);
        }

        if ($this->_iv_required) {
            if (strlen($iv) != 8) {
                return PEAR::raiseError('IV must be 8-character (byte) long. Supplied IV length: ' . strlen($iv), 7);
            }
            $this->_iv = $iv;
        }

        $return = mcrypt_generic_init($this->_td, $key, $this->_iv);
        if ($return < 0) {
            return PEAR::raiseError('Unknown PHP MCrypt library error', 4);
        }
        return true;
    }
}

?>                                                                                                                                                                                                                                                                                                                                                                                                                            Blowfish/PHP.php                                                                                    0000644 0000767 0000764 00000016674 11377500064 013363  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
 * PHP extension, but uses it if available, otherwise it uses only PHP.
 * Crypt_Blowfish support encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: PHP.php,v 1.7 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Include base class
 */
require_once 'Crypt/Blowfish.php';

/**
 * Common class for PHP-only implementations
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_PHP extends Crypt_Blowfish
{
    /**
     * P-Array contains 18 32-bit subkeys
     *
     * @var array
     * @access protected
     */
    var $_P = array();

    /**
     * Array of four S-Blocks each containing 256 32-bit entries
     *
     * @var array
     * @access protected
     */
    var $_S = array();

    /**
     * Whether the IV is required
     *
     * @var boolean
     * @access protected
     */
    var $_iv_required = false;
    
    /**
     * Hash value of last used key
     * 
     * @var     string
     * @access  protected
     */
    var $_keyHash = null;

    /**
     * Crypt_Blowfish_PHP Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $mode operating mode 'ecb' or 'cbc'
     * @param string $iv initialization vector
     * @access protected
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv = $iv . ((strlen($iv) < $this->_iv_size)
                            ? str_repeat(chr(0), $this->_iv_size - strlen($iv))
                            : '');
        if (!is_null($key)) {
            $this->setKey($key, $this->_iv);
        }
    }

    /**
     * Initializes the Crypt_Blowfish object
     *
     * @access private
     */
    function _init()
    {
        require_once 'Crypt/Blowfish/DefaultKey.php';
        $defaults = new Crypt_Blowfish_DefaultKey();
        $this->_P = $defaults->P;
        $this->_S = $defaults->S;
    }

    /**
     * Workaround for XOR on certain systems
     *
     * @param integer|float $l
     * @param integer|float $r
     * @return float
     * @access protected
     */
    function _binxor($l, $r)
    {
        $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)
             ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);

        return (float)(($x < 0) ? $x + 4294967296 : $x);
    }

    /**
     * Enciphers a single 64-bit block
     *
     * @param int &$Xl
     * @param int &$Xr
     * @access protected
     */
    function _encipher(&$Xl, &$Xr)
    {
        if ($Xl < 0) {
            $Xl += 4294967296;
        }
        if ($Xr < 0) {
            $Xr += 4294967296;
        }

        for ($i = 0; $i < 16; $i++) {
            $temp = $Xl ^ $this->_P[$i];
            if ($temp < 0) {
                $temp += 4294967296;
            }

            $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]
                             + $this->_S[1][($temp >> 16) & 255], 4294967296) 
                        ^ $this->_S[2][($temp >> 8) & 255]) 
                       + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;
            $Xr = $temp;
        }
        $Xr = $this->_binxor($Xl, $this->_P[16]);
        $Xl = $this->_binxor($temp, $this->_P[17]);
    }

    /**
     * Deciphers a single 64-bit block
     *
     * @param int &$Xl
     * @param int &$Xr
     * @access protected
     */
    function _decipher(&$Xl, &$Xr)
    {
        if ($Xl < 0) {
            $Xl += 4294967296;
        }
        if ($Xr < 0) {
            $Xr += 4294967296;
        }

        for ($i = 17; $i > 1; $i--) {
            $temp = $Xl ^ $this->_P[$i];
            if ($temp < 0) {
                $temp += 4294967296;
            }

            $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]
                             + $this->_S[1][($temp >> 16) & 255], 4294967296) 
                        ^ $this->_S[2][($temp >> 8) & 255]) 
                       + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;
            $Xr = $temp;
        }
        $Xr = $this->_binxor($Xl, $this->_P[1]);
        $Xl = $this->_binxor($temp, $this->_P[0]);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP mcrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @param string $iv 8-char initialization vector (required for CBC mode)
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     * @todo Fix the caching of the key
     */
    function setKey($key, $iv = null)
    {
        if (!is_string($key)) {
            return PEAR::raiseError('Key must be a string', 2);
        }

        $len = strlen($key);

        if ($len > $this->_key_size || $len == 0) {
            return PEAR::raiseError('Key must be less than ' . $this->_key_size . ' characters (bytes) and non-zero. Supplied key length: ' . $len, 3);
        }

        if ($this->_iv_required) {
            if (strlen($iv) != $this->_iv_size) {
                return PEAR::raiseError('IV must be ' . $this->_iv_size . '-character (byte) long. Supplied IV length: ' . strlen($iv), 7);
            }
            $this->_iv = $iv;
        }

        if ($this->_keyHash == md5($key)) {
            return true;
        }

        $this->_init();

        $k = 0;
        $data = 0;
        $datal = 0;
        $datar = 0;

        for ($i = 0; $i < 18; $i++) {
            $data = 0;
            for ($j = 4; $j > 0; $j--) {
                    $data = $data << 8 | ord($key{$k});
                    $k = ($k+1) % $len;
            }
            $this->_P[$i] ^= $data;
        }

        for ($i = 0; $i <= 16; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_P[$i] = $datal;
            $this->_P[$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[0][$i] = $datal;
            $this->_S[0][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[1][$i] = $datal;
            $this->_S[1][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[2][$i] = $datal;
            $this->_S[2][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[3][$i] = $datal;
            $this->_S[3][$i+1] = $datar;
        }

        $this->_keyHash = md5($key);
        return true;
    }
}

?>                                                                    Blowfish.php                                                                                        0000644 0000767 0000764 00000017672 11377500067 012736  0                                                                                                    ustar   deewhy                          deewhy                                                                                                                                                                                                                 <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the MCrypt
 * PHP extension, but uses it if available, otherwise it uses only PHP.
 * Crypt_Blowfish supports encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: Blowfish.php,v 1.86 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 */

/**
 * Required PEAR package(s)
 */
require_once 'PEAR.php';

/**
 * Engine choice constants
 */
/**
 * To let the Crypt_Blowfish package decide which engine to use
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_AUTO',   1);
/**
 * To use the MCrypt PHP extension.
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_MCRYPT', 2);
/**
 * To use the PHP-only engine.
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_PHP',    3);


/**
 * Example using the factory method in CBC mode
 * 
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123+=';
 * $key = 'My secret key';
 * $bf->setKey($key, $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey($key, $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * if (PEAR::isError($plaintext)) {
 *     echo $plaintext->getMessage();
 *     exit;
 * }
 * // Encrypted text is padded prior to encryption
 * // so you may need to trim the decrypted result.
 * echo 'plain text: ' . trim($plaintext);
 * </code>
 *
 * To disable using the mcrypt library, define the CRYPT_BLOWFISH_NOMCRYPT
 * constant. This is useful for instance on Windows platform with a buggy
 * mdecrypt_generic() function.
 * <code>
 * define('CRYPT_BLOWFISH_NOMCRYPT', true);
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @access     public
 */
class Crypt_Blowfish
{
    /**
     * Implementation-specific Crypt_Blowfish object
     *
     * @var object
     * @access private
     */
    var $_crypt = null;

    /**
     * Initialization vector
     *
     * @var string
     * @access protected
     */
    var $_iv = null;

    /**
     * Holds block size
     *
     * @var integer
     * @access protected
     */
    var $_block_size = 8;

    /**
     * Holds IV size
     *
     * @var integer
     * @access protected
     */
    var $_iv_size = 8;

    /**
     * Holds max key size
     *
     * @var integer
     * @access protected
     */
    var $_key_size = 56;

    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object (in EBC mode), and sets
     * the secret key
     *
     * @param string $key
     * @access public
     * @deprecated Since 1.1.0
     * @see Crypt_Blowfish::factory()
     */
    function Crypt_Blowfish($key)
    {
        $this->_crypt =& Crypt_Blowfish::factory('ecb', $key);
        if (!PEAR::isError($this->_crypt)) {
            $this->_crypt->setKey($key);
        }
    }

    /**
     * Crypt_Blowfish object factory
     *
     * This is the recommended method to create a Crypt_Blowfish instance.
     *
     * When using CRYPT_BLOWFISH_AUTO, you can force the package to ignore
     * the MCrypt extension, by defining CRYPT_BLOWFISH_NOMCRYPT.
     *
     * @param string $mode operating mode 'ecb' or 'cbc' (case insensitive)
     * @param string $key
     * @param string $iv initialization vector (must be provided for CBC mode)
     * @param integer $engine one of CRYPT_BLOWFISH_AUTO, CRYPT_BLOWFISH_PHP
     *                or CRYPT_BLOWFISH_MCRYPT
     * @return object Crypt_Blowfish object or PEAR_Error object on error
     * @access public
     * @static
     * @since 1.1.0
     */
    function &factory($mode = 'ecb', $key = null, $iv = null, $engine = CRYPT_BLOWFISH_AUTO)
    {
        switch ($engine) {
            case CRYPT_BLOWFISH_AUTO:
                if (!defined('CRYPT_BLOWFISH_NOMCRYPT')
                    && extension_loaded('mcrypt')) {
                    $engine = CRYPT_BLOWFISH_MCRYPT;
                } else {
                    $engine = CRYPT_BLOWFISH_PHP;
                }
                break;
            case CRYPT_BLOWFISH_MCRYPT:
                if (!PEAR::loadExtension('mcrypt')) {
                    return PEAR::raiseError('MCrypt extension is not available.');
                }
                break;
        }

        switch ($engine) {
            case CRYPT_BLOWFISH_PHP:
                $mode = strtoupper($mode);
                $class = 'Crypt_Blowfish_' . $mode;
                include_once 'Crypt/Blowfish/' . $mode . '.php';
                $crypt = new $class(null);
                break;

            case CRYPT_BLOWFISH_MCRYPT:
                include_once 'Crypt/Blowfish/MCrypt.php';
                $crypt = new Crypt_Blowfish_MCrypt(null, $mode);
                break;
        }

        if (!is_null($key) || !is_null($iv)) {
            $result = $crypt->setKey($key, $iv);
            if (PEAR::isError($result)) {
                return $result;
            }
        }

        return $crypt;
    }

    /**
     * Returns the algorithm's block size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getBlockSize()
    {
        return $this->_block_size;
    }

    /**
     * Returns the algorithm's IV size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getIVSize()
    {
        return $this->_iv_size;
    }

    /**
     * Returns the algorithm's maximum key size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getMaxKeySize()
    {
        return $this->_key_size;
    }

    /**
     * Deprecated isReady method
     *
     * @return bool
     * @access public
     * @deprecated
     */
    function isReady()
    {
        return true;
    }

    /**
     * Deprecated init method - init is now a private
     * method and has been replaced with _init
     *
     * @return bool
     * @access public
     * @deprecated
     */
    function init()
    {
        return $this->_crypt->init();
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText the string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        return $this->_crypt->encrypt($plainText);
    }


    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText the binary string to decrypt
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        return $this->_crypt->decrypt($cipherText);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP MCrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     */
    function setKey($key)
    {
        return $this->_crypt->setKey($key);
    }
}

?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Crypt/Blowfish/                                                                                     0000744 0001012 0001007 00000000000 11377500064 014101  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               Crypt/Blowfish/CBC.php                                                                              0000744 0001012 0001007 00000010603 11377500060 015200  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * PHP implementation of the Blowfish algorithm in CBC mode
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: CBC.php,v 1.8 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Required parent class
 */
require_once 'Crypt/Blowfish/PHP.php';

/**
 * Example
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123@%';
 * $bf->setKey('My secret key', $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey('My secret key', $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * <code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_CBC extends Crypt_Blowfish_PHP
{
    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_CBC($key = null, $iv = null)
    {
        $this->__construct($key, $iv);
    }

    /**
     * Class constructor
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv_required = true;
        parent::__construct($key, $iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        } elseif (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $cipherText = '';
        $len = strlen($plainText);
        $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        list(, $Xl, $Xr) = unpack('N2', substr($plainText, 0, 8) ^ $this->_iv);
        $this->_encipher($Xl, $Xr);
        $cipherText .= pack('N2', $Xl, $Xr);

        for ($i = 8; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($plainText, $i, 8) ^ substr($cipherText, $i - 8, 8));
            $this->_encipher($Xl, $Xr);
            $cipherText .= pack('N2', $Xl, $Xr);
        }

        return $cipherText;
    }

    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }
        if (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $plainText = '';
        $len = strlen($cipherText);
        $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        list(, $Xl, $Xr) = unpack('N2', substr($cipherText, 0, 8));
        $this->_decipher($Xl, $Xr);
        $plainText .= (pack('N2', $Xl, $Xr) ^ $this->_iv);

        for ($i = 8; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($cipherText, $i, 8));
            $this->_decipher($Xl, $Xr);
            $plainText .= (pack('N2', $Xl, $Xr) ^ substr($cipherText, $i - 8, 8));
        }

        return $plainText;
    }
}

?>                                                                                                                             Crypt/Blowfish/DefaultKey.php                                                                       0000744 0001012 0001007 00000043246 11377500061 016660  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
 * PHP extension, it uses only PHP.
 * Crypt_Blowfish support encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: DefaultKey.php,v 1.82 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 */


/**
 * Class containing default key
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 */
class Crypt_Blowfish_DefaultKey
{
    var $P = array();
    
    var $S = array();
    
    function Crypt_Blowfish_DefaultKey()
    {
        $this->P = array(
            0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,
            0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,
            0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,
            0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,
            0x9216D5D9, 0x8979FB1B
        );
        
        $this->S = array(
            array(
                0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,
                0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,
                0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,
                0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,
                0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,
                0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,
                0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,
                0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,
                0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
                0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,
                0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,
                0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,
                0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,
                0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,
                0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,
                0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,
                0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,
                0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,
                0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,
                0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,
                0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,
                0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,
                0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,
                0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,
                0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,
                0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,
                0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,
                0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,
                0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,
                0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,
                0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,
                0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,
                0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,
                0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,
                0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,
                0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,
                0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,
                0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,
                0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,
                0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,
                0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,
                0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,
                0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,
                0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,
                0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,
                0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,
                0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,
                0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,
                0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,
                0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,
                0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,
                0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,
                0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,
                0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,
                0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,
                0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,
                0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,
                0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,
                0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,
                0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,
                0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,
                0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,
                0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,
                0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A
            ),
            array(
                0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,
                0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,
                0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,
                0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,
                0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,
                0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,
                0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,
                0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,
                0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,
                0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,
                0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,
                0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,
                0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,
                0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,
                0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,
                0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,
                0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,
                0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,
                0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,
                0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,
                0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,
                0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,
                0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,
                0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,
                0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,
                0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,
                0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,
                0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,
                0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,
                0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,
                0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,
                0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,
                0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,
                0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,
                0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,
                0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,
                0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,
                0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,
                0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,
                0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,
                0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,
                0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,
                0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,
                0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,
                0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,
                0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,
                0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,
                0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,
                0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,
                0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,
                0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,
                0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,
                0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,
                0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,
                0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,
                0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,
                0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,
                0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,
                0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,
                0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,
                0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,
                0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,
                0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,
                0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7
            ),
            array(
                0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,
                0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,
                0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,
                0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,
                0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,
                0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,
                0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,
                0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,
                0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,
                0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,
                0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,
                0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,
                0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,
                0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,
                0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,
                0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,
                0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,
                0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,
                0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,
                0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,
                0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,
                0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,
                0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,
                0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,
                0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,
                0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,
                0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,
                0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,
                0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,
                0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,
                0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,
                0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,
                0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,
                0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,
                0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,
                0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,
                0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,
                0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,
                0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,
                0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,
                0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,
                0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,
                0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,
                0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,
                0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,
                0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,
                0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,
                0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,
                0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,
                0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,
                0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,
                0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,
                0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,
                0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,
                0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,
                0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,
                0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,
                0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,
                0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,
                0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,
                0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,
                0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,
                0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,
                0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0
            ),
            array(
                0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,
                0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,
                0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,
                0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,
                0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,
                0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,
                0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,
                0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,
                0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
                0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,
                0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,
                0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,
                0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,
                0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,
                0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,
                0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,
                0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,
                0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,
                0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,
                0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,
                0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,
                0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,
                0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,
                0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,
                0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,
                0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,
                0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,
                0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,
                0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,
                0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,
                0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,
                0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,
                0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,
                0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,
                0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,
                0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,
                0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,
                0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,
                0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,
                0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,
                0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,
                0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,
                0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,
                0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,
                0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,
                0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,
                0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,
                0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,
                0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,
                0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,
                0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,
                0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,
                0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,
                0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,
                0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,
                0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,
                0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,
                0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,
                0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,
                0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,
                0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,
                0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,
                0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,
                0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6
            )
        );
    }
    
}

?>
                                                                                                                                                                                                                                                                                                                                                          Crypt/Blowfish/ECB.php                                                                              0000744 0001012 0001007 00000007673 11377500062 015221  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * PHP implementation of the Blowfish algorithm in ECB mode
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: ECB.php,v 1.7 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Required parent class
 */
require_once 'Crypt/Blowfish/PHP.php';

/**
 * Example
 * <code>
 * $bf =& Crypt_Blowfish::factory('ecb');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $bf->setKey('My secret key');
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_ECB extends Crypt_Blowfish_PHP
{
    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_ECB($key = null, $iv = null)
    {
        $this->__construct($key, $iv);
    }

    /**
     * Class constructor
     *
     * @param string $key
     * @param string $iv initialization vector
     * @access public
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv_required = false;
        parent::__construct($key, $iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        } elseif (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $cipherText = '';
        $len = strlen($plainText);
        $plainText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        for ($i = 0; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($plainText, $i, 8));
            $this->_encipher($Xl, $Xr);
            $cipherText .= pack('N2', $Xl, $Xr);
        }

        return $cipherText;
    }

    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }
        if (empty($this->_P)) {
            return PEAR::raiseError('The key is not initialized.', 8);
        }

        $plainText = '';
        $len = strlen($cipherText);
        $cipherText .= str_repeat(chr(0), (8 - ($len % 8)) % 8);

        for ($i = 0; $i < $len; $i += 8) {
            list(, $Xl, $Xr) = unpack('N2', substr($cipherText, $i, 8));
            $this->_decipher($Xl, $Xr);
            $plainText .= pack('N2', $Xl, $Xr);
        }

        return $plainText;
    }
}

?>                                                                     Crypt/Blowfish/MCrypt.php                                                                           0000744 0001012 0001007 00000012144 11377500063 016034  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * MCrypt PHP extension wrapper for Crypt_Blowfish package
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: MCrypt.php,v 1.4 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Include base class
 */
require_once 'Crypt/Blowfish.php';

/**
 * Example using the factory method in CBC mode and forcing using
 * the MCrypt library.
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc', null, null, CRYPT_BLOWFISH_MCRYPT);
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123+=';
 * $key = 'My secret key';
 * $bf->setKey($key, $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey($key, $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * echo "plain text: $plaintext";
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_MCrypt extends Crypt_Blowfish
{
    /**
     * Mcrypt td resource
     *
     * @var resource
     * @access private
     */
    var $_td = null;

    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object, and sets the secret key
     *
     * @param string $key
     * @param string $mode operating mode 'ecb', 'cbc'...
     * @param string $iv initialization vector
     * @access public
     */
    function Crypt_Blowfish_MCrypt($key = null, $mode = 'ecb', $iv = null)
    {
        $this->_iv = $iv . ((strlen($iv) < 8)
                            ? str_repeat(chr(0), 8 - strlen($iv)) : '');

        $this->_td = mcrypt_module_open(MCRYPT_BLOWFISH, '', $mode, '');
        if (is_null($iv)) {
            $this->_iv = mcrypt_create_iv(8, MCRYPT_RAND);
        }

        switch (strtolower($mode)) {
            case 'ecb':
                $this->_iv_required = false;
                break;

            case 'cbc':
            default:
                $this->_iv_required = true;
                break;
        }

        $this->setKey($key, $this->_iv);
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success,
     *                           or PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        if (!is_string($plainText)) {
            return PEAR::raiseError('Input must be a string', 0);
        }

        return mcrypt_generic($this->_td, $plainText);
    }


    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText
     * @return string|PEAR_Error Returns plain text on success,
     *                           or PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        if (!is_string($cipherText)) {
            return PEAR::raiseError('Cipher text must be a string', 1);
        }

        return mdecrypt_generic($this->_td, $cipherText);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP mcrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @param string $iv 8-char initialization vector (required for CBC mode)
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     */
    function setKey($key, $iv = null)
    {
        static $keyHash = null;

        if (!is_string($key)) {
            return PEAR::raiseError('Key must be a string', 2);
        }

        $len = strlen($key);

        if ($len > 56 || $len == 0) {
            return PEAR::raiseError('Key must be less than 56 characters (bytes) and non-zero. Supplied key length: ' . $len, 3);
        }

        if ($this->_iv_required) {
            if (strlen($iv) != 8) {
                return PEAR::raiseError('IV must be 8-character (byte) long. Supplied IV length: ' . strlen($iv), 7);
            }
            $this->_iv = $iv;
        }

        $return = mcrypt_generic_init($this->_td, $key, $this->_iv);
        if ($return < 0) {
            return PEAR::raiseError('Unknown PHP MCrypt library error', 4);
        }
        return true;
    }
}

?>                                                                                                                                                                                                                                                                                                                                                                                                                            Crypt/Blowfish/PHP.php                                                                              0000744 0001012 0001007 00000016674 11377500064 015262  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the mcrypt
 * PHP extension, but uses it if available, otherwise it uses only PHP.
 * Crypt_Blowfish support encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: PHP.php,v 1.7 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @since      1.1.0
 */

/**
 * Include base class
 */
require_once 'Crypt/Blowfish.php';

/**
 * Common class for PHP-only implementations
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @since      1.1.0
 */
class Crypt_Blowfish_PHP extends Crypt_Blowfish
{
    /**
     * P-Array contains 18 32-bit subkeys
     *
     * @var array
     * @access protected
     */
    var $_P = array();

    /**
     * Array of four S-Blocks each containing 256 32-bit entries
     *
     * @var array
     * @access protected
     */
    var $_S = array();

    /**
     * Whether the IV is required
     *
     * @var boolean
     * @access protected
     */
    var $_iv_required = false;
    
    /**
     * Hash value of last used key
     * 
     * @var     string
     * @access  protected
     */
    var $_keyHash = null;

    /**
     * Crypt_Blowfish_PHP Constructor
     * Initializes the Crypt_Blowfish object, and sets
     * the secret key
     *
     * @param string $key
     * @param string $mode operating mode 'ecb' or 'cbc'
     * @param string $iv initialization vector
     * @access protected
     */
    function __construct($key = null, $iv = null)
    {
        $this->_iv = $iv . ((strlen($iv) < $this->_iv_size)
                            ? str_repeat(chr(0), $this->_iv_size - strlen($iv))
                            : '');
        if (!is_null($key)) {
            $this->setKey($key, $this->_iv);
        }
    }

    /**
     * Initializes the Crypt_Blowfish object
     *
     * @access private
     */
    function _init()
    {
        require_once 'Crypt/Blowfish/DefaultKey.php';
        $defaults = new Crypt_Blowfish_DefaultKey();
        $this->_P = $defaults->P;
        $this->_S = $defaults->S;
    }

    /**
     * Workaround for XOR on certain systems
     *
     * @param integer|float $l
     * @param integer|float $r
     * @return float
     * @access protected
     */
    function _binxor($l, $r)
    {
        $x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)
             ^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);

        return (float)(($x < 0) ? $x + 4294967296 : $x);
    }

    /**
     * Enciphers a single 64-bit block
     *
     * @param int &$Xl
     * @param int &$Xr
     * @access protected
     */
    function _encipher(&$Xl, &$Xr)
    {
        if ($Xl < 0) {
            $Xl += 4294967296;
        }
        if ($Xr < 0) {
            $Xr += 4294967296;
        }

        for ($i = 0; $i < 16; $i++) {
            $temp = $Xl ^ $this->_P[$i];
            if ($temp < 0) {
                $temp += 4294967296;
            }

            $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]
                             + $this->_S[1][($temp >> 16) & 255], 4294967296) 
                        ^ $this->_S[2][($temp >> 8) & 255]) 
                       + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;
            $Xr = $temp;
        }
        $Xr = $this->_binxor($Xl, $this->_P[16]);
        $Xl = $this->_binxor($temp, $this->_P[17]);
    }

    /**
     * Deciphers a single 64-bit block
     *
     * @param int &$Xl
     * @param int &$Xr
     * @access protected
     */
    function _decipher(&$Xl, &$Xr)
    {
        if ($Xl < 0) {
            $Xl += 4294967296;
        }
        if ($Xr < 0) {
            $Xr += 4294967296;
        }

        for ($i = 17; $i > 1; $i--) {
            $temp = $Xl ^ $this->_P[$i];
            if ($temp < 0) {
                $temp += 4294967296;
            }

            $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]
                             + $this->_S[1][($temp >> 16) & 255], 4294967296) 
                        ^ $this->_S[2][($temp >> 8) & 255]) 
                       + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;
            $Xr = $temp;
        }
        $Xr = $this->_binxor($Xl, $this->_P[1]);
        $Xl = $this->_binxor($temp, $this->_P[0]);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP mcrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @param string $iv 8-char initialization vector (required for CBC mode)
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     * @todo Fix the caching of the key
     */
    function setKey($key, $iv = null)
    {
        if (!is_string($key)) {
            return PEAR::raiseError('Key must be a string', 2);
        }

        $len = strlen($key);

        if ($len > $this->_key_size || $len == 0) {
            return PEAR::raiseError('Key must be less than ' . $this->_key_size . ' characters (bytes) and non-zero. Supplied key length: ' . $len, 3);
        }

        if ($this->_iv_required) {
            if (strlen($iv) != $this->_iv_size) {
                return PEAR::raiseError('IV must be ' . $this->_iv_size . '-character (byte) long. Supplied IV length: ' . strlen($iv), 7);
            }
            $this->_iv = $iv;
        }

        if ($this->_keyHash == md5($key)) {
            return true;
        }

        $this->_init();

        $k = 0;
        $data = 0;
        $datal = 0;
        $datar = 0;

        for ($i = 0; $i < 18; $i++) {
            $data = 0;
            for ($j = 4; $j > 0; $j--) {
                    $data = $data << 8 | ord($key{$k});
                    $k = ($k+1) % $len;
            }
            $this->_P[$i] ^= $data;
        }

        for ($i = 0; $i <= 16; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_P[$i] = $datal;
            $this->_P[$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[0][$i] = $datal;
            $this->_S[0][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[1][$i] = $datal;
            $this->_S[1][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[2][$i] = $datal;
            $this->_S[2][$i+1] = $datar;
        }
        for ($i = 0; $i < 256; $i += 2) {
            $this->_encipher($datal, $datar);
            $this->_S[3][$i] = $datal;
            $this->_S[3][$i+1] = $datar;
        }

        $this->_keyHash = md5($key);
        return true;
    }
}

?>                                                                    Crypt/Blowfish.php                                                                                  0000744 0001012 0001007 00000017672 11377500067 014635  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Crypt_Blowfish allows for encryption and decryption on the fly using
 * the Blowfish algorithm. Crypt_Blowfish does not require the MCrypt
 * PHP extension, but uses it if available, otherwise it uses only PHP.
 * Crypt_Blowfish supports encryption/decryption with or without a secret key.
 *
 * PHP versions 4 and 5
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @version    CVS: $Id: Blowfish.php,v 1.86 2008/08/30 21:53:50 jausions Exp $
 * @link       http://pear.php.net/package/Crypt_Blowfish
 */

/**
 * Required PEAR package(s)
 */
require_once 'PEAR.php';

/**
 * Engine choice constants
 */
/**
 * To let the Crypt_Blowfish package decide which engine to use
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_AUTO',   1);
/**
 * To use the MCrypt PHP extension.
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_MCRYPT', 2);
/**
 * To use the PHP-only engine.
 * @since 1.1.0
 */
define('CRYPT_BLOWFISH_PHP',    3);


/**
 * Example using the factory method in CBC mode
 * 
 * <code>
 * $bf =& Crypt_Blowfish::factory('cbc');
 * if (PEAR::isError($bf)) {
 *     echo $bf->getMessage();
 *     exit;
 * }
 * $iv = 'abc123+=';
 * $key = 'My secret key';
 * $bf->setKey($key, $iv);
 * $encrypted = $bf->encrypt('this is some example plain text');
 * $bf->setKey($key, $iv);
 * $plaintext = $bf->decrypt($encrypted);
 * if (PEAR::isError($plaintext)) {
 *     echo $plaintext->getMessage();
 *     exit;
 * }
 * // Encrypted text is padded prior to encryption
 * // so you may need to trim the decrypted result.
 * echo 'plain text: ' . trim($plaintext);
 * </code>
 *
 * To disable using the mcrypt library, define the CRYPT_BLOWFISH_NOMCRYPT
 * constant. This is useful for instance on Windows platform with a buggy
 * mdecrypt_generic() function.
 * <code>
 * define('CRYPT_BLOWFISH_NOMCRYPT', true);
 * </code>
 *
 * @category   Encryption
 * @package    Crypt_Blowfish
 * @author     Matthew Fonda <mfonda@php.net>
 * @author     Philippe Jausions <jausions@php.net>
 * @copyright  2005-2008 Matthew Fonda
 * @license    http://www.opensource.net/licenses/bsd-license.php New BSD
 * @link       http://pear.php.net/package/Crypt_Blowfish
 * @version    1.1.0RC2
 * @access     public
 */
class Crypt_Blowfish
{
    /**
     * Implementation-specific Crypt_Blowfish object
     *
     * @var object
     * @access private
     */
    var $_crypt = null;

    /**
     * Initialization vector
     *
     * @var string
     * @access protected
     */
    var $_iv = null;

    /**
     * Holds block size
     *
     * @var integer
     * @access protected
     */
    var $_block_size = 8;

    /**
     * Holds IV size
     *
     * @var integer
     * @access protected
     */
    var $_iv_size = 8;

    /**
     * Holds max key size
     *
     * @var integer
     * @access protected
     */
    var $_key_size = 56;

    /**
     * Crypt_Blowfish Constructor
     * Initializes the Crypt_Blowfish object (in EBC mode), and sets
     * the secret key
     *
     * @param string $key
     * @access public
     * @deprecated Since 1.1.0
     * @see Crypt_Blowfish::factory()
     */
    function Crypt_Blowfish($key)
    {
        $this->_crypt =& Crypt_Blowfish::factory('ecb', $key);
        if (!PEAR::isError($this->_crypt)) {
            $this->_crypt->setKey($key);
        }
    }

    /**
     * Crypt_Blowfish object factory
     *
     * This is the recommended method to create a Crypt_Blowfish instance.
     *
     * When using CRYPT_BLOWFISH_AUTO, you can force the package to ignore
     * the MCrypt extension, by defining CRYPT_BLOWFISH_NOMCRYPT.
     *
     * @param string $mode operating mode 'ecb' or 'cbc' (case insensitive)
     * @param string $key
     * @param string $iv initialization vector (must be provided for CBC mode)
     * @param integer $engine one of CRYPT_BLOWFISH_AUTO, CRYPT_BLOWFISH_PHP
     *                or CRYPT_BLOWFISH_MCRYPT
     * @return object Crypt_Blowfish object or PEAR_Error object on error
     * @access public
     * @static
     * @since 1.1.0
     */
    function &factory($mode = 'ecb', $key = null, $iv = null, $engine = CRYPT_BLOWFISH_AUTO)
    {
        switch ($engine) {
            case CRYPT_BLOWFISH_AUTO:
                if (!defined('CRYPT_BLOWFISH_NOMCRYPT')
                    && extension_loaded('mcrypt')) {
                    $engine = CRYPT_BLOWFISH_MCRYPT;
                } else {
                    $engine = CRYPT_BLOWFISH_PHP;
                }
                break;
            case CRYPT_BLOWFISH_MCRYPT:
                if (!PEAR::loadExtension('mcrypt')) {
                    return PEAR::raiseError('MCrypt extension is not available.');
                }
                break;
        }

        switch ($engine) {
            case CRYPT_BLOWFISH_PHP:
                $mode = strtoupper($mode);
                $class = 'Crypt_Blowfish_' . $mode;
                include_once 'Crypt/Blowfish/' . $mode . '.php';
                $crypt = new $class(null);
                break;

            case CRYPT_BLOWFISH_MCRYPT:
                include_once 'Crypt/Blowfish/MCrypt.php';
                $crypt = new Crypt_Blowfish_MCrypt(null, $mode);
                break;
        }

        if (!is_null($key) || !is_null($iv)) {
            $result = $crypt->setKey($key, $iv);
            if (PEAR::isError($result)) {
                return $result;
            }
        }

        return $crypt;
    }

    /**
     * Returns the algorithm's block size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getBlockSize()
    {
        return $this->_block_size;
    }

    /**
     * Returns the algorithm's IV size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getIVSize()
    {
        return $this->_iv_size;
    }

    /**
     * Returns the algorithm's maximum key size
     *
     * @return integer
     * @access public
     * @since 1.1.0
     */
    function getMaxKeySize()
    {
        return $this->_key_size;
    }

    /**
     * Deprecated isReady method
     *
     * @return bool
     * @access public
     * @deprecated
     */
    function isReady()
    {
        return true;
    }

    /**
     * Deprecated init method - init is now a private
     * method and has been replaced with _init
     *
     * @return bool
     * @access public
     * @deprecated
     */
    function init()
    {
        return $this->_crypt->init();
    }

    /**
     * Encrypts a string
     *
     * Value is padded with NUL characters prior to encryption. You may
     * need to trim or cast the type when you decrypt.
     *
     * @param string $plainText the string of characters/bytes to encrypt
     * @return string|PEAR_Error Returns cipher text on success, PEAR_Error on failure
     * @access public
     */
    function encrypt($plainText)
    {
        return $this->_crypt->encrypt($plainText);
    }


    /**
     * Decrypts an encrypted string
     *
     * The value was padded with NUL characters when encrypted. You may
     * need to trim the result or cast its type.
     *
     * @param string $cipherText the binary string to decrypt
     * @return string|PEAR_Error Returns plain text on success, PEAR_Error on failure
     * @access public
     */
    function decrypt($cipherText)
    {
        return $this->_crypt->decrypt($cipherText);
    }

    /**
     * Sets the secret key
     * The key must be non-zero, and less than or equal to
     * 56 characters (bytes) in length.
     *
     * If you are making use of the PHP MCrypt extension, you must call this
     * method before each encrypt() and decrypt() call.
     *
     * @param string $key
     * @return boolean|PEAR_Error  Returns TRUE on success, PEAR_Error on failure
     * @access public
     */
    function setKey($key)
    {
        return $this->_crypt->setKey($key);
    }
}

?>                                                                      README.txt                                                                                          0000755 0001012 0001007 00000024107 11204545252 012727  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               Better Together Discount Module for Zen Cart 1.3
Version 2.0 
--------------------------------------------------
Released under the GNU General Public License
See license.txt file.
--------------------------------------------------
Author: Scott Wilson
http://www.thatsoftwareguy.com 
Zen Forum PM swguy
Donations welcome at http://donate.thatsoftwareguy.com/

Even more information on this contribution is provided at 

http://www.thatsoftwareguy.com/zencart_better_together.html

Please read the FAQ on this page before posting to the forum.

No warranties expressed or implied; use at your own risk.

This module should only be used with ZenCart 1.3.5 or higher. 
If you are still running an earlier verison of ZenCart, please upgrade
before installing this module.  Alternately, you may use Better Together
version 1.1, which is compatible with ZenCart 1.3.0 or higher.

History: 
2.0  09/01/2008 - Added price sorting, add_cat_to_prod
1.6  12/14/2007 - Compatibility with 1.3.8.    
1.5a 09/18/2007 - Fixed Google Checkout issue.
1.5  09/08/2007 - Fixed some messages; consolidated marketing text down to 
                  one div; only display marketing text if module turned on
1.4a 07/31/2007 - Bad file upload
1.4 07/31/2007 - Simplified inclusion of marketing logic by adding it to this 
                 package.  Some minor language improvements.
1.3 12/30/2006 - Adding marketing ability to print discounts in reverse order.
                 (If buy A, get B free is offered, can now show this on 
                 B's page, not just A's page.)
               - Allow products which are ordered in odd quantities to be 
                 used as two-for-ones *and* better together discounts if so
                 specified.  Previously, two-for-one products were not 
                 additionally checked for better together discounts.
1.2 12/03/2006 - Adding explicit two for one support
1.1 09/26/2006 - Second Release (providing PHP 4 compatibility)
1.0 09/15/2006 - First Release 
--------------------------------------------------
Overview: 
The gold standard of online retailing is Amazon.com. Zen Cart store operators
looking to increase their profitability should constantly be asking, "WWAD?"
or "What would Amazon do?"

When you look at an item in Amazon, not only is a cross selling recommendation
made, a discount is offered to persuade the customer to accept the
recommendation.  This mod permits you to offer this type of discounted cross
selling in your Zen Cart.

You may specify

* Buy item <x>, get item <y> at a discount
* Buy item <x>, get an item from category <b> at a discount
* Buy an item from category <a>, get an item from category <b> at a discount
* Buy an item from category <a>, get item <x> at a discount

Discounts may be specified as percentages of the latter item's price or as 
absolute values in the currency you cart uses.

Using these discount specifications, messages are automatically displayed on 
the product_info page offering cross sell offers applicable to that item.

At the moment, linking must be done in code by default. 
If you wish, you may upgrade to the Better Together Admin Panel; see 
http://www.thatsoftwareguy.com/zencart_better_together_admin.html

Detailed Description: 

Linkages are specified in the setup() method at the bottom of the file 
includes/modules/order_total/ot_better_together.php.
Several examples are provided.

In addition to linkages, two for one offers can be done for identical
products.  Linkages will be discussed first.

Four types of linkages may be performed.   The format of each of these
is the same: first identifier (product or category), second identifier
(product or category), "%" or "$" to indicate how discounting is to be done,
and a number, indicating the discount amount.  

Note that where the word "category" is used, it means parent category,
which is not the same as top level category for items in subcategories.

The four calls for the four types of discounting are 
  
* add_prod_to_prod() 
* add_prod_to_cat()
* add_cat_to_cat() 
* add_cat_to_prod()

If a straight two for one discount is what is desired, the calls are

* add_twoforone_prod()
* add_twoforone_cat()


Let's consider two products: product 5 from category 3, and product 2
from category 1.

So suppose you want to offer a 50% discount on product 5 with the purchase
of product 2.   In the setup() function, add the line 

   $this->add_prod_to_prod(2,5,"%", 50); 

Want to make it buy product 2, get product 5 free? 
   $this->add_prod_to_prod(2,5,"%", 100); 

How about buy one product 2, get one free? 
   $this->add_prod_to_prod(2,2,"%", 100); 

Remember product 5 is in category 3. If instead of specifying product 5
in particular, you want to discount any item in category 3 by 20% with the 
purchase of a product 2 item, use

   $this->add_prod_to_cat(2,3,"%", 20); 

Discount can be done in currencies as well.  To offer $7 (or 7 of whatever
currency your cart uses), use 

   $this->add_prod_to_cat(2,3,"$", 7); 

(The "$" is just used to specify currency; your cart's currency settings 
will be respected when computing the discount.)

Remember product 2 is in category 1.  If you want to widen the discount to 
provide a discount of 20% off any item in category 3 when an item from
category 1 is purchased, use 

   $this->add_cat_to_cat(1,3,"%", 20); 

Any number of these discounts may be offered; discount computation will
be done in the order in which your discounts are specified in setup(),
and items will be processed in price order for the first parameter and 
reverse price order for the second.  In other words, the least expensive 
eligible item will be discounted by Better Together.  

(Note that in Better Together 1.x, items were processed in the order in 
which they appeared in the cart.)

Using the examples above, suppose these items are in your cart: 

* 1 - Product 2, category 1
* 2 - Product 10, category 1
* 2 - Product 20, category 3
* 2 - Product 5, category 3

and suppose you have coded these discounts: 

   $this->add_prod_to_prod(2,5,"$", 7); 
   $this->add_cat_to_cat(1,3,"%", 25); 

The following discounts will be computed: 
   - $7 off ONE product 5 because of ONE product 2 (rule 1)
   - 25% each off TWO product 20 because of TWO product 10 (rule 2) 

To get $7 off the second product 5, the customer would need to add 
a second product 2 to the cart.

With the same cart, coding 

   $this->add_cat_to_cat(1,3,"%", 25); 
   $this->add_prod_to_prod(2,5,"$", 7); 

Would compute the following discount: 
  - 25% off ONE product 20 because of ONE product 2 (rule 1)
  - 25% off ONE product 20 because of ONE product 10 (rule 1)
  - 25% off ONE product 5 because of ONE product 10 (rule 1)

Obviously these could be very different discounts!  

To create a two for one discount for product 5, simply code 
         $this->add_twoforone_prod(5);

And to create two for one discount for all products in category 3, code
         $this->add_twoforone_cat(3);

Note the difference between 
         $this->add_twoforone_cat(3);
and 
         $this->add_cat_to_cat(3,3,"%", 100); 

The latter says, "buy any item from category three, and get 100% 
off any other item from category three."  The former says, "all
items in category three are buy one, get an identical item free."
So if a customer bought items 20 and 30 from category three, 
a discount would only be given in the latter case.

To make these discounts visible on your product info page, customize the file
includes/templates/template_default/templates/tpl_product_info_display.php
as described in step 6 below in the installation instructions.  
This step will create text like this: 

   Buy this item, get an item from (link)Levis Jeans free
   Buy this item, get a (link)t-shirt free

The link is created to facilitate the cross-sell.

This step is optional; if you prefer, you can add your own cross-selling text.

If you need help adding custom logic, please go to www.thatsoftwareguy.com
and send me email.  There is a fee for this service based on the complexity
of the requested change.

--------------------------------------------------

Installation Instructions: 
0. Back up everything!  Try this in a test environment prior to installing
it on a live shop.

1. If you already have the Better Together module installed, please 
deinstall your old copy by going to Admin->Modules->Order Total, 
selecting "Better Together" and pressing the "Remove" button.  Make
a note of your settings so you can apply them to the new version.

2. Copy the contents of the folder you have unzipped to 
the root directory of your shop.  

3. Login to admin and in Modules->Order Total you will see 'Better Together' listed along with all the other modules available.

4. Click on 'Better Together' to highlight the module and click on 'Install'

5. Decide on the parameters you wish to use.  The easiest way to do this
is to open a shopping cart in another window, and just start adding 
discounts to includes/modules/order_total/ot_better_together.php.
The discounts are shown on the second step in 
"Your Total" under "Better Together."

6. Customize the tpl_product_info_display.php file to advertise
your discounts.  Put the file 
includes/templates/template_default/templates/tpl_product_info_display.php
into includes/templates/<Your Template>/templates, and be sure
you have installed tpl_better_together_marketing.php in this 
same directory.  Then add this block of code to the
tpl_product_info_display.php file 

<?php 
require($template->get_template_dir('/tpl_better_together_marketing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_better_together_marketing.php');
?>

The placement of this code is a matter of personal preference.
Try placing it below the product description (line 87 in
tpl_product_info_display.php in 1.3.7), and adjust to your taste.

7. If you wish, get a copy of the Better Together Promotional Page by 
following the links on 

http://www.thatsoftwareguy.com/zencart_better_together.html

This page displays all the Better Together discounts you are offering.
 
New Files
=========
includes/languages/english/modules/order_total/ot_better_together.php
includes/modules/order_total/ot_better_together.php
includes/templates/custom/templates/tpl_better_together_marketing.php

                                                                                                                                                                                                                                                                                                                                                                                                                                                         __MACOSX/                                                                                           0000755 0001012 0001007 00000000000 11463527446 012526  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/                                                                                     0000755 0001012 0001007 00000000000 11434735673 013617  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/.DS_Store                                                                            0000755 0001012 0001007 00000000000 11434735673 015273  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/                                                                            0000755 0001012 0001007 00000000000 11434735673 015425  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/.DS_Store                                                                   0000755 0001012 0001007 00000000000 11434735673 017101  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/auto_loaders/                                                               0000755 0001012 0001007 00000000000 11434735673 020106  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/auto_loaders/.DS_Store                                                      0000755 0001012 0001007 00000000000 11434735673 021562  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/auto_loaders/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11222177366 021776  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/extra_configures/                                                           0000755 0001012 0001007 00000000000 11434735673 020774  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/extra_configures/.DS_Store                                                  0000755 0001012 0001007 00000000000 11434735673 022450  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/extra_configures/._.DS_Store                                                0000755 0001012 0001007 00000000122 11222177366 022664  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/functions/                                                                  0000755 0001012 0001007 00000000000 11434735673 017435  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/functions/.DS_Store                                                         0000755 0001012 0001007 00000000000 11434735673 021111  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/functions/._.DS_Store                                                       0000755 0001012 0001007 00000000122 11222177366 021325  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/init_includes/                                                              0000755 0001012 0001007 00000000000 11434735673 020256  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/init_includes/.DS_Store                                                     0000755 0001012 0001007 00000000000 11434735673 021732  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/init_includes/._.DS_Store                                                   0000755 0001012 0001007 00000000122 11222177366 022146  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/javascript/                                                                 0000755 0001012 0001007 00000000000 11434735673 017573  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/javascript/.DS_Store                                                        0000755 0001012 0001007 00000000000 11434735673 021247  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/javascript/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11270052752 021455  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/templates/                                                                  0000755 0001012 0001007 00000000000 11434735673 017423  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/.DS_Store                                                         0000755 0001012 0001007 00000000000 11434735673 021077  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/templates/                                                        0000755 0001012 0001007 00000000000 11434735673 021421  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/templates/.DS_Store                                               0000755 0001012 0001007 00000000000 11434735673 023075  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/templates/module_manager/                                         0000755 0001012 0001007 00000000000 11434735673 024400  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/templates/module_manager/.DS_Store                                0000755 0001012 0001007 00000000000 11434735673 026054  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/admin/includes/templates/templates/module_manager/._.DS_Store                              0000755 0001012 0001007 00000000122 11204742124 026256  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/templates/templates/._.DS_Store                                             0000755 0001012 0001007 00000000122 11204742124 023277  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/templates/._.DS_Store                                                       0000755 0001012 0001007 00000000122 11204742124 021301  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/includes/._.DS_Store                                                                 0000755 0001012 0001007 00000000122 11434760264 017315  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/admin/._.DS_Store                                                                          0000755 0001012 0001007 00000000122 11434740650 015504  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/                                                                                  0000755 0001012 0001007 00000000000 11434760301 014001  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/                                                                            0000755 0001012 0001007 00000000000 11434760301 015071  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/._.DS_Store                                                                 0000755 0001012 0001007 00000000122 11434735673 017005  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/                                                                   0000755 0001012 0001007 00000000000 11434760301 016677  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/._.DS_Store                                                        0000755 0001012 0001007 00000000122 11434735673 020613  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/auto_loaders/                                                      0000755 0001012 0001007 00000000000 11434760301 021360  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/auto_loaders/._.DS_Store                                           0000755 0001012 0001007 00000000122 11434735673 023274  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/extra_configures/                                                  0000755 0001012 0001007 00000000000 11434760301 022246  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/extra_configures/._.DS_Store                                       0000755 0001012 0001007 00000000122 11434735673 024162  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/functions/                                                         0000755 0001012 0001007 00000000000 11434760301 020707  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/functions/._.DS_Store                                              0000755 0001012 0001007 00000000122 11434735673 022623  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/init_includes/                                                     0000755 0001012 0001007 00000000000 11434760301 021530  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/init_includes/._.DS_Store                                          0000755 0001012 0001007 00000000122 11434735673 023444  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/javascript/                                                        0000755 0001012 0001007 00000000000 11434760301 021045  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/javascript/._.DS_Store                                             0000755 0001012 0001007 00000000122 11434735673 022761  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/templates/                                                         0000755 0001012 0001007 00000000000 11434760301 020675  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/templates/._.DS_Store                                              0000755 0001012 0001007 00000000122 11434735673 022611  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/templates/templates/                                               0000755 0001012 0001007 00000000000 11434760301 022673  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/templates/templates/._.DS_Store                                    0000755 0001012 0001007 00000000122 11434735673 024607  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/admin/includes/templates/templates/module_manager/                                0000755 0001012 0001007 00000000000 11434760301 025652  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/admin/includes/templates/templates/module_manager/._.DS_Store                     0000755 0001012 0001007 00000000122 11434735673 027566  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/cache/                                                                            0000755 0001012 0001007 00000000000 11434760301 015044  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/cache/._.DS_Store                                                                 0000755 0001012 0001007 00000000122 11434735673 016760  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/docs/                                                                             0000755 0001012 0001007 00000000000 11434760301 014731  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/docs/._.DS_Store                                                                  0000755 0001012 0001007 00000000122 11434735673 016645  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/                                                                         0000755 0001012 0001007 00000000000 11434760301 015607  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/._.DS_Store                                                              0000755 0001012 0001007 00000000122 11434735673 017523  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/auto_loaders/                                                            0000755 0001012 0001007 00000000000 11434760301 020270  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/auto_loaders/._.DS_Store                                                 0000755 0001012 0001007 00000000122 11434735673 022204  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/classes/                                                                 0000755 0001012 0001007 00000000000 11434760301 017244  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/classes/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11434735673 021160  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/extra_datafiles/                                                         0000755 0001012 0001007 00000000000 11434760301 020746  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/extra_datafiles/._.DS_Store                                              0000755 0001012 0001007 00000000122 11434735673 022662  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/functions/                                                               0000755 0001012 0001007 00000000000 11434760301 017617  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/functions/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11434735673 021533  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/functions/extra_functions/                                               0000755 0001012 0001007 00000000000 11434760301 023032  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/functions/extra_functions/._.DS_Store                                    0000755 0001012 0001007 00000000122 11434735673 024746  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/init_includes/                                                           0000755 0001012 0001007 00000000000 11434760301 020440  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/init_includes/._.DS_Store                                                0000755 0001012 0001007 00000000122 11434735673 022354  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/                                                               0000755 0001012 0001007 00000000000 11434760301 017555  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11434735673 021471  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/english/                                                       0000755 0001012 0001007 00000000000 11434760301 021206  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/english/._.DS_Store                                            0000755 0001012 0001007 00000000122 11434735673 023122  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/english/extra_definitions/                                     0000755 0001012 0001007 00000000000 11434760301 024724  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/english/extra_definitions/._.DS_Store                          0000755 0001012 0001007 00000000122 11434735673 026640  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/english/modules/                                               0000755 0001012 0001007 00000000000 11434760301 022656  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/english/modules/._.DS_Store                                    0000755 0001012 0001007 00000000122 11434735673 024572  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/english/modules/order_total/                                   0000755 0001012 0001007 00000000000 11434760301 025174  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/english/modules/order_total/._.DS_Store                        0000755 0001012 0001007 00000000122 11434735673 027110  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/languages/english/theme160/                                              0000755 0001012 0001007 00000000000 11434760301 022537  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/languages/english/theme160/._.DS_Store                                   0000755 0001012 0001007 00000000122 11434735673 024453  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/                                                                 0000755 0001012 0001007 00000000000 11434760301 017257  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11434735673 021173  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/order_total/                                                     0000755 0001012 0001007 00000000000 11434760301 021575  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/order_total/._.DS_Store                                          0000755 0001012 0001007 00000000122 11434735673 023511  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/pages/                                                           0000755 0001012 0001007 00000000000 11434760301 020356  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/pages/._.DS_Store                                                0000755 0001012 0001007 00000000122 11434735673 022272  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/pages/product_info/                                              0000755 0001012 0001007 00000000000 11434760301 023051  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/pages/product_info/._.DS_Store                                   0000755 0001012 0001007 00000000122 11434735673 024765  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/theme150/                                                        0000755 0001012 0001007 00000000000 11434760301 020607  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/theme150/._.DS_Store                                             0000755 0001012 0001007 00000000122 11434735673 022523  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/modules/theme160/                                                        0000755 0001012 0001007 00000000000 11434760301 020610  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/modules/theme160/._.DS_Store                                             0000755 0001012 0001007 00000000122 11434735673 022524  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/templates/                                                               0000755 0001012 0001007 00000000000 11434760301 017605  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/templates/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11434735673 021521  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/templates/theme160/                                                      0000755 0001012 0001007 00000000000 11434760301 021136  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/templates/theme160/._.DS_Store                                           0000755 0001012 0001007 00000000122 11434735673 023052  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/templates/theme160/sideboxes/                                            0000755 0001012 0001007 00000000000 11434760301 023123  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/templates/theme160/sideboxes/._.DS_Store                                 0000755 0001012 0001007 00000000122 11434735673 025037  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/__MACOSX/includes/templates/theme160/templates/                                            0000755 0001012 0001007 00000000000 11434760301 023134  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/__MACOSX/includes/templates/theme160/templates/._.DS_Store                                 0000755 0001012 0001007 00000000122 11434735673 025050  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/cache/                                                                                     0000755 0001012 0001007 00000000000 11434735673 013572  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/cache/.DS_Store                                                                            0000755 0001012 0001007 00000000000 11434735673 015246  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/cache/._.DS_Store                                                                          0000755 0001012 0001007 00000000122 11216155575 015463  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/docs/                                                                                      0000755 0001012 0001007 00000000000 11434735673 013457  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/docs/.DS_Store                                                                             0000755 0001012 0001007 00000000000 11434735673 015133  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/docs/._.DS_Store                                                                           0000755 0001012 0001007 00000000122 11204743005 015334  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/                                                                                  0000755 0001012 0001007 00000000000 11463560060 014321  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/.DS_Store                                                                         0000755 0001012 0001007 00000000000 11434735673 016011  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/auto_loaders/                                                                     0000755 0001012 0001007 00000000000 11434735673 017016  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/auto_loaders/.DS_Store                                                            0000755 0001012 0001007 00000000000 11434735673 020472  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/auto_loaders/._.DS_Store                                                          0000755 0001012 0001007 00000000122 11204742124 020674  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/classes/                                                                          0000755 0001012 0001007 00000000000 11434735673 015772  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/classes/.DS_Store                                                                 0000755 0001012 0001007 00000000000 11434735673 017446  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/classes/._.DS_Store                                                               0000755 0001012 0001007 00000000122 11243244435 017655  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/extra_datafiles/                                                                  0000755 0001012 0001007 00000000000 11434735673 017474  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/extra_datafiles/.DS_Store                                                         0000755 0001012 0001007 00000000000 11434735673 021150  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/extra_datafiles/._.DS_Store                                                       0000755 0001012 0001007 00000000122 11270050375 021355  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/functions/                                                                        0000755 0001012 0001007 00000000000 11434735673 016345  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/functions/.DS_Store                                                               0000755 0001012 0001007 00000000000 11434735673 020021  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/functions/extra_functions/                                                        0000755 0001012 0001007 00000000000 11434735673 021560  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/functions/extra_functions/.DS_Store                                               0000755 0001012 0001007 00000000000 11434735673 023234  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/functions/extra_functions/._.DS_Store                                             0000755 0001012 0001007 00000000122 11270050402 023430  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/functions/._.DS_Store                                                             0000755 0001012 0001007 00000000122 11274765724 020245  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/init_includes/                                                                    0000755 0001012 0001007 00000000000 11434735673 017166  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/init_includes/.DS_Store                                                           0000755 0001012 0001007 00000000000 11434735673 020642  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/init_includes/._.DS_Store                                                         0000755 0001012 0001007 00000000122 11204742125 021045  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/                                                                        0000755 0001012 0001007 00000000000 11434735673 016303  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/.DS_Store                                                               0000755 0001012 0001007 00000000000 11434735673 017757  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/                                                                0000755 0001012 0001007 00000000000 11434735673 017734  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/.DS_Store                                                       0000755 0001012 0001007 00000000000 11434735673 021410  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/extra_definitions/                                              0000755 0001012 0001007 00000000000 11434735673 023452  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/extra_definitions/.DS_Store                                     0000755 0001012 0001007 00000000000 11434735673 025126  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/extra_definitions/._.DS_Store                                   0000755 0001012 0001007 00000000122 11311547330 025331  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/modules/                                                        0000755 0001012 0001007 00000000000 11434735673 021404  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/.DS_Store                                               0000755 0001012 0001007 00000000000 11434735673 023060  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/order_total/                                            0000755 0001012 0001007 00000000000 11434735673 023722  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/order_total/.DS_Store                                   0000755 0001012 0001007 00000000000 11434735673 025376  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/order_total/._.DS_Store                                 0000755 0001012 0001007 00000000122 11434754400 025605  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/modules/._.DS_Store                                             0000755 0001012 0001007 00000000122 11434756672 023304  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/modules/payment/                                                0000755 0001012 0001007 00000000000 11434760306 023050  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/payment/._.DS_Store                                     0000755 0001012 0001007 00000000122 11434754405 024751  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/modules/shipping/                                               0000755 0001012 0001007 00000000000 11434760306 023214  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/modules/shipping/._.DS_Store                                    0000755 0001012 0001007 00000000122 11434754524 025117  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/theme160/                                                       0000755 0001012 0001007 00000000000 11434735673 021265  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/theme160/.DS_Store                                              0000755 0001012 0001007 00000000000 11434735673 022741  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/theme160/._.DS_Store                                            0000755 0001012 0001007 00000000122 11204743004 023141  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/._.DS_Store                                                     0000755 0001012 0001007 00000000122 11434754366 021632  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/english/html_includes/                                                  0000755 0001012 0001007 00000000000 11434760306 022555  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/languages/english/html_includes/._.DS_Store                                       0000755 0001012 0001007 00000000122 11434754323 024455  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/languages/._.DS_Store                                                             0000755 0001012 0001007 00000000122 11434754345 020176  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/                                                                          0000755 0001012 0001007 00000000000 11434735673 016005  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/.DS_Store                                                                 0000755 0001012 0001007 00000000000 11434735673 017461  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/order_total/                                                              0000755 0001012 0001007 00000000000 11434735673 020323  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/order_total/.DS_Store                                                     0000755 0001012 0001007 00000000000 11434735673 021777  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/order_total/._.DS_Store                                                   0000755 0001012 0001007 00000000122 11311525531 022201  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/pages/                                                                    0000755 0001012 0001007 00000000000 11434735673 017104  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/pages/.DS_Store                                                           0000755 0001012 0001007 00000000000 11434735673 020560  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/pages/product_info/                                                       0000755 0001012 0001007 00000000000 11434735673 021577  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/pages/product_info/.DS_Store                                              0000755 0001012 0001007 00000000000 11434735673 023253  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/pages/product_info/._.DS_Store                                            0000755 0001012 0001007 00000000122 11270052550 023455  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/pages/._.DS_Store                                                         0000755 0001012 0001007 00000000122 11270052616 020765  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/theme150/                                                                 0000755 0001012 0001007 00000000000 11434735673 017335  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/theme150/.DS_Store                                                        0000755 0001012 0001007 00000000000 11434735673 021011  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/theme150/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11311547421 021215  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/theme160/                                                                 0000755 0001012 0001007 00000000000 11434735673 017336  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/theme160/.DS_Store                                                        0000755 0001012 0001007 00000000000 11434735673 021012  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/theme160/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11311547421 021216  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/._.DS_Store                                                               0000755 0001012 0001007 00000000122 11270052550 017663  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/sideboxes/                                                                0000755 0001012 0001007 00000000000 11434760306 017761  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/sideboxes/._.DS_Store                                                     0000755 0001012 0001007 00000000122 11243244435 021655  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/modules/sideboxes/theme160/                                                       0000755 0001012 0001007 00000000000 11434760306 021312  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/modules/sideboxes/theme160/._.DS_Store                                            0000755 0001012 0001007 00000000122 11243244435 023206  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/                                                                        0000755 0001012 0001007 00000000000 11463560063 016322  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/.DS_Store                                                               0000755 0001012 0001007 00000000000 11434735673 020007  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/                                                               0000755 0001012 0001007 00000000000 11434735673 017664  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/.DS_Store                                                      0000755 0001012 0001007 00000000000 11434735673 021340  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/sideboxes/                                                     0000755 0001012 0001007 00000000000 11434735673 021651  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/sideboxes/.DS_Store                                            0000755 0001012 0001007 00000000000 11434735673 023325  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/sideboxes/._.DS_Store                                          0000755 0001012 0001007 00000000122 11311550514 023526  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/templates/                                                     0000755 0001012 0001007 00000000000 11434735673 021662  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/templates/.DS_Store                                            0000755 0001012 0001007 00000000000 11434735673 023336  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/templates/._.DS_Store                                          0000755 0001012 0001007 00000000122 11270052135 023537  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11307154755 021555  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/css/                                                           0000755 0001012 0001007 00000000000 11434760307 020444  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/css/._.DS_Store                                                0000755 0001012 0001007 00000000122 11270052260 022330  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/images/                                                        0000755 0001012 0001007 00000000000 11434760307 021121  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/images/._.DS_Store                                             0000755 0001012 0001007 00000000122 11270060142 023003  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/images/slimbox/                                                0000755 0001012 0001007 00000000000 11434760307 022576  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/images/slimbox/._.DS_Store                                     0000755 0001012 0001007 00000000122 11270060142 024460  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/theme160/jscript/                                                       0000755 0001012 0001007 00000000000 11434760307 021332  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/theme160/jscript/._.DS_Store                                            0000755 0001012 0001007 00000000122 11307154750 023226  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/._.DS_Store                                                             0000644 0001012 0001007 00000000122 11463560016 020213  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/                                                               0000755 0001012 0001007 00000000000 11434760306 017612  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/                                                      0000755 0001012 0001007 00000000000 11434760306 021143  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/._.DS_Store                                           0000755 0001012 0001007 00000000122 11434735673 023052  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/theme160/css/                                                  0000755 0001012 0001007 00000000000 11434760306 021733  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/css/._.DS_Store                                       0000755 0001012 0001007 00000000122 11434735673 023642  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/theme160/images/                                               0000755 0001012 0001007 00000000000 11434760306 022410  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/images/._.DS_Store                                    0000755 0001012 0001007 00000000122 11434735673 024317  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/theme160/images/slimbox/                                       0000755 0001012 0001007 00000000000 11434760306 024065  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/images/slimbox/._.DS_Store                            0000755 0001012 0001007 00000000122 11434735673 025774  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/theme160/jscript/                                              0000755 0001012 0001007 00000000000 11434760306 022621  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/jscript/._.DS_Store                                   0000755 0001012 0001007 00000000122 11434735673 024530  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/__MACOSX/theme160/templates/                                            0000755 0001012 0001007 00000000000 11434760306 023141  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/__MACOSX/theme160/templates/._.DS_Store                                 0000755 0001012 0001007 00000000122 11434735673 025050  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/template_default/                                                       0000755 0001012 0001007 00000000000 11434760306 021641  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/template_default/._.DS_Store                                            0000755 0001012 0001007 00000000122 11434760176 023544  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/templates/template_default/images/                                                0000755 0001012 0001007 00000000000 11434760306 023106  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/templates/template_default/images/._.DS_Store                                     0000755 0001012 0001007 00000000122 11434756704 025013  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/._.DS_Store                                                                       0000644 0001012 0001007 00000000122 11463560016 016215  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/                                                                         0000755 0001012 0001007 00000000000 11434760305 015613  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/classes/                                                                 0000755 0001012 0001007 00000000000 11434760305 017250  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/classes/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11434735673 021160  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/includes/                                                                0000755 0001012 0001007 00000000000 11434760305 017421  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/includes/._.DS_Store                                                     0000755 0001012 0001007 00000000122 11434735673 021331  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/includes/modules/                                                        0000755 0001012 0001007 00000000000 11434760305 021071  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/includes/modules/._.DS_Store                                             0000755 0001012 0001007 00000000122 11434735673 023001  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/includes/modules/pages/                                                  0000755 0001012 0001007 00000000000 11434760305 022170  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/includes/modules/pages/._.DS_Store                                       0000755 0001012 0001007 00000000122 11434735673 024100  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/includes/modules/pages/product_info/                                     0000755 0001012 0001007 00000000000 11434760305 024663  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/includes/modules/pages/product_info/._.DS_Store                          0000755 0001012 0001007 00000000122 11434735673 026573  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/languages/                                                               0000755 0001012 0001007 00000000000 11434760305 017561  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/languages/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11434735673 021471  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/languages/english/                                                       0000755 0001012 0001007 00000000000 11434760305 021212  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/languages/english/._.DS_Store                                            0000755 0001012 0001007 00000000122 11434735673 023122  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/languages/english/extra_definitions/                                     0000755 0001012 0001007 00000000000 11434760305 024730  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/languages/english/extra_definitions/._.DS_Store                          0000755 0001012 0001007 00000000122 11434735673 026640  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/modules/                                                                 0000755 0001012 0001007 00000000000 11434760305 017263  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/modules/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11434735673 021173  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/modules/sideboxes/                                                       0000755 0001012 0001007 00000000000 11434760305 021250  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/modules/sideboxes/._.DS_Store                                            0000755 0001012 0001007 00000000122 11434735673 023160  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/modules/sideboxes/theme160/                                              0000755 0001012 0001007 00000000000 11434760305 022601  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/modules/sideboxes/theme160/._.DS_Store                                   0000755 0001012 0001007 00000000122 11434735673 024511  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/templates/                                                               0000755 0001012 0001007 00000000000 11434760305 017611  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/templates/._.DS_Store                                                    0000755 0001012 0001007 00000000122 11434735673 021521  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/templates/theme160/                                                      0000755 0001012 0001007 00000000000 11434760305 021142  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/templates/theme160/._.DS_Store                                           0000755 0001012 0001007 00000000122 11434735673 023052  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/__MACOSX/templates/theme160/templates/                                            0000755 0001012 0001007 00000000000 11434760305 023140  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/__MACOSX/templates/theme160/templates/._.DS_Store                                 0000755 0001012 0001007 00000000122 11434735673 025050  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/includes/                                                                         0000755 0001012 0001007 00000000000 11434760306 016132  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/includes/._.DS_Store                                                              0000755 0001012 0001007 00000000122 11270052550 020021  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/includes/modules/                                                                 0000755 0001012 0001007 00000000000 11434760306 017602  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/includes/modules/._.DS_Store                                                      0000755 0001012 0001007 00000000122 11270052550 021471  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/includes/modules/pages/                                                           0000755 0001012 0001007 00000000000 11434760306 020701  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/includes/modules/pages/._.DS_Store                                                0000755 0001012 0001007 00000000122 11270052616 022573  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/includes/includes/modules/pages/product_info/                                              0000755 0001012 0001007 00000000000 11434760306 023374  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/includes/includes/modules/pages/product_info/._.DS_Store                                   0000755 0001012 0001007 00000000122 11270052550 025263  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/adminhome/                                                                                 0000775 0001012 0001007 00000000000 11463527415 014465  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/adminhome/._.DS_Store                                                                      0000644 0001012 0001007 00000000122 11463526464 016361  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/adminhome/includes/                                                                        0000775 0001012 0001007 00000000000 11463527415 016273  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/adminhome/includes/._.DS_Store                                                             0000644 0001012 0001007 00000000122 11463526464 020167  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/adminhome/includes/boxes/                                                                  0000775 0001012 0001007 00000000000 11463527415 017413  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/adminhome/includes/boxes/._.DS_Store                                                       0000644 0001012 0001007 00000000122 11463526471 021305  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     __MACOSX/adminhome/includes/boxes/extra_boxes/                                                      0000775 0001012 0001007 00000000000 11463527415 021736  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               __MACOSX/adminhome/includes/boxes/extra_boxes/._.DS_Store                                           0000644 0001012 0001007 00000000122 11463526464 023632  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                                       	   2          R            @                                                                                                                                                                                                                                                                                                                                                                                                                                                                     _readme_files/                                                                                      0000755 0001012 0001007 00000000000 11434761612 014005  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               _readme_files/example_large.jpg                                                                     0000755 0001012 0001007 00000047264 11171212031 017314  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                JFIF  H H   C 		



           C                                                  &                	 Y    !1"AQq2BRa#U$3SbrCT%457DEVctdes             )      !1A"2Qaq#Bb   ? KL!;ԫ1ki)?Xm<\h&ǳԮt$0,_6:()`hwu=@boE^}wYɷfik]*E:vQgֽq7Ɉ.܀֟|E?S \ \ ],=单*:sf-r:ZP]>*IS)=2tTdnOx+SM/>* PBEVwq-.AURᝣOFZ	?gQda/kt5̲Ǳ'؂VH"W4{PDK;ep!Awf{ w2=sU;⢊9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Cft) &2U6.MtC2 ~>fyq 	/`}mAw[IgԂn8[~V˻ScDcx{tׯ Y쿽X1#mAQ}ߵ)M/J*p15uLw^Lۍ|bG{U]aEY<XsŻ/z*Yod<4W_D:R-W֦oqk{SBV!z'l <J  XA/;LZR8
B$ ւp@@@@@@@@@@@A+wA2
SqRj/ftKOx{\nhTՉ"hѩI˟2oKJ\ǣY*vI+G.]VD]aEY<V$x,u{VҌuI%ק[(5'/N T{e2qc	s:EϽ]A,oҭ	Ѹ Z=
c 봶YB;%&@AJn1~xVSl883dllwFtkzk16zREyj*Ȃ-2                                                                                                                                                                                                                                                                                                                                                   _readme_files/example_small.jpg                                                                     0000755 0001012 0001007 00000046147 11171212031 017331  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                JFIF  H H  2http://ns.adobe.com/xap/1.0/ <?xpacket begin="﻿" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.1-c034 46.272976, Sat Jan 27 2007 22:37:37        ">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:xap="http://ns.adobe.com/xap/1.0/">
         <xap:CreatorTool>Adobe Fireworks CS3</xap:CreatorTool>
         <xap:CreateDate>2007-09-23T16:47:23Z</xap:CreateDate>
         <xap:ModifyDate>2007-09-23T16:48:16Z</xap:ModifyDate>
      </rdf:Description>
      <rdf:Description rdf:about=""
            xmlns:dc="http://purl.org/dc/elements/1.1/">
         <dc:format>image/jpeg</dc:format>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                            
<?xpacket end="w"?> C 

		"""""""""" C             !      !!!   !!!!!!!!"""""""""""""""                     T 
    !1"AQ2Baq#RUb$3CS%4Vcr'5Dst             %         !1A"Qa2q   ? KL%{TU)Nqvo&|{;TlV/^ӲØd2٠|do(*jDvnvv>OEJY[ݤ܎yEם-+	'JT|Xĵ"E ӄ ЯfWHs5SӇEoR{~!}$ Pt6z3Ӓ<saWos\/~ۧID/n:MdNm<u7)󒜖>rZf??ZA2")㖐J3Jv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f'%'y;:LqJ )];AVD"ǒV7TK{yփ^bvMXiEe;d1.þāpB*	D$tw,=K6Sd*#j_iL()!E#U0Y$`:Svv豳\g-a><0EM&Ǝ@An!DI߼頡 dH~ĢӰ?7X[^ *,%#CoebxYlur|?M͖Wݠ<Kfۼ1;IX=l4<S|kA<}A"ePAQ7Wb:|ꥳj%4]KG'M R_zm{Q**,,]8EϦz?ЖtɷQf3|J[Rקk-4       h+"pX`(ae[Ђ/Q9y&TRWo8~v*+	"      "]oR!P EZny[=M (&ZKc6HࠊJf9l%5)-W4mmEk8ilEd>0V(*;9b!oKf!卻ZoA퉉4L1-q-bWj6I[ 7XZ@@@@@@@@Al/j2BzxBX>WPYcWYCK#pXY֍֌y_us߅$Yv4-ʓʳ`-705K[VUAzsuT{#ǁ>mLU('ln:	m.t2q;{~j~jFg7';Yy=xTpeh<^@ ~cf{(<:g~cf{(<:g~cf{(<:g~cf{(<:g~cf{(<:g~cf{(<:gG[a@0 ! Gx\a\ oPnmh)$]88R8׌hRN2dKb'@{?9gmschw 4P@@@@@@E ީjЛRїfeH	8_I#܂<3rsF%x76bN
3o3{p@,;NakҀ9'):+:zPa3W=EL"}ɂtU%a$U%aNk[n#¤j}g̴*<MY5#{UZK5XUYB_VUh01+ `w [n)a$U                                                                                                                                                                                                                                                                                                                                                                                                                         _readme_files/x-click-but21.gif                                                                     0000755 0001012 0001007 00000001076 11171212031 016750  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89an   OOO}}}ddd⊊٥;;;Ƅ   !   ,    n   'dihlI-ex|m00($hШtJZجV`&f!zn[90~"{"eg gikr"	h}~zƹfξ²Ǖ֤ͳL@5 @ttϠ<}ch9r߹H\IͻyHk㳆</fG3,Η
 tDL044  	<0xׯ`ÊKٳh@ÅGT( x˷߿@AA"tPxǐ#KL˘3G%:#t0РӨS^ͺװcVM0$LƻN|ڄ/+_μ9 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                  abelia                                                                                              0000755 0001012 0001007 00000145325 11417041752 012401  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                JFIF   ` `   LEAD Technologies Inc. V1.01   		


		          	
       	
   } !1AQa"q2#BR$3br	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz  w !1AQaq"2B	#3Rbr
$4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz     ? }M"S
 rO򯏭V1\]8;ݖZkH2FT??ۨQOșZOk2>ds#g4Ҏ->X:v].En!j L}޼;"}<]HYGz 
|Ilbр {	(-ž)$}
9<󨔹tKR|7!1J3Þ';q[MKM+xt'd|?p:fNjji.ї8pGJ듲 2 y_+RGD5N&?*9=3׏ַW[fr]inP$ 5Dܥ^0'8SR*-E>EZo!0=>i[6-	m@q >+ݻhiY]?4cr;VMc 
Y.e8'sϵg)+2HϖcO ׊#ukX[ݜܱ??[PQJVDHbbDH!O	vebbAl/SNkFsEOrPy?AX9<sv=]w#ץce{LimY*R1=_ ZThe(V؃ ~\cȬBϖ/_ ׬g>]"Tbss~&7͵n|dv?U:j:ˡDTgWkMv;B)k޹c
z۶㔭ἤ%CUIGD8GW EǩsTȋ1b<(9#GS\Q\ҷC᎛}ơQcv:=½)P\e֏gvGgJR{9'ܒ
U*I̔]3ci
z`=EMNپ_Rѻl\z~9W*+Ьړc88d뾛3&զOF= ^u*qHD3sӞ>,CA*V=
C$(`YduL; JyJLttA8uЋX銿ggͭĥ~ѐTpq3ZsYgc<6]x?3r<䁜:9*5'cE"Z!Qu'5ȢcR*v t8?O7M+\ʱ8>qǨ8ZR2'"jfCokxiAGs}iTA)ntضy7vcӯ vM:˨NJ[+X{dt1bzVڄMB4|3h8ׯ~)E2C>pڼ=+0zvۃ^5fOCBy =s
5pGZFNɯ#Y:ڽu=sZ*.(v/WS4Z1Glf#==	<c*|im<bc6+[8?-\B(T11HD@&(Ê PHBHN-%)[UXrO[+$U- b][a$KUhu^O|W<Folsײ j0rئU-*O_Sռ$m+$dڠ=Wl(\,_q^^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iꕍl2o{9jkۧoEC]Vٴ9!/%m"K[E|D0m|ṻgROm%lEs^κߞj|Jv}˛\5$+rZl+rӒ\˕MA;X  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P@  P                                                                                                                                                                                                                                                                                                           admin/                                                                                              0000755 0001012 0001007 00000000000 11463745573 012331  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/                                                                                     0000755 0001012 0001007 00000000000 10657437122 014127  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/boxes/                                                                               0000755 0001012 0001007 00000000000 10657437122 015247  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/boxes/extra_boxes/                                                                   0000755 0001012 0001007 00000000000 11464012030 017552  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php                                     0000755 0001012 0001007 00000000225 10255425072 025724  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
$za_contents[] = array('text' => BOX_REPORTS_RECOVER_CART_SALES, 
'link' => zen_href_link(FILENAME_STATS_RECOVER_CART_SALES, '', 'NONSSL'));
?>                                                                                                                                                                                                                                                                                                                                                                           admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php                                       0000755 0001012 0001007 00000000207 10255425156 025371  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
$za_contents[] = array('text' => BOX_TOOLS_RECOVER_CART, 
'link' => zen_href_link(FILENAME_RECOVER_CART_SALES, '', 'NONSSL'));
?>                                                                                                                                                                                                                                                                                                                                                                                         admin/includes/boxes/extra_boxes/error_log                                                          0000644 0001012 0001007 00000003530 11505546426 021511  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               [02-Nov-2010 09:37:28] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php on line 3
[02-Nov-2010 09:52:39] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php on line 3
[04-Nov-2010 07:20:45] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php on line 3
[05-Nov-2010 06:34:29] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php on line 3
[07-Nov-2010 04:09:46] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php on line 3
[08-Nov-2010 04:03:02] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php on line 3
[10-Nov-2010 03:03:27] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php on line 3
[11-Nov-2010 02:41:53] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php on line 3
[25-Dec-2010 19:15:42] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_tools_dhtml.php on line 3
[26-Dec-2010 00:05:26] PHP Fatal error:  Call to undefined function  zen_href_link() in /home/homeline/public_html/admin/includes/boxes/extra_boxes/recover_cart_reports_dhtml.php on line 3
                                                                                                                                                                        admin/includes/extra_datafiles/                                                                     0000755 0001012 0001007 00000000000 11463527353 017270  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/extra_datafiles/recover_cart_filenames.php                                           0000755 0001012 0001007 00000000310 10523517176 024475  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
		define('FILENAME_RECOVER_CART_SALES', 'recover_cart_sales.php');
		define('FILENAME_STATS_RECOVER_CART_SALES', 'stats_recover_cart_sales.php');
		define('TABLE_SCART', DB_PREFIX . 'scart');
?>                                                                                                                                                                                                                                                                                                                        admin/includes/languages/                                                                           0000755 0001012 0001007 00000000000 10657437122 016075  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/languages/english/                                                                   0000755 0001012 0001007 00000000000 11463527353 017530  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/languages/english/extra_definitions/                                                 0000755 0001012 0001007 00000000000 11463527353 023246  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/languages/english/extra_definitions/recover_cart.php                                 0000755 0001012 0001007 00000000205 10604016714 026423  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
define('BOX_REPORTS_RECOVER_CART_SALES', 'Recovered Sales Results');
define('BOX_TOOLS_RECOVER_CART', 'Recover Cart Sales');
?>                                                                                                                                                                                                                                                                                                                                                                                           admin/includes/languages/english/recover_cart_sales.php                                             0000755 0001012 0001007 00000006664 11202400646 024107  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
  $Id: recover_cart_sales.php,v 1.3 2005/06/01 16:34:52 lane Exp $
  Recover Cart Sales ENGLISH Language File

  Recover Cart Sales contribution: JM Ivler (c)
  Copyright (c) 2003-2005 JM Ivler
 Released under the GNU General Public License
*/

define('MESSAGE_STACK_CUSTOMER_ID', 'Cart for Customer-ID ');
define('MESSAGE_STACK_CART_CUSTOMER', 'Cart for Customer ');
define('MESSAGE_STACK_DELETE_SUCCESS', ' deleted successfully');
define('MESSAGE_STACK_CUSTOMER', 'Customer ');
define('MESSAGE_STACK_SETCONACTED', ' set conacted successfully');
define('HEADING_TITLE', 'Recover Cart Sales');
define('HEADING_EMAIL_SENT', 'E-mail Sent Report');
define('EMAIL_TEXT_LOGIN', 'Login to your account here:');
define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('EMAIL_TEXT_SUBJECT', 'Inquiry from '.  STORE_NAME );
define('EMAIL_TEXT_SALUTATION', 'Dear ' );
define('EMAIL_TEXT_NEWCUST_INTRO', "\n\n" . 'Thank you for stopping by ' . STORE_NAME .
                                   ' and considering us for your purchase. ');
define('EMAIL_TEXT_CURCUST_INTRO', "\n\n" . 'We would like to thank you for having shopped at ' .
                                   STORE_NAME . ' in the past. ');
define('EMAIL_TEXT_BODY_HEADER',
	'We noticed that during a visit to our store you placed ' .
	'the following item(s) in your shopping cart, but did not complete ' .
	'the transaction.' . "\n\n" .
	'Shopping Cart Contents:' . "\n\n"
	);
	
define('EMAIL_TEXT_BODY_FOOTER',
	'We are always interested in knowing what happened ' .
	'and if there was a reason that you decided not to purchase at ' .
	'this time. If you could be so kind as to let us ' .
	'know if you had any issues or concerns, we would appreciate it.  ' .
	'We are asking for feedback from you and others as to how we can ' .
	'help make your experience at '. STORE_NAME . ' better.'."\n\n".
	'PLEASE NOTE:'."\n".'If you believe you completed your purchase and are ' .
	'wondering why it was not delivered, this email is an indication that ' .
	'your order was NOT completed, and that you have NOT been charged! ' .
	'Please return to the store in order to complete your order.'."\n\n".
	'Our apologies if you already completed your purchase, ' .
	'we try not to send these messages in those cases, but sometimes it is ' .
	'hard for us to tell depending on individual circumstances.'."\n\n".
	'Again, thank you for your time and consideration in helping us ' .
	'improve the ' . STORE_NAME .  " website.\n\nSincerely,\n\n"
	);

define('DAYS_FIELD_PREFIX', 'Show for last ');
define('DAYS_FIELD_POSTFIX', ' days ');
define('DAYS_FIELD_BUTTON', 'Go');
define('TABLE_HEADING_DATE', 'DATE');
define('TABLE_HEADING_CONTACT', 'CONTACTED');
define('TABLE_HEADING_CUSTOMER', 'CUSTOMER NAME');
define('TABLE_HEADING_EMAIL', 'E-MAIL');
define('TABLE_HEADING_PHONE', 'PHONE');
define('TABLE_HEADING_MODEL', 'ITEM');
define('TABLE_HEADING_DESCRIPTION', 'DESCRIPTION');
define('TABLE_HEADING_QUANTY', 'QTY');
define('TABLE_HEADING_PRICE', 'PRICE');
define('TABLE_HEADING_TOTAL', 'TOTAL');
define('TABLE_GRAND_TOTAL', 'Grand Total: ');
define('TABLE_CART_TOTAL', 'Cart Total: ');
define('TEXT_CURRENT_CUSTOMER', 'CUSTOMER');
define('TEXT_SEND_EMAIL', 'Send E-mail');
define('TEXT_RETURN', '[Click Here To Return]');
define('TEXT_NOT_CONTACTED', 'Uncontacted');
define('PSMSG', 'Additional PS Message: ');
define('TEXT_SET_CONTACTED', 'Set Contacted');
define('TEXT_FROM', 'From:');
define('TEXT_SUBJECT', 'Subject:');
?>
                                                                            admin/includes/languages/english/stats_recover_cart_sales.php                                       0000755 0001012 0001007 00000002453 10615400310 025310  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
  $Id: stats_recover_cart_sales.php,v 1.2 2005/05/31 07:21:56 lane Exp $
  Recover Cart Sales ENGLISH Language File v2.00

  Recover Cart Sales contribution: JM Ivler 11/23/03
  Copyright (c) 2003-2005 JM Ivler / Ideas From the Deep / OSCommerce
  http://www.oscommerce.com

  Released under the GNU General Public License

  Modifed by Aalst (stats_recover_cart_sales.php,v 1.2 .. 1.36)
  aalst@aalst.com

  Modifed by Lane (stats_recover_cart_sales.php,v 1.4d .. 2.00)
  lane@ifd.com www.osc-modsquad.com / www.ifd.com
*/

define('HEADING_TITLE', 'Recover Cart Sales Report');
define('DAYS_FIELD_PREFIX', 'Show for last ');
define('DAYS_FIELD_POSTFIX', ' days ');
define('DAYS_FIELD_BUTTON', 'Go');
define('TABLE_HEADING_SCART_ID', 'SCart ID');
define('TABLE_HEADING_SCART_ADD_DATE', 'Date Added to SC');
define('TABLE_HEADING_SCART_SENT_DATE', 'RC email sent');
define('TABLE_HEADING_CUSTOMER', 'Customer Name');
define('TABLE_HEADING_ORDER_DATE', 'Order Date');
define('TABLE_HEADING_ORDER_STATUS', 'Status');
define('TABLE_HEADING_ORDER_AMOUNT', 'Amount');
define('TOTAL_RECORDS', 'Examined Records:');
define('TOTAL_SALES', 'Recovered Sales:');
define('TOTAL_SALES_EXPLANATION', ' (Possible sales from customers who abanoned carts & were notified via RCS)');
define('TOTAL_RECOVERED', 'Total Recovered:');
?>                                                                                                                                                                                                                     admin/includes/languages/russian/                                                                   0000755 0001012 0001007 00000000000 11463527353 017563  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/languages/russian/extra_definitions/                                                 0000755 0001012 0001007 00000000000 11463527353 023301  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               admin/includes/languages/russian/extra_definitions/recover_cart.php                                 0000755 0001012 0001007 00000000206 10604016674 026464  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
define('BOX_REPORTS_RECOVER_CART_SALES', ' ');
define('BOX_TOOLS_RECOVER_CART', ' ');
?>                                                                                                                                                                                                                                                                                                                                                                                          admin/includes/languages/russian/recover_cart_sales.php                                             0000755 0001012 0001007 00000010033 10604044770 024132  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
  $Id$
  Recover Cart Sales v 1.4 ENGLISH Language File

  Recover Cart Sales contrib: JM Ivler (c)
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Released under the GNU General Public License

*/

define('MESSAGE_STACK_CUSTOMER_ID', '   (id  ');
define('MESSAGE_STACK_CART_CUSTOMER', 'Cart for Customer ');
define('MESSAGE_STACK_DELETE_SUCCESS', ')  .');
define('MESSAGE_STACK_CUSTOMER', 'Customer ');
define('MESSAGE_STACK_SETCONACTED', ' set conacted successfully');
define('HEADING_TITLE', ' ');
define('HEADING_EMAIL_SENT', '   ');
define('EMAIL_TEXT_LOGIN', 'Login to your account here:');
define('EMAIL_SEPARATOR', '------------------------------------------------------');
define('EMAIL_TEXT_SUBJECT', '  - '.  STORE_NAME );
define('EMAIL_TEXT_SALUTATION', ' ' );
define('EMAIL_TEXT_NEWCUST_INTRO', "\n\n" . '     - ' .
                                   STORE_NAME . ',        .');
define('EMAIL_TEXT_CURCUST_INTRO', "\n\n" . '     - ' .
                                   STORE_NAME . ',        .  ');
define('EMAIL_TEXT_BODY_HEADER',
	'We noticed that during a visit to our store you placed ' .
	'the following item(s) in your shopping cart, but did not complete ' .
	'the transaction.' . "\n\n" .
	'Shopping Cart Contents:' . "\n\n"
	);
define('EMAIL_TEXT_COMMON_BODY', "\n\n" . '    ,         ?         - ,               .      ,     .' .
                                  "\n\n" . ',   :' .
                                 "\n\n" . '%s' . "\n");
define('EMAIL_TEXT_BODY_FOOTER',
	'We are always interested in knowing what happened ' .
	'and if there was a reason that you decided not to purchase at ' .
	'this time. If you could be so kind as to let us ' .
	'know if you had any issues or concerns, we would appreciate it.  ' .
	'We are asking for feedback from you and others as to how we can ' .
	'help make your experience at '. STORE_NAME . ' better.'."\n\n".
	'PLEASE NOTE:'."\n".'If you believe you completed your purchase and are ' .
	'wondering why it was not delivered, this email is an indication that ' .
	'your order was NOT completed, and that you have NOT been charged! ' .
	'Please return to the store in order to complete your order.'."\n\n".
	'Our apologies if you already completed your purchase, ' .
	'we try not to send these messages in those cases, but sometimes it is ' .
	'hard for us to tell depending on individual circumstances.'."\n\n".
	'Again, thank you for your time and consideration in helping us ' .
	'improve the ' . STORE_NAME .  " website.\n\nSincerely,\n\n"
	);
	
define('DAYS_FIELD_PREFIX', '    ');
define('DAYS_FIELD_POSTFIX', '  ');
define('DAYS_FIELD_BUTTON', '');
define('TABLE_HEADING_DATE', '');
define('TABLE_HEADING_CONTACT', '');
define('TABLE_HEADING_CUSTOMER', ' ');
define('TABLE_HEADING_EMAIL', 'E-mail ');
define('TABLE_HEADING_PHONE', '');
define('TABLE_HEADING_MODEL', '');
define('TABLE_HEADING_DESCRIPTION', '');
define('TABLE_HEADING_QUANTY', '');
define('TABLE_HEADING_PRICE', '');
define('TABLE_HEADING_TOTAL', '');
define('TABLE_GRAND_TOTAL', '    : ');
define('TABLE_CART_TOTAL', ' : ');
define('TEXT_CURRENT_CUSTOMER', '');
define('TEXT_SEND_EMAIL', ' E-mail');
define('TEXT_RETURN', ' ');
define('TEXT_NOT_CONTACTED', ' ');
define('PSMSG', ' : ');
define('TEXT_SET_CONTACTED', 'Set Contacted');
define('TEXT_FROM', ':');
define('TEXT_SUBJECT', ':');
?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     admin/includes/languages/russian/stats_recover_cart_sales.php                                       0000755 0001012 0001007 00000002616 10615400300 025343  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
  $Id$
  Recover Cart Sales ENGLISH Language File

  report_recover_cart_sales contrib: JM Ivler 11/23/03
  (c) Ivler/ osCommerce
  http://www.oscommerce.com

  Released under the GNU General Public License

  Modifed by Aalst (stats_recover_cart_sales.php,v 1.2)
  aalst@aalst.com
  Nov 28th 2003

  Modifed by Aalst (stats_recover_cart_sales.php,v 1.3)
  aalst@aalst.com
  Nov 29th 2003

  Modifed by Aalst (stats_recover_cart_sales.php,v 1.3.5)
  aalst@aalst.com
  Nov 30th 2003

  Modifed by Aalst (stats_recover_cart_sales.php,v 1.3.6)
  aalst@aalst.com
  Dec 2nd 2003
*/
define('HEADING_TITLE', '  ');

define('DAYS_FIELD_PREFIX', '    ');
define('DAYS_FIELD_POSTFIX', '  ');
define('DAYS_FIELD_BUTTON', '');

define('TABLE_HEADING_SCART_ID', 'SCart ID');
define('TABLE_HEADING_SCART_ADD_DATE', '   SC');
define('TABLE_HEADING_SCART_SENT_DATE', 'RC email sent');
define('TABLE_HEADING_CUSTOMER', '');
define('TABLE_HEADING_ORDER_DATE', ' ');
define('TABLE_HEADING_ORDER_STATUS', '');
define('TABLE_HEADING_ORDER_AMOUNT', '');
define('TOTAL_RECORDS', ' :');
define('TOTAL_SALES', ' :');
define('TOTAL_SALES_EXPLANATION', ' (Possible sales from customers who abanoned carts & were notified via RCS)');
define('TOTAL_RECOVERED', ' :');
?>                                                                                                                  admin/recover_cart_sales.php                                                                        0000755 0001012 0001007 00000073452 11251437414 016710  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: recover_cart_sales.php 2.12 17.09.2006 22:25 Andrew Berezin $
 */
/*
 $Id: recover_cart_sales.php,v 1.6 2005/06/22 06:10:35 lane Exp $
 Recover Cart Sales Tool v2.11

 Copyright (c) 2003-2005 JM Ivler / Ideas From the Deep / OSCommerce
 Released under the GNU General Public License

 Based on an original release of unsold carts by: JM Ivler

 That was modifed by Aalst (aalst@aalst.com) until v1.7 of stats_unsold_carts.php

 Then, the report was turned into a sales tool (recover_cart_sales.php) by
 JM Ivler based on the scart.php program that was written off the Oct 8 unsold carts code release.

 Modifed by Aalst (recover_cart_sales.php,v 1.2 ... 1.36)
 aalst@aalst.com

 Modifed by willross (recover_cart_sales.php,v 1.4)
 reply@qwest.net
 - don't forget to flush the 'scart' db table every so often

 Modified by Lane Roathe (recover_cart_sales.php,v 1.4d .. v2.11)
 lane@ifd.com	www.osc-modsquad.com / www.ifd.com
*/
require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_MAIL . '.php');
require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

if ($action == 'set_editor') {
	// Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
	zen_redirect(zen_href_link(FILENAME_RECOVER_CART_SALES));
}

// Delete Entry Begin
if ($_GET['action'] == 'delete') {
	$customer = $db->Execute("SELECT customers_firstname, customers_lastname
														FROM " . TABLE_CUSTOMERS . "
														WHERE customers_id ='" . (int)$_GET['customer_id'] . "' LIMIT 1");
	$db->Execute("DELETE FROM " . TABLE_CUSTOMERS_BASKET . " WHERE customers_id='" . (int)$_GET['customer_id'] . "'");
	$db->Execute("DELETE FROM " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " WHERE customers_id='" . (int)$_GET['customer_id'] . "'");
	$messageStack->add(MESSAGE_STACK_CART_CUSTOMER . $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'] . ' (ID ' . $_GET['customer_id'] . ')' . MESSAGE_STACK_DELETE_SUCCESS, 'success');
}
// Delete Entry End

// Set Contacted Begin
if ($_GET['action'] == 'setconacted') {
	$customer = $db->Execute("SELECT customers_firstname, customers_lastname
														FROM " . TABLE_CUSTOMERS . "
														WHERE customers_id ='" . (int)$_GET['customer_id'] . "' LIMIT 1");
	// See if a record for this customer already exists; if not create one and if so update it
	$donequery = $db->Execute("SELECT * FROM ". TABLE_SCART ." WHERE customers_id = '" . (int)$_GET['customer_id'] . "'");
	if ($donequery->RecordCount() == 0)
		$db->Execute("INSERT INTO " . TABLE_SCART . " (customers_id, dateadded, datemodified) VALUES ('" . (int)$_GET['customer_id'] . "', '" . date('Ymd') . "', '" . date('Ymd') . "')");
	else
		$db->Execute("UPDATE " . TABLE_SCART . " SET datemodified = '" . date('Ymd') . "' WHERE customers_id = " . (int)$_GET['customer_id']);
	$messageStack->add(MESSAGE_STACK_CUSTOMER . $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'] . ' (ID ' . $_GET['customer_id'] . ')' . MESSAGE_STACK_SETCONACTED, 'success');
}
// Set Contacted End

$tdate = (isset($_GET['tdate']) ? (int)$_GET['tdate'] : RCS_BASE_DAYS);

function zen_cart_date_short($raw_date) {
	if ($raw_date <= 0)
		return false;
	$year = substr($raw_date, 0, 4);
	$month = (int)substr($raw_date, 4, 2);
	$day = (int)substr($raw_date, 6, 2);
	if (@date('Y', mktime(0, 0, 0, $month, $day, $year)) == $year) {
		return date(DATE_FORMAT, mktime(0, 0, 0, $month, $day, $year));
	} else {
		return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime(0, 0, 0, $month, $day, 2037)));
	}
}

// This will return a list of active customers
function zen_GetCustomerOnline() {
	global $db;
  $members = array();
// Set expiration time, default is 1200 secs (20 mins)
  $xx_mins_ago = (time() - 1200);
  $whos_online_query = $db->Execute("SELECT customer_id
                                     FROM " . TABLE_WHOS_ONLINE . "
                                     WHERE time_last_click > '" . $xx_mins_ago . "'");
  while (!$whos_online_query->EOF) {
    if ($whos_online_query->fields['customer_id'] != 0) {
    	$members[] = $whos_online_query->fields['customer_id'];
    }
    $whos_online_query->MoveNext();
  }
  return $members;
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
<!--
function init()
{
  cssjsmenu('navbar');
  if (document.getElementById)
  {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
  }
  if (typeof _editor_url == "string") HTMLArea.replace('message_html');
}
// -->
</script>
<?php if ($editor_handler != '') { $PHP_SELF_save = $PHP_SELF; $PHP_SELF = 'mail.php'; include ($editor_handler); $PHP_SELF = $PHP_SELF_save; } ?>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="2" cellpadding="2">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="main" align="right">
<?php
        echo DAYS_FIELD_PREFIX . zen_draw_form('set_depth_days', FILENAME_RECOVER_CART_SALES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_input_field('tdate', $tdate, 'size="4" style="text-align:right;"') . DAYS_FIELD_POSTFIX .
        zen_hide_session_id() .
//        zen_image_submit('', DAYS_FIELD_BUTTON) .
        '<input type="submit" title="' . DAYS_FIELD_BUTTON . '" value="' . DAYS_FIELD_BUTTON . '" />' .
        '</form>';

// toggle switch for editor
        echo '&nbsp;&nbsp;&nbsp;&nbsp' . TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_RECOVER_CART_SALES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') .
        zen_hide_session_id() .
        zen_draw_hidden_field('action', 'set_editor') .
        '</form>';
?>
            </td>
          </tr>
        </table></td>
      </tr>
<?php if(isset($_GET['action']) && $_GET['action'] == 'sendmail') { ?>
      <tr>
        <td><table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td class="pageHeading" align="left" colspan=6><? echo HEADING_EMAIL_SENT;?></td>
  </tr>
  <tr class="dataTableHeadingRow">
    <td class="dataTableHeadingContent" align="left" colspan="1" width="15%"><?php echo TABLE_HEADING_CUSTOMER; ?></td>
    <td class="dataTableHeadingContent" align="left" colspan="1" width="30%">&nbsp;</td>
    <td class="dataTableHeadingContent" align="left" colspan="1" width="25%">&nbsp;</td>
    <td class="dataTableHeadingContent" align="left" colspan="1" width="10%">&nbsp;</td>
    <td class="dataTableHeadingContent" align="left" colspan="1" width="10%">&nbsp;</td>
    <td class="dataTableHeadingContent" align="left" colspan="1" width="10%">&nbsp;</td>
  </tr>
  <tr class="dataTableHeadingRow">
    <td class="dataTableHeadingContent" align="left"   colspan="1"  width="15%"><?php echo TABLE_HEADING_MODEL; ?></td>
    <td class="dataTableHeadingContent" align="left"   colspan="2"  width="55%"><?php echo TABLE_HEADING_DESCRIPTION; ?></td>
    <td class="dataTableHeadingContent" align="center" colspan="1"  width="10%"> <?php echo TABLE_HEADING_QUANTY; ?></td>
    <td class="dataTableHeadingContent" align="right"  colspan="1"  width="10%"><?php echo TABLE_HEADING_PRICE; ?></td>
    <td class="dataTableHeadingContent" align="right"  colspan="1"  width="10%"><?php echo TABLE_HEADING_TOTAL; ?></td>
  </tr>
<?php
	if(!isset($_POST['custid'])) $_POST['custid'] = array();
	foreach ($_POST['custid'] as $cid) {
		$mline = '';
		$basket = $db->Execute("SELECT    cb.products_id,
																			cb.customers_basket_quantity,
																			cb.customers_basket_date_added,
																			cus.customers_firstname fname,
																			cus.customers_lastname lname,
																			cus.customers_email_address email
														FROM      " . TABLE_CUSTOMERS_BASKET . " cb,
																			" . TABLE_CUSTOMERS . " cus
														WHERE     cb.customers_id = cus.customers_id AND
																			cus.customers_id ='" . $cid . "'
														ORDER BY  cb.customers_basket_date_added DESC ");
		while (!$basket->EOF) {

		// set new cline and curcus
			if ($lastcid != $cid) {
				if ($lastcid != "") {
					$cline .= "
					<tr>
						<td class='dataTableContent' align='right' colspan='6'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td>
					</tr>
					<tr>
						<td colspan='6' align='right'><a href=" . zen_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate) . ">" . zen_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td>
					</tr>\n";
					echo $cline;
				}
				$cline = "<tr> <td class='dataTableContent' align='left' colspan='6'><a href='" . zen_href_link(FILENAME_CUSTOMERS, 'search=' . $basket->fields['lname']) . "'>" . $basket->fields['fname'] . " " . $basket->fields['lname'] . "</a>".$customer."</td></tr>";
				$tprice = 0;
			}
			$lastcid = $cid;

			$products = $db->Execute("SELECT p.products_model model,
																				pd.products_name name
																FROM " . TABLE_PRODUCTS . " p,
																		 " . TABLE_PRODUCTS_DESCRIPTION . " pd
																WHERE p.products_id = '" . $basket->fields['products_id'] . "'
																  AND pd.products_id = p.products_id
																  AND pd.language_id = " . (int)$_SESSION['languages_id']);

			$sprice = zen_get_products_actual_price($basket->fields['products_id']);

			$tprice += $basket->fields['customers_basket_quantity'] * $sprice;

			$cline .= "<tr class='dataTableRow'>
									 <td class='dataTableContent' align='left' width='15%'>" . $products->fields['model'] . "</td>
											<td class='dataTableContent' align='left' colspan='2' width='55%'><a href='" . zen_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $basket->fields['products_id'] . '&origin=' . FILENAME_RECOVER_CART_SALES . '?page=' . $_GET['page']) . "'>" . $products->fields['name'] . "</a></td>
											<td class='dataTableContent' align='center' width='10%'>" . $basket->fields['customers_basket_quantity'] . "</td>
											<td class='dataTableContent' align='right' width='10%'>" . $currencies->format($sprice) . "</td>
											<td class='dataTableContent' align='right' width='10%'>" . $currencies->format($basket->fields['customers_basket_quantity'] * $sprice) . "</td>
									 </tr>";

			$mline .= $basket->fields['customers_basket_quantity'] . ' x ' . $products->fields['name'] . "\n";
			$mline .= '   <blockquote><a href="' . zen_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id='. $basket->fields['products_id']) . '">' . zen_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id='. $basket->fields['products_id']) . "</a></blockquote>\n\n";
			$basket->MoveNext();
		}

		$cline .= "</td></tr>";

		// E-mail Processing - Requires EMAIL_* defines in the
		// includes/languages/english/recover_cart_sales.php file
		$email = '';

		if (RCS_EMAIL_FRIENDLY == 'true'){
			$email .= EMAIL_TEXT_SALUTATION . $basket->fields['fname'] . ' ' . $basket->fields['lname'] . ",";
		} else {
			$email .= STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n";
		}

		$cquery = $db->Execute("SELECT * FROM " . TABLE_ORDERS . " WHERE customers_id = '" . $cid . "'" );
		if ($cquery->RecordCount() < 1) {
			$email .= sprintf(EMAIL_TEXT_NEWCUST_INTRO, $mline);
		} else {
			$email .= sprintf(EMAIL_TEXT_CURCUST_INTRO, $mline);
		}

		$email .= EMAIL_TEXT_BODY_HEADER . $mline . EMAIL_TEXT_BODY_FOOTER;

		if( EMAIL_USE_HTML == 'true' )
			$email .= '<a href="' . zen_catalog_href_link(FILENAME_DEFAULT) . '">' . STORE_OWNER . "\n" . zen_catalog_href_link(FILENAME_DEFAULT)  . '</a>';
		else
			$email .= STORE_OWNER . "\n" . zen_catalog_href_link(FILENAME_DEFAULT);

		$email .= "\n\n";

		$email .= "\n" . EMAIL_SEPARATOR . "\n\n";
		$email .= EMAIL_TEXT_LOGIN;

		if( EMAIL_USE_HTML == 'true' )
			$email .= '  <a href="' . zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL') . '</a>';
		else
			$email .= '  (' . zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL') . ')';

		$custname = $basket->fields['fname']." ".$basket->fields['lname'];
		$outEmailAddr = '"' . $custname . '" <' . $basket->fields['email'] . '>';
		if( zen_not_null(RCS_EMAIL_COPIES_TO) )
			$outEmailAddr .= ', ' . RCS_EMAIL_COPIES_TO;

		$html_msg['EMAIL_MESSAGE_HTML'] = nl2br($email) . zen_db_prepare_input($_POST['message_html']);
		$email = strip_tags($email . "\n\n" . zen_db_prepare_input($_POST['message']));
		$from = zen_db_prepare_input($_POST['from']); // STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS
		$subject = zen_db_prepare_input($_POST['subject']); // EMAIL_TEXT_SUBJECT
		zen_mail('', $outEmailAddr, $subject, $email, '', $from, $html_msg);

		$mline = "";

		// See if a record for this customer already exists; if not create one and if so update it
		$donequery = $db->Execute("SELECT * FROM ". TABLE_SCART ." WHERE customers_id = '" . $cid . "'");
		if ($donequery->RecordCount() == 0)
			$db->Execute("INSERT INTO " . TABLE_SCART . " (customers_id, dateadded, datemodified) VALUES ('" . $cid . "', '" . date('Ymd') . "', '" . date('Ymd') . "')");
		else
			$db->Execute("UPDATE " . TABLE_SCART . " SET datemodified = '" . date('Ymd') . "' WHERE customers_id = " . $cid );

		echo $cline;

		$cline = "";
	}
?>
          <tr><td colspan=8 align="right" class="dataTableContent"><?php echo '<b>' . TABLE_CART_TOTAL . '</b>' . $currencies->format($tprice); ?></td> </tr>
          <tr><td colspan=6 align="right"><a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate); ?>"><?php echo zen_image_button('button_delete.gif', IMAGE_DELETE); ?></a></td></tr>
          <tr><td colspan=6 align=center><a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES); ?>"><?php echo TEXT_RETURN; ?></a></td></tr>
        </table></td>
      </tr>
<?php
} else {  //we are not doing an e-mail to some customers
?>
      <tr>
        <td>
          <?php echo zen_draw_form('mail', FILENAME_RECOVER_CART_SALES,'action=sendmail','post', 'enctype="multipart/form-data"') . "\n"; //action=preview ?>
<!-- REPORT TABLE BEGIN //-->
          <table border="0" width="100%" cellspacing="2" cellpadding="2">
            <tr class="dataTableHeadingRow">
              <td class="dataTableHeadingContent" align="left" colspan="2" width="10%"><?php echo TABLE_HEADING_CONTACT; ?></td>
              <td class="dataTableHeadingContent" align="left" colspan="1" width="15%"><?php echo TABLE_HEADING_DATE; ?></td>
              <td class="dataTableHeadingContent" align="left" colspan="1" width="30%"><?php echo TABLE_HEADING_CUSTOMER; ?></td>
              <td class="dataTableHeadingContent" align="left" colspan="2" width="30%"><?php echo TABLE_HEADING_EMAIL; ?></td>
              <td class="dataTableHeadingContent" align="left" colspan="2" width="15%"><?php echo TABLE_HEADING_PHONE; ?></td>
            </tr>
<!--
            <tr class="dataTableHeadingRow">
              <td class="dataTableHeadingContent" align="left" colspan="2"  width="10%">&nbsp; </td>
              <td class="dataTableHeadingContent" align="left" colspan="1"  width="15%"><?php echo TABLE_HEADING_MODEL; ?></td>
              <td class="dataTableHeadingContent" align="left" colspan="2" width="55%"><?php echo TABLE_HEADING_DESCRIPTION; ?></td>
              <td class="dataTableHeadingContent" align="center" colspan="1" width="5%"> <?php echo TABLE_HEADING_QUANTY; ?></td>
              <td class="dataTableHeadingContent" align="right"  colspan="1"  width="5%"><?php echo TABLE_HEADING_PRICE; ?></td>
              <td class="dataTableHeadingContent" align="right"  colspan="1" width="10%"><?php echo TABLE_HEADING_TOTAL; ?></td>
            </tr>
-->
<?php
	$cust_ses_ids = zen_GetCustomerOnline();
	$basket = $db->Execute("SELECT cb.customers_id,
																 cb.products_id,
																 cb.customers_basket_quantity,
																 cb.customers_basket_date_added,
																 cus.customers_firstname,
																 cus.customers_lastname,
																 cus.customers_telephone,
																 cus.customers_email_address,
																 sc.datemodified
													FROM " . TABLE_CUSTOMERS_BASKET . " cb
														LEFT JOIN " . TABLE_CUSTOMERS . " cus ON (cb.customers_id = cus.customers_id)
														LEFT JOIN " . TABLE_SCART . " sc ON (cb.customers_id = sc.customers_id)
													WHERE cb.customers_basket_date_added >= '" . date('Ymd', time()-$tdate*24*60*60) . "'
														AND cb.customers_id NOT IN ('" . implode(", ", $cust_ses_ids) . "')
													ORDER BY cb.customers_id ASC, cb.customers_basket_date_added DESC");
	$results = 0;
	$curcus = 0;
	$tprice = 0;
	$totalAll = 0;
	$first_line = true;
	$skip = false;

	while (!$basket->EOF) {
//echo '<pre>';var_export($basket->fields);echo '</pre>';
	// If this is a new customer, create the appropriate HTML
		if ($curcus != $basket->fields['customers_id']) {
			$totalAll += $tprice;
			if ($curcus != 0 && !$skip) {
?>
            </tr>
              <td class="dataTableContent" align="right" colspan="8"><?php echo '<b>' . TABLE_CART_TOTAL . '</b> ' . $currencies->format($tprice); ?></td>
            </tr>
            <tr>
              <td colspan="8" align="right"><a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES, 'action=setconacted&customer_id=' . $curcus . '&tdate=' . $tdate); ?>"><?php echo TEXT_SET_CONTACTED; ?></a>&nbsp;<a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES, 'action=delete&customer_id=' . $curcus . '&tdate=' . $tdate); ?>"><?php echo zen_image_button('button_delete.gif', IMAGE_DELETE); ?></a></td>
            </tr>
<?php }
			$curcus = $basket->fields['customers_id'];
			$tprice = 0;

			// change the color on those we have contacted add customer tag to customers
			$fcolor = RCS_UNCONTACTED_COLOR;
			$checked = 1; // assume we'll send an email
			$new = 1;
			$skip = false;
			$sentdate = "";
			$beforeDate = RCS_CARTS_MATCH_ALL_DATES ? '0' : $basket->fields['customers_basket_date_added'];
			$customer = $basket->fields['customers_firstname'] . " " . $basket->fields['customers_lastname'];
			$status = "";
			if ((time()-(RCS_EMAIL_TTL*24*60*60)) <= strtotime($basket->fields['datemodified'])) {
				$sentdate = $basket->fields['datemodified'];
				$fcolor = RCS_CONTACTED_COLOR;
				$checked = 0;
				$new = 0;
			}
			// See if the customer has purchased from us before
			// Customers are identified by either their customer ID or name or email address
			// If the customer has an order with items that match the current order, assume
			// order completed, bail on this entry!
			$orec = $db->Execute('SELECT orders_id, orders_status
														FROM ' . TABLE_ORDERS . '
														WHERE (customers_id = ' . (int)$curcus . '
																		OR customers_email_address like "' . $basket->fields['customers_email_address'] .'"
																		OR customers_name like "' . $basket->fields['customers_firstname'] . ' ' . $basket->fields['customers_lastname'] . '")
															AND date_purchased >= "' . $basket->fields['customers_basket_date_added'] . '"' );
			if ($orec->RecordCount() > 0) {
        // skip repeat customers
        if (RCS_CHECK_REPEAT == 'true') {
          $skip = true; 
        } else {
				  // We have a matching order; assume current customer but not for this order
				  $customer = '<font color=' . RCS_CURCUST_COLOR . '><b>' . $customer . '</b></font>';
				  // Now, look to see if one of the orders matches this current order's items
				  while(!$orec->EOF) {
					  $ccquery = $db->Execute('SELECT products_id
					                           FROM ' . TABLE_ORDERS_PRODUCTS . '
					                           WHERE orders_id = ' . (int)$orec->fields['orders_id'] . '
					                             AND products_id = ' . (int)(int)$basket->fields['products_id'] );
					  if( $ccquery->RecordCount() > 0 ) {
						  if( $orec->fields['orders_status'] > RCS_PENDING_SALE_STATUS )
							  $checked = 0;
						  // OK, we have a matching order; see if we should just skip this or show the status
						  if( RCS_SKIP_MATCHED_CARTS == 'true' && !$checked ) {
							  $skip = true; // reset flag & break us out of the while loop!
							  break;
						  } else {
						  // It's rare for the same customer to order the same item twice, so we probably have a matching order, show it
							  $fcolor = RCS_MATCHED_ORDER_COLOR;
							  $srec = $db->Execute("SELECT orders_status_name
							                        FROM " . TABLE_ORDERS_STATUS . "
							                        WHERE language_id = " . (int)$_SESSION['languages_id'] . "
							                          AND orders_status_id = " . (int)$orec->fields['orders_status'] );
							  if( $srec )
								  $status = ' [' . $srec->fields['orders_status_name'] . ']';
							  else
								  $status = ' ['. TEXT_CURRENT_CUSTOMER . ']';
						  }
					  }
					  $orec->MoveNext();
				  }
        }
				if( $skip )
					continue; // got a matched cart, skip to next one
			}

?>
    <tr bgcolor="<?php echo $fcolor; ?>">
      <td class="dataTableContent" align="center" width="1%"><?php echo zen_draw_checkbox_field("custid[]", $curcus, RCS_AUTO_CHECK == "true" ? $checked : 0); ?></td>
      <td class="dataTableContent" align="left" width="9%"><b><?php echo ($sentdate != "" ? zen_cart_date_short($sentdate) : TEXT_NOT_CONTACTED); ?></b></td>
      <td class="dataTableContent" align="left" width="15%"><?php echo zen_cart_date_short($basket->fields['customers_basket_date_added']); ?></td>
      <td class="dataTableContent" align="left" width="30%"><a href="<?php echo zen_href_link(FILENAME_CUSTOMERS, "search=" . $basket->fields['customers_lastname']); ?>" target="_blank"><?php echo $customer; ?></a><?php echo $status; ?></td>
      <td class="dataTableContent" align="left" colspan="2" width="30%"><a href="<?php echo zen_href_link("mail.php", "selected_box=tools&customer=" . $basket->fields['customers_email_address']); ?>" target="_blank"><?php echo $basket->fields['customers_email_address']; ?></a></td>
      <td class="dataTableContent" align="left" colspan="2" width="15%"><?php echo $basket->fields['customers_telephone']; ?></td>
    </tr>
<?php
		}

		// We only have something to do for the product if the quantity selected was not zero!
		if ($basket->fields['customers_basket_quantity'] > 0) {
			// Get the product information (name, price, etc)
			$products = $db->Execute("SELECT p.products_model model,
																			 p.products_type,
																			 pd.products_name name
																FROM " . TABLE_PRODUCTS . " p
																	LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (pd.products_id = p.products_id AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "')
																WHERE p.products_id = '" . (int)$basket->fields['products_id'] . "'");
			// Check to see if the product is on special, and if so use that pricing
			$sprice = zen_get_products_actual_price( (int)$basket->fields['products_id'] );

			// BEGIN OF ATTRIBUTE DB CODE
			$prodAttribs = ''; // DO NOT DELETE
			if (RCS_SHOW_ATTRIBUTES == 'true') {
				$attribrecs = $db->Execute("SELECT cba.products_id,
																					 po.products_options_name poname,
																					 pov.products_options_values_name povname
																		FROM " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " cba,
																				 " . TABLE_PRODUCTS_OPTIONS . " po,
																				 " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov,
																				 " . TABLE_LANGUAGES . " l
																		WHERE cba.products_id ='" . (int)$basket->fields['products_id'] . "'
																			AND cba.customers_id = " . $curcus . "
																			AND po.products_options_id = cba.products_options_id
																			AND pov.products_options_values_id = cba.products_options_value_id
																			AND po.language_id =" . (int)$_SESSION['languages_id'] . "
																			AND pov.language_id =" . (int)$_SESSION['languages_id']);
				$hasAttributes = false;
				if ($attribrecs->RecordCount() > 0){
					$hasAttributes = true;
					$prodAttribs = '<br />';
					while (!$attribrecs->EOF){
						$prodAttribs .= '<small><i> - ' . $attribrecs->fields['poname'] . ' ' . $attribrecs->fields['povname'] . '</i></small><br />';
						$attribrecs->MoveNext();
					}
				}
			}
			// END OF ATTRIBUTE DB CODE
			$tprice += $basket->fields['customers_basket_quantity'] * $sprice;
			$ib++;
?>
  <tr class="dataTableRow">
    <td class="dataTableContent" align="left" vAlign="top" colspan="2" width="10%"><?php echo $ib; ?></td>
    <td class="dataTableContent" align="left" vAlign="top" width="15%"><?php echo $products->fields['model']; ?></td>
    <td class="dataTableContent" align="left" vAlign="top" colspan="2" width="55%"><a href="<?php echo zen_href_link($zc_products->get_admin_handler($products->fields['products_type']), "page=" . $_GET['page'] . "&product_type=" . $products->fields['products_type'] . "&cPath=" . zen_get_product_path((int)$basket->fields['products_id']) . "&pID=" . (int)$basket->fields['products_id'] . "&action=new_product"); ?>" target="_blank"><b><?php echo $products->fields['name']; ?></b></a><?php echo $prodAttribs; ?></td>
    <td class="dataTableContent" align="center" vAlign="top" width="5%"><?php echo $basket->fields['customers_basket_quantity']; ?></td>
    <td class="dataTableContent" align="right"  vAlign="top" width="5%"><?php echo $currencies->format($sprice); ?></td>
    <td class="dataTableContent" align="right"  vAlign="top" width="10%"><?php echo $currencies->format($basket->fields['customers_basket_quantity'] * $sprice); ?></td>
  </tr>
<?php
		}
		$basket->MoveNext();
	}
	if ($curcus != 0) {
		$totalAll += $tprice;
?>
    <tr>
      <td class='dataTableContent' align='right' colspan='8'><?php echo '<b>' . TABLE_CART_TOTAL . '</b>' . $currencies->format($tprice); ?></td>
    </tr>
    <tr>
      <td colspan='8' align='right'><a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES, 'action=setconacted&customer_id=' . $curcus . '&tdate=' . $tdate); ?>"><?php echo TEXT_SET_CONTACTED; ?></a>&nbsp;<a href="<?php echo zen_href_link(FILENAME_RECOVER_CART_SALES, 'action=delete&customer_id=' . $curcus . '&tdate=' . $tdate); ?>"><?php echo zen_image_button('button_delete.gif', IMAGE_DELETE); ?></a></td>
    </tr>
<?php  } ?>
    <tr>
      <td class='dataTableContent' align='right' colspan='8'><hr align=right><?php echo '<b>' . TABLE_GRAND_TOTAL . '</b>' . $currencies->format($totalAll); ?></td>
    </tr>
  </table></td>
    </tr>
    <tr>
      <td><table width="100%">
        <tr>
          <td valign="top" class="main" width="5%"></td>
          <td valign="top" class="main" width="95%"></td>
        </tr>
        <tr>
          <td valign="top" class="main" colspan=2><hr size=1 color=000080></td>
        </tr>
        <tr>
          <td valign="top" class="main" colspan=2><b><?php echo PSMSG; ?></b></td>
        </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_FROM; ?></td>
            <td><?php echo zen_draw_input_field('from', (isset($_POST['from']) ? $_POST['from'] : STORE_OWNER . ' <' . STORE_OWNER_EMAIL_ADDRESS . '>'), 'size="60"'); ?></td>
          </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_SUBJECT; ?></td>
            <td><?php echo zen_draw_input_field('subject', (isset($_POST['subject']) ? $_POST['subject'] : EMAIL_TEXT_SUBJECT), 'size="60"'); ?></td>
          </tr>
        <tr>
          <td valign="top" class="main"><?php echo TEXT_MESSAGE_HTML;?></td>
          <td class="main" width="750">
<?php if (EMAIL_USE_HTML != 'true') echo TEXT_WARNING_HTML_DISABLED; ?>
<?php if (EMAIL_USE_HTML == 'true') {
	if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
		$oFCKeditor = new FCKeditor('message_html') ;
		$oFCKeditor->Value = stripslashes($_POST['message_html']) ;
		$oFCKeditor->Width  = '97%' ;
		$oFCKeditor->Height = '350' ;
//		$oFCKeditor->Create() ;
		$output = $oFCKeditor->CreateHtml() ; echo $output;
	} else { // using HTMLAREA or just raw "source"
		echo zen_draw_textarea_field('message_html', 'soft', '100%', '25', stripslashes($_POST['message_html']), 'id="message_html"');
	}
} ?>
          </td>
        </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
            <td><?php echo zen_draw_textarea_field('message', 'soft', '100%', '15', $_POST['message']); ?></td>
          </tr>
          <tr>
<!--            <td colspan="2" align="right"><?php echo zen_image_submit('button_preview.gif', IMAGE_PREVIEW); ?></td> //-->
            <td colspan="2" align="right"><?php echo zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
          </tr>
        </table>
      </td>
    </tr>
    </form>
<?php
}
//
// end footer of both e-mail and report
//
?>
  <!-- REPORT TABLE END //-->
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                      admin/stats_recover_cart_sales.php                                                                  0000755 0001012 0001007 00000020127 11157772734 020131  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
  $Id: stats_recover_cart_sales.php,v 1.6 2005/06/22 06:10:35 lane Exp $
  Recover Cart Sales Report v2.11

	Recover Cart Sales contribution: JM Ivler 11/20/03
	(c) Ivler / Ideas From the Deep / osCommerce

	Released under the GNU General Public License

 Modifed by Aalst (recover_cart_sales.php,v 1.2 .. 1.36)
 aalst@aalst.com

 Modified by Lane Roathe (recover_cart_sales.php,v 1.4d .. v2.11)
 lane@ifd.com	www.osc-modsquad.com / www.ifd.com
*/
require('includes/application_top.php');
require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

$tdate = (isset($_GET['tdate']) ? $_GET['tdate'] : RCS_BASE_DAYS);
$ndate = seadate($tdate);

function zen_date_order_stat($raw_date) {
	if ($raw_date == '') return false;
	$year = substr($raw_date, 2, 2);
	$month = (int)substr($raw_date, 4, 2);
	$day = (int)substr($raw_date, 6, 2);
	return date(DATE_FORMAT, mktime(0, 0, 0, $month, $day, $year));
}

function seadate($day) {
	$ts = date("U");
	$rawtime = strtotime("-".$day." days", $ts);
	$ndate = date("Ymd", $rawtime);
	return $ndate;
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
<!--
function init()
{
  cssjsmenu('navbar');
  if (document.getElementById)
  {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
  }
  if (typeof _editor_url == "string") HTMLArea.replace('message_html');
}
// -->
</script>
<?php if ($editor_handler != '') include ($editor_handler); ?>
</head>
<body onload="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="2" cellpadding="2">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="main" align="right">
<?php
        echo DAYS_FIELD_PREFIX . zen_draw_form('set_depth_days', FILENAME_STATS_RECOVER_CART_SALES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_input_field('tdate', $tdate, 'size="4" style="text-align:right;"') . DAYS_FIELD_POSTFIX .
        zen_hide_session_id() .
//        zen_image_submit('', DAYS_FIELD_BUTTON) .
        '<input type="submit" title="' . DAYS_FIELD_BUTTON . '" value="' . DAYS_FIELD_BUTTON . '" />' .
        '</form>';
?>
            </td>
          </tr>
        </table></td>
      </tr>
<?php
// Init vars
$cust_array = array();
$custknt = 0;
$total_recovered = 0;
$custlist = '';

// Query database for abandoned carts within our timeframe
$scart = $db->Execute("SELECT s.scartid, s.customers_id, s.dateadded, s.datemodified, c.customers_firstname, c.customers_lastname, c.customers_email_address
											 FROM " . TABLE_SCART . " s
												 LEFT JOIN " . TABLE_CUSTOMERS . " c ON (s.customers_id = c.customers_id)
											 WHERE dateadded >= '" . $ndate . "'
											 ORDER BY dateadded DESC" );
$rc_cnt = $scart->RecordCount();

// Loop though each one and process it
while(!$scart->EOF) {
	// Query DB for the FIRST order that matches this customer ID and came
	// after the abandoned cart
	$orders = $db->Execute("SELECT o.orders_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value
                            FROM " . TABLE_ORDERS . " o 
                              LEFT JOIN " . TABLE_ORDERS_TOTAL . " ot ON (o.orders_id = ot.orders_id) 
                              LEFT JOIN " . TABLE_ORDERS_STATUS . " s ON (s.orders_status_id = o.orders_status AND s.language_id = " . $_SESSION['languages_id'] . ")
                            WHERE o.customers_id = " . (int)$scart->fields['customers_id'] . "
                              AND o.orders_status > " . RCS_PENDING_SALE_STATUS . "
                              AND o.date_purchased >= '" . date('Y-m-d', strtotime($scart->fields['dateadded'])) . "'
                              AND ot.class = 'ot_total'");
	// If we got a match, create the table entry to display the information
	if (!$orders->EOF) {
		$custknt++;
		$total_recovered += $orders->fields['value'];
		$cust_array[$custknt] = array_merge($scart->fields, $orders->fields);
	}
	$scart->MoveNext();
}
?>
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="2" cellpadding="2">
          <tr>
            <td align="right" class="main"><b><?php echo TOTAL_RECORDS ?></b></td>
            <td align="left" class="main"><?php echo $rc_cnt ?></td>
          </tr>
          <tr>
            <td align="right" class="main"><b><?php echo TOTAL_SALES ?></b></td>
            <td align="left" class="main"><?php echo $custknt . TOTAL_SALES_EXPLANATION ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="2" cellpadding="2">
          <!-- Header -->
          <tr class="dataTableHeadingRow">
            <th width="4%"  class="dataTableHeadingContent"><?php echo TABLE_HEADING_SCART_ID ?></td>
            <th width="8%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_SCART_ADD_DATE ?></td>
            <th width="8%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_SCART_SENT_DATE ?></td>
            <th width="50%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMER ?></td>
            <th width="8%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ORDER_DATE ?></td>
            <th width="10%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ORDER_STATUS ?></td>
            <th width="12%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ORDER_AMOUNT ?></td>
          </tr>
<?php
//echo '<pre>';var_export($cust_array);echo '</pre>';
	foreach($cust_array as $cust) {
?>
          <tr class="<?php echo ($i % 2 ? RCS_REPORT_EVEN_STYLE : RCS_REPORT_ODD_STYLE); ?>">
            <td class="dataTableContent" align="right"><?php echo $cust['scartid']; ?></td>
            <td class="dataTableContent" align="center"><?php echo zen_date_order_stat($cust['dateadded']); ?></td>
            <td class="dataTableContent" align="center"><?php echo zen_date_order_stat($cust['datemodified']); ?></td>
            <td class="dataTableContent"><a href="<?php echo zen_href_link(FILENAME_CUSTOMERS, "search=" . $cust['customers_email_address']); ?>"><?php echo $cust['customers_firstname'] . " " . $cust['customers_lastname']; ?></a></td>
            <td class="dataTableContent" align="center"><?php echo zen_date_short($cust['date_purchased']); ?></td>
            <td class="dataTableContent" align="center"><?php echo $cust['orders_status_name']; ?></td>
            <td class="dataTableContent" align="right"><?php echo strip_tags($cust['order_total']); ?></td>
          </tr>
<?php
	}
?>
        </table></td>
      </tr>
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="2" cellpadding="2">
          <tr>
            <td valign="bottom"><hr width="100%" size="1" color="#800000" noshade></td>
          </tr>
          <tr>
            <td align="right" class="main"><b><?php echo TOTAL_RECOVERED; ?>&nbsp;<?php echo $rc_cnt ? zen_round(($custknt / $rc_cnt) * 100, 2) : 0 ?>%&nbsp;&nbsp;<?php echo $currencies->format(zen_round($total_recovered, 2)); ?></b></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
<!-- body_text_eof //-->
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                                                         admin/error_log                                                                                     0000644 0001012 0001007 00000026576 11512515716 014253  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               [02-Nov-2010 04:27:39] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[02-Nov-2010 04:27:39] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[02-Nov-2010 04:27:39] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[02-Nov-2010 04:27:43] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[02-Nov-2010 04:27:43] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[02-Nov-2010 04:27:43] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[11-Nov-2010 00:35:48] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[11-Nov-2010 00:35:48] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[11-Nov-2010 00:35:48] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[11-Nov-2010 02:51:11] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[11-Nov-2010 02:51:11] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[11-Nov-2010 02:51:11] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Nov-2010 02:21:42] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Nov-2010 02:21:42] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Nov-2010 02:21:42] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Nov-2010 03:21:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[24-Nov-2010 03:21:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[24-Nov-2010 03:21:13] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[13-Dec-2010 03:19:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[13-Dec-2010 03:19:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[13-Dec-2010 03:19:13] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[14-Dec-2010 03:18:56] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[14-Dec-2010 03:18:56] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[14-Dec-2010 03:18:56] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[20-Dec-2010 07:58:15] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[20-Dec-2010 07:58:15] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[20-Dec-2010 07:58:15] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[20-Dec-2010 08:38:55] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[20-Dec-2010 08:38:55] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[20-Dec-2010 08:38:55] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Dec-2010 04:42:48] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[24-Dec-2010 04:42:48] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[24-Dec-2010 04:42:48] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[24-Dec-2010 05:07:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Dec-2010 05:07:13] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[24-Dec-2010 05:07:13] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[29-Dec-2010 05:04:46] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[29-Dec-2010 05:04:46] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[29-Dec-2010 05:04:46] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/stats_recover_cart_sales.php on line 17
[30-Dec-2010 04:41:11] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[30-Dec-2010 04:41:11] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[30-Dec-2010 04:41:11] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[10-Jan-2011 00:40:30] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[10-Jan-2011 00:40:30] PHP Warning:  require(includes/application_top.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
[10-Jan-2011 00:40:30] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/application_top.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/homeline/public_html/admin/recover_cart_sales.php on line 33
                                                                                                                                  adminhome/                                                                                          0000755 0001012 0001007 00000000000 11463527446 013177  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/.DS_Store                                                                                 0000644 0001012 0001007 00000014004 11463526464 014660  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                  Bud1           	                                                           u d e sIloc                                                                                                                                                                                                                                                                                                                                                                                                                                           i n c l u d e sIlocblob      Z   #      i n c l u d e sicgoblob              r e c o v e r _ c a r t _ s a l e s . p h pIlocblob        #      s t a t s _ r e c o v e r _ c a r t _ s a l e s . p h pIlocblob        #                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @                                              @                                                @                                                @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   E  	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       DSDB                                 `                                                   @                                                @                                                @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/.htaccess                                                                                 0000755 0001012 0001007 00000003775 11366342066 015007  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               #
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################
DirectoryIndex index.php

# deny *everything*
<FilesMatch ".*\..*">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch "(^$|^favicon.ico$|.*\.(php|js|css|jpg|gif|png)$)">
  Order Allow,Deny
  Allow from all
</FilesMatch>

IndexIgnore */*


# The following makes adjustments to the SSL protocol for Internet Explorer browsers
<IfModule mod_setenvif.c>
  <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
  </IfDefine>
</IfModule>

# Fix certain PHP values

#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>

# to turn off register_globals
# php_value register_globals 0

#turn off X-PHP-Originating-Script header when sending emails from admin
#uncomment to activate:
# php_flag mail.add_x_header Off

   adminhome/admin.php                                                                                 0000755 0001012 0001007 00000044142 10512004610 014761  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2006 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: admin.php 4701 2006-10-08 01:09:44Z drbyte $
//

require('includes/application_top.php');

$action = (isset($_GET['action']) ? $_GET['action'] : '');

if (zen_not_null($action)) {

  switch ($action) {
    // demo active test
    case (zen_admin_demo()):
      $action='';
      $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
    	zen_redirect(zen_href_link(FILENAME_ADMIN));
      break;
//-------------------------------------------------------------------------------------------------------------------------
    case 'insert':
    case 'save':
    case 'reset':
    $error = false;
    if ( ($action == 'insert') || ($action == 'reset') ){
    	$password_new = zen_db_prepare_input($_POST['password_new']);
    	$password_confirmation = zen_db_prepare_input($_POST['password_confirmation']);
    
    	if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
    		$error = true;
    		$messageStack->add(ENTRY_PASSWORD_NEW_ERROR, 'error');
    	}
    	if ($password_new != $password_confirmation) {
    		$error = true;
    		$messageStack->add(ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING, 'error');
    	}
    }
    
    if ($error == false) {
    	if (isset($_GET['adminID'])) $admins_id = zen_db_prepare_input($_GET['adminID']);
    	$admin_name = zen_db_prepare_input($_POST['admin_name']);
    	$admin_email = zen_db_prepare_input($_POST['admin_email']);
    	$password_new = zen_db_prepare_input($password_new);
    	$admin_level = zen_db_prepare_input($_POST['admin_level']);
    	$password_new = zen_db_prepare_input($password_new);
    
    	$sql_data_array = array(
                              'admin_name' => $admin_name,
                              'admin_email' => $admin_email,
                              'admin_level' => (int)$admin_level
                              );
    
    	if ($action == 'insert') {
    
    		$insert_sql_data = array('admin_pass' => zen_encrypt_password($password_new));
    		$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
    		zen_db_perform(TABLE_ADMIN, $sql_data_array);
    		$new_admin_id = zen_db_insert_id();
        $admins_id = $new_admin_id;
    
    	} elseif ($action == 'save') {
    
    		zen_db_perform(TABLE_ADMIN, $sql_data_array, 'update', "admin_id = '" . (int)$admins_id . "'");
        $db->Execute("UPDATE " . TABLE_CONFIGURATION . " set configuration_value='" . (int)$_POST['demo_status'] . "' where configuration_key='ADMIN_DEMO'");
    
    	} elseif ($action == 'reset') {
    
    		$update_sql_data = array('admin_pass' => zen_encrypt_password($password_new));
    		$sql_data_array = array_merge($sql_data_array, $update_sql_data);
    		zen_db_perform(TABLE_ADMIN, $sql_data_array, 'update', "admin_id = '" . (int)$admins_id . "'");
    
    	} // end action check
    
    
    	zen_redirect(zen_href_link(FILENAME_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'adminID=' . $admins_id));
    
    } // end error check
    
    
    //echo $action;
    //	zen_redirect(zen_href_link(FILENAME_ADMIN, (isset($_GET['page']) ? 'page=' . '&' : '') . 'adminID=' . $admins_id));
    break;
    
//-------------------------------------------------------------------------------------------------------------------------
    case 'deleteconfirm':
      $new_admin_id = zen_db_prepare_input($_GET['adminID']);
      $db->Execute("delete from " . TABLE_ADMIN . " where admin_id = '" . (int)$new_admin_id . "'");
    
    	zen_redirect(zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page']));
    break;
//-------------------------------------------------------------------------------------------------------------------------
  } // end switch
} // end zen_not_null
?>


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr>
<!-- body_text //-->
		<td width="100%" valign="top">


<?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	</tr>
</table>

<?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top">

<table border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr class="dataTableHeadingRow">
		<td width="10%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ADMINS_ID; ?></td>
		<td width="35%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ADMINS_NAME; ?></td>
		<td width="35%" class="dataTableHeadingContent"><?php echo TABLE_HEADING_ADMINS_EMAIL; ?></td>
		<td width="20%" class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
</tr>

<?php
$admins_query_raw = "select admin_id, admin_name, admin_email, admin_pass, admin_level from " . TABLE_ADMIN . " order by admin_name";
$admins_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $admins_query_raw, $admins_query_numrows);
$admins = $db->Execute($admins_query_raw);

while (!$admins->EOF) {
  if ((!isset($_GET['adminID']) || (isset($_GET['adminID']) && ($_GET['adminID'] == $admins->fields['admin_id']))) && !isset($adminInfo) && (substr($action, 0, 3) != 'new')) {
  	$adminInfo = new objectInfo($admins->fields);
  }
  
  if (isset($adminInfo) && is_object($adminInfo) && ($admins->fields['admin_id'] == $adminInfo->admin_id)) {
  	echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $admins->fields['admin_id'] . '&action=edit') . '\'">' . "\n";
  } else {
  	echo '<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $admins->fields['admin_id'] . '') . '\'">' . "\n";
  }
?>

		<td class="dataTableContent"><?php echo $admins->fields['admin_id']; ?></td>
		<td class="dataTableContent"><?php echo $admins->fields['admin_name']; ?></td>
		<td class="dataTableContent"><?php echo $admins->fields['admin_email']; ?></td>
		<td class="dataTableContent" align="right">
<?php echo '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $admins->fields['admin_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?>
<?php echo '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $admins->fields['admin_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '</a>'; ?>
<?php echo '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $admins->fields['admin_id'] . '&action=resetpassword') . '">' . zen_image(DIR_WS_IMAGES . 'icon_reset.gif', ICON_RESET) . '</a>'; ?>
		</td>
</tr>

<?php
  $admins->MoveNext();
}
?>

	<tr>
		<td colspan="2">

<table border="0" width="100%" cellspacing="0" cellpadding="4">
	<tr>
		<td class="smallText" valign="top"><?php echo $admins_split->display_count($admins_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ADMINS); ?></td>
		<td class="smallText" align="right"><?php echo $admins_split->display_links($admins_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
	</tr>
</table>

		</td>
	</tr>

<?php
if (empty($action)) {
?>
	<tr>
		<td align="right" colspan="4" class="smallText">
<?php
  echo '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>';
?>
		</td>
	</tr>
<?php
}
?>
</table>
		</td>

<?php
$heading = array();
$contents = array();

switch ($action) {
//-------------------------------------------------------------------------------------------------------------------------

  case 'new':
    $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_ADMIN . '</b>');
    $contents = array('form' => zen_draw_form('new_admin', FILENAME_ADMIN, 'action=insert', 'post', 'enctype="multipart/form-data"'));
    $contents[] = array('text' => TEXT_NEW_INTRO);
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_NAME . '<br>' . zen_draw_input_field('admin_name', '', zen_set_field_length(TABLE_ADMIN, 'admin_name', $max=30)) );
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_EMAIL . '<br>' . zen_draw_input_field('admin_email', '', zen_set_field_length(TABLE_ADMIN, 'admin_email', $max=30)) );
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_PASSWORD . '<br>' . zen_draw_password_field('password_new', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=20)) );
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_CONFIRM_PASSWORD . '<br>' . zen_draw_password_field('password_confirmation', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=20)) );
    $contents[] = array('text' => zen_draw_hidden_field('admin_level', '1') );
    $contents[] = array('align' => 'center',
                        'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $_GET['adminID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
  
//-------------------------------------------------------------------------------------------------------------------------
  case 'edit':
    $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_ADMIN . '</b>');
    $contents = array('form' => zen_draw_form('edit_admin', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
    $contents[] = array('text' => TEXT_EDIT_INTRO);
    $contents[] = array('text' => '<br><b>' . $adminInfo->admin_id . '</b>&nbsp;-&nbsp;' . $adminInfo->admin_name . '</b>');
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_NAME . '<br>' . zen_draw_input_field('admin_name', $adminInfo->admin_name, zen_set_field_length(TABLE_ADMIN, 'admin_name', $max=30)) );
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_EMAIL . '<br>' . zen_draw_input_field('admin_email', $adminInfo->admin_email, zen_set_field_length(TABLE_ADMIN, 'admin_email', $max=30)) );
    
    $admin_current = $db->Execute("select admin_level from " . TABLE_ADMIN . " where admin_id='" . $_SESSION['admin_id'] . "'");
    /*
    if ($admin_current->fields['admin_level'] == '1') {
      $contents[] = array('text' => '<br>' . TEXT_ADMIN_LEVEL_INSTRUCTIONS);
      $contents[] = array(
    	  'text' => '<strong>' . TEXT_ADMINS_LEVEL . '</strong><br>' . zen_draw_input_field('admin_level', $adminInfo->admin_level, zen_set_field_length(TABLE_ADMIN, 'admin_level'))
      );
    */
      $demo_status= zen_get_configuration_key_value('ADMIN_DEMO');
      switch ($demo_status) {
        case '0': $on_status = false; $off_status = true; break;
        case '1': $on_status = true; $off_status = false; break;
        default:  $on_status = false; $off_status = true; break;
      }
      if ($on_status == true) {
        $contents[] = array('text' => '<br>' . TEXT_ADMIN_DEMO);
        $contents[] = array('text' => '<strong>' . TEXT_DEMO_STATUS . '</strong><br>' . zen_draw_radio_field('demo_status', '1', $on_status) . '&nbsp;' . TEXT_DEMO_ON . '&nbsp;' . zen_draw_radio_field('demo_status', '0', $off_status) . '&nbsp;' . TEXT_DEMO_OFF);
      } else {
        $contents[] = array('text' => zen_draw_hidden_field('demo_status', 0) );
      }
    
    $contents[] = array('align' => 'center',
                        'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
  
//-------------------------------------------------------------------------------------------------------------------------
  case 'resetpassword':
    $heading[] = array('text' => '<b>' . TEXT_HEADING_RESET_PASSWORD . '</b>');
    $contents = array('form' => zen_draw_form('reset_password', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=reset',
                      'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('admin_name', $adminInfo->admin_name) . zen_draw_hidden_field('admin_email', $adminInfo->admin_email) . zen_draw_hidden_field('admin_level', $adminInfo->admin_level));
    $contents[] = array('text' => TEXT_EDIT_INTRO);
    $contents[] = array('text' => '<br><b>' . $adminInfo->admin_id . '</b>&nbsp;-&nbsp;' . $adminInfo->admin_name . '</b>');
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_PASSWORD . '<br>' . zen_draw_password_field('password_new', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=25)) );
    $contents[] = array('text' => '<br>' . TEXT_ADMINS_CONFIRM_PASSWORD . '<br>' . zen_draw_password_field('password_confirmation', '', zen_set_field_length(TABLE_ADMIN, 'admin_pass', $max=25)) );
    $contents[] = array('align' => 'center',
                        'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
  
  
//-------------------------------------------------------------------------------------------------------------------------
    case 'delete':
    $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_ADMIN . '</b>');
    $contents = array('form' => zen_draw_form('delete_admin', FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=deleteconfirm'));
    $contents[] = array('text' => TEXT_DELETE_INTRO);
    $contents[] = array('text' => '<br><b>' . $adminInfo->admin_name . '</b>');
    $contents[] = array('align' => 'center',
                        'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
  
//-------------------------------------------------------------------------------------------------------------------------
  default:
//-------------------------------------------------------------------------------------------------------------------------
    if (isset($adminInfo) && is_object($adminInfo)) {
    	$heading[] = array('text' => '<b>' . $adminInfo->admin_name . '</b>');
    	$contents[] = array('align' => 'center',
                          'text' => '<a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a><a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=resetpassword') . '">' . zen_image_button('button_reset_pwd.gif', IMAGE_RESET) . '</a><a href="' . zen_href_link(FILENAME_ADMIN, 'page=' . $_GET['page'] . '&adminID=' . $adminInfo->admin_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
    }
    
    break;
//-------------------------------------------------------------------------------------------------------------------------
} // end switch action

if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  echo '<td width="25%" valign="top">' . "\n";
  $box = new box;
  echo $box->infoBox($heading, $contents);
  echo '</td>' . "\n";
}
?>

	</tr>
</table>


		</td>
<!-- body_text_eof //-->
	</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                                              adminhome/AJAX_image_swapper.php                                                                    0000755 0001012 0001007 00000012223 11354623553 017334  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: categories.php 4809 2006-10-22 18:53:22Z ajeh $
 */

// $Id:AJAX_image_swapper.php,v1.0 2007/10/08 Jaycode jay@webextremecustomiser.com$
require('includes/application_top.php');
require(DIR_WS_MODULES . FILENAME_AJAX_PREV_NEXT);

if (!($_SESSION['gdv'] = gdVersion())) {
	$messageStack->add_session("GD extension is not installed in this server, you may still use this module, but without automatic resizing capability.");
}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<link rel="stylesheet" type="text/css" href="includes/styles_ajax_image_swapper.css">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
  cssjsmenu('navbar');
  if (document.getElementById)
  {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
  }
  if (typeof _editor_url == "string") HTMLArea.replaceAll();
	init_attributes_area();
}

function popupWindow(url) {
	window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=600,height=460,screenX=150,screenY=150,top=150,left=150')
}
// -->
</script>
<script language="javascript" src="includes/javascript/mootools-complete.js"></script>
<script language="javascript" src="includes/javascript/AJAX_image_swapper.js"></script>
<?php if ($action != 'edit_category_meta_tags') { // bof: categories meta tags ?>
<?php if ($editor_handler != '') include ($editor_handler); ?>
<?php } // meta tags disable editor eof: categories meta tags?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init();selectCategoryID()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<div id="mainContent">
<h1>AJAX Image Swapper v.3.1.4</h1>
<div id="jayMessage" style="padding: 0px; margin: 0px;">
	
</div>
<div id="imageManager">
	Select category: 
	<?php require(DIR_WS_MODULES . FILENAME_AJAX_PREV_NEXT_DISPLAY); ?>
	<br /><br />
	Product name: 
	<select id="productID" onChange="selectProductID()">
	<option value="1">--Please select a category first--</option>
	</select>
	<br /><br />
	Use attributes?
	<br />
	<input type="radio" name="useAttribute" value="0" id="useAttribute_0" checked onClick="set_no_attribute();" />
	<label for="useAttribute_0">No</label>
	<input type="radio" name="useAttribute" value="1" id="useAttribute_1" onClick="set_with_attribute();" />
	<label for="useAttribute_1">Yes</label>
	<br /><br />
	<div id="for_product_with_attributes">
		Set product images for option name
		<select id="attributeID" onChange="selectAttributeID()" value="Please select a product">
			<option value="1">--Please select a product first--</option>
		</select>
		<br /><br />
		with option value
		<select id="optionID" onChange="selectOptionID()" value="Please select an attribute">
			<option value="1">--Please select an option name first--</option>
		</select>
		<br /><br />
	</div>
	<div id="imagesDisplay">
		Images for selected product / attribute:<br />
		<select id="imageList" size="13" style="width:380px;" onChange="selectImage();">
			<option value="1">--Please select an option value first--</option>
		</select>
	</div>
	<br /><br />
	<div>
		<fieldset id="setupImages">
			<legend><b>Setup Images</b></legend>
			Click this button if you just installed this module to shop with product images already set up.<br />
			This will add the images to AIS image storage structure.
			<br /><br />
			<input type= "button" id="buttonSetupImages" value="Setup images" onClick="setupImages();" />
			<br /><br />
		</fieldset>
	</div>
	<div>
		<fieldset id="cleaningUp">
			<legend><b>Cleaning up</b></legend>
			Cleans up Ajax Image Swapper database by removing orphaned data and images, and rows with broken image links.<br />
			If you upgraded from AJAX Image Swapper 2.x, this will also fixes the upgrade issues.
			<br /><br />
			<input type= "button" id="buttonCleaningUp" value="Clean up now" onClick="cleanUp();" />
			<br /><br />
			<b>Note:<br />
			Orphaned data example: Image row pointing to empty attribute_id / products_id,<br />
			it could happen from for example if you removed a product before removing its attribute_images</b>
		</fieldset>
	</div>
</div>
<div id="imageDisplay">
</div>
	<br class="clearBoth" />
</div>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                             adminhome/AJAX_servers/                                                                             0000755 0001012 0001007 00000000000 11452615425 015464  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/AJAX_servers/AJAX_image_swapper_server.php                                                0000755 0001012 0001007 00000051231 11452617474 023224  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/* AJAX_image_swapper_server.php
 * PI = Product_Info
 * Made by Jaycode / Jay T (teguhwpurwanto@gmail.com)
 * 7 Oct 2007
*/
?>
<?php
if (isset($_GET['action'])) {
	chdir('../');
	
	require('includes/application_top.php');
	header('Content-Type: text/xml');
	$action = $_GET['action'];
	switch ($action) {
	case 'loadCategories':
		$sqlStr = "SELECT c.categories_id, categories_name 
							 FROM " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c 
							 WHERE c.categories_id = cd.categories_id AND cd.language_id = " . $_SESSION['languages_id'];
		$products = $db->Execute($sqlStr);
		$elements = array('categories_id','categories_name');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;	
	case 'loadProducts':
		if (is_numeric($_GET['category_id'])) {
			$category_id = $_GET['category_id'];
		}
		else {
			$category_id = 0;
		}		
		$sqlStr = "SELECT DISTINCT p.products_id, products_name 
							 FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc 
							 WHERE p.products_id = pd.products_id AND pc.categories_id = " . $category_id . " 
							 AND pd.language_id = " . $_SESSION['languages_id'] . " AND pc.products_id = p.products_id";
		$products = $db->Execute($sqlStr);
		$elements = array('products_id','products_name');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'loadAttributes':
		if (is_numeric($_GET['product_id'])) {
			$product_id = $_GET['product_id'];
		}
		else {
			$product_id = 0;
		}		
		$sqlStr = "SELECT DISTINCT o.products_options_id, products_options_name 
				   FROM " . TABLE_PRODUCTS_OPTIONS ." o, " . TABLE_PRODUCTS_ATTRIBUTES . " a 
				   WHERE o.products_options_id = a.options_id 
				   AND a.products_id = " . $product_id . " 
				   ORDER BY o.products_options_sort_order";
		$products = $db->Execute($sqlStr);
		$elements = array('products_options_id','products_options_name');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'loadOptions':
		if (is_numeric($_GET['product_id'])) {
			$product_id = $_GET['product_id'];
		}
		else {
			$product_id = 0;
		}
		
		if (is_numeric($_GET['attribute_id'])) {
			$attribute_id = $_GET['attribute_id'];
		}
		else {
			$attribute_id = 0;
		}
		$sqlStr = "SELECT a.products_attributes_id, products_options_values_name
				   FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " o, " . TABLE_PRODUCTS_ATTRIBUTES . " a 
				   WHERE o.products_options_values_id = a.options_values_id 
				   AND a.options_id = " . $attribute_id . " 
				   AND a.products_id = " . $product_id . " 
				   AND language_id = " . $_SESSION['languages_id'] . " 
				   ORDER BY o.products_options_values_sort_order";
		$products = $db->Execute($sqlStr);
		$elements = array('products_attributes_id','products_options_values_name');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'loadImages':
	case 'loadImagesFromIframe':
		if(isset($_GET['option_id']) && !empty($_GET['option_id'])) {
			$option_id = (is_numeric($_GET['option_id'])) ? ($_GET['option_id']) : (0);
			$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
					   WHERE products_attributes_id = " . $option_id . " 
					   ORDER BY image_sort_order";
		}
		elseif (!(isset($_GET['option_id']) && !empty($_GET['option_id'])) && isset($_GET['product_id'])){
			$products_id = $_GET['product_id'];
			$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
					   WHERE products_id_no_attribute = " . $products_id . " 
						 AND products_attributes_id = 0 
					   ORDER BY image_sort_order";			
		}
		else {
			$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
					   WHERE 1 = 2 
					   ORDER BY image_sort_order";	
		}
		$products = $db->Execute($sqlStr);
		$elements = array('image_id', 'image_path', 'image_title','image_sort_order');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'selectImage':
		$image_id = (is_numeric($_GET['image_id'])) ? ($_GET['image_id']) : (0);
		$sqlStr = "SELECT image_path, image_sort_order, image_title  
				   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
				   WHERE image_id = " . $image_id;
		$products = $db->Execute($sqlStr);
		$image_and_file_sizes = get_image_and_file_sizes('../' . $products->fields['image_path']);
		$products->fields['image_small_imagesize'] = $image_and_file_sizes['small_imagesize'];
		$products->fields['image_small_filesize'] = $image_and_file_sizes['small_filesize'];
		
		$products->fields['image_medium_filename'] = str_replace('../', '', get_image_filename('../' . $products->fields['image_path'], 'medium'));
		$products->fields['image_medium_imagesize'] = $image_and_file_sizes['medium_imagesize'];
		$products->fields['image_medium_filesize'] = $image_and_file_sizes['medium_filesize'];
		$products->fields['image_large_filename'] = str_replace('../', '', get_image_filename('../' . $products->fields['image_path'], 'large'));
		$products->fields['image_large_imagesize'] = $image_and_file_sizes['large_imagesize'];
		$products->fields['image_large_filesize'] = $image_and_file_sizes['large_filesize'];
		$elements = array('image_path', 'image_sort_order', 'image_title', 'image_small_imagesize', 'image_small_filesize', 'image_medium_filename', 'image_medium_imagesize', 'image_medium_filesize', 'image_large_filename', 'image_large_imagesize', 'image_large_filesize');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'update':
		$new_order = (is_numeric($_GET['new_order'])) ? ($_GET['new_order']) : (0);
		$new_title = (is_string($_GET['new_title'])) ? ($_GET['new_title']) : (0);
		$image_id = (is_numeric($_GET['image_id'])) ? ($_GET['image_id']) : (0);
		$option_id = (is_numeric($_GET['option_id'])) ? ($_GET['option_id']) : (0);
		
		$sqlStr = "UPDATE " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
				   SET image_sort_order = " . $new_order . ", 
					 image_title = '" . $new_title . "' 
				   WHERE image_id = " . $image_id;
		$db->Execute($sqlStr);
		
		$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
				   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
				   WHERE products_attributes_id = " . $option_id . " 
				   ORDER BY image_sort_order";
		$products = $db->Execute($sqlStr);
		$elements = array('image_id', 'image_path', 'image_title','image_sort_order');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'delImage':
		$image_id = (is_numeric($_GET['image_id'])) ? ($_GET['image_id']) : (0);
		//Delete Image
		$sqlStr = "SELECT image_path 
				   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . "
				   WHERE image_id = " . $image_id;
		$result = $db->Execute($sqlStr);
		$image_path = $result->fields['image_path'];
		deleteImage($image_path);
		
		$sqlStr = "DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
				   WHERE image_id = " . $image_id;
		$db->Execute($sqlStr);
		
		//Display image list
		if(isset($_GET['option_id'])) {
			$option_id = (is_numeric($_GET['option_id'])) ? ($_GET['option_id']) : (0);
			$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
					   WHERE products_attributes_id = " . $option_id . " 
					   ORDER BY image_sort_order";
		}
		else {
			$products_id = $_GET['product_id'];
			$sqlStr = "SELECT image_id, image_path, image_title, image_sort_order 
					   FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
					   WHERE products_id_no_attribute = " . $products_id . " 
						 AND products_attributes_id = 0 
					   ORDER BY image_sort_order";			
		}
		
		$products = $db->Execute($sqlStr);
		$elements = array('image_id', 'image_path', 'image_title','image_sort_order');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	
	case 'setupImages':
		//Add images from TABLE_PRODUCTS to TABLE_PRODUCT_ATTRIBUTES_IMAGES for products which images haven't already set up
			$sql = "SELECT p.products_id products_id, products_name, products_image FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " d 
							WHERE d.products_id = p.products_id 
							AND language_id = " . $_SESSION['languages_id'];
			//echo $sql . "\n";
			$results = $db->Execute($sql);
			if ($results->recordCount() > 0) {
				while (!$results->EOF) {
					$products_id = zen_db_prepare_input($results->fields['products_id']);
					$products_name = zen_db_prepare_input($results->fields['products_name']);
					$image_path = zen_db_prepare_input(DIR_WS_IMAGES . ($results->fields['products_image']));
					$set_image_path = true;
				//bof - Add the image if no image found at that product (on attribute image table) OR image path found but pointing to incorrect file
					$sql = "SELECT image_path FROM . " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
									WHERE products_id_no_attribute = :products_id";
					$sql  = $db->bindVars($sql, ':products_id', $products_id, 'integer');
					$check = $db->Execute($sql);
					if ($check->recordCount() > 0) {
						if (file_exists('../' . $check->fields['image_path'])) {
							$set_image_path = false;
						}
					}
				//eof - Add the image if no image found at that product (on attribute image table) OR image path found but not pointing to correct file
					if ($set_image_path == true) {
					//Adding the image - if multiple images found add these as well
						$sql = "INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
										(products_attributes_id, products_id_no_attribute, image_path, image_title, image_sort_order) 
										VALUES(0, :products_id, :image_path, :products_name, 0)";
						$sql  = $db->bindVars($sql, ':products_id', $products_id, 'integer');
						$sql  = $db->bindVars($sql, ':image_path', $image_path, 'string');
						$sql  = $db->bindVars($sql, ':products_name', $products_name, 'string');

						//echo $sql . "\n";
						$db->Execute($sql);
						
					//This is the multiple image area
						// prepare image name
						$products_image = str_replace(DIR_WS_IMAGES, '', $image_path);
						$products_image_extension = substr($products_image, strrpos($products_image, '.'));
						$products_image_base = str_replace($products_image_extension, '', $products_image);

						// if in a subdirectory
						if (strrpos($products_image, '/')) {
							$products_image_match = substr($products_image, strrpos($products_image, '/')+1);
							//echo 'TEST 1: I match ' . $products_image_match . ' - ' . $file . ' -  base ' . $products_image_base . "\n";
							$products_image_match = str_replace($products_image_extension, '', $products_image_match) . '_';
							$products_image_base = $products_image_match;
						}

						$products_image_directory = str_replace($products_image, '', substr($products_image, strrpos($products_image, '/')));
						if ($products_image_directory != '') {
							$products_image_directory = '../' . DIR_WS_IMAGES . str_replace($products_image_directory, '', $products_image) . "/";
						} else {
							$products_image_directory = '../' . DIR_WS_IMAGES;
						}
						
						//resize image if _MED and _LRG not found
						if (!empty($products_image_base) && !file_exists($products_image_directory . 'medium/' . $products_image_base . $ais_config['medium']['suffix'] . $products_image_extension)) {
							$med_dir = create_size_dir('../' . $image_path, 'medium');
							ais_resize_image($med_dir . $products_image_base . $ais_config['medium']['suffix'] . $products_image_extension, '../' . $image_path, $ais_config['medium']['width'], $ais_config['medium']['height']);
						}
						file_put_contents('debug.txt', 'check large ' . $products_image_directory . 'large/' . $products_image_base . $ais_config['large']['suffix'] . $products_image_extension . "\n", FILE_APPEND);							
						if (!empty($products_image_base) && !file_exists($products_image_directory . 'large/' . $products_image_base . $ais_config['large']['suffix'] . $products_image_extension)) {
							$lrg_dir = create_size_dir('../' . $image_path, 'large');
							file_put_contents('debug.txt', $lrg_dir . $products_image_base . $ais_config['large']['suffix'] . $products_image_extension . ' src: ' . '../' . $image_path . "\n", FILE_APPEND);							
							ais_resize_image($lrg_dir . $products_image_base . $ais_config['large']['suffix'] . $products_image_extension, '../' . $image_path, $ais_config['large']['width'], $ais_config['large']['height']);
						}
						//if image has a large size, resize small image
						if (!empty($products_image_base) && file_exists($products_image_directory . 'large/' . $products_image_base . $ais_config['large']['suffix'] . $products_image_extension)) {
							ais_resize_image('../' . $image_path, '../' . $image_path, $ais_config['small']['width'], $ais_config['small']['height']);
						}
						// Check for additional matching images
						$images_array = array();
						//echo $products_image_directory . "\n";
						$file_extension = $products_image_extension;
						$products_image_match_array = array();
						if ($dir = @dir($products_image_directory)) {
							while ($file = $dir->read()) {
								//echo $products_image_directory . $file . "\n";
								if (!is_dir($products_image_directory . $file)) {
									if (substr($file, strrpos($file, '.')) == $file_extension) {
										//          if(preg_match("/" . $products_image_match . "/i", $file) == '1') {
										if(preg_match("/" . $products_image_base . "/i", $file) == 1) {
											if ($file != $products_image) {
												if ($products_image_base . str_replace($products_image_base, '', $file) == $file) {
														//echo 'I AM A MATCH ' . $file . "\n";
													$images_array[] = str_replace('../','',$products_image_directory) . $file;
												} else {
														//echo 'I AM NOT A MATCH ' . $file . "\n";
												}
											}
										}
									}
								}
							}
							if (sizeof($images_array)) {
								sort($images_array);
							}
							$dir->close();
						}
					}
					if (!empty($images_array)) {
						foreach ($images_array as $new_image_path) {
						//Adding the image
							$sql = "INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
											(products_attributes_id, products_id_no_attribute, image_path, image_title, image_sort_order) 
											VALUES(0, :products_id, :new_image_path, :products_name, 0)";
							$sql  = $db->bindVars($sql, ':products_id', $products_id, 'integer');
							$sql  = $db->bindVars($sql, ':new_image_path', $new_image_path, 'string');
							$sql  = $db->bindVars($sql, ':products_name', $products_name, 'string');

							//echo $sql . "\n";
							$db->Execute($sql);
						}
					}
					$results->MoveNext();
				}
			}
		//Creates dummy sql results
		$sqlStr = "SELECT image_id FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " WHERE 1 = 2";
		$products = $db->Execute($sqlStr);
		$elements = array('image_id');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	case 'cleanUp':
		//Cleans up orphan data & files
		$sqlStr = "SELECT image_path FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
							 WHERE (products_attributes_id <> 0 
							 AND products_attributes_id NOT IN (
								SELECT products_attributes_id 
								FROM " . TABLE_PRODUCTS_ATTRIBUTES . " 
							 ))
							 OR (products_attributes_id = 0
							 AND products_id_no_attribute NOT IN (
								SELECT products_id
								FROM " . TABLE_PRODUCTS . "
							 ))";
		$results = $db->Execute($sqlStr);
		if ($results->recordCount() > 0) {
			while (!$results->EOF) {
				deleteImage($results->fields['image_path']);
				$results->MoveNext();
			}
		}
		
		$sqlStr = "DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
							 WHERE (products_attributes_id <> 0 
							 AND products_attributes_id NOT IN (
								SELECT products_attributes_id 
								FROM " . TABLE_PRODUCTS_ATTRIBUTES . " 
							 ))
							 OR (products_attributes_id = 0
							 AND products_id_no_attribute NOT IN (
								SELECT products_id
								FROM " . TABLE_PRODUCTS . "
							 ))";
		$db->Execute($sqlStr);
		
		// Cleans up data with broken image link, while moving the medium and large images to the rightful places, if found wrong
		$sqlStr = "SELECT image_path FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES;
		$image_path_list = $db->Execute($sqlStr);
		if ($image_path_list->recordCount() > 0) {
			while(!$image_path_list->EOF) {
				$image_path = $image_path_list->fields['image_path'];
				$new_filename = '../' . $image_path;
				if(!file_exists($new_filename)) {
					$sqlStr = "DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
										 WHERE image_path = '" . $image_path . "'";
					$db->Execute($sqlStr);
				}
				else {
					//This is the part for moving medium and large image. Gets the filenames using existing version's technique then move them to new locations
					$old_med_filename = get_image_filename_old_version($new_filename, 'medium');
					$old_lrg_filename = get_image_filename_old_version($new_filename, 'large');
					if ($old_med_filename != $new_filename) { // Meaning there IS a medium size image
						move_image_to_new_location($old_med_filename, 'medium');
					}
					if ($old_lrg_filename != $new_filename) { // Meaning there IS a large size image
						move_image_to_new_location($old_lrg_filename, 'large');
					}			
				}
				$image_path_list->MoveNext();
			}
		}
		
		$sqlStr = "SELECT products_id FROM " . TABLE_PRODUCTS;
		$results = $db->Execute($sqlStr);
		if ($results->recordCount() > 0) {
			while (!$results->EOF) {
				$products_id = $results->fields['products_id'];
				//Get the topmost image available for given products_id, taken from products_attributes_images table
				$default_image = get_default_image($products_id);
				if (!empty($default_image)) {
					//echo 'products_id = ' . $products_id . "\n" . 'default_image = ' . $default_image . "\n";
					//If the product doesn't already have an image or has a broken image link, add the image to products table
					set_image_in_products_table($products_id, $default_image);					
				}
				$results->MoveNext();
			}
		}
		$products_id = $results->fields['products_id'];
		
		//Creates dummy sql results
		$sqlStr = "SELECT image_id FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " WHERE 1 = 2";
		$products = $db->Execute($sqlStr);
		$elements = array('image_id');
		$xmlStr = getXML($action, $products, $elements);
		echo $xmlStr;
		break;
	}
}

function get_image_and_file_sizes($filename) {
	$medium_filename = get_image_filename($filename, 'medium');
	$large_filename = get_image_filename($filename, 'large');
	
	$info_array = array();
	$small_imagesize = @getimagesize($filename);
	$medium_imagesize = @getimagesize($medium_filename);
	$large_imagesize = @getimagesize($large_filename);
	
	if ($small_imagesize != false && $medium_imagesize != false && $large_imagesize != false) {
		$info_array['small_imagesize'] = $small_imagesize[0] . 'x' . $small_imagesize[1];
		$info_array['small_filesize'] = round(filesize($filename)/1024, 2) . 'Kb';
		$info_array['medium_imagesize'] = $medium_imagesize[0] . 'x' . $medium_imagesize[1];
		$info_array['medium_filesize'] = round(filesize($medium_filename)/1024, 2) . 'Kb';
		$info_array['large_imagesize'] = $large_imagesize[0] . 'x' . $large_imagesize[1];
		$info_array['large_filesize'] = round(filesize($large_filename)/1024, 2) . 'Kb';
	}
	else {
		$info_array['small_imagesize'] = '0x0';
		$info_array['small_filesize'] = '0Kb';
		$info_array['medium_imagesize'] = '0x0';
		$info_array['medium_filesize'] = '0Kb';
		$info_array['large_imagesize'] = '0x0';
		$info_array['large_filesize'] = '0Kb';
	}
	return $info_array;
}

/*
getXML function
$action = the name of action, returned as the value of attribute "action" of node "items"
$items = result of $db->Execute($sqlStr)
$elements = array of returned node tagNames
*/
function getXML($action, $items, $elements) {
	if ($items->recordCount() > 0) {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		while (!$items->EOF) {
			$itemNode = $doc->createElement('item');
			$itemNode = $itemsNode->appendChild($itemNode);
			for($i = 0; $i < count($elements); $i++) {
				$elementNode = $doc->createElement($elements[$i]);
				$elementNode = $itemNode->appendChild($elementNode);
				$valueNode = $doc->createTextNode($items->fields[$elements[$i]]);
				$valueNode = $elementNode->appendChild($valueNode);
			}
			$items->MoveNext();
		}
		$xmlStr = $doc->saveXML();
		return $xmlStr;
	}
	else {
		$doc = new DomDocument('1.0', 'utf-8');
		$itemsNode = $doc->createElement('items');
		$itemsNode = $doc->appendChild($itemsNode);
		$itemsNode->setAttribute('action',$action);
		$itemNode = $doc->createElement('item');
		$itemNode = $itemsNode->appendChild($itemNode);

		$xmlStr = $doc->saveXML();
		return $xmlStr;
	}
}
?>                                                                                                                                                                                                                                                                                                                                                                       adminhome/alt_nav.php                                                                               0000755 0001012 0001007 00000005772 10311431002 015317  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: alt_nav.php 1969 2005-09-13 06:57:21Z drbyte $
//

  require('includes/application_top.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<script language="JavaScript" src="includes/menu.js" type="text/JavaScript"></script>
<link href="includes/stylesheet.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="includes/nde-basic.css" type="text/css" media="screen, projection">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS'); 
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<?php

  require(DIR_WS_BOXES . 'configuration_dhtml.php');
  require(DIR_WS_BOXES . 'catalog_dhtml.php');
  require(DIR_WS_BOXES . 'modules_dhtml.php');
  require(DIR_WS_BOXES . 'customers_dhtml.php');
  require(DIR_WS_BOXES . 'taxes_dhtml.php');
  require(DIR_WS_BOXES . 'localization_dhtml.php');
  require(DIR_WS_BOXES . 'reports_dhtml.php');
  require(DIR_WS_BOXES . 'tools_dhtml.php');
  require(DIR_WS_BOXES . 'gv_admin_dhtml.php');
  require(DIR_WS_BOXES . 'extras_dhtml.php');

?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>      adminhome/attributes_controller.php                                                                 0000755 0001012 0001007 00000411671 11372500572 020344  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: attributes_controller.php 16260 2010-05-12 15:22:50Z drbyte $
 */

  require('includes/application_top.php');
  // troubleshooting/debug of option name/value IDs:
  $show_name_numbers = true;
  $show_value_numbers = true;

  // verify option names, values, products
  $chk_option_names = $db->Execute("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $_SESSION['languages_id'] . "' limit 1");
  if ($chk_option_names->RecordCount() < 1) {
    $messageStack->add_session(ERROR_DEFINE_OPTION_NAMES, 'caution');
    zen_redirect(zen_href_link(FILENAME_OPTIONS_NAME_MANAGER));
  }
  $chk_option_values = $db->Execute("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id='" . $_SESSION['languages_id'] . "' limit 1");
  if ($chk_option_values->RecordCount() < 1) {
    $messageStack->add_session(ERROR_DEFINE_OPTION_VALUES, 'caution');
    zen_redirect(zen_href_link(FILENAME_OPTIONS_VALUES_MANAGER));
  }
  $chk_products = $db->Execute("select * from " . TABLE_PRODUCTS . " limit 1");
  if ($chk_products->RecordCount() < 1) {
    $messageStack->add_session(ERROR_DEFINE_PRODUCTS, 'caution');
    zen_redirect(zen_href_link(FILENAME_CATEGORIES));
  }

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $languages = zen_get_languages();

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  $products_filter = (isset($_GET['products_filter']) ? $_GET['products_filter'] : $products_filter);

  $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);

  if ($action == 'new_cat') {
    $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);
    $sql =     "select ptc.*
    from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
    on ptc.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    where ptc.categories_id='" . $current_category_id . "'
    order by pd.products_name";
    $new_product_query = $db->Execute($sql);
    $products_filter = $new_product_query->fields['products_id'];
    zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id));
  }

// set categories and products if not set
  if ($products_filter == '' and $current_category_id != '') {
    $sql =     "select ptc.*
    from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
    on ptc.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    where ptc.categories_id='" . $current_category_id . "'
    order by pd.products_name";
    $new_product_query = $db->Execute($sql);
    $products_filter = $new_product_query->fields['products_id'];
    if ($products_filter != '') {
      zen_redirect(zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id));
    }
  } else {
    if ($products_filter == '' and $current_category_id == '') {
      $reset_categories_id = zen_get_category_tree('', '', '0', '', '', true);
      $current_category_id = $reset_categories_id[0]['id'];
      $sql = "select ptc.*
      from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
      left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
      on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
      where ptc.categories_id='" . $current_category_id . "'
      order by pd.products_name";
      $new_product_query = $db->Execute($sql);
      $products_filter = $new_product_query->fields['products_id'];
      $_GET['products_filter'] = $products_filter;
    }
  }

  require(DIR_WS_MODULES . FILENAME_PREV_NEXT);

  if (zen_not_null($action)) {
    $_SESSION['page_info'] = '';
    if (isset($_GET['option_page'])) $_SESSION['page_info'] .= 'option_page=' . $_GET['option_page'] . '&';
    if (isset($_GET['value_page'])) $_SESSION['page_info'] .= 'value_page=' . $_GET['value_page'] . '&';
    if (isset($_GET['attribute_page'])) $_SESSION['page_info'] .= 'attribute_page=' . $_GET['attribute_page'] . '&';
    if (isset($_GET['products_filter'])) $_SESSION['page_info'] .= 'products_filter=' . $_GET['products_filter'] . '&';
    if (isset($_GET['current_category_id'])) $_SESSION['page_info'] .= 'current_category_id=' . $_GET['current_category_id'] . '&';

    if (zen_not_null($_SESSION['page_info'])) {
      $_SESSION['page_info'] = substr($_SESSION['page_info'], 0, -1);
    }

    switch ($action) {
/////////////////////////////////////////
//// BOF OF FLAGS
      case 'set_flag_attributes_display_only':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_display_only from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['attributes_display_only'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_display_only='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_display_only='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

      case 'set_flag_product_attribute_is_free':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, product_attribute_is_free from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['product_attribute_is_free'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set product_attribute_is_free='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set product_attribute_is_free='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

      case 'set_flag_attributes_default':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_default from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['attributes_default'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_default='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_default='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

      case 'set_flag_attributes_discounted':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_discounted from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['attributes_discounted'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_discounted='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_discounted='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($_GET['products_filter']);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

      case 'set_flag_attributes_price_base_included':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_price_base_included from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['attributes_price_base_included'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_price_base_included='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_price_base_included='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($_GET['products_filter']);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

      case 'set_flag_attributes_required':
        $action='';
        $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_required from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        if ($new_flag->fields['attributes_required'] == '0') {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_required='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        } else {
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_required='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'");
        }
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;

//// EOF OF FLAGS
/////////////////////////////////////////

      case 'set_products_filter':
        $_GET['products_filter'] = $_POST['products_filter'];
        $_GET['current_category_id'] = $_POST['current_category_id'];
        $action='';
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_GET['products_filter'] . '&current_category_id=' . $_GET['current_category_id']));
        break;
// update by product
      case ('update_product'):
        if (!zen_has_product_attributes($products_filter, 'false')) {
          $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT_NONE . $products_filter . ' ' . zen_get_products_name($products_filter, $_SESSION['languages_id']), 'error');
        } else {
          $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT . $products_filter . ' ' . zen_get_products_name($products_filter, $_SESSION['languages_id']), 'success');
          zen_update_attributes_products_option_values_sort_order($products_filter);
        }
        $action='';
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_GET['current_category_id']));
        break;
      case 'add_product_attributes':
        $current_image_name = '';
        for ($i=0; $i<sizeof($_POST['values_id']); $i++) {
// check for duplicate and block them
          $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . "
                                           where products_id ='" . $_POST['products_id'] . "'
                                           and options_id = '" . $_POST['options_id'] . "'
                                           and options_values_id = '" . $_POST['values_id'][$i] . "'");
          if ($check_duplicate->RecordCount() > 0) {
            // do not add duplicates -- give a warning
            $messageStack->add_session(ATTRIBUTE_WARNING_DUPLICATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id'][$i]), 'error');
          } else {
// For TEXT and FILE option types, ignore option value entered by administrator and use PRODUCTS_OPTIONS_VALUES_TEXT instead.
            $products_options_array = $db->Execute("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'");
            $values_id = zen_db_prepare_input((($products_options_array->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT) or ($products_options_array->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE)) ? PRODUCTS_OPTIONS_VALUES_TEXT_ID : $_POST['values_id'][$i]);

            $products_id = zen_db_prepare_input($_POST['products_id']);
            $options_id = zen_db_prepare_input($_POST['options_id']);
//            $values_id = zen_db_prepare_input($_POST['values_id'][$i]);
            $value_price = zen_db_prepare_input($_POST['value_price']);
            $price_prefix = zen_db_prepare_input($_POST['price_prefix']);

            $products_options_sort_order = zen_db_prepare_input($_POST['products_options_sort_order']);

// modified options sort order to use default if not otherwise set
            if (zen_not_null($_POST['products_options_sort_order'])) {
              $products_options_sort_order = zen_db_prepare_input($_POST['products_options_sort_order']);
            } else {
              $sort_order_query = $db->Execute("select products_options_values_sort_order from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $_POST['values_id'][$i] . "'");
              $products_options_sort_order = $sort_order_query->fields['products_options_values_sort_order'];
            } // end if (zen_not_null($_POST['products_options_sort_order'])

// end modification for sort order

            $product_attribute_is_free = zen_db_prepare_input($_POST['product_attribute_is_free']);
            $products_attributes_weight = zen_db_prepare_input($_POST['products_attributes_weight']);
            $products_attributes_weight_prefix = zen_db_prepare_input($_POST['products_attributes_weight_prefix']);
            $attributes_display_only = zen_db_prepare_input($_POST['attributes_display_only']);
            $attributes_default = zen_db_prepare_input($_POST['attributes_default']);
            $attributes_discounted = zen_db_prepare_input($_POST['attributes_discounted']);
            $attributes_price_base_included = zen_db_prepare_input($_POST['attributes_price_base_included']);

            $attributes_price_onetime = zen_db_prepare_input($_POST['attributes_price_onetime']);
            $attributes_price_factor = zen_db_prepare_input($_POST['attributes_price_factor']);
            $attributes_price_factor_offset = zen_db_prepare_input($_POST['attributes_price_factor_offset']);
            $attributes_price_factor_onetime = zen_db_prepare_input($_POST['attributes_price_factor_onetime']);
            $attributes_price_factor_onetime_offset = zen_db_prepare_input($_POST['attributes_price_factor_onetime_offset']);
            $attributes_qty_prices = zen_db_prepare_input($_POST['attributes_qty_prices']);
            $attributes_qty_prices_onetime = zen_db_prepare_input($_POST['attributes_qty_prices_onetime']);

            $attributes_price_words = zen_db_prepare_input($_POST['attributes_price_words']);
            $attributes_price_words_free = zen_db_prepare_input($_POST['attributes_price_words_free']);
            $attributes_price_letters = zen_db_prepare_input($_POST['attributes_price_letters']);
            $attributes_price_letters_free = zen_db_prepare_input($_POST['attributes_price_letters_free']);
            $attributes_required = zen_db_prepare_input($_POST['attributes_required']);

// add - update as record exists
// attributes images
// when set to none remove from database
// only processes image once for multiple selection of options_values_id
            if ($i == 0) {
              if (isset($_POST['attributes_image']) && zen_not_null($_POST['attributes_image']) && ($_POST['attributes_image'] != 'none')) {
                $attributes_image = zen_db_prepare_input($_POST['attributes_image']);
              } else {
                $attributes_image = '';
              }

              $attributes_image = new upload('attributes_image');
              $attributes_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
              if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) {
                $attributes_image_name = $_POST['img_dir'] . $attributes_image->filename;
              } else {
                $attributes_image_name = (isset($_POST['attributes_previous_image']) ? $_POST['attributes_previous_image'] : '');
              }
              $current_image_name = $attributes_image_name;
            } else {
              $attributes_image_name = $current_image_name;
            }

            $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required)
                          values (0,
                                  '" . (int)$products_id . "',
                                  '" . (int)$options_id . "',
                                  '" . (int)$values_id . "',
                                  '" . (float)zen_db_input($value_price) . "',
                                  '" . zen_db_input($price_prefix) . "',
                                  '" . (int)zen_db_input($products_options_sort_order) . "',
                                  '" . (int)zen_db_input($product_attribute_is_free) . "',
                                  '" . (float)zen_db_input($products_attributes_weight) . "',
                                  '" . zen_db_input($products_attributes_weight_prefix) . "',
                                  '" . (int)zen_db_input($attributes_display_only) . "',
                                  '" . (int)zen_db_input($attributes_default) . "',
                                  '" . (int)zen_db_input($attributes_discounted) . "',
                                  '" . zen_db_input($attributes_image_name) . "',
                                  '" . (int)zen_db_input($attributes_price_base_included) . "',
                                  '" . (float)zen_db_input($attributes_price_onetime) . "',
                                  '" . (float)zen_db_input($attributes_price_factor) . "',
                                  '" . (float)zen_db_input($attributes_price_factor_offset) . "',
                                  '" . (float)zen_db_input($attributes_price_factor_onetime) . "',
                                  '" . (float)zen_db_input($attributes_price_factor_onetime_offset) . "',
                                  '" . zen_db_input($attributes_qty_prices) . "',
                                  '" . zen_db_input($attributes_qty_prices_onetime) . "',
                                  '" . (float)zen_db_input($attributes_price_words) . "',
                                  '" . (int)zen_db_input($attributes_price_words_free) . "',
                                  '" . (float)zen_db_input($attributes_price_letters) . "',
                                  '" . (int)zen_db_input($attributes_price_letters_free) . "',
                                  '" . (int)zen_db_input($attributes_required) . "')");

            if (DOWNLOAD_ENABLED == 'true') {
              $products_attributes_id = $db->Insert_ID();

              $products_attributes_filename = zen_db_prepare_input($_POST['products_attributes_filename']);
              $products_attributes_maxdays = (int)zen_db_prepare_input($_POST['products_attributes_maxdays']);
              $products_attributes_maxcount = (int)zen_db_prepare_input($_POST['products_attributes_maxcount']);

//die( 'I am adding ' . strlen($_POST['products_attributes_filename']) . ' vs ' . strlen(trim($_POST['products_attributes_filename'])) . ' vs ' . strlen(zen_db_prepare_input($_POST['products_attributes_filename'])) . ' vs ' . strlen(zen_db_input($products_attributes_filename)) );
              if (zen_not_null($products_attributes_filename)) {
                $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
                              (products_attributes_id, products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount)
                              values (" . (int)$products_attributes_id . ",
                                      '" . zen_db_input($products_attributes_filename) . "',
                                      '" . zen_db_input($products_attributes_maxdays) . "',
                                      '" . zen_db_input($products_attributes_maxcount) . "')");
              }
            }
          }
        }

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($_POST['products_id']);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_POST['products_id'] . '&current_category_id=' . $_POST['current_category_id']));
        break;
      case 'update_product_attribute':
        $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . "
                                         where products_id ='" . $_POST['products_id'] . "'
                                         and options_id = '" . $_POST['options_id'] . "'
                                         and options_values_id = '" . $_POST['values_id'] . "'
                                         and products_attributes_id != '" . $_POST['attribute_id'] . "'");

        if ($check_duplicate->RecordCount() > 0) {
          // do not add duplicates give a warning
          $messageStack->add_session(ATTRIBUTE_WARNING_DUPLICATE_UPDATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error');
        } else {
          // Validate options_id and options_value_id
          if (!zen_validate_options_to_options_value($_POST['options_id'], $_POST['values_id'])) {
            // do not add invalid match
            $messageStack->add_session(ATTRIBUTE_WARNING_INVALID_MATCH_UPDATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error');
          } else {
            // add the new attribute
// iii 030811 added:  Enforce rule that TEXT and FILE Options use value PRODUCTS_OPTIONS_VALUES_TEXT_ID
        $products_options_query = $db->Execute("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'");
        switch ($products_options_array->fields['products_options_type']) {
          case PRODUCTS_OPTIONS_TYPE_TEXT:
          case PRODUCTS_OPTIONS_TYPE_FILE:
            $values_id = PRODUCTS_OPTIONS_VALUES_TEXT_ID;
            break;
          default:
          $values_id = zen_db_prepare_input($_POST['values_id']);
        }
// iii 030811 added END

            $products_id = zen_db_prepare_input($_POST['products_id']);
            $options_id = zen_db_prepare_input($_POST['options_id']);
//            $values_id = zen_db_prepare_input($_POST['values_id']);
            $value_price = zen_db_prepare_input($_POST['value_price']);
            $price_prefix = zen_db_prepare_input($_POST['price_prefix']);

            $products_options_sort_order = zen_db_prepare_input($_POST['products_options_sort_order']);
            $product_attribute_is_free = zen_db_prepare_input($_POST['product_attribute_is_free']);
            $products_attributes_weight = zen_db_prepare_input($_POST['products_attributes_weight']);
            $products_attributes_weight_prefix = zen_db_prepare_input($_POST['products_attributes_weight_prefix']);
            $attributes_display_only = zen_db_prepare_input($_POST['attributes_display_only']);
            $attributes_default = zen_db_prepare_input($_POST['attributes_default']);
            $attributes_discounted = zen_db_prepare_input($_POST['attributes_discounted']);
            $attributes_price_base_included = zen_db_prepare_input($_POST['attributes_price_base_included']);

            $attributes_price_onetime = zen_db_prepare_input($_POST['attributes_price_onetime']);
            $attributes_price_factor = zen_db_prepare_input($_POST['attributes_price_factor']);
            $attributes_price_factor_offset = zen_db_prepare_input($_POST['attributes_price_factor_offset']);
            $attributes_price_factor_onetime = zen_db_prepare_input($_POST['attributes_price_factor_onetime']);
            $attributes_price_factor_onetime_offset = zen_db_prepare_input($_POST['attributes_price_factor_onetime_offset']);
            $attributes_qty_prices = zen_db_prepare_input($_POST['attributes_qty_prices']);
            $attributes_qty_prices_onetime = zen_db_prepare_input($_POST['attributes_qty_prices_onetime']);

            $attributes_price_words = zen_db_prepare_input($_POST['attributes_price_words']);
            $attributes_price_words_free = zen_db_prepare_input($_POST['attributes_price_words_free']);
            $attributes_price_letters = zen_db_prepare_input($_POST['attributes_price_letters']);
            $attributes_price_letters_free = zen_db_prepare_input($_POST['attributes_price_letters_free']);
            $attributes_required = zen_db_prepare_input($_POST['attributes_required']);

            $attribute_id = zen_db_prepare_input($_POST['attribute_id']);

// edit
// attributes images
// when set to none remove from database
          if (isset($_POST['attributes_image']) && zen_not_null($_POST['attributes_image']) && ($_POST['attributes_image'] != 'none')) {
            $attributes_image = zen_db_prepare_input($_POST['attributes_image']);
            $attributes_image_none = false;
          } else {
            $attributes_image = '';
            $attributes_image_none = true;
          }

          $attributes_image = new upload('attributes_image');
          $attributes_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
          if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) {
            $attributes_image_name = ($attributes_image->filename != 'none' ? ($_POST['img_dir'] . $attributes_image->filename) : '');
          } else {
            $attributes_image_name = ((isset($_POST['attributes_previous_image']) and $_POST['attributes_image'] != 'none') ? $_POST['attributes_previous_image'] : '');
          }

if ($_POST['image_delete'] == 1) {
  $attributes_image_name = '';
}
// turned off until working
          $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . "
                        set attributes_image = '" .  $attributes_image_name . "'
                        where products_attributes_id = '" . (int)$attribute_id . "'");

            $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . "
                          set products_id = '" . (int)$products_id . "',
                              options_id = '" . (int)$options_id . "',
                              options_values_id = '" . (int)$values_id . "',
                              options_values_price = '" . zen_db_input($value_price) . "',
                              price_prefix = '" . zen_db_input($price_prefix) . "',
                              products_options_sort_order = '" . zen_db_input($products_options_sort_order) . "',
                              product_attribute_is_free = '" . zen_db_input($product_attribute_is_free) . "',
                              products_attributes_weight = '" . zen_db_input($products_attributes_weight) . "',
                              products_attributes_weight_prefix = '" . zen_db_input($products_attributes_weight_prefix) . "',
                              attributes_display_only = '" . zen_db_input($attributes_display_only) . "',
                              attributes_default = '" . zen_db_input($attributes_default) . "',
                              attributes_discounted = '" . zen_db_input($attributes_discounted) . "',
                              attributes_price_base_included = '" . zen_db_input($attributes_price_base_included) . "',
                              attributes_price_onetime = '" . zen_db_input($attributes_price_onetime) . "',
                              attributes_price_factor = '" . zen_db_input($attributes_price_factor) . "',
                              attributes_price_factor_offset = '" . zen_db_input($attributes_price_factor_offset) . "',
                              attributes_price_factor_onetime = '" . zen_db_input($attributes_price_factor_onetime) . "',
                              attributes_price_factor_onetime_offset = '" . zen_db_input($attributes_price_factor_onetime_offset) . "',
                              attributes_qty_prices = '" . zen_db_input($attributes_qty_prices) . "',
                              attributes_qty_prices_onetime = '" . zen_db_input($attributes_qty_prices_onetime) . "',
                              attributes_price_words = '" . zen_db_input($attributes_price_words) . "',
                              attributes_price_words_free = '" . zen_db_input($attributes_price_words_free) . "',
                              attributes_price_letters = '" . zen_db_input($attributes_price_letters) . "',
                              attributes_price_letters_free = '" . zen_db_input($attributes_price_letters_free) . "',
                              attributes_required = '" . zen_db_input($attributes_required) . "'
                          where products_attributes_id = '" . (int)$attribute_id . "'");

            if (DOWNLOAD_ENABLED == 'true') {
              $products_attributes_filename = zen_db_prepare_input($_POST['products_attributes_filename']);
              $products_attributes_maxdays = zen_db_prepare_input($_POST['products_attributes_maxdays']);
              $products_attributes_maxcount = zen_db_prepare_input($_POST['products_attributes_maxcount']);

              if (zen_not_null($products_attributes_filename)) {
                $db->Execute("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
                              set products_attributes_id = '" . (int)$attribute_id . "',
                                  products_attributes_filename = '" . zen_db_input($products_attributes_filename) . "',
                                  products_attributes_maxdays = '" . zen_db_input($products_attributes_maxdays) . "',
                                  products_attributes_maxcount = '" . zen_db_input($products_attributes_maxcount) . "'");
              }
            }
          }
        }

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($_POST['products_id']);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&current_category_id=' . $_POST['current_category_id']));
        break;
      case 'delete_attribute':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&current_category_id=' . $_POST['current_category_id']));
        }
        $attribute_id = zen_db_prepare_input($_GET['attribute_id']);

        $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . "
                      where products_attributes_id = '" . (int)$attribute_id . "'");

// added for DOWNLOAD_ENABLED. Always try to remove attributes, even if downloads are no longer enabled
        $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
                      where products_attributes_id = '" . (int)$attribute_id . "'");

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($products_filter);

//        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info']));
        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&current_category_id=' . $current_category_id));
        break;
// delete all attributes
      case 'delete_all_attributes':
        zen_delete_products_attributes($_POST['products_filter']);
        $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED . ' ID#' . $products_filter, 'success');
        $action='';
        $products_filter = $_POST['products_filter'];

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($products_filter);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
        break;

      case 'delete_option_name_values':
        $delete_attributes_options_id = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_POST['products_filter'] . "' and options_id='" . $_POST['products_options_id_all'] . "'");
        while (!$delete_attributes_options_id->EOF) {
// remove any attached downloads
          $remove_downloads = $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id= '" . $delete_attributes_options_id->fields['products_attributes_id'] . "'");
// remove all option values
          $delete_attributes_options_id_values = $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_POST['products_filter'] . "' and options_id='" . $_POST['products_options_id_all'] . "'");
          $delete_attributes_options_id->MoveNext();
        }

        $action='';
        $products_filter = $_POST['products_filter'];
        $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED_OPTION_NAME_VALUES. ' ID#' . zen_options_name($_POST['products_options_id_all']), 'success');

        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($products_filter);

        zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
        break;


// attributes copy to product
    case 'update_attributes_copy_to_product':
      $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
      $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
      $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
      zen_copy_products_attributes($_POST['products_filter'], $_POST['products_update_id']);
      $_GET['action']= '';
      $products_filter = $_POST['products_update_id'];
      zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
      break;

// attributes copy to category
    case 'update_attributes_copy_to_category':
      $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
      $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
      $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
      if ($_POST['categories_update_id'] == '') {
        $messageStack->add_session(WARNING_PRODUCT_COPY_TO_CATEGORY_NONE . ' ID#' . $_POST['products_filter'], 'warning');
      } else {
        $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $_POST['categories_update_id'] . "'");
        while (!$copy_to_category->EOF) {
          zen_copy_products_attributes($_POST['products_filter'], $copy_to_category->fields['products_id']);
          $copy_to_category->MoveNext();
        }
      }
      $_GET['action']= '';
      $products_filter = $_POST['products_filter'];
      zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
      break;

    }
  }

//iii 031103 added to get results from database option type query
  $products_options_types_list = array();
//  $products_options_type_array = $db->Execute("select products_options_types_id, products_options_types_name from " . TABLE_PRODUCTS_OPTIONS_TYPES . " where language_id='" . $_SESSION['languages_id'] . "' order by products_options_types_id");
  $products_options_type_array = $db->Execute("select products_options_types_id, products_options_types_name from " . TABLE_PRODUCTS_OPTIONS_TYPES . " order by products_options_types_id");
  while (!$products_options_type_array->EOF) {
    $products_options_types_list[$products_options_type_array->fields['products_options_types_id']] = $products_options_type_array->fields['products_options_types_name'];
    $products_options_type_array->MoveNext();
  }

//CLR 030312 add function to draw pulldown list of option types
// Draw a pulldown for Option Types
//iii 031103 modified to use results of database option type query from above
function draw_optiontype_pulldown($name, $default = '') {
  global $products_options_types_list;
  $values = array();
  foreach ($products_options_types_list as $id => $text) {
    $values[] = array('id' => $id, 'text' => $text);
  }
  return zen_draw_pull_down_menu($name, $values, $default);
}

//CLR 030312 add function to translate type_id to name
// Translate option_type_values to english string
//iii 031103 modified to use results of database option type query from above
function translate_type_to_name($opt_type) {
  global $products_options_types_list;
  return $products_options_types_list[$opt_type];
}

  function zen_js_option_values_list($selectedName, $fieldName) {
    global $db, $show_value_numbers;
    $attributes_sql = "SELECT povpo.products_options_id, povpo.products_options_values_id, po.products_options_name, po.products_options_sort_order,
                       pov.products_options_values_name, pov.products_options_values_sort_order
                       FROM " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " povpo, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
                       WHERE povpo.products_options_id = po.products_options_id
                       AND povpo.products_options_values_id = pov.products_options_values_id
                       AND pov.language_id = po.language_id
                       AND po.language_id = " . $_SESSION['languages_id'] . "
                       ORDER BY po.products_options_id, po.products_options_name, pov.products_options_values_name";

//           "
//           ORDER BY po.products_options_name, pov.products_options_values_sort_order";

    $attributes = $db->Execute($attributes_sql);

    $counter = 1;
    $val_count = 0;
    $value_string = '  // Build conditional Option Values Lists' . "\n";
    $last_option_processed = null;
    while (!$attributes->EOF) {
      $products_options_values_name = str_replace('-', '\-', $attributes->fields['products_options_values_name']);
      $products_options_values_name = str_replace('(', '\(', $products_options_values_name);
      $products_options_values_name = str_replace(')', '\)', $products_options_values_name);
      $products_options_values_name = str_replace('"', '\"', $products_options_values_name);
      $products_options_values_name = str_replace('&quot;', '\"', $products_options_values_name);
      $products_options_values_name = str_replace('&frac12;', '1/2', $products_options_values_name);

      if ($counter == 1) {
        $value_string .= '  if (' . $selectedName . ' == "' . $attributes->fields['products_options_id'] . '") {' . "\n";
      } elseif ($last_option_processed != $attributes->fields['products_options_id']) {
        $value_string .= '  } else if (' . $selectedName . ' == "' . $attributes->fields['products_options_id'] . '") {' . "\n";
        $val_count = 0;
      }

      $value_string .= '    ' . $fieldName . '.options[' . $val_count . '] = new Option("' . $products_options_values_name . ($attributes->fields['products_options_values_id'] == 0 ? '/UPLOAD FILE' : '') . ($show_value_numbers ? ' [ #' . $attributes->fields['products_options_values_id'] . ' ] ' : '') . '", "' . $attributes->fields['products_options_values_id'] . '");' . "\n";

      $last_option_processed = $attributes->fields['products_options_id'];;
      $val_count++;
      $counter++;
      $attributes->MoveNext();
    }
    if ($counter > 1) {
      $value_string .= '  }' . "\n";
    }
    return $value_string;
  }

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function go_option() {
  if (document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value != "none") {
    location = "<?php echo zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'option_page=' . ($_GET['option_page'] ? $_GET['option_page'] : 1)); ?>&option_order_by="+document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value;
  }
}
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=600,height=460,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<!-- <body onload="init()"> -->
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="smallText" align="right">
<?php
    echo zen_draw_form('search', FILENAME_CATEGORIES, '', 'get');
// show reset search
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
      echo '<a href="' . zen_href_link(FILENAME_CATEGORIES) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
    }
    echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
      $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
      echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
    }
    echo '</form>';
?>
                </td>
              </tr>

      <tr>
        <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- products_attributes //-->
      <tr>
        <td width="100%"><table border="0" cellspacing="2" cellpadding="2">
          <tr>
  	        <td height="40" valign="bottom"><a href="<?php echo  zen_href_link(FILENAME_OPTIONS_NAME_MANAGER, '', 'NONSSL') ?>"><?php echo zen_image_button('button_option_names.gif', IMAGE_OPTION_NAMES); ?></a></td>
  	        <td height="40" valign="bottom"><a href="<?php echo  zen_href_link(FILENAME_OPTIONS_VALUES_MANAGER, '', 'NONSSL') ?>"><?php echo zen_image_button('button_option_values.gif', IMAGE_OPTION_VALUES); ?></a></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading">&nbsp;<?php echo HEADING_TITLE_ATRIB; ?>&nbsp;</td>
          </tr>
        </table></td>
      </tr>

<?php
if ($action == 'attributes_preview') {
  // don't show anything from here down
?>

<tr><td><table align="center"><tr>
            <td class="pageHeading" align="center"><?php echo TEXT_ATTRIBUTES_PREVIEW_DISPLAY . $products_filter . '<br />' . zen_get_products_name($products_filter); ?></td>
</tr></table></td></tr>

<?php
} else {
  // show the attributes
?>
<?php
  if ($products_filter != '' and $action != 'attribute_features_copy_to_product' and $action != 'attribute_features_copy_to_category' and $action != 'delete_all_attributes_confirm') {
?>
      <tr>
        <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>

      <tr>
        <td colspan="2"><table border="1" cellspacing="2" cellpadding="4" align="left">
          <tr>
            <td colspan="7" class="main" align="center">
              <?php echo TEXT_PRODUCTS_LISTING . TEXT_PRODUCTS_ID . $products_filter .  TEXT_PRODUCT_IN_CATEGORY_NAME . zen_get_category_name(zen_get_products_category_id($products_filter), (int)$_SESSION['languages_id']) . '<br />' . zen_get_products_name($products_filter); ?>
            </td>
          </tr>
          <tr>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=new_product' . '&cPath=' . zen_get_product_path($products_filter) . '&pID=' . $products_filter . '&product_type=' . zen_get_products_type($products_filter)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . TEXT_PRODUCT_EDIT . '</a>'; ?></td>
            <td class="smallText" align="center">
              <?php
                if ($zc_products->get_allow_add_to_cart($products_filter) == "Y") {
                  echo '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '<br />' . TEXT_PRODUCTS_PRICE_MANAGER . '</a>';
                } else {
                  echo TEXT_INFO_ALLOW_ADD_TO_CART_NO;
                }
              ?>
            </td>
<?php
  if (zen_has_product_attributes($products_filter, 'false')) {
?>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=update_product' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_update_sort.gif', IMAGE_UPDATE_SORT) . '<br />' . TEXT_ATTRIBUTES_UPDATE_SORT_ORDER . '</a>'; ?></td>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '<br />' . TEXT_ATTRIBUTES_PREVIEW . '</a>'; ?></td>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=delete_all_attributes_confirm' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '<br />' . TEXT_ATTRIBUTES_DELETE . '</a>'; ?></td>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attribute_features_copy_to_product' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY) . '<br />' . TEXT_ATTRIBUTES_COPY_TO_PRODUCTS . '</a>'; ?></td>
            <td class="smallText" align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attribute_features_copy_to_category' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY) . '<br />' . TEXT_ATTRIBUTES_COPY_TO_CATEGORY . '</a>'; ?></td>
<?php
} else {
?>
            <td class="main" align="center" width="200"><?php echo TEXT_NO_ATTRIBUTES_DEFINED . $products_filter; ?></td>
<?php
}
?>
          </tr>
          <tr>
            <td class="smallText" align="center" colspan="7"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCTS_TO_CATEGORIES, '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . IMAGE_PRODUCTS_TO_CATEGORIES . '</a>'; ?></td>
          </tr>
        </table></td>
      </form></tr>
      <tr>
        <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
<?php
}
?>
<?php
} // eof: attributes_preview
?>

<?php
// remove all attributes from the product
  if ($action == 'delete_all_attributes_confirm') {
?>
      <tr><form name="delete_all"<?php echo 'action="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=delete_all_attributes') . '"'; ?> method="post"><?php echo zen_draw_hidden_field('products_filter', $_GET['products_filter']); ?><?php echo zen_draw_hidden_field('current_category_id', $_GET['current_category_id']); ?>
        <td colspan="2"><table border="2" cellspacing="2" cellpadding="4">
          <tr>
            <td><table border="0" cellspacing="2" cellpadding="2">
              <tr>
                <td class="alert" align="center"><?php echo TEXT_DELETE_ALL_ATTRIBUTES . $products_filter . '<br />' . zen_get_products_name($products_filter); ?></td>
                <td class="main" align="center"><?php echo zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
              </tr>
            </table></td>
          </table></td>
        </tr>
      </form></tr>
<?php
}
?>

<?php
// remove option name and all values from the product
  if ($action == 'delete_option_name_values_confirm') {
?>
      <tr><form name="delete_all"<?php echo 'action="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=delete_option_name_values') . '"'; ?> method="post">
        <?php echo zen_draw_hidden_field('products_filter', $_GET['products_filter']); ?>
        <?php echo zen_draw_hidden_field('current_category_id', $_GET['current_category_id']); ?>
        <?php echo zen_draw_hidden_field('products_options_id_all', $_GET['products_options_id_all']); ?>
        <td colspan="2"><table border="2" cellspacing="2" cellpadding="4">
          <tr>
            <td><table border="0" cellspacing="2" cellpadding="2">
              <tr class="pageHeading">
                <td class="alert" align="center" colspan="2"><?php echo TEXT_DELETE_ATTRIBUTES_OPTION_NAME_VALUES; ?></td>
              </tr>
              <tr>
                <td class="main" align="left"><?php echo TEXT_INFO_PRODUCT_NAME . zen_get_products_name($products_filter) . '<br />' . TEXT_INFO_PRODUCTS_OPTION_ID . $_GET['products_options_id_all'] . '&nbsp;' . TEXT_INFO_PRODUCTS_OPTION_NAME . '&nbsp;' . zen_options_name($_GET['products_options_id_all']); ?></td>
                <td class="main" align="left"><?php echo zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
              </tr>
            </table></td>
          </table></td>
        </tr>
      </form></tr>
<?php
}
?>

<?php
  if ($action == 'attribute_features_copy_to_product') {
    $_GET['products_update_id'] = '';
    // excluded current product from the pull down menu of products
    $products_exclude_array = array();
    $products_exclude_array[] = $products_filter;
?>
      <tr><form name="product_copy_to_product"<?php echo 'action="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=update_attributes_copy_to_product') . '"'; ?> method="post"><?php echo zen_draw_hidden_field('products_filter', $_GET['products_filter']) . zen_draw_hidden_field('products_id', $_GET['products_filter']) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']); ?>
        <td colspan="2"><table border="2" cellspacing="0" cellpadding="2">
          <tr>
            <td><table border="0" cellspacing="2" cellpadding="4">
              <tr>
                <td class="main" align="center"><?php echo TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . $products_filter . '<br />' . zen_get_products_name($products_filter); ?></td>
                <td class="main" align="left"><?php echo TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE; ?></td>
              </tr>
              <tr>
                <td class="alert" align="center"><?php echo TEXT_INFO_ATTRIBUTES_FEATURE_COPY_TO . '<br />' . zen_draw_products_pull_down('products_update_id', 'size="15"', $products_exclude_array, true, '', true); ?></td>
                <td class="main" align="center"><?php echo zen_image_submit('button_copy.gif', IMAGE_COPY) . '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
              </tr>
            </table></td>
          </table></td>
        </tr>
      </form></tr>
<?php
}
?>

<?php
  if ($action == 'attribute_features_copy_to_category') {
?>
      <tr><form name="product_copy_to_category"<?php echo 'action="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=update_attributes_copy_to_category') . '"'; ?> method="post"><?php echo zen_draw_hidden_field('products_filter', $_GET['products_filter']) . zen_draw_hidden_field('products_id', $_GET['products_filter']) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']) . zen_draw_hidden_field('current_category_id', $_GET['current_category_id']); ?>
        <td colspan="2"><table border="2" cellspacing="0" cellpadding="2">
          <tr>
            <td><table border="0" cellspacing="2" cellpadding="4">
              <tr>
                <td class="main" align="center"><?php echo TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . $products_filter . '<br />' . zen_get_products_name($products_filter); ?></td>
                <td class="main" align="left"><?php echo TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE; ?></td>
              </tr>
              <tr>
                <td class="alert" align="center"><?php echo TEXT_INFO_ATTRIBUTES_FEATURE_CATEGORIES_COPY_TO . '<br />' . zen_draw_products_pull_down_categories('categories_update_id', 'size="5"', '', true, true); ?></td>
                <td class="main" align="center"><?php echo zen_image_submit('button_copy.gif', IMAGE_COPY) . '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
              </tr>
            </table></td>
          </table></td>
        </tr>
      </form></tr>

<?php
}
?>

<?php
// fix here
// preview shot of attributes
if ($action == 'attributes_preview') {
  $_GET['products_id'] = $products_filter;
  $pInfo->products_id = $products_filter;

  include(DIR_WS_INCLUDES . 'attributes_preview.php');
?>
      <tr>
        <td colspan="2" class="main" align="center" height= "40" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
      </tr>
      <tr>
        <td colspan="2"><table border="1" cellspacing="0" cellpadding="2" align="center" class="main_page">
          <tr>
            <td class="main">
<?php
//            where    patrib.products_id='" . $pInfo->products_id . "'
//            where    patrib.products_id='" . (int)$_GET['products_id'] . "'
  $check_template = $db->Execute("select template_dir from " . TABLE_TEMPLATE_SELECT);
  echo '<link rel="stylesheet" type="text/css" href="' . DIR_WS_CATALOG_TEMPLATE . $check_template->fields['template_dir'] . '/css/stylesheet.css' . '" />';
?>

  <tr>
    <td colspan="2" class="main" align="center">
<?php
  if ($pr_attr->fields['total'] > 0) {
?>
      <table border="0" width="90%" cellspacing="0" cellpadding="2">
        <tr>
          <td colspan="2" class="main" align="left"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
        </tr>
<?php
    for($i=0;$i<sizeof($options_name);$i++) {
?>
<?php
  if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
?>
        <tr>
          <td colspan="2" class="ProductInfoComments" align="left" valign="bottom"><?php echo $options_comment[$i]; ?></td>
        </tr>
<?php
  }
?>
        <tr>
          <td class="main" align="left" valign="top"><?php echo $options_name[$i] . ':'; ?></td>
          <td class="main" align="left" valign="top" width="75%"><?php echo $options_menu[$i]; ?></td>
        </tr>
<?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
        <tr>
          <td colspan="2" class="ProductInfoComments" align="left" valign="top"><?php echo $options_comment[$i]; ?></td>
        </tr>
<?php } ?>

<?php
if ($options_attributes_image[$i] != '') {
?>
        <tr><td colspan="2"><table border= "0" align="center" valign="top" cellpadding="2" cellspacing="2"><tr>
          <?php echo $options_attributes_image[$i]; ?>
        </tr></table></td></tr>
<?php
}
?>
<?php
    }
?>
      </table>
<?php
  }
?>
    </td>
  </tr>
            </td>
          </tr>
        </table></td>
      </tr>

      <tr>
        <td colspan="2" class="main" align="center" height= "40" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $current_category_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
      </tr>
<?php
} // eof: attributes preview
?>

      <tr>
        <td colspan="3" class="main" height="20" align="center"><?php echo zen_draw_separator('pixel_black.gif', '90%', '2'); ?></td>
      </tr>

<?php
if ($action == 'attributes_preview') {
  // don't show anything from here down
} else {
  // show the attributes
?>
<?php
  if ($action == '') {
?>
      <tr>
        <td colspan="2"><table>
          <?php require(DIR_WS_MODULES . FILENAME_PREV_NEXT_DISPLAY); ?>
        </table></td>
      </tr>

      <tr><form name="set_products_filter_id" <?php echo 'action="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_products_filter') . '"'; ?> method="post"><?php echo zen_draw_hidden_field('products_filter', $products_filter); ?><?php echo zen_draw_hidden_field('current_category_id', $current_category_id); ?>
        <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">

<?php
    if ($_GET['products_filter'] != '') {
?>
          <tr>
            <td class="main" width="200" align="left" valign="top">&nbsp;</td>
            <td colspan="2" class="main"><?php echo TEXT_PRODUCT_TO_VIEW; ?></td>
          </tr>
          <tr>
            <td class="main" width="200" align="center" valign="top">
<?php
  $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($_GET['products_filter']);
  echo ($display_priced_by_attributes ? '<span class="alert">' . TEXT_PRICED_BY_ATTRIBUTES . '</span>' . '<br />' : '');
  echo zen_get_products_display_price($_GET['products_filter']) . '<br /><br />';
  echo zen_get_products_quantity_min_units_display($_GET['products_filter'], $include_break = true);
?>
            </td>
            <td class="attributes-even" align="center"><?php echo zen_draw_products_pull_down('products_filter', 'size="10"', '', true, $_GET['products_filter'], true, true); ?></td>
            <td class="main" align="right" valign="top"><?php echo zen_image_submit('button_display.gif', IMAGE_DISPLAY); ?></td>
          </tr>
        </table></td>
      </form></tr>

<?php
    } // product dropdown
?>
<?php
  } // $action == ''
?>
<?php
// start of attributes display
if ($_GET['products_filter'] == '') {
?>
      <tr>
        <td colspan="2" class="pageHeading" align="center" valign="middle" height="200"><?php echo HEADING_TITLE_ATRIB_SELECT; ?></td>
      </tr>
<?php
} else {
////
// attribute listings and add

  if ($action == 'update_attribute') {
    $form_action = 'update_product_attribute';
  } else {
    $form_action = 'add_product_attributes';
  }

  if (!isset($_GET['attribute_page'])) {
    $_GET['attribute_page'] = 1;
  }
  $prev_attribute_page = $_GET['attribute_page'] - 1;
  $next_attribute_page = $_GET['attribute_page'] + 1;
?>

<?php
if ($action == '') {
?>
<tr>
  <td>
    <table border="2" align="left" cellpadding="2" cellspacing="2">
      <tr>
        <td class="smallText" align="right"><?php echo LEGEND_BOX; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_DISPLAY_ONLY; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_IS_FREE; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_DEFAULT; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTE_IS_DISCOUNTED; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTE_PRICE_BASE_INCLUDED; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_REQUIRED; ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_IMAGES ?></td>
        <td class="smallText" align="center"><?php echo LEGEND_ATTRIBUTES_DOWNLOAD ?></td>
      </tr>
      <tr>
        <td class="smallText" align="right"><?php echo LEGEND_KEYS; ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_yellow_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_pink_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_pink_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_purple_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_purple_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_red_off.gif') . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif'); ?></td>
        <td class="smallText" align="center"><?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . '&nbsp;' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'); ?></td>
      </tr>
    </table>
  </td>
<?php } ?>
<?php
// fix here border width
?>
      <tr>
        <td><form name="attributes" action="<?php echo zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=' . $form_action . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter ); ?>" method="post", enctype="multipart/form-data"><table border="0" cellspacing="0" cellpadding="2">

          <tr>
            <td colspan="10" class="smallText">
<?php
  $per_page = (defined('MAX_ROW_LISTS_ATTRIBUTES_CONTROLLER') && (int)MAX_ROW_LISTS_ATTRIBUTES_CONTROLLER > 3) ? (int)MAX_ROW_LISTS_ATTRIBUTES_CONTROLLER : 40;
  $attributes = "select pa.*
  from (" . TABLE_PRODUCTS_ATTRIBUTES . " pa
  left join " . TABLE_PRODUCTS_DESCRIPTION . " pd
  on pa.products_id = pd.products_id
  and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
  left join " . TABLE_PRODUCTS_OPTIONS . " po
  on pa.options_id = po.products_options_id
  and po.language_id = '" . (int)$_SESSION['languages_id'] . "'" . ")
  where pa.products_id ='" . $products_filter . "'
  order by pd.products_name, LPAD(po.products_options_sort_order,11,'0'), LPAD(pa.options_id,11,'0'), LPAD(pa.products_options_sort_order,11,'0')";
  $attribute_query = $db->Execute($attributes);

  $attribute_page_start = ($per_page * $_GET['attribute_page']) - $per_page;
  $num_rows = $attribute_query->RecordCount();

  if ($num_rows <= $per_page) {
     $num_pages = 1;
  } else if (($num_rows % $per_page) == 0) {
     $num_pages = ($num_rows / $per_page);
  } else {
     $num_pages = ($num_rows / $per_page) + 1;
  }
  $num_pages = (int) $num_pages;

// fix limit error on some versions
    if ($attribute_page_start < 0) { $attribute_page_start = 0; }

  $attributes = $attributes . " LIMIT $attribute_page_start, $per_page";

  // Previous
  if ($prev_attribute_page) {
    echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'attribute_page=' . $prev_attribute_page . '&products_filter=' . $products_filter) . '"> &lt;&lt; </a> | ';
  }

  for ($i = 1; $i <= $num_pages; $i++) {
    if ($i != $_GET['attribute_page']) {
      echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'attribute_page=' . $i  . '&products_filter=' . $products_filter) . '">' . $i . '</a> | ';
    } else {
      echo '<b><font color="red">' . $i . '</font></b> | ';
    }
  }

  // Next
  if ($_GET['attribute_page'] != $num_pages) {
    echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'attribute_page=' . $next_attribute_page . '&products_filter=' . $products_filter) . '"> &gt;&gt; </a>';
  }
?>
            </td>
          </tr>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>
          <tr class="dataTableHeadingRow">
            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_ID; ?>&nbsp;</td>
            <td class="dataTableHeadingContent">&nbsp;<?php // echo TABLE_HEADING_PRODUCT; ?>&nbsp;</td>
            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME; ?>&nbsp;</td>
            <td class="dataTableHeadingContent">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE; ?>&nbsp;</td>
            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE_PREFIX; ?>&nbsp;<?php echo TABLE_HEADING_OPT_PRICE; ?>&nbsp;</td>
            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_OPT_WEIGHT_PREFIX; ?>&nbsp;<?php echo TABLE_HEADING_OPT_WEIGHT; ?>&nbsp;</td>
            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_OPT_SORT_ORDER; ?>&nbsp;</td>
            <td class="dataTableHeadingContent" align="center"><?php echo LEGEND_BOX; ?></td>
            <td class="dataTableHeadingContent" align="right">&nbsp;<?php echo TABLE_HEADING_PRICE_TOTAL; ?>&nbsp;</td>
            <td class="dataTableHeadingContent" align="center">&nbsp;<?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>

<?php
  $next_id = 1;
  $attributes_values = $db->Execute($attributes);

  if ($attributes_values->RecordCount() == 0) {
?>
          <tr class="attributeBoxContent">
            <td colspan="10" class="dataTableHeadingContent">&nbsp;</td>
          </tr>
          <tr class="attributes-even">
            <td colspan="10" class="pageHeading" align="center">
              <?php echo ($products_filter == '' ? TEXT_NO_PRODUCTS_SELECTED : TEXT_NO_ATTRIBUTES_DEFINED . $products_filter . ' ' . zen_get_products_model($products_filter) . ' - ' . zen_get_products_name($products_filter)); ?>
            </td>
          </tr>
          <tr class="dataTableHeadingRow">
            <td colspan="10" class="dataTableHeadingContent">&nbsp;</td>
          </tr>

<?php
} else {
?>
          <tr class="attributeBoxContent">
            <td colspan="10" class="dataTableHeadingContent">&nbsp;</td>
          </tr>
          <tr class="attributes-even">
            <td colspan="10" class="pageHeading" align="center">
              <?php echo TEXT_INFO_ID . $products_filter . ' ' . zen_get_products_model($products_filter) . ' - ' . zen_get_products_name($products_filter); ?>
            </td>
          </tr>
          <tr class="attributeBoxContent">
            <td colspan="10" class="dataTableHeadingContent">&nbsp;</td>
          </tr>
<?php } ?>
<?php
  $current_options_name = '';
  while (!$attributes_values->EOF) {
    $current_attributes_products_id = $attributes_values->fields['products_id'];
    $current_attributes_options_id = $attributes_values->fields['options_id'];

    $products_name_only = zen_get_products_name($attributes_values->fields['products_id']);
    $options_name = zen_options_name($attributes_values->fields['options_id']);
    $values_name = zen_values_name($attributes_values->fields['options_values_id']);
    $rows++;

// delete all option name values
    if ($current_options_name != $options_name) {
      $current_options_name = $options_name;
?>
          <tr>
            <td>
              <?php
              if ($action == '') {
                echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=delete_option_name_values_confirm&products_options_id_all=' . $current_attributes_options_id . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id ) , '">' .
                zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>';
              }
              ?>
              </td>
            <td class="pageHeading"><?php echo $current_options_name; ?></td>
          </tr>
<?php } // option name delete ?>
          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
<?php
    if (($action == 'update_attribute') && ($_GET['attribute_id'] == $attributes_values->fields['products_attributes_id'])) {
?>
          <tr>
            <td colspan="10"><?php echo zen_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>

<tr><td colspan="10" class="attributeBoxContent"><table border="0" width="100%">

<tr><td class="pageHeading"><?php echo PRODUCTS_ATTRIBUTES_EDITING; ?>

<?php // fix here edit ?>
<tr><td class="attributeBoxContent">
<table border="0" cellpadding="4" cellspacing="2">

<tr>
            <td class="smallText" valign="top" width="40">&nbsp;<?php echo $attributes_values->fields['products_attributes_id']; ?><input type="hidden" name="attribute_id" value="<?php echo $attributes_values->fields['products_attributes_id']; ?>">&nbsp;</td>
            <td class="smallText" valign="top">
      	    <td class="pageHeading" valign="top">&nbsp;
              <input type="hidden" name="products_id" value="<?php echo $products_filter; ?>">
              <input type="hidden" name="current_category_id" value="<?php echo $current_category_id; ?>">
      	      <?php
      	        $show_model = zen_get_products_model($products_filter);
      	        if(!empty($show_model)) {
      	          $show_model = " - (" . $show_model . ")";
      	        }
      	        echo zen_clean_html(zen_get_products_name($products_filter)) . $show_model;
      	      ?>
      	    </td>

          </tr></table></td></tr>
          <tr class="attributeBoxContent"><td><table><tr>
            <td class="smallText" valign="top" width="40">&nbsp;</td>
            <td class="pageHeading">&nbsp;
              <input type="hidden" name="options_id" value="<?php echo $attributes_values->fields['options_id']; ?>">
              <?php echo zen_get_option_name_language($attributes_values->fields['options_id'], $_SESSION['languages_id']); ?>:
            </td>
            <td class="smallText">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE . '<br />'; ?><select name="values_id" size="10">
<?php
// FIX HERE 2 - editing
      $values_values = $db->Execute("select pov.* from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " povtpo on pov.products_options_values_id = povtpo.products_options_values_id
                                     where pov.language_id ='" . $_SESSION['languages_id'] . "'
                                     and povtpo.products_options_id='" . $attributes_values->fields['options_id'] . "'
                                     order by pov.products_options_values_name");

      while(!$values_values->EOF) {

        if ($show_value_numbers == false) {
          $show_option_name= '&nbsp;&nbsp;&nbsp;[' . strtoupper(zen_get_products_options_name_from_value($values_values->fields['products_options_values_id'])) . ' ]';
        } else {
          $show_option_name= ' [ #' . $values_values->fields['products_options_values_id'] . ' ] ' . '&nbsp;&nbsp;&nbsp;[' . strtoupper(zen_get_products_options_name_from_value($values_values->fields['products_options_values_id'])) . ' ]';
        }
        if ($attributes_values->fields['options_values_id'] == $values_values->fields['products_options_values_id']) {
          echo "\n" . '<option name="' . $values_values->fields['products_options_values_name'] . '" value="' . $values_values->fields['products_options_values_id'] . '" SELECTED>' . $values_values->fields['products_options_values_name'] . $show_option_name . '</option>';
        } else {
          echo "\n" . '<option name="' . $values_values->fields['products_options_values_name'] . '" value="' . $values_values->fields['products_options_values_id'] . '">' . $values_values->fields['products_options_values_name'] . $show_option_name . '</option>';
        }
        $values_values->MoveNext();
      }
?>
<?php
// set radio values attributes_display_only
    switch ($attributes_values->fields['attributes_display_only']) {
      case '0': $on_attributes_display_only = false; $off_attributes_display_only = true; break;
      case '1': $on_attributes_display_only = true; $off_attributes_display_only = false; break;
      default: $on_attributes_display_only = false; $off_attributes_display_only = true;
    }
// set radio values attributes_default
    switch ($attributes_values->fields['product_attribute_is_free']) {
      case '0': $on_product_attribute_is_free = false; $off_product_attribute_is_free = true; break;
      case '1': $on_product_attribute_is_free = true; $off_product_attribute_is_free = false; break;
      default: $on_product_attribute_is_free = false; $off_product_attribute_is_free = true;
    }
// set radio values attributes_default
    switch ($attributes_values->fields['attributes_default']) {
      case '0': $on_attributes_default = false; $off_attributes_default = true; break;
      case '1': $on_attributes_default = true; $off_attributes_default = false; break;
      default: $on_attributes_default = false; $off_attributes_default = true;
    }
// set radio values attributes_discounted
    switch ($attributes_values->fields['attributes_discounted']) {
      case '0': $on_attributes_discounted = false; $off_attributes_discounted = true; break;
      case '1': $on_attributes_discounted = true; $off_attributes_discounted = false; break;
      default: $on_attributes_discounted = false; $off_attributes_discounted = true;
    }
// set radio values attributes_price_base_included
    switch ($attributes_values->fields['attributes_price_base_included']) {
      case '0': $on_attributes_price_base_included = false; $off_attributes_price_base_included = true; break;
      case '1': $on_attributes_price_base_included = true; $off_attributes_price_base_included = false; break;
      default: $on_attributes_price_base_included = false; $off_attributes_price_base_included = true;
    }
// set radio values attributes_required
    switch ($attributes_values->fields['attributes_required']) {
      case '0': $on_attributes_required = false; $off_attributes_required = true; break;
      case '1': $on_attributes_required = true; $off_attributes_required = false; break;
      default: $on_attributes_required = false; $off_attributes_required = true;
    }
// set image overwrite
  $on_overwrite = true;
  $off_overwrite = false;
// set image delete
  $on_image_delete = false;
  $off_image_delete = true;

?>
            </select>&nbsp;</td>

</table></td></tr>

<!-- bof: Edit Prices -->
<tr>
  <td class="attributeBoxContent">
    <table border="1" cellpadding="4" cellspacing="2" align="left" width="100%">
      <tr>
        <td align="right" class="pageHeading"><?php echo TEXT_SAVE_CHANGES . '&nbsp;&nbsp;' . zen_image_submit('button_update.gif', IMAGE_UPDATE); ?>&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id ) . '">'; ?><?php echo zen_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</td>
      </tr>
    </table>
  </td>
</tr>

<tr><td>
  <table border="0">
    <tr>
      <td colspan="3" class="pageHeading"><?php echo TEXT_PRICES_AND_WEIGHTS; ?></td>
    </tr>
    <tr>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2" align="left">
          <tr>
            <td align="center" class="smallText">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE; ?><br /><input type="text" name="price_prefix" value="<?php echo $attributes_values->fields['price_prefix']; ?>" size="2">&nbsp;<input type="text" name="value_price" value="<?php echo $attributes_values->fields['options_values_price']; ?>" size="6">&nbsp;</td>
            <td align="center" class="smallText">&nbsp;<?php echo TABLE_HEADING_OPT_WEIGHT; ?><br /><input type="text" name="products_attributes_weight_prefix" value="<?php echo $attributes_values->fields['products_attributes_weight_prefix']; ?>" size="2">&nbsp;<input type="text" name="products_attributes_weight" value="<?php echo $attributes_values->fields['products_attributes_weight']; ?>" size="6">&nbsp;</td>
            <td align="center" class="smallText">&nbsp;<?php echo TABLE_HEADING_OPT_SORT_ORDER; ?><br /><input type="text" name="products_options_sort_order" value="<?php echo $attributes_values->fields['products_options_sort_order']; ?>" size="4">&nbsp;</td>
            <td align="center" class="smallText">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_ONETIME; ?><br />&nbsp;<input type="text" name="attributes_price_onetime" value="<?php echo $attributes_values->fields['attributes_price_onetime']; ?>" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>

<?php if (ATTRIBUTES_ENABLED_PRICE_FACTOR == 'true') { ?>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2" align="left">
          <tr>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR . ' ' . TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_OFFSET; ?><br />&nbsp;<input type="text" name="attributes_price_factor" value="<?php echo $attributes_values->fields['attributes_price_factor']; ?>" size="6">&nbsp;&nbsp;<input type="text" name="attributes_price_factor_offset" value="<?php echo $attributes_values->fields['attributes_price_factor_offset']; ?>" size="6">&nbsp;</td>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_ONETIME . ' ' . TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_OFFSET_ONETIME; ?><br />&nbsp;<input type="text" name="attributes_price_factor_onetime" value="<?php echo $attributes_values->fields['attributes_price_factor_onetime']; ?>" size="6">&nbsp;&nbsp;<input type="text" name="attributes_price_factor_onetime_offset" value="<?php echo $attributes_values->fields['attributes_price_factor_onetime_offset']; ?>" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>
<?php
    } else {
      echo zen_draw_hidden_field('attributes_price_factor', $attributes_values->fields['attributes_price_factor']);
      echo zen_draw_hidden_field('attributes_price_factor_offset', $attributes_values->fields['attributes_price_factor_offset']);
      echo zen_draw_hidden_field('attributes_price_factor_onetime', $attributes_values->fields['attributes_price_factor_onetime']);
      echo zen_draw_hidden_field('attributes_price_factor_onetime_offset', $attributes_values->fields['attributes_price_factor_onetime_offset']);
    } // ATTRIBUTES_ENABLED_PRICE_FACTOR
?>

    </tr>
  </table>
</td></tr>

<?php if (ATTRIBUTES_ENABLED_QTY_PRICES == 'true') { ?>
    <tr>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2" align="left">
          <tr>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_QTY_PRICES; ?><br />&nbsp;<input type="text" name="attributes_qty_prices" value="<?php echo $attributes_values->fields['attributes_qty_prices']; ?>" size="60">&nbsp;</td>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_QTY_PRICES_ONETIME; ?><br />&nbsp;<input type="text" name="attributes_qty_prices_onetime" value="<?php echo $attributes_values->fields['attributes_qty_prices_onetime']; ?>" size="60">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
<?php
    } else {
      echo zen_draw_hidden_field('attributes_qty_prices', $attributes_values->fields['attributes_qty_prices']);
      echo zen_draw_hidden_field('attributes_qty_prices_onetime', $attributes_values->fields['attributes_qty_prices_onetime']);
    } // ATTRIBUTES_ENABLED_QTY_PRICES
?>

<?php if (ATTRIBUTES_ENABLED_TEXT_PRICES == 'true') { ?>
    <tr>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2" align="left">
          <tr>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_WORDS . ' ' . TABLE_HEADING_ATTRIBUTES_PRICE_WORDS_FREE; ?><br />&nbsp;<input type="text" name="attributes_price_words" value="<?php echo $attributes_values->fields['attributes_price_words']; ?>" size="6">&nbsp;&nbsp;<input type="text" name="attributes_price_words_free" value="<?php echo $attributes_values->fields['attributes_price_words_free']; ?>" size="6">&nbsp;</td>
            <td align="center" class="smallText" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS . ' ' . TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS_FREE; ?><br />&nbsp;<input type="text" name="attributes_price_letters" value="<?php echo $attributes_values->fields['attributes_price_letters']; ?>" size="6">&nbsp;&nbsp;<input type="text" name="attributes_price_letters_free" value="<?php echo $attributes_values->fields['attributes_price_letters_free']; ?>" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
<?php
    } else {
      echo zen_draw_hidden_field('attributes_price_words', $attributes_values->fields['attributes_price_words']);
      echo zen_draw_hidden_field('attributes_price_words_free', $attributes_values->fields['attributes_price_words_free']);
      echo zen_draw_hidden_field('attributes_price_letters', $attributes_values->fields['attributes_price_letters']);
      echo zen_draw_hidden_field('attributes_price_letters_free', $attributes_values->fields['attributes_price_letters_free']);
    } // ATTRIBUTES_ENABLED_TEXT_PRICES
?>

<!-- eof: Edit Prices -->

<tr><td class="attributeBoxContent">
<table border="1" cellpadding="4" cellspacing="2">

              <tr >
                <td class="attributeBoxContent" align="center" width="50"><?php echo TEXT_ATTRIBUTES_FLAGS; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ffff00"><strong><?php echo TEXT_ATTRIBUTES_DISPLAY_ONLY . '</strong><br>' . zen_draw_radio_field('attributes_display_only', '0', $off_attributes_display_only) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_display_only', '1', $on_attributes_display_only) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#2C54F5"><strong><?php echo TEXT_ATTRIBUTES_IS_FREE . '</strong><br>' . zen_draw_radio_field('product_attribute_is_free', '0', $off_product_attribute_is_free) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('product_attribute_is_free', '1', $on_product_attribute_is_free) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ffa346"><strong><?php echo TEXT_ATTRIBUTES_DEFAULT . '</strong><br>' . zen_draw_radio_field('attributes_default', '0', $off_attributes_default) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_default', '1', $on_attributes_default) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ff00ff"><strong><?php echo TEXT_ATTRIBUTE_IS_DISCOUNTED . '</strong><br>' . zen_draw_radio_field('attributes_discounted', '0', $off_attributes_discounted) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_discounted', '1', $on_attributes_discounted) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#d200f0"><strong><?php echo TEXT_ATTRIBUTE_PRICE_BASE_INCLUDED . '</strong><br>' . zen_draw_radio_field('attributes_price_base_included', '0', $off_attributes_price_base_included) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_price_base_included', '1', $on_attributes_price_base_included) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td align="center" class="smallText" width="150" bgcolor="#FF0606"><strong><?php echo TEXT_ATTRIBUTES_REQUIRED . '</strong><br>' . zen_draw_radio_field('attributes_required', '0', $off_attributes_required) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_required', '1', $on_attributes_required) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
              </tr>

</table></td></tr>

<?php if (ATTRIBUTES_ENABLED_IMAGES == 'true') { ?>

<?php
// edit
// attributes images
  $dir = @dir(DIR_FS_CATALOG_IMAGES);
  $dir_info[] = array('id' => '', 'text' => "Main Directory");
  while ($file = $dir->read()) {
    if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
      $dir_info[] = array('id' => $file . '/', 'text' => $file);
    }
  }
  $dir->close();

  sort($dir_info);

  if ($attributes_values->fields['attributes_image'] != '') {
    $default_directory = substr( $attributes_values->fields['attributes_image'], 0,strpos( $attributes_values->fields['attributes_image'], '/')+1);
  } else {
    $default_directory = 'attributes/';
  }
?>
<tr><td class="attributeBoxContent">
<table border="0" cellpadding="4" cellspacing="2">

          <tr class="attributeBoxContent">
            <td>&nbsp;</td>
            <td colspan="5">
              <table>
                <tr class="attributeBoxContent">
                  <td class="main" valign="top">&nbsp;</td>
                  <td class="main" valign="top"><?php echo TEXT_ATTRIBUTES_IMAGE . '<br />' . zen_draw_file_field('attributes_image') . '<br />' . zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . $attributes_values->fields['attributes_image']  . zen_draw_hidden_field('attributes_previous_image', $attributes_values->fields['attributes_image']); ?></td>
                  <td class="main" valign="top"><?php echo TEXT_ATTRIBUTES_IMAGE_DIR . '<br />' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?></td>
                  <td class="main" valign="middle"><?php echo ($attributes_values->fields['attributes_image'] != '' ? zen_image(DIR_WS_CATALOG_IMAGES . $attributes_values->fields['attributes_image']) : ''); ?></td>
                  <td class="main" valign="top"><?php echo TEXT_IMAGES_OVERWRITE . '<br />' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                  <td class="main" valign="top"><?php echo TEXT_IMAGES_DELETE . '<br />' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                </tr>
              </table>
            </td>
            <td>&nbsp;</td>
          </tr>

</table></td></tr>
<?php
    } else {
      echo zen_draw_hidden_field('attributes_previous_image', $attributes_values->fields['attributes_image']);
      echo zen_draw_hidden_field('attributes_image', $attributes_values->fields['attributes_image']);
    } // ATTRIBUTES_ENABLED_IMAGES
?>

<?php
      if (DOWNLOAD_ENABLED == 'true') {
        $download_query_raw ="select products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount
                              from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
                              where products_attributes_id='" . $attributes_values->fields['products_attributes_id'] . "'";
        $download = $db->Execute($download_query_raw);
        if ($download->RecordCount() > 0) {
          $products_attributes_filename = $download->fields['products_attributes_filename'];
          $products_attributes_maxdays  = $download->fields['products_attributes_maxdays'];
          $products_attributes_maxcount = $download->fields['products_attributes_maxcount'];
        }
?>
<tr><td class="attributeBoxContent">
<table border="0" cellpadding="4" cellspacing="2">
          <tr class="attributeBoxContent">
            <td colspan="5">
                <tr class="attributeBoxContent">
                  <td class="attributeBoxContent" valign="top"><?php echo TABLE_HEADING_DOWNLOAD; ?>&nbsp;</td>
                  <td class="attributeBoxContent"><?php echo TABLE_TEXT_FILENAME . '<br />' . zen_draw_input_field('products_attributes_filename', $products_attributes_filename, zen_set_field_length(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, 'products_attributes_filename', 35)); ?>&nbsp;</td>
                  <td class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_DAYS . '<br />' . zen_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>&nbsp;</td>
                  <td class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_COUNT . '<br />' . zen_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
                </tr>

</table></td></tr>
</td></tr>

<?php
      }
?>

</td></tr>
</table></td></tr>

          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>
          <tr>
            <td colspan="10"><?php echo zen_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>

<?php
    } elseif (($action == 'delete_product_attribute') && ($_GET['attribute_id'] == $attributes_values->fields['products_attributes_id'])) {
?>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>
          <tr class="attributeBoxContent">
            <td align="left" colspan="6" class="pageHeading"><?php echo PRODUCTS_ATTRIBUTES_DELETE; ?></td><td colspan="3" align="center" class="pageHeading"><?php echo PRODUCTS_ATTRIBUTES_DELETE; ?></td>
            <td colspan="3" align="center" class="attributeBoxContent">&nbsp;</td>
          </tr>
          <tr>
            <td class="attributeBoxContent">&nbsp;<b><?php echo $attributes_values->fields["products_attributes_id"]; ?></b>&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<b><?php echo $products_name_only; ?></b>&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<b><?php echo $options_name; ?></b>&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<b><?php echo $values_name; ?></b>&nbsp;</td>
            <td align="right" class="attributeBoxContent">&nbsp;<b><?php echo $attributes_values->fields["options_values_price"]; ?></b>&nbsp;</td>
            <td align="center" class="attributeBoxContent">&nbsp;<b><?php echo $attributes_values->fields["price_prefix"]; ?></b>&nbsp;</td>
            <td colspan="3" align="center" class="attributeBoxContent">&nbsp;<b><?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=delete_attribute&attribute_id=' . $_GET['attribute_id'] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">'; ?><?php echo zen_image_button('button_confirm.gif', IMAGE_CONFIRM); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id ) . '">'; ?><?php echo zen_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>&nbsp;</b></td>
            <td colspan="3" align="center" class="attributeBoxContent">&nbsp;</td>
          </tr>
          <tr class="attributeBoxContent">
            <td colspan="10" class="attributeBoxContent">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>
          <tr>
<?php
    } else {
// attributes display listing

// calculate current total attribute price
// $attributes_values
$attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
$attributes_price_final_value = $attributes_price_final;
$attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
$attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
$attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1);
?>
            <td class="smallText">&nbsp;<?php echo $attributes_values->fields["products_attributes_id"]; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php // echo $products_name_only; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php echo $options_name; ?>&nbsp;</td>
            <td class="smallText">&nbsp;<?php echo ($attributes_values->fields['attributes_image'] != '' ? zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . '&nbsp;' : '&nbsp;&nbsp;') . $values_name; ?>&nbsp;</td>
            <td align="right" class="smallText">&nbsp;<?php echo $attributes_values->fields["price_prefix"]; ?>&nbsp;<?php echo $attributes_values->fields["options_values_price"]; ?>&nbsp;</td>
            <td align="right" class="smallText">&nbsp;<?php echo $attributes_values->fields["products_attributes_weight_prefix"]; ?>&nbsp;<?php echo $attributes_values->fields["products_attributes_weight"]; ?>&nbsp;</td>
            <td align="right" class="smallText">&nbsp;<?php echo $attributes_values->fields["products_options_sort_order"]; ?>&nbsp;</td>
<?php
// '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_display_only' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter) . '">' .
// $marker = '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter) . '">';
if ($action == '') {
?>
<td>
  <table border="0" align="center" cellpadding="2" cellspacing="2">
      <tr>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["attributes_display_only"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_display_only' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_off.gif', LEGEND_ATTRIBUTES_DISPLAY_ONLY) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_display_only' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', LEGEND_ATTRIBUTES_DISPLAY_ONLY)) . '</a>'; ?></td>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["product_attribute_is_free"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_product_attribute_is_free' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', LEGEND_ATTRIBUTES_IS_FREE) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_product_attribute_is_free' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', LEGEND_ATTRIBUTES_IS_FREE)) . '</a>'; ?></td>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["attributes_default"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_default' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', LEGEND_ATTRIBUTES_DEFAULT) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_default' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', LEGEND_ATTRIBUTES_DEFAULT)) . '</a>' ?></td>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["attributes_discounted"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_discounted' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_pink_off.gif', LEGEND_ATTRIBUTE_IS_DISCOUNTED) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_discounted' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_pink_on.gif', LEGEND_ATTRIBUTE_IS_DISCOUNTED)) . '</a>'; ?></td>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["attributes_price_base_included"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_price_base_included' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_purple_off.gif', LEGEND_ATTRIBUTE_PRICE_BASE_INCLUDED) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_price_base_included' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_purple_on.gif', LEGEND_ATTRIBUTE_PRICE_BASE_INCLUDED)) . '</a>'; ?></td>
        <td class="smallText" align="center"><?php echo ($attributes_values->fields["attributes_required"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_required' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_off.gif', LEGEND_ATTRIBUTES_REQUIRED) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_required' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', LEGEND_ATTRIBUTES_REQUIRED)) . '</a>'; ?></td>
      </tr>
    </table>
</td>
<?php } ?>
<?php
  $new_attributes_price= '';
  if ($attributes_values->fields["attributes_discounted"]) {
    $new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
    $new_attributes_price = zen_get_discount_calc($products_filter, true, $new_attributes_price);
    if ($new_attributes_price != $attributes_price_final_value) {
      $new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1);
    } else {
      $new_attributes_price = '';
    }
  }
?>
            <td align="right" class="smallText"><?php echo $attributes_price_final . $new_attributes_price . ' ' . $attributes_price_final_onetime; ?></td>
<?php
  if ($action != '') {
?>
            <td width='120' align="center" class="smallText">&nbsp;</td>
<?php
  } else {
?>
            <td align="center" class="smallText">&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=update_attribute&attribute_id=' . $attributes_values->fields['products_attributes_id'] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id ) . '">'; ?><?php echo zen_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>&nbsp;&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=delete_product_attribute&attribute_id=' . $attributes_values->fields['products_attributes_id'] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id ) , '">'; ?><?php echo zen_image_button('button_delete.gif', IMAGE_DELETE); ?></a>&nbsp;</td>
<?php
  }
?>
<?php
// bof: show filename if it exists
      if (DOWNLOAD_ENABLED == 'true') {
        $download_display_query_raw ="select products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount
                              from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . "
                              where products_attributes_id='" . $attributes_values->fields['products_attributes_id'] . "'";
        $download_display = $db->Execute($download_display_query_raw);
        if ($download_display->RecordCount() > 0) {

// Moved to /admin/includes/configure.php
  if (!defined('DIR_FS_DOWNLOAD')) define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

  $filename_is_missing='';
  if ( !file_exists(DIR_FS_DOWNLOAD . $download_display->fields['products_attributes_filename']) ) {
    $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  } else {
    $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
  }
?>
          </tr>

          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
            <td colspan="3" class="smallText">&nbsp;</td>
            <td colspan="4"><table>
              <tr>
                <td class="smallText"><?php echo $filename_is_missing . '&nbsp;' . TABLE_TEXT_FILENAME; ?></td>
                <td class="smallText">&nbsp;&nbsp;<?php echo $download_display->fields['products_attributes_filename']; ?>&nbsp;</td>
                <td class="smallText">&nbsp;&nbsp;<?php echo TABLE_TEXT_MAX_DAYS_SHORT; ?></td>
                <td class="smallText">&nbsp;&nbsp;<?php echo $download_display->fields['products_attributes_maxdays']; ?>&nbsp;</td>
                <td class="smallText">&nbsp;&nbsp;<?php echo TABLE_TEXT_MAX_COUNT_SHORT; ?></td>
                <td class="smallText">&nbsp;&nbsp;<?php echo $download_display->fields['products_attributes_maxcount']; ?>&nbsp;</td>
              </tr>
            </table></td>


<?php
        } // show downloads
      }
// eof: show filename if it exists
?>
<?php
    }
    $max_attributes_id_values = $db->Execute("select max(products_attributes_id) + 1
                                              as next_id from " . TABLE_PRODUCTS_ATTRIBUTES);

    $next_id = $max_attributes_id_values->fields['next_id'];

//////////////////////////////////////////////////////////////
// BOF: Add dividers between Product Names and between Option Names
    $attributes_values->MoveNext();
    if (!$attributes_values->EOF) {
      if ($current_attributes_products_id != $attributes_values->fields['products_id']) {
?>
          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
            <td colspan="10"><table width="100%"><td>
              <tr>
                <td><?php echo zen_draw_separator('pixel_black.gif', '100%', '3'); ?></td>
              </tr>
            </table></td></tr>
<?php
  } else {
    if ($current_attributes_options_id != $attributes_values->fields['options_id']) {
?>
          <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">
            <td colspan="10"><table width="100%"><td>
              <tr>
                <td><?php echo zen_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
              </tr>
            </table></td></tr>
<?php
    }
  }
}
// EOF: Add dividers between Product Names and between Option Names
//////////////////////////////////////////////////////////////
?>
          </tr>

<?php
  }
  if (($action != 'update_attribute' and $action != 'delete_product_attribute')) {
?>
          <tr>
            <td colspan="10"><?php echo zen_black_line(); ?></td>
          </tr>

<!-- bof_adding -->
<tr class="attributeBoxContent"><td colspan="10"><table border="0" width="100%">

  <tr class="attributeBoxContent">
    <td class="pageHeading">
      <table border="0" width="100%">
        <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2" width="100%">

          <tr class="attributeBoxContent">
            <td class="pageHeading">&nbsp;<?php echo PRODUCTS_ATTRIBUTES_ADDING; ?></td>
            <td class="main"><?php echo TEXT_ATTRIBUTES_INSERT_INFO; ?></td>
              <td align="center" class="attributeBoxContent" height="30" valign="bottom">&nbsp;
              <?php
                if ($action == '') {
                  echo zen_image_submit('button_insert.gif', IMAGE_INSERT);
                } else {
                  // hide button
                }
              ?>
            &nbsp;
              </td>

          </tr>

        </table></td></tr>
      </table>
    </td>
  </tr>

<!-- bof Option Names and Values -->
  <tr class="attributeBoxContent">
    <td class="pageHeading">
      <table border='0' width="100%">
        <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">
          <tr class="attributeBoxContent"><td><table><tr>
            <td class="attributeBoxContent" width="40">&nbsp;<?php echo $next_id; ?>&nbsp;</td>
      	    <td class="pageHeading" valign="top">&nbsp;
              <input type="hidden" name="products_id" value="<?php echo $products_filter; ?>">
              <input type="hidden" name="current_category_id" value="<?php echo $current_category_id; ?>">
      	      <?php
        	      $show_model = zen_get_products_model($products_filter);
        	      if(!empty($show_model)) {
        	        $show_model = " - (" . $show_model . ")";
        	      }
      	        echo zen_clean_html(zen_get_products_name($products_filter)) . $show_model;
      	      ?>
      	    </td>
          </tr></table></td></tr>
          <tr class="attributeBoxContent"><td><table><tr>
            <td class="attributeBoxContent" width="40">&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_OPT_NAME . '<br />'; ?>
              <select name="options_id" id="OptionName" onChange="update_option(this.form)" size="<?php echo ($action != 'delete_attribute' ? "15" : "1"); ?>">
<?php
    $options_values = $db->Execute("select * from " . TABLE_PRODUCTS_OPTIONS . "
                                    where language_id = '" . $_SESSION['languages_id'] . "'
                                    order by products_options_name");

    while (!$options_values->EOF) {
      echo '              <option name="' . $options_values->fields['products_options_name'] . '" value="' . $options_values->fields['products_options_id'] . '">' . $options_values->fields['products_options_name'] . '&nbsp;&nbsp;&nbsp;[' . translate_type_to_name($options_values->fields['products_options_type']) . ']' . ($show_name_numbers ? ' &nbsp; [ #' . $options_values->fields['products_options_id'] . ' ] ' : '' ) . '</option>' . "\n";
      $options_values->MoveNext();
    }
?>
            </select>&nbsp;</td>
            <td class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_OPT_VALUE . '<br />'; ?>
            <select name="values_id[]" id="OptionValue" multiple="multiple" size="<?php echo ($action != 'delete_attribute' ? "15" : "1"); ?>">
  <option selected>&lt;-- Please select an Option Name from the list ... </option>
</select>&nbsp;</td>

<script language="javascript" type="text/javascript"><!--
  function update_option(theForm) {
    // if nothing to do, abort
    if (!theForm || !theForm.elements["options_id"] || !theForm.elements["values_id[]"]) return;
    if (!theForm.options_id.options[theForm.options_id.selectedIndex]) return;

    // enable hourglass
    document.body.style.cursor = "wait";

    // set initial values
    var SelectedOption = theForm.options_id.options[theForm.options_id.selectedIndex].value;
    var theField = document.getElementById("OptionValue");

    // reset the array of pulldown options so it can be repopulated
    var Opts = theField.options.length;
    while(Opts > 0) {
      Opts = Opts - 1;
      theField.options[Opts] = null;
    }

<?php  echo zen_js_option_values_list('SelectedOption', 'theField'); ?>

    // turn off hourglass
    document.body.style.cursor = "default";
  }
-->
</script>
<?php

$chk_defaults = $db->Execute("select products_type from " . TABLE_PRODUCTS . " where products_id=" . $products_filter);
// set defaults for adding attributes

$on_product_attribute_is_free = (zen_get_show_product_switch($products_filter, 'ATTRIBUTE_IS_FREE', 'DEFAULT_', '') == 1 ? true : false);
$off_product_attribute_is_free = ($on_product_attribute_is_free == 1 ? false : true);
$on_attributes_display_only = (zen_get_show_product_switch($products_filter, 'ATTRIBUTES_DISPLAY_ONLY', 'DEFAULT_', '') == 1 ? true : false);
$off_attributes_display_only = ($on_attributes_display_only == 1 ? false : true);
$on_attributes_default = (zen_get_show_product_switch($products_filter, 'ATTRIBUTES_DEFAULT', 'DEFAULT_', '') == 1 ? true : false);
$off_attributes_default = ($on_attributes_default == 1 ? false : true);
$on_attributes_discounted = (zen_get_show_product_switch($products_filter, 'ATTRIBUTES_DISCOUNTED', 'DEFAULT_', '') == 1 ? true : false);
$off_attributes_discounted = ($on_attributes_discounted == 1 ? false : true);
$on_attributes_price_base_included = (zen_get_show_product_switch($products_filter, 'ATTRIBUTES_PRICE_BASE_INCLUDED', 'DEFAULT_', '') == 1 ? true : false);
$off_attributes_price_base_included = ($on_attributes_price_base_included == 1 ? false : true);
$on_attributes_required = (zen_get_show_product_switch($products_filter, 'ATTRIBUTES_REQUIRED', 'DEFAULT_', '') == 1 ? true : false);
$off_attributes_required = ($on_attributes_required == 1 ? false : true);

$default_price_prefix = zen_get_show_product_switch($products_filter, 'PRICE_PREFIX', 'DEFAULT_', '');
$default_price_prefix = ($default_price_prefix == 1 ? '+' : ($default_price_prefix == 2 ? '-' : ''));
$default_products_attributes_weight_prefix  = zen_get_show_product_switch($products_filter, 'PRODUCTS_ATTRIBUTES_WEIGHT_PREFIX', 'DEFAULT_', '');
$default_products_attributes_weight_prefix  = ($default_products_attributes_weight_prefix  == 1 ? '+' : ($default_products_attributes_weight_prefix == 2 ? '-' : ''));

// set defaults for copying
$on_overwrite = true;
$off_overwrite = false;
?>
            </select>&nbsp;</td>
          </tr></table></td></tr>

<?php // split here ?>
        </table></td></tr>
      </table>
    </td>
  </tr>
<!-- eof Option Name and Value -->

<!-- bof Prices and Weight -->
  <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">
    <tr>
      <td colspan="2" class="pageHeading"><?php echo TEXT_PRICES_AND_WEIGHTS; ?></td>
    </tr>
    <tr>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2">
          <tr>
            <td align="center" class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_OPT_PRICE . '<br />'; ?><input type="text" name="price_prefix" size="2" value="<?php echo $default_price_prefix; ?>">&nbsp;<input type="text" name="value_price" size="6">&nbsp;</td>
            <td align="center" class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_OPT_WEIGHT . '<br />'; ?><input type="text" name="products_attributes_weight_prefix" size="2" value="<?php echo $default_products_attributes_weight_prefix; ?>">&nbsp;<input type="text" name="products_attributes_weight" size="6">&nbsp;</td>
            <td align="center" class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_OPT_SORT_ORDER; ?><br /><input type="text" name="products_options_sort_order" value="" size="4">&nbsp;</td>
            <td align="center" class="attributeBoxContent">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_ONETIME . '<br />'; ?><input type="text" name="attributes_price_onetime" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>

<?php if (ATTRIBUTES_ENABLED_PRICE_FACTOR == 'true') { ?>
      <td class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2">
          <tr>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR . '&nbsp;&nbsp;' . TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_OFFSET . '<br />'; ?><input type="text" name="attributes_price_factor" size="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="attributes_price_factor_offset" size="6">&nbsp;</td>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_ONETIME . '&nbsp;&nbsp;' . TABLE_HEADING_ATTRIBUTES_PRICE_FACTOR_OFFSET_ONETIME . '<br />'; ?><input type="text" name="attributes_price_factor_onetime" size="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="attributes_price_factor_onetime_offset" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
<?php
    } // ATTRIBUTES_ENABLED_PRICE_FACTOR
?>

<?php if (ATTRIBUTES_ENABLED_QTY_PRICES == 'true') { ?>
    <tr>
      <td colspan="2" class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2">
          <tr>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_QTY_PRICES . '<br />'; ?><input type="text" name="attributes_qty_prices" size="60">&nbsp;</td>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_QTY_PRICES_ONETIME . '<br />'; ?><input type="text" name="attributes_qty_prices_onetime" size="60">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
<?php } // ATTRIBUTES_ENABLED_QTY_PRICES ?>

<?php if (ATTRIBUTES_ENABLED_TEXT_PRICES == 'true') { ?>
    <tr>
      <td colspan="2" class="attributeBoxContent">
        <table border="1" cellpadding="4" cellspacing="2">
          <tr>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_WORDS . '&nbsp;&nbsp;' . TABLE_HEADING_ATTRIBUTES_PRICE_WORDS_FREE . '<br />'; ?><input type="text" name="attributes_price_words" size="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="attributes_price_words_free" size="6">&nbsp;</td>
            <td align="center" class="attributeBoxContent" nowrap="nowrap">&nbsp;<?php echo TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS . '&nbsp;&nbsp;' . TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS_FREE . '<br />'; ?><input type="text" name="attributes_price_letters" size="6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="attributes_price_letters_free" size="6">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
<?php } // ATTRIBUTES_ENABLED_TEXT_PRICES ?>

  </table></td></tr>

<!-- eof Option Name and Value -->

<!-- bof Attribute Flags -->
<tr class="attributeBoxContent">
  <td class="pageHeading">
    <table border='0' width="100%">
      <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">

            <tr><td class="attributeBoxContent"><table border="1" cellpadding="4" cellspacing="2">

              <tr >
                <td class="smallText" align="center" width="50"><?php echo TEXT_ATTRIBUTES_FLAGS; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ffff00"><strong><?php echo TEXT_ATTRIBUTES_DISPLAY_ONLY . '</strong><br>' . zen_draw_radio_field('attributes_display_only', '0', $off_attributes_display_only) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_display_only', '1', $on_attributes_display_only) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#2C54F5"><strong><?php echo TEXT_ATTRIBUTES_IS_FREE . '</strong><br>' . zen_draw_radio_field('product_attribute_is_free', '0', $off_product_attribute_is_free) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('product_attribute_is_free', '1', $on_product_attribute_is_free) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ffa346"><strong><?php echo TEXT_ATTRIBUTES_DEFAULT . '</strong><br>' . zen_draw_radio_field('attributes_default', '0', $off_attributes_default) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_default', '1', $on_attributes_default) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#ff00ff"><strong><?php echo TEXT_ATTRIBUTE_IS_DISCOUNTED . '</strong><br>' . zen_draw_radio_field('attributes_discounted', '0', $off_attributes_discounted) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_discounted', '1', $on_attributes_discounted) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td class="smallText" align="center" width="150" bgcolor="#d200f0"><strong><?php echo TEXT_ATTRIBUTE_PRICE_BASE_INCLUDED . '</strong><br>' . zen_draw_radio_field('attributes_price_base_included', '0', $off_attributes_price_base_included) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_price_base_included', '1', $on_attributes_price_base_included) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
                <td align="center" class="smallText" width="150" bgcolor="#FF0606"><strong><?php echo TEXT_ATTRIBUTES_REQUIRED . '</strong><br>' . zen_draw_radio_field('attributes_required', '0', $off_attributes_required) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_required', '1', $on_attributes_required) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
              </tr>

</table></td></tr>

      </table></td></tr>
    </table>
  </td>
</tr>
<!-- eof Attribute Flags -->

<?php if (ATTRIBUTES_ENABLED_IMAGES == 'true') { ?>
<?php
// add
// attributes images
  $dir = @dir(DIR_FS_CATALOG_IMAGES);
  $dir_info[] = array('id' => '', 'text' => "Main Directory");
  while ($file = $dir->read()) {
    if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
      $dir_info[] = array('id' => $file . '/', 'text' => $file);
    }
  }
  $dir->close();
  sort($dir_info);

  $default_directory = 'attributes/';
?>

<!-- bof Attribute Images -->
<tr class="attributeBoxContent">
  <td class="pageHeading">
    <table border='0' width="100%">
      <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2" width="100%">

        <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">
          <tr class="attributeBoxContent">
            <td>&nbsp;</td>
            <td class="main" valign="top">&nbsp;</td>

<!--
            <td class="main" valign="top">xxx<?php echo TEXT_ATTRIBUTES_IMAGE . '<br />' . zen_draw_file_field('attributes_image') . '<br />' . zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . $attributes_values->fields['attributes_image'] . zen_draw_hidden_field('attributes_image', $attributes_values->fields['attributes_image']); ?></td>
-->

            <td class="main" valign="top"><?php echo TEXT_ATTRIBUTES_IMAGE . '<br />' . zen_draw_file_field('attributes_image'); ?></td>

            <td class="main" valign="top"><?php echo TEXT_ATTRIBUTES_IMAGE_DIR . '<br />' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?></td>
            <td class="main" valign="top"><?php echo TEXT_IMAGES_OVERWRITE . '<br />' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . '&nbsp;' . TABLE_HEADING_YES; ?></td>
          </tr>
        </table></td>

        <td width="200">
          <table align="right">
            <tr>
              <td align="center" class="attributeBoxContent" height="30" valign="bottom">&nbsp;
              <?php
                if ($action == '') {
                  echo zen_image_submit('button_insert.gif', IMAGE_INSERT);
                } else {
                  // hide button
                }
              ?>
            &nbsp;
              </td>
            </tr>
          </table>

        </td></tr>

      </table></td></tr>
    </table>
  </td>
</tr>
<!-- eof Attribute Images -->
<?php } // ATTRIBUTES_ENABLED_IMAGES ?>

<?php
      if (DOWNLOAD_ENABLED == 'true') {
        $products_attributes_maxdays  = DOWNLOAD_MAX_DAYS;
        $products_attributes_maxcount = DOWNLOAD_MAX_COUNT;
?>
<!-- bof Down loads ON -->
<tr class="attributeBoxContent">
  <td class="pageHeading">
    <table border='0' width="100%">
      <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">

        <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">
          <tr class="attributeBoxContent">
            <td class="attributeBoxContent" valign="top"><?php echo TABLE_HEADING_DOWNLOAD; ?>&nbsp;</td>
            <td class="attributeBoxContent"><?php echo TABLE_TEXT_FILENAME . '<br />' . zen_draw_input_field('products_attributes_filename', $products_attributes_filename, zen_set_field_length(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, 'products_attributes_filename', 35)); ?>&nbsp;</td>
            <td class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_DAYS . '<br />' . zen_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>&nbsp;</td>
            <td class="attributeBoxContent"><?php echo TABLE_TEXT_MAX_COUNT . '<br />' . zen_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>&nbsp;</td>
          </tr>
        </table></td></tr>

      </table></td></tr>
    </table>
  </td>
</tr>
<!-- eof Downloads ON -->

<?php
      } else {
?>
<!-- bof Down loads OFF -->
<tr class="attributeBoxContent">
  <td class="pageHeading">
    <table border='0' width="100%">
      <tr><td class="attributeBoxContent"><table border="1" cellpadding="4" cellspacing="2">

        <tr><td class="attributeBoxContent"><table border="0" cellpadding="4" cellspacing="2">
          <tr class="attributeBoxContent">
            <td class="attributeBoxContent"><?php echo TEXT_DOWNLOADS_DISABLED; ?>&nbsp;</td>
          </tr>
        </table></td></tr>

      </table></td></tr>
    </table>
  </td>
</tr>
<!-- eof Downloads OFF -->
<?php
      } // end of DOWNLOAD_ENABLED section
?>
<?php
  }
?>
        </table></form></td>
<?php
} // EOF: attributes preview
?>
      </tr>
<?php
} // end of attributes
?>
    </table></td>

</table></td></tr>
<!-- eof_adding -->

<!-- products_attributes_eof //-->
  </tr>
</table>
<!-- body_text_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                       adminhome/backups/                                                                                  0000755 0001012 0001007 00000000000 11434737434 014625  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/backups/index.php                                                                         0000755 0001012 0001007 00000002747 10224324310 016437  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: index.php 1111 2005-04-05 01:51:19Z drbyte $
//

// send to domain root
    session_write_close();
    header('Location: ' . 'http://' . $_SERVER['HTTP_HOST']);
    exit();
?>                         adminhome/banner_manager.php                                                                        0000755 0001012 0001007 00000110023 11347523776 016652  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: banner_manager.php 15678 2010-03-16 02:34:53Z kuroi $
 */

  require('includes/application_top.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  $banner_extension = zen_banner_image_extension();

  if (zen_not_null($action)) {
    switch ($action) {
      case 'setflag':
        if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
          zen_set_banner_status($_GET['bID'], $_GET['flag']);

          $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success');
        } else {
          $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
        }

        zen_redirect(zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']));
        break;

      case 'setbanners_on_ssl':
        if ( ($_GET['flagbanners_on_ssl'] == '0') || ($_GET['flagbanners_on_ssl'] == '1') ) {
          $db->Execute("update " . TABLE_BANNERS . " set banners_on_ssl='" . $_GET['flagbanners_on_ssl'] . "' where banners_id='" . $_GET['bID'] . "'");

          $messageStack->add_session(SUCCESS_BANNER_ON_SSL_UPDATED, 'success');
        } else {
          $messageStack->add_session(ERROR_UNKNOWN_BANNER_ON_SSL, 'error');
        }

        zen_redirect(zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']));
        break;
      case 'setbanners_open_new_windows':
        if ( ($_GET['flagbanners_open_new_windows'] == '0') || ($_GET['flagbanners_open_new_windows'] == '1') ) {
          $db->Execute("update " . TABLE_BANNERS . " set banners_open_new_windows='" . $_GET['flagbanners_open_new_windows'] . "' where banners_id='" . $_GET['bID'] . "'");

          $messageStack->add_session(SUCCESS_BANNER_OPEN_NEW_WINDOW_UPDATED, 'success');
        } else {
          $messageStack->add_session(ERROR_UNKNOWN_BANNER_OPEN_NEW_WINDOW, 'error');
        }

        zen_redirect(zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']));
        break;
      case 'insert':
      case 'update':
        if (isset($_POST['banners_id'])) $banners_id = zen_db_prepare_input($_POST['banners_id']);
        $banners_title = zen_db_prepare_input($_POST['banners_title']);
        $banners_url = zen_db_prepare_input($_POST['banners_url']);
        $new_banners_group = zen_db_prepare_input($_POST['new_banners_group']);
        $banners_group = (empty($new_banners_group)) ? zen_db_prepare_input($_POST['banners_group']) : $new_banners_group;
        $banners_html_text = zen_db_prepare_input($_POST['banners_html_text']);
        $banners_image_local = zen_db_prepare_input($_POST['banners_image_local']);
        $banners_image_target = zen_db_prepare_input($_POST['banners_image_target']);
        $db_image_location = '';
        $expires_date = zen_db_prepare_input($_POST['expires_date']) == '' ? 'null' : zen_date_raw($_POST['expires_date']);
        $expires_impressions = zen_db_prepare_input($_POST['expires_impressions']);
        $date_scheduled = zen_db_prepare_input($_POST['date_scheduled']) == '' ? 'null' : zen_date_raw($_POST['date_scheduled']);
        $status = zen_db_prepare_input($_POST['status']);
        $banners_open_new_windows = zen_db_prepare_input($_POST['banners_open_new_windows']);
        $banners_on_ssl = zen_db_prepare_input($_POST['banners_on_ssl']);
        $banners_sort_order = zen_db_prepare_input($_POST['banners_sort_order']);

        $banner_error = false;
        if (empty($banners_title)) {
          $messageStack->add(ERROR_BANNER_TITLE_REQUIRED, 'error');
          $banner_error = true;
        }

        if (empty($banners_group)) {
          $messageStack->add(ERROR_BANNER_GROUP_REQUIRED, 'error');
          $banner_error = true;
        }

        if (empty($banners_html_text)) {
          if (empty($banners_image_local)) {
            $banners_image = new upload('banners_image');
            $banners_image->set_destination(DIR_FS_CATALOG_IMAGES . $banners_image_target);
            if ( ($banners_image->parse() == false) || ($banners_image->save() == false) ) {
              $messageStack->add(ERROR_BANNER_IMAGE_REQUIRED, 'error');
              $banner_error = true;
            }
          }
        }

        if ($banner_error == false) {
          $db_image_location = (zen_not_null($banners_image_local)) ? $banners_image_local : $banners_image_target . $banners_image->filename;
          $sql_data_array = array('banners_title' => $banners_title,
                                  'banners_url' => $banners_url,
                                  'banners_image' => $db_image_location,
                                  'banners_group' => $banners_group,
                                  'banners_html_text' => $banners_html_text,
                                  'status' => $status,
                                  'banners_open_new_windows' => $banners_open_new_windows,
                                  'banners_on_ssl' => $banners_on_ssl,
                                  'banners_sort_order' => (int)$banners_sort_order);

          if ($action == 'insert') {
            $insert_sql_data = array('date_added' => 'now()',
                                     'status' => '1');

            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

            zen_db_perform(TABLE_BANNERS, $sql_data_array);

            $banners_id = zen_db_insert_id();

            $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
          } elseif ($action == 'update') {
            zen_db_perform(TABLE_BANNERS, $sql_data_array, 'update', "banners_id = '" . (int)$banners_id . "'");

            $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
          }

// NOTE: status will be reset by the /functions/banner.php
// build new update sql for date_scheduled, expires_date and expires_impressions

          $sql = "UPDATE " . TABLE_BANNERS . "
                  SET
                    date_scheduled = :scheduledDate,
                    expires_date = DATE_ADD(:expiresDate, INTERVAL '23:59:59' HOUR_SECOND),
                    expires_impressions = " . ($expires_impressions == 0 ? "null" : ":expiresImpressions") . "
                    WHERE banners_id = :bannersID";
          if ($expires_impressions > 0) {
            $sql = $db->bindVars($sql, ':expiresImpressions', $expires_impressions, 'integer');
          }
          if ($date_scheduled != '') {
            $sql = $db->bindVars($sql, ':scheduledDate', $date_scheduled, 'date');
          }
          if ($expires_date != '') {
            $sql = $db->bindVars($sql, ':expiresDate', $expires_date, 'date');
          }
            $sql = $db->bindVars($sql, ':bannersID', $banners_id, 'integer');
            $db->Execute($sql);

          zen_redirect(zen_href_link(FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'bID=' . $banners_id));
        } else {
          $action = 'new';
        }
        break;
      case 'deleteconfirm':
        $banners_id = zen_db_prepare_input($_GET['bID']);

        if (isset($_POST['delete_image']) && ($_POST['delete_image'] == 'on')) {
          $banner = $db->Execute("select banners_image
                                 from " . TABLE_BANNERS . "
                                 where banners_id = '" . (int)$banners_id . "'");

          if (is_file(DIR_FS_CATALOG_IMAGES . $banner->fields['banners_image'])) {
            if (is_writeable(DIR_FS_CATALOG_IMAGES . $banner->fields['banners_image'])) {
              unlink(DIR_FS_CATALOG_IMAGES . $banner->fields['banners_image']);
            } else {
              $messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
            }
          } else {
            $messageStack->add_session(ERROR_IMAGE_DOES_NOT_EXIST, 'error');
          }
        }

        $db->Execute("delete from " . TABLE_BANNERS . "
                      where banners_id = '" . (int)$banners_id . "'");
        $db->Execute("delete from " . TABLE_BANNERS_HISTORY . "
                      where banners_id = '" . (int)$banners_id . "'");

        if (function_exists('imagecreate') && zen_not_null($banner_extension)) {
          if (is_file(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension)) {
              unlink(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banners_id . '.' . $banner_extension);
            }
          }

          if (is_file(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension)) {
              unlink(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banners_id . '.' . $banner_extension);
            }
          }

          if (is_file(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension)) {
              unlink(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banners_id . '.' . $banner_extension);
            }
          }

          if (is_file(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
            if (is_writeable(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
              unlink(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension);
            }
          }
        }

        $messageStack->add_session(SUCCESS_BANNER_REMOVED, 'success');

        zen_redirect(zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page']));
        break;
    }
  }

// check if the graphs directory exists
  $dir_ok = false;
  if (function_exists('imagecreate') && zen_not_null($banner_extension)) {
    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
      if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
        $dir_ok = true;
      } else {
        $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
      }
    } else {
      $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
<?php if ($action=='') { ?>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="smallText" align="center" width="100"><?php echo TEXT_LEGEND; ?></td>
            <td class="smallText" align="center" width="100"><?php echo TEXT_LEGEND_STATUS_OFF . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '&nbsp' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON); ?></td>
            <td class="smallText" align="center" width="100"><?php echo TEXT_LEGEND_BANNER_ON_SSL . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', IMAGE_ICON_BANNER_ON_SSL_ON) . '&nbsp;' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', IMAGE_ICON_BANNER_ON_SSL_OFF); ?></td>
            <td class="smallText" align="center" width="100"><?php echo TEXT_LEGEND_BANNER_OPEN_NEW_WINDOWS . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_ON) . '&nbsp;' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_OFF); ?></td>
          </tr>
        </table></td>
      </tr>
<?php } // legend ?>
<?php
  if ($action == 'new') {
    $form_action = 'insert';

    $parameters = array('expires_date' => '',
                        'date_scheduled' => '',
                        'banners_title' => '',
                        'banners_url' => '',
                        'banners_group' => '',
                        'banners_image' => '',
                        'banners_html_text' => '',
                        'expires_impressions' => '',
                        'banners_open_new_windows' => '',
                        'banners_on_ssl' => '');

    $bInfo = new objectInfo($parameters);

    if (isset($_GET['bID'])) {
      $form_action = 'update';

      $bID = zen_db_prepare_input($_GET['bID']);

      $banner = $db->Execute("select banners_title, banners_url, banners_image, banners_group,
                                     banners_html_text, status,
                                     date_format(date_scheduled, '%Y/%m/%d') as date_scheduled,
                                     date_format(expires_date, '%Y/%m/%d') as expires_date,
                                     expires_impressions, date_status_change, banners_open_new_windows, banners_on_ssl, banners_sort_order
                                     from " . TABLE_BANNERS . "
                                     where banners_id = '" . (int)$bID . "'");

      $bInfo->objectInfo($banner->fields);
    } elseif (zen_not_null($_POST)) {
      $bInfo->objectInfo($_POST);
    }

    if (!isset($bInfo->status)) $bInfo->status = '1';
    switch ($bInfo->status) {
      case '0': $is_status = false; $not_status = true; break;
      case '1': $is_status = true; $not_status = false; break;
      default: $is_status = true; $not_status = false; break;
    }
    if (!isset($bInfo->banners_open_new_windows)) $bInfo->banners_open_new_windows = '1';
    switch ($bInfo->banners_open_new_windows) {
      case '0': $is_banners_open_new_windows = false; $not_banners_open_new_windows = true; break;
      case '1': $is_banners_open_new_windows = true; $not_banners_open_new_windows = false; break;
      default: $is_banners_open_new_windows = true; $not_banners_open_new_windows = false; break;
    }
    if (!isset($bInfo->banners_on_ssl)) $bInfo->banners_on_ssl = '1';
    switch ($bInfo->banners_on_ssl) {
      case '0': $is_banners_on_ssl = false; $not_banners_on_ssl = true; break;
      case '1': $is_banners_on_ssl = true; $not_banners_on_ssl = false; break;
      default: $is_banners_on_ssl = true; $not_banners_on_ssl = false; break;
    }

    $groups_array = array();
    $groups = $db->Execute("select distinct banners_group
                            from " . TABLE_BANNERS . "
                            order by banners_group");
    while (!$groups->EOF) {
      $groups_array[] = array('id' => $groups->fields['banners_group'], 'text' => $groups->fields['banners_group']);
      $groups->MoveNext();
    }
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript">
  var dateExpires = new ctlSpiffyCalendarBox("dateExpires", "new_banner", "expires_date","btnDate1","<?php echo zen_date_short($bInfo->expires_date); ?>",scBTNMODE_CUSTOMBLUE);
  var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "new_banner", "date_scheduled","btnDate2","<?php echo zen_date_short($bInfo->date_scheduled); ?>",scBTNMODE_CUSTOMBLUE);
</script>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr><?php echo zen_draw_form('new_banner', FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo zen_draw_hidden_field('banners_id', $bID); ?>
        <td><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_STATUS; ?></td>
            <td class="main"><?php echo zen_draw_radio_field('status', '1', $is_status) . '&nbsp;' . TEXT_BANNERS_ACTIVE . '&nbsp;' . zen_draw_radio_field('status', '0', $not_status) . '&nbsp;' . TEXT_BANNERS_NOT_ACTIVE . '<br />' . TEXT_INFO_BANNER_STATUS; ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_OPEN_NEW_WINDOWS; ?></td>
            <td class="main"><?php echo zen_draw_radio_field('banners_open_new_windows', '1', $is_banners_open_new_windows) . '&nbsp;' . TEXT_YES . '&nbsp;' . zen_draw_radio_field('banners_open_new_windows', '0', $not_banners_open_new_windows) . '&nbsp;' . TEXT_NO . '<br />' . TEXT_INFO_BANNER_OPEN_NEW_WINDOWS; ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_ON_SSL; ?></td>
            <td class="main"><?php echo zen_draw_radio_field('banners_on_ssl', '1', $is_banners_on_ssl) . '&nbsp;' . TEXT_YES . '&nbsp;' . zen_draw_radio_field('banners_on_ssl', '0', $not_banners_on_ssl) . '&nbsp;' . TEXT_NO . '<br />' . TEXT_INFO_BANNER_ON_SSL; ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td>
            <td class="main"><?php echo zen_draw_input_field('banners_title', $bInfo->banners_title, zen_set_field_length(TABLE_BANNERS, 'banners_title'), true); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_URL; ?></td>
            <td class="main"><?php echo zen_draw_input_field('banners_url', $bInfo->banners_url, zen_set_field_length(TABLE_BANNERS, 'banners_url')); ?></td>
          </tr>
          <tr>
            <td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td>
            <td class="main"><?php echo zen_draw_pull_down_menu('banners_group', $groups_array, $bInfo->banners_group) . TEXT_BANNERS_NEW_GROUP . '<br>' . zen_draw_input_field('new_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main" valign="top"><?php echo TEXT_BANNERS_IMAGE; ?></td>
            <td class="main"><?php echo zen_draw_file_field('banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br>' . DIR_FS_CATALOG_IMAGES . zen_draw_input_field('banners_image_local', (isset($bInfo->banners_image) ? $bInfo->banners_image : ''), zen_set_field_length(TABLE_BANNERS, 'banners_image')); ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_IMAGE_TARGET; ?></td>
            <td class="main"><?php echo DIR_FS_CATALOG_IMAGES . zen_draw_input_field('banners_image_target'); ?></td>
          </tr>
          <tr>
            <td class="main" colspan="2"><?php echo TEXT_BANNER_IMAGE_TARGET_INFO; ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_BANNERS_HTML_TEXT; ?></td>
            <td class="main"><?php echo TEXT_BANNERS_HTML_TEXT_INFO . '<br />' . zen_draw_textarea_field('banners_html_text', 'soft', '60', '5', $bInfo->banners_html_text); ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_ALL_SORT_ORDER; ?></td>
            <td class="main"><?php echo TEXT_BANNERS_ALL_SORT_ORDER_INFO . '<br />' . zen_draw_input_field('banners_sort_order', $bInfo->banners_sort_order, zen_set_field_length(TABLE_BANNERS, 'banners_sort_order'), false); ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_SCHEDULED_AT; ?></td>
            <td valign="top" class="main"><script language="javascript">dateScheduled.writeControl();dateScheduled.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_BANNERS_EXPIRES_ON; ?></td>
            <td class="main"><script language="javascript">dateExpires.writeControl();dateExpires.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script><?php echo TEXT_BANNERS_OR_AT . '<br>' . zen_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><?php echo TEXT_BANNERS_BANNER_NOTE . '<br>' . TEXT_BANNERS_INSERT_NOTE . '<br>' . TEXT_BANNERS_EXPIRCY_NOTE . '<br>' . TEXT_BANNERS_SCHEDULE_NOTE; ?></td>
            <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? zen_image_submit('button_insert.gif', IMAGE_INSERT) : zen_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['bID']) ? 'bID=' . $_GET['bID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
          </tr>
        </table></td>
      </form></tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_BANNERS; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_GROUPS; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATISTICS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_BANNER_OPEN_NEW_WINDOWS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_BANNER_ON_SSL; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_BANNER_SORT_ORDER; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
// Split Page
// reset page when page is unknown
if (($_GET['page'] == '' or $_GET['page'] == '1') and $_GET['bID'] != '') {
  $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added, banners_open_new_windows, banners_on_ssl, banners_sort_order from " . TABLE_BANNERS . " order by banners_title, banners_group";
  $check_page = $db->Execute($banners_query_raw);
  $check_count=1;
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
    while (!$check_page->EOF) {
      if ($check_page->fields['banners_id'] == $_GET['bID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
  } else {
    $_GET['page'] = 1;
  }
}

    $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added, banners_open_new_windows, banners_on_ssl, banners_sort_order from " . TABLE_BANNERS . " order by banners_title, banners_group";
    $banners_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $banners_query_raw, $banners_query_numrows);
    $banners = $db->Execute($banners_query_raw);
    while (!$banners->EOF) {
      $info = $db->Execute("select sum(banners_shown) as banners_shown,
                                   sum(banners_clicked) as banners_clicked
                            from " . TABLE_BANNERS_HISTORY . "
                            where banners_id = '" . (int)$banners->fields['banners_id'] . "'");

      if ((!isset($_GET['bID']) || (isset($_GET['bID']) && ($_GET['bID'] == $banners->fields['banners_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
        $bInfo_array = array_merge($banners->fields, $info->fields);
        $bInfo = new objectInfo($bInfo_array);
      }

      $banners_shown = ($info->fields['banners_shown'] != '') ? $info->fields['banners_shown'] : '0';
      $banners_clicked = ($info->fields['banners_clicked'] != '') ? $info->fields['banners_clicked'] : '0';

      if (isset($bInfo) && is_object($bInfo) && ($banners->fields['banners_id'] == $bInfo->banners_id)) {
        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=new') . '\'">' . "\n";
      } else {
        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id']) . '\'">' . "\n";
      }
?>
                <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '.php' . '?banner=' . $banners->fields['banners_id']  . '\')">' . zen_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . '</a>&nbsp;' . $banners->fields['banners_title']; ?></td>
                <td class="dataTableContent" align="right"><?php echo $banners->fields['banners_group']; ?></td>
                <td class="dataTableContent" align="right"><?php echo $banners_shown . ' / ' . $banners_clicked; ?></td>
                <td class="dataTableContent" align="center">
<?php
      if ($banners->fields['status'] == '1') {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setflag&flag=0') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>';
      } else {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setflag&flag=1') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
      }
?>
                </td>
                <td class="dataTableContent" align="center">
<?php
      if ($banners->fields['banners_open_new_windows'] == '1') {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setbanners_open_new_windows&flagbanners_open_new_windows=0') . '">' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_ON) . '</a>';
      } else {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setbanners_open_new_windows&flagbanners_open_new_windows=1') . '">' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', IMAGE_ICON_BANNER_OPEN_NEW_WINDOWS_OFF) . '</a>';
      }
?>
                </td>
                <td class="dataTableContent" align="center">
<?php
      if ($banners->fields['banners_on_ssl'] == '1') {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setbanners_on_ssl&flagbanners_on_ssl=0') . '">' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', IMAGE_ICON_BANNER_ON_SSL_ON) . '</a>';
      } else {
        echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id'] . '&action=setbanners_on_ssl&flagbanners_on_ssl=1') . '">' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', IMAGE_ICON_BANNER_ON_SSL_OFF) . '</a>';
      }
?>
                </td>
                <td class="dataTableContent" align="right"><?php echo $banners->fields['banners_sort_order']; ?></td>

                <td class="dataTableContent" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id']) . '">' . zen_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . '</a>&nbsp;'; if (isset($bInfo) && is_object($bInfo) && ($banners->fields['banners_id'] == $bInfo->banners_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners->fields['banners_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $banners->MoveNext();
    }
?>
              <tr>
                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $banners_split->display_count($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?></td>
                    <td class="smallText" align="right"><?php echo $banners_split->display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
                  <tr>
                    <td align="right" colspan="2"><?php echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'action=new') . '">' . zen_image_button('button_new_banner.gif', IMAGE_NEW_BANNER) . '</a>'; ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();
  switch ($action) {
    case 'delete':
      $heading[] = array('text' => '<b>' . $bInfo->banners_title . '</b>');

      $contents = array('form' => zen_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br><b>' . $bInfo->banners_title . '</b>');
      if ($bInfo->banners_image) $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($bInfo)) {
        $heading[] = array('text' => '<b>' . $bInfo->banners_title . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=new') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('text' => '<br>' . TEXT_BANNERS_DATE_ADDED . ' ' . zen_date_short($bInfo->date_added));
        $contents[] = array('center', 'text' => '<br />' . '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>' );

        if ( (function_exists('imagecreate')) && ($dir_ok) && ($banner_extension) ) {
          $banner_id = $bInfo->banners_id;
          $days = '3';
          include(DIR_WS_INCLUDES . 'graphs/banner_infobox.php');
          $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension));
        } else {
          include(DIR_WS_FUNCTIONS . 'html_graphs.php');
          $contents[] = array('align' => 'center', 'text' => '<br>' . zen_banner_graph_infoBox($bInfo->banners_id, '3'));
        }

        $contents[] = array('text' => zen_image(DIR_WS_IMAGES . 'graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . '<br>' . zen_image(DIR_WS_IMAGES . 'graph_hbar_red.gif', 'Red', '5', '5') . ' ' . TEXT_BANNERS_BANNER_CLICKS);

        if ($bInfo->date_scheduled) $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, zen_date_short($bInfo->date_scheduled)));

        if ($bInfo->expires_date) {
          $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, zen_date_short($bInfo->expires_date)));
        } elseif ($bInfo->expires_impressions) {
          $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
        }

        if ($bInfo->date_status_change) $contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_STATUS_CHANGE, zen_date_short($bInfo->date_status_change)));
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             adminhome/banner_statistics.php                                                                     0000755 0001012 0001007 00000021664 10311431002 017410  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: banner_statistics.php 1969 2005-09-13 06:57:21Z drbyte $
//


  require('includes/application_top.php');

  $type = (isset($_GET['type']) ? $_GET['type'] : '');

  $banner_extension = zen_banner_image_extension();

// check if the graphs directory exists
  $dir_ok = false;
  if (function_exists('imagecreate') && zen_not_null($banner_extension)) {
    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
      if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
        $dir_ok = true;
      } else {
        $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
      }
    } else {
      $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
  }

  $banner = $db->Execute("select banners_title
                                from " . TABLE_BANNERS . "
                                where banners_id = '" . (int)$_GET['bID'] . "'");

  $years_array = array();
  $years = $db->Execute("select distinct year(banners_history_date) as banner_year
                              from " . TABLE_BANNERS_HISTORY . "
                              where banners_id = '" . (int)$_GET['bID'] . "'");
  while (!$years->EOF) {
    $years_array[] = array('id' => $years->fields['banner_year'],
                           'text' => $years->fields['banner_year']);
    $years->MoveNext();
  }

  $months_array = array();
  for ($i=1; $i<13; $i++) {
    $months_array[] = array('id' => $i,
                            'text' => strftime('%B', mktime(0,0,0,$i)));
  }

  $type_array = array(array('id' => 'daily',
                            'text' => STATISTICS_TYPE_DAILY),
                      array('id' => 'monthly',
                            'text' => STATISTICS_TYPE_MONTHLY),
                      array('id' => 'yearly',
                            'text' => STATISTICS_TYPE_YEARLY));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr><?php echo zen_draw_form('year', FILENAME_BANNER_STATISTICS, '', 'get'); ?>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
            <td class="main" align="right"><?php echo TITLE_TYPE . ' ' . zen_draw_pull_down_menu('type', $type_array, (zen_not_null($type) ? $type : 'daily'), 'onChange="this.form.submit();"'); ?><noscript><input type="submit" value="GO"></noscript><br>
<?php
  switch ($type) {
    case 'yearly': break;
    case 'monthly':
      echo TITLE_YEAR . ' ' . zen_draw_pull_down_menu('year', $years_array, (isset($_GET['year']) ? $_GET['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
      break;
    default:
    case 'daily':
      echo TITLE_MONTH . ' ' . zen_draw_pull_down_menu('month', $months_array, (isset($_GET['month']) ? $_GET['month'] : date('n')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript><br>' . TITLE_YEAR . ' ' . zen_draw_pull_down_menu('year', $years_array, (isset($_GET['year']) ? $_GET['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
      break;
  }
?>
            </td>
          <?php echo zen_hide_session_id() . zen_draw_hidden_field('page', $_GET['page']) . zen_draw_hidden_field('bID', $_GET['bID']); ?></form></tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="main" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
      </tr>
      <tr>
        <td align="center">
<?php
  if (function_exists('imagecreate') && ($dir_ok == true) && zen_not_null($banner_extension)) {
    $banner_id = (int)$_GET['bID'];

    switch ($type) {
      case 'yearly':
        include(DIR_WS_INCLUDES . 'graphs/banner_yearly.php');
        echo zen_image(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banner_id . '.' . $banner_extension);
        break;
      case 'monthly':
        include(DIR_WS_INCLUDES . 'graphs/banner_monthly.php');
        echo zen_image(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
        break;
      default:
      case 'daily':
        include(DIR_WS_INCLUDES . 'graphs/banner_daily.php');
        echo zen_image(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banner_id . '.' . $banner_extension);
        break;
    }
?>
          <table border="0" width="600" cellspacing="0" cellpadding="2">
            <tr class="dataTableHeadingRow">
             <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SOURCE; ?></td>
             <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VIEWS; ?></td>
             <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CLICKS; ?></td>
           </tr>
<?php
    for ($i=0, $n=sizeof($stats); $i<$n; $i++) {
      echo '            <tr class="dataTableRow">' . "\n" .
           '              <td class="dataTableContent">' . $stats[$i][0] . '</td>' . "\n" .
           '              <td class="dataTableContent" align="right">' . number_format($stats[$i][1]) . '</td>' . "\n" .
           '              <td class="dataTableContent" align="right">' . number_format($stats[$i][2]) . '</td>' . "\n" .
           '            </tr>' . "\n";
    }
?>
          </table>
<?php
  } else {
    include(DIR_WS_FUNCTIONS . 'html_graphs.php');

    switch ($type) {
      case 'yearly':
        echo zen_banner_graph_yearly($_GET['bID']);
        break;
      case 'monthly':
        echo zen_banner_graph_monthly($_GET['bID']);
        break;
      default:
      case 'daily':
        echo zen_banner_graph_daily($_GET['bID']);
        break;
    }
  }
?>
        </td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="main" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                            adminhome/categories.php                                                                            0000755 0001012 0001007 00000175132 11367545310 016042  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: categories.php 16185 2010-05-03 18:08:24Z ajeh $
 */

  require('includes/application_top.php');

  require(DIR_WS_MODULES . 'prod_cat_header_code.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (!isset($_SESSION['categories_products_sort_order'])) {
    $_SESSION['categories_products_sort_order'] = CATEGORIES_PRODUCTS_SORT_ORDER;
  }

  if (!isset($_GET['reset_categories_products_sort_order'])) {
    $reset_categories_products_sort_order = $_SESSION['categories_products_sort_order'];
  }

  if (zen_not_null($action)) {
    switch ($action) {
      case 'set_categories_products_sort_order':
      $_SESSION['categories_products_sort_order'] = $_GET['reset_categories_products_sort_order'];
      $action='';
      zen_redirect(zen_href_link(FILENAME_CATEGORIES,  'cPath=' . $_GET['cPath'] . ((isset($_GET['pID']) and !empty($_GET['pID'])) ? '&pID=' . $_GET['pID'] : '') . ((isset($_GET['page']) and !empty($_GET['page'])) ? '&page=' . $_GET['page'] : '')));
      break;
      case 'set_editor':
      // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
      $action='';
      zen_redirect(zen_href_link(FILENAME_CATEGORIES,  'cPath=' . $_GET['cPath'] . ((isset($_GET['pID']) and !empty($_GET['pID'])) ? '&pID=' . $_GET['pID'] : '') . ((isset($_GET['page']) and !empty($_GET['page'])) ? '&page=' . $_GET['page'] : '')));
      break;

      case 'update_category_status':
      // disable category and products including subcategories
      if (isset($_POST['categories_id'])) {
        $categories_id = zen_db_prepare_input($_POST['categories_id']);

        $categories = zen_get_category_tree($categories_id, '', '0', '', true);

        for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
          $product_ids = $db->Execute("select products_id
                                         from " . TABLE_PRODUCTS_TO_CATEGORIES . "
                                         where categories_id = '" . (int)$categories[$i]['id'] . "'");

          while (!$product_ids->EOF) {
            $products[$product_ids->fields['products_id']]['categories'][] = $categories[$i]['id'];
            $product_ids->MoveNext();
          }
        }

        // change the status of categories and products
        zen_set_time_limit(600);
        for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
          if ($_POST['categories_status'] == '1') {
            $categories_status = '0';
            $products_status = '0';
          } else {
            $categories_status = '1';
            $products_status = '1';
          }

          $sql = "update " . TABLE_CATEGORIES . " set categories_status='" . $categories_status . "'
                  where categories_id='" . $categories[$i]['id'] . "'";
          $db->Execute($sql);

          // set products_status based on selection
          if ($_POST['set_products_status'] == 'set_products_status_nochange') {
            // do not change current product status
          } else {
            if ($_POST['set_products_status'] == 'set_products_status_on') {
              $products_status = '1';
            } else {
              $products_status = '0';
            }

            $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
            $category_products = $db->Execute($sql);

            while (!$category_products->EOF) {
              $sql = "update " . TABLE_PRODUCTS . " set products_status='" . $products_status . "' where products_id='" . $category_products->fields['products_id'] . "'";
              $db->Execute($sql);
              $category_products->MoveNext();
            }
          }
        } // for

      }
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID']));
      break;

      case 'remove_type':
      $sql = "delete from " .  TABLE_PRODUCT_TYPES_TO_CATEGORY . "
              where category_id = '" . zen_db_prepare_input($_GET['cID']) . "'
              and product_type_id = '" . zen_db_prepare_input($_GET['type_id']) . "'";

      $db->Execute($sql);

      zen_remove_restrict_sub_categories($_GET['cID'], $_GET['type_id']);

      $action = "edit";
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $_GET['cPath'] . '&cID=' . zen_db_prepare_input($_GET['cID'])));
      break;
      case 'setflag':
      if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
        if (isset($_GET['pID'])) {
          zen_set_product_status($_GET['pID'], $_GET['flag']);
        }

      }

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      break;
      case 'insert_category':
      case 'update_category':
      if ( isset($_POST['add_type']) or isset($_POST['add_type_all']) ) {
        // check if it is already restricted
        $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
                where category_id = '" . zen_db_prepare_input($_POST['categories_id']) . "'
                and product_type_id = '" . zen_db_prepare_input($_POST['restrict_type']) . "'";

        $type_to_cat = $db->Execute($sql);
        if ($type_to_cat->RecordCount() < 1) {
          //@@TODO find all sub-categories and restrict them as well.

          $insert_sql_data = array('category_id' => zen_db_prepare_input($_POST['categories_id']),
                                   'product_type_id' => zen_db_prepare_input($_POST['restrict_type']));

          zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);
          /*
          // moved below so evaluated separately from current category
          if (isset($_POST['add_type_all'])) {
          zen_restrict_sub_categories($_POST['categories_id'], $_POST['restrict_type']);
          }
          */
        }
        // add product type restrictions to subcategories if not already set
        if (isset($_POST['add_type_all'])) {
          zen_restrict_sub_categories($_POST['categories_id'], $_POST['restrict_type']);
        }
        $action = "edit";
        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'action=edit_category&cPath=' . $cPath . '&cID=' . zen_db_prepare_input($_POST['categories_id'])));
      }
      if (isset($_POST['categories_id'])) $categories_id = zen_db_prepare_input($_POST['categories_id']);
      $sort_order = zen_db_prepare_input($_POST['sort_order']);

      $sql_data_array = array('sort_order' => (int)$sort_order);

      if ($action == 'insert_category') {
        $insert_sql_data = array('parent_id' => $current_category_id,
                                 'date_added' => 'now()');

        $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

        zen_db_perform(TABLE_CATEGORIES, $sql_data_array);

        $categories_id = zen_db_insert_id();
        // check if [arent is restricted
        $sql = "select parent_id from " . TABLE_CATEGORIES . "
                where categories_id = '" . $categories_id . "'";

        $parent_cat = $db->Execute($sql);
        if ($parent_cat->fields['parent_id'] != '0') {
          $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
                  where category_id = '" . $parent_cat->fields['parent_id'] . "'";
          $has_type = $db->Execute($sql);
          if ($has_type->RecordCount() > 0 ) {
            while (!$has_type->EOF) {
              $insert_sql_data = array('category_id' => $categories_id,
                                       'product_type_id' => $has_type->fields['product_type_id']);
              zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);
              $has_type->moveNext();
            }
          }
        }
      } elseif ($action == 'update_category') {
        $update_sql_data = array('last_modified' => 'now()');

        $sql_data_array = array_merge($sql_data_array, $update_sql_data);

        zen_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");
      }

      $languages = zen_get_languages();
      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
        $categories_name_array = $_POST['categories_name'];
        $categories_description_array = $_POST['categories_description'];
        $language_id = $languages[$i]['id'];

        // clean $categories_description when blank or just <p /> left behind
        $sql_data_array = array('categories_name' => zen_db_prepare_input($categories_name_array[$language_id]),
                                'categories_description' => ($categories_description_array[$language_id] == '<p />' ? '' : zen_db_prepare_input($categories_description_array[$language_id])));

        if ($action == 'insert_category') {
          $insert_sql_data = array('categories_id' => $categories_id,
                                   'language_id' => $languages[$i]['id']);

          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

          zen_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
        } elseif ($action == 'update_category') {
          zen_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
        }
      }

      if ($_POST['categories_image_manual'] != '') {
        // add image manually
        $categories_image_name = $_POST['img_dir'] . $_POST['categories_image_manual'];
        $db->Execute("update " . TABLE_CATEGORIES . "
                      set categories_image = '" . $categories_image_name . "'
                      where categories_id = '" . (int)$categories_id . "'");
      } else {
        if ($categories_image = new upload('categories_image')) {
          $categories_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
          if ($categories_image->parse() && $categories_image->save()) {
            $categories_image_name = $_POST['img_dir'] . $categories_image->filename;
          }
          if ($categories_image->filename != 'none' && $categories_image->filename != '' && $_POST['image_delete'] != 1) {
            // save filename when not set to none and not blank
            $db->Execute("update " . TABLE_CATEGORIES . "
                          set categories_image = '" . $categories_image_name . "'
                          where categories_id = '" . (int)$categories_id . "'");
          } else {
            // remove filename when set to none and not blank
            if ($categories_image->filename != '' || $_POST['image_delete'] == 1) {
              $db->Execute("update " . TABLE_CATEGORIES . "
                            set categories_image = ''
                            where categories_id = '" . (int)$categories_id . "'");
            }
          }
        }
      }

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '')));
      break;

      // bof: categories meta tags
      case 'update_category_meta_tags':
      // add or update meta tags
      //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
      $categories_id = $_POST['categories_id'];
      $languages = zen_get_languages();
      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
        $language_id = $languages[$i]['id'];
        $check = $db->Execute("select *
                               from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
                               where categories_id = '" . (int)$categories_id . "'
                               and language_id = '" . (int)$language_id . "'");
        if ($check->RecordCount() > 0) {
          $action = 'update_category_meta_tags';
        } else {
          $action = 'insert_categories_meta_tags';
        }
        if (empty($_POST['metatags_title'][$language_id]) && empty($_POST['metatags_keywords'][$language_id]) && empty($_POST['metatags_description'][$language_id])) {
          $action = 'delete_category_meta_tags';
        }

        $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

        if ($action == 'insert_categories_meta_tags') {
          $insert_sql_data = array('categories_id' => $categories_id,
                                   'language_id' => $language_id);
          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

          zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
        } elseif ($action == 'update_category_meta_tags') {
          zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
        } elseif ($action == 'delete_category_meta_tags') {
          $remove_categories_metatag = "DELETE from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . " WHERE categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'";
          $db->Execute($remove_categories_metatag);
        }
      }

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
      break;
      // eof: categories meta tags

      case 'delete_category_confirm_old':
      // demo active test
      if (zen_admin_demo()) {
        $_GET['action']= '';
        $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
      }
      if (isset($_POST['categories_id'])) {
        $categories_id = zen_db_prepare_input($_POST['categories_id']);

        $categories = zen_get_category_tree($categories_id, '', '0', '', true);
        $products = array();
        $products_delete = array();

        for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
          $product_ids = $db->Execute("select products_id
                                           from " . TABLE_PRODUCTS_TO_CATEGORIES . "
                                           where categories_id = '" . (int)$categories[$i]['id'] . "'");

          while (!$product_ids->EOF) {
            $products[$product_ids->fields['products_id']]['categories'][] = $categories[$i]['id'];
            $product_ids->MoveNext();
          }
        }

        reset($products);
        while (list($key, $value) = each($products)) {
          $category_ids = '';

          for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {
            $category_ids .= "'" . (int)$value['categories'][$i] . "', ";
          }
          $category_ids = substr($category_ids, 0, -2);

          $check = $db->Execute("select count(*) as total
                                           from " . TABLE_PRODUCTS_TO_CATEGORIES . "
                                           where products_id = '" . (int)$key . "'
                                           and categories_id not in (" . $category_ids . ")");
          if ($check->fields['total'] < '1') {
            $products_delete[$key] = $key;
          }
        }

        // removing categories can be a lengthy process
        zen_set_time_limit(600);
        for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
          zen_remove_category($categories[$i]['id']);
        }

        reset($products_delete);
        while (list($key) = each($products_delete)) {
          zen_remove_product($key);
        }
      }


      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
      break;

      //////////////////////////////////
      // delete new

      case 'delete_category_confirm':
      // demo active test
      if (zen_admin_demo()) {
        $_GET['action']= '';
        $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
      }

      // future cat specific deletion
      $delete_linked = 'true';
      if ($_POST['delete_linked'] == 'delete_linked_no') {
        $delete_linked = 'false';
      } else {
        $delete_linked = 'true';
      }

      // delete category and products
      if (isset($_POST['categories_id']) && $_POST['categories_id'] != '' && is_numeric($_POST['categories_id']) && $_POST['categories_id'] != 0) {
        $categories_id = zen_db_prepare_input($_POST['categories_id']);

        // create list of any subcategories in the selected category,
        $categories = zen_get_category_tree($categories_id, '', '0', '', true);

        zen_set_time_limit(600);

        // loop through this cat and subcats for delete-processing.
        for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
          $sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
          $category_products = $db->Execute($sql);

          while (!$category_products->EOF) {
            $cascaded_prod_id_for_delete = $category_products->fields['products_id'];
            $cascaded_prod_cat_for_delete = array();
            $cascaded_prod_cat_for_delete[] = $categories[$i]['id'];
            //echo 'processing product_id: ' . $cascaded_prod_id_for_delete . ' in category: ' . $cascaded_prod_cat_for_delete . '<br>';

            // determine product-type-specific override script for this product
            $product_type = zen_get_products_type($category_products->fields['products_id']);
            // now loop thru the delete_product_confirm script for each product in the current category
            if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
              require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php');
            } else {
              require(DIR_WS_MODULES . 'delete_product_confirm.php');
            }

            // THIS LINE COMMENTED BECAUSE IT'S DONE ALREADY DURING DELETE_PRODUCT_CONFIRM.PHP:
            //zen_remove_product($category_products->fields['products_id'], $delete_linked);
            $category_products->MoveNext();
          }

          zen_remove_category($categories[$i]['id']);

        } // end for loop
      }
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
      break;

      // eof delete new
      /////////////////////////////////
      // @@TODO where is delete_product_confirm

      case 'move_category_confirm':
      if (isset($_POST['categories_id']) && ($_POST['categories_id'] != $_POST['move_to_category_id'])) {
        $categories_id = zen_db_prepare_input($_POST['categories_id']);
        $new_parent_id = zen_db_prepare_input($_POST['move_to_category_id']);

        $path = explode('_', zen_get_generated_category_path_ids($new_parent_id));

        if (in_array($categories_id, $path)) {
          $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');

          zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
        } else {

          $sql = "select count(*) as count from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$new_parent_id . "'";
          $zc_count_products = $db->Execute($sql);

          if ( $zc_count_products->fields['count'] > 0) {
            $messageStack->add_session(ERROR_CATEGORY_HAS_PRODUCTS, 'error');
          } else {
            $messageStack->add_session(SUCCESS_CATEGORY_MOVED, 'success');
          }

          $db->Execute("update " . TABLE_CATEGORIES . "
                            set parent_id = '" . (int)$new_parent_id . "', last_modified = now()
                            where categories_id = '" . (int)$categories_id . "'");

          // fix here - if this is a category with subcats it needs to know to loop through
          // reset all products_price_sorter for moved category products
          $reset_price_sorter = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int)$categories_id . "'");
          while (!$reset_price_sorter->EOF) {
            zen_update_products_price_sorter($reset_price_sorter->fields['products_id']);
            $reset_price_sorter->MoveNext();
          }

          zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id));
        }
      } else {
        $messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_CATEGORY_SELF . $cPath, 'error');
        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
      }

      break;
      // @@TODO where is move_product_confirm
      // @@TODO where is insert_product
      // @@TODO where is update_product

      // attribute features
      case 'delete_attributes':
      zen_delete_products_attributes($_GET['products_id']);
      $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED . ' ID#' . $_GET['products_id'], 'success');
      $action='';

      // reset products_price_sorter for searches etc.
      zen_update_products_price_sorter($_GET['products_id']);

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      break;

      case 'update_attributes_sort_order':
      zen_update_attributes_products_option_values_sort_order($_GET['products_id']);
      $messageStack->add_session(SUCCESS_ATTRIBUTES_UPDATE . ' ID#' . $_GET['products_id'], 'success');
      $action='';
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      break;

      // attributes copy to product
      case 'update_attributes_copy_to_product':
      $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
      $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
      $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
      zen_copy_products_attributes($_POST['products_id'], $_POST['products_update_id']);
      //      die('I would copy Product ID#' . $_POST['products_id'] . ' to a Product ID#' . $_POST['products_update_id'] . ' - Existing attributes ' . $_POST['copy_attributes']);
      $_GET['action']= '';
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      break;

      // attributes copy to category
      case 'update_attributes_copy_to_category':
      $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
      $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
      $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
      $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $_POST['categories_update_id'] . "'");
      while (!$copy_to_category->EOF) {
        zen_copy_products_attributes($_POST['products_id'], $copy_to_category->fields['products_id']);
        $copy_to_category->MoveNext();
      }
      //      die('CATEGORIES - I would copy Product ID#' . $_POST['products_id'] . ' to a Category ID#' . $_POST['categories_update_id']  . ' - Existing attributes ' . $_POST['copy_attributes'] . ' Total Products ' . $copy_to_category->RecordCount());

      $_GET['action']= '';
      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      break;
      case 'new_product':
      if (isset($_GET['product_type'])) {
        // see if this category is restricted
        $pieces = explode('_',$_GET['cPath']);
        $cat_id = $pieces[sizeof($pieces)-1];
        //	echo $cat_id;
        $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . $cat_id . "'";
        $product_type_list = $db->Execute($sql);
        $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . $cat_id . "' and product_type_id = '" . $_GET['product_type'] . "'";
        $product_type_good = $db->Execute($sql);
        if ($product_type_list->RecordCount() < 1 || $product_type_good->RecordCount() > 0) {
          $url = zen_get_all_get_params();
          $sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . $_GET['product_type'] . "'";
          $handler = $db->Execute($sql);
          zen_redirect(zen_href_link($handler->fields['type_handler'] . '.php', zen_get_all_get_params()));
        } else {
          $messageStack->add(ERROR_CANNOT_ADD_PRODUCT_TYPE, 'error');
        }
      }
      break;
    }
  }

  // check if the catalog image directory exists
  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
    $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
  cssjsmenu('navbar');
  if (document.getElementById)
  {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
  }
  if (typeof _editor_url == "string") HTMLArea.replaceAll();
}
// -->
</script>
<?php if ($action != 'edit_category_meta_tags') { // bof: categories meta tags ?>
<?php if ($editor_handler != '') include ($editor_handler); ?>
<?php } // meta tags disable editor eof: categories meta tags?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<?php if ($action == '') { ?>
      <tr>
        <td><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND; ?></td>
            <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_STATUS_OFF . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF); ?></td>
            <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_STATUS_ON . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON); ?></td>
            <td class="smallText" align="center" width="100" valign="top"><?php echo TEXT_LEGEND_LINKED . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED); ?></td>
            <td class="smallText" align="center" width="150" valign="top"><?php echo TEXT_LEGEND_META_TAGS . '<br />' . TEXT_YES . '&nbsp;' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . '&nbsp;' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_off.gif', ICON_METATAGS_OFF); ?></td>
          </tr>
        </table></td>
      </tr>
  <tr>
    <td class="smallText" width="100%" align="right">
<?php
      // toggle switch for editor
      echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_CATEGORIES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') . zen_hide_session_id() .
            zen_draw_hidden_field('cID', $cPath) .
            zen_draw_hidden_field('cPath', $cPath) .
            zen_draw_hidden_field('pID', $_GET['pID']) .
            zen_draw_hidden_field('page', $_GET['page']) .
            zen_draw_hidden_field('action', 'set_editor') .
      '</form>';
?>
    </td>
  </tr>

  <tr>
    <td class="smallText" width="100%" align="right">
      <?php
      // check for which buttons to show for categories and products
      $check_categories = zen_has_category_subcategories($current_category_id);
      $check_products = zen_products_in_category_count($current_category_id, false, false, 1);

      $zc_skip_products = false;
      $zc_skip_categories = false;

      if ($check_products == 0) {
        $zc_skip_products = false;
        $zc_skip_categories = false;
      }
      if ($check_categories == true) {
        $zc_skip_products = true;
        $zc_skip_categories = false;
      }
      if ($check_products > 0) {
        $zc_skip_products = false;
        $zc_skip_categories = true;
      }

      if ($zc_skip_products == true) {
        // toggle switch for display sort order
        $categories_products_sort_order_array = array(array('id' => '0', 'text' => TEXT_SORT_CATEGORIES_SORT_ORDER_PRODUCTS_NAME),
        array('id' => '1', 'text' => TEXT_SORT_CATEGORIES_NAME)
        );
      } else {
        // toggle switch for display sort order
        $categories_products_sort_order_array = array(array('id' => '0', 'text' => TEXT_SORT_PRODUCTS_SORT_ORDER_PRODUCTS_NAME),
        array('id' => '1', 'text' => TEXT_SORT_PRODUCTS_NAME),
        array('id' => '2', 'text' => TEXT_SORT_PRODUCTS_MODEL),
        array('id' => '3', 'text'=> TEXT_SORT_PRODUCTS_QUANTITY),
        array('id' => '4', 'text'=> TEXT_SORT_PRODUCTS_QUANTITY_DESC),
        array('id' => '5', 'text'=> TEXT_SORT_PRODUCTS_PRICE),
        array('id' => '6', 'text'=> TEXT_SORT_PRODUCTS_PRICE_DESC)
        );
      }

      echo TEXT_CATEGORIES_PRODUCTS_SORT_ORDER_INFO . zen_draw_form('set_categories_products_sort_order_form', FILENAME_CATEGORIES, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_categories_products_sort_order', $categories_products_sort_order_array, $reset_categories_products_sort_order, 'onChange="this.form.submit();"') . zen_hide_session_id() .
            zen_draw_hidden_field('cID', $cPath) .
            zen_draw_hidden_field('cPath', $cPath) .
            zen_draw_hidden_field('pID', $_GET['pID']) .
            zen_draw_hidden_field('page', $_GET['page']) .
            zen_draw_hidden_field('action', 'set_categories_products_sort_order') .
      '</form>';
      ?>
    </td>
  </tr>

<?php } ?>
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top">
<?php
  require(DIR_WS_MODULES . 'category_product_listing.php');

  $heading = array();
  $contents = array();
  // Make an array of product types
  $sql = "select type_id, type_name from " . TABLE_PRODUCT_TYPES;
  $product_types = $db->Execute($sql);
  while (!$product_types->EOF) {
    $type_array[] = array('id' => $product_types->fields['type_id'], 'text' => $product_types->fields['type_name']);
    $product_types->MoveNext();
  }

  if (isset($_GET['cPath'])) {
    $cPath = $_GET['cPath'];
  }

  switch ($action) {
    case 'setflag_categories':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_STATUS_CATEGORY . '</b>');
    $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category_status&cPath=' . $_GET['cPath'] . '&cID=' . $_GET['cID'], 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id) . zen_draw_hidden_field('categories_status', $cInfo->categories_status));
    $contents[] = array('text' => zen_get_category_name($cInfo->categories_id, $_SESSION['languages_id']));
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_STATUS_WARNING . '<br /><br />');
    $contents[] = array('text' => TEXT_CATEGORIES_STATUS_INTRO . ' ' . ($cInfo->categories_status == '1' ? TEXT_CATEGORIES_STATUS_OFF : TEXT_CATEGORIES_STATUS_ON));
    if ($cInfo->categories_status == '1') {
      $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . ' ' . TEXT_PRODUCTS_STATUS_OFF . zen_draw_hidden_field('set_products_status_off', true));
    } else {
      $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . '<br />' .
      zen_draw_radio_field('set_products_status', 'set_products_status_on', true) . ' ' . TEXT_PRODUCTS_STATUS_ON . '<br />' .
      zen_draw_radio_field('set_products_status', 'set_products_status_off') . ' ' . TEXT_PRODUCTS_STATUS_OFF . '<br />' .
      zen_draw_radio_field('set_products_status', 'set_products_status_nochange') . ' ' . TEXT_PRODUCTS_STATUS_NOCHANGE);
    }


    //        $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_STATUS_INFO . '<br />' . zen_draw_radio_field('set_products_status', 'set_products_status_off', true) . ' ' . TEXT_PRODUCTS_STATUS_OFF . '<br />' . zen_draw_radio_field('set_products_status', 'set_products_status_on') . ' ' . TEXT_PRODUCTS_STATUS_ON);

    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;

    case 'new_category':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');

    $contents = array('form' => zen_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
    $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);

    $category_inputs_string = '';
    $languages = zen_get_languages();
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
    }

    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
    $category_inputs_string = '';

    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;';
      if ($_SESSION['html_editor_preference_status']=='FCKEDITOR') {
                $oFCKeditor = new FCKeditor('categories_description[' . $languages[$i]['id']  . ']') ;
                $oFCKeditor->Value = zen_get_category_description($cInfo->categories_id, $languages[$i]['id']);
                $oFCKeditor->Width  = '97%' ;
                $oFCKeditor->Height = '200' ;
//                $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
//                $oFCKeditor->Create() ;
                $output = $oFCKeditor->CreateHtml() ;
        $category_inputs_string .= '<br />' . $output;

//        $category_inputs_string .= '<IFRAME src= "' . DIR_WS_CATALOG . 'FCKeditor/fckeditor.html?FieldName=categories_description[' . $languages[$i]['id']  . ']&Upload=false&Browse=false&Toolbar=Short" width="97%" height="200" frameborder="no" scrolling="yes"></IFRAME>';
//        $category_inputs_string .= '<INPUT type="hidden" name="categories_description[' . $languages[$i]['id']  . ']" ' . 'value=' . "'" . zen_get_category_description($cInfo->categories_id, $languages[$i]['id']) . "'>";
      } else {
        $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', zen_get_category_description($cInfo->categories_id, $languages[$i]['id']));
      }
    }
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_DESCRIPTION . $category_inputs_string);
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));
    $dir = @dir(DIR_FS_CATALOG_IMAGES);
    $dir_info[] = array('id' => '', 'text' => "Main Directory");
    while ($file = $dir->read()) {
      if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
        $dir_info[] = array('id' => $file . '/', 'text' => $file);
      }
    }
    $dir->close();
    sort($dir_info);
    $default_directory = 'categories/';

    $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE_MANUAL . '&nbsp;' . zen_draw_input_field('categories_image_manual'));

    $contents[] = array('text' => '<br />' . TEXT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', '', 'size="6"'));
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
    case 'edit_category':
    // echo 'I SEE ' . $_SESSION['html_editor_preference_status'];
    // set image delete
    $on_image_delete = false;
    $off_image_delete = true;
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');

    $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : ''), 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
    $contents[] = array('text' => TEXT_EDIT_INTRO);

    $languages = zen_get_languages();

    $category_inputs_string = '';
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', htmlspecialchars(zen_get_category_name($cInfo->categories_id, $languages[$i]['id'])), zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
    }
    $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
    $category_inputs_string = '';
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' ;
      if ($_SESSION['html_editor_preference_status']=='FCKEDITOR') {
                $oFCKeditor = new FCKeditor('categories_description[' . $languages[$i]['id']  . ']') ;
                $oFCKeditor->Value = zen_get_category_description($cInfo->categories_id, $languages[$i]['id']);
                $oFCKeditor->Width  = '97%' ;
                $oFCKeditor->Height = '200' ;
//                $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
//                $oFCKeditor->Create() ;
                $output = $oFCKeditor->CreateHtml() ;
        $category_inputs_string .= '<br />' . $output;
//        $category_inputs_string .= '<IFRAME src= "' . DIR_WS_CATALOG . 'FCKeditor/fckeditor.html?FieldName=categories_description[' . $languages[$i]['id']  . ']&Upload=false&Browse=false&Toolbar=Short" width="97%" height="200" frameborder="no" scrolling="yes"></IFRAME>';
//        $category_inputs_string .= '<INPUT type="hidden" name="categories_description[' . $languages[$i]['id']  . ']" ' . 'value=' . "'" . zen_get_category_description($cInfo->categories_id, $languages[$i]['id']) . "'>";
      } else {
        $category_inputs_string .= zen_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', htmlspecialchars(zen_get_category_description($cInfo->categories_id, $languages[$i]['id'])));
      }
    }
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_DESCRIPTION . $category_inputs_string);
    $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));

    $dir = @dir(DIR_FS_CATALOG_IMAGES);
    $dir_info[] = array('id' => '', 'text' => "Main Directory");
    while ($file = $dir->read()) {
      if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
        $dir_info[] = array('id' => $file . '/', 'text' => $file);
      }
    }
    $dir->close();
    sort($dir_info);
    $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);

    $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));

    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE_MANUAL . '&nbsp;' . zen_draw_input_field('categories_image_manual'));

    $contents[] = array('text' => '<br />' . zen_info_image($cInfo->categories_image, $cInfo->categories_name));
    $contents[] = array('text' => '<br />' . $cInfo->categories_image);
    $contents[] = array('text' => '<br />' . TEXT_IMAGES_DELETE . ' ' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . '&nbsp;' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . '&nbsp;' . TABLE_HEADING_YES);

    $contents[] = array('text' => '<br />' . TEXT_EDIT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', $cInfo->sort_order, 'size="6"'));
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . ((isset($_GET['search']) && !empty($_GET['search'])) ? '&search=' . $_GET['search'] : '') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    $contents[] = array('text' => TEXT_RESTRICT_PRODUCT_TYPE . ' ' . zen_draw_pull_down_menu('restrict_type', $type_array) . '&nbsp<input type="submit" name="add_type_all" value="' . BUTTON_ADD_PRODUCT_TYPES_SUBCATEGORIES_ON . '">' . '&nbsp<input type="submit" name="add_type" value="' . BUTTON_ADD_PRODUCT_TYPES_SUBCATEGORIES_OFF . '">');
    $sql = "select * from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . "
                           where category_id = '" . $cInfo->categories_id . "'";

    $restrict_types = $db->Execute($sql);
    if ($restrict_types->RecordCount() > 0 ) {
      $contents[] = array('text' => '<br />' . TEXT_CATEGORY_HAS_RESTRICTIONS . '<br />');
      while (!$restrict_types->EOF) {
        $sql = "select type_name from " . TABLE_PRODUCT_TYPES . " where type_id = '" . $restrict_types->fields['product_type_id'] . "'";
        $type = $db->Execute($sql);
        $contents[] = array('text' => '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=remove_type&cPath=' . $cPath . '&cID='.$cInfo->categories_id.'&type_id='.$restrict_types->fields['product_type_id']) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>&nbsp;' . $type->fields['type_name'] . '<br />');
        $restrict_types->MoveNext();
      }
    }
    break;
    case 'delete_category':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</b>');

    $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
    $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
    $contents[] = array('text' => '<br />' . TEXT_DELETE_CATEGORY_INTRO_LINKED_PRODUCTS);
    $contents[] = array('text' => '<br /><b>' . $cInfo->categories_name . '</b>');
    if ($cInfo->childs_count > 0) $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
    if ($cInfo->products_count > 0) $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count));
    /*
    // future cat specific
    if ($cInfo->products_count > 0) {
    $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_LINKED_INFO . '<br />' .
    zen_draw_radio_field('delete_linked', 'delete_linked_yes') . ' ' . TEXT_PRODUCTS_DELETE_LINKED_YES . '<br />' .
    zen_draw_radio_field('delete_linked', 'delete_linked_no', true) . ' ' . TEXT_PRODUCTS_DELETE_LINKED_NO);
    }
    */
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;

    // bof: categories meta tags
    case 'edit_category_meta_tags':
    $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_EDIT_CATEGORY_META_TAGS . '</strong>');

    $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category_meta_tags&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
    $contents[] = array('text' => TEXT_EDIT_CATEGORIES_META_TAGS_INTRO . ' - <strong>' . $cInfo->categories_id . ' ' . $cInfo->categories_name . '</strong>');

    $languages = zen_get_languages();

    $category_inputs_string_metatags_title = '';
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string_metatags_title .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['metatags_title']) . '&nbsp;' . zen_draw_input_field('metatags_title[' . $languages[$i]['id'] . ']', zen_get_category_metatags_title($cInfo->categories_id, $languages[$i]['id']), zen_set_field_length(TABLE_METATAGS_CATEGORIES_DESCRIPTION, 'metatags_title'));
    }
    $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_TITLE . $category_inputs_string_metatags_title);

    $category_inputs_string_metatags_keywords = '';
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string_metatags_keywords .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['metatags_keywords']) . '&nbsp;' ;
      $category_inputs_string_metatags_keywords .= zen_draw_textarea_field('metatags_keywords[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', zen_get_category_metatags_keywords($cInfo->categories_id, $languages[$i]['id']));
    }
    $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_KEYWORDS . $category_inputs_string_metatags_keywords);

    $category_inputs_string_metatags_description = '';
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $category_inputs_string_metatags_description .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' ;
      $category_inputs_string_metatags_description .= zen_draw_textarea_field('metatags_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', zen_get_category_metatags_description($cInfo->categories_id, $languages[$i]['id']));
    }
    $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_META_TAGS_DESCRIPTION . $category_inputs_string_metatags_description);

    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
    // eof: categories meta tags

    case 'move_category':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_CATEGORY . '</b>');

    $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=move_category_confirm&cPath=' . $cPath) . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
    $contents[] = array('text' => sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name));
    $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
    case 'delete_product':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCT . '</b>');

    $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=delete_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
    $contents[] = array('text' => TEXT_DELETE_PRODUCT_INTRO);
    $contents[] = array('text' => '<br /><b>' . $pInfo->products_name . ' ID#' . $pInfo->products_id . '</b>');

    $product_categories_string = '';
    $product_categories = zen_generate_category_path($pInfo->products_id, 'product');
    for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) {
      $category_path = '';
      for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) {
        $category_path .= $product_categories[$i][$j]['text'] . '&nbsp;&gt;&nbsp;';
      }
      $category_path = substr($category_path, 0, -16);
      $product_categories_string .= zen_draw_checkbox_field('product_categories[]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . '&nbsp;' . $category_path . '<br />';
    }
    $product_categories_string = substr($product_categories_string, 0, -4);

    $contents[] = array('text' => '<br />' . $product_categories_string);
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
    case 'move_product':
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_MOVE_PRODUCT . '</b>');

    $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
    $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
    $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
    $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br />' . zen_draw_pull_down_menu('move_to_category_id', zen_get_category_tree(), $current_category_id));
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;
    case 'copy_to':
    $copy_attributes_delete_first = '0';
    $copy_attributes_duplicates_skipped = '0';
    $copy_attributes_duplicates_overwrite = '0';
    $copy_attributes_include_downloads = '1';
    $copy_attributes_include_filename = '1';

    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
    // WebMakers.com Added: Split Page
    if (empty($pInfo->products_id)) {
      $pInfo->products_id= $pID;
    }

    $contents = array('form' => zen_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
    $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
    $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_PRODUCT . '<br /><b>' . $pInfo->products_name  . ' ID#' . $pInfo->products_id . '</b>');
    $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
    $contents[] = array('text' => '<br />' . TEXT_CATEGORIES . '<br />' . zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id));
    $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);

    // only ask about attributes if they exist
    if (zen_has_product_attributes($pInfo->products_id, 'false')) {
      $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_ONLY);
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
      // future          $contents[] = array('align' => 'center', 'text' => '<br />' . ATTRIBUTES_NAMES_HELPER . '<br />' . zen_draw_separator('pixel_trans.gif', '1', '10'));
      $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
    }

    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

    break;
    // attribute features
    case 'attribute_features':
    $copy_attributes_delete_first = '0';
    $copy_attributes_duplicates_skipped = '0';
    $copy_attributes_duplicates_overwrite = '0';
    $copy_attributes_include_downloads = '1';
    $copy_attributes_include_filename = '1';
    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');

    $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');

    $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' .
    (zen_has_product_attributes($pInfo->products_id, 'false') ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' . '&nbsp;&nbsp;' : '') .
    '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' .
    '<br /><br />');
    // only if attributes
    if (zen_has_product_attributes($pInfo->products_id, 'false')) {
      $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
      $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
      $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
      $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
      $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
    }
    $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;

    // attribute copier to product
    case 'attribute_features_copy_to_product':
    $_GET['products_update_id'] = '';
    // excluded current product from the pull down menu of products
    $products_exclude_array = array();
    $products_exclude_array[] = $pInfo->products_id;

    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
    $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_product&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
    $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down('products_update_id', '', $products_exclude_array, true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;

    // attribute copier to product
    case 'attribute_features_copy_to_category':
    $_GET['categories_update_id'] = '';

    $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
    $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_category&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('categories_update_id', $_GET['categories_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
    $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
    $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down_categories('categories_update_id', '', '', true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
    break;

  } // switch

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>

          </tr>
          <tr>
            <td class="alert" colspan="3" width="100%" align="center">
<?php
  // warning if products are in top level categories
  $check_products_top_categories = $db->Execute("select count(*) as products_errors from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = 0");
  if ($check_products_top_categories->fields['products_errors'] > 0) {
    echo WARNING_PRODUCTS_IN_TOP_INFO . $check_products_top_categories->fields['products_errors'] . '<br />';
  }
?>
            </td>
          </tr>
          <tr>
<?php
// Split Page
if ($products_query_numrows > 0) {
  if (empty($pInfo->products_id)) {
    $pInfo->products_id= $pID;
  }
?>
            <td class="smallText" align="center"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'pID')) ); ?></td>

<?php
}
// Split Page
?>
          </tr>
        </table></td>
      </tr>
    </table>
    </td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                      adminhome/configuration.php                                                                         0000755 0001012 0001007 00000027254 11242362202 016552  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: configuration.php 14193 2009-08-18 04:15:13Z drbyte $
 */


  require('includes/application_top.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'save':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
        }
        $configuration_value = zen_db_prepare_input($_POST['configuration_value']);
        $cID = zen_db_prepare_input($_GET['cID']);

        $db->Execute("update " . TABLE_CONFIGURATION . "
                      set configuration_value = '" . zen_db_input($configuration_value) . "',
                          last_modified = now() where configuration_id = '" . (int)$cID . "'");
        $configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
                          from ' . TABLE_CONFIGURATION;

        $configuration = $db->Execute($configuration_query);

        // set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
        if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
        $db->Execute("update " . TABLE_CONFIGURATION . "
                      set configuration_value = 'false', last_modified = '" . NOW . "'
                      where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }

        $configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
                          from ' . TABLE_CONFIGURATION;

        $configuration = $db->Execute($configuration_query);

        zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
        break;
    }
  }

  $gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
  $_GET['gID'] = $gID;
  $cfg_group = $db->Execute("select configuration_group_title
                             from " . TABLE_CONFIGURATION_GROUP . "
                             where configuration_group_id = '" . (int)$gID . "'");

if ($gID == 7) {
        $shipping_errors = '';
        if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
          $shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
        }
        if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
          $shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
        }
        if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
          $shipping_errors .= '<br />' . ERROR_USPS_STATUS;
        }
        if ($shipping_errors != '') {
          $messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
        }
}

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
                                        use_function from " . TABLE_CONFIGURATION . "
                                        where configuration_group_id = '" . (int)$gID . "'
                                        order by sort_order");
  while (!$configuration->EOF) {
    if (zen_not_null($configuration->fields['use_function'])) {
      $use_function = $configuration->fields['use_function'];
      if (preg_match('/->/', $use_function)) {
        $class_method = explode('->', $use_function);
        if (!is_object(${$class_method[0]})) {
          include(DIR_WS_CLASSES . $class_method[0] . '.php');
          ${$class_method[0]} = new $class_method[0]();
        }
        $cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
      } else {
        $cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']);
      }
    } else {
      $cfgValue = $configuration->fields['configuration_value'];
    }

    if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
      $cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added,
                                        last_modified, use_function, set_function
                                 from " . TABLE_CONFIGURATION . "
                                 where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'");
      $cInfo_array = array_merge($configuration->fields, $cfg_extra->fields);
      $cInfo = new objectInfo($cInfo_array);
    }

    if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) {
      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td>
                <td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    $configuration->MoveNext();
  }
?>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'edit':
      $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');

      if ($cInfo->set_function) {
        eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value) . '");');
      } else {
        $value_field = zen_draw_input_field('configuration_value', $cInfo->configuration_value, 'size="60"');
      }

      $contents = array('form' => zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
      if (ADMIN_CONFIGURATION_KEY_ON == 1) {
        $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
      }
      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . '&nbsp;<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (isset($cInfo) && is_object($cInfo)) {
        $heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
        if (ADMIN_CONFIGURATION_KEY_ON == 1) {
          $contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
        }

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
        $contents[] = array('text' => '<br>' . $cInfo->configuration_description);
        $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added));
        if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified));
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                    adminhome/countries.php                                                                             0000755 0001012 0001007 00000032367 11237757112 015733  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: countries.php 14139 2009-08-10 13:46:02Z wilt $
 */

  require('includes/application_top.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'insert':
        $countries_name = zen_db_prepare_input($_POST['countries_name']);
        $countries_iso_code_2 = zen_db_prepare_input($_POST['countries_iso_code_2']);
        $countries_iso_code_3 = zen_db_prepare_input($_POST['countries_iso_code_3']);
        $address_format_id = zen_db_prepare_input($_POST['address_format_id']);

        $db->Execute("insert into " . TABLE_COUNTRIES . "
                    (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id)
                    values ('" . zen_db_input($countries_name) . "',
                            '" . zen_db_input($countries_iso_code_2) . "',
                            '" . zen_db_input($countries_iso_code_3) . "',
                            '" . (int)$address_format_id . "')");

        zen_redirect(zen_href_link(FILENAME_COUNTRIES));
        break;
      case 'save':
        $countries_id = zen_db_prepare_input($_GET['cID']);
        $countries_name = zen_db_prepare_input($_POST['countries_name']);
        $countries_iso_code_2 = zen_db_prepare_input($_POST['countries_iso_code_2']);
        $countries_iso_code_3 = zen_db_prepare_input($_POST['countries_iso_code_3']);
        $address_format_id = zen_db_prepare_input($_POST['address_format_id']);

        $db->Execute("update " . TABLE_COUNTRIES . "
                      set countries_name = '" . zen_db_input($countries_name) . "',
                          countries_iso_code_2 = '" . zen_db_input($countries_iso_code_2) . "',
                          countries_iso_code_3 = '" . zen_db_input($countries_iso_code_3) . "',
                          address_format_id = '" . (int)$address_format_id . "'
                      where countries_id = '" . (int)$countries_id . "'");

        zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries_id));
        break;
      case 'deleteconfirm':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']));
        }
        $countries_id = zen_db_prepare_input($_GET['cID']);
        $sql = "select entry_country_id from " . TABLE_ADDRESS_BOOK . " where entry_country_id = :countryID: LIMIT 1";
        $sql = $db->bindVars($sql, ':countryID:', $countries_id, 'integer');
        $result = $db->Execute($sql);
        if ($result->recordCount() == 0) {
          $db->Execute("delete from " . TABLE_COUNTRIES . "
                        where countries_id = '" . (int)$countries_id . "'");
        } else {
          $messageStack->add_session(ERROR_COUNTRY_IN_USE, 'error');
        }

        zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']));
        break;
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_NAME; ?></td>
                <td class="dataTableHeadingContent" align="center" colspan="2"><?php echo TABLE_HEADING_COUNTRY_CODES; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $countries_query_raw = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id from " . TABLE_COUNTRIES . " order by countries_name";
  $countries_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $countries_query_raw, $countries_query_numrows);
  $countries = $db->Execute($countries_query_raw);
  while (!$countries->EOF) {
    if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $countries->fields['countries_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
      $cInfo = new objectInfo($countries->fields);
    }

    if (isset($cInfo) && is_object($cInfo) && ($countries->fields['countries_id'] == $cInfo->countries_id)) {
      echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries->fields['countries_id']) . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $countries->fields['countries_name']; ?></td>
                <td class="dataTableContent" align="center" width="40"><?php echo $countries->fields['countries_iso_code_2']; ?></td>
                <td class="dataTableContent" align="center" width="40"><?php echo $countries->fields['countries_iso_code_3']; ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($countries->fields['countries_id'] == $cInfo->countries_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $countries->fields['countries_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    $countries->MoveNext();
  }
?>
              <tr>
                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $countries_split->display_count($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
                    <td class="smallText" align="right"><?php echo $countries_split->display_links($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
<?php
  if (empty($action)) {
?>
                  <tr>
                    <td colspan="2" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&action=new') . '">' . zen_image_button('button_new_country.gif', IMAGE_NEW_COUNTRY) . '</a>'; ?></td>
                  </tr>
<?php
  }
?>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'new':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&action=insert'));
      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . zen_draw_input_field('countries_name'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . zen_draw_input_field('countries_iso_code_2'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . zen_draw_input_field('countries_iso_code_3'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . zen_draw_pull_down_menu('address_format_id', zen_get_address_formats()));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . '&nbsp;<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'edit':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=save'));
      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . zen_draw_input_field('countries_name', $cInfo->countries_name));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . zen_draw_input_field('countries_iso_code_2', $cInfo->countries_iso_code_2));
      $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . zen_draw_input_field('countries_iso_code_3', $cInfo->countries_iso_code_3));
      $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . zen_draw_pull_down_menu('address_format_id', zen_get_address_formats(), $cInfo->address_format_id));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'delete':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_COUNTRY . '</b>');

      $contents = array('form' => zen_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br><b>' . $cInfo->countries_name . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($cInfo)) {
        $heading[] = array('text' => '<b>' . $cInfo->countries_name . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->countries_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . $cInfo->countries_name);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . ' ' . $cInfo->countries_iso_code_2);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . ' ' . $cInfo->countries_iso_code_3);
        $contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . ' ' . $cInfo->address_format_id);
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                         adminhome/coupon_admin.php                                                                          0000755 0001012 0001007 00000202011 11237757112 016354  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: coupon_admin.php 14139 2009-08-10 13:46:02Z wilt $
 */

  require('includes/application_top.php');
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  if ($_GET['selected_box']) {
    $_GET['action']='';
    $_GET['old_action']='';
  }

  if (($_GET['action'] == 'send_email_to_user') && ($_POST['customers_email_address']) && (!$_POST['back_x'])) {
    $audience_select = get_audience_sql_query($_POST['customers_email_address'], 'email');
    $mail = $db->Execute($audience_select['query_string']);
    $mail_sent_to = $audience_select['query_name'];
    if ($_POST['email_to']) {
      $mail_sent_to = $_POST['email_to'];
    }

    $coupon_result = $db->Execute("select coupon_code, coupon_start_date, coupon_expire_date
                                   from " . TABLE_COUPONS . "
                                   where coupon_id = '" . $_GET['cid'] . "'");

    $coupon_name = $db->Execute("select coupon_name, coupon_description
                                 from " . TABLE_COUPONS_DESCRIPTION . "
                                 where coupon_id = '" . $_GET['cid'] . "'
                                 and language_id = '" . $_SESSION['languages_id'] . "'");

    // demo active test
    if (zen_admin_demo()) {
      $_GET['action']= '';
      $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
      zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'mail_sent_to=' . urlencode($mail_sent_to)));
    }
    $from = zen_db_prepare_input($_POST['from']);
    $subject = zen_db_prepare_input($_POST['subject']);
    $recip_count=0;
    $text_coupon_help = sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon_result->fields['coupon_start_date']), zen_date_short($coupon_result->fields['coupon_expire_date']));
    $html_coupon_help = sprintf(HTML_COUPON_HELP_DATE, zen_date_short($coupon_result->fields['coupon_start_date']), zen_date_short($coupon_result->fields['coupon_expire_date']));

    while (!$mail->EOF) {
      $message = zen_db_prepare_input($_POST['message']);
      $message .= "\n\n" . TEXT_TO_REDEEM . "\n\n";
      $message .= TEXT_VOUCHER_IS . $coupon_result->fields['coupon_code'] . "\n\n";
      $message .= $text_coupon_help . "\n\n";
      $message .= TEXT_REMEMBER . "\n\n";
      $message .=(!empty($coupon_name->fields['coupon_description']) ? $coupon_name->fields['coupon_description'] . "\n\n" : '');
      $message .= sprintf(TEXT_VISIT ,HTTP_CATALOG_SERVER . DIR_WS_CATALOG);

      // disclaimer
      $message .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";

      $html_msg['EMAIL_FIRST_NAME'] = $mail->fields['customers_firstname'];
      $html_msg['EMAIL_LAST_NAME']  = $mail->fields['customers_lastname'];
      $html_msg['EMAIL_MESSAGE_HTML'] = zen_db_prepare_input($_POST['message_html']);
      $html_msg['COUPON_TEXT_TO_REDEEM'] = TEXT_TO_REDEEM;
      $html_msg['COUPON_TEXT_VOUCHER_IS'] = TEXT_VOUCHER_IS;
      $html_msg['COUPON_CODE'] = $coupon_result->fields['coupon_code'] . $html_coupon_help;
      $html_msg['COUPON_DESCRIPTION'] =(!empty($coupon_name->fields['coupon_description']) ? $coupon_name->fields['coupon_description'] : '');
      $html_msg['COUPON_TEXT_REMEMBER']  = TEXT_REMEMBER;
      $html_msg['COUPON_REDEEM_STORENAME_URL'] = sprintf(TEXT_VISIT ,'<a href="'.HTTP_CATALOG_SERVER . DIR_WS_CATALOG.'">'.STORE_NAME.'</a>');

//Send the emails
      zen_mail($mail->fields['customers_firstname'] . ' ' . $mail->fields['customers_lastname'], $mail->fields['customers_email_address'], $subject , $message, '',$from, $html_msg, 'coupon');

      $recip_count++;
      // send copy to Admin if enabled
      if (SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_STATUS== '1' and SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO != '') {
        zen_mail('', SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO, SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_SUBJECT . ' ' . $subject , $message, '',$from, $html_msg, 'coupon_extra');
      }
      $mail->MoveNext();
    }
    zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'mail_sent_to=' . urlencode($mail_sent_to) . '&recip_count='. $recip_count ));
  }

  if ( ($_GET['action'] == 'preview_email') && (!$_POST['customers_email_address']) ) {
    $_GET['action'] = 'email';
    $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
  }

  if ($_GET['mail_sent_to']) {
    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']. '(' . $_GET['recip_count'] . ')'), 'success');
    $_GET['mail_sent_to'] = '';
  }

  switch ($_GET['action']) {
      case 'set_editor':
        // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
        $action='';
        zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN));
        break;
    case 'confirmdelete':
      // demo active test
      if (zen_admin_demo()) {
        $_GET['action']= '';
        $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
        zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN));
      }

// do not allow change if set to welcome coupon
      if ($_GET['cid'] == NEW_SIGNUP_DISCOUNT_COUPON) {
        $messageStack->add_session(ERROR_DISCOUNT_COUPON_WELCOME, 'caution');
        zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      }

      $db->Execute("update " . TABLE_COUPONS . "
                    set coupon_active = 'N'
                    where coupon_id='".$_GET['cid']."'");
      $messageStack->add_session(SUCCESS_COUPON_DISABLED, 'success');
      zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN));
      break;
    case 'confirmcopy':
      $coupon_copy_to = trim($_POST['coupon_copy_to']);

      // check if new coupon code exists
      $sql = "SELECT * from " . TABLE_COUPONS . " where coupon_code='" . $coupon_copy_to . "'";
      $check_new_coupon = $db->Execute($sql);
      if ($check_new_coupon->RecordCount() > 0) {
        $messageStack->add_session(ERROR_DISCOUNT_COUPON_DUPLICATE . $coupon_copy_to, 'caution');
        zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
      }

      $sql = "SELECT * from " . TABLE_COUPONS . " where coupon_id='" . $_GET['cid'] . "'";
      $check_new_coupon = $db->Execute($sql);

      // create duplicate coupon
        $sql_data_array = array('coupon_code' => zen_db_prepare_input($coupon_copy_to),
                                'coupon_amount' => zen_db_prepare_input($check_new_coupon->fields['coupon_amount']),
                                'coupon_type' => zen_db_prepare_input($check_new_coupon->fields['coupon_type']),
                                'uses_per_coupon' => zen_db_prepare_input((int)$check_new_coupon->fields['uses_per_coupon']),
                                'uses_per_user' => zen_db_prepare_input((int)$check_new_coupon->fields['uses_per_user']),
                                'coupon_minimum_order' => zen_db_prepare_input((float)$check_new_coupon->fields['coupon_minimum_order']),
                                'restrict_to_products' => zen_db_prepare_input($check_new_coupon->fields['restrict_to_products']),
                                'restrict_to_categories' => zen_db_prepare_input($check_new_coupon->fields['restrict_to_categories']),
                                'coupon_start_date' => $check_new_coupon->fields['coupon_start_date'],
                                'coupon_expire_date' => $check_new_coupon->fields['coupon_expire_date'],
                                'date_created' => 'now()',
                                'date_modified' => 'now()',
                                'coupon_zone_restriction' => $check_new_coupon->fields['coupon_zone_restriction']);

          zen_db_perform(TABLE_COUPONS, $sql_data_array);
          $insert_id = $db->Insert_ID();
          $cid = $insert_id;
//          $_GET['cid'] = $cid;

          // create duplicate coupon description
          $sql = "SELECT * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id='" . $_GET['cid'] . "'";
          $new_coupon_descriptions = $db->Execute($sql);

          while (!$new_coupon_descriptions->EOF) {
            $sql_mdata_array = array('coupon_id' => zen_db_prepare_input($cid),
                                    'language_id' => zen_db_prepare_input($new_coupon_descriptions->fields['language_id']),
                                    'coupon_name' => zen_db_prepare_input('COPY: ' . $new_coupon_descriptions->fields['coupon_name']),
                                    'coupon_description' => zen_db_prepare_input($new_coupon_descriptions->fields['coupon_description'])
                                    );
            zen_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_mdata_array);
            $new_coupon_descriptions->MoveNext();
          }

      // copy restrictions
      $sql = "SELECT * from " . TABLE_COUPON_RESTRICT . " where coupon_id='" . $_GET['cid'] . "'";
      $copy_coupon_restrictions = $db->Execute($sql);

      while (!$copy_coupon_restrictions->EOF) {
        $sql_rdata_array = array('coupon_id' => zen_db_prepare_input($cid),
                                 'product_id' => zen_db_prepare_input($copy_coupon_restrictions->fields['product_id']),
                                 'category_id' => zen_db_prepare_input($copy_coupon_restrictions->fields['category_id']),
                                 'coupon_restrict' => zen_db_prepare_input($copy_coupon_restrictions->fields['coupon_restrict'])
                                 );
        zen_db_perform(TABLE_COUPON_RESTRICT, $sql_rdata_array);
        $copy_coupon_restrictions->MoveNext();
      }

      $_GET['cid'] = $cid;
      $messageStack->add_session(SUCCESS_COUPON_DUPLICATE . $coupon_copy_to, 'success');
      zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'action=voucheredit' . '&cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')));
//        zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN));
      break;
    case 'update':
      $update_errors = 0;
      // get all HTTP_POST_VARS and validate
      $_POST['coupon_code'] = trim($_POST['coupon_code']);
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $language_id = $languages[$i]['id'];
          $_POST['coupon_name'][$language_id] = trim($_POST['coupon_name'][$language_id]);
          if (!$_POST['coupon_name'][$language_id]) {
            $update_errors = 1;
            $messageStack->add(ERROR_NO_COUPON_NAME . $languages[$i]['name'], 'error');
          }
          $_POST['coupon_desc'][$language_id] = trim($_POST['coupon_desc'][$language_id]);
        }
      $_POST['coupon_amount'] = trim($_POST['coupon_amount']);
      $_POST['coupon_amount'] = preg_replace('/[^0-9.%]/', '', $_POST['coupon_amount']);
      if (!$_POST['coupon_name']) {
        $update_errors = 1;
        $messageStack->add(ERROR_NO_COUPON_NAME, 'error');
      }
      if ((!$_POST['coupon_amount']) && (!$_POST['coupon_free_ship'])) {
        $update_errors = 1;
        $messageStack->add(ERROR_NO_COUPON_AMOUNT, 'error');
      }
      if (!$_POST['coupon_code']) {
        $coupon_code = create_coupon_code();
      }
      if ($_POST['coupon_code']) $coupon_code = $_POST['coupon_code'];
      $query1 = $db->Execute("select coupon_code
                              from " . TABLE_COUPONS . "
                              where coupon_code = '" . zen_db_prepare_input($coupon_code) . "'");

      if ($query1->RecordCount()>0 && $_POST['coupon_code'] && $_GET['oldaction'] != 'voucheredit')  {
        $update_errors = 1;
        $messageStack->add(ERROR_COUPON_EXISTS, 'error');
      }
      if ($update_errors != 0) {
        $_GET['action'] = 'new';
      } else {
        $_GET['action'] = 'update_preview';
      }
      break;
    case 'update_confirm':
      if ( ($_POST['back_x']) || ($_POST['back_y']) ) {
        $_GET['action'] = 'new';
      } else {
        $coupon_type = "F";
        if (substr($_POST['coupon_amount'], -1) == '%') $coupon_type='P';
        $_POST['coupon_amount'] = preg_replace('/[^0-9.]/', '', $_POST['coupon_amount']);
        if ($_POST['coupon_free_ship']) $coupon_type = 'S';
        $sql_data_array = array('coupon_code' => zen_db_prepare_input($_POST['coupon_code']),
                                'coupon_amount' => zen_db_prepare_input($_POST['coupon_amount']),
                                'coupon_type' => zen_db_prepare_input($coupon_type),
                                'uses_per_coupon' => zen_db_prepare_input((int)$_POST['coupon_uses_coupon']),
                                'uses_per_user' => zen_db_prepare_input((int)$_POST['coupon_uses_user']),
                                'coupon_minimum_order' => zen_db_prepare_input((float)$_POST['coupon_min_order']),
                                'restrict_to_products' => zen_db_prepare_input($_POST['coupon_products']),
                                'restrict_to_categories' => zen_db_prepare_input($_POST['coupon_categories']),
                                'coupon_start_date' => $_POST['coupon_startdate'],
                                'coupon_expire_date' => $_POST['coupon_finishdate'],
                                'date_created' => 'now()',
                                'date_modified' => 'now()',
                                'coupon_zone_restriction' => $_POST['coupon_zone_restriction']);
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $language_id = $languages[$i]['id'];
          $sql_data_marray[$i] = array('coupon_name' => zen_db_prepare_input($_POST['coupon_name'][$language_id]),
                                       'coupon_description' => zen_db_prepare_input($_POST['coupon_desc'][$language_id])
                                       );
        }
        if ($_GET['oldaction']=='voucheredit') {
          zen_db_perform(TABLE_COUPONS, $sql_data_array, 'update', "coupon_id='" . $_GET['cid']."'");
          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $language_id = $languages[$i]['id'];
            $sql_data_desc_array = array('coupon_name' => zen_db_prepare_input($_POST['coupon_name'][$language_id]),
                                         'coupon_description' => zen_db_prepare_input($_POST['coupon_desc'][$language_id])
                                         );
            zen_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_data_desc_array, 'update', "coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $languages[$i]['id'] . "'");
          }
        } else {
          zen_db_perform(TABLE_COUPONS, $sql_data_array);
          $insert_id = $db->Insert_ID();
          $cid = $insert_id;
          $_GET['cid'] = $cid;

          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $language_id = $languages[$i]['id'];
            $sql_data_marray[$i]['coupon_id'] = $insert_id;
            $sql_data_marray[$i]['language_id'] = $language_id;
            zen_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_data_marray[$i]);
          }
        }
      }
      zen_redirect(zen_href_link(FILENAME_COUPON_ADMIN, 'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript">
  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
</script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
<?php if ($_GET['action'] == 'new') { ?>
    if (typeof _editor_url == "string") HTMLArea.replaceAll();
<?php } else { ?>
    if (typeof _editor_url == "string") HTMLArea.replace('message_html');
<?php } ?>
  }
  // -->
</script>
<script language="javascript" type="text/javascript"><!--
var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_select(field_name, field_default, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == field_default) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}
function check_message(msg) {
  if (form.elements['message'] && form.elements['message_html']) {
    var field_value1 = form.elements['message'].value;
    var field_value2 = form.elements['message_html'].value;

    if ((field_value1 == '' || field_value1.length < 3) && (field_value2 == '' || field_value2.length < 3)) {
      error_message = error_message + "* " + msg + "\n";
      error = true;
    }
  }
}
function check_input(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == '' || field_value.length < field_size) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_form(form_name) {
  if (submitted == true) {
    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
    return false;
  }
  error = false;
  form = form_name;
  error_message = "<?php echo JS_ERROR; ?>";

  check_select('customers_email_address', '', "<?php echo ERROR_NO_CUSTOMER_SELECTED; ?>");
  check_message("<?php echo ENTRY_NOTHING_TO_SEND; ?>");
  check_input('subject','',"<?php echo ERROR_NO_SUBJECT; ?>");

  if (error == true) {
    alert(error_message);
    return false;
  } else {
    submitted = true;
    return true;
  }
}
//--></script>
<?php if ($editor_handler != '') include ($editor_handler); ?>
</head>
<body onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
<?php
  switch ($_GET['action']) {
  case 'voucherreport':
?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo CUSTOMER_ID; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo CUSTOMER_NAME; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo IP_ADDRESS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo REDEEM_DATE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
    $cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $_GET['cid'] . "'";
    $cc_split = new splitPageResults($_GET['reports_page'], MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS_REPORTS, $cc_query_raw, $cc_query_numrows);
    $cc_list = $db->Execute($cc_query_raw);
    while (!$cc_list->EOF) {
      $rows++;
      if (strlen($rows) < 2) {
        $rows = '0' . $rows;
      }
      if (((!$_GET['uid']) || (@$_GET['uid'] == $cc_list->fields['unique_id'])) && (!$cInfo)) {
        $cInfo = new objectInfo($cc_list->fields);
      }
      if ( (is_object($cInfo)) && ($cc_list->fields['unique_id'] == $cInfo->unique_id) ) {
        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUPON_ADMIN, zen_get_all_get_params(array('cid', 'action', 'uid')) . 'cid=' . $cInfo->coupon_id . '&action=voucherreport&uid=' . $cinfo->unique_id) . '\'">' . "\n";
      } else {
        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUPON_ADMIN, zen_get_all_get_params(array('cid', 'action', 'uid')) . 'cid=' . $cc_list->fields['coupon_id'] . '&action=voucherreport&uid=' . $cc_list->fields['unique_id']) . '\'">' . "\n";
      }
$customer = $db->Execute("select customers_firstname, customers_lastname
                          from " . TABLE_CUSTOMERS . "
                          where customers_id = '" . $cc_list->fields['customer_id'] . "'");

?>
                <td class="dataTableContent"><?php echo $cc_list->fields['customer_id']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $cc_list->fields['redeem_ip']; ?></td>
                <td class="dataTableContent" align="center"><?php echo zen_date_short($cc_list->fields['redeem_date']); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($cc_list->fields['unique_id'] == $cInfo->unique_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'reports_page=' . $_GET['reports_page'] . '&cid=' . $cc_list->fields['coupon_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $cc_list->MoveNext();
    }
?>
          <tr>
            <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="smallText">&nbsp;<?php echo $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS_REPORTS, $_GET['reports_page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?>&nbsp;</td>
                <td align="right" class="smallText">&nbsp;<?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS_REPORTS, MAX_DISPLAY_PAGE_LINKS, $_GET['reports_page'], 'action=voucherreport&cid=' . $cInfo->coupon_id, 'reports_page'); ?>&nbsp;</td>
              </tr>

              <tr>
                <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . (!empty($cInfo->coupon_id) ? $cInfo->coupon_id : $_GET['cid']) . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
              </tr>
            </table></td>
          </tr>
             </table></td>
<?php
    $heading = array();
    $contents = array();
      $coupon_desc = $db->Execute("select coupon_name
                                   from " . TABLE_COUPONS_DESCRIPTION . "
                                   where coupon_id = '" . $_GET['cid'] . "'
                                   and language_id = '" . $_SESSION['languages_id'] . "'");
      $count_customers = $db->Execute("select * from " . TABLE_COUPON_REDEEM_TRACK . "
                                       where coupon_id = '" . $_GET['cid'] . "'
                                       and customer_id = '" . $cInfo->customer_id . "'");

      $heading[] = array('text' => '<b>[' . $_GET['cid'] . ']' . COUPON_NAME . ' ' . $coupon_desc->fields['coupon_name'] . '</b>');
      $contents[] = array('text' => '<b>' . TEXT_REDEMPTIONS . '</b>');
//      $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_list->RecordCount());
      $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_query_numrows);
      $contents[] = array('text' => TEXT_REDEMPTIONS_CUSTOMER . '=' . $count_customers->RecordCount());
      $contents[] = array('text' => '');
?>
    <td width="25%" valign="top">
<?php
      $box = new box;
      echo $box->infoBox($heading, $contents);
      echo '            </td>' . "\n";
?>
<?php
    break;
  case 'preview_email':
    $coupon_result = $db->Execute("select coupon_code
                                   from " .TABLE_COUPONS . "
                                   where coupon_id = '" . $_GET['cid'] . "'");

    $coupon_name = $db->Execute("select coupon_name
                                 from " . TABLE_COUPONS_DESCRIPTION . "
                                 where coupon_id = '" . $_GET['cid'] . "'
                                 and language_id = '" . $_SESSION['languages_id'] . "'");

    $audience_select = get_audience_sql_query($_POST['customers_email_address']);
    $mail_sent_to = $audience_select['query_name'];

?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr><?php echo zen_draw_form('mail', FILENAME_COUPON_ADMIN, 'action=send_email_to_user&cid=' . $_GET['cid']); ?>
            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br /><?php echo $mail_sent_to; ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_COUPON; ?></b><br /><?php echo $coupon_name->fields['coupon_name']; ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br /><?php echo htmlspecialchars(stripslashes($_POST['from'])); ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br /><?php echo htmlspecialchars(stripslashes($_POST['subject'])); ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td><hr /><b><?php echo TEXT_RICH_TEXT_MESSAGE; ?></b><br /><?php echo stripslashes($_POST['message_html']); ?></td>
              </tr>
              <tr>
                <td ><hr /><b><?php echo TEXT_MESSAGE; ?></b><br /><tt><?php echo nl2br(htmlspecialchars(stripslashes($_POST['message']))); ?></tt><hr /></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td>
<?php
/* Re-Post all POST'ed variables */
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if (!is_array($_POST[$key])) {
        echo zen_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
      }
    }
?>
                <table border="0" width="100%" cellpadding="0" cellspacing="2">
                  <tr>
                    <td><?php ?>&nbsp;</td>
                    <td align="right"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN,  'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </form></tr>
<?php
    break;
  case 'email':
    $coupon_result = $db->Execute("select coupon_code
                                   from " . TABLE_COUPONS . "
                                   where coupon_id = '" . $_GET['cid'] . "'");
    $coupon_name = $db->Execute("select coupon_name
                                 from " . TABLE_COUPONS_DESCRIPTION . "
                                 where coupon_id = '" . $_GET['cid'] . "'
                                 and language_id = '" . $_SESSION['languages_id'] . "'");
?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr><?php echo zen_draw_form('mail', FILENAME_COUPON_ADMIN, 'action=preview_email&cid='. $_GET['cid'],'post', 'onsubmit="return check_form(mail);"'); ?>
            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo TEXT_COUPON; ?>&nbsp;&nbsp;</td>
                <td><?php echo $coupon_name->fields['coupon_name']; ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
<?php
    $customers = get_audiences_list('email');
?>
              <tr>
                <td class="main"><?php echo TEXT_CUSTOMER; ?>&nbsp;&nbsp;</td>
                <td><?php echo zen_draw_pull_down_menu('customers_email_address', $customers, $_GET['customer']);?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo TEXT_FROM; ?>&nbsp;&nbsp;</td>
                <td><?php echo zen_draw_input_field('from', EMAIL_FROM, 'size="50"'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
<?php
/*
              <tr>
                <td class="main"><?php echo TEXT_RESTRICT; ?>&nbsp;&nbsp;</td>
                <td><?php echo zen_draw_checkbox_field('customers_restrict', $customers_restrict);?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
*/
?>
              <tr>
                <td class="main"><?php echo TEXT_SUBJECT; ?>&nbsp;&nbsp;</td>
                <td><?php echo zen_draw_input_field('subject', '', 'size="50"'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_RICH_TEXT_MESSAGE; ?></td>
                <td>
<?php   if (EMAIL_USE_HTML == 'true') {
              if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                $oFCKeditor = new FCKeditor('message_html') ;
                $oFCKeditor->Value = ($_POST['message_html']=='') ? TEXT_COUPON_ANNOUNCE : stripslashes($_POST['message_html']) ;
                $oFCKeditor->Width  = '97%' ;
                $oFCKeditor->Height = '250' ;
//                $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
//                $oFCKeditor->Create() ;
                $output = $oFCKeditor->CreateHtml() ; echo $output;
        } else { // using HTMLAREA or just raw "source"
          echo zen_draw_textarea_field('message_html', 'soft', '100%', '25', ($_POST['message_html']=='') ? TEXT_COUPON_ANNOUNCE : stripslashes($_POST['message_html']), 'id="message_html"');
        }
} ?>
                </td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?>&nbsp;&nbsp;</td>
                <td><?php echo zen_draw_textarea_field('message', 'soft', '60', '15', strip_tags(($_POST['message_html']=='') ? TEXT_COUPON_ANNOUNCE : stripslashes($_POST['message_html']))); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td colspan="2" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' .  zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
              </tr>
            </table></td>
          </form></tr>
  </table></td>
<?php
    break;
  case 'update_preview':
?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
      <td>
<?php echo zen_draw_form('coupon', FILENAME_COUPON_ADMIN, 'action=update_confirm&oldaction=' . $_GET['oldaction'] . '&cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>
      <table border="0" width="100%" cellspacing="0" cellpadding="6">
        <tr>
          <td align="left" class="main"><?php echo COUPON_ZONE_RESTRICTION; ?></td>
          <td align="left" class="main"><?php echo zen_get_geo_zone_name($_POST['coupon_zone_restriction']); ?>
        </tr>
<?php
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $language_id = $languages[$i]['id'];
?>
      <tr>
        <td align="left"><?php echo COUPON_NAME; ?></td>
        <td align="left"><?php echo zen_db_prepare_input($_POST['coupon_name'][$language_id]); ?></td>
      </tr>
<?php
}
?>
<?php
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $language_id = $languages[$i]['id'];
?>
      <tr>
        <td align="left"><?php echo COUPON_DESC; ?></td>
        <td align="left"><?php echo zen_db_prepare_input($_POST['coupon_desc'][$language_id]); ?></td>
      </tr>
<?php
}
?>
      <tr>
        <td align="left"><?php echo COUPON_AMOUNT; ?></td>
        <td align="left"><?php echo zen_db_prepare_input($_POST['coupon_amount']); ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_MIN_ORDER; ?></td>
        <td align="left"><?php echo zen_db_prepare_input($_POST['coupon_min_order']); ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_FREE_SHIP; ?></td>
<?php
    if ($_POST['coupon_free_ship']) {
?>
        <td align="left"><?php echo TEXT_FREE_SHIPPING; ?></td>
<?php
    } else {
?>
        <td align="left"><?php echo TEXT_NO_FREE_SHIPPING; ?></td>
<?php
    }
?>
      </tr>
      <tr>
        <td align="left"><?php echo COUPON_CODE; ?></td>
<?php
    if ($_POST['coupon_code']) {
      $c_code = $_POST['coupon_code'];
    } else {
      $c_code = $coupon_code;
    }
?>
        <td align="left"><?php echo $coupon_code; ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_USES_COUPON; ?></td>
        <td align="left"><?php echo $_POST['coupon_uses_coupon']; ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_USES_USER; ?></td>
        <td align="left"><?php echo $_POST['coupon_uses_user']; ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_STARTDATE; ?></td>
<?php
    $start_date = date(DATE_FORMAT, mktime(0, 0, 0, $_POST['coupon_startdate_month'],$_POST['coupon_startdate_day'] ,$_POST['coupon_startdate_year'] ));
?>
        <td align="left"><?php echo $start_date; ?></td>
      </tr>

      <tr>
        <td align="left"><?php echo COUPON_FINISHDATE; ?></td>
<?php
    $finish_date = date(DATE_FORMAT, mktime(0, 0, 0, $_POST['coupon_finishdate_month'],$_POST['coupon_finishdate_day'] ,$_POST['coupon_finishdate_year'] ));
?>
        <td align="left"><?php echo $finish_date; ?></td>
      </tr>
<?php
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $language_id = $languages[$i]['id'];
          echo zen_draw_hidden_field('coupon_name[' . $languages[$i]['id'] . ']', stripslashes($_POST['coupon_name'][$language_id]));
          echo zen_draw_hidden_field('coupon_desc[' . $languages[$i]['id'] . ']', stripslashes($_POST['coupon_desc'][$language_id]));
       }
    echo zen_draw_hidden_field('coupon_amount', $_POST['coupon_amount']);
    echo zen_draw_hidden_field('coupon_min_order', $_POST['coupon_min_order']);
    echo zen_draw_hidden_field('coupon_free_ship', $_POST['coupon_free_ship']);
    echo zen_draw_hidden_field('coupon_code', stripslashes($c_code));
    echo zen_draw_hidden_field('coupon_uses_coupon', $_POST['coupon_uses_coupon']);
    echo zen_draw_hidden_field('coupon_uses_user', $_POST['coupon_uses_user']);
    echo zen_draw_hidden_field('coupon_products', $_POST['coupon_products']);
    echo zen_draw_hidden_field('coupon_categories', $_POST['coupon_categories']);
    echo zen_draw_hidden_field('coupon_startdate', date('Y-m-d', mktime(0, 0, 0, $_POST['coupon_startdate_month'],$_POST['coupon_startdate_day'] ,$_POST['coupon_startdate_year'] )));
    echo zen_draw_hidden_field('coupon_finishdate', date('Y-m-d', mktime(0, 0, 0, $_POST['coupon_finishdate_month'],$_POST['coupon_finishdate_day'] ,$_POST['coupon_finishdate_year'] )));
    echo zen_draw_hidden_field('coupon_zone_restriction', $_POST['coupon_zone_restriction']);
?>
     <tr>
        <td align="left"><?php echo zen_image_submit('button_confirm.gif',COUPON_BUTTON_CONFIRM, (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?></td>
        <td align="left"><?php echo zen_image_submit('button_cancel.gif',COUPON_BUTTON_CANCEL, 'name=back'); ?></td>
      </td>
      </tr>

      </td></table></form>
      </tr>

      </table></td>
<?php

    break;
  case 'voucheredit':
    $languages = zen_get_languages();
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
      $language_id = $languages[$i]['id'];
      $coupon = $db->Execute("select coupon_name,coupon_description
                              from " . TABLE_COUPONS_DESCRIPTION . "
                              where coupon_id = '" .  $_GET['cid'] . "'
                              and language_id = '" . $language_id . "'");

      $_POST['coupon_name'][$language_id] = $coupon->fields['coupon_name'];
      $_POST['coupon_desc'][$language_id] = $coupon->fields['coupon_description'];
    }

    $coupon = $db->Execute("select coupon_code, coupon_amount, coupon_type, coupon_minimum_order,
                                   coupon_start_date, coupon_expire_date, uses_per_coupon,
                                   uses_per_user, restrict_to_products, restrict_to_categories, coupon_zone_restriction
                            from " . TABLE_COUPONS . "
                            where coupon_id = '" . $_GET['cid'] . "'");

    $_POST['coupon_amount'] = $coupon->fields['coupon_amount'];
    if ($coupon->fields['coupon_type']=='P') {
      $_POST['coupon_amount'] .= '%';
    }
    if ($coupon->fields['coupon_type']=='S') {
      $_POST['coupon_free_ship'] = true;
    } else {
      $_POST['coupon_free_ship'] = false;
    }
    $_POST['coupon_min_order'] = $coupon->fields['coupon_minimum_order'];
    $_POST['coupon_code'] = $coupon->fields['coupon_code'];
    $_POST['coupon_uses_coupon'] = $coupon->fields['uses_per_coupon'];
    $_POST['coupon_uses_user'] = $coupon->fields['uses_per_user'];
    $_POST['coupon_startdate'] = $coupon->fields['coupon_start_date'];
    $_POST['coupon_finishdate'] = $coupon->fields['coupon_expire_date'];
    $_POST['coupon_zone_restriction'] = $coupon->fields['coupon_zone_restriction'];

  case 'new':
// set some defaults
    if ($_GET['action'] != 'voucheredit' and $_POST['coupon_uses_user'] == '') $_POST['coupon_uses_user'] = 1;
?>
      <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
      <td>
<?php
    echo zen_draw_form('coupon', FILENAME_COUPON_ADMIN, 'action=update&oldaction=' . $_GET['action'] . '&cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''));
?>
      <table border="0" width="100%" cellspacing="0" cellpadding="6">
<?php
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        $language_id = $languages[$i]['id'];
?>
      <tr>
        <td align="left" class="main"><?php if ($i==0) echo COUPON_NAME; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_name[' . $languages[$i]['id'] . ']', stripslashes($_POST['coupon_name'][$language_id])) . '&nbsp;' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?></td>
        <td align="left" class="main" width="40%"><?php if ($i==0) echo COUPON_NAME_HELP; ?></td>
      </tr>
<?php
}
?>
<?php
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        $language_id = $languages[$i]['id'];
?>

      <tr>
        <td align="left" valign="top" class="main"><?php if ($i==0) echo COUPON_DESC; ?></td>
        <td align="left" valign="top"><?php
            if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                $oFCKeditor = new FCKeditor('coupon_desc[' . $languages[$i]['id'] . ']') ;
                $oFCKeditor->Value = (stripslashes($_POST['coupon_desc'][$language_id]) != '') ? stripslashes($_POST['coupon_desc'][$language_id]) : '';
                $oFCKeditor->Width  = '97%' ;
                $oFCKeditor->Height = '200' ;
//                $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
                $output = $oFCKeditor->CreateHtml() ; echo $output;
            } else { // using HTMLAREA or just raw "source"
              echo zen_draw_textarea_field('coupon_desc[' . $languages[$i]['id'] . ']','physical','24','8', stripslashes($_POST['coupon_desc'][$language_id]));
            }
            echo '&nbsp;' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?></td>
        <td align="left" valign="top" class="main"><?php if ($i==0) echo COUPON_DESC_HELP; ?></td>
      </tr>
<?php
}
?>
      <tr>
        <td align="left" class="main"><?php echo COUPON_AMOUNT; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_amount', $_POST['coupon_amount']); ?></td>
        <td align="left" class="main"><?php echo COUPON_AMOUNT_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_MIN_ORDER; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_min_order', $_POST['coupon_min_order']); ?></td>
        <td align="left" class="main"><?php echo COUPON_MIN_ORDER_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_FREE_SHIP; ?></td>
        <td align="left"><input type="checkbox" name="coupon_free_ship" <?php if ($_POST['coupon_free_ship']) echo 'CHECKED'; ?>></td>
        <td align="left" class="main"><?php echo COUPON_FREE_SHIP_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_CODE; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_code', $_POST['coupon_code']); ?></td>
        <td align="left" class="main"><?php echo COUPON_CODE_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_USES_COUPON; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_uses_coupon', ($_POST['coupon_uses_coupon'] >= 1 ? $_POST['coupon_uses_coupon'] : '')); ?></td>
        <td align="left" class="main"><?php echo COUPON_USES_COUPON_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_USES_USER; ?></td>
        <td align="left"><?php echo zen_draw_input_field('coupon_uses_user', ($_POST['coupon_uses_user'] >= 1 ? $_POST['coupon_uses_user'] : '')); ?></td>
        <td align="left" class="main"><?php echo COUPON_USES_USER_HELP; ?></td>
      </tr>
      <tr>
<?php
    if (!$_POST['coupon_startdate']) {
      $coupon_startdate = preg_split("/[-]/", date('Y-m-d'));
    } else {
      $coupon_startdate = preg_split("/[-]/", $_POST['coupon_startdate']);
    }
    if (!$_POST['coupon_finishdate']) {
      $coupon_finishdate = preg_split("/[-]/", date('Y-m-d'));
      $coupon_finishdate[0] = $coupon_finishdate[0] + 1;
    } else {
      $coupon_finishdate = preg_split("/[-]/", $_POST['coupon_finishdate']);
    }
?>
        <td align="left" class="main"><?php echo COUPON_STARTDATE; ?></td>
        <td align="left"><?php echo zen_draw_date_selector('coupon_startdate', mktime(0,0,0, $coupon_startdate[1], $coupon_startdate[2], $coupon_startdate[0], 0)); ?></td>
        <td align="left" class="main"><?php echo COUPON_STARTDATE_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_FINISHDATE; ?></td>
        <td align="left"><?php echo zen_draw_date_selector('coupon_finishdate', mktime(0,0,0, $coupon_finishdate[1], $coupon_finishdate[2], $coupon_finishdate[0], 0)); ?></td>
        <td align="left" class="main"><?php echo COUPON_FINISHDATE_HELP; ?></td>
      </tr>
      <tr>
        <td align="left" class="main"><?php echo COUPON_ZONE_RESTRICTION; ?></td>
        <td align="left" class="main"><?php echo zen_geo_zones_pull_down_coupon('name="coupon_zone_restriction" style="font-size:10px"', $_POST['coupon_zone_restriction']); ?>
        <td align="left" class="main"><?php echo TEXT_COUPON_ZONE_RESTRICTION; ?></td>
      </tr>
      <tr>
        <td align="left"><?php echo zen_image_submit('button_preview.gif',COUPON_BUTTON_PREVIEW); ?></td>
        <td align="left">&nbsp;&nbsp;<a href="<?php echo zen_href_link(FILENAME_COUPON_ADMIN, 'cid=' . $_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')); ?>"><?php echo zen_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>
      </td>
      </tr>
      </td></table></form>
      </tr>

      </table></td>
<?php
    break;
  default:
?>
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="main"><?php echo zen_draw_form('status', FILENAME_COUPON_ADMIN, '', 'get'); ?>
<?php
    $status_array[] = array('id' => 'Y', 'text' => TEXT_COUPON_ACTIVE);
    $status_array[] = array('id' => 'N', 'text' => TEXT_COUPON_INACTIVE);
    $status_array[] = array('id' => '*', 'text' => TEXT_COUPON_ALL);

    if ($_GET['status']) {
      $status = zen_db_prepare_input($_GET['status']);
    } else {
      $status = 'Y';
    }

    echo zen_hide_session_id();
    echo HEADING_TITLE_STATUS . ' ' . zen_draw_pull_down_menu('status', $status_array, $status, 'onChange="this.form.submit();"') .
    zen_draw_hidden_field('page', $_GET['page']);
?>
              </form>
           </td>
            <td class="main">
<?php
// toggle switch for editor
        echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_COUPON_ADMIN, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') .
        zen_hide_session_id() .
        zen_draw_hidden_field('action', 'set_editor') .
        '</form>';
?>
</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo COUPON_NAME; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_AMOUNT; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_CODE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_ACTIVE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_START_DATE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo COUPON_EXPIRE_DATE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
    if ($_GET['page'] > 1) $rows = $_GET['page'] * 20 - 20;
    if ($status != '*') {
      $cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS ." where coupon_active='" . zen_db_input($status) . "' and coupon_type != 'G'";
    } else {
      $cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS . " where coupon_type != 'G'";
    }
    $cc_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, $cc_query_raw, $cc_query_numrows);
    $cc_list = $db->Execute($cc_query_raw);
    while (!$cc_list->EOF) {
      $rows++;
      if (strlen($rows) < 2) {
        $rows = '0' . $rows;
      }
      if (((!$_GET['cid']) || (@$_GET['cid'] == $cc_list->fields['coupon_id'])) && (!$cInfo)) {
        $cInfo = new objectInfo($cc_list->fields);
      }
      if ( (is_object($cInfo)) && ($cc_list->fields['coupon_id'] == $cInfo->coupon_id) ) {
        echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUPON_ADMIN, zen_get_all_get_params(array('cid', 'action')) . 'cid=' . $cInfo->coupon_id . '&action=voucheredit') . '\'">' . "\n";
      } else {
        echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link(FILENAME_COUPON_ADMIN, zen_get_all_get_params(array('cid', 'action')) . 'cid=' . $cc_list->fields['coupon_id']) . '\'">' . "\n";
      }
      $coupon_desc = $db->Execute("select coupon_name
                                   from " . TABLE_COUPONS_DESCRIPTION . "
                                   where coupon_id = '" . $cc_list->fields['coupon_id'] . "'
                                   and language_id = '" . $_SESSION['languages_id'] . "'");
?>
                <td class="dataTableContent"><?php echo $coupon_desc->fields['coupon_name']; ?></td>
                <td class="dataTableContent" align="center">
<?php
      if ($cc_list->fields['coupon_type'] == 'P') {
        echo $cc_list->fields['coupon_amount'] . '%';
      } elseif ($cc_list->fields['coupon_type'] == 'S') {
        echo TEXT_FREE_SHIPPING;
      } else {
        echo $currencies->format($cc_list->fields['coupon_amount']);
      }
?>
            &nbsp;</td>
                <td class="dataTableContent" align="center"><?php echo $cc_list->fields['coupon_code']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $cc_list->fields['coupon_active']; ?></td>
                <td class="dataTableContent" align="center"><?php echo zen_date_short($cc_list->fields['coupon_start_date']); ?></td>
                <td class="dataTableContent" align="center"><?php echo zen_date_short($cc_list->fields['coupon_expire_date']); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($cc_list->fields['coupon_id'] == $cInfo->coupon_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . $cc_list->fields['coupon_id'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $cc_list->MoveNext();
    }
?>
          <tr>
            <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="smallText">&nbsp;<?php echo $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?>&nbsp;</td>
                <td align="right" class="smallText">&nbsp;<?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')); ?>&nbsp;</td>
              </tr>

              <tr>
                <td align="right" colspan="2" class="smallText"><?php echo '<a name="couponInsert" href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . $cInfo->coupon_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>

<?php

    $heading = array();
    $contents = array();

    switch ($_GET['action']) {
    case 'release':
      break;
    case 'voucherreport':
      $heading[] = array('text' => '<b>' . TEXT_HEADING_COUPON_REPORT . '</b>');
      $contents[] = array('text' => TEXT_NEW_INTRO);
      break;
    case 'new':
      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_COUPON . '</b>');
      $contents[] = array('text' => TEXT_NEW_INTRO);
      $contents[] = array('text' => '<br />' . COUPON_NAME . '<br />' . zen_draw_input_field('name'));
      $contents[] = array('text' => '<br />' . COUPON_AMOUNT . '<br />' . zen_draw_input_field('voucher_amount'));
      $contents[] = array('text' => '<br />' . COUPON_CODE . '<br />' . zen_draw_input_field('voucher_code'));
      $contents[] = array('text' => '<br />' . COUPON_USES_COUPON . '<br />' . zen_draw_input_field('voucher_number_of'));
      break;
    default:
      $heading[] = array('text'=>'['.$cInfo->coupon_id.']  '.$cInfo->coupon_code);
      $amount = $cInfo->coupon_amount;
      if ($cInfo->coupon_type == 'P') {
        $amount .= '%';
      } else {
        $amount = $currencies->format($amount);
      }
      if ($_GET['action'] == 'voucherdelete' or $_GET['action'] == 'vouchercopy') {
        if ($_GET['action'] == 'voucherdelete') {
          $contents[] = array('text'=> TEXT_CONFIRM_DELETE . '</br></br>' .
                  '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=confirmdelete&cid='.$_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_confirm.gif','Confirm Delete ' . TEXT_DISCOUNT_COUPON).'</a>' .
                  '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_cancel.gif','Cancel').'</a>'
                  );
        }
        if ($_GET['action'] == 'vouchercopy') {
          $contents = array('form' => zen_draw_form('new_coupon', FILENAME_COUPON_ADMIN, 'action=confirmcopy' . '&cid='.$_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'post', 'enctype="multipart/form-data"'));

          $contents[] = array('text' => '<br>' . TEXT_COUPON_NEW . '&nbsp;' . zen_draw_input_field('coupon_copy_to', '', 6, 6));

          $contents[] = array('text'=> TEXT_CONFIRM_COPY . '</br>');
          $contents[] = array('text'=> zen_image_submit('button_save.gif', IMAGE_SAVE));
          $contents[] = array('text'=>
                  '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_cancel.gif','Cancel').'</a>'
                  );
/*
          $contents[] = array('text'=>
                  '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=confirmcopy&cid='.$_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&coupon_copy_to=' . $_GET['coupon_copy_to'] . '-' . $_POST['coupon_copy_to'] . '-' . $coupon_copy_to,'NONSSL').'">'.zen_image_button('button_confirm.gif','Confirm Copy ' . TEXT_DISCOUNT_COUPON).'</a>' .


                  '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_cancel.gif','Cancel').'</a>'
                  );
*/


        }
      } else {
        $prod_details = TEXT_NONE;
//bof 12-6ke
$product_query = $db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $cInfo->coupon_id . "' and product_id != '0'");        if ($product_query->RecordCount() > 0) $prod_details = TEXT_SEE_RESTRICT;
//eof 12-6ke
        $cat_details = TEXT_NONE;
//bof 12-6ke
$category_query = $db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $cInfo->coupon_id . "' and category_id != '0'");        if ($category_query->RecordCount() > 0) $cat_details = TEXT_SEE_RESTRICT;
//eof 12-6ke
        $coupon_name = $db->Execute("select coupon_name
                                     from " . TABLE_COUPONS_DESCRIPTION . "
                                     where coupon_id = '" . $cInfo->coupon_id . "'
                                     and language_id = '" . $_SESSION['languages_id'] . "'");
        $uses_coupon = $cInfo->uses_per_coupon;
        $uses_user = $cInfo->uses_per_user;
        if ($uses_coupon == 0 || $uses_coupon == '') $uses_coupon = TEXT_UNLIMITED;
        if ($uses_user == 0 || $uses_user == '') $uses_user = TEXT_UNLIMITED;
        $contents[] = array('text'=>COUPON_NAME . '&nbsp;::&nbsp; ' . $coupon_name->fields['coupon_name'] . '<br />' .
                     COUPON_AMOUNT . '&nbsp;::&nbsp; ' . $amount . '<br />' .
                     COUPON_STARTDATE . '&nbsp;::&nbsp; ' . zen_date_short($cInfo->coupon_start_date) . '<br />' .
                     COUPON_FINISHDATE . '&nbsp;::&nbsp; ' . zen_date_short($cInfo->coupon_expire_date) . '<br />' .
                     COUPON_USES_COUPON . '&nbsp;::&nbsp; ' . $uses_coupon . '<br />' .
                     COUPON_USES_USER . '&nbsp;::&nbsp; ' . $uses_user . '<br />' .
                     COUPON_PRODUCTS . '&nbsp;::&nbsp; ' . $prod_details . '<br />' .
                     COUPON_CATEGORIES . '&nbsp;::&nbsp; ' . $cat_details . '<br />' .
                     DATE_CREATED . '&nbsp;::&nbsp; ' . zen_date_short($cInfo->date_created) . '<br />' .
                     DATE_MODIFIED . '&nbsp;::&nbsp; ' . zen_date_short($cInfo->date_modified) . '<br /><br />' .
                     COUPON_ZONE_RESTRICTION . '&nbsp;::&nbsp; ' . zen_get_geo_zone_name($cInfo->coupon_zone_restriction) . '<br /><br />' .
                     ($cInfo->coupon_id != '' ?
                     '<center><a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=email&cid='.$cInfo->coupon_id,'NONSSL').'">'.zen_image_button('button_email.gif','Email ' . TEXT_DISCOUNT_COUPON).'</a>' .
                     '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=voucheredit&cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_edit.gif','Edit ' . TEXT_DISCOUNT_COUPON) .'</a>' .
                     '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=voucherdelete&cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_delete.gif','Delete ' . TEXT_DISCOUNT_COUPON).'</a>' .
                     '<br /><a href="'.zen_href_link('coupon_restrict.php','cid='.$cInfo->coupon_id  . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_restrict.gif','Restrict').'</a><a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=voucherreport&cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_report.gif',TEXT_DISCOUNT_COUPON . ' Report').
                     '<a href="'.zen_href_link(FILENAME_COUPON_ADMIN,'action=vouchercopy&cid='.$cInfo->coupon_id . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''),'NONSSL').'">'.zen_image_button('button_copy.gif','Copy ' . TEXT_DISCOUNT_COUPON) . '</a></center>'
                     : ' who ' . $cInfo->coupon_id . ' - ' . $_GET['cid'])
                     );
        }
        break;
      }
?>
    <td width="25%" valign="top">
<?php
      $box = new box;
      echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
    }
?>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       adminhome/coupon_restrict.php                                                                       0000755 0001012 0001007 00000055703 11360331530 017126  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: coupon_restrict.php 15881 2010-04-11 16:32:39Z wilt $
 */
  //define('MAX_DISPLAY_RESTRICT_ENTRIES', 10);
  require('includes/application_top.php');
  $restrict_array = array();
  $restrict_array[] = array('id'=>'Deny', text=>'Deny');
  $restrict_array[] = array('id'=>'Allow', text=>'Allow');

  $the_path = $_POST['cPath'];
  if ($_GET['action']=='switch_status') {
    $status = $db->Execute("select coupon_restrict
                            from " . TABLE_COUPON_RESTRICT . "
                            where restrict_id = '" . $_GET['info'] . "'");

    $new_status = 'N';
    if ($status->fields['coupon_restrict'] == 'N') $new_status = 'Y';
    $db->Execute("update " . TABLE_COUPON_RESTRICT . "
                  set coupon_restrict = '" . $new_status . "'
                  where restrict_id = '" . $_GET['info'] . "'");
  }
  if ($_GET['action']=='add_category' && isset($_POST['cPath'])) {
  	if ($_POST['cPath'] == 0) $_POST['cPath'] = -1;
    $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . "
                              where coupon_id = '" . $_GET['cid'] . "'
                              and category_id = '" . $_POST['cPath'] . "'");

    if ($test_query->RecordCount() < 1) {
      $status = 'N';
      if ($_POST['restrict_status']=='Deny') $status = 'Y';
      $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
                  (coupon_id, category_id, coupon_restrict)
                  values ('" . $_GET['cid'] . "', '" . $_POST['cPath'] . "', '" . $status . "')");
    } else {
      // message that nothing is done
      $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
    }
  }


// from products dropdown selection
  if ($_GET['action']=='add_product' && $_POST['products_drop']) {
    $test_query=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id = '" . $_POST['products_drop'] . "'");
    if ($test_query->RecordCount() < 1) {
      $status = 'N';
      if ($_POST['restrict_status']=='Deny') $status = 'Y';

// ==================================
// bof: ALL ADD/DELETE of Products in one Category
        if ($_POST['products_drop'] < 0) {
        // adding new records
          if ($_POST['products_drop'] == -1) {
          // to insert new products from a given categories_id for a coupon_code that are not already in the table
          // products in the table from the catategories_id are skipped
            $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id not in (select product_id from coupon_restrict where coupon_id = '" . $_GET['cid'] . "')";
            $new_products = $db->Execute($new_products_query);
          }

          if ($_POST['products_drop'] == -2) {
          // to delete existing products from a given categories_id for a coupon_code that are already in the table
          // products in the table from the catategories_id are skipped
            $new_products_query = "select products_id from products_to_categories where categories_id = '" . $_GET['build_cat'] . "' and products_id in (select product_id from coupon_restrict where coupon_restrict = '" . $status . "' and coupon_id = '" . $_GET['cid'] . "')";
            $new_products = $db->Execute($new_products_query);
          }

          // nothing to be done
          if ($new_products->RecordCount() == 0) {
            $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_CATEGORY . ' ' . $_POST['cPath'], 'caution');
          }
          while(!$new_products->EOF) {
            // product passed and needs to be added/deleted
            // add all products from select category for each product not already defined in coupons_restrict
            if ($_POST['products_drop'] == -1) {
              $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
                          (coupon_id, product_id, coupon_restrict)
                          values ('" . $_GET['cid'] . "', '" . $new_products->fields['products_id'] . "', '" . $status . "')");
            } else {
            // removed as defined in coupons_restrict for either DENY or ALLOW
              $db->Execute("delete from " . TABLE_COUPON_RESTRICT . "
                            WHERE coupon_id = '" . $_GET['cid'] . "'
                            and product_id = '" . $new_products->fields['products_id'] . "'
                            and coupon_restrict = '" . $status . "'");
            }

            $new_products->MoveNext();
          }
// eof: ALL ADD/DELETE of Products in one Category
// ==================================

      } else {
// normal insert of product one by one allow/deny to coupon
      $db->Execute("insert into " . TABLE_COUPON_RESTRICT . "
                  (coupon_id, product_id, coupon_restrict)
                  values ('" . $_GET['cid'] . "', '" . $_POST['products_drop'] . "', '" . $status . "')");
      } // not all deny allow
    } else {
      $messageStack->add(ERROR_DISCOUNT_COUPON_DEFINED_PRODUCT . ' ' . $_POST['products_drop'], 'caution');
    }
  }
  if ($_GET['action']=='remove' && $_GET['info']) {
    $db->Execute("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = '" . $_GET['info'] . "'");
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="pageHeading"><?php echo HEADING_TITLE_CATEGORY; ?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr class="dataTableHeadingRow">
                    <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_ID; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_CATEGORY_NAME; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
                  </tr>
<?php
    $cr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and category_id != '0'";
    $cr_split = new splitPageResults($_GET['cpage'], MAX_DISPLAY_RESTRICT_ENTRIES, $cr_query_raw, $cr_query_numrows);
    $cr_list = $db->Execute($cr_query_raw);
    while (!$cr_list->EOF) {
      $rows++;
      if (strlen($rows) < 2) {
        $rows = '0' . $rows;
      }
      if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$cInfo)) {
        $cInfo = new objectInfo($cr_list->fields);
      }
        echo '          <tr class="dataTableRow">' . "\n";
     if ($cr_list->fields['category_id'] != -1) {
     $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . "
                             where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
     $category_name = zen_get_category_name($cr_list->fields['category_id'], $_SESSION['languages_id']);
     } else {
     	$category_name = TEXT_ALL_CATEGORIES;
     }
?>
                <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $cr_list->fields['category_id']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $category_name; ?></td>
<?php
		if ($cr_list->fields['coupon_restrict']=='N') {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
		} else {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
		}
		if ($cr_list->fields['coupon_restrict']=='Y') {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
		} else {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
		}
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $cr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
?>
              </tr>
<?php
    $cr_list->MoveNext();
    }
?>
              <tr>
                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $cr_split->display_count($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['cpage'], TEXT_DISPLAY_NUMBER_OF_CATEGORIES); ?></td>
                    <td class="smallText" align="right"><?php echo $cr_split->display_links($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['cpage'],zen_get_all_get_params(array('cpage','action', 'x', 'y')),'cpage'); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
                    <td class="smallText" align="left"></td>
                    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id); ?></td>
                    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array, $current_category_id); ?></td>
                    <td class="smallText" align="left"><input type="submit" name="add" value="Add"></td>
                    <td class="smallText" align="left">&nbsp;</td>
                    <td class="smallText" align="left">&nbsp;</td>
                  </tr>
                </table></td>
              </tr></form>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="pageHeading"><?php echo HEADING_TITLE_PRODUCT; ?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr class="dataTableHeadingRow">
                    <td class="dataTableHeadingContent"><?php echo HEADER_COUPON_ID; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_COUPON_NAME; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_ID; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_PRODUCT_NAME; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_ALLOW; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_DENY; ?></td>
                    <td class="dataTableHeadingContent" align="center"><?php echo HEADER_RESTRICT_REMOVE; ?></td>
                  </tr>
<?php
    $pr_query_raw = "select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $_GET['cid'] . "' and product_id != '0'";
    $pr_split = new splitPageResults($_GET['ppage'], MAX_DISPLAY_RESTRICT_ENTRIES, $pr_query_raw, $pr_query_numrows);
    $pr_list = $db->Execute($pr_query_raw);
    while (!$pr_list->EOF) {
      $rows++;
      if (strlen($rows) < 2) {
        $rows = '0' . $rows;
      }
      if (((!$_GET['cid']) || (@$_GET['cid'] == $cr_list->fields['restrict_id'])) && (!$pInfo)) {
        $pInfo = new objectInfo($pr_list);
      }
        echo '          <tr class="dataTableRow">' . "\n";

     $coupon = $db->Execute("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
     $product_name = zen_get_products_name($pr_list->fields['product_id'], $_SESSION['languages_id']);
?>
                <td class="dataTableContent"><?php echo $_GET['cid']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $coupon->fields['coupon_name']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $pr_list->fields['product_id']; ?></td>
                <td class="dataTableContent" align="left"><?php echo '<strong>' . $product_name . '</strong><br />' . TEXT_CATEGORY . zen_get_categories_name_from_product($pr_list->fields['product_id']) . '<br />' . TEXT_MANUFACTURER . zen_get_products_manufacturers_name($pr_list->fields['product_id']); ?></td>
<?php
		if ($pr_list->fields['coupon_restrict']=='N') {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ALLOW) . '</a></td>';
		} else {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_DENY) . '</a></td>';
		}
		if ($pr_list->fields['coupon_restrict']=='Y') {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_DENY) . '</a></td>';
		} else {
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=switch_status&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ALLOW) . '</a></td>';
		}
		  echo '<td class="dataTableContent" align="center"><a href="' . zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=remove&info=' . $pr_list->fields['restrict_id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icons/delete.gif', IMAGE_REMOVE) . '</a></td>';
?>
              </tr>
<?php
    $pr_list->MoveNext();
    }
?>
              <tr>
                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $pr_split->display_count($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['ppage'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
                    <td class="smallText" align="right"><?php echo $pr_split->display_links($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['ppage'],zen_get_all_get_params(array('ppage','action', 'x', 'y')),'ppage'); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr><form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_category&info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
                <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
<?php
      if (isset($_POST['cPath_prod'])) $current_category_id = $_POST['cPath_prod'];
      $products = $db->Execute("select p.products_id, pd.products_name from " .
      TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
      where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'
      and p.products_id = p2c.products_id and p2c.categories_id = '" . $_POST['cPath_prod'] . "'
      order by pd.products_name");
      $products_array = array();

      if (!$products->EOF) {
        $products_array[] = array('id' => '-1',
                                   'text' => TEXT_ALL_PRODUCTS_ADD);
        $products_array[] = array('id' => '-2',
                                   'text' => TEXT_ALL_PRODUCTS_REMOVE);
      }

      while (!$products->EOF) {
        $products_array[] = array('id'=>$products->fields['products_id'],
                                   'text'=>$products->fields['products_name']);
        $products->MoveNext();
      }
?>
                    <td class="smallText" valign="top"><?php echo HEADER_CATEGORY_NAME; ?></td>
                    <td class="smallText" align="left"></td><form name="restrict_product" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'info=' . $cInfo->restrict_id, 'NONSSL'); ?>">
                    <?php echo zen_hide_session_id(); ?>
                    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('cPath_prod', zen_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form>
<?php if (sizeof($products_array) > 0) { ?>
                    <form name="restrict_category" method="post" action="<?php echo zen_href_link('coupon_restrict.php', zen_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=add_product&info=' . $cInfo->restrict_id . '&build_cat=' . $current_category_id, 'NONSSL'); ?>">
                    <td class="smallText" valign="top"><?php echo HEADER_PRODUCT_NAME; ?></td>
                    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('products_drop', $products_array, $current_category_id); ?></td>
                    <td class="smallText" align="left"><?php echo zen_draw_pull_down_menu('restrict_status', $restrict_array); ?></td>
                    <td class="smallText" align="left"><input type="submit" name="add" value="Update"></td>
                    <td class="smallText" align="left">&nbsp;</td>
                    <td class="smallText" align="left">&nbsp;</td>
<?php } else { ?>
                    <td class="smallText" align="left" colspan="6">&nbsp;</td>
<?php } ?>
                  </tr>
                  <tr>
                    <td class="smallText" align="left" colspan = "9"><?php echo TEXT_INFO_ADD_DENY_ALL; ?></td>
                  </tr>
                </table></td>
              </tr></form>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td align="right" colspan="2" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_COUPON_ADMIN, 'page=' . $_GET['page'] . '&cid=' . (!empty($cInfo->coupon_id) ? $cInfo->coupon_id : $_GET['cid']) . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                             adminhome/currencies.php                                                                            0000755 0001012 0001007 00000047121 11310010340 016025  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: currencies.php 15074 2009-12-10 03:04:31Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'insert':
      case 'save':
        if (isset($_GET['cID'])) $currency_id = zen_db_prepare_input($_GET['cID']);
        $title = zen_db_prepare_input($_POST['title']);
        $code = strtoupper(zen_db_prepare_input($_POST['code']));
        $symbol_left = zen_db_prepare_input($_POST['symbol_left']);
        $symbol_right = zen_db_prepare_input($_POST['symbol_right']);
        $decimal_point = zen_db_prepare_input($_POST['decimal_point']);
        $thousands_point = zen_db_prepare_input($_POST['thousands_point']);
        $decimal_places = zen_db_prepare_input($_POST['decimal_places']);
        $value = zen_db_prepare_input((float)$_POST['value']);

        // special handling for JPY, which always uses whole numbers, never decimals
        if ($code == 'JPY') {
          $value = (int)$value;
          $decimal_places = 0;
        }

        $sql_data_array = array('title' => $title,
                                'code' => $code,
                                'symbol_left' => $symbol_left,
                                'symbol_right' => $symbol_right,
                                'decimal_point' => $decimal_point,
                                'thousands_point' => $thousands_point,
                                'decimal_places' => $decimal_places,
                                'value' => $value);

        if ($action == 'insert') {
          zen_db_perform(TABLE_CURRENCIES, $sql_data_array);
          $currency_id = zen_db_insert_id();
        } elseif ($action == 'save') {
          zen_db_perform(TABLE_CURRENCIES, $sql_data_array, 'update', "currencies_id = '" . (int)$currency_id . "'");
        }

        if (isset($_POST['default']) && ($_POST['default'] == 'on')) {
          $db->Execute("update " . TABLE_CONFIGURATION . "
                        set configuration_value = '" . zen_db_input($code) . "'
                        where configuration_key = 'DEFAULT_CURRENCY'");
        }

        zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $currency_id));
        break;
      case 'deleteconfirm':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page']));
        }
        $currencies_id = zen_db_prepare_input($_GET['cID']);

        $currency = $db->Execute("select currencies_id
                                  from " . TABLE_CURRENCIES . "
                                  where code = '" . DEFAULT_CURRENCY . "'");


        if ($currency->fields['currencies_id'] == $currencies_id) {
          $db->Execute("update " . TABLE_CONFIGURATION . "
                        set configuration_value = ''
                        where configuration_key = 'DEFAULT_CURRENCY'");
        }

        $db->Execute("delete from " . TABLE_CURRENCIES . "
                      where currencies_id = '" . (int)$currencies_id . "'");

        zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page']));
        break;
      case 'update_currencies':
        $server_used = CURRENCY_SERVER_PRIMARY;
        zen_set_time_limit(600);
        $currency = $db->Execute("select currencies_id, code, title from " . TABLE_CURRENCIES);
        while (!$currency->EOF) {
          $quote_function = 'quote_' . CURRENCY_SERVER_PRIMARY . '_currency';
          $rate = $quote_function($currency->fields['code']);

          if (empty($rate) && (zen_not_null(CURRENCY_SERVER_BACKUP))) {
            // failed to get currency quote from primary server - attempting to use backup server instead
            $messageStack->add_session(sprintf(WARNING_PRIMARY_SERVER_FAILED, CURRENCY_SERVER_PRIMARY, $currency->fields['title'], $currency->fields['code']), 'warning');
            $quote_function = 'quote_' . CURRENCY_SERVER_BACKUP . '_currency';
            $rate = $quote_function($currency->fields['code']);
            $server_used = CURRENCY_SERVER_BACKUP;
          }

          /* Add currency uplift */
          if ($rate != 1 && defined('CURRENCY_UPLIFT_RATIO') && (int)CURRENCY_UPLIFT_RATIO != 0) {
            $rate = (string)((float)$rate * (float)CURRENCY_UPLIFT_RATIO);
          }

          // special handling for JPY, which always uses whole numbers, never decimals
          if ($code == 'JPY') {
            $rate = (int)$rate;
          }

          if (zen_not_null($rate) && $rate > 0) {
            $db->Execute("update " . TABLE_CURRENCIES . "
                          set value = '" . $rate . "', last_updated = now()
                          where currencies_id = '" . (int)$currency->fields['currencies_id'] . "'");
            $messageStack->add_session(sprintf(TEXT_INFO_CURRENCY_UPDATED, $currency->fields['title'], $currency->fields['code'], $server_used), 'success');
          } else {
            $messageStack->add_session(sprintf(ERROR_CURRENCY_INVALID, $currency->fields['title'], $currency->fields['code'], $server_used), 'error');
          }
          $currency->MoveNext();
        }

        zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']));
        break;
      case 'delete':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']));
        }
        $currencies_id = zen_db_prepare_input($_GET['cID']);

        $currency = $db->Execute("select code
                                  from " . TABLE_CURRENCIES . "
                                  where currencies_id = '" . (int)$currencies_id . "'");

        $remove_currency = true;
        if ($currency->fields['code'] == DEFAULT_CURRENCY) {
          $remove_currency = false;
          $messageStack->add(ERROR_REMOVE_DEFAULT_CURRENCY, 'error');
        }
        break;
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CURRENCY_NAME; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CURRENCY_CODES; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CURRENCY_VALUE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $currency_query_raw = "select currencies_id, title, code, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, last_updated, value from " . TABLE_CURRENCIES . " order by title";
  $currency_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $currency_query_raw, $currency_query_numrows);
  $currency = $db->Execute($currency_query_raw);
  while (!$currency->EOF) {
    if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $currency->fields['currencies_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
      $cInfo = new objectInfo($currency->fields);
    }

    if (isset($cInfo) && is_object($cInfo) && ($currency->fields['currencies_id'] == $cInfo->currencies_id) ) {
      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $currency->fields['currencies_id']) . '\'">' . "\n";
    }

    if (DEFAULT_CURRENCY == $currency->fields['code']) {
      echo '                <td class="dataTableContent"><b>' . $currency->fields['title'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
    } else {
      echo '                <td class="dataTableContent">' . $currency->fields['title'] . '</td>' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $currency->fields['code']; ?></td>
                <td class="dataTableContent" align="right"><?php echo number_format($currency->fields['value'], 8); ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($currency->fields['currencies_id'] == $cInfo->currencies_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $currency->fields['currencies_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    $currency->MoveNext();
  }
?>
              <tr>
                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $currency_split->display_count($currency_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CURRENCIES); ?></td>
                    <td class="smallText" align="right"><?php echo $currency_split->display_links($currency_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
<?php
  if (empty($action)) {
?>
                  <tr>
                    <td><?php if (CURRENCY_SERVER_PRIMARY) { echo '<a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=update_currencies') . '">' . zen_image_button('button_update_currencies.gif', IMAGE_UPDATE_CURRENCIES) . '</a>'; } ?></td>
                    <td align="right"><?php echo '<a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=new') . '">' . zen_image_button('button_new_currency.gif', IMAGE_NEW_CURRENCY) . '</a>'; ?></td>
                  </tr>
<?php
  }
?>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'new':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CURRENCY . '</b>');

      $contents = array('form' => zen_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $_GET['page'] . (isset($cInfo) ? '&cID=' . $cInfo->currencies_id : '') . '&action=insert'));
      $contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . '<br>' . zen_draw_input_field('title'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . zen_draw_input_field('code'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . zen_draw_input_field('symbol_left'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . zen_draw_input_field('symbol_right'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . zen_draw_input_field('decimal_point'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . zen_draw_input_field('thousands_point'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . zen_draw_input_field('decimal_places'));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . zen_draw_input_field('value'));
      $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'edit':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CURRENCY . '</b>');

      $contents = array('form' => zen_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=save'));
      $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . '<br>' . zen_draw_input_field('title', $cInfo->title));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . zen_draw_input_field('code', $cInfo->code));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . zen_draw_input_field('symbol_left', htmlspecialchars($cInfo->symbol_left)));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . zen_draw_input_field('symbol_right', htmlspecialchars($cInfo->symbol_right)));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . zen_draw_input_field('decimal_point', $cInfo->decimal_point));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . zen_draw_input_field('thousands_point', $cInfo->thousands_point));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . zen_draw_input_field('decimal_places', $cInfo->decimal_places));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . zen_draw_input_field('value', $cInfo->value));
      if (DEFAULT_CURRENCY != $cInfo->code) $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'delete':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CURRENCY . '</b>');
      $contents = array('form'=>zen_draw_form('delete', FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm', 'post'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text'=> (($remove_currency) ? zen_image_submit('button_delete.gif', IMAGE_DELETE) : '') . ' <a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>', 'align'=>'center');
      $contents[] = array('text' => '<br><b>' . $cInfo->title . '</b>');
//      $contents[] = array('align' => 'center', 'text' => '<br>' . (($remove_currency) ? '<a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '') . ' <a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($cInfo)) {
        $heading[] = array('text' => '<b>' . $cInfo->title . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . ' ' . $cInfo->title);
        $contents[] = array('text' => TEXT_INFO_CURRENCY_CODE . ' ' . $cInfo->code);
        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . ' ' . $cInfo->symbol_left);
        $contents[] = array('text' => TEXT_INFO_CURRENCY_SYMBOL_RIGHT . ' ' . $cInfo->symbol_right);
        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . ' ' . $cInfo->decimal_point);
        $contents[] = array('text' => TEXT_INFO_CURRENCY_THOUSANDS_POINT . ' ' . $cInfo->thousands_point);
        $contents[] = array('text' => TEXT_INFO_CURRENCY_DECIMAL_PLACES . ' ' . $cInfo->decimal_places);
        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_LAST_UPDATED . ' ' . zen_date_short($cInfo->last_updated));
        $contents[] = array('text' => TEXT_INFO_CURRENCY_VALUE . ' ' . number_format($cInfo->value, 8));
        $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_EXAMPLE . '<br>' . $currencies->format('30', false, DEFAULT_CURRENCY) . ' = ' . $currencies->format('30', true, $cInfo->code));
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                               adminhome/customers.php                                                                             0000755 0001012 0001007 00000175466 11366641062 015753  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: customers.php 16167 2010-05-01 01:48:50Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $action = (isset($_GET['action']) ? $_GET['action'] : '');
  $customers_id = zen_db_prepare_input($_GET['cID']);

  $error = false;
  $processed = false;

  if (zen_not_null($action)) {
    switch ($action) {
      case 'list_addresses':
        $addresses_query = "SELECT address_book_id, entry_firstname as firstname, entry_lastname as lastname,
                            entry_company as company, entry_street_address as street_address,
                            entry_suburb as suburb, entry_city as city, entry_postcode as postcode,
                            entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id
                    FROM   " . TABLE_ADDRESS_BOOK . "
                    WHERE  customers_id = :customersID
                    ORDER BY firstname, lastname";

        $addresses_query = $db->bindVars($addresses_query, ':customersID', $_GET['cID'], 'integer');
        $addresses = $db->Execute($addresses_query);
        $addressArray = array();
        while (!$addresses->EOF) {
          $format_id = zen_get_address_format_id($addresses->fields['country_id']);

          $addressArray[] = array('firstname'=>$addresses->fields['firstname'],
                                  'lastname'=>$addresses->fields['lastname'],
                                  'address_book_id'=>$addresses->fields['address_book_id'],
                                  'format_id'=>$format_id,
                                  'address'=>$addresses->fields);
          $addresses->MoveNext();
        }
?>
<fieldset>
<legend><?php echo ADDRESS_BOOK_TITLE; ?></legend>
<div class="alert forward"><?php echo sprintf(TEXT_MAXIMUM_ENTRIES, MAX_ADDRESS_BOOK_ENTRIES); ?></div>
<br class="clearBoth" />
<?php
/**
 * Used to loop thru and display address book entries
 */
  foreach ($addressArray as $addresses) {
?>
<h3 class="addressBookDefaultName"><?php echo zen_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?><?php if ($addresses['address_book_id'] == zen_get_customers_address_primary($_GET['cID'])) echo '&nbsp;' . PRIMARY_ADDRESS ; ?></h3>
<address><?php echo zen_address_format($addresses['format_id'], $addresses['address'], true, ' ', '<br />'); ?></address>

<br class="clearBoth" />
<?php } // end list ?>
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=list_addresses_done' . '&cID=' . $_GET['cID'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?>
</fieldset>
<?php
        die();
        break;
      case 'list_addresses_done':
        $action = '';
        zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . (int)$_GET['cID'] . '&page=' . $_GET['page'], 'NONSSL'));
        break;
      case 'status':
        if ($_GET['current'] == CUSTOMERS_APPROVAL_AUTHORIZATION) {
          $sql = "update " . TABLE_CUSTOMERS . " set customers_authorization=0 where customers_id='" . (int)$customers_id . "'";
          $custinfo = $db->Execute("select customers_email_address, customers_firstname, customers_lastname
                                    from " . TABLE_CUSTOMERS . "
                                    where customers_id = '" . (int)$customers_id . "'");
          if ((int)CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && (int)$_GET['current'] > 0 && $custinfo->RecordCount() > 0) {
            $message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE;
            $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ;
            zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT , $message, STORE_NAME, EMAIL_FROM, $html_msg, 'default');
          }
        } else {
          $sql = "update " . TABLE_CUSTOMERS . " set customers_authorization='" . CUSTOMERS_APPROVAL_AUTHORIZATION . "' where customers_id='" . (int)$customers_id . "'";
        }
        $db->Execute($sql);
        $action = '';
        zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . (int)$customers_id . '&page=' . $_GET['page'], 'NONSSL'));
        break;
      case 'update':
        $customers_firstname = zen_db_prepare_input(zen_sanitize_string($_POST['customers_firstname']));
        $customers_lastname = zen_db_prepare_input(zen_sanitize_string($_POST['customers_lastname']));
        $customers_email_address = zen_db_prepare_input($_POST['customers_email_address']);
        $customers_telephone = zen_db_prepare_input($_POST['customers_telephone']);
        $customers_fax = zen_db_prepare_input($_POST['customers_fax']);
        $customers_newsletter = zen_db_prepare_input($_POST['customers_newsletter']);
        $customers_group_pricing = (int)zen_db_prepare_input($_POST['customers_group_pricing']);
        $customers_email_format = zen_db_prepare_input($_POST['customers_email_format']);
        $customers_gender = zen_db_prepare_input($_POST['customers_gender']);
        $customers_dob = (empty($_POST['customers_dob']) ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_db_prepare_input($_POST['customers_dob']));

        $customers_authorization = zen_db_prepare_input($_POST['customers_authorization']);
        $customers_referral= zen_db_prepare_input($_POST['customers_referral']);

        if (CUSTOMERS_APPROVAL_AUTHORIZATION == 2 and $customers_authorization == 1) {
          $customers_authorization = 2;
          $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION2, 'caution');
        }

        if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 and $customers_authorization == 2) {
          $customers_authorization = 1;
          $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION1, 'caution');
        }

        $default_address_id = zen_db_prepare_input($_POST['default_address_id']);
        $entry_street_address = zen_db_prepare_input($_POST['entry_street_address']);
        $entry_suburb = zen_db_prepare_input($_POST['entry_suburb']);
        $entry_postcode = zen_db_prepare_input($_POST['entry_postcode']);
        $entry_city = zen_db_prepare_input($_POST['entry_city']);
        $entry_country_id = zen_db_prepare_input($_POST['entry_country_id']);

        $entry_company = zen_db_prepare_input($_POST['entry_company']);
        $entry_state = zen_db_prepare_input($_POST['entry_state']);
        if (isset($_POST['entry_zone_id'])) $entry_zone_id = zen_db_prepare_input($_POST['entry_zone_id']);

        if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
          $error = true;
          $entry_firstname_error = true;
        } else {
          $entry_firstname_error = false;
        }

        if (strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
          $error = true;
          $entry_lastname_error = true;
        } else {
          $entry_lastname_error = false;
        }

        if (ACCOUNT_DOB == 'true') {
          if (ENTRY_DOB_MIN_LENGTH >0) {
            if (checkdate(substr(zen_date_raw($customers_dob), 4, 2), substr(zen_date_raw($customers_dob), 6, 2), substr(zen_date_raw($customers_dob), 0, 4))) {
              $entry_date_of_birth_error = false;
            } else {
              $error = true;
              $entry_date_of_birth_error = true;
            }
          }
        } else {
            $customers_dob = '0001-01-01 00:00:00';
        }

        if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
          $error = true;
          $entry_email_address_error = true;
        } else {
          $entry_email_address_error = false;
        }

        if (!zen_validate_email($customers_email_address)) {
          $error = true;
          $entry_email_address_check_error = true;
        } else {
          $entry_email_address_check_error = false;
        }

        if (strlen($entry_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
          $error = true;
          $entry_street_address_error = true;
        } else {
          $entry_street_address_error = false;
        }

        if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
          $error = true;
          $entry_post_code_error = true;
        } else {
          $entry_post_code_error = false;
        }

        if (strlen($entry_city) < ENTRY_CITY_MIN_LENGTH) {
          $error = true;
          $entry_city_error = true;
        } else {
          $entry_city_error = false;
        }

        if ($entry_country_id == false) {
          $error = true;
          $entry_country_error = true;
        } else {
          $entry_country_error = false;
        }

        if (ACCOUNT_STATE == 'true') {
          if ($entry_country_error == true) {
            $entry_state_error = true;
          } else {
            $zone_id = 0;
            $entry_state_error = false;
            $check_value = $db->Execute("select count(*) as total
                                         from " . TABLE_ZONES . "
                                         where zone_country_id = '" . (int)$entry_country_id . "'");

            $entry_state_has_zones = ($check_value->fields['total'] > 0);
            if ($entry_state_has_zones == true) {
              $zone_query = $db->Execute("select zone_id
                                          from " . TABLE_ZONES . "
                                          where zone_country_id = '" . (int)$entry_country_id . "'
                                          and zone_name = '" . zen_db_input($entry_state) . "'");

              if ($zone_query->RecordCount() > 0) {
                $entry_zone_id = $zone_query->fields['zone_id'];
              } else {
                $error = true;
                $entry_state_error = true;
              }
            } else {
              if (strlen($entry_state) < (int)ENTRY_STATE_MIN_LENGTH) {
                $error = true;
                $entry_state_error = true;
              }
            }
         }
      }

      if (strlen($customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
        $error = true;
        $entry_telephone_error = true;
      } else {
        $entry_telephone_error = false;
      }

      $check_email = $db->Execute("select customers_email_address
                                   from " . TABLE_CUSTOMERS . "
                                   where customers_email_address = '" . zen_db_input($customers_email_address) . "'
                                   and customers_id != '" . (int)$customers_id . "'");

      if ($check_email->RecordCount() > 0) {
        $error = true;
        $entry_email_address_exists = true;
      } else {
        $entry_email_address_exists = false;
      }

      if ($error == false) {

        $sql_data_array = array('customers_firstname' => $customers_firstname,
                                'customers_lastname' => $customers_lastname,
                                'customers_email_address' => $customers_email_address,
                                'customers_telephone' => $customers_telephone,
                                'customers_fax' => $customers_fax,
                                'customers_group_pricing' => $customers_group_pricing,
                                'customers_newsletter' => $customers_newsletter,
                                'customers_email_format' => $customers_email_format,
                                'customers_authorization' => $customers_authorization,
                                'customers_referral' => $customers_referral
                                );

        if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender;
        if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = ($customers_dob == '0001-01-01 00:00:00' ? '0001-01-01 00:00:00' : zen_date_raw($customers_dob));

        zen_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'");

        $db->Execute("update " . TABLE_CUSTOMERS_INFO . "
                      set customers_info_date_account_last_modified = now()
                      where customers_info_id = '" . (int)$customers_id . "'");

        if ($entry_zone_id > 0) $entry_state = '';

        $sql_data_array = array('entry_firstname' => $customers_firstname,
                                'entry_lastname' => $customers_lastname,
                                'entry_street_address' => $entry_street_address,
                                'entry_postcode' => $entry_postcode,
                                'entry_city' => $entry_city,
                                'entry_country_id' => $entry_country_id);

        if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $entry_company;
        if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $entry_suburb;

        if (ACCOUNT_STATE == 'true') {
          if ($entry_zone_id > 0) {
            $sql_data_array['entry_zone_id'] = $entry_zone_id;
            $sql_data_array['entry_state'] = '';
          } else {
            $sql_data_array['entry_zone_id'] = '0';
            $sql_data_array['entry_state'] = $entry_state;
          }
        }

        zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

        zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id, 'NONSSL'));

        } else if ($error == true) {
          $cInfo = new objectInfo($_POST);
          $processed = true;
        }

        break;
      case 'deleteconfirm':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')), 'NONSSL'));
        }

        if (isset($_POST['delete_reviews']) && ($_POST['delete_reviews'] == 'on')) {
          $reviews = $db->Execute("select reviews_id
                                   from " . TABLE_REVIEWS . "
                                   where customers_id = '" . (int)$customers_id . "'");
          while (!$reviews->EOF) {
            $db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "
                          where reviews_id = '" . (int)$reviews->fields['reviews_id'] . "'");
            $reviews->MoveNext();
          }

          $db->Execute("delete from " . TABLE_REVIEWS . "
                        where customers_id = '" . (int)$customers_id . "'");
        } else {
          $db->Execute("update " . TABLE_REVIEWS . "
                        set customers_id = null
                        where customers_id = '" . (int)$customers_id . "'");
        }

        $db->Execute("delete from " . TABLE_ADDRESS_BOOK . "
                      where customers_id = '" . (int)$customers_id . "'");

        $db->Execute("delete from " . TABLE_CUSTOMERS . "
                      where customers_id = '" . (int)$customers_id . "'");

        $db->Execute("delete from " . TABLE_CUSTOMERS_INFO . "
                      where customers_info_id = '" . (int)$customers_id . "'");

        $db->Execute("delete from " . TABLE_CUSTOMERS_BASKET . "
                      where customers_id = '" . (int)$customers_id . "'");

        $db->Execute("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . "
                      where customers_id = '" . (int)$customers_id . "'");

        $db->Execute("delete from " . TABLE_WHOS_ONLINE . "
                      where customer_id = '" . (int)$customers_id . "'");


        zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')), 'NONSSL'));
        break;
      default:
        $customers = $db->Execute("select c.customers_id, c.customers_gender, c.customers_firstname,
                                          c.customers_lastname, c.customers_dob, c.customers_email_address,
                                          a.entry_company, a.entry_street_address, a.entry_suburb,
                                          a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id,
                                          a.entry_country_id, c.customers_telephone, c.customers_fax,
                                          c.customers_newsletter, c.customers_default_address_id,
                                          c.customers_email_format, c.customers_group_pricing,
                                          c.customers_authorization, c.customers_referral
                                  from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a
                                  on c.customers_default_address_id = a.address_book_id
                                  where a.customers_id = c.customers_id
                                  and c.customers_id = '" . (int)$customers_id . "'");

        $cInfo = new objectInfo($customers->fields);
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<?php
  if ($action == 'edit' || $action == 'update') {
?>
<script language="javascript"><!--

function check_form() {
  var error = 0;
  var error_message = "<?php echo JS_ERROR; ?>";

  var customers_firstname = document.customers.customers_firstname.value;
  var customers_lastname = document.customers.customers_lastname.value;
<?php if (ACCOUNT_COMPANY == 'true') echo 'var entry_company = document.customers.entry_company.value;' . "\n"; ?>
<?php if (ACCOUNT_DOB == 'true') echo 'var customers_dob = document.customers.customers_dob.value;' . "\n"; ?>
  var customers_email_address = document.customers.customers_email_address.value;
  var entry_street_address = document.customers.entry_street_address.value;
  var entry_postcode = document.customers.entry_postcode.value;
  var entry_city = document.customers.entry_city.value;
  var customers_telephone = document.customers.customers_telephone.value;

<?php if (ACCOUNT_GENDER == 'true') { ?>
  if (document.customers.customers_gender[0].checked || document.customers.customers_gender[1].checked) {
  } else {
    error_message = error_message + "<?php echo JS_GENDER; ?>";
    error = 1;
  }
<?php } ?>

  if (customers_firstname == "" || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_FIRST_NAME; ?>";
    error = 1;
  }

  if (customers_lastname == "" || customers_lastname.length < <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_LAST_NAME; ?>";
    error = 1;
  }

<?php if (ACCOUNT_DOB == 'true' && ENTRY_DOB_MIN_LENGTH !='') { ?>
  if (customers_dob == "" || customers_dob.length < <?php echo ENTRY_DOB_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_DOB; ?>";
    error = 1;
  }
<?php } ?>

  if (customers_email_address == "" || customers_email_address.length < <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_EMAIL_ADDRESS; ?>";
    error = 1;
  }

  if (entry_street_address == "" || entry_street_address.length < <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_ADDRESS; ?>";
    error = 1;
  }

  if (entry_postcode == "" || entry_postcode.length < <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_POST_CODE; ?>";
    error = 1;
  }

  if (entry_city == "" || entry_city.length < <?php echo ENTRY_CITY_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_CITY; ?>";
    error = 1;
  }

<?php
  if (ACCOUNT_STATE == 'true') {
?>
  if (document.customers.elements['entry_state'].type != "hidden") {
    if (document.customers.entry_state.value == '' || document.customers.entry_state.value.length < <?php echo ENTRY_STATE_MIN_LENGTH; ?> ) {
       error_message = error_message + "<?php echo JS_STATE; ?>";
       error = 1;
    }
  }
<?php
  }
?>

  if (document.customers.elements['entry_country_id'].type != "hidden") {
    if (document.customers.entry_country_id.value == 0) {
      error_message = error_message + "<?php echo JS_COUNTRY; ?>";
      error = 1;
    }
  }

  if (customers_telephone == "" || customers_telephone.length < <?php echo (int)ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
    error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
    error = 1;
  }

  if (error == 1) {
    alert(error_message);
    return false;
  } else {
    return true;
  }
}
//--></script>
<?php
  }
?>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
  if ($action == 'edit' || $action == 'update') {
    $newsletter_array = array(array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES),
                              array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO));
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr><?php echo zen_draw_form('customers', FILENAME_CUSTOMERS, zen_get_all_get_params(array('action')) . 'action=update', 'post', 'onsubmit="return check_form(customers);"', true) . zen_draw_hidden_field('default_address_id', $cInfo->customers_default_address_id);
           echo zen_hide_session_id(); ?>
        <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
      </tr>
      <tr>
        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<?php
    if (ACCOUNT_GENDER == 'true') {
?>
          <tr>
            <td class="main"><?php echo ENTRY_GENDER; ?></td>
            <td class="main">
<?php
    if ($error == true && $entry_gender_error == true) {
      echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . ENTRY_GENDER_ERROR;
    } else {
      echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '&nbsp;&nbsp;' . FEMALE;
    }
?></td>
          </tr>
<?php
    }
?>

<?php
  $customers_authorization_array = array(array('id' => '0', 'text' => CUSTOMERS_AUTHORIZATION_0),
                                array('id' => '1', 'text' => CUSTOMERS_AUTHORIZATION_1),
                                array('id' => '2', 'text' => CUSTOMERS_AUTHORIZATION_2),
                                array('id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3),
                                array('id' => '4', 'text' => CUSTOMERS_AUTHORIZATION_4), // banned
                                );
?>
          <tr>
            <td class="main"><?php echo CUSTOMERS_AUTHORIZATION; ?></td>
            <td class="main">
              <?php echo zen_draw_pull_down_menu('customers_authorization', $customers_authorization_array, $cInfo->customers_authorization); ?>
            </td>
          </tr>

          <tr>
            <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_firstname_error == true) {
      echo zen_draw_input_field('customers_firstname', $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50)) . '&nbsp;' . ENTRY_FIRST_NAME_ERROR;
    } else {
      echo $cInfo->customers_firstname . zen_draw_hidden_field('customers_firstname');
    }
  } else {
    echo zen_draw_input_field('customers_firstname', $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50), true);
  }
?></td>
          </tr>
          <tr>
            <td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_lastname_error == true) {
      echo zen_draw_input_field('customers_lastname', $cInfo->customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50)) . '&nbsp;' . ENTRY_LAST_NAME_ERROR;
    } else {
      echo $cInfo->customers_lastname . zen_draw_hidden_field('customers_lastname');
    }
  } else {
    echo zen_draw_input_field('customers_lastname', $cInfo->customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50), true);
  }
?></td>
          </tr>
<?php
    if (ACCOUNT_DOB == 'true') {
?>
          <tr>
            <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
            <td class="main">

<?php
    if ($error == true) {
      if ($entry_date_of_birth_error == true) {
        echo zen_draw_input_field('customers_dob', ($cInfo->customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"') . '&nbsp;' . ENTRY_DATE_OF_BIRTH_ERROR;
      } else {
        echo $cInfo->customers_dob . ($customers_dob == '0001-01-01 00:00:00' ? 'N/A' : zen_draw_hidden_field('customers_dob'));
      }
    } else {
      echo zen_draw_input_field('customers_dob', ($customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"', true);
    }
?></td>
          </tr>
<?php
    }
?>
          <tr>
            <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_email_address_error == true) {
      echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR;
    } elseif ($entry_email_address_check_error == true) {
      echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
    } elseif ($entry_email_address_exists == true) {
      echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
    } else {
      echo $customers_email_address . zen_draw_hidden_field('customers_email_address');
    }
  } else {
    echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50), true);
  }
?></td>
          </tr>
        </table></td>
      </tr>
<?php
    if (ACCOUNT_COMPANY == 'true') {
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td>
      </tr>
      <tr>
        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
          <tr>
            <td class="main"><?php echo ENTRY_COMPANY; ?></td>
            <td class="main">
<?php
    if ($error == true) {
      if ($entry_company_error == true) {
        echo zen_draw_input_field('entry_company', $cInfo->entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50)) . '&nbsp;' . ENTRY_COMPANY_ERROR;
      } else {
        echo $cInfo->entry_company . zen_draw_hidden_field('entry_company');
      }
    } else {
      echo zen_draw_input_field('entry_company', $cInfo->entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50));
    }
?></td>
          </tr>
        </table></td>
      </tr>
<?php
    }
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td>
      </tr>
      <tr>
        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
          <tr>
            <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_street_address_error == true) {
      echo zen_draw_input_field('entry_street_address', $cInfo->entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50)) . '&nbsp;' . ENTRY_STREET_ADDRESS_ERROR;
    } else {
      echo $cInfo->entry_street_address . zen_draw_hidden_field('entry_street_address');
    }
  } else {
    echo zen_draw_input_field('entry_street_address', $cInfo->entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50), true);
  }
?></td>
          </tr>
<?php
    if (ACCOUNT_SUBURB == 'true') {
?>
          <tr>
            <td class="main"><?php echo ENTRY_SUBURB; ?></td>
            <td class="main">
<?php
    if ($error == true) {
      if ($entry_suburb_error == true) {
        echo zen_draw_input_field('suburb', $cInfo->entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50)) . '&nbsp;' . ENTRY_SUBURB_ERROR;
      } else {
        echo $cInfo->entry_suburb . zen_draw_hidden_field('entry_suburb');
      }
    } else {
      echo zen_draw_input_field('entry_suburb', $cInfo->entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50));
    }
?></td>
          </tr>
<?php
    }
?>
          <tr>
            <td class="main"><?php echo ENTRY_POST_CODE; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_post_code_error == true) {
      echo zen_draw_input_field('entry_postcode', $cInfo->entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10)) . '&nbsp;' . ENTRY_POST_CODE_ERROR;
    } else {
      echo $cInfo->entry_postcode . zen_draw_hidden_field('entry_postcode');
    }
  } else {
    echo zen_draw_input_field('entry_postcode', $cInfo->entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10), true);
  }
?></td>
          </tr>
          <tr>
            <td class="main"><?php echo ENTRY_CITY; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_city_error == true) {
      echo zen_draw_input_field('entry_city', $cInfo->entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50)) . '&nbsp;' . ENTRY_CITY_ERROR;
    } else {
      echo $cInfo->entry_city . zen_draw_hidden_field('entry_city');
    }
  } else {
    echo zen_draw_input_field('entry_city', $cInfo->entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50), true);
  }
?></td>
          </tr>
<?php
    if (ACCOUNT_STATE == 'true') {
?>
          <tr>
            <td class="main"><?php echo ENTRY_STATE; ?></td>
            <td class="main">
<?php
    $entry_state = zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
    if ($error == true) {
      if ($entry_state_error == true) {
        if ($entry_state_has_zones == true) {
          $zones_array = array();
          $zones_values = $db->Execute("select zone_name
                                        from " . TABLE_ZONES . "
                                        where zone_country_id = '" . zen_db_input($cInfo->entry_country_id) . "'
                                        order by zone_name");

          while (!$zones_values->EOF) {
            $zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
            $zones_values->MoveNext();
          }
          echo zen_draw_pull_down_menu('entry_state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
        } else {
          echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . '&nbsp;' . ENTRY_STATE_ERROR;
        }
      } else {
        echo $entry_state . zen_draw_hidden_field('entry_zone_id') . zen_draw_hidden_field('entry_state');
      }
    } else {
      echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
    }

?></td>
         </tr>
<?php
    }
?>
          <tr>
            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_country_error == true) {
      echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id) . '&nbsp;' . ENTRY_COUNTRY_ERROR;
    } else {
      echo zen_get_country_name($cInfo->entry_country_id) . zen_draw_hidden_field('entry_country_id');
    }
  } else {
    echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id);
  }
?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>
      </tr>
      <tr>
        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
          <tr>
            <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
            <td class="main">
<?php
  if ($error == true) {
    if ($entry_telephone_error == true) {
      echo zen_draw_input_field('customers_telephone', $cInfo->customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15)) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR;
    } else {
      echo $cInfo->customers_telephone . zen_draw_hidden_field('customers_telephone');
    }
  } else {
    echo zen_draw_input_field('customers_telephone', $cInfo->customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15), true);
  }
?></td>
          </tr>
<?php
  if (ACCOUNT_FAX_NUMBER == 'true') {
?>
          <tr>
            <td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
            <td class="main">
<?php
  if ($processed == true) {
    echo $cInfo->customers_fax . zen_draw_hidden_field('customers_fax');
  } else {
    echo zen_draw_input_field('customers_fax', $cInfo->customers_fax, zen_set_field_length(TABLE_CUSTOMERS, 'customers_fax', 15));
  }
?></td>
          </tr>
<?php } ?>
        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td>
      </tr>
      <tr>
        <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

      <tr>
        <td class="main"><?php echo ENTRY_EMAIL_PREFERENCE; ?></td>
        <td class="main">
<?php
if ($processed == true) {
  if ($cInfo->customers_email_format) {
    echo $customers_email_format . zen_draw_hidden_field('customers_email_format');
  }
} else {
    $email_pref_text = ($cInfo->customers_email_format == 'TEXT') ? true : false;
  $email_pref_html = !$email_pref_text;
  echo zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . '&nbsp;' . ENTRY_EMAIL_HTML_DISPLAY . '&nbsp;&nbsp;&nbsp;' . zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . '&nbsp;' . ENTRY_EMAIL_TEXT_DISPLAY ;
}
?></td>
      </tr>
          <tr>
            <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
            <td class="main">
<?php
  if ($processed == true) {
    if ($cInfo->customers_newsletter == '1') {
      echo ENTRY_NEWSLETTER_YES;
    } else {
      echo ENTRY_NEWSLETTER_NO;
    }
    echo zen_draw_hidden_field('customers_newsletter');
  } else {
    echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));
  }
?></td>
          </tr>
          <tr>
            <td class="main"><?php echo ENTRY_PRICING_GROUP; ?></td>
            <td class="main">
<?php
  if ($processed == true) {
    if ($cInfo->customers_group_pricing) {
      $group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where group_id = '" . $cInfo->customers_group_pricing . "'");
      echo $group_query->fields['group_name'].'&nbsp;'.$group_query->fields['group_percentage'].'%';
    } else {
      echo ENTRY_NONE;
    }
    echo zen_draw_hidden_field('customers_group_pricing', $cInfo->customers_group_pricing);
  } else {
    $group_array_query = $db->execute("select group_id, group_name, group_percentage from " . TABLE_GROUP_PRICING);
    $group_array[] = array('id'=>0, 'text'=>TEXT_NONE);
    while (!$group_array_query->EOF) {
      $group_array[] = array('id'=>$group_array_query->fields['group_id'], 'text'=>$group_array_query->fields['group_name'].'&nbsp;'.$group_array_query->fields['group_percentage'].'%');
      $group_array_query->MoveNext();
    }
    echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cInfo->customers_group_pricing);
  }
?></td>
          </tr>

          <tr>
            <td class="main"><?php echo CUSTOMERS_REFERRAL; ?></td>
            <td class="main">
              <?php echo zen_draw_input_field('customers_referral', $cInfo->customers_referral, zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15)); ?>
            </td>
          </tr>
        </table></td>
      </tr>

      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td align="right" class="main"><?php echo zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('action')), 'NONSSL') .'">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
      </tr></form>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr><?php echo zen_draw_form('search', FILENAME_CUSTOMERS, '', 'get', '', true); ?>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="smallText" align="right">
<?php
// show reset search
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
      echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
    }
    echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
      $keywords = zen_db_prepare_input($_GET['search']);
      echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . zen_output_string_protected($keywords);
    }
?>
            </td>
          </form></tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
<?php
// Sort Listing
          switch ($_GET['list_order']) {
              case "id-asc":
              $disp_order = "ci.customers_info_date_account_created";
              break;
              case "firstname":
              $disp_order = "c.customers_firstname";
              break;
              case "firstname-desc":
              $disp_order = "c.customers_firstname DESC";
              break;
              case "group-asc":
              $disp_order = "c.customers_group_pricing";
              break;
              case "group-desc":
              $disp_order = "c.customers_group_pricing DESC";
              break;
              case "lastname":
              $disp_order = "c.customers_lastname, c.customers_firstname";
              break;
              case "lastname-desc":
              $disp_order = "c.customers_lastname DESC, c.customers_firstname";
              break;
              case "company":
              $disp_order = "a.entry_company";
              break;
              case "company-desc":
              $disp_order = "a.entry_company DESC";
              break;
              case "login-asc":
              $disp_order = "ci.customers_info_date_of_last_logon";
              break;
              case "login-desc":
              $disp_order = "ci.customers_info_date_of_last_logon DESC";
              break;
              case "approval-asc":
              $disp_order = "c.customers_authorization";
              break;
              case "approval-desc":
              $disp_order = "c.customers_authorization DESC";
              break;
              case "gv_balance-asc":
              $disp_order = "cgc.amount, c.customers_lastname, c.customers_firstname";
              break;
              case "gv_balance-desc":
              $disp_order = "cgc.amount DESC, c.customers_lastname, c.customers_firstname";
              break;
              default:
              $disp_order = "ci.customers_info_date_account_created DESC";
          }
?>
             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" align="center" valign="top">
                  <?php echo TABLE_HEADING_ID; ?>
                </td>
                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='lastname' or $_GET['list_order']=='lastname-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_LASTNAME . '</span>' : TABLE_HEADING_LASTNAME); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=lastname', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='lastname' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=lastname-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='lastname-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>
                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='firstname' or $_GET['list_order']=='firstname-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_FIRSTNAME . '</span>' : TABLE_HEADING_FIRSTNAME); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=firstname', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='firstname' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=firstname-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='firstname-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</span>'); ?></a>
                </td>
                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='company' or $_GET['list_order']=='company-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_COMPANY . '</span>' : TABLE_HEADING_COMPANY); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=company', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='company' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=company-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='company-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>
                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='id-asc' or $_GET['list_order']=='id-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_ACCOUNT_CREATED . '</span>' : TABLE_HEADING_ACCOUNT_CREATED); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=id-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='id-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=id-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='id-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>

                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='login-asc' or $_GET['list_order']=='login-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_LOGIN . '</span>' : TABLE_HEADING_LOGIN); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=login-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='login-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=login-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='login-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>

                <td class="dataTableHeadingContent" align="left" valign="top">
                  <?php echo (($_GET['list_order']=='group-asc' or $_GET['list_order']=='group-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_PRICING_GROUP . '</span>' : TABLE_HEADING_PRICING_GROUP); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=group-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='group-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=group-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='group-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>

<?php if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') { ?>
                <td class="dataTableHeadingContent" align="left" valign="top" width="75">
                  <?php echo (($_GET['list_order']=='gv_balance-asc' or $_GET['list_order']=='gv_balance-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_GV_AMOUNT . '</span>' : TABLE_HEADING_GV_AMOUNT); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=gv_balance-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='gv_balance-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=gv_balance-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='gv_balance-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>
<?php } ?>

                <td class="dataTableHeadingContent" align="center" valign="top">
                  <?php echo (($_GET['list_order']=='approval-asc' or $_GET['list_order']=='approval-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_AUTHORIZATION_APPROVAL . '</span>' : TABLE_HEADING_AUTHORIZATION_APPROVAL); ?><br>
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=approval-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='approval-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>&nbsp;
                  <a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=approval-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='approval-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
                </td>

                <td class="dataTableHeadingContent" align="right" valign="top"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
    $search = '';
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
      $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
      $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%' or c.customers_telephone rlike ':keywords:' or a.entry_company rlike ':keywords:' or a.entry_street_address rlike ':keywords:' or a.entry_city rlike ':keywords:' or a.entry_postcode rlike ':keywords:'";
      $search = $db->bindVars($search, ':keywords:', $keywords, 'regexp');
    }
    $new_fields=', c.customers_telephone, a.entry_company, a.entry_street_address, a.entry_city, a.entry_postcode, c.customers_authorization, c.customers_referral';
    $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_pricing, a.entry_country_id, a.entry_company, ci.customers_info_date_of_last_logon, ci.customers_info_date_account_created " . $new_fields . ",
    cgc.amount
    from " . TABLE_CUSTOMERS . " c
    left join " . TABLE_CUSTOMERS_INFO . " ci on c.customers_id= ci.customers_info_id
    left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . "
    left join " . TABLE_COUPON_GV_CUSTOMER . " cgc on c.customers_id = cgc.customer_id " .
    $search . " order by $disp_order";

// Split Page
// reset page when page is unknown
if (($_GET['page'] == '' or $_GET['page'] == '1') and $_GET['cID'] != '') {
  $check_page = $db->Execute($customers_query_raw);
  $check_count=1;
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) {
    while (!$check_page->EOF) {
      if ($check_page->fields['customers_id'] == $_GET['cID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER) !=0 ? .5 : 0)),0);
//    zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . $_GET['cID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'NONSSL'));
  } else {
    $_GET['page'] = 1;
  }
}

    $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, $customers_query_raw, $customers_query_numrows);
    $customers = $db->Execute($customers_query_raw);
    while (!$customers->EOF) {
      $sql = "select customers_info_date_account_created as date_account_created,
                                   customers_info_date_account_last_modified as date_account_last_modified,
                                   customers_info_date_of_last_logon as date_last_logon,
                                   customers_info_number_of_logons as number_of_logons
                            from " . TABLE_CUSTOMERS_INFO . "
                            where customers_info_id = '" . $customers->fields['customers_id'] . "'";
      $info = $db->Execute($sql);

      // if no record found, create one to keep database in sync
      if (!isset($info->fields) || !is_array($info->fields)) {
        $insert_sql = "insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
                       values ('" . (int)$customers->fields['customers_id'] . "', '0', now())";
        $db->Execute($insert_sql);
        $info = $db->Execute($sql);
      }

      if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $customers->fields['customers_id']))) && !isset($cInfo)) {
        $country = $db->Execute("select countries_name
                                 from " . TABLE_COUNTRIES . "
                                 where countries_id = '" . (int)$customers->fields['entry_country_id'] . "'");

        $reviews = $db->Execute("select count(*) as number_of_reviews
                                 from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers->fields['customers_id'] . "'");

        $customer_info = array_merge($country->fields, $info->fields, $reviews->fields);

        $cInfo_array = array_merge($customers->fields, $customer_info);
        $cInfo = new objectInfo($cInfo_array);
      }

        $group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where
                                     group_id = '" . $customers->fields['customers_group_pricing'] . "'");

        if ($group_query->RecordCount() < 1) {
          $group_name_entry = TEXT_NONE;
        } else {
          $group_name_entry = $group_query->fields['group_name'];
        }

      if (isset($cInfo) && is_object($cInfo) && ($customers->fields['customers_id'] == $cInfo->customers_id)) {
        echo '          <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit', 'NONSSL') . '\'">' . "\n";
      } else {
        echo '          <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID')) . 'cID=' . $customers->fields['customers_id'], 'NONSSL') . '\'">' . "\n";
      }

      $zc_address_book_count_list = zen_get_customers_address_book($customers->fields['customers_id']);
      $zc_address_book_count = $zc_address_book_count_list->RecordCount();
?>
                <td class="dataTableContent" align="right"><?php echo $customers->fields['customers_id'] . ($zc_address_book_count == 1 ? TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count : '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=list_addresses' . '&cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . TEXT_INFO_ADDRESS_BOOK_COUNT . $zc_address_book_count . '</a>'); ?></td>
                <td class="dataTableContent"><?php echo $customers->fields['customers_lastname']; ?></td>
                <td class="dataTableContent"><?php echo $customers->fields['customers_firstname']; ?></td>
                <td class="dataTableContent"><?php echo $customers->fields['entry_company']; ?></td>
                <td class="dataTableContent"><?php echo zen_date_short($info->fields['date_account_created']); ?></td>
                <td class="dataTableContent"><?php echo zen_date_short($customers->fields['customers_info_date_of_last_logon']); ?></td>
                <td class="dataTableContent"><?php echo $group_name_entry; ?></td>
<?php if (MODULE_ORDER_TOTAL_GV_STATUS == 'true') { ?>
                <td class="dataTableContent" align="right"><?php echo $currencies->format($customers->fields['amount']); ?></td>
<?php } ?>
                <td class="dataTableContent" align="center"><?php echo ($customers->fields['customers_authorization'] == 4 ? zen_image(DIR_WS_IMAGES . 'icon_red_off.gif', IMAGE_ICON_STATUS_OFF) : ($customers->fields['customers_authorization'] == 0 ? '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=status&current=' . $customers->fields['customers_authorization'] . '&cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_CUSTOMERS, 'action=status&current=' . $customers->fields['customers_authorization'] . '&cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>')); ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers->fields['customers_id'] == $cInfo->customers_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID')) . 'cID=' . $customers->fields['customers_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $customers->MoveNext();
    }
?>
              <tr>
                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
                    <td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_CUSTOMER, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
                  </tr>
<?php
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
?>
                  <tr>
                    <td align="right" colspan="2"><?php echo '<a href="' . zen_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
                  </tr>
<?php
    }
?>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'confirm':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');

      $contents = array('form' => zen_draw_form('customers', FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action', 'search')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm', 'post', '', true));
      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
      if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = array('text' => '<br />' . zen_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id, 'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (isset($_GET['search'])) $_GET['search'] = zen_output_string_protected($_GET['search']);
      if (isset($cInfo) && is_object($cInfo)) {
        $customers_orders = $db->Execute("select o.orders_id, o.date_purchased, o.order_total, o.currency, o.currency_value,
                                          cgc.amount
                                          from " . TABLE_ORDERS . " o
                                          left join " . TABLE_COUPON_GV_CUSTOMER . " cgc on o.customers_id = cgc.customer_id
                                          where customers_id='" . $cInfo->customers_id . "' order by date_purchased desc");

        $heading[] = array('text' => '<b>' . TABLE_HEADING_ID . $cInfo->customers_id . ' ' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action', 'search')) . 'cID=' . $cInfo->customers_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action', 'search')) . 'cID=' . $cInfo->customers_id . '&action=confirm', 'NONSSL') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br />' . ($customers_orders->RecordCount() != 0 ? '<a href="' . zen_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id, 'NONSSL') . '">' . zen_image_button('button_orders.gif', IMAGE_ORDERS) . '</a>' : '') . ' <a href="' . zen_href_link(FILENAME_MAIL, 'origin=customers.php&mode=NONSSL&selected_box=tools&customer=' . $cInfo->customers_email_address.'&cID=' . $cInfo->customers_id, 'NONSSL') . '">' . zen_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
        $contents[] = array('text' => '<br />' . TEXT_DATE_ACCOUNT_CREATED . ' ' . zen_date_short($cInfo->date_account_created));
        $contents[] = array('text' => '<br />' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . zen_date_short($cInfo->date_account_last_modified));
        $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_LAST_LOGON . ' '  . zen_date_short($cInfo->date_last_logon));
        $contents[] = array('text' => '<br />' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons);

        $customer_gv_balance = zen_user_has_gv_balance($cInfo->customers_id);
        $contents[] = array('text' => '<br />' . TEXT_INFO_GV_AMOUNT . ' ' . $currencies->format($customer_gv_balance));

        $contents[] = array('text' => '<br />' . TEXT_INFO_NUMBER_OF_ORDERS . ' ' . $customers_orders->RecordCount());
        if ($customers_orders->RecordCount() != 0) {
          $contents[] = array('text' => TEXT_INFO_LAST_ORDER . ' ' . zen_date_short($customers_orders->fields['date_purchased']) . '<br />' . TEXT_INFO_ORDERS_TOTAL . ' ' . $currencies->format($customers_orders->fields['order_total'], true, $customers_orders->fields['currency'], $customers_orders->fields['currency_value']));
        }
        $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name);
        $contents[] = array('text' => '<br />' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews);
        $contents[] = array('text' => '<br />' . CUSTOMERS_REFERRAL . ' ' . $cInfo->customers_referral);
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                          adminhome/define_pages_editor.php                                                                   0000755 0001012 0001007 00000024675 10473675102 017701  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: define_pages_editor.php 4279 2006-08-26 03:31:29Z drbyte $
 */

  require('includes/application_top.php');

  function zen_display_files() {
    global $check_directory, $found, $configuration_key_lookup;
    for ($i = 0, $n = sizeof($check_directory); $i < $n; $i++) {
//echo 'I SEE ' . $check_directory[$i] . '<br>';

      $dir_check = $check_directory[$i];
      $file_extension = '.php';

      if ($dir = @dir($dir_check)) {
        while ($file = $dir->read()) {
          if (!is_dir($dir_check . $file)) {
            if (substr($file, strrpos($file, '.')) == $file_extension) {
              $directory_array[] = $file;
            }
          }
        }
        if (sizeof($directory_array)) {
          sort($directory_array);
        }
        $dir->close();
      }
    }
    return $directory_array;
  }

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  $za_who = $_GET['za_lookup'];

  if ($action == 'new_page') {
    $page = $_GET['define_it'];

    $check_directory = array();
    $check_directory[] = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/';
    $directory_files = zen_display_files();

    $za_lookup = array();
    for ($i = 0, $n = sizeof($directory_files); $i < $n; $i++) {
      $za_lookup[] = array('id' => $i, 'text' => $directory_files[$i]);
    }

// This will cause it to look for 'define_conditions.php'
    $_GET['filename'] = $za_lookup[$page]['text'];
    $_GET['box_name'] = BOX_TOOLS_DEFINE_CONDITIONS;
  }

// define template specific file name defines
  $file = zen_get_file_directory(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/html_includes/', $_GET['filename'], 'false');
?>
<?php
  switch ($_GET['action']) {
      case 'set_editor':
        // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
        $action='';
        zen_redirect(zen_href_link(FILENAME_DEFINE_PAGES_EDITOR));
        break;
    case 'save':
      if ( ($_GET['lngdir']) && ($_GET['filename']) ) {
        if (file_exists($file)) {
          if (file_exists('bak' . $file)) {
            @unlink('bak' . $file);
          }
          @rename($file, 'bak' . $file);
          $new_file = fopen($file, 'w');
          $file_contents = stripslashes($_POST['file_contents']);
          fwrite($new_file, $file_contents, strlen($file_contents));
          fclose($new_file);
        }
        zen_redirect(zen_href_link(FILENAME_DEFINE_PAGES_EDITOR));
      }
      break;
  }

  if (!$_SESSION['language']) $_SESSION['language'] = $language;

  $languages_array = array();
  $languages = zen_get_languages();
  $lng_exists = false;
  for ($i=0; $i<sizeof($languages); $i++) {
    if ($languages[$i]['directory'] == $_SESSION['language']) $lng_exists = true;

    $languages_array[] = array('id' => $languages[$i]['directory'],
                               'text' => $languages[$i]['name']);
  }
  if (!$lng_exists) $_SESSION['language'] = $language;
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  if (typeof _editor_url == "string") HTMLArea.replaceAll();
  }
  // -->
</script>
<?php if ($editor_handler != '') include ($editor_handler); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td class="pageHeading"><?php echo HEADING_TITLE . '&nbsp;' . $_SESSION['language']; ?> &nbsp;&nbsp;
          <?php
            $check_directory = array();
            $check_directory[] = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/';
            $directory_files = zen_display_files();

            $za_lookup = array();
            $za_lookup[] = array('id' => -1, 'text' => TEXT_INFO_SELECT_FILE);

            for ($i = 0, $n = sizeof($directory_files); $i < $n; $i++) {
              $za_lookup[] = array('id' => $i, 'text' => $directory_files[$i]);
            }

            echo zen_draw_form('new_page', FILENAME_DEFINE_PAGES_EDITOR, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('define_it', $za_lookup, '-1', 'onChange="this.form.submit();"') .
            zen_hide_session_id() . 
            zen_draw_hidden_field('action', 'new_page') . '&nbsp;&nbsp;</form>';
          ?>
<?php
// toggle switch for editor
        echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_DEFINE_PAGES_EDITOR, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') .
        zen_draw_hidden_field('action', 'set_editor') .
        zen_hide_session_id() . 
        '</form>';
?>
        </td>
      </tr>
<?php
// show editor
if (isset($_GET['filename'])) {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
  if ( ($_SESSION['language']) && ($_GET['filename']) ) {
    if (file_exists($file)) {
      $file_array = @file($file);
      $file_contents = @implode('', $file_array);

      $file_writeable = true;
      if (!is_writeable($file)) {
        $file_writeable = false;
        $messageStack->reset();
        $messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
        echo $messageStack->output();
      }

?>
              <tr>
            <td class="main"><b><?php echo TEXT_INFO_CAUTION . '<br /><br />' . TEXT_INFO_EDITING . '<br />' . $file . '<br />'; ?></b></td>
              </tr>
          <tr><?php echo zen_draw_form('language', FILENAME_DEFINE_PAGES_EDITOR, 'lngdir=' . $_SESSION['language'] . '&filename=' . $_GET['filename'] . '&action=save'); ?>
            <td><table border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main">
				<?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                $oFCKeditor = new FCKeditor('file_contents') ;
                $oFCKeditor->Value = $file_contents ;
                $oFCKeditor->Width  = '700' ;
                $oFCKeditor->Height = '450' ;
//                $oFCKeditor->Create() ;
                $output = $oFCKeditor->CreateHtml() ; echo $output;
					} else { // using HTMLAREA or just raw "source"
					echo zen_draw_textarea_field('file_contents', 'soft', '100%', '30', $file_contents, (($file_writeable) ? '' : 'readonly') . ' id="file_contents"');
					} ?>
				</td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td align="right"><?php if ($file_writeable) { echo zen_image_submit('button_save.gif', IMAGE_SAVE) . '&nbsp;<a href="' . zen_href_link(FILENAME_DEFINE_PAGES_EDITOR, 'define_it=' .$_GET['define_it'] . '&action=new_page') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>' . '&nbsp;' . '<a href="' . zen_href_link(FILENAME_DEFINE_PAGES_EDITOR . '.php') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; } else { echo '<a href="' . zen_href_link(FILENAME_DEFINE_PAGES_EDITOR, 'lngdir=' . $_SESSION['language']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; } ?></td>
              </tr>
            </table></td>
          </form></tr>
<?php
    } else {
?>
          <tr>
            <td class="main"><b><?php echo sprintf(TEXT_FILE_DOES_NOT_EXIST, $file); ?></b></td>
          </tr>
          <tr>
            <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td><?php echo '<a href="' . zen_href_link($_GET['filename'], 'lngdir=' . $_SESSION['language']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
          </tr>
<?php
    }
  } else {
    $filename = $_SESSION['language'] . '.php';
?>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="smallText"><a href="<?php echo zen_href_link($_GET['filename'], 'lngdir=' . $_SESSION['language'] . '&filename=' . $filename); ?>"><b><?php echo $filename; ?></b></a></td>
<?php
    $dir = dir(DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']);
    $left = false;
    if ($dir) {
      $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
      while ($file = $dir->read()) {
        if (substr($file, strrpos($file, '.')) == $file_extension) {
          echo '                <td class="smallText"><a href="' . zen_href_link($_GET['filename'], 'lngdir=' . $_SESSION['language'] . '&filename=' . $file) . '">' . $file . '</a></td>' . "\n";
          if (!$left) {
            echo '              </tr>' . "\n" .
                 '              <tr>' . "\n";
          }
          $left = !$left;
        }
      }
      $dir->close();
    }
?>

              </tr>
            </table></td>
          </tr>
<?php
  }
?>
        </table></td>
<?php } // filename ?>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                   adminhome/developers_tool_kit.php                                                                   0000755 0001012 0001007 00000115411 11401127066 017754  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: developers_tool_kit.php 16569 2010-06-01 11:52:37Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $languages = zen_get_languages();

  $configuration_key_lookup = zen_db_prepare_input($_POST['configuration_key'], false);
  if (isset($_GET['configuration_key_lookup']) && $_GET['configuration_key_lookup'] != '') {
    $configuration_key_lookup = strtoupper($_GET['configuration_key_lookup']);
    $_POST['configuration_key'] = strtoupper($_GET['configuration_key_lookup']);
    $_POST['zv_files'] = 1;
    $_POST['zv_filestype'] = $_POST['zv_filestype'];
    $_POST['case_sensitive'] = $_POST['case_sensitive'];
  }

  function getDirList ($dirName, $filetypes = 1) {
    global $directory_array, $sub_dir_files;
// add directory name to the sub_dir_files list;
    $sub_dir_files[] = $dirName;
    $d = @dir($dirName);
    $file_extension = '.php';
    if ($d) {
      while($entry = $d->read()) {
        if ($entry != "." && $entry != "..") {
          if (is_dir($dirName."/".$entry)) {
            if ($entry == 'CVS') {
            // skip
            } else {
              getDirList($dirName."/".$entry);
            }
          } else {
            if (preg_match('/\\' . $file_extension . '$/', $entry) > 0) {
//echo 'I AM HERE 2 ' . $dirName."/".$entry . '<br>';
//            $directory_array[] .= $dirName."/".$entry;
            } else {
//echo 'I AM HERE 3 ' . $dirName."/".$entry . '<br>';
            }
          }
        }
      }
      $d->close();
      unset($d);
    }

    return $sub_dir_files;
  }

  function zen_display_files($include_root = false, $filetypesincluded = 1) {
    global $check_directory, $found, $configuration_key_lookup;
    global $db;
    $directory_array = array();
    for ($i = 0, $n = sizeof($check_directory); $i < $n; $i++) {
//echo 'I SEE ' . $check_directory[$i] . '<br>';

      $dir_check = $check_directory[$i];

      switch($filetypesincluded) {
        case(1):
          $file_extensions = array('.php');
          break;
        case(2):
          $file_extensions = array('.php', '.css');
          break;
        case(3):
          $file_extensions = array('.css');
          break;
        case(4):
          $file_extensions = array('.html', '.txt');
          break;
        default:
          $file_extensions = array('.php', '.css');
          break;
      }

      if ($dir = @dir($dir_check)) {
        while ($file = $dir->read()) {
          if (!is_dir($dir_check . $file)) {
            foreach($file_extensions as $extension) {
              if (preg_match('/\\' . $extension . '$/', $file) > 0) {
                $directory_array[] = $dir_check . $file;
              }
            }
          }
        }
        if (sizeof($directory_array)) {
          sort($directory_array);
        }
        $dir->close();
        unset($dir);
      }
    }

    if ($include_root == true) {
      $original_array = $directory_array;
      $root_array = array();
// if not html/txt
    if ($filetypesincluded != 4) {
      $root_array[] = DIR_FS_CATALOG . 'index.php';
      $root_array[] = DIR_FS_CATALOG . 'ipn_main_handler.php';
      $root_array[] = DIR_FS_CATALOG . 'ipn_test.php';
      $root_array[] = DIR_FS_CATALOG . 'ipn_test_return.php';
      $root_array[] = DIR_FS_CATALOG . 'page_not_found.php';
    }

      $root_array[] = DIR_FS_CATALOG . 'nddbc.html';
      $new_array = array_merge($root_array, $original_array);
      $directory_array = $new_array;
    }

// show path and filename
    if (strtoupper($configuration_key_lookup) == $configuration_key_lookup) {
      while (strstr($configuration_key_lookup, '"')) $configuration_key_lookup = str_replace('"', '', $configuration_key_lookup);
      while (strstr($configuration_key_lookup, "'")) $configuration_key_lookup = str_replace("'", '', $configuration_key_lookup);

      // if appears to be a constant ask about configuration table
      $check_database = true;
      $check_configure = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key='" . strtoupper($configuration_key_lookup) . "'");
      if ($check_configure->RecordCount() < 1) {
        $check_configure = $db->Execute("select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key='" . strtoupper($configuration_key_lookup) . "'");
      }
      if ($check_configure->RecordCount() >= 1) {
        $links = '<strong><span class="alert">' . TEXT_SEARCH_DATABASE_TABLES . '</span></strong> ' . '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=' . 'locate_configuration' . '&configuration_key_lookup=' . $configuration_key_lookup) . '">' . $configuration_key_lookup . '</a><br /><br />';
      } else {
        // do nothing
      }
    } else {
      // don't ask about configuration table
    }
//die('I SEE ' . $check_configure->RecordCount() . ' vs ' . $check_database);
    echo '<table border="0" width="100%" cellspacing="2" cellpadding="1" align="center">' . "\n";
    if (isset($check_database ) && ($check_database == true && $check_configure->RecordCount() >= 1)) {
      // only ask if found
      echo '<tr><td>' . $links . '</td></tr>';
    }
    echo '<tr class="infoBoxContent"><td class="dataTableHeadingContent">' . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . TEXT_INFO_SEARCHING . sizeof($directory_array) . TEXT_INFO_FILES_FOR . $configuration_key_lookup . '</td></tr></table>' . "\n\n";
    echo '<tr><td>&nbsp;</td></tr>';

// check all files located
    $file_cnt = 0;
    $cnt_found=0;
    for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
    // build file content of matching lines
      $file_cnt++;
      $file = $directory_array[$i];
//echo 'I SEE ' . $directory_array[$i] . '<br>';
      // clean path name
      while (strstr($file, '//')) $file = str_replace('//', '/', $file);

      $show_file = '';
      if (file_exists($file)) {
        $show_file .= "\n" . '<table border="2" width="95%" cellspacing="2" cellpadding="1" align="center"><tr><td class="main">' . "\n";
        $show_file .= '<tr class="infoBoxContent"><td class="dataTableHeadingContent">';
        $show_file .= '<strong>' . $file . '</strong>';
        $show_file .= '</td></tr>';
        $show_file .= '<tr><td class="main">';

        // put file into an array to be scanned
        $lines = file($file);
        $found_line = 'false';
        // loop through the array, show line and line numbers
        $cnt_lines = 0;
        foreach ($lines as $line_num => $line) {
          $cnt_lines++;
          if (isset($_POST['case_sensitive']) && $_POST['case_sensitive']) {
            $check_case = strstr($line, $configuration_key_lookup);
          } else {
            $check_case = strstr(strtoupper($line), strtoupper($configuration_key_lookup));
          }
          if ($check_case) {
            $found_line= 'true';
            $found = 'true';
            $cnt_found++;
            $show_file .= "<br />Line #<strong>{$line_num}</strong> : " ;
            //prevent db pwd from being displayed, for sake of security
            $show_file .= (substr_count($line,"'DB_SERVER_PASSWORD'")) ? '***HIDDEN***' : htmlspecialchars($line, ENT_QUOTES, CHARSET);
            $show_file .= "<br />\n";
          } else {
            if ($cnt_lines >= 5) {
//            $show_file .= ' .';
              $cnt_lines=0;
            }
          }
        }
      }
      $show_file .= '</td></tr></table>' . "\n";

      // if there was a match, show lines
      if ($found_line == 'true') {
        echo $show_file . '<table><tr><td>&nbsp;</td></tr></table>';
      } // show file
    }
    echo '<table border="0" width="100%" cellspacing="2" cellpadding="1" align="center"><tr class="infoBoxContent"><td class="dataTableHeadingContent">' . TEXT_INFO_MATCHES_FOUND . $cnt_found . '</td></tr></table>';
  } // zen_display_files


  $products_filter = (isset($_GET['products_filter']) ? $_GET['products_filter'] : (isset($products_filter) ? $products_filter : ''));

  $action = (isset($_GET['action']) ? $_GET['action'] : '');
  // don't do any 'action' if clicked on the Check for Updates button
  if (isset($_GET['vcheck']) && $_GET['vcheck']=='yes') $action = '';

  $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);
  $found= 'true';

  switch($action) {
    case ('locate_configuration'):
      if ($configuration_key_lookup == '') {
        $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
        zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
      }
      $found = 'false';
      $zv_files_group = $_POST['zv_files'];

      $check_configure = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key='" . $_POST['configuration_key'] . "'");
      if ($check_configure->RecordCount() < 1) {
        $check_configure = $db->Execute("select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key='" . $_POST['configuration_key'] . "'");
        if ($check_configure->RecordCount() < 1) {
          // build filenames to search
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all english.php files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES;
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/extra_definitions/' . $template_dir . '/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/payment/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/shipping/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/order_total/';
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language']. '/modules/product_types/';
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES;
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/newsletters/';
              break;
            case (2): // all catalog /language/*.php
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES;
              break;
            case (3): // all catalog /language/english/*.php
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/';
              break;
            case (4): // all admin /language/*.php
              $check_directory = array();
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES;
              break;
            case (5): // all admin /language/english/*.php
              // set directories and files names
              $check_directory = array();
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
              break;
            } // eof: switch

              // Check for new databases and filename in extra_datafiles directory

              zen_display_files();

        } else {
          $show_products_type_layout = 'true';
          $show_configuration_info = 'true';
          $found = 'true';
        }
      } else {
        $show_products_type_layout = 'false';
        $show_configuration_info = 'true';
        $found = 'true';
      }

      break;

    case ('locate_function'):
      if ($configuration_key_lookup == '') {
        $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
        zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
      }
      $found = 'false';
      $zv_files_group = $_POST['zv_files'];

          // build filenames to search
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all admin/catalog function files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS;
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/';
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS;
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS . 'extra_functions/';
              break;
            case (2): // all catalog function files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS;
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/';
              break;
            case (3): // all admin function files
              $check_directory = array();
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS;
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_FUNCTIONS . 'extra_functions/';
              break;
            } // eof: switch

              // Check for new databases and filename in extra_datafiles directory

              zen_display_files();

      break;

    case ('locate_class'):
      if ($configuration_key_lookup == '') {
        $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
        zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
      }
      $found = 'false';
      $zv_files_group = $_POST['zv_files'];

          // build filenames to search
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all admin/catalog classes files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_CLASSES;
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_CLASSES;
              break;
            case (2): // all catalog classes files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG . DIR_WS_CLASSES;
              break;
            case (3): // all admin function files
              $check_directory = array();
              $check_directory[] = DIR_FS_ADMIN . DIR_WS_CLASSES;
              break;
            } // eof: switch

              // Check for new databases and filename in extra_datafiles directory

              zen_display_files();

      break;

    case ('locate_template'):
      if ($configuration_key_lookup == '') {
        $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
        zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
      }
      $found = 'false';
      $zv_files_group = $_POST['zv_files'];

          // build filenames to search
          switch ($zv_files_group) {
            case (0): // none
              $filename_listing = '';
              break;
            case (1): // all template files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/templates' . '/';
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/sideboxes' . '/';
              $check_directory[] = DIR_FS_CATALOG_MODULES;
              $check_directory[] = DIR_FS_CATALOG_MODULES . 'sideboxes/';

              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/templates' . '/';
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/sideboxes' . '/';

              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG_MODULES . 'pages');

              $check_dir = array_merge($check_directory, $sub_dir_files);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $check_directory[] = $check_dir[$i] . '/';
              }

              break;
            case (2): // all /templates files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/templates' . '/';
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/templates' . '/';
              break;
            case (3): // all sideboxes files
              $check_directory = array();
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . 'template_default/sideboxes' . '/';
              $check_directory[] = DIR_FS_CATALOG_MODULES . 'sideboxes/';
              $check_directory[] = DIR_FS_CATALOG_TEMPLATES . $template_dir . '/sideboxes' . '/';
              break;
            case (4): // all /pages files
              $check_directory = array();
              //$check_directory[] = DIR_FS_CATALOG_MODULES . 'pages/';
              $sub_dir_files = array();
              getDirList(DIR_FS_CATALOG_MODULES . 'pages');

              $check_dir = array_merge($check_directory, $sub_dir_files);
              for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
                $check_directory[] = $check_dir[$i] . '/';
              }

              break;
            } // eof: switch

              // Check for new databases and filename in extra_datafiles directory

              zen_display_files();

      break;


/// all files
    case ('locate_all_files'):
      $zv_check_root = false;
      if ($configuration_key_lookup == '') {
        $messageStack->add_session(ERROR_CONFIGURATION_KEY_NOT_ENTERED, 'caution');
        zen_redirect(zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT));
      }
      $found = 'false';
      $zv_files_group = $_POST['zv_files'];
      $zv_filestype_group = $_POST['zv_filestype'];
//echo 'settings: ' . '$zv_files_group: ' . $zv_files_group . '$zv_filestype_group: ' . $zv_filestype_group . '<br>';
//echo 'Who am I template ' . $template_dir . ' sess lang ' . $_SESSION['language'];
      switch ($zv_files_group) {
        case (0): // none
          $filename_listing = '';
          break;
        case (1): // all
          $zv_check_root = true;
          $filename_listing = '';

          $check_directory = array();

// get includes
          $sub_dir_files = array();
          getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
          $sub_dir_files_catalog = $sub_dir_files;

// get email
          $sub_dir_files = array();
          getDirList(DIR_FS_EMAIL_TEMPLATES, $zv_filestype_group);
          $sub_dir_files_email = $sub_dir_files;

// get admin
          $sub_dir_files = array();
          getDirList(DIR_FS_ADMIN, $zv_filestype_group);
          $sub_dir_files_admin= $sub_dir_files;

          $check_dir = array_merge($sub_dir_files_catalog, $sub_dir_files_email, $sub_dir_files_admin);
          for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
            $check_directory[] = $check_dir[$i] . '/';
          }
          break;

        case (2): // all catalog
          $zv_check_root = true;
          $filename_listing = '';

          $check_directory = array();

          $sub_dir_files = array();
          getDirList(DIR_FS_CATALOG . DIR_WS_INCLUDES, $zv_filestype_group);
          $sub_dir_files_catalog = $sub_dir_files;

          $check_dir = array_merge($sub_dir_files_catalog);
          for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
            $zv_add_dir= str_replace('//', '/', $check_dir[$i] . '/');
            if (strstr($zv_add_dir, DIR_WS_ADMIN) == '') {
              $check_directory[] = $zv_add_dir;
            }
          }
          break;

        case (3): // all admin
          $zv_check_root = false;
          $filename_listing = '';

          $check_directory = array();

          $sub_dir_files = array();
          getDirList(DIR_FS_ADMIN, $zv_filestype_group);
          $sub_dir_files_admin = $sub_dir_files;

          $check_dir = array_merge($sub_dir_files_admin);
          for ($i = 0, $n = sizeof($check_dir); $i < $n; $i++) {
            $check_directory[] = $check_dir[$i] . '/';
          }
          break;
        }
          zen_display_files($zv_check_root, $zv_filestype_group);

      break;
    } // eof: action

    // if no matches in either databases or selected language directory give an error
    if ($found == 'false') {
      $messageStack->add(ERROR_CONFIGURATION_KEY_NOT_FOUND . ' ' . $configuration_key_lookup, 'caution');
    } elseif ($action != '') {
      echo '<table width="90%" align="center"><tr><td>' . zen_draw_separator('pixel_black.gif', '100%', '2') . '</td></tr><tr><td>&nbsp;</td></tr></table>' . "\n";
    }

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>

<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
        <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
      </tr>

<?php
if (isset($show_configuration_info) && $show_configuration_info == 'true') {
  $show_configuration_info = 'false';
?>
      <tr><td colspan="2">
        <table border="3" cellspacing="4" cellpadding="4">
          <tr class="infoBoxContent">
            <td colspan="2" class="pageHeading" align="center"><?php echo TABLE_CONFIGURATION_TABLE; ?></td>
          </tr>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_KEY; ?></td>
            <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_key']; ?></td>
          </tr>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_TITLE; ?></td>
            <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_title']; ?></td>
          </tr>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_DESCRIPTION; ?></td>
            <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_description']; ?></td>
          </tr>
<?php
  if ($show_products_type_layout == 'true') {
    $check_configure_group = $db->Execute("select * from " . TABLE_PRODUCT_TYPES . " where type_id='" . $check_configure->fields['product_type_id'] . "'");
  } else {
    $check_configure_group = $db->Execute("select * from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id='" . $check_configure->fields['configuration_group_id'] . "'");
  }
?>

<?php
  if ($show_products_type_layout == 'true') {
?>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_GROUP; ?></td>
            <td class="dataTableHeadingContentWhois"><?php echo 'Product Type Layout'; ?></td>
          </tr>
<?php } else { ?>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_VALUE; ?></td>
            <td class="dataTableHeadingContentWhois"><?php echo $check_configure->fields['configuration_value']; ?></td>
          </tr>
          <tr>
            <td class="infoBoxHeading"><?php echo TABLE_TITLE_GROUP; ?></td>
            <td class="dataTableHeadingContentWhois">
            <?php
              if ($check_configure_group->fields['configuration_group_id'] == '6') {
                $id_note = TEXT_INFO_CONFIGURATION_HIDDEN;
              } else {
                $id_note = '';
              }
              echo 'ID#' . $check_configure_group->fields['configuration_group_id'] . ' ' . $check_configure_group->fields['configuration_group_title'] . $id_note;
            ?>
            </td>
          </tr>
<?php } ?>
          <tr>
            <td class="main" align="center" valign="middle">
              <?php
                if ($show_products_type_layout == 'false' and ($check_configure->fields['configuration_id'] != 0 and $check_configure->fields['configuration_group_id'] != 6)) {
                  echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $check_configure_group->fields['configuration_group_id'] . '&cID=' . $check_configure->fields['configuration_id']) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
                } else {
                  $page= '';
                  if (strstr($check_configure->fields['configuration_key'], 'MODULE_SHIPPING')) $page .= 'shipping';
                  if (strstr($check_configure->fields['configuration_key'], 'MODULE_PAYMENT')) $page .= 'payment';
                  if (strstr($check_configure->fields['configuration_key'], 'MODULE_ORDER_TOTAL')) $page .= 'ordertotal';

                  if ($show_products_type_layout == 'true') {
                    echo '<a href="' . zen_href_link(FILENAME_PRODUCT_TYPES) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
                  } else {
                    if ($page != '') {
                      echo '<a href="' . zen_href_link(FILENAME_MODULES, 'set=' . $page) . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>';
                    } else {
                      echo TEXT_INFO_NO_EDIT_AVAILABLE . '<br />';
                    }
                  }
                }
              ?>
              </td>
            <td class="main" align="center" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
          </tr>
          <tr class="infoBoxContent">
            <td colspan="2" class="pageHeading" align="center">
<?php
      $links = '<br /><strong><span class="alert">' . TEXT_SEARCH_ALL_FILES . '</span></strong> ' . '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=' . 'locate_all_files' . '&configuration_key_lookup=' . $configuration_key_lookup . '&zv_files=1') . '">' . $configuration_key_lookup . '</a><br />';
      echo $links;
?>
            </td>
          </tr>
        </table>
      </td></tr>
<?php
} else {
?>

<?php
// disabled and here for an example
if (false) {
?>
<!-- bof: update all products price sorter -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main" align="left" valign="top"><?php echo TEXT_INFO_PRODUCTS_PRICE_SORTER_UPDATE; ?></td>
            <td class="main" align="right" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=update_all_products_price_sorter') . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>'; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: update all products price sorter -->
<?php } ?>

<!-- bof: Locate a configuration constant -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_CONFIGURATION_CONSTANT; ?></td>
          </tr>

          <tr><form name = "locate_configure" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_configuration', 'NONSSL'); ?>" method="post">
            <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
                                              array('id' => '1', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_LANGUAGE),
                                              array('id' => '2', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG),
                                              array('id' => '3', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_CATALOG_TEMPLATE),
                                              array('id' => '4', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN),
                                              array('id' => '5', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ADMIN_LANGUAGE)
                                                    );
//                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)

                echo '<strong>' . TEXT_LANGUAGE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
              ?>
            </td>
            <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
          </form></tr>
          <tr>
            <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: Locate a configuration constant -->


<!-- bof: Locate a function -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_FUNCTION_CONSTANT; ?></td>
          </tr>

          <tr><form name = "locate_function" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_function', 'NONSSL'); ?>"' method="post">
            <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
                                              array('id' => '1', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT),
                                              array('id' => '2', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT_CATALOG),
                                              array('id' => '3', 'text' => TEXT_FUNCTION_LOOKUP_CURRENT_ADMIN)
                                                    );
//                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)

                echo '<strong>' . TEXT_FUNCTION_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
              ?>
            </td>
            <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
          </form></tr>
          <tr>
            <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: Locate a function -->

<!-- bof: Locate a class -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_CLASS_CONSTANT; ?></td>
          </tr>

          <tr><form name = "locate_class" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_class', 'NONSSL'); ?>"' method="post">
            <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
                                              array('id' => '1', 'text' => TEXT_CLASS_LOOKUP_CURRENT),
                                              array('id' => '2', 'text' => TEXT_CLASS_LOOKUP_CURRENT_CATALOG),
                                              array('id' => '3', 'text' => TEXT_CLASS_LOOKUP_CURRENT_ADMIN)
                                                    );
//                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)

                echo '<strong>' . TEXT_CLASS_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
              ?>
            </td>
            <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
          </form></tr>
          <tr>
            <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: Locate a class -->

<!-- bof: Locate a template files -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="3" class="main" align="left" valign="middle"><?php echo TEXT_TEMPLATE_CONSTANT; ?></td>
          </tr>

          <tr><form name = "locate_template" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_template', 'NONSSL'); ?>"' method="post">
            <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
                                              array('id' => '1', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT),
                                              array('id' => '2', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_TEMPLATES),
                                              array('id' => '3', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_SIDEBOXES),
                                              array('id' => '4', 'text' => TEXT_TEMPLATE_LOOKUP_CURRENT_PAGES)
                                                    );
//                                              array('id' => '6', 'text' => TEXT_LANGUAGE_LOOKUP_CURRENT_ALL)

                echo '<strong>' . TEXT_TEMPLATE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
              ?>
            </td>
            <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
          </form></tr>
          <tr>
            <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: Locate template Files -->


<!-- bof: Locate all files -->
      <tr>
        <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="4" class="main" align="left" valign="middle"><?php echo TEXT_ALL_FILES_CONSTANT; ?></td>
          </tr>

          <tr><form name = "locate_all_files" action="<?php echo zen_href_link(FILENAME_DEVELOPERS_TOOL_KIT, 'action=locate_all_files', 'NONSSL'); ?>" method="post">
            <td class="main" align="left" valign="bottom"><?php echo '<strong>' . TEXT_CONFIGURATION_KEY . '</strong>' . '<br />' . zen_draw_input_field('configuration_key', '', ' size="40" '); ?></td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup = array(array('id' => '0', 'text' => TEXT_LOOKUP_NONE),
                                              array('id' => '1', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT),
                                              array('id' => '2', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT_CATALOG),
                                              array('id' => '3', 'text' => TEXT_ALL_FILES_LOOKUP_CURRENT_ADMIN)
                                                    );

                echo '<strong>' . TEXT_ALL_FILES_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_files', $za_lookup, '0');
              ?>
            </td>
            <td class="main" align="left" valign="middle">
              <?php
                $za_lookup_filetype = array(
                                              array('id' => '1', 'text' => TEXT_ALL_FILES_LOOKUP_PHP),
                                              array('id' => '2', 'text' => TEXT_ALL_FILES_LOOKUP_PHPCSS),
                                              array('id' => '3', 'text' => TEXT_ALL_FILES_LOOKUP_CSS),
                                              array('id' => '4', 'text' => TEXT_ALL_FILES_LOOKUP_HTMLTXT)
                                                    );

                echo '<strong>' . TEXT_ALL_FILESTYPE_LOOKUPS . '</strong>' . '<br />' . zen_draw_pull_down_menu('zv_filestype', $za_lookup_filetype, '0');
                echo '<strong>' . TEXT_CASE_SENSITIVE . '</strong>' . zen_draw_checkbox_field('case_sensitive', true);
              ?>
            </td>
            <td class="main" align="right" valign="bottom"><?php echo zen_image_submit('button_search.gif', IMAGE_SEARCH); ?></td>
          </form></tr>
          <tr>
            <td colspan="4" class="main" align="left" valign="top"><?php echo TEXT_INFO_CONFIGURATION_UPDATE; ?></td>
          </tr>
        </table></td>
      </tr>
<!-- eof: Locate all files -->

<?php
} // eof configure
?>
      <tr>
        <td colspan="2"><?php echo '<br />' . zen_draw_separator('pixel_black.gif', '100%', '2'); ?></td>
      </tr>


    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                       adminhome/document_general.php                                                                      0000755 0001012 0001007 00000055761 10606045744 017236  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: document_general.php 6131 2007-04-08 06:56:51Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_MODULES . 'prod_cat_header_code.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'setflag':
        if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
          if (isset($_GET['pID'])) {
            zen_set_product_status($_GET['pID'], $_GET['flag']);
          }
        }

        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
        break;

      case 'delete_product_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'delete_product_confirm.php');
         }
        break;
      case 'move_product_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/move_product_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/move_product_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'move_product_confirm.php');
         }
        break;
      case 'insert_product_meta_tags':
      case 'update_product_meta_tags':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product_meta_tags.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product_meta_tags.php');
         } else {
          require(DIR_WS_MODULES . 'update_product_meta_tags.php');
         }
        break;
      case 'insert_product':
      case 'update_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product.php');
         } else {
          require(DIR_WS_MODULES . 'update_product.php');
         }
        break;
      case 'copy_to_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/copy_to_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/copy_to_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'copy_to_confirm.php');
         }
        break;
      case 'new_product_preview_meta_tags':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview_meta_tags.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview_meta_tags.php');
         } else {
          require(DIR_WS_MODULES . 'new_product_preview_meta_tags.php');
         }
        break;
      case 'new_product_preview':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php');
         } else {
          require(DIR_WS_MODULES . 'new_product_preview.php');
         }
        break;

    }
  }

// check if the catalog image directory exists
  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
    $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
if (typeof _editor_url == "string") HTMLArea.replaceAll();
 }
 // -->
</script>
<?php if ($action != 'new_product_meta_tags' && $editor_handler != '') include ($editor_handler); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top">
<?php
  if ($action == 'new_product' or $action == 'new_product_meta_tags') {

    if ($action == 'new_product_meta_tags') {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info_metatags.php');
    } else {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info.php');
    }

  } elseif ($action == 'new_product_preview' or $action == 'new_product_preview_meta_tags') {
    if ($action == 'new_product_preview_meta_tags') {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/preview_info_meta_tags.php');
    } else {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/preview_info.php');
    }

  } else {

  require(DIR_WS_MODULES . 'category_product_listing.php');

    $heading = array();
    $contents = array();
    switch ($action) {
      case 'new_category':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');

        $contents = array('form' => zen_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
        $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);

        $category_inputs_string = '';
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
        }

        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));

        $dir = @dir(DIR_FS_CATALOG_IMAGES);
        $dir_info[] = array('id' => '', 'text' => "Main Directory");
        while ($file = $dir->read()) {
          if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
            $dir_info[] = array('id' => $file . '/', 'text' => $file);
          }
        }
        $dir->close();

        $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);
        $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));

        $contents[] = array('text' => '<br />' . TEXT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', '', 'size="4"'));
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'edit_category':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');

        $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
        $contents[] = array('text' => TEXT_EDIT_INTRO);

        $category_inputs_string = '';
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', zen_get_category_name($cInfo->categories_id, $languages[$i]['id']), zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
        }
        $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
        $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));

        $dir = @dir(DIR_FS_CATALOG_IMAGES);
        $dir_info[] = array('id' => '', 'text' => "Main Directory");
        while ($file = $dir->read()) {
          if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
            $dir_info[] = array('id' => $file . '/', 'text' => $file);
          }
        }
        $dir->close();

        $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);
        $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
        $contents[] = array('text' => '<br>' . zen_info_image($cInfo->categories_image, $cInfo->categories_name));
        $contents[] = array('text' => '<br>' . $cInfo->categories_image);

        $contents[] = array('text' => '<br />' . TEXT_EDIT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'delete_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_delete_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_delete_product.php');
         } else {
          require(DIR_WS_MODULES . 'sidebox_delete_product.php');
         }
        break;
      case 'move_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_move_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_move_product.php');
         } else {
          require(DIR_WS_MODULES . 'sidebox_move_product.php');
         }
        break;
      case 'copy_to':
        $copy_attributes_delete_first = '0';
        $copy_attributes_duplicates_skipped = '0';
        $copy_attributes_duplicates_overwrite = '0';
        $copy_attributes_include_downloads = '1';
        $copy_attributes_include_filename = '1';

        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
// WebMakers.com Added: Split Page
        if (empty($pInfo->products_id)) {
          $pInfo->products_id= $pID;
        }

        $contents = array('form' => zen_draw_form('copy_to', $type_admin_handler, 'action=copy_to_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
        $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_PRODUCT . '<br /><b>' . $pInfo->products_name  . ' ID#' . $pInfo->products_id . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES . '<br />' . zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id));
        $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);

        // only ask about attributes if they exist
        if (zen_has_product_attributes($pInfo->products_id, 'false')) {
          $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
          $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_ONLY);
          $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
// future          $contents[] = array('align' => 'center', 'text' => '<br />' . ATTRIBUTES_NAMES_HELPER . '<br />' . zen_draw_separator('pixel_trans.gif', '1', '10'));
          $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
        }

        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        $contents[] = array('text' => '</form>');

        $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
        $contents[] = array('text' => '<form action="' . FILENAME_PRODUCTS_TO_CATEGORIES . '.php' . '?products_filter=' . $pInfo->products_id . '" method="post">');
        $contents[] = array('align' => 'center', 'text' => '<input type="submit" value="' . BUTTON_PRODUCTS_TO_CATEGORIES . '"></form>');

        break;
// attribute features
    case 'attribute_features':
        $copy_attributes_delete_first = '0';
        $copy_attributes_duplicates_skipped = '0';
        $copy_attributes_duplicates_overwrite = '0';
        $copy_attributes_include_downloads = '1';
        $copy_attributes_include_filename = '1';
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');

        $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' .
                                                           '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' .
                                                           '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' .
                                                           '<br /><br />');
        $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');

        $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;

// attribute copier to product
    case 'attribute_features_copy_to_product':
      $_GET['products_update_id'] = '';
      // excluded current product from the pull down menu of products
      $products_exclude_array = array();
      $products_exclude_array[] = $pInfo->products_id;

      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
      $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_product&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down('products_update_id', '', $products_exclude_array, true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;

// attribute copier to product
    case 'attribute_features_copy_to_category':
      $_GET['categories_update_id'] = '';

      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
      $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_category&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('categories_update_id', $_GET['categories_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down_categories('categories_update_id', '', '', true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;

    } // switch

    if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
      echo '            <td width="25%" valign="top">' . "\n";

      $box = new box;
      echo $box->infoBox($heading, $contents);

      echo '            </td>' . "\n";
    }
?>

          </tr>
          <tr>
<?php
// Split Page
if ($products_query_numrows > 0) {
  if (empty($pInfo->products_id)) {
    $pInfo->products_id= $pID;
  }
?>
            <td class="smallText" align="right"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y')) ); ?></td>

<?php
}
// Split Page
?>
          </tr>
        </table></td>
      </tr>
    </table>
<?php
  }
?>
    </td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
               adminhome/document_product.php                                                                      0000755 0001012 0001007 00000055757 10606045744 017306  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: document_product.php 6131 2007-04-08 06:56:51Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_MODULES . 'prod_cat_header_code.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'setflag':
        if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
          if (isset($_GET['pID'])) {
            zen_set_product_status($_GET['pID'], $_GET['flag']);
          }
        }

        zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
        break;

      case 'delete_product_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'delete_product_confirm.php');
         }
        break;
      case 'move_product_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/move_product_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/move_product_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'move_product_confirm.php');
         }
        break;
      case 'insert_product_meta_tags':
      case 'update_product_meta_tags':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product_meta_tags.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product_meta_tags.php');
         } else {
          require(DIR_WS_MODULES . 'update_product_meta_tags.php');
         }
        break;
      case 'insert_product':
      case 'update_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/update_product.php');
         } else {
          require(DIR_WS_MODULES . 'update_product.php');
         }
        break;
      case 'copy_to_confirm':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/copy_to_confirm.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/copy_to_confirm.php');
         } else {
          require(DIR_WS_MODULES . 'copy_to_confirm.php');
         }
        break;
      case 'new_product_preview_meta_tags':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview_meta_tags.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview_meta_tags.php');
         } else {
          require(DIR_WS_MODULES . 'new_product_preview_meta_tags.php');
         }
        break;
      case 'new_product_preview':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php');
         } else {
          require(DIR_WS_MODULES . 'new_product_preview.php');
         }
        break;

    }
  }

// check if the catalog image directory exists
  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
    if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
    $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
if (typeof _editor_url == "string") HTMLArea.replaceAll();
 }
 // -->
</script>
<?php if ($action != 'new_product_meta_tags' && $editor_handler != '') include ($editor_handler); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top">
<?php
  if ($action == 'new_product' or $action == 'new_product_meta_tags') {

    if ($action == 'new_product_meta_tags') {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info_metatags.php');
    } else {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/collect_info.php');
    }

  } elseif ($action == 'new_product_preview' or $action == 'new_product_preview_meta_tags') {
    if ($action == 'new_product_preview_meta_tags') {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/preview_info_meta_tags.php');
    } else {
      require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/preview_info.php');
    }

  } else {

  require(DIR_WS_MODULES . 'category_product_listing.php');

    $heading = array();
    $contents = array();
    switch ($action) {
      case 'new_category':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_CATEGORY . '</b>');

        $contents = array('form' => zen_draw_form('newcategory', FILENAME_CATEGORIES, 'action=insert_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"'));
        $contents[] = array('text' => TEXT_NEW_CATEGORY_INTRO);

        $category_inputs_string = '';
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
        }

        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));

        $dir = @dir(DIR_FS_CATALOG_IMAGES);
        $dir_info[] = array('id' => '', 'text' => "Main Directory");
        while ($file = $dir->read()) {
          if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
            $dir_info[] = array('id' => $file . '/', 'text' => $file);
          }
        }
        $dir->close();

        $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);
        $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));

        $contents[] = array('text' => '<br />' . TEXT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', '', 'size="4"'));
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'edit_category':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');

        $contents = array('form' => zen_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . zen_draw_hidden_field('categories_id', $cInfo->categories_id));
        $contents[] = array('text' => TEXT_EDIT_INTRO);

        $category_inputs_string = '';
        $languages = zen_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          $category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', zen_get_category_name($cInfo->categories_id, $languages[$i]['id']), zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
        }
        $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
        $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_IMAGE . '<br />' . zen_draw_file_field('categories_image'));

        $dir = @dir(DIR_FS_CATALOG_IMAGES);
        $dir_info[] = array('id' => '', 'text' => "Main Directory");
        while ($file = $dir->read()) {
          if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
            $dir_info[] = array('id' => $file . '/', 'text' => $file);
          }
        }
        $dir->close();

        $default_directory = substr( $cInfo->categories_image, 0,strpos( $cInfo->categories_image, '/')+1);
        $contents[] = array('text' => TEXT_CATEGORIES_IMAGE_DIR . ' ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory));
        $contents[] = array('text' => '<br>' . zen_info_image($cInfo->categories_image, $cInfo->categories_name));
        $contents[] = array('text' => '<br>' . $cInfo->categories_image);

        $contents[] = array('text' => '<br />' . TEXT_EDIT_SORT_ORDER . '<br />' . zen_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'delete_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_delete_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_delete_product.php');
         } else {
          require(DIR_WS_MODULES . 'sidebox_delete_product.php');
         }
        break;
      case 'move_product':
        if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_move_product.php')) {
          require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/sidebox_move_product.php');
         } else {
          require(DIR_WS_MODULES . 'sidebox_move_product.php');
         }
        break;
      case 'copy_to':
        $copy_attributes_delete_first = '0';
        $copy_attributes_duplicates_skipped = '0';
        $copy_attributes_duplicates_overwrite = '0';
        $copy_attributes_include_downloads = '1';
        $copy_attributes_include_filename = '1';

        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
// WebMakers.com Added: Split Page
        if (empty($pInfo->products_id)) {
          $pInfo->products_id= $pID;
        }

        $contents = array('form' => zen_draw_form('copy_to', $type_admin_handler, 'action=copy_to_confirm&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id));
        $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
        $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_PRODUCT . '<br /><b>' . $pInfo->products_name  . ' ID#' . $pInfo->products_id . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENT_CATEGORIES . '<br /><b>' . zen_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_CATEGORIES . '<br />' . zen_draw_pull_down_menu('categories_id', zen_get_category_tree(), $current_category_id));
        $contents[] = array('text' => '<br />' . TEXT_HOW_TO_COPY . '<br />' . zen_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br />' . zen_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);

        // only ask about attributes if they exist
        if (zen_has_product_attributes($pInfo->products_id, 'false')) {
          $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
          $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_ONLY);
          $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
// future          $contents[] = array('align' => 'center', 'text' => '<br />' . ATTRIBUTES_NAMES_HELPER . '<br />' . zen_draw_separator('pixel_trans.gif', '1', '10'));
          $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
        }

        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        $contents[] = array('text' => '</form>');

        $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
        $contents[] = array('text' => '<form action="' . FILENAME_PRODUCTS_TO_CATEGORIES . '.php' . '?products_filter=' . $pInfo->products_id . '" method="post">');
        $contents[] = array('align' => 'center', 'text' => '<input type="submit" value="' . BUTTON_PRODUCTS_TO_CATEGORIES . '"></form>');

        break;
// attribute features
    case 'attribute_features':
        $copy_attributes_delete_first = '0';
        $copy_attributes_duplicates_skipped = '0';
        $copy_attributes_duplicates_overwrite = '0';
        $copy_attributes_include_downloads = '1';
        $copy_attributes_include_filename = '1';
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');

        $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' .
                                                           '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' .
                                                           '&nbsp;&nbsp;' . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' .
                                                           '<br /><br />');
        $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');

        $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;

// attribute copier to product
    case 'attribute_features_copy_to_product':
      $_GET['products_update_id'] = '';
      // excluded current product from the pull down menu of products
      $products_exclude_array = array();
      $products_exclude_array[] = $pInfo->products_id;

      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
      $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_product&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('products_update_id', $_GET['products_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down('products_update_id', '', $products_exclude_array, true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;

// attribute copier to product
    case 'attribute_features_copy_to_category':
      $_GET['categories_update_id'] = '';

      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
      $contents = array('form' => zen_draw_form('products', FILENAME_CATEGORIES, 'action=update_attributes_copy_to_category&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . zen_draw_hidden_field('products_id', $pInfo->products_id) . zen_draw_hidden_field('categories_update_id', $_GET['categories_update_id']) . zen_draw_hidden_field('copy_attributes', $_GET['copy_attributes']));
      $contents[] = array('text' => '<br />' . TEXT_COPY_ATTRIBUTES_CONDITIONS . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '<br />' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE);
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_draw_products_pull_down_categories('categories_update_id', '', '', true) . '<br /><br />' . zen_image_submit('button_copy_to.gif', IMAGE_COPY_TO) . '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;

    } // switch

    if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
      echo '            <td width="25%" valign="top">' . "\n";

      $box = new box;
      echo $box->infoBox($heading, $contents);

      echo '            </td>' . "\n";
    }
?>

          </tr>
          <tr>
<?php
// Split Page
if ($products_query_numrows > 0) {
  if (empty($pInfo->products_id)) {
    $pInfo->products_id= $pID;
  }
?>
            <td class="smallText" align="right"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '<br>' . $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS_CATEGORIES, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y')) ); ?></td>

<?php
}
// Split Page
?>
          </tr>
        </table></td>
      </tr>
    </table>
<?php
  }
?>
    </td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                 adminhome/downloads_manager.php                                                                     0000755 0001012 0001007 00000040046 11371401314 017362  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: downloads_manager.php 16249 2010-05-09 05:33:16Z ajeh $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $languages = zen_get_languages();

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'insert':
      case 'save':
        $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_filename='" . zen_db_prepare_input($_POST['products_attributes_filename']) . "', products_attributes_maxdays='" . zen_db_prepare_input($_POST['products_attributes_maxdays']) . "', products_attributes_maxcount='" . zen_db_prepare_input($_POST['products_attributes_maxcount']) . "' where products_attributes_id='" . $_GET['padID'] . "'");
        zen_redirect(zen_href_link(FILENAME_DOWNLOADS_MANAGER, 'padID=' . $_GET['padID'] . '&page=' . $_GET['page']));
        break;
    }
  }

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function go_option() {
  if (document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value != "none") {
    location = "<?php echo zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'option_page=' . ($_GET['option_page'] ? $_GET['option_page'] : 1)); ?>&option_order_by="+document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value;
  }
}
//--></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<!-- <body onload="init()"> -->
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr><?php echo zen_draw_form('search', FILENAME_DOWNLOADS_MANAGER, '', 'get'); ?>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="smallText" align="right">
<?php
// show reset search
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    echo '<a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
  }
  echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
  }
?>
            </td>
          </form></tr>
        </table></td>
      </tr>

      <tr>
        <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="smallText" align="center">
              <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . TEXT_INFO_FILENAME_MISSING; ?> &nbsp;&nbsp;&nbsp;<?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . TEXT_INFO_FILENAME_GOOD; ?>
            </td>
          </tr>
        </table></td>
      </tr>

<!-- downloads by product_name//-->
      <tr>
        <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ATTRIBUTES_ID; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_ID; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_MODEL; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OPT_NAME; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_OPT_VALUE; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_TEXT_FILENAME; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_TEXT_MAX_DAYS; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_TEXT_MAX_COUNT; ?></td>
                <td class="dataTableHeadingContent">&nbsp;</td>
              </tr>

<?php
// create search filter
  $search = '';
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    $search = " and pd.products_name like '%" . $keywords . "%' or pad.products_attributes_filename like '%" . $keywords . "%' or pd.products_description like '%" . $keywords . "%' or p.products_model like '%" . $keywords . "%'";
  }

// order of display
  $order_by = " order by pd.products_name ";

// create split page control
  $products_downloads_query_raw = ("select pad.*, pa.*, pd.*, p.* from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa on pad.products_attributes_id = pa.products_attributes_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pa.products_id = pd.products_id and pd.language_id ='" . (int)$_SESSION['languages_id'] . "' left join " . TABLE_PRODUCTS . " p on p.products_id= pd.products_id " . " where pa.products_attributes_id = pad.products_attributes_id" . $search . $order_by);
  $products_downloads_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_DOWNLOADS_MANAGER, $products_downloads_query_raw, $products_downloads_query_numrows);
  $products_downloads_query = $db->Execute($products_downloads_query_raw);

  while (!$products_downloads_query->EOF) {

    if ((!isset($_GET['padID']) || (isset($_GET['padID']) && ($_GET['padID'] == $products_downloads_query->fields['products_attributes_id']))) && !isset($padInfo)) {
      $padInfo_array = $products_downloads_query->fields;
      $padInfo = new objectInfo($padInfo_array);
    }

// Moved to /admin/includes/configure.php
  if (!defined('DIR_FS_DOWNLOAD')) define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

  $filename_is_missing='';
  if ( !file_exists(DIR_FS_DOWNLOAD . $products_downloads_query->fields['products_attributes_filename']) ) {
    $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  } else {
    $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
  }
?>
<?php
      if (isset($padInfo) && is_object($padInfo) && ($products_downloads_query->fields['products_attributes_id'] == $padInfo->products_attributes_id)) {
        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID', 'action')) . 'padID=' . $padInfo->products_attributes_id . '&action=edit' . '&page=' . $_GET['page']) . '\'">' . "\n";
      } else {
        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID')) . 'padID=' . $products_downloads_query->fields['products_attributes_id'] . '&page=' . $_GET['page']) . '\'">' . "\n";
      }
?>

                <td class="smallText"><?php echo $products_downloads_query->fields['products_attributes_id']; ?></td>
                <td class="smallText"><?php echo $products_downloads_query->fields['products_id']; ?></td>
                <td class="smallText"><?php echo $products_downloads_query->fields['products_name']; ?></td>
                <td class="smallText"><?php echo $products_downloads_query->fields['products_model']; ?></td>
                <td class="smallText"><?php echo zen_options_name($products_downloads_query->fields['options_id']); ?></td>
                <td class="smallText"><?php echo zen_values_name($products_downloads_query->fields['options_values_id']); ?></td>
                <td class="smallText"><?php echo $filename_is_missing . '&nbsp;' . $products_downloads_query->fields['products_attributes_filename']; ?></td>
                <td class="smallText"><?php echo $products_downloads_query->fields['products_attributes_maxdays']; ?></td>
                <td class="smallText"><?php echo $products_downloads_query->fields['products_attributes_maxcount']; ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($padInfo) && is_object($padInfo) && ($products_downloads_query->fields['products_attributes_id'] == $padInfo->products_attributes_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID')) . 'padID=' . $products_downloads_query->fields['products_attributes_id'] . '&page=' . $_GET['page']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
  $products_downloads_query->MoveNext();
  }
?>
<?php
// bof: split page control and search filter
?>
              <tr>
                <td colspan="10"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $products_downloads_split->display_count($products_downloads_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DOWNLOADS_MANAGER, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS_DOWNLOADS_MANAGER); ?></td>
<!--
                    <td class="smallText" align="right"><?php echo $products_downloads_split->display_links($products_downloads_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DOWNLOADS_MANAGER, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
-->
                    <td class="smallText" align="right"><?php echo $products_downloads_split->display_links($products_downloads_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DOWNLOADS_MANAGER, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>


                  </tr>
<?php
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
?>
                  <tr>
                    <td align="right" colspan="2"><?php echo '<a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
                  </tr>
<?php
  }
?>
                </table></td>
              </tr>
<?php
// eof: split page control
?>
            </table></td>

<?php
  $heading = array();
  $contents = array();

  switch ($action) {
/*
    case 'confirm':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_PRODUCTS_DOWNLOAD . '</b>');

      $contents = array('form' => zen_draw_form('products_downloads_delete', FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID', 'action')) . 'padID=' . $padInfo->products_attributes_id . '&action=deleteconfirm' . '&page=' . $_GET['page']));
      $contents[] = array('text' => TEXT_DELETE_INTRO . '<br /><br /><b>' . $padInfo->products_name . ' - ' . $padInfo->products_attributes_filename . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID', 'action')) . 'padID=' . $padInfo->products_attributes_id) . '&page=' . $_GET['page'] . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
*/
    case 'edit':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_PRODUCTS_DOWNLOAD . '</b>');

      $contents = array('form' => zen_draw_form('products_downloads_edit', FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID', 'action')) . 'padID=' . $padInfo->products_attributes_id . '&action=save' . '&page=' . $_GET['page']));
      $contents[] = array('text' => '<b>' . TEXT_PRODUCTS_NAME . $padInfo->products_name . '<br />' . TEXT_PRODUCTS_MODEL . $padInfo->products_model . '</b>');
      $contents[] = array('text' => '<br />' . TEXT_INFO_EDIT_INTRO);
      $contents[] = array('text' => '<br />' . TEXT_INFO_FILENAME . '<br />' . zen_draw_input_field('products_attributes_filename', $padInfo->products_attributes_filename));
      $contents[] = array('text' => '<br />' . TEXT_INFO_MAX_DAYS . '<br />' . zen_draw_input_field('products_attributes_maxdays', $padInfo->products_attributes_maxdays));
      $contents[] = array('text' => '<br />' . TEXT_INFO_MAX_COUNT . '<br />' . zen_draw_input_field('products_attributes_maxcount', $padInfo->products_attributes_maxcount));
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, 'padID=' . $padInfo->products_attributes_id) . '&page=' . $_GET['page'] . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (isset($padInfo) && is_object($padInfo)) {
        $heading[] = array('text' => '<b>' . $padInfo->products_attributes_id . ' ' . $padInfo->products_attributes_filename . '</b>');

        $contents[] = array('align' => 'center', 'text' =>
          '<a href="' . zen_href_link(FILENAME_DOWNLOADS_MANAGER, zen_get_all_get_params(array('padID', 'action')) . 'padID=' . $padInfo->products_attributes_id . '&page=' . $_GET['page'].'&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>' .
          '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $padInfo->products_id . '&current_categories_id=' . $padInfo->master_categories_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>'
          );
        $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_NAME . $padInfo->products_name);
        $contents[] = array('text' => TEXT_PRODUCTS_MODEL . $padInfo->products_model);
        $contents[] = array('text' => TEXT_INFO_FILENAME . $padInfo->products_attributes_filename);
        $contents[] = array('text' => TEXT_INFO_MAX_DAYS . $padInfo->products_attributes_maxdays);
        $contents[] = array('text' => TEXT_INFO_MAX_COUNT . $padInfo->products_attributes_maxcount);

      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </td></table>
      </tr>

    </table></td>
<!-- downloads by product_name_eof //-->
  </tr>
</table>
<!-- body_text_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/easypopulate.php                                                                          0000755 0001012 0001007 00000110564 11171165560 016424  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/*
Easy Populate for Zen Cart Copyright 2005 & 2006 Nicholas Keown - langer@zencartbuilder.com
Portions Copyright Zen Cart Developers, osCommerce, Tim Kroeger, and numerous osCommerce contributors (see changelog/history
Released under GPL v2.0
*/

require ('includes/application_top.php');
if(!file_exists(DIR_FS_ADMIN . 'includes/languages/' . $_SESSION['language'] . '/easypopulate.php'))
{
  if (!@include (DIR_FS_ADMIN . 'includes/languages/english/easypopulate.php'))
    die('Language definition files cannot be located. Ensure the file ' . DIR_FS_ADMIN . 'includes/languages/english/easypopulate.php has been uploaded.<br />');
}
if(!file_exists(DIR_FS_ADMIN . 'includes/languages/' . $_SESSION['language'] . '/extra_definitions/easypopulate.php'))
  @include (DIR_FS_ADMIN . 'includes/languages/english/extra_definitions/easypopulate.php');
define('DIR_EP_INCLUDES', DIR_FS_ADMIN . 'includes/easypopulate/');
define('DIR_EP_CLASSES', DIR_FS_ADMIN . 'includes/easypopulate/classes/');
define('ECLIPSE_ROOT', DIR_FS_ADMIN . 'includes/easypopulate/classes/eclipse/');
if (DB_TYPE == 'mysql')
{
  include_once (ECLIPSE_ROOT . 'MyDatabase.php');
  $database =& new eclipseMyDatabase(DB_DATABASE, DB_SERVER);
}
else if (DB_TYPE == 'postgres')
{
  include_once (ECLIPSE_ROOT . 'PgDatabase.php');
  $database =& new eclipsePgDatabase(DB_DATABASE, DB_SERVER);
}
else
{
  die ('Database not defined or supported');
}
require_once (ECLIPSE_ROOT . 'FileWriter.php');
require_once (ECLIPSE_ROOT . 'FileIterator.php');
require_once DIR_EP_CLASSES . 'class.easypopulate.php';
require_once DIR_EP_INCLUDES . 'easypopulate_config.php';
require_once DIR_EP_INCLUDES . 'easypopulate_overrides.php';
if ('true' == EASYPOPULATE_CONFIG_ADV_SMART_TAGS)
  include_once DIR_EP_INCLUDES . 'easypopulate_smart_tags.php';
if (file_exists(DIR_FS_ADMIN . 'easypopulate_test.php'))
  include_once (DIR_FS_ADMIN . 'easypopulate_test.php');



$epMsgStack =& new messageStack;
$database->connect(DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
$ep_languages = array();
$result  = ep_query('SELECT languages_id, code, name FROM (' . TABLE_LANGUAGES . ')');
for ($i = 0; $row = $result->getRow($i, ECLIPSE_DB_ASSOC); $i++)
{
  $ep_languages[$row['languages_id']] = array(
        'id' => $row['languages_id'],
        'code' => $row['code'],
        'name' => $row['name']
        );
  if (DEFAULT_LANGUAGE == $row['code'])
  {
    $language_id_default = $row['languages_id'];
  }
}
$epCategories =& new EpCategories($language_id_default);
@set_time_limit(600);
$display = array();
$config_fail = array();
$epLayout = array();
$epControl = array();
$ep_keys = array('EASYPOPULATE_CONFIG_PRIMARY_INDEX', 'EASYPOPULATE_CONFIG_TEMP_DIR', 'EASYPOPULATE_CONFIG_FILE_DATE_FORMAT', 'EASYPOPULATE_CONFIG_DEFAULT_RAW_TIME', 'EASYPOPULATE_CONFIG_SPLIT_MAX', 'EASYPOPULATE_CONFIG_PRICE_INC_TAX', 'EASYPOPULATE_CONFIG_ZERO_QTY_INACTIVE', 'EASYPOPULATE_CONFIG_CRLB_SUB', 'EASYPOPULATE_CONFIG_ADV_SMART_TAGS', 'EASYPOPULATE_CONFIG_EXPORT_SUFFIX', 'EASYPOPULATE_CONFIG_EXPLICIT_EOR', 'EASYPOPULATE_CONFIG_CATEGORIES_PATH_SEPARATOR', 'EASYPOPULATE_CONFIG_PRODUCT_TYPE_DEFAULT', 'EASYPOPULATE_CONFIG_NEW_ON_NULL_INDEX');
$ep_orphaned_keys = array('EASYPOPULATE_CONFIG_MAX_CATEGORY_LEVELS', 'EASYPOPULATE_CONFIG_DEBUG_LOGGING', 'EASYPOPULATE_CONFIG_SMART_TAGS');
$ep_upgraded_keys = array('EASYPOPULATE_CONFIG_EXPORT_SUFFIX' => 'EASYPOPULATE_EXPORT_SUFFIX');
$ep_version = 'Advanced 3.0.3';
if (!isset($_GET['langer']))
{
  $key_groups = array();
  foreach ($ep_keys as $key)
  {
    if (!defined($key) && !isset($ep_upgraded_keys[$key]))
    {
      $keys_check_fail = true;
    }
    else
    {
      $result =& ep_query('SELECT configuration_group_id FROM ' . TABLE_CONFIGURATION . ' WHERE (configuration_key = \'' . $key . '\')');
      for ($i = 0; $row = $result->getRow($i, ECLIPSE_DB_ASSOC); $i++)
      {
        $key_groups[$row['configuration_group_id']] = $row['configuration_group_id'];
      }
    }
  }
  foreach ($ep_orphaned_keys as $key)
  {
    if (defined($key))
    {
      $keys_check_fail = true;
    }
  }
  if (isset($keys_check_fail) || count($key_groups) !== 1)
  {
    $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_INSTALL';
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_INSTALL_RQD, '<a href="' . zen_href_link(FILENAME_EASYPOPULATE, 'langer=install">'),'</a>'), 'caution');
  }
  else
  {
    $result =& ep_query('SELECT configuration_group_description, configuration_group_id FROM ' . TABLE_CONFIGURATION_GROUP . '
            WHERE (configuration_group_title = \'Easy Populate\')');
    if ($result->getRowCount() > 1)
    {
      for ($i = 0; $check_id = $result->getRow($i, ECLIPSE_DB_ASSOC); $i++)
      {
        if (!isset($key_groups[$check_id['configuration_group_id']]))
        {
          ep_query('DELETE FROM ' . TABLE_CONFIGURATION_GROUP . ' WHERE configuration_group_id = ' . (int)$check_id['configuration_group_id']);
        }
      }
      $result =& ep_query('SELECT configuration_group_description FROM ' . TABLE_CONFIGURATION_GROUP . ' WHERE (configuration_group_title = \'Easy Populate\')');
    }
    foreach ($ep_upgraded_keys as $key)
    {
      if (defined($key))
      {
        $keys_check_fail = true;
      }
    }
    $description = $result->getRow(0, ECLIPSE_DB_ASSOC);
    if (strpos($description['configuration_group_description'], $ep_version) === false || $keys_check_fail)
    {
      $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_UPGRADE';
      $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_UPGRADE_RQD, '<a href="' . zen_href_link(FILENAME_EASYPOPULATE, 'langer=update">'),'</a>'), 'caution');
    }
  }
}
else
{
  if ($_GET['langer'] != 'remove')
  {
    if ('install' == $_GET['langer'])
    {
      install_easypopulate($ep_version, 'install');
      zen_redirect(zen_href_link(FILENAME_EASYPOPULATE, 'langer=install_success'));
    }
    else if ('update' == $_GET['langer'])
    {
      install_easypopulate($ep_version, 'update');
      zen_redirect(zen_href_link(FILENAME_EASYPOPULATE, 'langer=update_success'));
    }
    else if ('remove_success' == $_GET['langer'])
    {
      $epMsgStack->add(EASYPOPULATE_MSGSTACK_REMOVE_SUCCESS, 'success');
      $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_REMOVE';
    }
    else if ('update_success' == $_GET['langer'])
    {
      $epMsgStack->add(EASYPOPULATE_MSGSTACK_INSTALL_UPDATE_SUCCESS, 'success');
    }
    else if ('install_success' == $_GET['langer'])
    {
      $epMsgStack->add(EASYPOPULATE_MSGSTACK_INSTALL_SUCCESS, 'success');
    }
    else
    {
      header('location: easypopulate.php');
    }
    if ('install_success' == $_GET['langer'] || 'update_success' == $_GET['langer'])
    {
      if (defined('EASYPOPULATE_MSGSTACK_LANGER') && strpos(EASYPOPULATE_MSGSTACK_LANGER, 'paypal%40zencartbuilder%2ecom'))
      {
        $epMsgStack->add(EASYPOPULATE_MSGSTACK_LANGER, 'caution');
      }
      else
      {
        $epMsgStack->add('Easy Populate support &amp; development by <a href="http://www.zencartbuilder.com/"><b>zencartbuilder.com</b></a>. Donations are always appreciated to support continuing development &amp; support: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40zencartbuilder%2ecom&item_name=Module%20%28donation%29&no_shipping=0&no_note=1&tax=0&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8?"><b>PayPal</b></a>', 'caution');
      }
      if (@unlink(DIR_FS_ADMIN . 'easypopulate_functions.php'))
      {
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_INSTALL_DELETE_SUCCESS, 'easypopulate_functions.php', 'ADMIN'), 'success');
      }
      if (@unlink(DIR_FS_ADMIN . 'includes/boxes/extra_boxes/populate_tools_dhtml.php'))
      {
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_INSTALL_DELETE_SUCCESS, 'populate_tools_dhtml.php', DIR_FS_ADMIN . 'includes/boxes/extra_boxes/'), 'success');
      }
      else
      {
        if (file_exists(DIR_FS_ADMIN . 'includes/boxes/extra_boxes/populate_tools_dhtml.php'))
        {
          $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_INSTALL_DELETE_FAIL, 'populate_tools_dhtml.php', DIR_FS_ADMIN . 'includes/boxes/extra_boxes/'), 'caution');
        }
      }
    }
  }
  else
  {
    install_easypopulate('', 'remove');
    zen_redirect(zen_href_link(FILENAME_EASYPOPULATE, 'langer=remove_success'));
  }
}
if (isset($_GET['categories']) && count($epCategories->errors) > 0)
{
  if ('repair' == $_GET['categories'])
  {
    $repair_count = 0;
    foreach ($epCategories->errors['row_missing'] as $repair_category_id)
    {
      ep_query('INSERT INTO ' . TABLE_CATEGORIES_DESCRIPTION . ' (categories_id, language_id, categories_name) VALUES (' . (int)$repair_category_id . ', ' . (int)$language_id_default . ', ' . "'CATEGORY " . $repair_category_id . "')");
      $repair_count++;
    }
    foreach ($epCategories->errors['name_missing'] as $repair_category_id)
    {
      ep_query('UPDATE ' . TABLE_CATEGORIES_DESCRIPTION . ' SET categories_name=' . "'CATEGORY " . $repair_category_id . "' WHERE (categories_id=" . (int)$repair_category_id . ' AND language_id=' . (int)$language_id_default . ')');
      $repair_count++;
    }
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_CATEGORIES_REPAIR_SUCCESS, $repair_count), 'success');
    $epCategories =& new EpCategories($language_id_default);
  }
}
if (0 == count($config_fail))
{
  if (EASYPOPULATE_CONFIG_PRIMARY_INDEX != 'products_model' && EASYPOPULATE_CONFIG_PRIMARY_INDEX != 'products_id')
  {
    $epMsgStack->add(EASYPOPULATE_MSGSTACK_PRIMARY_INDEX_FAIL, 'warning');
    $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_INDEX';
  }
  if (isset($uploads_security) && $uploads_security === true)
  {
  $tempdir = $secure_dir;
  }
  elseif (isset($uploads_security) && $uploads_security === false)
  {
  $tempdir = EASYPOPULATE_CONFIG_TEMP_DIR;
  }
  else
  {
    die ('You have removed or misconfigured $uploads_security');
  }
  if (substr($tempdir, -1, 1) != '/')
  {
    $tempdir .= '/';
  }
  if (substr($tempdir, 0, 1) != '/' && substr($tempdir, 1, 1) != ':')
  {
    $tempdir = '/' . $tempdir;
  }
  if ('' == trim($tempdir) || '/' == trim($tempdir))
  {
    $epMsgStack->add(EASYPOPULATE_MSGSTACK_TEMP_CONFIG_ERROR, 'caution');
    $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_TEMP';
  }
  elseif ($uploads_security == true)
  {
    if ('/home/username/easypopulate/' == $secure_dir)
    {
      $epMsgStack->add(EASYPOPULATE_MSGSTACK_TEMP_CONFIG_ERROR, 'caution');
      $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_TEMP_NOTSET';
    }
    elseif (strpos($tempdir, trim(DIR_FS_CATALOG, '/')) === false)
    {
      ep_chmod_check($tempdir);
    }
    else
    {
     $epMsgStack->add(EASYPOPULATE_MSGSTACK_TEMP_DIR_UNSAFE, 'warning');
     $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_TEMP_PUBLIC';
     ep_chmod_check($tempdir);
    }
  }
  else
  {
    if (ep_chmod_check($tempdir))
    {
      if (!file_exists($tempdir . '.htaccess') && !file_exists($tempdir . 'index.html'))
      {
        $epMsgStack->add(EASYPOPULATE_MSGSTACK_TEMP_DIR_UNSAFE, 'warning');
        $config_fail[] = 'EASYPOPULATE_FAIL_CONFIG_TEMP_UNSAFE';
      }
    }
  }
  if (count($epCategories->errors) > 0)
  {
    $config_fail[] = 'EASYPOPULATE_FAIL_CATEGORY_NAMES_MISSING';
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_CATEGORIES_NAMES_MISSING, count($epCategories->errors['row_missing']), count($epCategories->errors['name_missing']), zen_href_link(FILENAME_EASYPOPULATE, 'categories=repair')), 'warning');
  }
}
if (count($config_fail) != 0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  <title><?php echo TITLE; ?></title>
  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  <style type="text/css"> .epdata {padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px;} .eprowshade {background-color:#EFF4F8}</style>
  <script language="javascript" src="includes/menu.js"></script>
  <script language="javascript" src="includes/general.js"></script>
  <script type="text/javascript">
    <!--
    function init()
    {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
    }
    }
    //-->
  </script>
</head>

<body onload="init()">
<!-- header //-->
<?php require (DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<?php echo $epMsgStack->output(); ?>
  <div align="right" style="margin-right:10px"><a style="text-decoration:underline" target="_blank" href="http://www.zencartbuilder.com/documentation_page/"><?php echo EASYPOPULATE_LINK_TEXT_DOCUMENTAION; ?></a> | <a style="text-decoration:underline" target="_blank" href="http://www.zencartbuilder.com/support_page/"><?php echo EASYPOPULATE_LINK_TEXT_SUPPORT; ?></a></div>
  <table border="0" width="100%" cellspacing="2" cellpadding="2">
    <tr>
    <!-- body_text //-->
      <td width="100%" valign="top">
<?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo "Easy Populate $ep_version"; ?></td>
          </tr>
        </table>
<?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?>
        <table border="0" width="100%" cellspacing="0" cellpadding="8">
          <tr>
            <td valign="top">
              <!-- message here //-->
<?php
  foreach ($config_fail as $reason)
  {
    echo '              ' . constant($reason) . "\n";
  }
?>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <!-- footer //-->
<?php
  require (DIR_WS_INCLUDES . 'footer.php');
  if (isset($ep_debug)) ekko($GLOBALS);
?>
  <!-- footer_eof //-->
</body>
</html>
<?php
  require (DIR_WS_INCLUDES . 'application_bottom.php');
  die;
}

$price_with_tax = (('true' == EASYPOPULATE_CONFIG_PRICE_INC_TAX) ? 1 : 0);
if (!isset($maxrecs)) $maxrecs = EASYPOPULATE_CONFIG_SPLIT_MAX;
$v_primary_index = 'v_' . EASYPOPULATE_CONFIG_PRIMARY_INDEX;
$ep_stack_sql_error = false;
$has_attributes = false;
$has_specials = false;
$ep_counter = array(); $ep_counter['added'] = 0; $ep_counter['deleted'] = 0; $ep_counter['errors'] = 0; $ep_counter['updated'] = 0; $ep_counter['partial_errors'] = 0; $ep_counter['moved'] = 0; $ep_counter['meta_deleted'] = 0; $ep_counter['meta_added'] = 0; $ep_counter['meta_updated'] = 0; $ep_counter['meta_repaired'] = 0; $ep_counter['meta_delete_failed'] = 0;
$separator = "\t";
if (isset($ep_debug_logging_all) && $_GET['action'] != 'download') {
$fp = fopen($tempdir . 'ep_debug_log.txt','w');
fclose($fp);
}
$ep_supported_mods = array();
if (ep_field_name_exists(TABLE_PRODUCTS_DESCRIPTION, 'products_short_desc')) $ep_supported_mods['psd'] = 'Products Short Description';
$category_strlen_max = zen_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name');
$modelsize = zen_field_length(TABLE_PRODUCTS, 'products_model');
if (ep_empty($modelsize))
{
  $epMsgStack->add(EASYPOPULATE_MSGSTACK_MODELSIZE_DETECT_FAIL, 'warning');
  $modelsize = 32;
}
if ('download' == $_GET['action'])
{
  $fn = $tempdir . $_GET['file'];
  ini_set('zlib.output_compression', 'Off');
  header("Content-Type: application/force-download\n");
  header("Content-Disposition: attachment; filename="  . $_GET['file']);
  header("Cache-Control: cache, must-revalidate");
  header("Pragma: public");
/*
    if ($file = fopen($fn, 'r'))
    {
     while (!feof($file) and (connection_status()==0))
     {
       print (fread($file, (1024*8)));
       flush();
     }
     $status = (connection_status() == 0);
     fclose($file);
    }
*/
  readfile($fn);
  exit;
}
elseif ('delete' == $_POST['action'])
{
  if (substr($_POST['action'], 0, 2) == '..' || is_int(strpos($_POST['action'], '/')))
  {
    die ('Illegal filename entry');
  }
  else if (@unlink($tempdir . $_POST['file']))
  {
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_DELETE_SUCCESS, $_POST['file']), 'success');
  }
  else
  {
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_DELETE_FAIL, $_POST['file']), 'caution');
  }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  <title><?php echo TITLE; ?></title>
  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  <style type="text/css"> .epdata {padding-left:12px;padding-right:12px;padding-top:4px;padding-bottom:4px;} .eprowshade {background-color:#EFF4F8}</style>
  <script language="javascript" src="includes/menu.js"></script>
  <script language="javascript" src="includes/general.js"></script>
  <script type="text/javascript">
    <!--
    function init()
    {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
    }
    }
    function confirmFileDelete(formid,fname)
    {
    if(eval('confirm("<?php echo EASYPOPULATE_JS_FILE_DELETE; ?>'+' ('+fname+')")'))
    {
      eval('document.getElementById(\''+formid+'\').submit();');
    }
    }
    function confirmFileImport(formid,fname)
    {
    if(eval('confirm("<?php echo EASYPOPULATE_JS_FILE_IMPORT; ?>'+' ('+fname+')")'))
    {
      eval('document.getElementById(\''+formid+'\').submit();');
    }
    }
    //-->
  </script>
</head>

<body onload="init()">
<!-- header //-->
<?php require (DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<?php
if (isset($_GET['export']) || isset($_POST['localfile']) || (isset($_POST['buttonupload']) && 'Import' == $_POST['buttonupload']) || isset($_GET['dross']))
{
?>
  <div class="headerBar" style="color:#FFFFFF; padding: 3px">
<?php
}
else
{
?>
  <div>
<?php
}
$time = explode(' ', microtime());
$start_time = $time[1] + $time[0];
$loop_start_time = $start_time;
$ep_qry_count = 0;
/*
$posted_languages = array(1);
$ep_layout['languages'] = array();
if (count($posted_languages) < 1)
{
  $posted_languages = array($language_id_default);
}
foreach ($posted_languages as $language_id)
{
  $ep_layout['languages'][$language_id] = $ep_languages[$language_id];
}
*/
if('products_model' == EASYPOPULATE_CONFIG_PRIMARY_INDEX)
{
  $result =& ep_query("SHOW CREATE TABLE " . TABLE_PRODUCTS);
  $thing = $result->getRow(0, ECLIPSE_DB_NUM);
  if(!strpos($thing[1],'idx_products_model'))
  {
    @ep_query('ALTER TABLE ' . TABLE_PRODUCTS . ' ADD INDEX idx_products_model (products_model)');
  }
}
if (isset($_GET['export']))
{
  include(DIR_EP_INCLUDES . 'easypopulate_export.php');
}
if ((isset($_POST['localfile'])) || isset($_FILES['usrfl']))
{
  $display['EASYPOPULATE_DISPLAY_RESULT_FILE'] = '';
  if (isset($ep_debug)) $sultimer = ep_timer();
  if (isset($_POST['buttonupload']))
  {
    $file = ep_get_uploaded_file('usrfl');
    if (is_uploaded_file($file['tmp_name']))
    {
      $reject_file_types = array('.php', '.php4', '.php5', '.pl', '.exe', '.msi', '.inc', '.sh');
      foreach ($reject_file_types as $reject)
      {
        if (substr($file['name'], -(strlen($reject))) == $reject)
        {
          die (sprintf(EASYPOPULATE_FILE_UPLOAD_DENIED, $reject));
        }
      }
      if ($_POST['buttonupload'] != 'Upload')
      {
        $display['EASYPOPULATE_DISPLAY_RESULT_FILE'] .= sprintf(EASYPOPULATE_DISPLAY_UPLOADED_FILE_SPEC, $file['tmp_name'], $file['name'], $file['size']);
        $file_name = $file['name'];
        $file['name'] = 'oops_pls_delete_me';
      }
      if (!ep_copy_uploaded_file($file, $tempdir))
      {
        $epMsgStack->add(EASYPOPULATE_MSGSTACK_FILE_UPLOAD_COPY_FAIL, 'warning');
      }
      else if ($_POST['buttonupload'] == 'Split')
      {
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_UPLOAD_SUCCESS, $file_name), 'success');
        $infp = fopen($tempdir . $file['name'], "r");
        $toprow = fgets($infp, 32768);
        $filecount = 1;
        $tmpfname = EASYPOPULATE_FILE_SPLITS_PREFIX . $filecount . "-" . $file_name;
        $tmpfpath = $tempdir . $tmpfname;
        $fp = fopen( $tmpfpath, "w+");
        fwrite($fp, $toprow);
        $linecount = 0;
        while ($line = fgets($infp, 32768))
        {
          $line = str_replace('"EOREOR"', 'EOREOR', $line);
          fwrite($fp, $line);
          if (strpos($line, 'EOREOR'))
          {
            if ($linecount >= $maxrecs)
            {
              $linecount = 0;
              fclose($fp);
              $filecount++;
              $tmpfname = EASYPOPULATE_FILE_SPLITS_PREFIX . $filecount . "-" . $file_name;
              $tmpfpath = $tempdir . $tmpfname;
              $fp = fopen( $tmpfpath, "w+");
              fwrite($fp, $toprow);
            }
          $linecount++;
          }
        }
        fclose($fp);
        fclose($infp);
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_UPLOAD_SPLIT_SUCCESS, $file_name), 'success');
      }
      else if ($_POST['buttonupload'] == 'Import')
      {
        include DIR_EP_INCLUDES . 'easypopulate_import.php';
      }
      else if ($_POST['buttonupload'] == 'Upload')
      {
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_UPLOAD_SUCCESS, $file['name']), 'success');
        $dl_filename = $file['name'];
      }
    }
    else
    {
      $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_FILE_UPLOAD_FAIL, $file['name']), 'warning');
    }
  }
  else
  {
    $file = ep_get_uploaded_file('localfile');
    $display['EASYPOPULATE_DISPLAY_RESULT_FILE'] .= sprintf(EASYPOPULATE_DISPLAY_LOCAL_FILE_SPEC, $file['name']);
    include DIR_EP_INCLUDES . 'easypopulate_import.php';
  }
}
$fn_colour = 'red';
if (isset($_POST['buttonupload']))
{
  if ($_POST['buttonupload'] != 'Upload')
  {
    @unlink($tempdir . $file['name']);
  }
  else
  {
  $fn_colour = 'green';
  }
}
if(isset($dl_filename))
{
  $dl_exclude = strtolower($dl_filename);
}
else
{
  $dl_exclude = NULL;
}
$temp_dir_exclusions = array('.', '..', 'index.html', 'index.htm', 'index.php', '.htaccess', $dl_exclude);
$temp_contents = array();
if ($dh = @opendir($tempdir))
{
  while (($fn = readdir($dh)) !== false)
  {
    if(!is_dir($tempdir . $fn))
    {
      if (!in_array(strtolower($fn), $temp_dir_exclusions))
      {
        $stat = stat("$tempdir/$fn");
        $temp_contents[$fn] = $stat['ctime'];
      }
    }
  }
  closedir($dh);
  arsort($temp_contents);
}
$temp_display = '';
$row_shade = 'shade';
if(0 == sizeof($temp_contents) && !isset($dl_filename))
{
  $temp_display = '<table style="border: #999999 2px inset" cellspacing="0"><tr class="eprowshade"><td><b>' . EASYPOPULATE_TEMP_DIR_EMPTY . '</b></td></tr></table>' . "\n";
}
elseif (!$tempdir)
{
  $temp_display = '<table style="border: #999999 2px inset" cellspacing="0"><tr class="eprowshade"><td><b>' . EASYPOPULATE_TEMP_DIR_NOT_CONFIGURED . '</b></td></tr></table>' . "\n";
}
else
{
  for (reset($temp_contents), $i = 1; list($fn, $thing) = each($temp_contents); $i++)
  {
    $temp_display .= '<tr class="eprow' . $row_shade . '">' . "\n" . '<td class="epdata" nowrap="nowrap">' . $fn;
    $temp_display .= ' (' . ceil(filesize($tempdir . $fn)/1000) . ' kb)</td>' . "\n" . '<td class="epdata"><a href="' . zen_href_link(FILENAME_EASYPOPULATE, 'action=download&file=' . $fn) . '">' . EASYPOPULATE_FORM_TEMP_TITLE_SAVE . '</a>';
    $temp_display .= '</td>' . "\n" . '<td class="epdata">';
    $temp_display .= '<form id="frmImport' . $i . '" action="' . FILENAME_EASYPOPULATE . '" method="post"><input TYPE="hidden" name="localfile" value=' . $fn . '><a href="javascript:confirmFileImport(\'frmImport' . $i . '\',\'' . $fn . '\')">' . EASYPOPULATE_FORM_TEMP_TITLE_IMPORT . '</a></form>';
    $temp_display .= '</td>' . "\n" . '<td class="epdata">';
    $temp_display .= '<form id="frmDelete' . $i . '" action="' . FILENAME_EASYPOPULATE . '" method="post"><input TYPE="hidden" name="action" value="delete"><input TYPE="hidden" name="file" value=' . $fn . '><a href="javascript:confirmFileDelete(\'frmDelete' . $i . '\',\'' . $fn . '\')">' . EASYPOPULATE_FORM_TEMP_TITLE_DELETE . '</a></form>';
    $temp_display .= '</td>' . "\n" . '</tr>' . "\n";
    if ('shade' == $row_shade)
    {
      $row_shade = '';
    }
    else
    {
      $row_shade = 'shade';
    }
  }
  if (isset($dl_filename))
  {
    $dln = '<tr class="eprow">' . "\n" . '<td class="epdata" nowrap="nowrap">';
    $dln .= '<span style="color: ' . $fn_colour . '"><b>' . $dl_filename . ' (' . ceil(filesize($tempdir . $dl_filename)/1000) . ' kb)</b></span></td>' . "\n" . '<td class="epdata"><a href="' . zen_href_link(FILENAME_EASYPOPULATE, 'action=download&file=' . $dl_filename) . '">' . EASYPOPULATE_FORM_TEMP_TITLE_SAVE . '</a></td>' . "\n" . '<td class="epdata"><form id="frmImport" action="' . FILENAME_EASYPOPULATE . '" method="post"><input TYPE="hidden" name="localfile" value=' . $dl_filename . '><a href="javascript:confirmFileImport(\'frmImport\',\'' . $dl_filename . '\')">' . EASYPOPULATE_FORM_TEMP_TITLE_IMPORT . '</a></form></td>' . "\n" . '<td class="epdata">';
    $dln .= '<form id="frmDelete" action="' . FILENAME_EASYPOPULATE . '" method="post"><input TYPE="hidden" name="action" value="delete"><input TYPE="hidden" name="file" value=' . $dl_filename . '><a href="javascript:confirmFileDelete(\'frmDelete\',\'' . $dl_filename . '\')">' . EASYPOPULATE_FORM_TEMP_TITLE_DELETE . '</a></form>';
    $dln .= '</td>' . "\n" . '</tr>' . "\n";
    $temp_display = $dln . $temp_display;
  }
  $temp_display = '<table style="border: #999999 2px inset" cellspacing="0">' . "\n$temp_display" . '</table>' . "\n";
}
$upload_result_type = array('added' => EASYPOPULATE_MSGSTACK_IMPORT_ADDED,
                            'updated' => EASYPOPULATE_MSGSTACK_IMPORT_UPDATED,
                            'deleted' => EASYPOPULATE_MSGSTACK_IMPORT_DELETED,
                            'moved' => EASYPOPULATE_MSGSTACK_IMPORT_MOVED,
                            'linked' => EASYPOPULATE_MSGSTACK_IMPORT_LINKED,
                            );
for (reset($ep_counter); list($key, $val) = each($ep_counter);)
{
  if($val != 0)
  {
    switch ($key)
    {
      case 'errors':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_DATA_IMPORT_ERRORS, $val), 'caution');
        break;
      case 'partial_errors':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_DATA_IMPORT_PARTIAL_ERRORS, $val), 'caution');
        break;
      case 'meta_deleted':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_META_IMPORT_DELETED, $val), 'success');
        break;
      case 'meta_delete_failed':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_META_IMPORT_DELETE_FAILED, $val), 'caution');
        break;
      case 'meta_added':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_META_IMPORT_ADDED, $val), 'success');
        break;
      case 'meta_updated':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_META_IMPORT_UPDATED, $val), 'success');
        break;
      case 'meta_repaired':
        $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_META_IMPORT_REPAIRED, $val), 'success');
        break;
      default:
        if (isset($filelayout['c_categories_index_path']))
        {
          $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_DATA_CATEGORIES_IMPORT_SUCCESS, $val) . ' ' . $upload_result_type[$key], 'success');
        }
        else
        {
          $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_DATA_PRODUCT_IMPORT_SUCCESS, $val) . ' ' . $upload_result_type[$key], 'success');
        }
    }
  }
}
if (isset($ep_debug) && isset($sultimer)) ep_timer($sultimer,'Upload');
if ($ep_stack_sql_error) $epMsgStack->add(EASYPOPULATE_MSGSTACK_ERROR_SQL, 'caution');
if (isset($_GET['dross']) && 'delete' == $_GET['dross'])
{
  ep_purge_dross();
  $dross = ep_get_dross();
  if (!ep_empty($dross))
  {
    $string = "Product debris corresponding to the following product_id(s) cannot be deleted by EasyPopulate:\n";
    foreach ($dross as $products_id => $langer) {
      $string .= $products_id . "\n";
    }
    $string .= "It is recommended that you delete this data using phpMyAdmin.\n\n";
    write_debug_log($string);
    $epMsgStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_FAIL, 'caution');
  }
  else
  {
    $epMsgStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_SUCCESS, 'success');
  }
}
else
{
  $dross = ep_get_dross();
  if (!ep_empty($dross))
  {
    $epMsgStack->add(sprintf(EASYPOPULATE_MSGSTACK_DROSS_DETECTED, count($dross), zen_href_link(FILENAME_EASYPOPULATE, 'dross=delete')), 'caution');
  }
}
if (isset($ep_debug)) {
  ekko(round(array_size($GLOBALS) / 1000, 1) . ' kb approximate memory used');
  ekko();
}
?>
</div>
<?php echo $epMsgStack->output(); ?>
  <div align="right" style="padding-right:10px"><a style="text-decoration:underline" target="_blank" href="http://www.zencartbuilder.com/documentation_page/"><?php echo EASYPOPULATE_LINK_TEXT_DOCUMENTAION; ?></a> | <a style="text-decoration:underline" target="_blank" href="http://www.zencartbuilder.com/support_page/"><?php echo EASYPOPULATE_LINK_TEXT_SUPPORT; ?></a></div>
<?php
if(isset($test) && isset($test_display))
{
  echo '<div align="left" style="margin-left:10px">' . $test_display . '</div>';
}
?>
  <table border="0" width="100%" cellspacing="2" cellpadding="2">
    <tr>
<!-- body_text //-->
      <td width="100%" valign="top">
<?php
        echo zen_draw_separator('pixel_trans.gif', '1', '10');
?>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo "Easy Populate $ep_version"; ?></td>
          </tr>
        </table>
<?php
        echo zen_draw_separator('pixel_trans.gif', '1', '10');
?>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top">
              <table width="750" border="0" cellpadding="0" cellspacing="16" valign="top">
                <tr>
                  <td NOWRAP style="padding: 8px; border: 1px solid #CCCCCC">
                    <p>
                      <form ENCTYPE="multipart/form-data" ACTION="easypopulate.php" METHOD="POST">
                        <div align = "left">
                          <b><?php echo sprintf(EASYPOPULATE_FORM_HEADING_IMPORT, EASYPOPULATE_FORM_TITLE_UPLOAD, EASYPOPULATE_FORM_TITLE_SPLIT, EASYPOPULATE_FORM_TITLE_IMPORT); ?></b><br />
                          <input TYPE="hidden" name="MAX_FILE_SIZE" value="100000000">
                          <input type="file" name="usrfl" size="50">
                          <br />
                          <input type="submit" name="buttonupload" value="Upload" title="<?php echo EASYPOPULATE_FORM_TITLE_UPLOAD; ?>">&nbsp;
                          <input type="submit" name="buttonupload" value="Split" title="<?php echo EASYPOPULATE_FORM_TITLE_SPLIT; ?>">&nbsp;
                          <input type="submit" name="buttonupload" value="Import" title="<?php echo EASYPOPULATE_FORM_TITLE_IMPORT; ?>">
                          <br />
                        </div>
                      </form>
                    </p>
                    <br />
                    <p>
                      <b><?php echo sprintf(EASYPOPULATE_FORM_HEADING_EXPORT, $tempdir); ?></b><br />
                      <table>
                        <tr>
                          <td width="150"><?php echo EASYPOPULATE_FORM_HEADING_FILES ?></td>
                          <td width="150"><?php echo EASYPOPULATE_FORM_HEADING_TEMPLATES ?></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=extstore"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_EXTSTORE, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=extstore&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_EXTSTORE, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=store"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_STORE, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=store&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_STORE, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=priceqty"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_PRICEQTY, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=priceqty&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_PRICEQTY, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=products_categories"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_PRODUCTS_CATEGORIES, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=products_categories&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_PRODUCTS_CATEGORIES, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=googlebase"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_GOOGLEBASE, $tempdir)); ?></a></td>
                          <td>N/A</td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=attrib"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_ATTRIBUTES, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=attrib&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_ATTRIBUTES, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=meta"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_META, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=meta&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_META, $tempdir)); ?></a></td>
                        </tr>
                        <tr>
                          <td><a href="easypopulate.php?export=categories"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_CATEGORIES, $tempdir)); ?></a></td>
                          <td><a href="easypopulate.php?export=categories&type=template"><?php echo(sprintf(EASYPOPULATE_FORM_ACTION_EXPORT_ALL, EASYPOPULATE_FORM_ACTION_EXPORT_CATEGORIES, $tempdir)); ?></a></td>
                        </tr>
                      </table>
                    </p>
                    <p><b><span class="fieldRequired"><?php echo $tempdir; ?></span></b>
<?php
                      echo $temp_display;
?>
                    </p>
                  </td>
                  <td width="100%" valign="top" align="left" style="padding: 8px; border: 1px solid #CCCCCC">
                    <table>
                      <tr>
                        <td>
<?php
echo sprintf(EASYPOPULATE_PRODUCTS_INDEX_MODE, EASYPOPULATE_CONFIG_PRIMARY_INDEX);
if (EASYPOPULATE_CONFIG_PRIMARY_INDEX == 'products_id')
{
  echo sprintf(EASYPOPULATE_ADVICE_NEXT_PRODUCTS_ID, ep_get_next_id(TABLE_PRODUCTS));
}
if (sizeof($ep_supported_mods) > 0)
{
                          echo EASYPOPULATE_HEADING_MODS . "\n<br />";
  for (reset($ep_supported_mods); list($key, $val) = each($ep_supported_mods);)
  {
                          echo "&nbsp;&nbsp;<b>$val</b><br />\n";
  }
}
?>
                        </td>
                      </tr>
                    </table>
                  </td>
              </table>
            </td>
          </tr>
          </tr>
          <tr colspan="2">
            <td>
<?php
                foreach($display as $type => $string)
                {
                  if (!ep_empty($string))
                  {
                    echo '<br />' . constant($type) . '<br />';
                    echobig($string);
                  }
                }
?>
            </td>
          </tr>
        </table>
      </td>
<!-- body_text_eof //-->
    </tr>
  </table>
<!-- body_eof //-->
  <br />
<!-- footer //-->
<?php
if (isset($ep_debug)) ekko($GLOBALS);
if(isset($debug_display)) echo $debug_display;
if(isset($test)) echo 'Query Count: ' . $ep_qry_count;
include(DIR_WS_INCLUDES . 'footer.php');
?>
<!-- footer_eof //-->
</body>
</html>
<?php include(DIR_WS_INCLUDES . 'application_bottom.php');
                                                                                                                                            adminhome/email_welcome.php                                                                         0000755 0001012 0001007 00000021240 10565700506 016504  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: email_welcome.php 5805 2007-02-18 04:27:17Z ajeh $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  if (file_exists(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . (($template_dir=='') ? '' : '/'.$template_dir) .'/' . 'create_account.php')) {
    require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . (($template_dir=='') ? '' : '/'.$template_dir) . '/' . 'create_account.php');
  } else {
    require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . 'create_account.php');
  }

// build the message content
      $name = 'Fred Smith';
      $firstname = 'Fred';
      $lastname = 'Smith';
	  $gender='m';
	  $email_address='fredsmith@somewhere.com';

// build the message content

      if (ACCOUNT_GENDER == 'true') {
         if ($gender == 'm') {
           $email_text = sprintf(EMAIL_GREET_MR, $lastname);
         } else {
           $email_text = sprintf(EMAIL_GREET_MS, $lastname);
         }
      } else {
        $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
      }
      $html_msg['EMAIL_GREETING'] = str_replace('\n','',$email_text);
      $html_msg['EMAIL_FIRST_NAME'] = $firstname;
      $html_msg['EMAIL_LAST_NAME']  = $lastname;

      // initial welcome
      $email_text .=  EMAIL_WELCOME;
	  $html_msg['EMAIL_WELCOME'] = str_replace('\n','',EMAIL_WELCOME);

      if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
        $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
        $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
        $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
//        $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");

      // if on, add in Discount Coupon explanation
        $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
                       (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') .
                       strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR ;

      $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
	  $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
      $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
      $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'];
      }

      if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
        $coupon_code = 'ABCDEF';
//        $insert_query = $db->Execute("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
//        $insert_id = $db->Insert_ID();
//        $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )");

      // if on, add in GV explanation
        $email_text .= "\n\n" . sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) .
                       sprintf(EMAIL_GV_REDEEM, $coupon_code) .
                       EMAIL_GV_LINK . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . "\n\n" .
                       EMAIL_GV_LINK_OTHER . EMAIL_SEPARATOR;
		$html_msg['GV_WORTH'] = str_replace('\n','',sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) );
		$html_msg['GV_REDEEM'] = str_replace('\n','',str_replace('\n\n','<br />',sprintf(EMAIL_GV_REDEEM, '<strong>' . $coupon_code . '</strong>')));
		$html_msg['GV_CODE_NUM'] = $coupon_code;
		$html_msg['GV_CODE_URL'] = str_replace('\n','',EMAIL_GV_LINK . '<a href="' . zen_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code, 'NONSSL', false) . '">' . TEXT_GV_NAME . ': ' . $coupon_code . '</a>');
        $html_msg['GV_LINK_OTHER'] = EMAIL_GV_LINK_OTHER;
      }

      // add in regular email welcome text
      $email_text .= "\n\n" . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_GV_CLOSURE;

	  $html_msg['EMAIL_MESSAGE_HTML']  = str_replace('\n','',EMAIL_TEXT);
	  $html_msg['EMAIL_CONTACT_OWNER'] = str_replace('\n','',EMAIL_CONTACT);
	  $html_msg['EMAIL_CLOSURE']       = nl2br(EMAIL_GV_CLOSURE);

// include create-account-specific disclaimer
      $email_text .= "\n\n" . sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, STORE_OWNER_EMAIL_ADDRESS). "\n\n";
	  $html_msg['EMAIL_DISCLAIMER'] = sprintf(EMAIL_DISCLAIMER_NEW_CUSTOMER, '<a href="mailto:' . STORE_OWNER_EMAIL_ADDRESS . '">'. STORE_OWNER_EMAIL_ADDRESS .' </a>');

      $html_msg['EMAIL_TO_NAME'] = $name;
      $html_msg['EMAIL_TO_ADDRESS'] = $email_address;
      $html_msg['EMAIL_SUBJECT'] = $EMAIL_SUBJECT;
      $html_msg['EMAIL_FROM_NAME'] = $STORE_NAME;
      $html_msg['EMAIL_FROM_ADDRESS'] = $EMAIL_FROM;
      $extra_info=email_collect_extra_info(STORE_NAME, EMAIL_FROM, $name, $email_address );
      $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
	  $email_html = zen_build_html_email_from_template('welcome_extra', $html_msg);
//   zen_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_NAME, EMAIL_FROM, $html_msg, 'welcome');



?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body_text //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
        <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
      </tr>
      <tr>
        <td class="errorText" colspan="2"><?php echo HEADING_SUBTITLE; ?></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table border="2" width="625" cellspacing="0" cellpadding="20" align="center">
<?php if (EMAIL_USE_HTML=='true') { ?>
      <tr><td width="100%"><table border="0" cellpadding="0" width="100%">
        <tr>
          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
        </tr>

        <tr>
          <td class="main"><?php echo TEXT_SUBJECT . ' ' . EMAIL_SUBJECT; ?></td>
        </tr>

        <tr>
          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
        </tr>

        <tr>
          <td class="main"><?php echo $email_html; ?></td>
        </tr>

      </table></td></tr>
<?php } ?>

      <tr><td width="100%"><table border="0" cellpadding="0" width="100%">
        <tr>
          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
        </tr>

        <tr>
          <td class="main"><?php echo TEXT_SUBJECT . ' ' . EMAIL_SUBJECT; ?></td>
        </tr>

        <tr>
          <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
        </tr>

        <tr>
          <td class="main"><?php echo nl2br(strip_tags($email_text)); ?></td>
        </tr>

      </table></td></tr>
    </table></td>
  </tr>
</table>
<!-- body_text_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                adminhome/ezpages.php                                                                               0000755 0001012 0001007 00000117173 11350555104 015346  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: ezpages.php 15698 2010-03-19 06:58:28Z drbyte $
 */

// Sets the status of a page
  function zen_set_ezpage_status($pages_id, $status, $status_field) {
  global $db;
    if ($status == '1') {
      return $db->Execute("update " . TABLE_EZPAGES . " set " . $status_field . " = '0'  where pages_id = '" . $pages_id . "'");
    } elseif ($status == '0') {
      return $db->Execute("update " . TABLE_EZPAGES . " set " . $status_field . " = '1'  where pages_id = '" . $pages_id . "'");
    } else {
      return -1;
    }
  }


  require('includes/application_top.php');

  if (!isset($_SESSION['ez_sort_order'])) {
    $_SESSION['ez_sort_order'] = 0;
  }
  if (!isset($_GET['reset_ez_sort_order'])) {
    $reset_ez_sort_order = $_SESSION['ez_sort_order'];
  }

  if ($_GET['action'] == 'set_editor') {
    // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
    $action='';
    zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN));
  }

  $action = (isset($_GET['action']) ? $_GET['action'] : '');
  if (zen_not_null($action)) {
    switch ($action) {
      case 'set_ez_sort_order':
        $_SESSION['ez_sort_order'] = $_GET['reset_ez_sort_order'];
        $action='';
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . ($_GET['ezID'] != '' ? '&ezID=' . $_GET['ezID'] : '')));
        break;
      case 'setflag':
        if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
          zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['flag']));
          $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        } else {
          $messageStack->add(ERROR_UNKNOWN_STATUS_FLAG, 'error');
        }
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;

      case 'page_open_new_window':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_open_new_window');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'page_is_ssl':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_is_ssl');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'status_header':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_header');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'status_sidebox':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_sidebox');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'status_footer':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_footer');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'status_toc':
        zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_toc');
        $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']));
        break;
      case 'insert':
      case 'update':
        if (isset($_POST['pages_id'])) $pages_id = zen_db_prepare_input($_POST['pages_id']);
        $pages_title = zen_db_prepare_input($_POST['pages_title']);
        $page_open_new_window = (int)$_POST['page_open_new_window'];
        $page_is_ssl  = (int)$_POST['page_is_ssl'];

        $pages_html_text = zen_db_prepare_input($_POST['pages_html_text']);
        $alt_url = zen_db_prepare_input($_POST['alt_url']);

        $alt_url_external = zen_db_prepare_input($_POST['alt_url_external']);

       	$pages_header_sort_order = (int)$_POST['header_sort_order'];
       	$pages_sidebox_sort_order = (int)$_POST['sidebox_sort_order'];
       	$pages_footer_sort_order = (int)$_POST['footer_sort_order'];
       	$pages_toc_sort_order = (int)$_POST['toc_sort_order'];

       	$toc_chapter = (int)$_POST['toc_chapter'];

       	$status_header = ($pages_header_sort_order == 0 ? 0 : (int)$_POST['status_header']);
       	$status_sidebox = ($pages_sidebox_sort_order == 0 ? 0 : (int)$_POST['status_sidebox']);
       	$status_footer = ($pages_footer_sort_order == 0 ? 0 : (int)$_POST['status_footer']);
       	$status_toc = ($pages_toc_sort_order == 0 ? 0 : (int)$_POST['status_toc']);

        $page_error = false;
        if (empty($pages_title)) {
          $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');
          $page_error = true;
        }
        if (empty($pages_html_text)) {
        }

        $zv_link_method_cnt = 0;
        if ($alt_url !='') {
          $zv_link_method_cnt++;
        }
        if ($alt_url_external !='') {
          $zv_link_method_cnt++;
        }
        if ($pages_html_text !='' and strlen(trim($pages_html_text)) > 6) {
          $zv_link_method_cnt++;
        }
        if ($zv_link_method_cnt > 1) {
          $messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error');
          $page_error = true;
        }

        if ($page_error == false) {
          $sql_data_array = array('pages_title' => $pages_title,
                                  'page_open_new_window' => $page_open_new_window,
                                  'page_is_ssl' => $page_is_ssl,
                                  'alt_url' => $alt_url,
                                  'alt_url_external' => $alt_url_external,
                                  'status_header' => $status_header,
                                  'status_sidebox' => $status_sidebox,
                                  'status_footer' => $status_footer,
                                  'status_toc' => $status_toc,
                                  'header_sort_order' => $pages_header_sort_order,
                                  'sidebox_sort_order' => $pages_sidebox_sort_order,
                                  'footer_sort_order' => $pages_footer_sort_order,
                                  'toc_sort_order' => $pages_toc_sort_order,
                                  'toc_chapter' => $toc_chapter,
                                  'pages_html_text' => $pages_html_text);

          if ($action == 'insert') {
            zen_db_perform(TABLE_EZPAGES, $sql_data_array);
            $pages_id = $db->insert_ID();
            $messageStack->add(SUCCESS_PAGE_INSERTED, 'success');
          } elseif ($action == 'update') {
            zen_db_perform(TABLE_EZPAGES, $sql_data_array, 'update', "pages_id = '" . (int)$pages_id . "'");
            $messageStack->add(SUCCESS_PAGE_UPDATED, 'success');
          }

          zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'ezID=' . $pages_id));
        } else {
          if ($page_error == false) {
            $action = 'new';
          } else {
            $_GET['pages_id'] = $pages_id;
            $_GET['ezID'] = $pages_id;
            $_GET['action'] = 'new';
            $action = 'new';
            $ezID = $pages_id;
            $page = $_GET['page'];
          }
        }
        break;
      case 'deleteconfirm':
        $pages_id = zen_db_prepare_input($_GET['ezID']);
        $db->Execute("delete from " . TABLE_EZPAGES . " where pages_id = '" . (int)$pages_id . "'");
        $messageStack->add(SUCCESS_PAGE_REMOVED, 'success');
        zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page']));
        break;
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  if (typeof _editor_url == "string") HTMLArea.replaceAll();
  }
  // -->
</script>
<?php if ($editor_handler != '') include ($editor_handler); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE . ' ' . ($ezID != '' ? TEXT_INFO_PAGES_ID . $ezID : TEXT_INFO_PAGES_ID_SELECT); ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="main">
<?php
      if ($action != 'new') {
// toggle switch for display sort order
        $ez_sort_order_array = array(array('id' => '0', 'text' => TEXT_SORT_CHAPTER_TOC_TITLE),
                              array('id' => '1', 'text' => TEXT_SORT_HEADER_TITLE),
                              array('id' => '2', 'text' => TEXT_SORT_SIDEBOX_TITLE),
                              array('id' => '3', 'text' => TEXT_SORT_FOOTER_TITLE),
                              array('id' => '4', 'text' => TEXT_SORT_PAGE_TITLE),
                              array('id' => '5', 'text' => TEXT_SORT_PAGE_ID_TITLE)
                              );
        echo TEXT_SORT_CHAPTER_TOC_TITLE_INFO . zen_draw_form('set_ez_sort_order_form', FILENAME_EZPAGES_ADMIN, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_ez_sort_order', $ez_sort_order_array, $reset_ez_sort_order, 'onChange="this.form.submit();"') . zen_hide_session_id() .
        ($_GET['page'] != '' ? zen_draw_hidden_field('page', $_GET['page']) : '') .
        zen_draw_hidden_field('action', 'set_ez_sort_order') .
        '</form>';
?>
            </td>
            <td class="main">
<?php
// toggle switch for editor
        echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_EZPAGES_ADMIN, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') .
        zen_hide_session_id() .
        zen_draw_hidden_field('action', 'set_editor') .
        '</form>';
      }
?>
          </td>
          </tr>
        </table></td>
      </tr>
<?php
  if ($action == 'new') {
    $form_action = 'insert';

    $parameters = array('pages_title' => '',
                        'page_open_new_window' => '',
                        'page_is_ssl' => '',
                        'pages_html_text' => '',
                        'alt_url' => '',
                        'alt_url_external' => '',
                        'header_sort_order' => '',
                        'sidebox_sort_order' => '',
                        'footer_sort_order' => '',
                        'toc_sort_order' => '',
                        'toc_chapter' => '',
                        'status_header' => '',
                        'status_sidebox' => '',
                        'status_footer' => '',
                        'status_toc' => '',
                        'page_open_new_window' => '',
                        'page_is_ssl' => ''
                        );

    $ezInfo = new objectInfo($parameters);

    if (isset($_GET['ezID'])) {
      $form_action = 'update';

      $ezID = zen_db_prepare_input($_GET['ezID']);

      $page_query = "select * from " . TABLE_EZPAGES . " where pages_id = '" . $_GET['ezID'] . "'";
      $page = $db->Execute($page_query);
      $ezInfo->objectInfo($page->fields);
    } elseif (zen_not_null($_POST)) {
      $ezInfo->objectInfo($_POST);
    }

// set all status settings and switches
    if (!isset($ezInfo->status_header)) $ezInfo->status_header = '1';
    switch ($ezInfo->status_header) {
      case '0': $is_status_header = false; $not_status_header = true; break;
      case '1': $is_status_header = true; $not_status_header = false; break;
      default: $is_status_header = true; $not_status_header = false; break;
    }
    if (!isset($ezInfo->status_sidebox)) $ezInfo->status_sidebox = '1';
    switch ($ezInfo->status_sidebox) {
      case '0': $is_status_sidebox = false; $not_status_sidebox = true; break;
      case '1': $is_status_sidebox = true; $not_status_sidebox = false; break;
      default: $is_status_sidebox = true; $not_status_sidebox = false; break;
    }
    if (!isset($ezInfo->status_footer)) $ezInfo->status_footer = '1';
    switch ($ezInfo->status_footer) {
      case '0': $is_status_footer = false; $not_status_footer = true; break;
      case '1': $is_status_footer = true; $not_status_footer = false; break;
      default: $is_status_footer = true; $not_status_footer = false; break;
    }
    if (!isset($ezInfo->status_toc)) $ezInfo->status_toc = '1';
    switch ($ezInfo->status_toc) {
      case '0': $is_status_toc = false; $not_status_toc = true; break;
      case '1': $is_status_toc = true; $not_status_toc = false; break;
      default: $is_status_toc = true; $not_status_toc = false; break;
    }
    if (!isset($ezInfo->page_open_new_window)) $ezInfo->not_page_open_new_window = '1';
    switch ($ezInfo->page_open_new_window) {
      case '0': $is_page_open_new_window = false; $not_page_open_new_window = true; break;
      case '1': $is_page_open_new_window = true; $not_page_open_new_window = false; break;
      default: $is_page_open_new_window = false; $not_page_open_new_window = true; break;
    }
    if (!isset($ezInfo->page_is_ssl)) $ezInfo->page_is_ssl = '1';
    switch ($ezInfo->page_is_ssl) {
      case '0': $is_page_is_ssl = false; $not_page_is_ssl = true; break;
      case '1': $is_page_is_ssl = true; $not_page_is_ssl = false; break;
      default: $is_page_is_ssl = false; $not_page_is_ssl = true; break;
    }
?>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
<?php
    echo zen_draw_form('new_page', FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . zen_db_prepare_input($_GET['page']) . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"');
    if ($form_action == 'update') echo zen_draw_hidden_field('pages_id', $ezID);
 ?>

      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2" class="main" align="left" valign="top" nowrap><?php echo (($form_action == 'insert') ? zen_image_submit('button_insert.gif', IMAGE_INSERT) : zen_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['ezID']) ? 'ezID=' . $_GET['ezID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
          </tr>
        </table></td>
      </tr>
        <td><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><?php echo TEXT_PAGES_TITLE; ?></td>
            <td class="main"><?php echo zen_draw_input_field('pages_title', htmlspecialchars($ezInfo->pages_title), zen_set_field_length(TABLE_EZPAGES, 'pages_title'), true); ?></td>
          </tr>
          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>

          <tr>
            <td colspan="2"><table border="0" cellspacing="4" cellpadding="4">
              <tr>
                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_PAGE_OPEN_NEW_WINDOW; ?></strong><br />
                  <?php echo zen_draw_radio_field('page_open_new_window', '1', $is_page_open_new_window) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('page_open_new_window', '0', $not_page_open_new_window) . '&nbsp;' . TEXT_NO; ?>
                </td>
                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_PAGE_IS_SSL; ?></strong><br />
                  <?php echo zen_draw_radio_field('page_is_ssl', '1', $is_page_is_ssl) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('page_is_ssl', '0', $not_page_is_ssl) . '&nbsp;' . TEXT_NO; ?>
                </td>
              </tr>
            </table></td>
          </tr>

          <tr>
            <td colspan="2"><table border="0" cellspacing="4" cellpadding="4">
              <tr>
                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_STATUS_HEADER; ?></strong><br />
                  <?php echo zen_draw_radio_field('status_header', '1', $is_status_header) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('status_header', '0', $not_status_header) . '&nbsp;' . TEXT_NO; ?>
                </td>
                <td class="main" align="center" valign="bottom">
                <?php echo TEXT_HEADER_SORT_ORDER; ?><br />
                  <?php echo zen_draw_input_field('header_sort_order', $ezInfo->header_sort_order, zen_set_field_length(TABLE_EZPAGES, 'header_sort_order'), false); ?>
                </td>
                <td align="center">&nbsp;<?php echo zen_draw_separator('pixel_black.gif', '2', '50'); ?>&nbsp;</td>

                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_STATUS_SIDEBOX; ?></strong><br />
                  <?php echo zen_draw_radio_field('status_sidebox', '1', $is_status_sidebox) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('status_sidebox', '0', $not_status_sidebox) . '&nbsp;' . TEXT_NO; ?>
                </td>
                <td class="main" align="center" valign="bottom">
                <?php echo TEXT_SIDEBOX_SORT_ORDER; ?><br />
                  <?php echo zen_draw_input_field('sidebox_sort_order', $ezInfo->sidebox_sort_order, zen_set_field_length(TABLE_EZPAGES, 'sidebox_sort_order'), false); ?>
                </td>
                <td align="center">&nbsp;<?php echo zen_draw_separator('pixel_black.gif', '2', '50'); ?>&nbsp;</td>

                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_STATUS_FOOTER; ?></strong><br />
                  <?php echo zen_draw_radio_field('status_footer', '1', $is_status_footer) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('status_footer', '0', $not_status_footer) . '&nbsp;' . TEXT_NO; ?>
                </td>
                <td class="main" align="center" valign="bottom">
                  <?php echo TEXT_FOOTER_SORT_ORDER; ?><br />
                  <?php echo zen_draw_input_field('footer_sort_order', $ezInfo->footer_sort_order, zen_set_field_length(TABLE_EZPAGES, 'footer_sort_order'), false); ?>
                </td>
                <td align="center">&nbsp;<?php echo zen_draw_separator('pixel_black.gif', '2', '50'); ?>&nbsp;</td>

                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_CHAPTER_PREV_NEXT; ?></strong>
                <?php echo zen_draw_input_field('toc_chapter', $ezInfo->toc_chapter, zen_set_field_length(TABLE_EZPAGES, 'toc_chapter', '6'), false); ?>
                </td>

                <td class="main" align="left" valign="top"><strong>
                <?php echo TABLE_HEADING_STATUS_TOC; ?></strong><br />
                  <?php echo zen_draw_radio_field('status_toc', '1', $is_status_toc) . '&nbsp;' . TEXT_YES . '<br />' . zen_draw_radio_field('status_toc', '0', $not_status_toc) . '&nbsp;' . TEXT_NO; ?>
                </td>
                <td class="main" align="center" valign="bottom">
                  <?php echo TEXT_TOC_SORT_ORDER; ?><br />
                  <?php echo zen_draw_input_field('toc_sort_order', $ezInfo->toc_sort_order, zen_set_field_length(TABLE_EZPAGES, 'toc_sort_order'), false); ?>
                </td>

              </tr>
            </table></td>
          </tr>
              <tr>
                <td class="main" colspan="2">
                  <?php echo TEXT_HEADER_SORT_ORDER_EXPLAIN . '<br />'; ?>
                  <?php echo TEXT_SIDEBOX_ORDER_EXPLAIN . '<br />'; ?>
                  <?php echo TEXT_FOOTER_ORDER_EXPLAIN . '<br />'; ?>
                  <?php echo TEXT_TOC_SORT_ORDER_EXPLAIN . '<br />'; ?>
                  <?php echo TEXT_CHAPTER_EXPLAIN; ?>
                </td>
              </tr>


          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>
          <tr>
            <td valign="top" class="main"><?php echo TEXT_PAGES_HTML_TEXT; ?></td>
            <td class="main">
				<?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                $oFCKeditor = new FCKeditor('pages_html_text') ;
                $oFCKeditor->Value = htmlspecialchars($ezInfo->pages_html_text);
                $oFCKeditor->Width  = '80%' ;
                $oFCKeditor->Height = '500' ;
//                $oFCKeditor->Create() ;
                $output = $oFCKeditor->CreateHtml() ; echo $output;
					} else { // using HTMLAREA or just raw "source"
					echo zen_draw_textarea_field('pages_html_text', 'soft', '100%', '40', htmlspecialchars($ezInfo->pages_html_text));
					} ?>
            </td>
          </tr>

          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>

          <tr>
            <td class="main" valign="top"><?php echo TEXT_ALT_URL; ?></td>
            <td class="main" valign="top"><?php echo zen_draw_input_field('alt_url', $ezInfo->alt_url, 'size="100"');
             			   echo '<br />' . TEXT_ALT_URL_EXPLAIN;
            		?></td>
          </tr>

          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>

          <tr>
            <td class="main" valign="top"><?php echo TEXT_ALT_URL_EXTERNAL; ?></td>
            <td class="main" valign="top"><?php echo zen_draw_input_field('alt_url_external', $ezInfo->alt_url_external, 'size="100"');
             			   echo '<br />' . TEXT_ALT_URL_EXTERNAL_EXPLAIN;
            		?></td>
          </tr>

          <tr>
            <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
          </tr>

        </table></td>
      </tr>
      <tr>
        <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2" class="main" align="left" valign="top" nowrap><?php echo (($form_action == 'insert') ? zen_image_submit('button_insert.gif', IMAGE_INSERT) : zen_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($_GET['ezID']) ? 'ezID=' . $_GET['ezID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
          </tr>
        </table></td>
      </form></tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow" width="100%">
                <td class="dataTableHeadingContent" width="75px" align="center"><?php echo TABLE_HEADING_ID; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAGES; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PAGE_OPEN_NEW_WINDOW; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PAGE_IS_SSL; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS_HEADER; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS_SIDEBOX; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS_FOOTER; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CHAPTER; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS_TOC; ?></td>
                <td class="dataTableHeadingContent" align="center">&nbsp;</td>
              </tr>

<?php
// set display order
  switch(true) {
    case ($_SESSION['ez_sort_order'] == 0):
      $ez_order_by =  " order by toc_chapter, toc_sort_order, pages_title";
      break;
    case ($_SESSION['ez_sort_order'] == 1):
      $ez_order_by =  " order by header_sort_order, pages_title";
      break;
    case ($_SESSION['ez_sort_order'] == 2):
      $ez_order_by =  " order by sidebox_sort_order, pages_title";
      break;
    case ($_SESSION['ez_sort_order'] == 3):
      $ez_order_by =  " order by footer_sort_order, pages_title";
      break;
    case ($_SESSION['ez_sort_order'] == 4):
      $ez_order_by =  " order by pages_title";
      break;
    case ($_SESSION['ez_sort_order'] == 5):
      $ez_order_by =  " order by  pages_id, pages_title";
      break;
    default:
      $ez_order_by =  " order by toc_chapter, toc_sort_order, pages_title";
      break;
  }

    $pages_query_raw = "select * from " . TABLE_EZPAGES . $ez_order_by;

// Split Page
// reset page when page is unknown
if (($_GET['page'] == '' or $_GET['page'] == '1') and $_GET['ezID'] != '') {
  $check_page = $db->Execute($pages_query_raw);
  $check_count=1;
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) {
    while (!$check_page->EOF) {
      if ($check_page->fields['customers_id'] == $_GET['cID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_EZPAGE)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) !=0 ? .5 : 0)),0);
  } else {
    $_GET['page'] = 1;
  }
}

    $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $pages_query_raw, $pages_query_numrows);
    $pages = $db->Execute($pages_query_raw);

while (!$pages->EOF) {
     if ((!isset($_GET['ezID']) || (isset($_GET['ezID']) && ($_GET['ezID'] == $pages->fields['pages_id']))) && !isset($ezInfo) && (substr($action, 0, 3) != 'new')) {
        $ezInfo_array = $pages->fields;
        $ezInfo = new objectInfo($ezInfo_array);
      }
    $zv_link_method_cnt = 0;
    if ($pages->fields['alt_url'] !='') {
      $zv_link_method_cnt++;
    }
    if ($pages->fields['alt_url_external'] !='') {
      $zv_link_method_cnt++;
    }
    if ($pages->fields['pages_html_text'] !='' and strlen(trim($pages->fields['pages_html_text'])) > 6) {
      $zv_link_method_cnt++;
    }
      if (isset($ezInfo) && is_object($ezInfo) && ($pages->fields['pages_id'] == $ezInfo->pages_id)) {
        echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $pages->fields['pages_id']) . '\'">' . "\n";
      } else {
        echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $pages->fields['pages_id']) . '\'">' . "\n";
      }
?>
                <td class="dataTableContent" width="75px" align="right"><?php echo ($zv_link_method_cnt > 1 ? zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) : '') . '&nbsp;' . $pages->fields['pages_id']; ?></td>
                <td class="dataTableContent"><?php echo '&nbsp;' . $pages->fields['pages_title']; ?></td>
                <td class="dataTableContent" align="center"><?php echo ($pages->fields['page_open_new_window'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=page_open_new_window&current=' . $pages->fields['page_open_new_window'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=page_open_new_window&current=' . $pages->fields['page_open_new_window'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="center"><?php echo ($pages->fields['page_is_ssl'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=page_is_ssl&current=' . $pages->fields['page_is_ssl'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=page_is_ssl&current=' . $pages->fields['page_is_ssl'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="right"><?php echo $pages->fields['header_sort_order'] . '&nbsp;' . ($pages->fields['status_header'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_header&current=' . $pages->fields['status_header'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_header&current=' . $pages->fields['status_header'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="right"><?php echo $pages->fields['sidebox_sort_order'] . '&nbsp;' . ($pages->fields['status_sidebox'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_sidebox&current=' . $pages->fields['status_sidebox'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_sidebox&current=' . $pages->fields['status_sidebox'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="right"><?php echo $pages->fields['footer_sort_order'] . '&nbsp;' . ($pages->fields['status_footer'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_footer&current=' . $pages->fields['status_footer'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_footer&current=' . $pages->fields['status_footer'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="right"><?php echo $pages->fields['toc_chapter']; ?></td>
                <td class="dataTableContent" align="right"><?php echo $pages->fields['toc_sort_order'] . '&nbsp;' . ($pages->fields['status_toc'] == 1 ? '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_toc&current=' . $pages->fields['status_toc'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>' : '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=status_toc&current=' . $pages->fields['status_toc'] . '&ezID=' . $pages->fields['pages_id'] . ($_GET['page'] > 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>'); ?></td>
                <td class="dataTableContent" align="center">&nbsp;&nbsp;<?php echo '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN,
(isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($ezInfo) && is_object($ezInfo) && ($pages->fields['pages_id'] == $ezInfo->pages_id)) ? 'ezID=' . $pages->fields['pages_id'] . '&action=new' : '') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?><?php if (isset($ezInfo) && is_object($ezInfo) && ($pages->fields['pages_id'] == $ezInfo->pages_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (isset($pages->fields['pages_id']) ? 'ezID=' . $pages->fields['pages_id'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?></td>
              </tr>
<?php

 $pages->MoveNext();
    }
?>
                  <tr>

                    <td class="smallText" valign="top" colspan="2"><?php echo $pages_split->display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td>
                    <td class="smallText" align="right" colspan="8"><?php echo $pages_split->display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'ezID'))); ?></td>
                  </tr>

              <tr>
                <td colspan="10"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td align="right" colspan="2"><?php echo '<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'action=new') . '">' . zen_image_button('button_new_file.gif', IMAGE_NEW_PAGE) . '</a>'; ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();
  switch ($action) {
    case 'delete':
      $heading[] = array('text' => '<b>' . $ezInfo->pages_title . '</b>');

      $contents = array('form' => zen_draw_form('pages', FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $ezInfo->pages_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br /><b>' . $ezInfo->pages_title . '</b>');

      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($ezInfo)) {
        $heading[] = array('text' => '<b>' . TEXT_PAGE_TITLE . '&nbsp;' . $ezInfo->pages_title . '&nbsp;|&nbsp;' . TEXT_CHAPTER . '&nbsp;' . $ezInfo->toc_chapter . '</b>');

        $zv_link_method_cnt = 0;
        if ($ezInfo->alt_url !='') {
          $zv_link_method_cnt++;
        }
        if ($ezInfo->alt_url_external !='') {
          $zv_link_method_cnt++;
        }
        if ($ezInfo->pages_html_text !='' and strlen(trim($ezInfo->pages_html_text)) > 6) {
          $zv_link_method_cnt++;
        }

        if ($zv_link_method_cnt > 1) {
          $contents[] = array('align' => 'left', 'text' => zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) . ' &nbsp;' . TEXT_WARNING_MULTIPLE_SETTINGS);
        }

        $contents[] = array('align' => 'left', 'text' => TEXT_ALT_URL . (empty($ezInfo->alt_url) ? '&nbsp;' . TEXT_NONE : '<br />' . $ezInfo->alt_url));
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_ALT_URL_EXTERNAL . (empty($ezInfo->alt_url_external) ? '&nbsp;' . TEXT_NONE : '<br />' . $ezInfo->alt_url_external));
        $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_PAGES_HTML_TEXT . '<br />' . substr(strip_tags($ezInfo->pages_html_text),0,100));

        $contents[] = array('align' => 'left', 'text' => '<br /><a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $ezInfo->pages_id . '&action=new') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $ezInfo->pages_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br /><br /><br />');

        if ($ezInfo->date_scheduled) $contents[] = array('text' => '<br />' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, zen_date_short($ezInfo->date_scheduled)));

        if ($ezInfo->expires_date) {
          $contents[] = array('text' => '<br />' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, zen_date_short($ezInfo->expires_date)));
        } elseif ($ezInfo->expires_impressions) {
          $contents[] = array('text' => '<br />' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $ezInfo->expires_impressions));
        }

        if ($ezInfo->date_status_change) $contents[] = array('text' => '<br />' . sprintf(TEXT_PAGES_STATUS_CHANGE, zen_date_short($ezInfo->date_status_change)));
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                     adminhome/featured.php                                                                              0000755 0001012 0001007 00000065355 11376403440 015516  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 *  $Id: featured.php 16339 2010-05-24 09:57:04Z ajeh $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'setflag':
        zen_set_featured_status($_GET['id'], $_GET['flag']);

        zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . $_GET['id'], 'NONSSL'));
        break;
      case 'insert':
        if ($_POST['products_id'] < 1) {
          $messageStack->add_session(ERROR_NOTHING_SELECTED, 'caution');
        } else {
        $products_id = zen_db_prepare_input($_POST['products_id']);

        $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
        $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));

        $db->Execute("insert into " . TABLE_FEATURED . "
                    (products_id, featured_date_added, expires_date, status, featured_date_available)
                    values ('" . (int)$products_id . "',
                            now(),
                            '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')");

        $new_featured = $db->Execute("select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$products_id . "'");
        } // nothing selected to add
        if ($_GET['go_back'] == 'ON'){
          zen_redirect(zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $products_id . '&current_category_id=' . $_GET['current_category_id']));
        } else {
          zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . $new_featured->fields['featured_id']));
        }
        break;
      case 'update':
        $featured_id = zen_db_prepare_input($_POST['featured_id']);

        $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
        $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));

        $db->Execute("update " . TABLE_FEATURED . "
                      set featured_last_modified = now(),
                          expires_date = '" . zen_db_input($expires_date) . "',
                          featured_date_available = '" . zen_db_input($featured_date_available) . "'
                      where featured_id = '" . (int)$featured_id . "'");

        zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . 'fID=' . (int)$featured_id));
        break;
      case 'deleteconfirm':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page']));
        }
        $featured_id = zen_db_prepare_input($_GET['fID']);

        $db->Execute("delete from " . TABLE_FEATURED . "
                      where featured_id = '" . (int)$featured_id . "'");

        zen_redirect(zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page']));
        break;
      case 'pre_add_confirmation':
      // check for blank or existing featured
        $skip_featured = false;
        if (empty($_POST['pre_add_products_id'])) {
          $skip_featured = true;
          $messageStack->add_session(WARNING_FEATURED_PRE_ADD_EMPTY, 'caution');
        }

        if ($skip_featured == false) {
          $sql = "select products_id from " . TABLE_PRODUCTS . " where products_id='" . (int)$_POST['pre_add_products_id'] . "'";
          $check_featured = $db->Execute($sql);
          if ($check_featured->RecordCount() < 1) {
            $skip_featured = true;
            $messageStack->add_session(WARNING_FEATURED_PRE_ADD_BAD_PRODUCTS_ID, 'caution');
          }
        }

        if ($skip_featured == false) {
          $sql = "select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$_POST['pre_add_products_id'] . "'";
          $check_featured = $db->Execute($sql);
          if ($check_featured->RecordCount() > 0) {
            $skip_featured = true;
            $messageStack->add_session(WARNING_FEATURED_PRE_ADD_DUPLICATE, 'caution');
          }
        }

        if ($skip_featured == true) {
          zen_redirect(zen_href_link(FILENAME_FEATURED, (isset($_GET['page']) && $_GET['page'] > 0 ? 'page=' . $_GET['page'] . '&' : '') . ((int)$check_featured->fields['featured_id'] > 0 ? 'fID=' . (int)$check_featured->fields['featured_id'] : '')));
        }
      // add empty featured

        $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start']));
        $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end']));

        $products_id = zen_db_prepare_input($_POST['pre_add_products_id']);
        $db->Execute("insert into " . TABLE_FEATURED . "
                    (products_id, featured_date_added, expires_date, status, featured_date_available)
                    values ('" . (int)$products_id . "',
                            now(),
                            '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')");

        $new_featured = $db->Execute("select featured_id from " . TABLE_FEATURED . " where products_id='" . (int)$products_id . "'");

        $messageStack->add_session(SUCCESS_FEATURED_PRE_ADD, 'success');
        zen_redirect(zen_href_link(FILENAME_FEATURED, 'action=edit' . '&fID=' . $new_featured->fields['featured_id'] . '&manual=1'));
        break;

    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<?php
  if ( ($action == 'new') || ($action == 'edit') ) {
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<?php
  }
?>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr><?php echo zen_draw_form('search', FILENAME_FEATURED, '', 'get'); ?>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="smallText" align="right">
<?php
// show reset search
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    echo '<a href="' . zen_href_link(FILENAME_FEATURED) . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>&nbsp;&nbsp;';
  }
  echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
  }
?>
            </td>
          </form></tr>
          <tr>
            <td colspan="3" class="main"><?php echo TEXT_STATUS_WARNING; ?></td>
          </tr>
        </table></td>
      </tr>

<?php
  if (empty($action)) {
?>
                    <td align="center"><?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, ((isset($_GET['page']) && $_GET['page'] > 0) ? 'page=' . $_GET['page'] . '&' : '') . 'action=new') . '">' . zen_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
<?php
  }
?>
<?php
  if ( ($action == 'new') || ($action == 'edit') ) {
    $form_action = 'insert';
    if ( ($action == 'edit') && isset($_GET['fID']) ) {
      $form_action = 'update';

      $product = $db->Execute("select p.products_id, pd.products_name, p.products_price, p.products_priced_by_attribute,
                                      f.expires_date, f.featured_date_available
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
                                        TABLE_FEATURED . " f
                               where p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and p.products_id = f.products_id
                               and f.featured_id = '" . (int)$_GET['fID'] . "'");

      $fInfo = new objectInfo($product->fields);

      if ($fInfo->products_priced_by_attribute == '1') {
        $fInfo->products_price = zen_get_products_base_price($product->fields['products_id']);
      }

    } else {
      $fInfo = new objectInfo(array());

// create an array of featured products, which will be excluded from the pull down menu of products
// (when creating a new featured product)
      $featured_array = array();
      $featured = $db->Execute("select p.products_id, p.products_model
                                from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " f
                                where f.products_id = p.products_id");

      while (!$featured->EOF) {
        $featured_array[] = $featured->fields['products_id'];
        $featured->MoveNext();
      }

// do not include things that cannot go in the cart
      $not_for_cart = $db->Execute("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCT_TYPES . " pt on p.products_type= pt.type_id where pt.allow_add_to_cart = 'N'");

      while (!$not_for_cart->EOF) {
        $featured_array[] = $not_for_cart->fields['products_id'];
        $not_for_cart->MoveNext();
      }
    }
?>
<script language="javascript">
var StartDate = new ctlSpiffyCalendarBox("StartDate", "new_featured", "start", "btnDate1","<?php echo (($fInfo->featured_date_available == '0001-01-01') ? '' : zen_date_short($fInfo->featured_date_available)); ?>",scBTNMODE_CUSTOMBLUE);
var EndDate = new ctlSpiffyCalendarBox("EndDate", "new_featured", "end", "btnDate2","<?php echo (($fInfo->expires_date == '0001-01-01') ? '' : zen_date_short($fInfo->expires_date)); ?>",scBTNMODE_CUSTOMBLUE);
</script>

      <tr>
      <?php echo zen_draw_form('new_featured', FILENAME_FEATURED, zen_get_all_get_params(array('action', 'info', 'fID')) . 'action=' . $form_action . '&go_back=' . $_GET['go_back']); ?><?php if ($form_action == 'update') echo zen_draw_hidden_field('featured_id', $_GET['fID']); ?>
        <td><br><table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><?php echo TEXT_FEATURED_PRODUCT; ?>&nbsp;</td>
            <td class="main"><?php echo (isset($fInfo->products_name)) ? $fInfo->products_name . ' <small>(' . $currencies->format($fInfo->products_price) . ')</small>' : zen_draw_products_pull_down('products_id', 'size="15" style="font-size:12px"', $featured_array, true, $_GET['add_products_id'], true); echo zen_draw_hidden_field('products_price', (isset($fInfo->products_price) ? $fInfo->products_price : '')); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_FEATURED_AVAILABLE_DATE; ?>&nbsp;</td>
            <td class="main"><script language="javascript">StartDate.writeControl(); StartDate.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script></td>
          </tr>
          <tr>
            <td class="main"><?php echo TEXT_FEATURED_EXPIRES_DATE; ?>&nbsp;</td>
            <td class="main"><script language="javascript">EndDate.writeControl(); EndDate.dateFormat="<?php echo DATE_FORMAT_SPIFFYCAL; ?>";</script></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
            <td colspan="2" class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? zen_image_submit('button_insert.gif', IMAGE_INSERT) : zen_image_submit('button_update.gif', IMAGE_UPDATE)). ((int)$_GET['manual'] == 0 ? '&nbsp;&nbsp;&nbsp;<a href="' . ($_GET['go_back'] == 'ON' ? zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $_GET['add_products_id'] . '&current_category_id=' . $_GET['current_category_id']) : zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . (isset($_GET['fID']) ? '&fID=' . $_GET['fID'] : ''))) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' : ''); ?></td>
          </tr>
        </table></td>
      </form></tr>
<?php
  } else {
?>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" align="right"><?php echo 'ID#'; ?>&nbsp;</td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_AVAILABLE_DATE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EXPIRES_DATE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
// create search filter
  $search = '';
  if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    $search = " and (pd.products_name like '%" . $keywords . "%' or pd.products_description like '%" . $keywords . "%' or p.products_model like '%" . $keywords . "%')";
  }

// order of display
  $order_by = " order by pd.products_name ";
  $featured_query_raw = "select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_priced_by_attribute, f.featured_id, f.featured_date_added, f.featured_last_modified, f.expires_date, f.date_status_change, f.status, f.featured_date_available from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " f, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_id = f.products_id"  . $search . $order_by;

// Split Page
// reset page when page is unknown
if (($_GET['page'] == '1' or $_GET['page'] == '') and $_GET['fID'] != '') {
  $old_page = $_GET['page'];
  $check_page = $db->Execute($featured_query_raw);
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN) {
    $check_count=1;
    while (!$check_page->EOF) {
      if ($check_page->fields['featured_id'] == $_GET['fID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN) !=0 ? .5 : 0)),0);
    $page = $_GET['page'];
    if ($old_page != $_GET['page']) {
// do nothing
    }
  } else {
    $_GET['page'] = 1;
  }
}


// create split page control
    $featured_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, $featured_query_raw, $featured_query_numrows);
    $featured = $db->Execute($featured_query_raw);
    while (!$featured->EOF) {
      if ((!isset($_GET['fID']) || (isset($_GET['fID']) && ($_GET['fID'] == $featured->fields['featured_id']))) && !isset($fInfo)) {
        $products = $db->Execute("select products_image
                                  from " . TABLE_PRODUCTS . "
                                  where products_id = '" . (int)$featured->fields['products_id'] . "'");

        $fInfo_array = array_merge($featured->fields, $products->fields);
        $fInfo = new objectInfo($fInfo_array);
      }

      if (isset($fInfo) && is_object($fInfo) && ($featured->fields['featured_id'] == $fInfo->featured_id)) {
        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=edit') . '\'">' . "\n";
      } else {
        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=edit') . '\'">' . "\n";
      }

?>
                <td  class="dataTableContent" align="right"><?php echo $featured->fields['products_id']; ?>&nbsp;</td>
                <td  class="dataTableContent"><?php echo $featured->fields['products_name']; ?></td>
                <td  class="dataTableContent" align="left"><?php echo $featured->fields['products_model']; ?>&nbsp;</td>
                <td  class="dataTableContent" align="center"><?php echo (($featured->fields['featured_date_available'] != '0001-01-01' and $featured->fields['featured_date_available'] !='') ? zen_date_short($featured->fields['featured_date_available']) : TEXT_NONE); ?></td>
                <td  class="dataTableContent" align="center"><?php echo (($featured->fields['expires_date'] != '0001-01-01' and $featured->fields['expires_date'] !='') ? zen_date_short($featured->fields['expires_date']) : TEXT_NONE); ?></td>
                <td  class="dataTableContent" align="center">
<?php
      if ($featured->fields['status'] == '1') {
        echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=setflag&flag=0&id=' . $featured->fields['featured_id'] . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '</a>';
      } else {
        echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=setflag&flag=1&id=' . $featured->fields['featured_id'] . '&page=' . $_GET['page'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
      }
?>
                </td>
                <td class="dataTableContent" align="right">
                  <?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?>
				          <?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $featured->fields['featured_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '</a>'; ?>
                  <?php if (isset($fInfo) && is_object($fInfo) && ($featured->fields['featured_id'] == $fInfo->featured_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_FEATURED, zen_get_all_get_params(array('fID')) . 'fID=' . $featured->fields['featured_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
				        </td>
      </tr>
<?php
      $featured->MoveNext();
    }
?>
              <tr>
                <td colspan="4"><table border="0" width="100%" cellpadding="0"cellspacing="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $featured_split->display_count($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_FEATURED); ?></td>
                    <td class="smallText" align="right"><?php echo $featured_split->display_links($featured_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_FEATURED_ADMIN, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
<?php
  if (empty($action)) {
?>
                  <tr>
                    <td colspan="2" align="right"><?php echo '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&action=new') . '">' . zen_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>
                  </tr>
<?php
  }
?>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'delete':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_FEATURED . '</b>');

      $contents = array('form' => zen_draw_form('featured', FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
      $contents[] = array('text' => '<br /><b>' . $fInfo->products_name . '</b>');
      $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'pre_add':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_PRE_ADD_FEATURED . '</b>');
      $contents = array('form' => zen_draw_form('featured', FILENAME_FEATURED, 'action=pre_add_confirmation' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')));
      $contents[] = array('text' => TEXT_INFO_PRE_ADD_INTRO);
      $contents[] = array('text' => '<br />' . TEXT_PRE_ADD_PRODUCTS_ID . '<br>' . zen_draw_input_field('pre_add_products_id', '', zen_set_field_length(TABLE_FEATURED, 'products_id')));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_confirm.gif', IMAGE_CONFIRM) . '&nbsp;<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . ($fInfo->featured_id > 0 ? '&fID=' . $fInfo->featured_id : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (is_object($fInfo)) {
        $heading[] = array('text' => '<b>' . $fInfo->products_name . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_FEATURED, 'page=' . $_GET['page'] . '&fID=' . $fInfo->featured_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'action=edit&products_filter=' . $fInfo->products_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a>');
        $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($fInfo->featured_date_added));
        $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($fInfo->featured_last_modified));
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_info_image($fInfo->products_image, $fInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));

        $contents[] = array('text' => '<br />' . TEXT_INFO_AVAILABLE_DATE . ' <b>' . (($fInfo->featured_date_available != '0001-01-01' and $fInfo->featured_date_available !='') ? zen_date_short($fInfo->featured_date_available) : TEXT_NONE) . '</b>');
        $contents[] = array('text' => TEXT_INFO_EXPIRES_DATE . ' <b>' . (($fInfo->expires_date != '0001-01-01' and $fInfo->expires_date !='') ? zen_date_short($fInfo->expires_date) : TEXT_NONE) . '</b>');
        $contents[] = array('text' => '<br />' . TEXT_INFO_STATUS_CHANGE . ' ' . zen_date_short($fInfo->date_status_change));
        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CATEGORIES, '&action=new_product' . '&cPath=' . zen_get_product_path($fInfo->products_id, 'override') . '&pID=' . $fInfo->products_id . '&product_type=' . zen_get_products_type($fInfo->products_id)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . '</a>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=pre_add' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_select.gif', IMAGE_SELECT) . '<br />' . TEXT_INFO_MANUAL . '</a><br /><br />');
      } else {
        $heading[] = array('text' => '<b>' . TEXT_NONE . '</b>');
        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_FEATURED, 'action=pre_add' . ((isset($_GET['page']) && $_GET['page'] > 0) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_select.gif', IMAGE_SELECT) . '<br />' . TEXT_INFO_MANUAL . '</a><br /><br />');
      }
      break;
  }
  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
}
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                                   adminhome/geo_zones.php                                                                             0000755 0001012 0001007 00000074011 10517751616 015703  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: geo_zones.php 4838 2006-10-26 02:13:50Z ajeh $
 */

  require('includes/application_top.php');

  $saction = (isset($_GET['saction']) ? $_GET['saction'] : '');

  if (zen_not_null($saction)) {
    switch ($saction) {
      case 'insert_sub':
        $zID = zen_db_prepare_input($_GET['zID']);
        $zone_country_id = zen_db_prepare_input($_POST['zone_country_id']);
        $zone_id = zen_db_prepare_input($_POST['zone_id']);

        $db->Execute("insert into " . TABLE_ZONES_TO_GEO_ZONES . "
                    (zone_country_id, zone_id, geo_zone_id, date_added)
                    values ('" . (int)$zone_country_id . "',
                            '" . (int)$zone_id . "',
                            '" . (int)$zID . "',
                            now())");

        $new_subzone_id = $db->Insert_ID();

//        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $new_subzone_id));
        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list' . '&sID=' . $new_subzone_id));
        break;
      case 'save_sub':
        $sID = zen_db_prepare_input($_GET['sID']);
        $zID = zen_db_prepare_input($_GET['zID']);
        $zone_country_id = zen_db_prepare_input($_POST['zone_country_id']);
        $zone_id = zen_db_prepare_input($_POST['zone_id']);

        $db->Execute("update " . TABLE_ZONES_TO_GEO_ZONES . "
                      set geo_zone_id = '" . (int)$zID . "',
                          zone_country_id = '" . (int)$zone_country_id . "',
                          zone_id = " . (zen_not_null($zone_id) ? "'" . (int)$zone_id . "'" : 'null') . ",
                          last_modified = now()
                      where association_id = '" . (int)$sID . "'");


        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $_GET['sID']));
        break;
      case 'deleteconfirm_sub':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage']));
        }
        $sID = zen_db_prepare_input($_GET['sID']);

        $db->Execute("delete from " . TABLE_ZONES_TO_GEO_ZONES . "
                      where association_id = '" . (int)$sID . "'");

        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage']));
        break;
    }
  }

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'insert_zone':
        $geo_zone_name = zen_db_prepare_input($_POST['geo_zone_name']);
        $geo_zone_description = zen_db_prepare_input($_POST['geo_zone_description']);

        $db->Execute("insert into " . TABLE_GEO_ZONES . "
                    (geo_zone_name, geo_zone_description, date_added)
                    values ('" . zen_db_input($geo_zone_name) . "',
                            '" . zen_db_input($geo_zone_description) . "',
                            now())");

        $new_zone_id = $db->Insert_ID();
        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zID=' . $new_zone_id));
        break;
      case 'save_zone':
        $zID = zen_db_prepare_input($_GET['zID']);
        $geo_zone_name = zen_db_prepare_input($_POST['geo_zone_name']);
        $geo_zone_description = zen_db_prepare_input($_POST['geo_zone_description']);

        $db->Execute("update " . TABLE_GEO_ZONES . "
                      set geo_zone_name = '" . zen_db_input($geo_zone_name) . "',
                          geo_zone_description = '" . zen_db_input($geo_zone_description) . "',
                          last_modified = now() where geo_zone_id = '" . (int)$zID . "'");

        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zID=' . $_GET['zID']));
        break;
      case 'deleteconfirm_zone':
        // demo active test
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage']));
        }
        $zID = zen_db_prepare_input($_GET['zID']);

        $check_tax_rates = $db->Execute("select tax_zone_id from " . TABLE_TAX_RATES . " where tax_zone_id='" . $zID . "'");
        if ($check_tax_rates->RecordCount() > 0) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_TAX_RATE_EXISTS, 'caution');
        } else {
          $db->Execute("delete from " . TABLE_GEO_ZONES . "
                        where geo_zone_id = '" . (int)$zID . "'");

          $db->Execute("delete from " . TABLE_ZONES_TO_GEO_ZONES . "
                        where geo_zone_id = '" . (int)$zID . "'");
        }

        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage']));
        break;
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<?php
  if (isset($_GET['zID']) && (($saction == 'edit') || ($saction == 'new'))) {
?>
<script language="javascript"><!--
function resetZoneSelected(theForm) {
  if (theForm.state.value != '') {
    theForm.zone_id.selectedIndex = '0';
    if (theForm.zone_id.options.length > 0) {
      theForm.state.value = '<?php echo JS_STATE_SELECT; ?>';
    }
  }
}

function update_zone(theForm) {
  var NumState = theForm.zone_id.options.length;
  var SelectedCountry = "";

  while(NumState > 0) {
    NumState--;
    theForm.zone_id.options[NumState] = null;
  }

  SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;

<?php echo zen_js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>

}
//--></script>
<?php
  }
?>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; if (isset($_GET['zone'])) echo '<br><span class="smallText">' . zen_get_geo_zone_name($_GET['zone']) . '</span>'; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top">
<?php
  if ($action == 'list') {
?>
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_ZONE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
// Split Page
// reset page when page is unknown
if ((!isset($_GET['spage']) or $_GET['spage'] == '' or $_GET['spage'] == '1') and $_GET['sID'] != '') {
//  $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by association_id";
  $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by c.countries_name, association_id";
  $check_page = $db->Execute($zones_query_raw);
  $check_count=1;
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
    while (!$check_page->EOF) {
      if ($check_page->fields['association_id'] == $_GET['sID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['spage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
  } else {
    $_GET['spage'] = 1;
  }
}
    $rows = 0;
//    $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by association_id";
    $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . $_GET['zID'] . " order by c.countries_name, association_id";
    $zones_split = new splitPageResults($_GET['spage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
    $zones = $db->Execute($zones_query_raw);
    while (!$zones->EOF) {
      $rows++;
      if ((!isset($_GET['sID']) || (isset($_GET['sID']) && ($_GET['sID'] == $zones->fields['association_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
        $sInfo = new objectInfo($zones->fields);
      }
      if (isset($sInfo) && is_object($sInfo) && ($zones->fields['association_id'] == $sInfo->association_id)) {
        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '\'">' . "\n";
      } else {
        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $zones->fields['association_id']) . '\'">' . "\n";
      }
?>
                <td class="dataTableContent"><?php echo (($zones->fields['countries_name']) ? $zones->fields['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
                <td class="dataTableContent"><?php echo (($zones->fields['zone_id']) ? $zones->fields['zone_name'] : PLEASE_SELECT); ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($zones->fields['association_id'] == $sInfo->association_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $zones->fields['association_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $zones->MoveNext();
    }
?>
              <tr>
                <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['spage'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
                    <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['spage'], 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list', 'spage'); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td align="right" colspan="3"><?php if (empty($saction)) echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($sInfo) ? 'sID=' . $sInfo->association_id . '&' : '') . 'saction=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
              </tr>
            </table>
<?php
  } else {
?>
<?php echo TEXT_LEGEND; ?>&nbsp;
<?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . TEXT_LEGEND_TAX_AND_ZONES; ?>&nbsp;&nbsp;&nbsp;
<?php echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . TEXT_LEGEND_ONLY_ZONES; ?>&nbsp;&nbsp;&nbsp;
<?php echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . TEXT_LEGEND_NOT_CONF; ?>&nbsp;&nbsp;&nbsp;<br />
            <table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES_DESCRIPTION; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
// Split Page
// reset page when page is unknown
if ((!isset($_GET['zpage']) or $_GET['zpage'] == '' or $_GET['zpage'] == '1') and $_GET['zID'] != '') {
  $zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
  $check_page = $db->Execute($zones_query_raw);
  $check_count=1;
  if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
    while (!$check_page->EOF) {
      if ($check_page->fields['geo_zone_id'] == $_GET['zID']) {
        break;
      }
      $check_count++;
      $check_page->MoveNext();
    }
    $_GET['zpage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
  } else {
    $_GET['zpage'] = 1;
  }
}
    $zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
    $zones_split = new splitPageResults($_GET['zpage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
    $zones = $db->Execute($zones_query_raw);
    while (!$zones->EOF) {
        $num_zones = $db->Execute("select count(*) as num_zones
                                   from " . TABLE_ZONES_TO_GEO_ZONES . "
                                   where geo_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
                                   group by geo_zone_id");

        if ($num_zones->fields['num_zones'] > 0) {
          $zones->fields['num_zones'] = $num_zones->fields['num_zones'];
        } else {
          $zones->fields['num_zones'] = 0;
        }

        $num_tax_rates = $db->Execute("select count(*) as num_tax_rates
                                   from " . TABLE_TAX_RATES . "
                                   where tax_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
                                   group by tax_zone_id");

        if ($num_tax_rates->fields['num_tax_rates'] > 0) {
          $zones->fields['num_tax_rates'] = $num_tax_rates->fields['num_tax_rates'];
        } else {
          $zones->fields['num_tax_rates'] = 0;
        }

      if ((!isset($_GET['zID']) || (isset($_GET['zID']) && ($_GET['zID'] == $zones->fields['geo_zone_id']))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) {
        $zInfo = new objectInfo($zones->fields);
      }
      if (isset($zInfo) && is_object($zInfo) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id)) {
        echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '\'">' . "\n";
      } else {
        echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id']) . '\'">' . "\n";
      }
?>
                <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id'] . '&action=list') . '">' . zen_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;' . $zones->fields['geo_zone_name']; ?></td>
                <td class="dataTableContent"><?php echo $zones->fields['geo_zone_description']; ?></td>
                <td class="dataTableContent" align="center"><?php
                    // show current status
                    if ($zones->fields['num_tax_rates'] && $zones->fields['num_zones']) {
                      echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
                    } elseif ($zones->fields['num_zones']) {
                      echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
                    } else {
                      echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
                    }
                  ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($zInfo) && is_object($zInfo) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
      $zones->MoveNext();
    }
?>
              <tr>
                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['zpage'], TEXT_DISPLAY_NUMBER_OF_TAX_ZONES); ?></td>
                    <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['zpage'], '', 'zpage'); ?></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td align="right" colspan="4"><?php if (!$action) echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=new_zone') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
              </tr>
            </table>
<?php
  }
?>
            </td>
<?php
  $heading = array();
  $contents = array();

  if ($action == 'list') {
    switch ($saction) {
      case 'new':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub'));
        $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down()));
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'edit':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub'));
        $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
        $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'delete':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub'));
        $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
        $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>');
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      default:
        if (isset($sInfo) && is_object($sInfo)) {
          $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>');

          $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->date_added));
          if (zen_not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->last_modified));
        }
        break;
    }
  } else {
    switch ($action) {
      case 'new_zone':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=insert_zone'));
        $contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . zen_draw_input_field('geo_zone_name', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . zen_draw_input_field('geo_zone_description', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'edit_zone':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=save_zone'));
        $contents[] = array('text' => TEXT_INFO_EDIT_ZONE_INTRO);
        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . zen_draw_input_field('geo_zone_name', $zInfo->geo_zone_name, zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
        $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . zen_draw_input_field('geo_zone_description', $zInfo->geo_zone_description, zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      case 'delete_zone':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>');

        $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=deleteconfirm_zone'));
        $contents[] = array('text' => TEXT_INFO_DELETE_ZONE_INTRO);
        $contents[] = array('text' => '<br><b>' . $zInfo->geo_zone_name . '</b>');
        $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
      default:
        if (isset($zInfo) && is_object($zInfo)) {
          $heading[] = array('text' => '<b>' . $zInfo->geo_zone_name . '</b>');

          $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=edit_zone') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=delete_zone') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>');
          $contents[] = array('align' => 'center', 'text' =>  ($zInfo->num_tax_rates > 0 ? '<a href="' . zen_href_link(FILENAME_TAX_RATES, '', 'NONSSL') . '">' . zen_image_button('button_tax_rates.gif', IMAGE_TAX_RATES) . '</a>' : ''));
          $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_ZONES . ' ' . $zInfo->num_zones);
          $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_TAX_RATES . ' ' . $zInfo->num_tax_rates);
          $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($zInfo->date_added));
          if (zen_not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($zInfo->last_modified));
          $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . $zInfo->geo_zone_description);
        }
        break;
    }
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       adminhome/group_pricing.php                                                                         0000755 0001012 0001007 00000035370 10412110426 016545  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: group_pricing.php 3295 2006-03-28 07:27:49Z drbyte $
//

  require('includes/application_top.php');

  $action = (isset($_GET['action']) ? $_GET['action'] : '');

  if (zen_not_null($action)) {
    switch ($action) {
      case 'insert':
      case 'save':
        if (isset($_GET['gID'])) $group_id = zen_db_prepare_input($_GET['gID']);
        $group_name = zen_db_prepare_input($_POST['group_name']);
        $group_percentage = zen_db_prepare_input((float)$_POST['group_percentage']);
        if ($group_name) {
          $sql_data_array = array('group_name' => $group_name,
                                  'group_percentage' => $group_percentage);
          if ($action == 'insert') {
            $insert_sql_data = array('date_added' => 'now()');
            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
            zen_db_perform(TABLE_GROUP_PRICING, $sql_data_array);
            $group_id = $db->insert_ID();
          } elseif ($action == 'save') {
            $update_sql_data = array('last_modified' => 'now()');
            $sql_data_array = array_merge($sql_data_array, $update_sql_data);
            zen_db_perform(TABLE_GROUP_PRICING, $sql_data_array, 'update', "group_id = '" . (int)$group_id . "'");
          }
        }
        zen_redirect(zen_href_link(FILENAME_GROUP_PRICING, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'gID=' . $group_id));
      break;
      case 'deleteconfirm':
        if (zen_admin_demo()) {
          $_GET['action']= '';
          $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
          zen_redirect(zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page']));
        }

        $delete_cust_confirmed = (isset($_POST['delete_customers']) && $_POST['delete_customers'] =='on') ? true : false ;

        $group_id = zen_db_prepare_input($_GET['gID']);
        $customers_query = $db->Execute("select customers_id from " . TABLE_CUSTOMERS . " where customers_group_pricing = '" . (int)$group_id . "'");

        if ($customers_query->RecordCount() > 0 && $delete_cust_confirmed == true) {
          $db->Execute("delete from " . TABLE_GROUP_PRICING . " where group_id = '" . (int)$group_id . "'");
          $db->Execute("update " . TABLE_CUSTOMERS ." set customers_group_pricing=0 where customers_group_pricing = '" . (int)$group_id . "'");
        } elseif ($customers_query->RecordCount() > 0 && $delete_cust_confirmed == false) {
          $messageStack->add_session(ERROR_GROUP_PRICING_CUSTOMERS_EXIST,'error');
        } elseif($customers_query->RecordCount() == 0) {
          $db->Execute("delete from " . TABLE_GROUP_PRICING . " where group_id = '" . (int)$group_id . "'");
        }
        zen_redirect(zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page']));
      break;
    }
  }

  $query = $db->Execute("select count(*) as count from " . TABLE_GROUP_PRICING );
  if ($query->fields['count'] > 0 && (!defined('MODULE_ORDER_TOTAL_GROUP_PRICING_STATUS') || MODULE_ORDER_TOTAL_GROUP_PRICING_STATUS !='true')) {
    $messageStack->add(ERROR_MODULE_NOT_CONFIGURED,'error');
  }

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_GROUP_ID; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_GROUP_NAME; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_GROUP_AMOUNT; ?>&nbsp;</td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $groups_query_raw = "select * from " . TABLE_GROUP_PRICING;
  $groups_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $groups_query_raw, $groups_query_numrows);
  $groups = $db->Execute($groups_query_raw);
  while (!$groups->EOF) {
    if ((!isset($_GET['gID']) || (isset($_GET['gID']) && ($_GET['gID'] == $groups->fields['group_id']))) && !isset($gInfo) && (substr($action, 0, 3) != 'new')) {
      $group_customers = $db->Execute("select count(*) as customer_count from " . TABLE_CUSTOMERS .
                                       " where customers_group_pricing = '" . (int)$groups->fields['group_id'] . "'");
      $gInfo_array = array_merge($groups->fields, $group_customers->fields);
      $gInfo = new objectInfo($gInfo_array);
    }

    if (isset($gInfo) && is_object($gInfo) && ($groups->fields['group_id'] == $gInfo->group_id)) {
      echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $groups->fields['group_id'] . '&action=edit') . '\'">' . "\n";
    } else {
      echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $groups->fields['group_id'] . '&action=edit') . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $groups->fields['group_id']; ?></td>
                <td class="dataTableContent"><?php echo $groups->fields['group_name']; ?></td>
                <td class="dataTableContent"><?php echo $groups->fields['group_percentage']; ?></td>
                <td class="dataTableContent" align="right">
                  <?php echo '<a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $groups->fields['group_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . '</a>'; ?>
                  <?php echo '<a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $groups->fields['group_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . '</a>'; ?>
                  <?php if (isset($gInfo) && is_object($gInfo) && ($groups->fields['group_id'] == $gInfo->group_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_GROUP_PRICING, zen_get_all_get_params(array('gID')) . 'gID=' . $groups->fields['group_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>
                </td>
              </tr>
<?php
    $groups->MoveNext();
  }
?>
              <tr>
                <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $groups_split->display_count($groups_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRICING_GROUPS); ?></td>
                    <td class="smallText" align="right"><?php echo $groups_split->display_links($groups_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
                </table></td>
              </tr>
<?php
  if (empty($action)) {
?>
              <tr>
                <td align="right" colspan="4" class="smallText"><?php echo '<a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
              </tr>
<?php
  }
?>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  switch ($action) {
    case 'new':
      $heading[] = array('text' => '<b>' . TEXT_HEADING_NEW_PRICING_GROUP . '</b>');

      $contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'action=insert', 'post'));
      $contents[] = array('text' => TEXT_NEW_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_GROUP_PRICING_NAME . '<br>' . zen_draw_input_field('group_name', '', zen_set_field_length(TABLE_GROUP_PRICING, 'group_name')));
      $contents[] = array('text' => '<br>' . TEXT_GROUP_PRICING_AMOUNT . '<br>' . zen_draw_input_field('group_percentage', ''));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $_GET['gID']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'edit':
      $heading[] = array('text' => '<b>' . TEXT_HEADING_EDIT_PRICING_GROUP . '</b>');

      $contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=save', 'post'));
      $contents[] = array('text' => TEXT_EDIT_INTRO);
      $contents[] = array('text' => '<br />' . TEXT_GROUP_PRICING_NAME . '<br>' . zen_draw_input_field('group_name', $gInfo->group_name, zen_set_field_length(TABLE_GROUP_PRICING, 'group_name')));
      $contents[] = array('text' => '<br>' . TEXT_GROUP_PRICING_AMOUNT . '<br>' . zen_draw_input_field('group_percentage', $gInfo->group_percentage));
      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'delete':
      $heading[] = array('text' => '<b>' . TEXT_HEADING_DELETE_PRICING_GROUP . '</b>');

      $contents = array('form' => zen_draw_form('group_pricing', FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=deleteconfirm'));
      $contents[] = array('text' => TEXT_DELETE_INTRO);
      $contents[] = array('text' => '<br><b>' . $gInfo->group_name . '</b>');

      if ($gInfo->customer_count > 0) {
        $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('delete_customers') . ' ' . TEXT_DELETE_PRICING_GROUP);
        $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_GROUP_MEMBERS, $gInfo->customer_count));
      }

      $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      if (isset($gInfo) && is_object($gInfo)) {
        $heading[] = array('text' => '<b>' . $gInfo->group_name . '</b>');

        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GROUP_PRICING, 'page=' . $_GET['page'] . '&gID=' . $gInfo->group_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
        $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . zen_date_short($gInfo->date_added));
        if (zen_not_null($gInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($gInfo->last_modified));
        $contents[] = array('text' => '<br>' . TEXT_CUSTOMERS . ' ' . $gInfo->customer_count);
      }
      break;
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
                                                                                                                                                                                                                                                                        adminhome/gv_mail.php                                                                               0000755 0001012 0001007 00000050501 11362146454 015324  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: gv_mail.php 15976 2010-04-17 01:48:44Z drbyte $
 */

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $_POST['amount'] = preg_replace('/[^0-9.%]/', '', $_POST['amount']);
  $_POST['amount'] = abs($_POST['amount']);

  if ($_GET['action'] == 'set_editor') {
    // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly.
    $action='';
    zen_redirect(zen_href_link(FILENAME_GV_MAIL));
  }

  if ( ($_GET['action'] == 'send_email_to_user') && ($_POST['customers_email_address'] || $_POST['email_to']) && (!$_POST['back_x']) ) {
    $audience_select = get_audience_sql_query($_POST['customers_email_address'], 'email');
    $mail = $db->Execute($audience_select['query_string']);
    $mail_sent_to = $audience_select['query_name'];
    if ($_POST['email_to']) {
      $mail_sent_to = $_POST['email_to'];
    }

    // demo active test
    if (zen_admin_demo()) {
      $_GET['action']= '';
      $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
      zen_redirect(zen_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
    }
    $from = zen_db_prepare_input($_POST['from']);
    $subject = zen_db_prepare_input($_POST['subject']);
    $recip_count=0;

    // set time-limit for processing to 5 minutes... if allowed by PHP configuration
    zen_set_time_limit(600);

    while (!$mail->EOF) {

      $id1 = create_coupon_code($mail->fields['customers_email_address']);
      $insert_query = $db->Execute("insert into " . TABLE_COUPONS . "
                                    (coupon_code, coupon_type, coupon_amount, date_created)
                                    values ('" . $id1 . "', 'G', '" . $_POST['amount'] . "', now())");

      $insert_id = $db->Insert_ID();

      $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
                    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
                    values ('" . $insert_id ."', '0', 'Admin',
                            '" . $mail->fields['customers_email_address'] . "', now() )");

      $message = $_POST['message'];
      $html_msg['EMAIL_MESSAGE_HTML'] = zen_db_prepare_input($_POST['message_html']);
      $message .= "\n\n" . TEXT_GV_WORTH  . $currencies->format($_POST['amount']) . "\n\n";
      $message .= TEXT_TO_REDEEM;
      $message .= TEXT_WHICH_IS . ' ' . $id1 . ' ' . TEXT_IN_CASE . "\n\n";

      $html_msg['GV_WORTH']  = TEXT_GV_WORTH;
      $html_msg['GV_AMOUNT']  = $currencies->format($_POST['amount']);
      $html_msg['GV_REDEEM'] = TEXT_TO_REDEEM . TEXT_WHICH_IS . ' <strong>' . $id1 . '</strong> ' . TEXT_IN_CASE;

      if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
        $message .= HTTP_SERVER  . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/'.$id1 . "\n\n";
        $html_msg['GV_CODE_URL'] = '<a href="'.HTTP_SERVER  . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/'.$id1.'">' .TEXT_CLICK_TO_REDEEM . '</a>'. "&nbsp;";
      } else {
        $message .= HTTP_SERVER  . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no='.$id1 . "\n\n";
        $html_msg['GV_CODE_URL'] =  '<a href="'. HTTP_SERVER  . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no='.$id1 .'">' .TEXT_CLICK_TO_REDEEM . '</a>' . "&nbsp;";
      }

      $message .= TEXT_OR_VISIT . HTTP_SERVER  . DIR_WS_CATALOG . TEXT_ENTER_CODE . "\n\n";
      $html_msg['GV_CODE_URL'] .= TEXT_OR_VISIT .  '<a href="'.HTTP_SERVER  . DIR_WS_CATALOG.'">' . STORE_NAME . '</a>' . TEXT_ENTER_CODE;
      $html_msg['EMAIL_FIRST_NAME'] = $mail->fields['customers_firstname'];
      $html_msg['EMAIL_LAST_NAME']  = $mail->fields['customers_lastname'];

      // disclaimer
      $message .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";

      zen_mail($mail->fields['customers_firstname'] . ' ' . $mail->fields['customers_lastname'], $mail->fields['customers_email_address'], $subject , $message, $from, $from, $html_msg, 'gv_mail');
      $recip_count++;
      if (SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_STATUS== '1' and SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO != '') {
        zen_mail('', SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO, SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_SUBJECT . ' ' . $subject, $message, $from, $from, $html_msg, 'gv_mail_extra');
      }

      // Now create the coupon main and email entry
      $mail->MoveNext();
    }

    if ($_POST['email_to']) {
      $id1 = create_coupon_code($_POST['email_to']);
      $message = zen_db_prepare_input($_POST['message']);
      $message .= "\n\n" . TEXT_GV_WORTH  . $currencies->format($_POST['amount']) . "\n\n";
      $message .= TEXT_TO_REDEEM;
      $message .= TEXT_WHICH_IS . ' ' . $id1 . ' ' . TEXT_IN_CASE . "\n\n";

      $html_msg['GV_WORTH']  = TEXT_GV_WORTH;
      $html_msg['GV_AMOUNT']  = $currencies->format($_POST['amount']);
      $html_msg['GV_REDEEM'] = TEXT_TO_REDEEM . TEXT_WHICH_IS . ' <strong>' . $id1 . '</strong> ' . TEXT_IN_CASE . "\n\n";

      if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
        $message .= HTTP_SERVER  . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/'.$id1 . "\n\n";
        $html_msg['GV_CODE_URL']  = '<a href="'.HTTP_SERVER  . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/'.$id1.'">' .TEXT_CLICK_TO_REDEEM . '</a>'. "&nbsp;";
      } else {
        $message .= HTTP_SERVER  . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no='.$id1 . "\n\n";
        $html_msg['GV_CODE_URL']  =  '<a href="'. HTTP_SERVER  . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no='.$id1 .'">' .TEXT_CLICK_TO_REDEEM . '</a>' . "&nbsp;";
      }
      $message .= TEXT_OR_VISIT . HTTP_SERVER  . DIR_WS_CATALOG  . TEXT_ENTER_CODE . "\n\n";
      $html_msg['GV_CODE_URL']  .= TEXT_OR_VISIT .  '<a href="'.HTTP_SERVER  . DIR_WS_CATALOG.'">' . STORE_NAME . '</a>' . TEXT_ENTER_CODE;

      $html_msg['EMAIL_MESSAGE_HTML'] = zen_db_prepare_input($_POST['message_html']);
      $html_msg['EMAIL_FIRST_NAME'] = ''; // unknown, since only an email address was supplied
      $html_msg['EMAIL_LAST_NAME']  = ''; // unknown, since only an email address was supplied

      // disclaimer
      $message .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";

      //Send the emails
      zen_mail('Friend', $_POST['email_to'], $subject , $message, $from, $from, $html_msg, 'gv_mail');
      $recip_count++;
      if (SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_STATUS== '1' and SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO != '') {
        zen_mail('', SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO, SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_SUBJECT . ' ' . $subject, $message, $from, $from, $html_msg, 'gv_mail_extra');
      }

      // Now create the coupon main entry
      $insert_query = $db->Execute("insert into " . TABLE_COUPONS . "
                                    (coupon_code, coupon_type, coupon_amount, date_created)
                                    values ('" . $id1 . "', 'G', '" . $_POST['amount'] . "', now())");

      $insert_id = $db->Insert_id();

      $insert_query = $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . "
                                    (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent)
                                    values ('" . $insert_id ."', '0', 'Admin',
                                            '" . $_POST['email_to'] . "', now() )");

    }
    zen_redirect(zen_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to) . '&recip_count='. $recip_count ));
  }

  if ( ($_GET['action'] == 'preview') && (!$_POST['customers_email_address']) && (!$_POST['email_to']) ) {
    $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
  }

  if ( ($_GET['action'] == 'preview') && (!$_POST['subject']) ) {
    $messageStack->add(ERROR_NO_SUBJECT, 'error');
  }
  if ( ($_GET['action'] == 'preview') && ($_POST['amount'] <= 0) ) {
    $messageStack->add(ERROR_NO_AMOUNT_SELECTED, 'error');
  }

  if ($_GET['mail_sent_to']) {
    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']. '(' . $_GET['recip_count'] . ')'), 'success');
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  if (typeof _editor_url == "string") HTMLArea.replace('message_html');
  }
  // -->
</script>
<script language="javascript" type="text/javascript"><!--
var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_recipient(field_cust, field_input, message) {
//  if (form.elements[field_cust] && form.elements[field_cust].type != "hidden" && form.elements[field_input] && form.elements[field_input].type != "hidden") {
    var field_value_cust = form.elements[field_cust].value;
    var field_value_input = form.elements[field_input].value;

    if ((field_value_input == '' || field_value_input.length < 1)  &&  field_value_cust == '') {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
//}
function check_amount(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == '' || field_value == 0 || field_value < 0 || field_value.length < field_size ) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}
function check_message(msg) {
  if (form.elements['message'] && form.elements['message_html']) {
    var field_value1 = form.elements['message'].value;
    var field_value2 = form.elements['message_html'].value;

    if ((field_value1 == '' || field_value1.length < 3) && (field_value2 == '' || field_value2.length < 3)) {
      error_message = error_message + "* " + msg + "\n";
      error = true;
    }
  }
}
function check_input(field_name, field_size, message) {
  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var field_value = form.elements[field_name].value;

    if (field_value == '' || field_value.length < field_size) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }
  }
}

function check_form(form_name) {
  if (submitted == true) {
    alert("<?php echo JS_ERROR_SUBMITTED; ?>");
    return false;
  }
  error = false;
  form = form_name;
  error_message = "<?php echo JS_ERROR; ?>";

  check_recipient('customers_email_address', 'email_to', "<?php echo ERROR_NO_CUSTOMER_SELECTED; ?>");
  check_message("<?php echo ENTRY_NOTHING_TO_SEND; ?>");
  check_amount('amount',1,"<?php echo ERROR_NO_AMOUNT_SELECTED; ?>");
  check_input('subject','',"<?php echo ERROR_NO_SUBJECT; ?>");

  if (error == true) {
    alert(error_message);
    return false;
  } else {
    submitted = true;
    return true;
  }
}
//--></script>
<?php if ($editor_handler != '') include ($editor_handler); ?>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
            <td class="main">
<?php
// toggle switch for editor
        echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_GV_MAIL, '', 'get') . '&nbsp;&nbsp;' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') .
        zen_hide_session_id() .
        zen_draw_hidden_field('action', 'set_editor') .
        '</form>';
?>
          </td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
  if ( ($_GET['action'] == 'preview') && ($_POST['customers_email_address'] || $_POST['email_to']) ) {
  $audience_select = get_audience_sql_query($_POST['customers_email_address']);
    $mail_sent_to = $audience_select['query_name'];
        if ($_POST['email_to']) {
          $mail_sent_to = $_POST['email_to'];
        }
?>
          <tr><?php echo zen_draw_form('mail', FILENAME_GV_MAIL, 'action=send_email_to_user'); ?>
            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br /><?php echo $mail_sent_to; ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br /><?php echo htmlspecialchars(stripslashes($_POST['from'])); ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br /><?php echo htmlspecialchars(stripslashes($_POST['subject'])); ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_AMOUNT; ?></b><br /><?php echo nl2br(htmlspecialchars(stripslashes($_POST['amount']))) . ($_POST['amount'] <= 0 ? '&nbsp<span class="alert">' . ERROR_GV_AMOUNT . '</span>' : ''); ?></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td><hr /><b><?php echo TEXT_RICH_TEXT_MESSAGE; ?></b><br /><?php echo stripslashes($_POST['message_html']); ?></td>
              </tr>
              <tr>
                <td><hr /><b><?php echo TEXT_MESSAGE; ?></b><br /><tt><?php echo nl2br(htmlspecialchars(stripslashes($_POST['message']))); ?></tt><hr /></td>
              </tr>
              <tr>
                <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td>
<?php
/* Re-Post all POST'ed variables */
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if (!is_array($_POST[$key])) {
        echo zen_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
      }
    }
?>
                <table border="0" width="100%" cellpadding="0" cellspacing="2">
                  <tr>
                    <td><?php echo zen_image_submit('button_back.gif', IMAGE_BACK, 'name="back"'); ?></td>
                    <td align="right"><?php echo '<a href="' . zen_href_link(FILENAME_GV_MAIL) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' . ($_POST['amount'] <= 0 ? '' : zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL)); ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </form></tr>
<?php
  } else {
?>
          <tr><?php echo zen_draw_form('mail', FILENAME_GV_MAIL, 'action=preview','post', 'onsubmit="return check_form(mail);"'); ?>
            <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
<?php
    $customers = get_audiences_list('email');
?>
              <tr>
                <td class="main"><?php echo TEXT_CUSTOMER; ?></td>
                <td><?php echo zen_draw_pull_down_menu('customers_email_address', $customers, $_GET['customer']);?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
               <tr>
                <td class="main"><?php echo TEXT_TO; ?></td>
                <td><?php echo zen_draw_input_field('email_to', '', 'size="50"'); ?><?php echo '&nbsp;&nbsp;' . TEXT_SINGLE_EMAIL; ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
             <tr>
                <td class="main"><?php echo TEXT_FROM; ?></td>
                <td><?php echo zen_draw_input_field('from', EMAIL_FROM, 'size="50"'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
                <td><?php echo zen_draw_input_field('subject', '', 'size="50"'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_AMOUNT; ?></td>
                <td><?php echo zen_draw_input_field('amount'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_RICH_TEXT_MESSAGE; ?></td>
                <td>
<?php if (EMAIL_USE_HTML == 'true') {?>
                <?php if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                    $oFCKeditor = new FCKeditor('message_html') ;
                    $oFCKeditor->Value = ($_POST['message_html']=='') ? TEXT_GV_ANNOUNCE : stripslashes($_POST['message_html']) ;
                    $oFCKeditor->Width  = '97%' ;
                    $oFCKeditor->Height = '250' ;
//                    $oFCKeditor->Create() ;
                    $output = $oFCKeditor->CreateHtml() ; echo $output;
                  } else { // using HTMLAREA or just raw "source"
                  echo zen_draw_textarea_field('message_html', 'soft', '100%', '20', ($_POST['message_html']=='') ? TEXT_GV_ANNOUNCE : stripslashes($_POST['message_html']), 'id="message_html" class="editorHook"');
                  }
} ?>
        </td>
        </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
                <td><?php echo zen_draw_textarea_field('message', 'soft', '60', '15', ($_POST['message']=='') ? strip_tags(TEXT_GV_ANNOUNCE) : stripslashes($_POST['message'])); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td colspan="2" align="right"><?php echo zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
              </tr>
            </table></td>
          </form></tr>
<?php
  }
?>
<!-- body_text_eof //-->
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                               adminhome/gv_queue.php                                                                              0000755 0001012 0001007 00000033327 10311431002 015510  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: gv_queue.php 1969 2005-09-13 06:57:21Z drbyte $
//

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

// bof: find gv for a particular order and set page
  if ($_GET['order'] != '') {
    $gv_check = $db->Execute("select order_id, unique_id
                                  from " . TABLE_COUPON_GV_QUEUE . "
                                  where order_id = '" . $_GET['order'] . "' and release_flag= 'N' limit 1");

    $_GET['gid'] = $gv_check->fields['unique_id'];

    $gv_page = $db->Execute("select c.customers_firstname, c.customers_lastname, gv.unique_id, gv.date_created, gv.amount, gv.order_id from " . TABLE_CUSTOMERS . " c, " . TABLE_COUPON_GV_QUEUE . " gv where (gv.customer_id = c.customers_id and gv.release_flag = 'N')" . " order by gv.order_id, gv.unique_id");
    $page_cnt=1;
    while (!$gv_page->EOF) {
      if ($gv_page->fields['order_id'] == $_GET['order']) {
        break;
      }
      $page_cnt++;
      $gv_page->MoveNext();
    }
    $_GET['page'] = round(($page_cnt/MAX_DISPLAY_SEARCH_RESULTS));
    zen_redirect(zen_href_link(FILENAME_GV_QUEUE, 'gid=' . $gv_check->fields['unique_id'] . '&page=' . $_GET['page']));
  }
// eof: find gv for a particular order and set page

  if ($_GET['action'] == 'confirmrelease' && isset($_GET['gid'])) {
    $gv_result = $db->Execute("select release_flag
                               from " . TABLE_COUPON_GV_QUEUE . "
                               where unique_id='" . $_GET['gid'] . "'");

    if ($gv_result->fields['release_flag'] == 'N') {
      $gv_resulta = $db->Execute("select customer_id, amount, order_id
                                  from " . TABLE_COUPON_GV_QUEUE . "
                                  where unique_id='" . $_GET['gid'] . "'");

      if ($gv_resulta->RecordCount() > 0) {
      $gv_amount = $gv_resulta->fields['amount'];

	// Begin composing email content
//      //Let's build a message object using the email class
      $mail = $db->Execute("select customers_firstname, customers_lastname, customers_email_address
                           from " . TABLE_CUSTOMERS . "
                           where customers_id = '" . $gv_resulta->fields['customer_id'] . "'");

      $message  = TEXT_REDEEM_GV_MESSAGE_HEADER . "\n" . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . "\n\n" . TEXT_REDEEM_GV_MESSAGE_RELEASED;
      $message .= sprintf(TEXT_REDEEM_GV_MESSAGE_AMOUNT, $currencies->format($gv_amount)) . "\n\n";
      $message .= TEXT_REDEEM_GV_MESSAGE_THANKS . "\n" . STORE_OWNER . "\n\n" . HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
      $message .= TEXT_REDEEM_GV_MESSAGE_BODY;
      $message .= TEXT_REDEEM_GV_MESSAGE_FOOTER;
	  $message .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";

      $html_msg['EMAIL_FIRST_NAME'] = $mail->fields['customers_firstname'];
      $html_msg['EMAIL_LAST_NAME']  = $mail->fields['customers_lastname'];
      $html_msg['GV_NOTICE_HEADER']  = TEXT_REDEEM_GV_MESSAGE_HEADER;
      $html_msg['GV_NOTICE_RELEASED']  = TEXT_REDEEM_GV_MESSAGE_RELEASED;
      $html_msg['GV_NOTICE_AMOUNT_REDEEM'] = sprintf(TEXT_REDEEM_GV_MESSAGE_AMOUNT, '<strong>' . $currencies->format($gv_amount) . '</strong>');
      $html_msg['GV_NOTICE_VALUE'] = $currencies->format($gv_amount);
      $html_msg['GV_NOTICE_THANKS'] = TEXT_REDEEM_GV_MESSAGE_THANKS;
      $html_msg['TEXT_REDEEM_GV_MESSAGE_BODY'] = TEXT_REDEEM_GV_MESSAGE_BODY;
      $html_msg['TEXT_REDEEM_GV_MESSAGE_FOOTER'] = TEXT_REDEEM_GV_MESSAGE_FOOTER;

//send the message
      	zen_mail($mail->fields['customers_firstname'] . ' ' . $mail->fields['customers_lastname'], $mail->fields['customers_email_address'], TEXT_REDEEM_GV_SUBJECT . TEXT_REDEEM_GV_SUBJECT_ORDER . $gv_resulta->fields['order_id'] , $message, STORE_NAME, EMAIL_FROM, $html_msg, 'gv_queue');



      $gv_amount=$gv_resulta->fields['amount'];
      $gv_result=$db->Execute("select amount
                               from " . TABLE_COUPON_GV_CUSTOMER . "
                               where customer_id='" . $gv_resulta->fields['customer_id'] . "'");

      $customer_gv=false;
      $total_gv_amount=0;
      if ($gv_result->RecordCount() > 0) {
        $total_gv_amount=$gv_result->fields['amount'];
        $customer_gv=true;
      }
      $total_gv_amount=$total_gv_amount+$gv_amount;
      if ($customer_gv) {
        $db->Execute("update " . TABLE_COUPON_GV_CUSTOMER . "
                      set amount='" . $total_gv_amount . "'
                      where customer_id='" . $gv_resulta->fields['customer_id'] . "'");
      } else {
        $db->Execute("insert into " . TABLE_COUPON_GV_CUSTOMER . "
                    (customer_id, amount)
                    values ('" . $gv_resulta->fields['customer_id']. "', '" . $total_gv_amount . "')");
      }
        $db->Execute("update " . TABLE_COUPON_GV_QUEUE . "
                      set release_flag= 'Y'
                      where unique_id='" . $_GET['gid'] . "'");
      }
    }
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_ORDERS_ID; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $gv_query_raw = "select c.customers_firstname, c.customers_lastname, gv.unique_id, gv.date_created, gv.amount, gv.order_id from " . TABLE_CUSTOMERS . " c, " . TABLE_COUPON_GV_QUEUE . " gv where (gv.customer_id = c.customers_id and gv.release_flag = 'N')" . " order by gv.order_id, gv.unique_id";
  $gv_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
  $gv_list = $db->Execute($gv_query_raw);
  while (!$gv_list->EOF) {
    if (((!$_GET['gid']) || (@$_GET['gid'] == $gv_list->fields['unique_id'])) && (!$gInfo)) {
      $gInfo = new objectInfo($gv_list->fields);
    }
    if ( (is_object($gInfo)) && ($gv_list->fields['unique_id'] == $gInfo->unique_id) ) {
      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link('gv_queue.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->unique_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link('gv_queue.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list->fields['unique_id']) . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $gv_list->fields['customers_firstname'] . ' ' . $gv_list->fields['customers_lastname']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $gv_list->fields['order_id']; ?></td>
                <td class="dataTableContent" align="right"><?php echo $currencies->format($gv_list->fields['amount']); ?></td>
                <td class="dataTableContent" align="right"><?php echo zen_datetime_short($gv_list->fields['date_created']); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list->fields['unique_id'] == $gInfo->unique_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_GV_QUEUE, 'page=' . $_GET['page'] . '&gid=' . $gv_list->fields['unique_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    $gv_list->MoveNext();
  }
?>
              <tr>
                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
                    <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();
  switch ($_GET['action']) {
    case 'release':
      $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . zen_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));

      $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link('gv_queue.php', 'action=confirmrelease&gid=' . $gInfo->unique_id,'NONSSL') . '">' . zen_image_button('button_confirm_red.gif', IMAGE_CONFIRM) . '</a> <a href="' . zen_href_link('gv_queue.php', 'action=cancel&gid=' . $gInfo->unique_id,'NONSSL') . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    default:
      $heading[] = array('text' => '[' . $gInfo->unique_id . '] ' . zen_datetime_short($gInfo->date_created) . ' ' . $currencies->format($gInfo->amount));

      if ($gv_list->RecordCount() == 0) {
        $contents[] = array('align' => 'center','text' => TEXT_GV_NONE);
      } else {
        $contents[] = array('align' => 'center','text' => '<a href="' . zen_href_link('gv_queue.php','action=release&gid=' . $gInfo->unique_id,'NONSSL'). '">' . zen_image_button('button_release_gift.gif', IMAGE_RELEASE) . '</a>');

// quick link to order
        $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif','','90%','3'));
        $contents[] = array('align' => 'center', 'text' => TEXT_EDIT_ORDER . $gInfo->order_id);
        $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, 'oID=' . $gInfo->order_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_order.gif', IMAGE_ORDER) . '</a>');
      }
      break;
   }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                         adminhome/gv_sent.php                                                                               0000755 0001012 0001007 00000022013 10442114720 015335  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//  $Id: gv_sent.php 3727 2006-06-09 02:42:39Z ajeh $
//

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SENDERS_NAME; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_CODE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_SENT; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TEXT_HEADING_DATE_REDEEMED; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
<?php
  $gv_query_raw = "select c.coupon_amount, c.coupon_code, c.coupon_id, et.sent_firstname, et.sent_lastname, et.customer_id_sent, et.emailed_to, et.date_sent, crt.redeem_date, c.coupon_id
                  from " . TABLE_COUPONS . " c
                  left join " . TABLE_COUPON_REDEEM_TRACK . " crt
                  on c.coupon_id= crt.coupon_id, " . TABLE_COUPON_EMAIL_TRACK . " et
                  where c.coupon_id = et.coupon_id " . "
                  and c.coupon_type = 'G'
                  order by date_sent desc";
  $gv_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
  $gv_list = $db->Execute($gv_query_raw);
  while (!$gv_list->EOF) {
    if (((!$_GET['gid']) || (@$_GET['gid'] == $gv_list->fields['coupon_id'])) && (!$gInfo)) {
    $gInfo = new objectInfo($gv_list->fields);
    }
    if ( (is_object($gInfo)) && ($gv_list->fields['coupon_id'] == $gInfo->coupon_id) ) {
      echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link('gv_sent.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->coupon_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link('gv_sent.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list->fields['coupon_id']) . '\'">' . "\n";
    }
?>
                <td class="dataTableContent"><?php echo $gv_list->fields['sent_firstname'] . ' ' . $gv_list->fields['sent_lastname']; ?></td>
                <td class="dataTableContent" align="center"><?php echo $currencies->format($gv_list->fields['coupon_amount']); ?></td>
                <td class="dataTableContent" align="center"><?php echo $gv_list->fields['coupon_code']; ?></td>
                <td class="dataTableContent" align="right"><?php echo zen_date_short($gv_list->fields['date_sent']); ?></td>
                <td class="dataTableContent" align="right"><?php echo (empty($gv_list->fields['redeem_date']) ? TEXT_INFO_NOT_REDEEMED : zen_date_short($gv_list->fields['redeem_date'])); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list->fields['coupon_id'] == $gInfo->coupon_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_GV_SENT, 'page=' . $_GET['page'] . '&gid=' . $gv_list->fields['coupon_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    $gv_list->MoveNext();
  }
?>
              <tr>
                <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
                    <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
<?php
  $heading = array();
  $contents = array();

  $heading[] = array('text' => '[' . $gInfo->coupon_id . '] ' . ' ' . $currencies->format($gInfo->coupon_amount));
  $redeem = $db->Execute("select * from " . TABLE_COUPON_REDEEM_TRACK . "
                          where coupon_id = '" . $gInfo->coupon_id . "'");
  $redeemed = 'No';
  if ($redeem->RecordCount() > 0) $redeemed = 'Yes';
  $contents[] = array('text' => TEXT_INFO_SENDERS_ID . ' ' . $gInfo->customer_id_sent);
  $contents[] = array('text' => TEXT_INFO_AMOUNT_SENT . ' ' . $currencies->format($gInfo->coupon_amount));
  $contents[] = array('text' => TEXT_INFO_DATE_SENT . ' ' . zen_date_short($gInfo->date_sent));
  $contents[] = array('text' => TEXT_INFO_VOUCHER_CODE . ' ' . $gInfo->coupon_code);
  $contents[] = array('text' => TEXT_INFO_EMAIL_ADDRESS . ' ' . $gInfo->emailed_to);
  if ($redeemed=='Yes') {
    $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_REDEEMED . ' ' . zen_date_short($redeem->fields['redeem_date']));
    $contents[] = array('text' => TEXT_INFO_IP_ADDRESS . ' ' . $redeem->fields['redeem_ip']);
    $contents[] = array('text' => TEXT_INFO_CUSTOMERS_ID . ' ' . $redeem->fields['customer_id']);
  } else {
    $contents[] = array('text' => '<br />' . TEXT_INFO_NOT_REDEEMED);
  }

  if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
    echo '            <td width="25%" valign="top">' . "\n";

    $box = new box;
    echo $box->infoBox($heading, $contents);

    echo '            </td>' . "\n";
  }
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br />
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     adminhome/image_uploader.php                                                                        0000755 0001012 0001007 00000022714 11135065442 016663  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: categories.php 4809 2006-10-22 18:53:22Z ajeh $
 */

// $Id:image_uploader.php,v1.0 2007/10/08 Jay T (Jaycode) teguhwpurwanto@gmail.com$
require('includes/application_top.php');

if (isset($_POST['image_title'])) {
	if (!empty($_FILES['smallImage']['name'])) {
		//If uploading new images while editing, delete the old ones
		if (!empty($_POST['image_id'])) {
			//Updating already existing image, delete the existing one and update the database.
			$sqlStr = "SELECT image_path FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
								 WHERE image_id = '" . $_POST['image_id'] . "' 
								 LIMIT 1";
			$result = $db->Execute($sqlStr);
			if ($result->recordCount() > 0) {
				$old_image_path = $result->fields['image_path'];
				deleteImage($old_image_path);
			}
		}
		
		//Upload image(s)
		$uploaded_file = $_FILES['smallImage'];
		$ftmp = $_FILES['smallImage']['tmp_name'];
		
		$dir = (!empty($_POST['new_dir']))?($_POST['new_dir']):($_POST['img_dir']);
		if (!empty($_POST['new_dir'])) {			
			@mkdir('../' . DIR_WS_IMAGES . $dir, 0777, true);
			$dir .= '/';
		}
		$fname_small = DIR_WS_IMAGES . $dir . $_FILES['smallImage']['name'];
		$fname = '../' . $fname_small;
		if (!$_SESSION['gdv']) {
			if(move_uploaded_file($ftmp, $fname)){
				$upload_small_done = 1;
			}
		}
		else {
			if(upload_resized_image($uploaded_file, $fname, $ais_config['small']['width'], $ais_config['small']['height'])) {
				$upload_small_done = 1;
			}
		}
		
		if (empty($_FILES['medImage']['name'])) {
			$uploaded_file = $_FILES['smallImage'];
			$ftmp = $_FILES['smallImage']['tmp_name'];
		}
		else {
			$uploaded_file = $_FILES['medImage'];
			$ftmp = $_FILES['medImage']['tmp_name'];
			$medium_available = true;
		}
		$dir = create_size_dir('../' . $fname_small, 'medium');
		$fname_array = explode('.', $_FILES['smallImage']['name']);
		$fname_med = substr($dir . $fname_array[0] . '_MED.' . $fname_array[count($fname_array)-1], 3);
		$fname = '../' . $fname_med;
		if (!$_SESSION['gdv']) {
			if(move_uploaded_file($ftmp, $fname)){
				$upload_med_done = 1;
			}
		}
		else {
			if(upload_resized_image($uploaded_file, $fname, $ais_config['medium']['width'], $ais_config['medium']['height'])) {
				$upload_med_done = 1;
			}
		}
		
		if (empty($_FILES['lrgImage']['name'])) {
			if (isset($medium_available)) {
				$uploaded_file = $_FILES['medImage'];
				$ftmp = $_FILES['medImage']['tmp_name'];
			}
			else {
				$uploaded_file = $_FILES['smallImage'];
				$ftmp = $_FILES['smallImage']['tmp_name'];
			}
		}
		else {
			$uploaded_file = $_FILES['lrgImage'];
			$ftmp = $_FILES['lrgImage']['tmp_name'];
		}
		$dir = create_size_dir('../' . $fname_small, 'large');
		$fname_array = explode('.', $_FILES['smallImage']['name']);
		$fname_lrg = substr($dir . $fname_array[0] . '_LRG.' . $fname_array[count($fname_array)-1], 3);
		$fname = '../' . $fname_lrg;
		if (!$_SESSION['gdv']) {
			if(move_uploaded_file($ftmp, $fname)){
				$upload_lrg_done = 1;
			}
		}
		else {
			if(upload_resized_image($uploaded_file, $fname, $ais_config['large']['width'], $ais_config['large']['height'])) {
				$upload_lrg_done = 1;
			}
		}
		
	}

	if (!empty($_POST['image_title'])) {
		$title = $_POST['image_title'];
	}
	else {
		$title = $fname_array[0];
	}

	if (!empty($_POST['image_sort_order'])) {
		$sort_order = $_POST['image_sort_order'];
	}
	else {
		$sort_order = 0;
	}
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/styles_ajax_image_swapper.css">
<script language="javascript" src="includes/javascript/AJAX_image_swapper.js"></script>
</head>
<body id="upload_form">
<?php
if (isset($_POST['image_title'])) {
	$with_attribute = false;
	if (!empty($_POST['image_id'])) {
		
		$sqlStr = "UPDATE " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . "
							 SET ";
		if (isset($upload_small_done)) {
			$sqlStr .= "image_path = '" . $fname_small . "', ";
		}
		
		$sqlStr .= "image_title = '" . $title . "', image_sort_order = '" . $sort_order . "' 
								WHERE image_id = '" . $_POST['image_id'] . "'";
		$db->Execute($sqlStr);
		
		//bof - for updating products database
		$sqlStr = "SELECT products_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " 
							 WHERE products_attributes_id IN (
								SELECT products_attributes_id
								FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
								WHERE image_id = '" . $_POST['image_id'] . "'
							 )";
		$result = $db->Execute($sqlStr);
		$products_id = $result->fields['products_id'];
		
		$sqlStr = "SELECT image_path FROM " . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . " 
							 WHERE image_id = '" . $_POST['image_id'] . "'";
		$result = $db->Execute($sqlStr);
		$fname_small = $result->fields['image_path'];
		//eof - for updating products database
	}
	else {
		if (isset($_POST['cur_products_id'])) {
			$sqlStr = 'INSERT INTO ' . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . ' 
					   (image_id, products_attributes_id, products_id_no_attribute, image_path, image_title, image_sort_order) 
					   VALUES ( NULL, \'0\', \'' . $_POST['cur_products_id'] . '\', \'' . $fname_small . '\', 
					   \'' . $title . '\', ' . $sort_order . ')';
			$db->Execute($sqlStr);
			
			//for updating products database
			$products_id = $_POST['cur_products_id'];
		}
		else {
			$sqlStr = 'INSERT INTO ' . TABLE_PRODUCTS_ATTRIBUTES_IMAGES . ' 
					   (image_id, products_attributes_id, image_path, image_title, image_sort_order) 
					   VALUES ( NULL, \'' . $_POST['cur_attribute_id'] . '\', \'' . $fname_small . '\', 
					   \'' . $title . '\', ' . $sort_order . ')';
			$db->Execute($sqlStr);
			
			//bof - for updating products database
			$sqlStr = "SELECT products_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_attributes_id = '" . $_POST['cur_attribute_id'] . "'";
			$result = $db->Execute($sqlStr);
			$products_id = $result->fields['products_id'];
		}		
	}
	//If the product doesn't already have an image or has a broken image link, add the image to products table
	set_image_in_products_table($products_id, $fname_small);
?>
<script>
	if (window.parent.document.getElementById('for_product_with_attributes').getStyle('display') == 'none') {
		var productID = window.parent.document.getElementById('productID').value;
		submit_values('AJAX_servers/AJAX_image_swapper_server.php', ['action', 'product_id', 'id'], ['loadImagesFromIframe', productID, Number(new Date)]);
	}
	else {
		var optionID = window.parent.document.getElementById('optionID').value;
		submit_values('AJAX_servers/AJAX_image_swapper_server.php', ['action', 'option_id', 'id'], ['loadImagesFromIframe', optionID, Number(new Date)]);
	}
</script>
<?php
}

?>
<form id='iform' name="iform" action="image_uploader.php" method="post" enctype="multipart/form-data">
	<input type="hidden" name="image_title" id="image_title" />
	<input type="hidden" name="image_sort_order" id="image_sort_order" />
	<input type="hidden" name="image_id" id="image_id" />
	<br />
	<div id="imageBrowser">
		
		<script>
			//Decide whether to add the image as part of the product id or attribute id.
			if (window.parent.document.getElementById('for_product_with_attributes').getStyle('display') == 'none') {
				var products_id = window.parent.document.getElementById('productID').value;
				document.write('<input id="cur_products_id" type="hidden" name="cur_products_id" value="' + products_id + '" />');
			}
			else {
				//yeah I know its crazy, but I should have written attributeID instead of optionID from start... oh well...
				var attribute_id = window.parent.document.getElementById('optionID').value;
				document.write('<input id="cur_attribute_id" type="hidden" name="cur_attribute_id" value="' + attribute_id + '" />');
			}
		</script>
		<b>AUTO RESIZE IMAGE</b><br />
		Upload the largest size of your image to Small image input form<br />
		to auto-generate the image in other sizes.<br /><br />
		Small image (default image) <br />
		<input id="smallImage" type="file" name="smallImage" onchange="displayImageName();" />
		<br /><br /><br />
		Medium image <br />
		<input id="medImage" type="file" name="medImage" />
		<br /><br /><br />
		Large image <br />
		<input id="lrgImage" type="file" name="lrgImage" />
		<br /><br /><br />
		Upload to directory
<?php
			$default_directory = '';
			$dir = @dir(DIR_FS_CATALOG_IMAGES);
			$dir_info[] = array('id' => '', 'text' => "Main Directory");
			while ($file = $dir->read()) {
				if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
				$dir_info[] = array('id' => $file . '/', 'text' => $file);
				}
			}
			echo zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory, 'id="img_dir"');
?>
		<br /><br />
		or <input id="new_dir" type="text" name="new_dir" />
		<br /><br /><br />
		Stored image name: <span id="imageName">Please browse the image(s)</span><br />
<?php
		if (isset($upload_small_done)) {
			echo '<br />Small file uploaded to ' . $fname_small;
		}
		if (isset($upload_med_done)) {
			echo '<br />Medium file uploaded to ' . $fname_med;
		}
		if (isset($upload_lrg_done)) {
			echo '<br />Large file uploaded to ' . $fname_lrg;
		}
?>
	</div>
</form>
</body>
</html>                                                    adminhome/images/                                                                                   0000755 0001012 0001007 00000000000 11434737435 014443  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/images/cal_close_small.gif                                                                0000755 0001012 0001007 00000001537 10110364614 020240  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a 
                    3  f       3  33 3f 3 3 3 f  f3 ff f f f   3 f      3 f ̙     3 f   3  3 33 f3 3 3 33 33333f3333333f 3f33ff3f3f3f3 333f3333 333f3̙333 333f333f  f 3f ff f f f3 f33f3ff3f3f3ff ff3ffffffffff f3ffffff f3fff̙fff f3fffff   3 f  ̙ 3 333f33̙3f f3ffff̙f 3f̙ 3f̙̙ 3f̙   3 f   3 333f333f f3fffff̙ ̙3̙f̙̙̙ 3f̙ 3f   3 f   3 333f333f f3fffff 3f 3f̙ 3f                                                            𠠤         ,     
  D 	Hp*T``a!B[ N<Pa58vFȑCDQɜI͛8m ;                                                                                                                                                                 adminhome/images/cal_date_down.gif                                                                  0000755 0001012 0001007 00000002172 10110364614 017703  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a                !"'"%"(")#)&.0<!!##!""'$$"%%"''%&&&!&)((%(()++)--;!1<11.00;7<>==9>>:  @BCEE	
HKOQVVXX"[++@,,D,,E--F//G#9I#9J#9K$:K00H22M55J77H88A88B99M11S22W66T33\33_55^<<S88Z33c33f44`05i7<o9>p9?q(@T-DU7L_9@t<As<Cv>Du?Ev?]z@@CFFBBBLCCMQQMTTOSSUWWR]][^^YBIhAGxBHyHN~@`|\jqaa[ee_kkeppivxtV^Ge]iUvUv^ailwnynznzozo{irp{p{q|q}r|r|}~aaceffhhihovusz{zʗ˘ØŚΝϞϞϞПТʠϤ̥̠СңӤҥѦѦҧҩѨԫӫլӭӭկ֙ݰֱֲسسٳٴٴڴڵڵ۵۴ݵܷܷݷݸ޸ߺ߯      𠠤        33f!   ,        	"ȏrD@O(4Xŋ
D8P )BdI#]TL`!tP	ӥ0Y)XX0$R+_׶i-9y !E왴8QF2wϐyX5{-ǌ9dq[ٳ] (h8i7v}D
fE{U5P:zyX*htksUccN.LaC֜qĮƖW~@MfPZ_
|`AW㓜}gH$x%/cl)H1B	`ȶd~CIBaGU<dEg$ځ ;                                                                                                                                                                                                                                                                                                                                                                                                      adminhome/images/cal_date_over.gif                                                                  0000755 0001012 0001007 00000002173 10110364614 017710  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a                   





	#$%(1 ! $$!!%&&$)(   0!!6""7!!:"";//2>=.774))D((G--B((K--V55M66N77O00\11]33_66X88P<<T22a33f>>cCB*FE,DC2HG5IH7LK9ON:PO<SR=TS?|z*|w8JJJHH__QAZYBAAimkEljO{sG|z]=>44578898<==6V[_emlu@Pw76DOGI\GGHOTURRUWW\`fbdfjkmnytpx|||y}Ȁʖ͜ـڅۄ܍Оћءۦ܁݂ޅކއ܊߉܍܎܏ݏޏܑݐݐݑߒޔߞߦߩ                           33f         !   ,        	%	!&ĈLv0ABŋ+(_VqD$IM``H	@ήW_TU*$Dpq\\M[F0C`2!CWblٰEk$AZq2d^2N6i ]a@ml)[TR3vʋ*Ц2.R6pE ZlGCk$!4YМjǌR!B0z]~!9w3C\ 2d].р7xXz@`,6m튄lК@ &t7tC0GtdXaƄdAƄhAБ5T A$hbP@ ;                                                                                                                                                                                                                                                                                                                                                                                                     adminhome/images/cal_date_up.gif                                                                    0000755 0001012 0001007 00000002203 10110364614 017353  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a                
#$%(1"'$+%/$,%,(4*6!!%&&$  0!!6""7!!:"";//27743B))D((G--B((K--V 4D 4E!5E 6F 6G$6D#;N*;H$<P$=R%>R%?S%?T%?U&?U55M66N77O00\11]33_66X88P<<T22a33f>>c(BX)BZ*C\+C\+C],C],D^.D_7F_.D`.Da/Da0D`0Dc3Da5Cd5Bg7Ce7Cf7De7Df6Bj9Cf9Ck:Bm9Di<Bn<Co=Co<Di<Dk>CqHH_AAi@EnAFoBFoBGoCGqCFsCGrDFqDHrEHrEHsEHxGJxJM}SW|MPNROSPTPTPTRURVSWSWY]Y]UYW\Z]Z^[__c]a]b_d_deiknafejfkhmlqmsʅ΅Ӊ҉ӋֱʾӞ                              33f                                                                                                                           𠠤            !   ,        	GK*&"]x q4iʈȌ&<\JEJ;jBaC,$ġʖ#O@3IeKvzuHTL"4,8DkW\Z4(V"
Xт
22K(An@QB`vؕWFQb\k1Vr5D`-]nejT5e뗫&QBN1V#l .*t6UԨ`1B兂}P,XTBu4IP D
Ta%L	$4RHk<AC'(}vAF8@#mq(,. ;                                                                                                                                                                                                                                                                                                                                                                                             adminhome/images/cal_del_small.gif                                                                  0000755 0001012 0001007 00000001530 10110364614 017670  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a 
                    3  f       3  33 3f 3 3 3 f  f3 ff f f f   3 f      3 f ̙     3 f   3  3 33 f3 3 3 33 33333f3333333f 3f33ff3f3f3f3 333f3333 333f3̙333 333f333f  f 3f ff f f f3 f33f3ff3f3f3ff ff3ffffffffff f3ffffff f3fff̙fff f3fffff   3 f  ̙ 3 333f33̙3f f3ffff̙f 3f̙ 3f̙̙ 3f̙   3 f   3 333f333f f3fffff̙ ̙3̙f̙̙̙ 3f̙ 3f   3 f   3 333f333f f3fffff 3f 3f̙ 3f                                                            𠠤         ,     
  = 	Hp*TB06DhPcG[ֈ%b,˗cʌY#  ;                                                                                                                                                                        adminhome/images/ceon_button_logo.png                                                               0000755 0001012 0001007 00000001514 11162450202 020472  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR   U      j   gAMA  7   tEXtSoftware Adobe ImageReadyqe<   `PLTE  ֱȸ㿿@@  ``00ppƏҮPP1 e    tRNS \\  FIDATxڬۢ EAjQ_ :3}:%/5,Bl.[Q0'#VYVu$bEoYԺE,87SO2]w&jQĚ=U"mZWzj*dʁԾn衫T, lrq qaa3qѾ}*j0|0k-<+>kT4Fq:6m)##utv|)TM
`V*;bPsZ!mDisR7	%q YO!15t쀑~V"5uwU _%E'%i9KRxZH JNv	ԛܓ(Eu72,Q'=n	/	C5fVc&j*,?#vC1>NcY@
c?P.̥]xK*?QIb`ylw'Y΂pkI.y:Iúu'_wtô&쑛.*uՖu&֋293P}cUxbWu0 ~ ,؄9n    IENDB`                                                                                                                                                                                    adminhome/images/google-sitemaps.gif                                                                0000755 0001012 0001007 00000006071 11214412632 020221  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89an 0   0sFM'.jQ̣Wutmظ{JZwr\аpH8/B[tpxqFDqĨ;I";izhxq]b*],q(@هYqkYȴ_K<B:bUQm߆i.W<+'ޙ\zԈ$ff3ĻYE1Do~0?yA,QUTKЪFrJ6ܰ9$q崠CԴ5+Kz߯[mX8,ȼ˨v+Ў^t^:@羴[aߥܱ'[̠䤧iWFL|⚠wﾘXbyrgõ퐟<axz,h/ƀvۖư_WpwƐtխݡ9Ѷٖﵩݪr^Z鲻ڵ雋U3;%Ħ𧕎ѡ                                                                                                         !  ,    n 0   H*\ȰÇ#JHŋ3jȱǏ CIɓ(SvF2 @u FJ^!b`e$#>9 
#p[_=RbeEJ(Q=4
6RmXF;szdح1T+Z4Fjr*<&K,b#J٘tذi6. %%f*s	"KG%\=Ė]2sp[hC47Kd6iU%^'tVpYce6\BRJz!Ğ{TP7=_@%LՐ%TwL1E6r8Ԍ$KC8#Ё(P
dI.)XҕKg rFr#Afd3PC*$A2`rK,`bl`1v#A$U`B"I	WPE)|a[l4$J`-p80,laL#AV5KLs왂	dl0D1\H)=4Eİ6ű$8/"Т3
	В+jp
#R0UyъT(f^`,m!HL(WQH1añ@ l*,%`$Y`+P2aE\-I% KT.kQ+1kD(Er7P|	$.PDx9,~<`Bi@jN#,H*FB0@$sESL(@8l1@+&%7DkA͜}@cCQ&%W8<BA:P
?VTdd $wp3beWLx)PI?$C#% A		U<Qp%XJ]ݹw:GnCP6Ul*n@A+] k\vo K=*~_h P+D])Y")2a 1am#Z",wDPh(!#Ɲ4pdX0268;G 0#	<0aqWa(=x Q<d1҆XAg[Wޥ-06@1<zL<# lz
1't}i|Wr ,',%(ATa<L =_7ptiBL:7,(F$`B	dW )`[<0b7(=D@b!8Z!rAF #<EU$s (iC\m˸@ KPIHkXK9Ah8r#Ĳa\~1!@@;P$p8
8g2RpBTZA5
+&@Ԅx85SB`VbHr cB$LbK h߼g ð2dǁ~v1GSprE
R5 DYD&XAN\dU47daH,"1! o(D# tC\P;AH@ˢ*8)`d Hc" E2: 1
W<!H@R"a@"6 \ $*
|2Z?l^Ђ)LL2b9yK
;ām'RЄ&aB0	B%Pc5sh 6h5\`T hEĲe'.xq'.kLc	aBeCKBňT$V,8,Z2W:<X-bBbrG\M9`!5PGvl`
F%S0Yu=fH9vmށv ac	4!vY]Z94AmҔ&҉vp5t#Y@ f8qZЛB؁0,n;A  h.0fdaHEycEd:0#!%ft`r[wt'{, l{\ns2w	[ 
d+I%UqHj: GA֝;j(:$mȠs188ļ!uGhOIg9!q%Gb #Z>P:-w=d7_q]CF[F&[B4>6=r'RCҌ}jE	bh؁KA'		He-E8bUnӍ m 	 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                       adminhome/images/graph_hbar_blue.gif                                                                0000755 0001012 0001007 00000000052 10110364614 020217  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a            ,        ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      adminhome/images/graph_hbar_red.gif                                                                 0000755 0001012 0001007 00000000062 10110364614 020043  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a         !   ,        ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                              adminhome/images/graphs/                                                                            0000755 0001012 0001007 00000000000 11434737434 015726  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/images/graphs/banner_infobox-1.png                                                        0000755 0001012 0001007 00000000714 11151055226 021554  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  fIDATxKn \u9ܬާ7.8P*qx"%|7 n     @[_"< KxCBu͈~2z$ǎs;Ar3*LW9(32˕Q.WTc
K5aU8$+We<}^&"oî(R#D[&mv[S.4>A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@9h\1a)($G     g>"7m}
*aHǙ͈:L$C6#ֈjMrCF    IENDB`                                                    adminhome/images/graphs/banner_infobox-2.png                                                        0000755 0001012 0001007 00000001047 11151055226 021555  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  IDATxQn0^!~f}K(IL !Bl!fqg;rFqҋ RZ+-Ξ}-ߍH1#aZF,~\6!ai8BW[&YG$riĸrY(Iʕ6>)U[{Uigs9撤'cضrUYߴ}λ0ȴG;@Fd:uHd2񽢌|}Ҁ+/"U^W+d@&c5z4#o#                      D֫H~bR{H? !6' |賌xJ1jaWVUWGTM"nsmsv	#dzO]Ƣ b3[HxxSGim| (^H    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         adminhome/images/graphs/banner_infobox-3.png                                                        0000755 0001012 0001007 00000001045 11151055226 021554  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  IDATxQ a<7ۗM<7^e.L)IihbP.     ;"GD=	"9q_r=͈~J;ϥƂr	LD>"1J^#IX$(kbt$]'KqLY%χ89;cNI3ĎT!1s            @d,S,埽-H<F?z6$iO}L;*R9QjF=S_                                          BU$Ėx\D$aȱ۽)#(#JB+*WَLwijD\sm;ا:׆K"x*Hl7b	)Ako{vo4S8;"?C    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           adminhome/images/graphs/banner_infobox-4.png                                                        0000755 0001012 0001007 00000000714 11151055226 021557  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  fIDATxKn \u9ܬާ7.8P*qx"%|7 n     @[_"< KxCBu͈~2z$ǎs;Ar3*LW9(32˕Q.WTc
K5aU8$+We<}^&"oî(R#D[&mv[S.4>A@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@9h\1a)($G     g>"7m}
*aHǙ͈:L$C6#ֈjMrCF    IENDB`                                                    adminhome/images/graphs/banner_infobox-5.png                                                        0000755 0001012 0001007 00000001046 11151055226 021557  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  IDATxQn0^!~f}K(KLTSH>lC67@I?\iqv?/cˈJ=&eߏ.$L2M%/㬤["җqs9嚳Q.*׺R'Q%/Ξ89;c.d?W(/q>     ͈~:,#uܩTw7="HIߓD)WE#_OCA@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@NȿE$n"nȾI*=GxJ6jf*2*@@@@@^GTM"Hֆ.a !&L'ԕz+6#JZM}㛏.ESy4Z?,@>Q%u    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/images/graphs/banner_infobox-6.png                                                        0000755 0001012 0001007 00000000723 11151055226 021561  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  mIDATxKn0\rf>q'"?wB\@@@@@^ Ȍbޗb:;'_HqOS)GBa[X{w![CY3JLlHeRr-Y(Kʕv|Rrd3Qt+t)Rb0=u                        #v_59%A
#EYffP22ͺk9c)($FR     fDDCvi}`^Df)W#D$B3[Ftn
E~RpA    IENDB`                                             adminhome/images/graphs/banner_infobox-7.png                                                        0000755 0001012 0001007 00000000726 11151055226 021565  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  pIDATxK \el6sx3Eh*NYVn𵐛;!n     Eы %UZ!av͈~~$6y	u[ȜQer\>#}8ʱZňr\e+WOJLgpyMH%)h_ve zqH9ga~3p94 ֏l?Q#t|GTj|\Yh޳ybJ^EΘ
!g      y CDErYLј#rmfD}&!Kdk{ҁZ    IENDB`                                          adminhome/images/graphs/banner_infobox-8.png                                                        0000755 0001012 0001007 00000000654 11223345146 021571  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  FIDATxK a캄HqBF1@l1e0L@@@@@.kHҠ7AdK8#2"f3H<\O
	|JwȔQ~21\.!LX,W̢FLV|Rj٪c=w$f}bu"zHv0ȿ#e{ cJ F,*u>HPfQ+H 8I9Iy<Hrɤg{,3rSeW    IENDB`                                                                                    adminhome/images/graphs/banner_infobox-9.png                                                        0000755 0001012 0001007 00000000654 11223345154 021571  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PNG

   IHDR         1    !PLTE   ddd        7%,  FIDATxK a캄HqBF1@l1e0L@@@@@.kHҠ7AdK8#2"f3H<\O
	|JwȔQ~21\.!LX,W̢FLV|Rj٪c=w$f}bu"zHv0ȿ#e{ cJ F,*u>HPfQ+H 8I9Iy<Hrɤg{,3rSeW    IENDB`                                                                                    adminhome/images/graphs/index.html                                                                  0000755 0001012 0001007 00000000166 10110364614 017713  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <html>
  <head>
    <title></title>
    <meta content="">
    <style></style>
  </head>
  <body></body>
</html>                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/images/icon_arrow_right.gif                                                               0000755 0001012 0001007 00000000121 10110364614 020447  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   E?   !   ,       "-	ᷘPI8~ &GjhPI@DJ ;                                                                                                                                                                                                                                                                                                                                                                                                                                               adminhome/images/icon_attributes.gif                                                                0000755 0001012 0001007 00000000426 10110364614 020316  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    !)!s)!)!k!)!c)!Z)!R)!J       )  !                                     !	   ,        HD!08P
	d"+,(
!/VL  Yqcʄ@`3gZ PP :/Ņ4>XQhҊ*:쁖(kDyADА ڈ                                                                                                                                                                                                                                           adminhome/images/icon_attributes_on.gif                                                             0000755 0001012 0001007 00000000407 10110364614 021011  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    scRJ:1)!                                              !	    ,        `
0AL@3: 0qCBxPc !#@@"UF@` 1!xdʙ+1 dƕAGNxTN4uS@F%HB
}`Xʝ ;                                                                                                                                                                                                                                                         adminhome/images/icon_blue_off.gif                                                                  0000755 0001012 0001007 00000000414 10110364614 017706  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    <?@vU[ry]ac8=kxHKM                                                !   ,        ("4<̴<(@4@ <H@`h@ƣf01.N_pX>?5aF=BX|BDY{g~JLK 
yx]%t
S436G."H()+"! ;                                                                                                                                                                                                                                                    adminhome/images/icon_blue_on.gif                                                                   0000755 0001012 0001007 00000000276 10110364614 017556  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    HjUu25@>MEa:?OuOSbyփl{auȖ   !	   ,       k=$%+ǂrT,ᾮ3x/E:.@a@)8IunKE$ E6A45 ;                                                                                                                                                                                                                                                                                                                                  adminhome/images/icon_copy_to.gif                                                                   0000755 0001012 0001007 00000000603 10110364614 017601  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a      II11cc;;[[00ޥqq!!YYLLddÍQQ::@@}}Ż@@RR##hhZZ::||                                                   ! $ ,       @$P* bhX1,@xh0:\R I"h!3d&ab$Bc+v c"$wec}bCb% )u "!$&	w	B
	x	C*-TW%O+,#CA ;                                                                                                                             adminhome/images/icon_delete.gif                                                                    0000755 0001012 0001007 00000000601 10110364614 017365  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a      [[11!!IIff;;33RRΈ}}qq::ff̙ZZ@@Ô@@YYQQ||ffޔ==33ӏ                                       !  ,       2%!eA	i `@b#ݰz^`/+q  {~_%N`,s/a}{$} `x_ "p_ r1B	r C#RUV'N2.,!CA ;                                                                                                                               adminhome/images/icon_edit.gif                                                                      0000755 0001012 0001007 00000000602 10110364614 017051  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a     f p[[@w@||в3f300jdd:r:LLȥˊ[[mw@@qqQQ88ֻRRcc!y!hh;;ZZӵ3f3                                                         !  ,       pJB9Ų..@S(,`Qb^lHf[epG$t }Bb'kab c~ab
 ud"{aC(a $u&B!c,C$RTV#N'	CA ;                                                                                                                              adminhome/images/icon_edit_metatags_off.gif                                                         0000755 0001012 0001007 00000000276 10412034574 021603  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a       JJJՌ"""ggg)))888   !	   ,       k7D0&1;YG%L H  <9,	H,6d(Qg\.AQD]4*hkp'A/1 "$;fR ;                                                                                                                                                                                                                                                                                                                                  adminhome/images/icon_edit_metatags_on.gif                                                          0000755 0001012 0001007 00000000302 10412034574 021433  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    X Jn"gs)\|8   !	   ,       oɗD0&4;Y BtJS@$(t 0̓5
+2aR\ SL`p` 9-$)+13 S$&LfW ;                                                                                                                                                                                                                                                                                                                              adminhome/images/icon_green_off.gif                                                                 0000755 0001012 0001007 00000000407 10110364614 020061  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    7:8q~tƽSTplX]Z7:fsiCGD                                                !   ,        )("48G3ts84@@ Q8H@`(Wza `8 {?@X{uKMOQF1pw[*I+*457,-H()+"! ;                                                                                                                                                                                                                                                         adminhome/images/icon_green_on.gif                                                                  0000755 0001012 0001007 00000000302 10110364614 017715  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    %.#4'f%K`%>3OGSIxz.^7CSez   !	   ,       o𽤐$_[C,B3	p|8 8FƁGBn(.@(}rvk%H# .we!LP(ba(O* ;                                                                                                                                                                                                                                                                                                                              adminhome/images/icon_info.gif                                                                      0000755 0001012 0001007 00000001034 10110364614 017057  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   ˰ʲ.'~/(2-lWQ95c^Y`[b]jfvr{\Y}Œɷ?:HCJEGBMIXSUPZU\WZV\XWSb^lhhemjolurxuol~{}z~Ȍɰɾ׷_\wu~|ȳ˺                                                                                                                                       !  Q ,       yQQI&!	);>%4@CEF*:BRA 
DR/$PQ=RR628N+RJ73R#5'<̲0 ѲK,9M?HOR"L(1.G- ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    adminhome/images/icon_move.gif                                                                      0000755 0001012 0001007 00000000604 10110364614 017074  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    f3wZmk:ɸۋdpQ[ǙwtwJo?jlOﮞpͤ|Pdઝm=yL{uxpð˭                                    ! ! ,       0rub21X(BK54x002a ́v'2f<c(ab"B!!b)u !bdb
c ,|B' 3t	+!	v	%B-	w	C(UW O0CA ;                                                                                                                            adminhome/images/icon_orange_off.gif                                                                0000755 0001012 0001007 00000000415 10110364614 020233  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    @?<xiUTղ8:ca\qj̸MKG                                                !   ,        <@(!B*4tm(0>F2bp0$Ep0X8`Q2qAGpW#)uv<XZ\p `LNP}p
V{z^%vT,458.1H/I) ,.! ;                                                                                                                                                                                                                                                   adminhome/images/icon_orange_on.gif                                                                 0000755 0001012 0001007 00000000301 10110364614 020067  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    C;..]	֟P`ZPcO0M_p.   !	   ,       n𽄎$_b2(!TnH,,4^et <l [n0)0|hk;CBۨǀX'' ;                                                                                                                                                                                                                                                                                                                               adminhome/images/icon_pink_off.gif                                                                  0000755 0001012 0001007 00000000412 10110364614 017716  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    @>@uſS[_]_7=py挅lgl                                                !   ,        "$ 4b
#$CA @~C	6x̆pa(vW`~yu~;8zIKMJyTvu* +3F. 7-$&('R,! ;                                                                                                                                                                                                                                                      adminhome/images/icon_pink_on.gif                                                                   0000755 0001012 0001007 00000000303 10110364614 017557  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    C.C P_E_9ҷMel1l   !	   ,       p=L$$_Rb,.CBEP-@((a#@aZQu^ܫWJw7V¡10p?r{rs4 ;                                                                                                                                                                                                                                                                                                                             adminhome/images/icon_popup.gif                                                                     0000755 0001012 0001007 00000000352 10110364614 017271  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   +++ڡ111BBB>>>EEE555UUUPPPjjjfffЫϲ^^^aaaIII!   ,       g'2`_`W S2ܓo@ C@%` t,I
x0T̅ qh"I@ 9CE$O	,,i"%	! ;                                                                                                                                                                                                                                                                                      adminhome/images/icon_products_price_manager.gif                                                    0000755 0001012 0001007 00000000312 10110364614 022641  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   ww  ٘MM照         !   ,       wjZWTK4:Y ++Y$Dc0	 8(_в* *4t1R-@P()#h$T&i  a5-$L"$6"7 ;                                                                                                                                                                                                                                                                                                                      adminhome/images/icon_purple_off.gif                                                                0000755 0001012 0001007 00000000411 10110364614 020263  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    536LTWTY4;dpqhw­͸B?B                                                !   ,        Ah"4<̴b$Ax
@pQR$	)eIA؋:ѧ5`GxQXm\wkKMO3i
m4{*g43%+*6F0-G()+"! ;                                                                                                                                                                                                                                                       adminhome/images/icon_purple_on.gif                                                                 0000755 0001012 0001007 00000000303 10110364614 020125  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    n>7CgcΉoIZNbֈd֝x[٨   !	   ,       pLؠ$3rb1S8DNP qf @0(X@!xAa)Za8x&Lke/3D
c&ah(
4 ;                                                                                                                                                                                                                                                                                                                             adminhome/images/icon_red_off.gif                                                                   0000755 0001012 0001007 00000000310 10110364614 017524  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF87a    @==c^^QU׿6;pploXRR{{,       }5#rb$B @"OE!X=qz!
sPGzuf^qqDs_;7BV>&||
 #&6 c7 ;                                                                                                                                                                                                                                                                                                                        adminhome/images/icon_red_on.gif                                                                    0000755 0001012 0001007 00000000277 10110364614 017402  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    3<D.3	52Vp;b"N`PSJ`t8Do   !	   ,       l=8!%_R$,nG>WCoH<$\ sx|椀60oރ9;kQ(m& ;                                                                                                                                                                                                                                                                                                                                 adminhome/images/icon_reset.gif                                                                     0000755 0001012 0001007 00000001002 10110364614 017241  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    ~~~|||{{{xxxvvvooonnnjjjhhheeeccc___XXXPPPNNNBBB888777000///***((('''&&&$$$"""!!!                                                                                                                                                   !  P ,       _P"J0MCO-<$PH&"9!6N5)>:;O% 72,I.+4B(FFE3D#*LA#G@/PIK1=?8' ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              adminhome/images/icon_save.gif                                                                      0000755 0001012 0001007 00000000233 10110364614 017062  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   ---hhh[[[   @@@   NNN            !   ,       HpI뒅6qdb1 )踎%pk< b@,I` h:dlF584BoSI*hW ;                                                                                                                                                                                                                                                                                                                                                                     adminhome/images/icon_status_green.gif                                                              0000755 0001012 0001007 00000001004 10110364614 020624  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
   HGHGFG    		
::;7# 598A>DQ \ V d c d b _ a k h f g l 		
~~~ttt]]]MMMJJJ+++***&&&                                                                                                                                                                  !  I ,    
 
  aII9DE;I=63AI8"4<C)'(1F0%%,$2	6 /+&
.(*-G:H!#3?I@35B; > ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            adminhome/images/icon_status_green_light.gif                                                        0000755 0001012 0001007 00000000444 10110364614 022022  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
   ⏍ѺهŒ󒒒                                                                                       !  " ,    
 
  A@a,a#$@Z8PObRbr5bVzS.0lQBDH"A ;                                                                                                                                                                                                                            adminhome/images/icon_status_red.gif                                                                0000755 0001012 0001007 00000000464 10110364614 020307  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
      ())122455?@@        xn[Zͻ~~~|||yyyjjjXXXOOOIII@@@%%%   !  > ,    
 
  Q@ϕ[$v/O NAbDW x	@=xr1!'̚B"H 5ǃ	P#6>7 %%  :J34BA ;                                                                                                                                                                                                            adminhome/images/icon_status_red_light.gif                                                          0000755 0001012 0001007 00000000464 10110364614 021476  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
   ƽ!  > ,    
 
  Q@ϕ[$v/O NAbDW x	@=xr1!'̚B"H 5ǃ	P#6>7 %%  :J34BA ;                                                                                                                                                                                                            adminhome/images/icon_status_yellow.gif                                                             0000755 0001012 0001007 00000001004 10110364614 021037  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
      //0**+==>MMNIIJ    
     Ӯ
	    ֬ԮЧЪpojv_|dkVgR	
{{{zzzqqqbbbRRRMMM...)))                                                                                                                                                         !  L ,    
 
  aLL@JKBLD41GL=2$,CH/*'  #
%!"0.) >6-(&+3ELF5I?	A ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            adminhome/images/icon_yellow_off.gif                                                                0000755 0001012 0001007 00000000412 10110364614 020270  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    @@=WUllc׶9;__[voĀù                                                !   ,        ="<"24b:$ q@? `q~E xàaa[(
_ސlFC|:mIKMJE
wv\S6+33F.
\8"$&('R,! ;                                                                                                                                                                                                                                                      adminhome/images/icon_yellow_on.gif                                                                 0000755 0001012 0001007 00000000306 10110364614 020134  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    CC. P__E9䋋Mekl1   !	   ,       s=L$$_3R,.CxA8@8)A,
@aZЋdn;cew:p\p@pl
t
' ;                                                                                                                                                                                                                                                                                                                          adminhome/images/icons/                                                                             0000755 0001012 0001007 00000000000 11434737435 015556  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/images/icons/cross.gif                                                                    0000755 0001012 0001007 00000000524 10110364614 017363  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a  # 22\\**::&&dd﫫uuTT..hh﨨}}zz肂LL힞!!ꎎGG                                                                                    !  # ,       qpH)(@ (& (0 4 NxT $z+ps-	vsv "s!nnaXn~C
u BdE] C	rDny#nI#A ;                                                                                                                                                                            adminhome/images/icons/current_folder.gif                                                           0000755 0001012 0001007 00000000204 10110364614 021242  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a        `Ȑ!   ,       Ix,gjCz7Ql^iqeKa/@Qv9]yrVd!uIjLFS0=p`pfLn$  ;                                                                                                                                                                                                                                                                                                                                                                                            adminhome/images/icons/delete.gif                                                                   0000755 0001012 0001007 00000000454 10110364614 017476  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   Ȩ666ZZZiii('JJJllЇ̽n||{IH\\ς|!   ,       m"Q0p`! #OǦ8A)P@qyTNrEn@\.r<:I i"	+ 
wV  <+
 *"I,v@	giY+,! ;                                                                                                                                                                                                                    adminhome/images/icons/error.gif                                                                    0000755 0001012 0001007 00000000301 10110364614 017354  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
  >@GHJNNTTYRX[ajq؂ĈskuvTS`^cb!   ,    
 
  >'~1K0xT[*A#aYX#x2y8<@ĠL]@ ( B ;                                                                                                                                                                                                                                                                                                                               adminhome/images/icons/file.gif                                                                     0000755 0001012 0001007 00000000230 10110364614 017143  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    PPP                     !   ,       EIkA{/G&dYA,xF@,ܰ\9D덄a2c?g0Q9z]kL.#" ;                                                                                                                                                                                                                                                                                                                                                                        adminhome/images/icons/file_download.gif                                                            0000755 0001012 0001007 00000000336 10110364614 021041  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   PPP  А@@WWҕjjЦqqKK                     !   ,       [ 6dy`(:lB*t]A<, `H"@aq-I2 `dJJ4gEժ8EV+w:?! ;                                                                                                                                                                                                                                                                                                  adminhome/images/icons/folder.gif                                                                   0000755 0001012 0001007 00000000201 10110364614 017475  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a     `Ȑ   !   ,       Fx d0]`(D`htjp<s^x1or9F*mfav)08 ;                                                                                                                                                                                                                                                                                                                                                                                               adminhome/images/icons/locked.gif                                                                   0000755 0001012 0001007 00000000327 10110364614 017474  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a              Ӭ  ۟  t ׯ  b    s ]fP !   ,       T'di*jm*Bz[gM㧨$RA$
\JȢ1 + 0 &ox\>KwB]'! ;                                                                                                                                                                                                                                                                                                         adminhome/images/icons/preview.gif                                                                  0000755 0001012 0001007 00000000571 10110364614 017715  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a  ? ľ人ABB𬥜Ȼɭ琏yyy騦!  ? ,       pH,Ʊ1EnS* @3v > [J$f Ac( /; 
C >9 ,1e,->,5y =0?' #.$
B 	l<D9*l7+E2 	6G:"4qR?A ;                                                                                                                                       adminhome/images/icons/previous_level.gif                                                           0000755 0001012 0001007 00000000407 10110364614 021275  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   v	Y,kjdݯ5yG՗(c7U>9ܦ߼S> Xԥo̙G@ջ!   ,       'xd:v T*)Z)J0@#?qtHăp9  ׂV+:Lİ<FeqaN܋@!Q<vbjSCYZ8	C (LC	*D;$! ;                                                                                                                                                                                                                                                         adminhome/images/icons/statistics.gif                                                               0000755 0001012 0001007 00000000217 10110364614 020423  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a    WWWҋtttkkk!!!|||EEE???!     ,       <I\<ĳ >EBL1%H E0*	A(i"jӬv ;                                                                                                                                                                                                                                                                                                                                                                                 adminhome/images/icons/success.gif                                                                  0000755 0001012 0001007 00000000261 10110364614 017700  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
  ~{꼣_ןYꠝ   !   ,    
 
  .'J!c z "ɫ D@yy6é@C`)P! ;                                                                                                                                                                                                                                                                                                                                               adminhome/images/icons/tick.gif                                                                     0000755 0001012 0001007 00000000323 10110364614 017161  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   %O]Ռ)ݤ٘ 1%5\iTaz҄ܠvрdp1@GU5Eߨ      !   ,       P`'dih9* C#8=S(@:HlnS&7NꀾQTdZWP@  ;                                                                                                                                                                                                                                                                                                             adminhome/images/icons/unlocked.gif                                                                 0000755 0001012 0001007 00000000330 10110364614 020031  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a   `w֋,ES)-3uKKCq7O\AXd^r~Vcfy|ʶk%!   ,       U'dihIyl~JF͵&3<ak6K@8X(@"r؊<u Ou;/$! ;                                                                                                                                                                                                                                                                                                        adminhome/images/icons/warning.gif                                                                  0000755 0001012 0001007 00000000300 10110364614 017667  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a
 
  AC 
++C5E&&Jmdbrc۸n!   ,    
 
  ='~#W *FUIN 	pt`p	 3 rXb` ;                                                                                                                                                                                                                                                                                                                                adminhome/images/index.html                                                                         0000755 0001012 0001007 00000000166 10311431002 016414  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <html>
  <head>
    <title></title>
    <meta content="">
    <style></style>
  </head>
  <body></body>
</html>                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/images/logo.gif                                                                           0000755 0001012 0001007 00000004263 10110364614 016063  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a @  cqcX{'#"!̙HfC@>         !   ,     @ @I8ͻ`(V3hlE*Ax|熋	(Z1`ˤ6 ,P5ݟ` .@b0gOi;A%'j(. 7,?
 +.@B8/ 9 )ɉ-: :7:CufZ/
ȝdemZ|n ˖? (f<	{FPqȵL 'DP GN+)Iv3\	K'hHAA42'	+8L'7tQ>\j5?N I9I]˶۷p1H	
(|o)ygRpǐ#&vnl1$:ԠQX$	tBpEkIzjwe!/\ZI^Wwk,4G/:P޸Yr&*V(fPJZA2GkTbt!{-8%DxrY0c$xEaSX9g-6'< a;&ݨhbH&L6PF)唡eXfeH`)昁8Q&hlOp]]_Sp az	uDa2e6=~u]gc	t颜vX_3 誌pㄷBq0`i0X-cZfA;fB 0 }*AQ*跊OBK?)2ɪB+䩰y9;	,IT+Yal
Љ g.r܁jͺjԆhG/뵗+ps ~>pv2
0V°{Yss'1Bo;.SR;GPqc,eAޖ$w6+L2D3tmw+Oƌew[u߀
YWr/Jr-'jI亖JyI#c<H'e\񴧅{^g3HZz'"*Vܚ82G1)6%[Jy0<NC>/nA	,*ً>`(]/?Z[o AL: $0 `Q(6Ȫ-1sQG85 	T
pB#dJ.d&`5b B@D%U `
`*h=Q^ąll8^AJeP(\)P,Loh'qnx(BG0;АŃU<DÑ=.qvt*:eB`+&hRYu'uIKK3DszAPXdA$A>ןyv-TU zǩDmT	5٣n!jMCc0ˢK2Yb$c|A="~ꌛ*8ZB|9|1bٶ4Y:{A0g,hL;&d|4"H62ma)mĴ4ɨ:٩0%թ>`~J2yn?m`ӊ,f{DN4%U}5TjG[PuL>1)	"
54)sȹ)]jivylg%>wutn
-PTWa;D*KU+hu*(yQQ6v&9VJpƖUTZ-.)FQbzQc&ځk5}]з78qf|لF馀+XcH{=`]S[N(	1\Wr"(r0'[n/S8F|Ļg}тb4o=}/хC5򐍚#xoJ,8+2ܛ/{Q08ȏ-VFDByWu3Jl)E`Q4:c1yӬص	E6:pJv"Ix14^AUdu+Q_INf% ;                                                                                                                                                                                                                                                                                                                                             adminhome/images/pixel_black.gif                                                                    0000755 0001012 0001007 00000000043 10110364614 017370  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a          ,       D ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             adminhome/images/pixel_trans.gif                                                                    0000755 0001012 0001007 00000000053 10110364614 017444  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89a      !    ,       D ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     adminhome/images/small_zen_logo.gif                                                                 0000755 0001012 0001007 00000002305 10110364614 020122  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               GIF89ax (  YӁDfff̙q$$$         !   ,    x ( @I8ͻP "$i剐E!I |pHx`4EIZl	X #`=%)`\FSr1N Ui<{Syz>nVFaminc?p=w!>1iOk>G`R OȲԻufC1
7=J@?\Pdɂ/&EiT gL3gJd
P
UZ`]/]	$"`=,07T X~A˷)УHwV)PAիX3@"^
(HUWPAlpt5 իs&bpidW0@Q)76xhC$!@LdP)4IqR#a۹9Gnct##̞EzhrEl	^|fYk\rsƟ&5էPpPc! `!-g5  2M첎@`D7$ĸ~ N*2@ 3y,Bb3"3GqY)DiHr`ؒL6PF)TV)%Wu9{$P:PÙ.0-0p$s$PXb3]\%XvxChܜHgy#)D4&uʝ()ZF b0z*rM2bv!{D BsLC&r.Zlm1gA"_ܶX@=KL!eɴU#&qBm"59)fh/:!OLIi@"jBdkI!7޾OhwlJAF'C
!~HҐ0p;bd`	d!W{U2d#Eɽla{!4+bʅHwH+0`-r{>a<""{r64..nLg_R#Z(zWCK(ԒHG`ͩMCw4\hYAHVU_BI Oo觯$)CF  ;                                                                                                                                                                                                                                                                                                                           adminhome/includes/                                                                                 0000755 0001012 0001007 00000000000 11463527446 015005  5                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               adminhome/includes/.DS_Store                                                                        0000644 0001012 0001007 00000014004 11463526464 016466  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                                  Bud1                                                                      sIlocblob                                                                                                                                                                             b o x e sIlocblob      Z   #      b o x e sicgoblob              e x t r a _ d a t a f i l e sIlocblob        #     	 l a n g u a g e sIlocblob        #                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @                                              @                                                @                                                @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   E                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         DSDB                                 `                                                   @                                                @                                                @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          adminhome/includes/.htaccess                                                                        0000755 0001012 0001007 00000002531 11366342066 016602  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               #
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################

# deny *everything*
<FilesMatch ".*">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch ".*\.(js|css|jpg|JPG|gif|GIF|png|PNG)$">
  Order Allow,Deny
  Allow from all
</FilesMatch>

IndexIgnore */*
                                                                                                                                                                       adminhome/includes/application_bottom.php                                                           0000755 0001012 0001007 00000001107 11424153470 021374  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: application_bottom.php 17049 2010-07-29 06:19:52Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
// close session (store variables)
  session_write_close();

  if (STORE_PAGE_PARSE_TIME == 'true') {
    if (!is_object($logger)) $logger = new logger;
    echo $logger->timer_stop(DISPLAY_PAGE_PARSE_TIME);
  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                         adminhome/includes/application_top.php                                                              0000755 0001012 0001007 00000013515 11452616524 020705  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               <?php
/**
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: application_top.php 15766 2010-03-31 20:17:56Z drbyte $
 */
/**
 * File contains just application_top code
 *
 * Initializes common classes & methods. Controlled by an array which describes
 * the elements to be initialised and the order in which that happens.
 *
 * @package admin
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 */
/**
 * boolean if true the autoloader scripts will be parsed and their output shown. For debugging purposes only.
 */
define('DEBUG_AUTOLOAD', false);
/**
 * boolean used to see if we are in the admin script, obviously set to false here.
 * DO NOT REMOVE THE define BELOW. WILL BREAK ADMIN
 */
define('IS_ADMIN_FLAG', true);
/**
 * integer saves the time at which the script started.
 */
// Start the clock for the page parse time log
define('PAGE_PARSE_START_TIME', microtime());
/**
 * set the level of error reporting
 *
 * Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />
 * It is mainly there to show php warnings during testing/bug fixing phases.<br />
 * note for strict error reporting we also turn on show_errors as this may be disabled<br />
 * in php.ini. Otherwise we respect the php.ini setting
 *
 */
if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
  @ini_set('display_errors', TRUE);
  error_reporting(version_compare(PHP_VERSION, 5.3, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE : version_compare(PHP_VERSION, 6.0, '>=') ? E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT : E_ALL & ~E_NOTICE);
} else {
  error_reporting(0);
}
/*
 * turn off magic-quotes support, for both runtime and sybase, as both will cause problems if enabled
 */
if (function_exists('set_magic_quotes_runtime') && version_compare(PHP_VERSION, 5.3, '<')) set_magic_quotes_runtime(0);
if (@ini_get('magic_quotes_sybase') != 0) @ini_set('magic_quotes_sybase', 0);
// set php_self in the local scope
if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];

/**
 * Set the local configuration parameters - mainly for developers
 */
if (file_exists('includes/local/configure.php')) {
  /**
   * load any local(user created) configure file.
   */
  include('includes/local/configure.php');
}
/**
 * check for and load application configuration parameters
 */
if (file_exists('includes/configure.php')) {
  /**
   * load the main configure file.
   */
  include('includes/configure.php');
}
if (!defined('DIR_FS_CATALOG') || !is_dir(DIR_FS_CATALOG.'/includes/classes') || !defined('DB_TYPE') || DB_TYPE == '') {
  if (file_exists('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php')) {
    require('../includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
    exit;
  } elseif (file_exists('../zc_install/index.php')) {
    echo 'ERROR: Admin configure.php not found. Suggest running install? <a href="../zc_install/index.php">Click here for installation</a>';
  } else {
    die('ERROR: admin/includes/configure.php file not found. Suggest running zc_install/index.php?');
  }
}
/**
 * ignore version-check if INI file setting has been set
 */
if (file_exists(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini')) {
  $lines = @file(DIR_FS_ADMIN . 'includes/local/skip_version_check.ini');
  if (is_array($lines)) {
    foreach($lines as $line) {
      if (substr($line,0,14)=='admin_configure_php_check=') $check_cfg=substr(trim(strtolower(str_replace('admin_configure_php_check=','',$line))),0,3);
    }
  }
}
/*
// turned off for now
  if ($check_cfg != 'off') {
    // if the admin/includes/configure.php file doesn't contain admin-related content, throw error
    $zc_pagepath = str_replace(basename($PHP_SELF),'',__FILE__); //remove page name from full path of current page
    $zc_pagepath = str_replace(array('\\','\\\\'),'/',$zc_pagepath); // convert '\' marks to '/'
    $zc_pagepath = str_replace('//','/',$zc_pagepath); //convert doubles to single
    $zc_pagepath = str_replace(strrchr($zc_pagepath,'/'),'',$zc_pagepath); // remove trailing '/'
    $zc_adminpage = str_replace('\\','/',DIR_FS_ADMIN); //convert "\" to '/'
    $zc_adminpage = str_replace('//','/',$zc_adminpage); // remove doubles
    $zc_adminpage = str_replace(strrchr($zc_adminpage,'/'),'',$zc_adminpage); // remove trailing '/'
    if (!defined('DIR_WS_ADMIN') || $zc_pagepath != $zc_adminpage ) {
      echo ('ERROR: The admin/includes/configure.php file has invalid configuration. Please rebuild, or verify specified paths.');
      if (file_exists('../zc_install/index.php')) {
        echo '<br /><a href="../zc_install/index.php">Click here for installation</a>';
      }
      echo '<br /><br /><br /><br />['.$zc_pagepath.']&nbsp;&nbsp;&nbsp;&laquo;&raquo;&nbsp;&nbsp;&nbsp;[' .$zc_adminpage.']<br />';
    }
  }
*/
/**
 * include the list of extra configure files
 */
if ($za_dir = @dir(DIR_WS_INCLUDES . 'extra_configures')) {
  while ($zv_file = $za_dir->read()) {
    if (preg_match('/\.php$/', $zv_file) > 0) {
      /**
       * load any user/contribution specific configuration files.
       */
      include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file);
    }
  }
  $za_dir->close();
}
/**
 * init some vars
 */
$template_dir = '';
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
/**
 * Prepare init-system
 */
unset($loaderPrefix); // admin doesn't need this override
$autoLoadConfig = array();
if (isset($loaderPrefix)) {
 $loaderPrefix = preg_replace('/[a-z_]^/', '', $loaderPrefix);
} else {
  $loaderPrefix = 'config';
}
$loader_file = $loaderPrefix . '.core.php';
require('includes/initsystem.php');
/**
 * load the autoloader interpreter code.
 */
  require(DIR_FS_CATALOG . 'includes/autoload_func.php');
                                                                                                                                                                                   adminhome/includes/Archive.zip                                                                      0000755 0001012 0001007 00001127154 11171165636 017123  0                                                                                                    ustar   homeline                        homeline                                                                                                                                                                                                               PK
     u"5              boxes/UX gIʉDP PK
     u"5              boxes/extra_boxes/UX gIʉDP PK   u"5            .  boxes/extra_boxes/easypopulate_tools_dhtml.phpUX AIʉDP ]OK@ --h1	Mbv7ӛx0y{3guQ;")%lX|-|[-l:=aNɼR*jKrO*V,פ9WNJV~M;*&m<Ha)+kZC5݀YY-Wem00Dȋ>[JhTwnx&pY!e;ZvZ.縊ei,җ$N2R}8?B&]D*4PKs"W  o  PK
     u"5              easypopulate/UX gIʉDP PK
     u"5              easypopulate/classes/UX gIʉDP PK   u"5            +  easypopulate/classes/class.easypopulate.phpUX AIʉDP Y[o8~)`Tr8&oذHt̩,S!uKNL΅7&v,`wbkH 'a]D61Ͽᒺ;>1NpGEۄ.v,)&)~NB>0>a-\҇ǈ>8A,0pYG6Y䄀}vwwÉIvܿ;'vs ᅳcI989<!r*Gbmi@8tl!"_-	b~eA߄y!IÆDB<	R9z/U1b>5t$hp,𼌺L0rU[S2' <!AUN9;`kpkH;>jm}pDUTfY"sGz\psb}E&E_ޱ>Q̻Q$(qcp0؝)A>kRhmDx<HOS10lHy&
y!RK鎻,RFb)"oKL0tXD05Ƚ@K0g3qD3L杈^z]ܨihR-$_1B<c`[vON<LJPJo]@X: EAh"$Oh<.}HKިPq7,P}NI-EZsʧfoTl#Ұe;WiM0sRzv\@YMk,Ij4Q3-A4EM/	иAèHL.3hgKhPX%U0݅eO+l1d ?.+lzHg[b:_Mg9b1nX&\bZ+4QqcY䉞ZQn 7T:]@M;/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