git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_WebOSC/trunk@5 15ff7747-3a15-8b43-b76a-1f22d5625af6
335
src/CHANGELOG
Normal file
@ -0,0 +1,335 @@
|
||||
$Id: $
|
||||
|
||||
osCommerce Changelog
|
||||
Copyright (c) 2006 osCommerce
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
08/17/2006 osCommerce 2.2 Milestone 2 Update 060817
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Please review the update-20060817.txt file for the important changes made.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
11/13/2005 osCommerce 2.2 Milestone 2 Update 051113
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Fixed bug 1662; update of customers address through the My Account page
|
||||
resulted in the country value not being stored properly and affected tax
|
||||
rate values.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
11/12/2005 osCommerce 2.2 Milestone 2 Update 051112
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Please review the update-20060817.txt file for the important changes made.
|
||||
|
||||
* Index language definition: updated the Wiki link to point to the Knowledge
|
||||
Base site
|
||||
|
||||
* Reviews Box: Renamed the following variables due to naming conflicts:
|
||||
|
||||
$review_query -> $rand_review_query
|
||||
$review -> $rand_review
|
||||
$review -> $rand_review_text
|
||||
|
||||
* Wrapped all input parameters with tep_output_string() in the tep_image()
|
||||
function on the administration tool
|
||||
(admin/includes/functions/html_output.php)
|
||||
|
||||
* UPS shipping module removed due to it violating the UPS terms of service.
|
||||
An alternative module can be found here:
|
||||
http://www.oscommerce.com/community/contributions,1323
|
||||
|
||||
* Updated codebase for PHP 5.0 compatibility
|
||||
|
||||
* Updated database structure for MySQL 5.0 compatibility
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
12/07/2003 osCommerce 2.2 Milestone 2
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Shared SSL servers are now properly supported with cookie parameters
|
||||
existing for both normal and secure servers.
|
||||
|
||||
* The installation/upgrade procedure was simplified with a new layout.
|
||||
|
||||
* Internally set PHPs error reporting to E_ALL to remove all notice messages
|
||||
on the Catalog module.
|
||||
|
||||
* Renamed default.php to index.php.
|
||||
|
||||
* Sanitize all user input on the Catalog module before inserting it into the
|
||||
database.
|
||||
|
||||
* Updated the layout of the shopping cart page.
|
||||
|
||||
* Fixed linefeed issues with emails.
|
||||
|
||||
* Modules are now installed at the Administration Tool via Install/Remove
|
||||
buttons located in the infobox; no longer through clicking on the status
|
||||
icons. This is to be consistent with other areas of the Administration
|
||||
Tool.
|
||||
|
||||
* Updated the layout of the product listing page.
|
||||
|
||||
* Updated the splitPageResults class to use the benefits a class provides.
|
||||
|
||||
* Realized the My Account Proposal as discussed on the developers forum
|
||||
channel.
|
||||
|
||||
* Introduced the message stack class used on the Administration Tool to the
|
||||
Catalog module. It has been extended to store messages in groups allowing
|
||||
to display the messages in groups at separate sections of the page.
|
||||
|
||||
* Removed old European currencies (Deutsche Mark and Spanish Peseta)
|
||||
|
||||
* Update the default configuration parameters to meet the needs of USA (it
|
||||
was previously meeting a mix of USA and European regulations)
|
||||
|
||||
* IP Address and Client Browser User Agent validations implemented for the
|
||||
Security And Privacy Proposal.
|
||||
|
||||
* Session ID Regeneration feature implemented as part of the Security And
|
||||
Privacy Proposal.
|
||||
|
||||
* New file upload class implemented.
|
||||
|
||||
* Search Engine Spider Session Prevention feature implemented as part of the
|
||||
Security And Privacy Proposal.
|
||||
|
||||
* Manually round numbers in the tep_round() function, bypassing PHPs round()
|
||||
and number_format() functions.
|
||||
|
||||
The PHP round() and number_format() functions return different results when
|
||||
strings or floats are being processed.
|
||||
|
||||
* Added data validation to the Customers section on the Administration Tool.
|
||||
|
||||
* Tax Compounding logic corrected.
|
||||
|
||||
* Cross site scripting vulnerabilities fixed.
|
||||
|
||||
* Moved filename and database table definitions from application_top.php to
|
||||
their own files.
|
||||
|
||||
* The Tax Priority can now be inserted when creating new tax rates in the
|
||||
Administration Tool.
|
||||
|
||||
* Implement the force cookie usage and ssl_session_id validations features
|
||||
from the Security and Privacy Proposal.
|
||||
|
||||
* Virtual products tax update (virtual products were not being updated as no
|
||||
shipping address is in use. Instead, the billing address is used to base
|
||||
the taxes on.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
02/17/2003 osCommerce 2.2 Milestone 1
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
*** The changelog entry for the 2.2 Milestone releases will be updated ***
|
||||
*** throughout the Milestone release path. The information here is ***
|
||||
*** currently old. ***
|
||||
|
||||
* Manufacturer now saved when adding products. (bug fix)
|
||||
|
||||
* Added .htaccess file in the 'includes' directory for some security (blocks
|
||||
direct http requests to .php files).
|
||||
ie, http://server/catalog/includes/application_top.php
|
||||
|
||||
* New cache class added for the categoies box (only for PHP4)
|
||||
- Note, this is disabled by default due to our run out-of-the-box approach.
|
||||
Can also be used in other areas of the catalog.
|
||||
|
||||
* New Who's Online section in the administration tool.
|
||||
|
||||
* Updated payment and shipping modules structure - no longer has multiple
|
||||
include statements - and are now classes.
|
||||
|
||||
* Administration Tool sections now with opened/closed box approach (the list
|
||||
of functions was getting too long!).
|
||||
|
||||
* New login and create account option page (ala Amazon style)
|
||||
|
||||
* Click on the products image (in products details) and a new browser window
|
||||
will open and resize itself to the image shown - used to display larger
|
||||
pictures of the product.
|
||||
|
||||
* All font styles are now in stylesheets.
|
||||
|
||||
* Full locaization support (ie, categories title, products descriptions,
|
||||
image buttons, etc)
|
||||
|
||||
* Table names now as constants (variables)
|
||||
|
||||
* Banner support functionality
|
||||
|
||||
* Products expected now as normal products (with descriptions)
|
||||
|
||||
* Stock control functionality
|
||||
|
||||
* Products with different attributes can now be added to the shopping cart.
|
||||
(feature fix)
|
||||
|
||||
* Authorize.net support added
|
||||
|
||||
* Sessions can now be stored in the database
|
||||
|
||||
* Tell-A-Friend function for products
|
||||
|
||||
* Information box, with all informations about shipping & returns, privacy
|
||||
notice and conditions of use
|
||||
|
||||
* Newsletter function in the administration tool.
|
||||
|
||||
* New zones for germany, swiss and austria.
|
||||
|
||||
* Prices can now be handled with/without tax. The tax would be correct
|
||||
calculated.
|
||||
|
||||
* Prices in all countries which joined the euro currency, displays the prices
|
||||
in euro and national currency. This is a european guideline which is now
|
||||
support by TEP.
|
||||
|
||||
* All address information is now stored in the address_book table only. This
|
||||
change was made to reduce redundancy and allow more feautures in the
|
||||
checkout part (e.g. selection of different BillTo and SendTo addresses)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
03/06/2001 The Exchange Project Preview Release 2.1
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Payment methods are now modules, makes it easier to implement other payment
|
||||
methods. Supported methods COD, Credit Card, Paypal. CC also supports
|
||||
storing only part of the CC# in the DB with the other digits being emailled
|
||||
to a specific email address.
|
||||
|
||||
* Shipping Modules - Modular shipping methods with support for UPS, USPS,
|
||||
FEDEX(Ground), Per Item and Flat rate shipping.
|
||||
|
||||
* Db query clean up a few AS clauses were added for earlier MySQL versions.
|
||||
Error checking added for when no records exist.
|
||||
|
||||
* Added languages box - customers can now choose their language anywhere
|
||||
except during the checkout procedure (due to POST variables in forms)
|
||||
|
||||
* Added currencies box - customers can now choose their currency independent
|
||||
from the language chosen
|
||||
|
||||
* Currencies can be added/deleted/modified through the administration tool -
|
||||
no longer through individual language files in the include directory
|
||||
|
||||
* Added a 'Contact Us' Page.
|
||||
|
||||
* Added COMMENTS field to Orders table - an order history
|
||||
Need to ALTER TABLE orders ADD comments TEXT not null;
|
||||
|
||||
* Selectable columns in 'Product Listings'.
|
||||
|
||||
* Added a delete button to the orders in the admin tool.
|
||||
|
||||
* Solved a problem with the session id not being passed to the secure server.
|
||||
|
||||
* Countries added to the admin tool.
|
||||
|
||||
* The 'Add a Quickie' box now uses the model number instead of the product
|
||||
id.
|
||||
|
||||
* The 'Search' box and the 'Advanced Search' now use the same engine.
|
||||
|
||||
* Backup in the admin tool.
|
||||
|
||||
* Numerous bugs fixed.
|
||||
|
||||
* Categories box has been updated to display path taken in bold, and display
|
||||
the parent categories (tree navigation)
|
||||
|
||||
* Font styles implemented
|
||||
|
||||
* tep_image now optionally calculates image size if omitted
|
||||
|
||||
* products_to_manufacturers table removed. Manufacturers are now directly
|
||||
link to products, via manufacturers_id record in the products table
|
||||
|
||||
* tep_href_link now removes extra & and ? characters in the URL
|
||||
|
||||
* Products with no manufacturers are now listed in the catalog module
|
||||
|
||||
* New DIR_* definitions for easier understanding ->
|
||||
FS = Filesystem (physical)
|
||||
WS = Webserver (virtual)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
12/13/2000 The Exchange Project Preview Release 2.0a
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Added FedEx shipping module
|
||||
* Bugfixes
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
12/02/2000 The Exchange Project Preview Release 2.0
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Manufacturers pull-down select box
|
||||
* Number of products in each category displayed
|
||||
* Bestsellers box
|
||||
* See what other customers have brought (linked to current product displayed)
|
||||
* Administration Tool now user-friendlier via new layout
|
||||
* Categories-to-Categories structure
|
||||
* Spanish added to the official languages supported
|
||||
* Dynamic product attributes
|
||||
* Tax zones, classes, and rates
|
||||
* Now PHP3/PHP4 compatible
|
||||
* Some configuration parameters now in database
|
||||
* Manufacturers now directly linked to products
|
||||
* Status of orders can now be modified
|
||||
* New advanced search page
|
||||
* Order confirmation emails can now be sent to multiple addresses
|
||||
* Address formating function implemented
|
||||
* PayPal payments implemented
|
||||
* Currencies are now formated to the selected locale
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
05/14/2000 The Exchange Project Preview Release 1.1
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Customization variables and constants
|
||||
* English and German localization
|
||||
* New products and upcoming products modularized
|
||||
* Added custom tep_db_* database functions
|
||||
* Added custom tep_session_* session functions
|
||||
* Added tep_href_link function
|
||||
* Added tep_image function
|
||||
* Added tep_image_submit function
|
||||
* Added tep_black_line function
|
||||
* Added tep_break_string function
|
||||
* Added tep_products_in_cart function
|
||||
* Added tep_exit function
|
||||
* Added tep_number_format function
|
||||
* Reviews-Box now displays a random review
|
||||
* account_edit_process.php updated
|
||||
* Review-Box: text now broken to avoid exceeding box width
|
||||
* address_book_add.php updated, also combined with
|
||||
address_book_add_process.php
|
||||
* login.php updated, also combined with login_process.php
|
||||
* login_forgotten.php and login_forgotten_process.php now combined to
|
||||
password_forgotten.php
|
||||
* Added products image to reviews info
|
||||
* products_reviews_write.php and products_reviews_write_process.php combined
|
||||
* shopping_cart.php updates
|
||||
* shopping_cart.php now displays proper price on special for nonsess cart
|
||||
* Fixed misalignment of checkout information
|
||||
* New directory structure for includes
|
||||
* application_top.php and application_bottom.php implemented for application
|
||||
wide parameters
|
||||
* column_left.php and column_right.php structure implemented
|
||||
* Display parse time of pages
|
||||
* SQL queries optimized
|
||||
* tep_number_format function implemented, but not in use
|
||||
* Fixed add a quickie bug - when product did not exist in catalog, it
|
||||
inserted a null entry in the cart
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
03/12/2000 The Exchange Project Preview Release 1.0
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
* Initial Release
|
||||
91
src/LICENSE
Normal file
@ -0,0 +1,91 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
|
||||
Version 2, June 1991
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
|
||||
NO WARRANTY
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
501
src/STANDARD
Normal file
@ -0,0 +1,501 @@
|
||||
$Id: STANDARD,v 1.13 2003/06/09 21:13:13 hpdl Exp $
|
||||
|
||||
osCommerce Coding Standards
|
||||
|
||||
Coding standards are defined to keep the codebase in a maintainable state.
|
||||
|
||||
The more developers working within the codebase means the more ways php
|
||||
logic can be written.
|
||||
|
||||
If every developer follows the standards then everyone is able to review
|
||||
the codebase and not waste time thinking about why a certain style was
|
||||
used in a particular area compared to another area.
|
||||
|
||||
File Format
|
||||
-----------
|
||||
|
||||
The source code should be saved in Unix format - meaning with Unix
|
||||
linefeeds.
|
||||
|
||||
Most editors are able to set the preferred format method of Windows,
|
||||
Unix, or Macintosh.
|
||||
|
||||
Some editors add a line to the bottom of the file. This is safe to have
|
||||
as long as a further character (including the space character) does not
|
||||
exist. Characters that exist at the end of the file may interfer when
|
||||
redirections occur as text has been sent to the client already.
|
||||
|
||||
The filename of the files must be all lowercass characters and contain
|
||||
no more than 31 characters to be Apple/Mac compatible.
|
||||
|
||||
Indentation
|
||||
-----------
|
||||
|
||||
Indentation of logic should be 2 whitespace characters.
|
||||
|
||||
TABs should not be used.
|
||||
|
||||
Starting and Ending PHP Logic
|
||||
-----------------------------
|
||||
|
||||
When starting PHP logic, the tag should be written as "<?php", not in the
|
||||
short form of "<?" or in ASP compatible tags such as "<%".
|
||||
|
||||
The end tag to mark the end of the PHP logic should be written as "?>".
|
||||
|
||||
A valid example:
|
||||
|
||||
<?php
|
||||
echo "Hello World!";
|
||||
?>
|
||||
|
||||
Defining Constants
|
||||
------------------
|
||||
|
||||
Constants must be defined before they are being used - which also includes
|
||||
constants called from include()'d/require()'d files.
|
||||
|
||||
Variable Scope*
|
||||
--------------
|
||||
|
||||
All variables must be accessed and set within their scope as:
|
||||
|
||||
$HTTP_GET_VARS['variable']
|
||||
$HTTP_POST_VARS['variable']
|
||||
$HTTP_COOKIE_VARS['variable']
|
||||
$variable (either local, or session)
|
||||
|
||||
* This needs to be updated when the codebase has been made compatible with
|
||||
the register_global parameter. Session variables are then accessed and set
|
||||
within its scope as:
|
||||
|
||||
$HTTP_SESSION_VARS['variable']
|
||||
|
||||
When PHP3 support is dropped, the following scope will be used:
|
||||
|
||||
$_GET['variable']
|
||||
$_POST['variable']
|
||||
$_COOKIE['variable']
|
||||
$_SESSION['variable']
|
||||
|
||||
PHP 4.0.x does not support the above scope which was introduced in PHP 4.1.x.
|
||||
The following can be used which is not compatible with PHP 3.x:
|
||||
|
||||
$_GET =& $HTTP_GET_VARS;
|
||||
$_POST =& $HTTP_POST_VARS;
|
||||
$_COOKIE =& $HTTP_COOKIE_VARS;
|
||||
$_SESSION =& $HTTP_SESSION_VARS;
|
||||
|
||||
include() vs require()
|
||||
----------------------
|
||||
|
||||
The use of include() will include the specified file when needed, whereas
|
||||
the use of require() will always include the specified file regardless if it
|
||||
is needed or not.
|
||||
|
||||
Example:
|
||||
|
||||
<?php
|
||||
require('file.php');
|
||||
|
||||
if (condition == true) {
|
||||
include('file_true.php');
|
||||
} else {
|
||||
...
|
||||
}
|
||||
?>
|
||||
|
||||
Instantiating Classes
|
||||
---------------------
|
||||
|
||||
When instantiating classes into objects, the following style must be used:
|
||||
|
||||
<?php
|
||||
// without class parameters*
|
||||
$object = new className;
|
||||
|
||||
// with class parameters
|
||||
$object = new className($parameter1);
|
||||
?>
|
||||
|
||||
* PHP3 does not support the following style which includes an empty bracket
|
||||
set:
|
||||
|
||||
<?php
|
||||
$object = new className();
|
||||
?>
|
||||
|
||||
Displaying Strings
|
||||
------------------
|
||||
|
||||
Strings or values should be displayed as:
|
||||
|
||||
<?php
|
||||
echo 'Hello Mr Mister!';
|
||||
?>
|
||||
|
||||
The following styles should be avoided:
|
||||
|
||||
<?php
|
||||
print $variable;
|
||||
?>
|
||||
|
||||
<?=$variable;?>
|
||||
|
||||
Singe-Quotes vs Double-Quotes
|
||||
-----------------------------
|
||||
|
||||
When displaying strings single quote characters should be used.
|
||||
|
||||
Double quote characters should be used only when control characters are
|
||||
needed.
|
||||
|
||||
For example:
|
||||
|
||||
<?php
|
||||
echo 'Hello Mr Mister!' . "\n";
|
||||
?>
|
||||
|
||||
|
||||
Custom Functions
|
||||
----------------
|
||||
|
||||
All custom functions should start with tep_ so that the developer knows
|
||||
a native PHP function is not being called.*
|
||||
|
||||
An example custom function style:
|
||||
|
||||
<?php
|
||||
function tep_my_function($parameter, $optional = '') {
|
||||
global $HTTP_GET_VARS, $another_variable;
|
||||
|
||||
....
|
||||
|
||||
return true;
|
||||
}
|
||||
?>
|
||||
|
||||
* When 2.2 is finalized the custom functions should be renamed to osc_*
|
||||
as "tep" refers to the previous name of the project.
|
||||
|
||||
Class Names
|
||||
-----------
|
||||
|
||||
There are two types of styles to use when classes are used.
|
||||
|
||||
The first type of class set are the static classes that can be found in
|
||||
the includes/classes directory.
|
||||
|
||||
If the class name contains more than one word, the words in the filename
|
||||
are separated with an underscore character. The actual class name is one
|
||||
whole word where words from the second onwards being capitalized.
|
||||
|
||||
For example, a class name of myOwnClass has a filename of
|
||||
my_own_class.php.
|
||||
|
||||
The second type of class set are the dynamic modules that can be found
|
||||
in the includes/modules/* directories.
|
||||
|
||||
The class names must match the filename as most of them are include()'d
|
||||
dynamicly.
|
||||
|
||||
For example, a class filename of my_own_module.php has a class name of
|
||||
my_own_module.
|
||||
|
||||
Class Structure
|
||||
---------------
|
||||
|
||||
The class should be written in the following structure:
|
||||
|
||||
<?php
|
||||
class myclass {
|
||||
var $variable;
|
||||
|
||||
// class constuctor
|
||||
function myclass() {
|
||||
|
||||
....
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// class methods
|
||||
function do_something() {
|
||||
|
||||
$this->variable = 'set';
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$class = new myclass;
|
||||
$class->do_something();
|
||||
?>
|
||||
|
||||
Database Queries
|
||||
----------------
|
||||
|
||||
Database queries are wrapped around custom functions and should be
|
||||
structured as:
|
||||
|
||||
<?php
|
||||
// multi-result set
|
||||
$action_query = tep_db_query("select column1, ...");
|
||||
while ($action = tep_db_fetch_array($action_query)) {
|
||||
echo $action['column1'];
|
||||
}
|
||||
|
||||
// single result set
|
||||
$action_query = tep_db_query("select column1, ...");
|
||||
$action = tep_db_fetch_array($action_query);
|
||||
|
||||
echo $action['column1'];
|
||||
|
||||
// return number of rows
|
||||
$action_query = tep_db_query("select count(*) as total from ...");
|
||||
$action = tep_db_fetch_array($action_query);
|
||||
|
||||
echo $action['total'];
|
||||
|
||||
// query with parameters
|
||||
$action_query = tep_db_query("select column1 from table where field = '" . tep_db_input($some_id) . "'");
|
||||
while ($action = tep_db_fetch_array($action_query)) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
Unlike displaying strings, double quote characters are wrapped around the sql query.
|
||||
|
||||
The following is currently for the Administration Tool but will also be implemented
|
||||
in the Catalog module.
|
||||
|
||||
Before data can be entered in the database, it must be protected against possible
|
||||
attacks residing in the user input. The data is first prepared and then protected
|
||||
when inserting it into the table. The following structure is used:
|
||||
|
||||
<?php
|
||||
$value1 = tep_db_prepare_input($HTTP_POST_VARS['value1']);
|
||||
|
||||
tep_db_query("update table set column = '" . tep_db_input($value1) . "' where id = '" . (int)$id . "'");
|
||||
?>
|
||||
|
||||
Variable type casting should be performed directly for integer based values, such
|
||||
as column IDs: (int)$variable
|
||||
|
||||
Multiple values can be parsed, protected and inserted into the table in an easier
|
||||
fashion:
|
||||
|
||||
<?php
|
||||
$value1 = tep_db_prepare_input($HTTP_POST_VARS['value1']);
|
||||
$value2 = tep_db_prepare_input($HTTP_POST_VARS['value2']);
|
||||
$value3 = tep_db_prepare_input($HTTP_POST_VARS['value3']);
|
||||
|
||||
$sql_data_array = array('column1' => $value1,
|
||||
'column2' => $value2,
|
||||
'column3' => $value3);
|
||||
|
||||
tep_db_perform('table', $sql_data_array);
|
||||
?>
|
||||
|
||||
A similar structure can be used for updating values in a table:
|
||||
|
||||
<?php
|
||||
$value1 = tep_db_prepare_input($HTTP_POST_VARS['value1']);
|
||||
$value2 = tep_db_prepare_input($HTTP_POST_VARS['value2']);
|
||||
$value3 = tep_db_prepare_input($HTTP_POST_VARS['value3']);
|
||||
|
||||
$sql_data_array = array('column1' => $value1,
|
||||
'column2' => $value2,
|
||||
'column3' => $value3);
|
||||
|
||||
tep_db_perform('table', $sql_data_array, 'update', "id = '" . (int)$id . "'");
|
||||
?>
|
||||
|
||||
Table names should not directly be entered in the query, but the constant
|
||||
parameter assigned to that table. A list of defined constant table names
|
||||
can currently be found in includes/database_tables.php.
|
||||
|
||||
Function Output
|
||||
---------------
|
||||
|
||||
All custom functions should return strings; not directly via echo().
|
||||
|
||||
For example:
|
||||
|
||||
<?php
|
||||
function tep_my_function($string) {
|
||||
return $string;
|
||||
}
|
||||
?>
|
||||
|
||||
and not:
|
||||
|
||||
<?php
|
||||
function tep_my_function($string) {
|
||||
echo $string;
|
||||
}
|
||||
?>
|
||||
|
||||
Condition Statements
|
||||
--------------------
|
||||
|
||||
If statements should be written as:
|
||||
|
||||
<?php
|
||||
if (condition == true) {
|
||||
....
|
||||
} else {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
If the condition is to check for a boolean value, this should be added
|
||||
to the condition (as above) for clarity.
|
||||
|
||||
The following should not be used:
|
||||
|
||||
<?php
|
||||
if (!$condition) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
instead use the following:
|
||||
|
||||
<?php
|
||||
if ($condition == false) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
Multiple conditions should reside in their own parenthesis, as:
|
||||
|
||||
<?php
|
||||
if ( (condition == true) && (condition == true) ) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
Simple boolean expressions can be written as:
|
||||
|
||||
<?php
|
||||
$value = (($condition == true) ? 'true' : 'false');
|
||||
?>
|
||||
|
||||
Simple statements can be written as:
|
||||
|
||||
<?php
|
||||
if ($condition == true) ....
|
||||
?>
|
||||
|
||||
Functions do not need to be checked with a true/false
|
||||
statement. For the following valid example:
|
||||
|
||||
<?php
|
||||
if (empty($string)) {
|
||||
...
|
||||
}
|
||||
|
||||
if ( (isset($variable)) && (tep_not_null($string)) ) {
|
||||
...
|
||||
}
|
||||
?>
|
||||
|
||||
Switch-Case statements should be written as:
|
||||
|
||||
<?php
|
||||
switch ($value) {
|
||||
case '1':
|
||||
....
|
||||
break;
|
||||
case '2':
|
||||
....
|
||||
break;
|
||||
default:
|
||||
....
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
Condition Checking
|
||||
------------------
|
||||
|
||||
To see if a variable exists, use the following structure:
|
||||
|
||||
<?php
|
||||
if (isset($variable)) {
|
||||
...
|
||||
}
|
||||
?>
|
||||
|
||||
and not:
|
||||
|
||||
<?php
|
||||
if ($variable) {
|
||||
...
|
||||
}
|
||||
?>
|
||||
|
||||
Repetitive Statements
|
||||
---------------------
|
||||
|
||||
while loops should be written as:
|
||||
|
||||
<?php
|
||||
while (condition == true) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
Walking through an array should be written as:
|
||||
|
||||
<?php
|
||||
// for php3 compatibility
|
||||
reset($array);
|
||||
while (list($key, $value) = each($array)) {
|
||||
....
|
||||
}
|
||||
|
||||
// the php4 way
|
||||
foreach ($array as $key => $value) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
for loops should be written as:
|
||||
|
||||
<?php
|
||||
for ($i=0, $n=sizeof($array); $i<$n; $i++) {
|
||||
....
|
||||
}
|
||||
?>
|
||||
|
||||
Mixing HTML and PHP
|
||||
-------------------
|
||||
|
||||
Common HTML tags started in HTML must end in HTML, and
|
||||
tags started in PHP must end in PHP.
|
||||
|
||||
Wrong:
|
||||
|
||||
<td><?php echo "Hello</td>"; ?>
|
||||
|
||||
Correct:
|
||||
|
||||
<td><?php echo "Hello"; ?></td>
|
||||
|
||||
Correct:
|
||||
|
||||
<?php
|
||||
echo '<td>Hello</td>';
|
||||
?>
|
||||
|
||||
Exceptions to this standard include the tep_draw_form()
|
||||
function:
|
||||
|
||||
<?php
|
||||
echo tep_draw_form();
|
||||
?>
|
||||
[form input fields are placed here]
|
||||
</form>
|
||||
?>
|
||||
BIN
src/_PSD/Thumbs.db
Normal file
BIN
src/_PSD/button_long.psd
Normal file
BIN
src/_PSD/button_short.psd
Normal file
BIN
src/_PSD/button_small.psd
Normal file
40
src/catalog/.htaccess
Normal file
@ -0,0 +1,40 @@
|
||||
# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
|
||||
#
|
||||
# This is used with Apache WebServers
|
||||
#
|
||||
# For this to work, you must include the parameter 'Options' to
|
||||
# the AllowOverride configuration
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# <Directory "/usr/local/apache/htdocs">
|
||||
# AllowOverride Options
|
||||
# </Directory>
|
||||
#
|
||||
# 'All' with also work. (This configuration is in the
|
||||
# apache/conf/httpd.conf file)
|
||||
|
||||
# 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>
|
||||
|
||||
# If Search Engine Friendly URLs do not work, try enabling the
|
||||
# following Apache configuration parameter
|
||||
#
|
||||
# AcceptPathInfo On
|
||||
|
||||
# Fix certain PHP values
|
||||
# (commented out by default to prevent errors occuring on certain
|
||||
# servers)
|
||||
#
|
||||
#<IfModule mod_php4.c>
|
||||
# php_value session.use_trans_sid 0
|
||||
# php_value register_globals 1
|
||||
#</IfModule>
|
||||
1
src/catalog/_version_
Normal file
@ -0,0 +1 @@
|
||||
1.0.2
|
||||
271
src/catalog/account.php
Normal file
@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account.php,v 1.61 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<script language="javascript"><!--
|
||||
function rowOverEffect(object) {
|
||||
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
|
||||
}
|
||||
|
||||
function rowOutEffect(object) {
|
||||
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
|
||||
}
|
||||
//--></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading">
|
||||
<?php
|
||||
global $customer_id, $customer_first_name;
|
||||
if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
|
||||
echo "Cuenta de " . tep_output_string_protected($customer_first_name);
|
||||
} else {
|
||||
echo HEADING_TITLE;
|
||||
}
|
||||
?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo TEXT_GREETING_PERSONAL; ?>
|
||||
<br/><br/>
|
||||
<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_ORDERS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_orders.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . '<b>Hacer un pedido nuevo o continuar el pendiente</b>' . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MY_ORDERS_VIEW . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php
|
||||
if ($messageStack->size('account') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('account'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if (tep_count_customer_orders() > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo OVERVIEW_TITLE; ?></b></td>
|
||||
<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>' . OVERVIEW_SHOW_ALL_ORDERS . '</u></a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" align="center" valign="top" width="130"><?php echo '<b>' . OVERVIEW_PREVIOUS_ORDERS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
|
||||
<td><table border="0" width="75%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 3");
|
||||
while ($orders = tep_db_fetch_array($orders_query)) {
|
||||
if (tep_not_null($orders['delivery_name'])) {
|
||||
$order_name = $orders['delivery_name'];
|
||||
$order_country = $orders['delivery_country'];
|
||||
} else {
|
||||
$order_name = $orders['billing_name'];
|
||||
$order_country = $orders['billing_country'];
|
||||
}
|
||||
?>
|
||||
<tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
|
||||
<td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
|
||||
<td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
|
||||
<td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
|
||||
<td class="main"><?php echo $orders['orders_status_name']; ?></td>
|
||||
<td class="main" align="right"><?php //Rodax Software echo $orders['order_total']; ?></td>
|
||||
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . Ver /*tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW)*/ . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_personal.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php // Rodax Software
|
||||
// No hay acceso a newsletters
|
||||
/*
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo EMAIL_NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_notifications.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_PRODUCTS . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
*/
|
||||
// Rodax Software
|
||||
?>
|
||||
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
271
src/catalog/account.php.ORIGINAL
Normal file
@ -0,0 +1,271 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account.php,v 1.61 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<script language="javascript"><!--
|
||||
function rowOverEffect(object) {
|
||||
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
|
||||
}
|
||||
|
||||
function rowOutEffect(object) {
|
||||
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
|
||||
}
|
||||
//--></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading">
|
||||
<?php
|
||||
global $customer_id, $customer_first_name;
|
||||
if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
|
||||
echo "Cuenta de " . tep_output_string_protected($customer_first_name);
|
||||
} else {
|
||||
echo HEADING_TITLE;
|
||||
}
|
||||
?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo TEXT_GREETING_PERSONAL; ?>
|
||||
<br/><br/>
|
||||
<?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_ORDERS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_orders.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . '<b>Hacer un pedido nuevo o continuar el pendiente</b>' . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MY_ORDERS_VIEW . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php
|
||||
if ($messageStack->size('account') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('account'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if (tep_count_customer_orders() > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo OVERVIEW_TITLE; ?></b></td>
|
||||
<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>' . OVERVIEW_SHOW_ALL_ORDERS . '</u></a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" align="center" valign="top" width="130"><?php echo '<b>' . OVERVIEW_PREVIOUS_ORDERS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 3");
|
||||
while ($orders = tep_db_fetch_array($orders_query)) {
|
||||
if (tep_not_null($orders['delivery_name'])) {
|
||||
$order_name = $orders['delivery_name'];
|
||||
$order_country = $orders['delivery_country'];
|
||||
} else {
|
||||
$order_name = $orders['billing_name'];
|
||||
$order_country = $orders['billing_country'];
|
||||
}
|
||||
?>
|
||||
<tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
|
||||
<td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
|
||||
<td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
|
||||
<td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
|
||||
<td class="main"><?php echo $orders['orders_status_name']; ?></td>
|
||||
<td class="main" align="right"><?php echo $orders['order_total']; ?></td>
|
||||
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_personal.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php // Rodax Software
|
||||
// No hay acceso a newsletters
|
||||
/*
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo EMAIL_NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'account_notifications.gif'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_PRODUCTS . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
*/
|
||||
// Rodax Software
|
||||
?>
|
||||
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
281
src/catalog/account_edit.php
Normal file
@ -0,0 +1,281 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_edit.php,v 1.65 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
// needs to be included earlier to set the success message in the messageStack
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT);
|
||||
|
||||
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
|
||||
if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
|
||||
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
|
||||
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
|
||||
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
|
||||
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
|
||||
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
|
||||
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
|
||||
|
||||
$error = false;
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') {
|
||||
if ( ($gender != 'm') && ($gender != 'f') ) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_GENDER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
|
||||
}
|
||||
|
||||
if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
|
||||
}
|
||||
|
||||
if (ACCOUNT_DOB == 'true') {
|
||||
if (!checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
|
||||
}
|
||||
|
||||
if (!tep_validate_email($email_address)) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
|
||||
}
|
||||
|
||||
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'");
|
||||
$check_email = tep_db_fetch_array($check_email_query);
|
||||
if ($check_email['total'] > 0) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
|
||||
}
|
||||
|
||||
if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR);
|
||||
}
|
||||
|
||||
if ($error == false) {
|
||||
$sql_data_array = array('customers_firstname' => $firstname,
|
||||
'customers_lastname' => $lastname,
|
||||
'customers_email_address' => $email_address,
|
||||
'customers_telephone' => $telephone,
|
||||
'customers_fax' => $fax);
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
|
||||
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
|
||||
|
||||
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
|
||||
|
||||
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
|
||||
|
||||
$sql_data_array = array('entry_firstname' => $firstname,
|
||||
'entry_lastname' => $lastname);
|
||||
|
||||
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
|
||||
|
||||
// reset the session variables
|
||||
$customer_first_name = $firstname;
|
||||
|
||||
$messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
}
|
||||
}
|
||||
|
||||
$account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
$account = tep_db_fetch_array($account_query);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<?php require('includes/form_check.js.php'); ?>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- body_text //-->
|
||||
<td width="100%" valign="top"><?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onSubmit="return check_form(account_edit);"') . tep_draw_hidden_field('action', 'process'); ?><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 tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($messageStack->size('account_edit') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('account_edit'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td>
|
||||
<td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" cellspacing="2" cellpadding="2">
|
||||
<?php
|
||||
if (ACCOUNT_GENDER == 'true') {
|
||||
if (isset($gender)) {
|
||||
$male = ($gender == 'm') ? true : false;
|
||||
} else {
|
||||
$male = ($account['customers_gender'] == 'm') ? true : false;
|
||||
}
|
||||
$female = !$male;
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_GENDER; ?></td>
|
||||
<td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
|
||||
<?php // Rodax Software ?>
|
||||
<td class="main"><strong><?php echo $account['customers_firstname']; ?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php /*echo ENTRY_LAST_NAME;*/ ?></td>
|
||||
<?php // Rodax Software
|
||||
/*<td class="main"><strong>< ? php echo $ account ['customers_lastname']; ? ></strong></td> */
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
if (ACCOUNT_DOB == 'true') {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
|
||||
<td class="main"><?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob'])) . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
|
||||
<?php // Rodax Software ?>
|
||||
<td class="main"><strong><?php echo $account['customers_email_address']; ?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
|
||||
<?php // Rodax Software ?>
|
||||
<td class="main"><strong><?php echo $account['customers_telephone']; ?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
|
||||
<?php // Rodax Software ?>
|
||||
<td class="main"><strong><?php echo $account['customers_fax']; ?></strong></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<?php // Rodax Software ?>
|
||||
<tr>
|
||||
<td colspan="2"><br/><br/>Si algún dato de su cuento no es correcto, por favor, contacte con <?php echo STORE_NAME ?>.</td>
|
||||
</tr>
|
||||
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php /*Rodax Software - echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);*/ ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
169
src/catalog/account_history.php
Normal file
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_history.php,v 1.63 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$orders_total = tep_count_customer_orders();
|
||||
|
||||
if ($orders_total > 0) {
|
||||
$history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id DESC";
|
||||
$history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
|
||||
$history_query = tep_db_query($history_split->sql_query);
|
||||
$i = 0;
|
||||
while ($history = tep_db_fetch_array($history_query)) {
|
||||
$i++;
|
||||
$products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'");
|
||||
$products = tep_db_fetch_array($products_query);
|
||||
|
||||
if (tep_not_null($history['delivery_name'])) {
|
||||
$order_type = TEXT_ORDER_SHIPPED_TO;
|
||||
$order_name = $history['delivery_name'];
|
||||
} else {
|
||||
$order_type = TEXT_ORDER_BILLED_TO;
|
||||
$order_name = $history['billing_name'];
|
||||
}
|
||||
?>
|
||||
<?php /* Rodax Software */
|
||||
if (($i/2) == floor($i/2)) {
|
||||
echo '<table border="0" width="100%" cellspacing="2" cellpadding="2" class="productListing-odd">';
|
||||
} else {
|
||||
echo '<table border="0" width="100%" cellspacing="2" cellpadding="2" class="productListing-even">';
|
||||
}?>
|
||||
|
||||
<tr>
|
||||
<td class="main"><?php echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id']; ?></td>
|
||||
<td class="main"><?php echo '<b>' . TEXT_ORDER_DATE . '</b> ' . tep_date_long($history['date_purchased']) ?> </td>
|
||||
<td class="main"><?php echo '<b>' . TEXT_ORDER_PRODUCTS . '</b> ' . $products['count'] ?> </td>
|
||||
<td class="main"><?php echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name']; ?></td>
|
||||
<td class="main" width="20%" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL') . '">' . Ver /*tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW)*/ . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--<table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
</table>-->
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="2" cellpadding="4">
|
||||
<tr>
|
||||
<td class="main"><?php echo TEXT_NO_PURCHASES; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($orders_total > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="smallText" valign="top"><?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
|
||||
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
277
src/catalog/account_history_info.php
Normal file
@ -0,0 +1,277 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_history_info.php,v 1.100 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id']) && !is_numeric($HTTP_GET_VARS['order_id']))) {
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
}
|
||||
|
||||
$customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
|
||||
$customer_info = tep_db_fetch_array($customer_info_query);
|
||||
if ($customer_info['customers_id'] != $customer_id) {
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
$breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL'));
|
||||
|
||||
require(DIR_WS_CLASSES . 'order.php');
|
||||
$order = new order($HTTP_GET_VARS['order_id']);
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" colspan="2"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $HTTP_GET_VARS['order_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td>
|
||||
<td class="smallText" align="right"><?php //echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<?php
|
||||
if ($order->delivery != false) {
|
||||
?>
|
||||
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (tep_not_null($order->info['shipping_method'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo $order->info['shipping_method']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
// Begin Rodax Software
|
||||
if (tep_not_null($order->delivery['shipdate'])){
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_ARRIVAL_DATE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo strftime("%A, %d de %B de %Y",$order->delivery['shipdate']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
// End Rodax Software
|
||||
?>
|
||||
</table></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
if (sizeof($order->info['tax_groups']) > 1) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
|
||||
<td class="smallText" align="right"><b><?php //echo HEADING_TAX; ?></b></td>
|
||||
<td class="smallText" align="right"><b><?php //echo HEADING_TOTAL; ?></b></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main" colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
|
||||
' <td class="main" valign="top">' . $order->products[$i]['name'];
|
||||
|
||||
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
|
||||
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
|
||||
echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</td>' . "\n";
|
||||
|
||||
/*if (sizeof($order->info['tax_groups']) > 1) {
|
||||
echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
|
||||
}
|
||||
|
||||
echo ' <td class="main" align="right" valign="top">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
*/
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php //echo HEADING_BILLING_INFORMATION; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php //echo HEADING_BILLING_ADDRESS; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php //echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php // echo HEADING_PAYMENT_METHOD; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php // echo $order->info['payment_method']; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
// Rodax Software
|
||||
/*for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
|
||||
' <td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
}*/
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b>Historial de estados del pedido</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
|
||||
while ($statuses = tep_db_fetch_array($statuses_query)) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
|
||||
' <td class="main" valign="top" width="20" align="center">' . tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . '</td>' . "\n" .
|
||||
' <td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
|
||||
' <td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
262
src/catalog/account_history_info.php.ORIGINAL
Normal file
@ -0,0 +1,262 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_history_info.php,v 1.100 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id']) && !is_numeric($HTTP_GET_VARS['order_id']))) {
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
}
|
||||
|
||||
$customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
|
||||
$customer_info = tep_db_fetch_array($customer_info_query);
|
||||
if ($customer_info['customers_id'] != $customer_id) {
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
|
||||
$breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL'));
|
||||
|
||||
require(DIR_WS_CLASSES . 'order.php');
|
||||
$order = new order($HTTP_GET_VARS['order_id']);
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_history.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" colspan="2"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $HTTP_GET_VARS['order_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td>
|
||||
<td class="smallText" align="right"><?php echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<?php
|
||||
if ($order->delivery != false) {
|
||||
?>
|
||||
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (tep_not_null($order->info['shipping_method'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo $order->info['shipping_method']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
if (sizeof($order->info['tax_groups']) > 1) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
|
||||
<td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
|
||||
<td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main" colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
|
||||
' <td class="main" valign="top">' . $order->products[$i]['name'];
|
||||
|
||||
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
|
||||
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
|
||||
echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</td>' . "\n";
|
||||
|
||||
if (sizeof($order->info['tax_groups']) > 1) {
|
||||
echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
|
||||
}
|
||||
|
||||
echo ' <td class="main" align="right" valign="top">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_BILLING_ADDRESS; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_PAYMENT_METHOD; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo $order->info['payment_method']; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
|
||||
' <td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo HEADING_ORDER_HISTORY; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");
|
||||
while ($statuses = tep_db_fetch_array($statuses_query)) {
|
||||
echo ' <tr>' . "\n" .
|
||||
' <td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
|
||||
' <td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
|
||||
' <td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
|
||||
' </tr>' . "\n";
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, tep_get_all_get_params(array('order_id')), 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
159
src/catalog/account_newsletters.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_newsletters.php,v 1.3 2003/06/05 23:23:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
// needs to be included earlier to set the success message in the messageStack
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NEWSLETTERS);
|
||||
|
||||
$newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
$newsletter = tep_db_fetch_array($newsletter_query);
|
||||
|
||||
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
|
||||
if (isset($HTTP_POST_VARS['newsletter_general']) && is_numeric($HTTP_POST_VARS['newsletter_general'])) {
|
||||
$newsletter_general = tep_db_prepare_input($HTTP_POST_VARS['newsletter_general']);
|
||||
} else {
|
||||
$newsletter_general = '0';
|
||||
}
|
||||
|
||||
if ($newsletter_general != $newsletter['customers_newsletter']) {
|
||||
$newsletter_general = (($newsletter['customers_newsletter'] == '1') ? '0' : '1');
|
||||
|
||||
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int)$newsletter_general . "' where customers_id = '" . (int)$customer_id . "'");
|
||||
}
|
||||
|
||||
$messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
}
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<script language="javascript"><!--
|
||||
function rowOverEffect(object) {
|
||||
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
|
||||
}
|
||||
|
||||
function rowOutEffect(object) {
|
||||
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
|
||||
}
|
||||
|
||||
function checkBox(object) {
|
||||
document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
|
||||
}
|
||||
//--></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- body_text //-->
|
||||
<td width="100%" valign="top"><?php echo tep_draw_form('account_newsletter', tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><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 tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_NEWSLETTERS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('newsletter_general')">
|
||||
<td class="main"><?php echo tep_draw_checkbox_field('newsletter_general', '1', (($newsletter['customers_newsletter'] == '1') ? true : false), 'onclick="checkBox(\'newsletter_general\')"'); ?></td>
|
||||
<td class="main"><b><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"> </td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main"><?php echo MY_NEWSLETTERS_GENERAL_NEWSLETTER_DESCRIPTION; ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
251
src/catalog/account_notifications.php
Normal file
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_notifications.php,v 1.2 2003/05/22 14:24:54 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
// needs to be included earlier to set the success message in the messageStack
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NOTIFICATIONS);
|
||||
|
||||
$global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
|
||||
$global = tep_db_fetch_array($global_query);
|
||||
|
||||
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
|
||||
if (isset($HTTP_POST_VARS['product_global']) && is_numeric($HTTP_POST_VARS['product_global'])) {
|
||||
$product_global = tep_db_prepare_input($HTTP_POST_VARS['product_global']);
|
||||
} else {
|
||||
$product_global = '0';
|
||||
}
|
||||
|
||||
(array)$products = $HTTP_POST_VARS['products'];
|
||||
|
||||
if ($product_global != $global['global_product_notifications']) {
|
||||
$product_global = (($global['global_product_notifications'] == '1') ? '0' : '1');
|
||||
|
||||
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set global_product_notifications = '" . (int)$product_global . "' where customers_info_id = '" . (int)$customer_id . "'");
|
||||
} elseif (sizeof($products) > 0) {
|
||||
$products_parsed = array();
|
||||
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
|
||||
if (is_numeric($products[$i])) {
|
||||
$products_parsed[] = $products[$i];
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($products_parsed) > 0) {
|
||||
$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
|
||||
$check = tep_db_fetch_array($check_query);
|
||||
|
||||
if ($check['total'] > 0) {
|
||||
tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
$check = tep_db_fetch_array($check_query);
|
||||
|
||||
if ($check['total'] > 0) {
|
||||
tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
}
|
||||
}
|
||||
|
||||
$messageStack->add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
}
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<script language="javascript"><!--
|
||||
function rowOverEffect(object) {
|
||||
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
|
||||
}
|
||||
|
||||
function rowOutEffect(object) {
|
||||
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
|
||||
}
|
||||
|
||||
function checkBox(object) {
|
||||
document.account_notifications.elements[object].checked = !document.account_notifications.elements[object].checked;
|
||||
}
|
||||
//--></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- body_text //-->
|
||||
<td width="100%" valign="top"><?php echo tep_draw_form('account_notifications', tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><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 tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main"><?php echo MY_NOTIFICATIONS_DESCRIPTION; ?></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('product_global')">
|
||||
<td class="main" width="30"><?php echo tep_draw_checkbox_field('product_global', '1', (($global['global_product_notifications'] == '1') ? true : false), 'onclick="checkBox(\'product_global\')"'); ?></td>
|
||||
<td class="main"><b><?php echo GLOBAL_NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td class="main"><?php echo GLOBAL_NOTIFICATIONS_DESCRIPTION; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($global['global_product_notifications'] != '1') {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo NOTIFICATIONS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$products_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
$products_check = tep_db_fetch_array($products_check_query);
|
||||
if ($products_check['total'] > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main" colspan="2"><?php echo NOTIFICATIONS_DESCRIPTION; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$counter = 0;
|
||||
$products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where pn.customers_id = '" . (int)$customer_id . "' and pn.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name");
|
||||
while ($products = tep_db_fetch_array($products_query)) {
|
||||
?>
|
||||
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="checkBox('products[<?php echo $counter; ?>]')">
|
||||
<td class="main" width="30"><?php echo tep_draw_checkbox_field('products[' . $counter . ']', $products['products_id'], true, 'onclick="checkBox(\'products[' . $counter . ']\')"'); ?></td>
|
||||
<td class="main"><b><?php echo $products['products_name']; ?></b></td>
|
||||
</tr>
|
||||
<?php
|
||||
$counter++;
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo NOTIFICATIONS_NON_EXISTING; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
183
src/catalog/account_password.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_password.php,v 1.1 2003/05/19 19:55:45 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
// needs to be included earlier to set the success message in the messageStack
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_PASSWORD);
|
||||
|
||||
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
|
||||
$password_current = tep_db_prepare_input($HTTP_POST_VARS['password_current']);
|
||||
$password_new = tep_db_prepare_input($HTTP_POST_VARS['password_new']);
|
||||
$password_confirmation = tep_db_prepare_input($HTTP_POST_VARS['password_confirmation']);
|
||||
|
||||
$error = false;
|
||||
|
||||
if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
|
||||
} elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
|
||||
} elseif ($password_new != $password_confirmation) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
|
||||
}
|
||||
|
||||
if ($error == false) {
|
||||
$check_customer_query = tep_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
|
||||
$check_customer = tep_db_fetch_array($check_customer_query);
|
||||
|
||||
if (tep_validate_password($password_current, $check_customer['customers_password'])) {
|
||||
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password_new) . "' where customers_id = '" . (int)$customer_id . "'");
|
||||
|
||||
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
|
||||
|
||||
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
} else {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<?php require('includes/form_check.js.php'); ?>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- body_text //-->
|
||||
<td width="100%" valign="top"><?php echo tep_draw_form('account_password', tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'), 'post', 'onSubmit="return check_form(account_password);"') . tep_draw_hidden_field('action', 'process'); ?><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 tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($messageStack->size('account_password') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('account_password'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo MY_PASSWORD_TITLE; ?></b></td>
|
||||
<td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_PASSWORD_CURRENT; ?></td>
|
||||
<td class="main"><?php echo tep_draw_password_field('password_current') . ' ' . (tep_not_null(ENTRY_PASSWORD_CURRENT_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CURRENT_TEXT . '</span>': ''); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_PASSWORD_NEW; ?></td>
|
||||
<td class="main"><?php echo tep_draw_password_field('password_new') . ' ' . (tep_not_null(ENTRY_PASSWORD_NEW_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_NEW_TEXT . '</span>': ''); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
|
||||
<td class="main"><?php echo tep_draw_password_field('password_confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
190
src/catalog/address_book.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: address_book.php,v 1.58 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK);
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<script language="javascript"><!--
|
||||
function rowOverEffect(object) {
|
||||
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
|
||||
}
|
||||
|
||||
function rowOutEffect(object) {
|
||||
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
|
||||
}
|
||||
//--></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_address_book.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($messageStack->size('addressbook') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('addressbook'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main" width="50%" valign="top"><?php echo PRIMARY_ADDRESS_DESCRIPTION; ?></td>
|
||||
<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" align="center" valign="top"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main" valign="top"><?php echo tep_address_label($customer_id, $customer_default_address_id, true, ' ', '<br>'); ?></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo ADDRESS_BOOK_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
$addresses_query = tep_db_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, entry_telephone as telephone from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' order by firstname, lastname");
|
||||
while ($addresses = tep_db_fetch_array($addresses_query)) {
|
||||
$format_id = tep_get_address_format_id($addresses['country_id']);
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'); ?>'">
|
||||
<td class="main"><b><?php echo tep_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b><?php if ($addresses['address_book_id'] == $customer_default_address_id) echo ' <small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
|
||||
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_edit.gif', SMALL_IMAGE_BUTTON_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . tep_image_button('small_delete.gif', SMALL_IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main"><?php echo tep_address_format($format_id, $addresses, true, ' ', '<br>'); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<?php
|
||||
if (tep_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) {
|
||||
?>
|
||||
<td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL') . '">' . tep_image_button('button_add_address.gif', IMAGE_BUTTON_ADD_ADDRESS) . '</a>'; ?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smallText"><?php echo sprintf(TEXT_MAXIMUM_ENTRIES, MAX_ADDRESS_BOOK_ENTRIES); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
405
src/catalog/address_book_process.php
Normal file
@ -0,0 +1,405 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: address_book_process.php,v 1.79 2003/06/09 23:03:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('customer_id')) {
|
||||
$navigation->set_snapshot();
|
||||
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
|
||||
}
|
||||
|
||||
// needs to be included earlier to set the success message in the messageStack
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
|
||||
|
||||
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'deleteconfirm') && isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
|
||||
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
|
||||
|
||||
$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
}
|
||||
|
||||
// error checking when updating or adding an entry
|
||||
$process = false;
|
||||
if (isset($HTTP_POST_VARS['action']) && (($HTTP_POST_VARS['action'] == 'process') || ($HTTP_POST_VARS['action'] == 'update'))) {
|
||||
$process = true;
|
||||
$error = false;
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
|
||||
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
|
||||
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
|
||||
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
|
||||
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
|
||||
if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
|
||||
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
|
||||
$city = tep_db_prepare_input($HTTP_POST_VARS['city']);
|
||||
$country = tep_db_prepare_input($HTTP_POST_VARS['country']);
|
||||
if (ACCOUNT_STATE == 'true') {
|
||||
if (isset($HTTP_POST_VARS['zone_id'])) {
|
||||
$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
|
||||
} else {
|
||||
$zone_id = false;
|
||||
}
|
||||
$state = tep_db_prepare_input($HTTP_POST_VARS['state']);
|
||||
}
|
||||
//Rodax Software begin
|
||||
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
|
||||
//Rodax Software end
|
||||
if (ACCOUNT_GENDER == 'true') {
|
||||
if ( ($gender != 'm') && ($gender != 'f') ) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_GENDER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_FIRST_NAME_ERROR);
|
||||
}
|
||||
|
||||
if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_LAST_NAME_ERROR);
|
||||
}
|
||||
|
||||
if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_STREET_ADDRESS_ERROR);
|
||||
}
|
||||
|
||||
if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_POST_CODE_ERROR);
|
||||
}
|
||||
|
||||
if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_CITY_ERROR);
|
||||
}
|
||||
|
||||
if (!is_numeric($country)) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_COUNTRY_ERROR);
|
||||
}
|
||||
|
||||
if (ACCOUNT_STATE == 'true') {
|
||||
$zone_id = 0;
|
||||
$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
|
||||
$check = tep_db_fetch_array($check_query);
|
||||
$entry_state_has_zones = ($check['total'] > 0);
|
||||
if ($entry_state_has_zones == true) {
|
||||
$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
|
||||
if (tep_db_num_rows($zone_query) == 1) {
|
||||
$zone = tep_db_fetch_array($zone_query);
|
||||
$zone_id = $zone['zone_id'];
|
||||
} else {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
|
||||
}
|
||||
} else {
|
||||
if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
|
||||
$error = true;
|
||||
|
||||
$messageStack->add('addressbook', ENTRY_STATE_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error == false) {
|
||||
$sql_data_array = array('entry_firstname' => $firstname,
|
||||
'entry_lastname' => $lastname,
|
||||
'entry_street_address' => $street_address,
|
||||
'entry_telephone' => $telephone, //Rodax Software
|
||||
'entry_postcode' => $postcode,
|
||||
'entry_city' => $city,
|
||||
'entry_country_id' => (int)$country);
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
|
||||
if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
|
||||
if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
|
||||
if (ACCOUNT_STATE == 'true') {
|
||||
if ($zone_id > 0) {
|
||||
$sql_data_array['entry_zone_id'] = (int)$zone_id;
|
||||
$sql_data_array['entry_state'] = '';
|
||||
} else {
|
||||
$sql_data_array['entry_zone_id'] = '0';
|
||||
$sql_data_array['entry_state'] = $state;
|
||||
}
|
||||
}
|
||||
|
||||
if ($HTTP_POST_VARS['action'] == 'update') {
|
||||
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id ='" . (int)$customer_id . "'");
|
||||
|
||||
// reregister session variables
|
||||
if ( (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) || ($HTTP_GET_VARS['edit'] == $customer_default_address_id) ) {
|
||||
$customer_first_name = $firstname;
|
||||
$customer_country_id = $country;
|
||||
$customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
|
||||
$customer_default_address_id = (int)$HTTP_GET_VARS['edit'];
|
||||
|
||||
$sql_data_array = array('customers_firstname' => $firstname,
|
||||
'customers_lastname' => $lastname,
|
||||
'customers_default_address_id' => (int)$HTTP_GET_VARS['edit']);
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
|
||||
|
||||
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
|
||||
}
|
||||
} else {
|
||||
$sql_data_array['customers_id'] = (int)$customer_id;
|
||||
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
|
||||
|
||||
$new_address_book_id = tep_db_insert_id();
|
||||
|
||||
// reregister session variables
|
||||
if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) {
|
||||
$customer_first_name = $firstname;
|
||||
$customer_country_id = $country;
|
||||
$customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
|
||||
if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $customer_default_address_id = $new_address_book_id;
|
||||
|
||||
$sql_data_array = array('customers_firstname' => $firstname,
|
||||
'customers_lastname' => $lastname);
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
|
||||
if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id;
|
||||
|
||||
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
|
||||
}
|
||||
}
|
||||
|
||||
$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
|
||||
$entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id, entry_telephone from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");
|
||||
|
||||
if (!tep_db_num_rows($entry_query)) {
|
||||
$messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
}
|
||||
|
||||
$entry = tep_db_fetch_array($entry_query);
|
||||
} elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
|
||||
if ($HTTP_GET_VARS['delete'] == $customer_default_address_id) {
|
||||
$messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
} else {
|
||||
$check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
|
||||
$check = tep_db_fetch_array($check_query);
|
||||
|
||||
if ($check['total'] < 1) {
|
||||
$messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$entry = array();
|
||||
}
|
||||
|
||||
if (!isset($HTTP_GET_VARS['delete']) && !isset($HTTP_GET_VARS['edit'])) {
|
||||
if (tep_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) {
|
||||
$messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL);
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
}
|
||||
}
|
||||
|
||||
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
|
||||
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
|
||||
|
||||
if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
|
||||
$breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $HTTP_GET_VARS['edit'], 'SSL'));
|
||||
} elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
|
||||
$breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'], 'SSL'));
|
||||
} else {
|
||||
$breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL'));
|
||||
}
|
||||
?>
|
||||
<!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>
|
||||
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="stylesheet.css">
|
||||
<?php
|
||||
if (!isset($HTTP_GET_VARS['delete'])) {
|
||||
include('includes/form_check.js.php');
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="3" cellpadding="3">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- body_text //-->
|
||||
<td width="100%" valign="top"><?php if (!isset($HTTP_GET_VARS['delete'])) echo tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, (isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post', 'onSubmit="return check_form(addressbook);"'); ?><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 if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_address_book.gif', (isset($HTTP_GET_VARS['edit']) ? HEADING_TITLE_MODIFY_ENTRY : HEADING_TITLE_ADD_ENTRY), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($messageStack->size('addressbook') > 0) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $messageStack->output('addressbook'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (isset($HTTP_GET_VARS['delete'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo DELETE_ADDRESS_TITLE; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main" width="50%" valign="top"><?php echo DELETE_ADDRESS_DESCRIPTION; ?></td>
|
||||
<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main" align="center" valign="top"><b><?php echo SELECTED_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td class="main" valign="top"><?php echo tep_address_label($customer_id, $HTTP_GET_VARS['delete'], true, ' ', '<br>'); ?></td>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] . '&action=deleteconfirm', 'SSL') . '">' . tep_image_button('button_delete.gif', IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php include(DIR_WS_MODULES . 'address_book_details.php'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('edit', $HTTP_GET_VARS['edit']) . tep_image_submit('button_update.gif', IMAGE_BUTTON_UPDATE); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
if (sizeof($navigation->snapshot) > 0) {
|
||||
$back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
|
||||
} else {
|
||||
$back_link = tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL');
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
|
||||
<tr class="infoBoxContents">
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
<td><?php echo '<a href="' . $back_link . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
|
||||
<td align="right"><?php echo tep_draw_hidden_field('action', 'process') . tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
|
||||
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table><?php if (!isset($HTTP_GET_VARS['delete'])) echo '</form>'; ?></td>
|
||||
<!-- body_text_eof //-->
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
|
||||
<!-- right_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
|
||||
<!-- right_navigation_eof //-->
|
||||
</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'); ?>
|
||||
40
src/catalog/admin/.htaccess
Normal file
@ -0,0 +1,40 @@
|
||||
# $Id: .htaccess,v 1.1 2003/06/20 00:18:30 hpdl Exp $
|
||||
#
|
||||
# This is used with Apache WebServers
|
||||
#
|
||||
# For this to work, you must include the parameter 'Options' to
|
||||
# the AllowOverride configuration
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# <Directory "/usr/local/apache/htdocs">
|
||||
# AllowOverride Options
|
||||
# </Directory>
|
||||
#
|
||||
# 'All' with also work. (This configuration is in the
|
||||
# apache/conf/httpd.conf file)
|
||||
|
||||
# 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>
|
||||
|
||||
# If Search Engine Friendly URLs do not work, try enabling the
|
||||
# following Apache configuration parameter
|
||||
#
|
||||
# AcceptPathInfo On
|
||||
|
||||
# Fix certain PHP values
|
||||
# (commented out by default to prevent errors occuring on certain
|
||||
# servers)
|
||||
#
|
||||
#<IfModule mod_php4.c>
|
||||
# php_value session.use_trans_sid 0
|
||||
# php_value register_globals 1
|
||||
#</IfModule>
|
||||
37
src/catalog/admin/SearchSuggest.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
This is the back-end PHP file for the osCommerce AJAX Search Suggest
|
||||
|
||||
You may use this code in your own projects as long as this
|
||||
copyright is left in place. All code is provided AS-IS.
|
||||
This code is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
The complete tutorial on how this works can be found at:
|
||||
http://www.dynamicajax.com/fr/AJAX_Suggest_Tutorial-271_290_312.html
|
||||
|
||||
For more AJAX code and tutorials visit http://www.DynamicAJAX.com
|
||||
For more osCommerce related tutorials and code examples visit http://www.osCommerce-SSL.com
|
||||
|
||||
Copyright 2006 Ryan Smith / 345 Technical / 345 Group.
|
||||
*/
|
||||
include('includes/application_top.php');
|
||||
$sql = "select * from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS . " p on pd.products_id = p.products_id WHERE p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and pd.products_name like('%" . tep_db_input($_GET['search']) . "%') LIMIT 15";
|
||||
$product_query = tep_db_query($sql);
|
||||
?>
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<?php
|
||||
|
||||
while($product_array = tep_db_fetch_array($product_query)) {
|
||||
?><tr>
|
||||
<td><?php
|
||||
echo '<a href="edit_orders.php?action=add_product&oID=' . $_GET['oid'] .'&step=3&add_product_products_id='. $product_array['products_id'] . '"> ' . $product_array['products_quantity'] . '</a></td><td>';
|
||||
echo '<a href="edit_orders.php?action=add_product&oID=' . $_GET['oid'] .'&step=3&add_product_products_id='. $product_array['products_id'] . '"> ' . $product_array['products_name'] . '</a>' . "\n";
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
494
src/catalog/admin/backup.php
Normal file
@ -0,0 +1,494 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: backup.php,v 1.60 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'forget':
|
||||
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
|
||||
|
||||
$messageStack->add_session(SUCCESS_LAST_RESTORE_CLEARED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BACKUP));
|
||||
break;
|
||||
case 'backupnow':
|
||||
tep_set_time_limit(0);
|
||||
$backup_file = 'db_' . DB_DATABASE . '-' . date('YmdHis') . '.sql';
|
||||
$fp = fopen(DIR_FS_BACKUP . $backup_file, 'w');
|
||||
|
||||
$schema = '# osCommerce, Open Source E-Commerce Solutions' . "\n" .
|
||||
'# http://www.oscommerce.com' . "\n" .
|
||||
'#' . "\n" .
|
||||
'# Database Backup For ' . STORE_NAME . "\n" .
|
||||
'# Copyright (c) ' . date('Y') . ' ' . STORE_OWNER . "\n" .
|
||||
'#' . "\n" .
|
||||
'# Database: ' . DB_DATABASE . "\n" .
|
||||
'# Database Server: ' . DB_SERVER . "\n" .
|
||||
'#' . "\n" .
|
||||
'# Backup Date: ' . date(PHP_DATE_TIME_FORMAT) . "\n\n";
|
||||
fputs($fp, $schema);
|
||||
|
||||
$tables_query = tep_db_query('show tables');
|
||||
while ($tables = tep_db_fetch_array($tables_query)) {
|
||||
list(,$table) = each($tables);
|
||||
|
||||
$schema = 'drop table if exists ' . $table . ';' . "\n" .
|
||||
'create table ' . $table . ' (' . "\n";
|
||||
|
||||
$table_list = array();
|
||||
$fields_query = tep_db_query("show fields from " . $table);
|
||||
while ($fields = tep_db_fetch_array($fields_query)) {
|
||||
$table_list[] = $fields['Field'];
|
||||
|
||||
$schema .= ' ' . $fields['Field'] . ' ' . $fields['Type'];
|
||||
|
||||
if (strlen($fields['Default']) > 0) $schema .= ' default \'' . $fields['Default'] . '\'';
|
||||
|
||||
if ($fields['Null'] != 'YES') $schema .= ' not null';
|
||||
|
||||
if (isset($fields['Extra'])) $schema .= ' ' . $fields['Extra'];
|
||||
|
||||
$schema .= ',' . "\n";
|
||||
}
|
||||
|
||||
$schema = ereg_replace(",\n$", '', $schema);
|
||||
|
||||
// add the keys
|
||||
$index = array();
|
||||
$keys_query = tep_db_query("show keys from " . $table);
|
||||
while ($keys = tep_db_fetch_array($keys_query)) {
|
||||
$kname = $keys['Key_name'];
|
||||
|
||||
if (!isset($index[$kname])) {
|
||||
$index[$kname] = array('unique' => !$keys['Non_unique'],
|
||||
'columns' => array());
|
||||
}
|
||||
|
||||
$index[$kname]['columns'][] = $keys['Column_name'];
|
||||
}
|
||||
|
||||
while (list($kname, $info) = each($index)) {
|
||||
$schema .= ',' . "\n";
|
||||
|
||||
$columns = implode($info['columns'], ', ');
|
||||
|
||||
if ($kname == 'PRIMARY') {
|
||||
$schema .= ' PRIMARY KEY (' . $columns . ')';
|
||||
} elseif ($info['unique']) {
|
||||
$schema .= ' UNIQUE ' . $kname . ' (' . $columns . ')';
|
||||
} else {
|
||||
$schema .= ' KEY ' . $kname . ' (' . $columns . ')';
|
||||
}
|
||||
}
|
||||
|
||||
$schema .= "\n" . ');' . "\n\n";
|
||||
fputs($fp, $schema);
|
||||
|
||||
// dump the data
|
||||
$rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table);
|
||||
while ($rows = tep_db_fetch_array($rows_query)) {
|
||||
$schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values (';
|
||||
|
||||
reset($table_list);
|
||||
while (list(,$i) = each($table_list)) {
|
||||
if (!isset($rows[$i])) {
|
||||
$schema .= 'NULL, ';
|
||||
} elseif (tep_not_null($rows[$i])) {
|
||||
$row = addslashes($rows[$i]);
|
||||
$row = ereg_replace("\n#", "\n".'\#', $row);
|
||||
|
||||
$schema .= '\'' . $row . '\', ';
|
||||
} else {
|
||||
$schema .= '\'\', ';
|
||||
}
|
||||
}
|
||||
|
||||
$schema = ereg_replace(', $', '', $schema) . ');' . "\n";
|
||||
fputs($fp, $schema);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
if (isset($HTTP_POST_VARS['download']) && ($HTTP_POST_VARS['download'] == 'yes')) {
|
||||
switch ($HTTP_POST_VARS['compress']) {
|
||||
case 'gzip':
|
||||
exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
|
||||
$backup_file .= '.gz';
|
||||
break;
|
||||
case 'zip':
|
||||
exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
|
||||
unlink(DIR_FS_BACKUP . $backup_file);
|
||||
$backup_file .= '.zip';
|
||||
}
|
||||
header('Content-type: application/x-octet-stream');
|
||||
header('Content-disposition: attachment; filename=' . $backup_file);
|
||||
|
||||
readfile(DIR_FS_BACKUP . $backup_file);
|
||||
unlink(DIR_FS_BACKUP . $backup_file);
|
||||
|
||||
exit;
|
||||
} else {
|
||||
switch ($HTTP_POST_VARS['compress']) {
|
||||
case 'gzip':
|
||||
exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file);
|
||||
break;
|
||||
case 'zip':
|
||||
exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
|
||||
unlink(DIR_FS_BACKUP . $backup_file);
|
||||
}
|
||||
|
||||
$messageStack->add_session(SUCCESS_DATABASE_SAVED, 'success');
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BACKUP));
|
||||
break;
|
||||
case 'restorenow':
|
||||
case 'restorelocalnow':
|
||||
tep_set_time_limit(0);
|
||||
|
||||
if ($action == 'restorenow') {
|
||||
$read_from = $HTTP_GET_VARS['file'];
|
||||
|
||||
if (file_exists(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])) {
|
||||
$restore_file = DIR_FS_BACKUP . $HTTP_GET_VARS['file'];
|
||||
$extension = substr($HTTP_GET_VARS['file'], -3);
|
||||
|
||||
if ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) {
|
||||
switch ($extension) {
|
||||
case 'sql':
|
||||
$restore_from = $restore_file;
|
||||
$remove_raw = false;
|
||||
break;
|
||||
case '.gz':
|
||||
$restore_from = substr($restore_file, 0, -3);
|
||||
exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
|
||||
$remove_raw = true;
|
||||
break;
|
||||
case 'zip':
|
||||
$restore_from = substr($restore_file, 0, -4);
|
||||
exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . DIR_FS_BACKUP);
|
||||
$remove_raw = true;
|
||||
}
|
||||
|
||||
if (isset($restore_from) && file_exists($restore_from) && (filesize($restore_from) > 15000)) {
|
||||
$fd = fopen($restore_from, 'rb');
|
||||
$restore_query = fread($fd, filesize($restore_from));
|
||||
fclose($fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'restorelocalnow') {
|
||||
$sql_file = new upload('sql_file');
|
||||
|
||||
if ($sql_file->parse() == true) {
|
||||
$restore_query = fread(fopen($sql_file->tmp_filename, 'r'), filesize($sql_file->tmp_filename));
|
||||
$read_from = $sql_file->filename;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($restore_query)) {
|
||||
$sql_array = array();
|
||||
$sql_length = strlen($restore_query);
|
||||
$pos = strpos($restore_query, ';');
|
||||
for ($i=$pos; $i<$sql_length; $i++) {
|
||||
if ($restore_query[0] == '#') {
|
||||
$restore_query = ltrim(substr($restore_query, strpos($restore_query, "\n")));
|
||||
$sql_length = strlen($restore_query);
|
||||
$i = strpos($restore_query, ';')-1;
|
||||
continue;
|
||||
}
|
||||
if ($restore_query[($i+1)] == "\n") {
|
||||
for ($j=($i+2); $j<$sql_length; $j++) {
|
||||
if (trim($restore_query[$j]) != '') {
|
||||
$next = substr($restore_query, $j, 6);
|
||||
if ($next[0] == '#') {
|
||||
// find out where the break position is so we can remove this line (#comment line)
|
||||
for ($k=$j; $k<$sql_length; $k++) {
|
||||
if ($restore_query[$k] == "\n") break;
|
||||
}
|
||||
$query = substr($restore_query, 0, $i+1);
|
||||
$restore_query = substr($restore_query, $k);
|
||||
// join the query before the comment appeared, with the rest of the dump
|
||||
$restore_query = $query . $restore_query;
|
||||
$sql_length = strlen($restore_query);
|
||||
$i = strpos($restore_query, ';')-1;
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($next == '') { // get the last insert query
|
||||
$next = 'insert';
|
||||
}
|
||||
if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) {
|
||||
$next = '';
|
||||
$sql_array[] = substr($restore_query, 0, $i);
|
||||
$restore_query = ltrim(substr($restore_query, $i+1));
|
||||
$sql_length = strlen($restore_query);
|
||||
$i = strpos($restore_query, ';')-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tep_db_query("drop table if exists address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones");
|
||||
|
||||
for ($i=0, $n=sizeof($sql_array); $i<$n; $i++) {
|
||||
tep_db_query($sql_array[$i]);
|
||||
}
|
||||
|
||||
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'");
|
||||
tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')");
|
||||
|
||||
if (isset($remove_raw) && ($remove_raw == true)) {
|
||||
unlink($restore_from);
|
||||
}
|
||||
|
||||
$messageStack->add_session(SUCCESS_DATABASE_RESTORED, 'success');
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BACKUP));
|
||||
break;
|
||||
case 'download':
|
||||
$extension = substr($HTTP_GET_VARS['file'], -3);
|
||||
|
||||
if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) {
|
||||
if ($fp = fopen(DIR_FS_BACKUP . $HTTP_GET_VARS['file'], 'rb')) {
|
||||
$buffer = fread($fp, filesize(DIR_FS_BACKUP . $HTTP_GET_VARS['file']));
|
||||
fclose($fp);
|
||||
|
||||
header('Content-type: application/x-octet-stream');
|
||||
header('Content-disposition: attachment; filename=' . $HTTP_GET_VARS['file']);
|
||||
|
||||
echo $buffer;
|
||||
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$messageStack->add(ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error');
|
||||
}
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
if (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP));
|
||||
|
||||
tep_remove(DIR_FS_BACKUP . '/' . $HTTP_GET_VARS['file']);
|
||||
|
||||
if (!$tep_remove_error) {
|
||||
$messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BACKUP));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the backup directory exists
|
||||
$dir_ok = false;
|
||||
if (is_dir(DIR_FS_BACKUP)) {
|
||||
if (is_writeable(DIR_FS_BACKUP)) {
|
||||
$dir_ok = true;
|
||||
} else {
|
||||
$messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
|
||||
}
|
||||
} else {
|
||||
$messageStack->add(ERROR_BACKUP_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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_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_TITLE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_FILE_DATE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_FILE_SIZE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($dir_ok == true) {
|
||||
$dir = dir(DIR_FS_BACKUP);
|
||||
$contents = array();
|
||||
while ($file = $dir->read()) {
|
||||
if (!is_dir(DIR_FS_BACKUP . $file)) {
|
||||
$contents[] = $file;
|
||||
}
|
||||
}
|
||||
sort($contents);
|
||||
|
||||
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
|
||||
$entry = $contents[$i];
|
||||
|
||||
$check = 0;
|
||||
|
||||
if ((!isset($HTTP_GET_VARS['file']) || (isset($HTTP_GET_VARS['file']) && ($HTTP_GET_VARS['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) {
|
||||
$file_array['file'] = $entry;
|
||||
$file_array['date'] = date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry));
|
||||
$file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . ' bytes';
|
||||
switch (substr($entry, -3)) {
|
||||
case 'zip': $file_array['compression'] = 'ZIP'; break;
|
||||
case '.gz': $file_array['compression'] = 'GZIP'; break;
|
||||
default: $file_array['compression'] = TEXT_NO_EXTENSION; break;
|
||||
}
|
||||
|
||||
$buInfo = new objectInfo($file_array);
|
||||
}
|
||||
|
||||
if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
|
||||
$onclick_link = 'file=' . $buInfo->file . '&action=restore';
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
|
||||
$onclick_link = 'file=' . $entry;
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=download&file=' . $entry) . '">' . tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a> ' . $entry; ?></td>
|
||||
<td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); ?></td>
|
||||
<td class="dataTableContent" align="right" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo number_format(filesize(DIR_FS_BACKUP . $entry)); ?> bytes</td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $entry) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$dir->close();
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="smallText" colspan="3"><?php echo TEXT_BACKUP_DIRECTORY . ' ' . DIR_FS_BACKUP; ?></td>
|
||||
<td align="right" class="smallText"><?php if ( ($action != 'backup') && (isset($dir)) ) echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=backup') . '">' . tep_image_button('button_backup.gif', IMAGE_BACKUP) . '</a>'; if ( ($action != 'restorelocal') && isset($dir) ) echo ' <a href="' . tep_href_link(FILENAME_BACKUP, 'action=restorelocal') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (defined('DB_LAST_RESTORE')) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="smallText" colspan="4"><?php echo TEXT_LAST_RESTORATION . ' ' . DB_LAST_RESTORE . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'action=forget') . '">' . TEXT_FORGET . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table></td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
switch ($action) {
|
||||
case 'backup':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_BACKUP . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('backup', FILENAME_BACKUP, 'action=backupnow'));
|
||||
$contents[] = array('text' => TEXT_INFO_NEW_BACKUP);
|
||||
|
||||
$contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'no', true) . ' ' . TEXT_INFO_USE_NO_COMPRESSION);
|
||||
if (file_exists(LOCAL_EXE_GZIP)) $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'gzip') . ' ' . TEXT_INFO_USE_GZIP);
|
||||
if (file_exists(LOCAL_EXE_ZIP)) $contents[] = array('text' => tep_draw_radio_field('compress', 'zip') . ' ' . TEXT_INFO_USE_ZIP);
|
||||
|
||||
if ($dir_ok == true) {
|
||||
$contents[] = array('text' => '<br>' . tep_draw_checkbox_field('download', 'yes') . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
|
||||
} else {
|
||||
$contents[] = array('text' => '<br>' . tep_draw_radio_field('download', 'yes', true) . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS);
|
||||
}
|
||||
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_backup.gif', IMAGE_BACKUP) . ' <a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'restore':
|
||||
$heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
|
||||
|
||||
$contents[] = array('text' => tep_break_string(sprintf(TEXT_INFO_RESTORE, DIR_FS_BACKUP . (($buInfo->compression != TEXT_NO_EXTENSION) ? substr($buInfo->file, 0, strrpos($buInfo->file, '.')) : $buInfo->file), ($buInfo->compression != TEXT_NO_EXTENSION) ? TEXT_INFO_UNPACK : ''), 35, ' '));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restorenow') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'restorelocal':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_RESTORE_LOCAL . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('restore', FILENAME_BACKUP, 'action=restorelocalnow', 'post', 'enctype="multipart/form-data"'));
|
||||
$contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL . '<br><br>' . TEXT_INFO_BEST_THROUGH_HTTPS);
|
||||
$contents[] = array('text' => '<br>' . tep_draw_file_field('sql_file'));
|
||||
$contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL_RAW_FILE);
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_restore.gif', IMAGE_RESTORE) . ' <a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'delete':
|
||||
$heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('delete', FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=deleteconfirm'));
|
||||
$contents[] = array('text' => TEXT_DELETE_INTRO);
|
||||
$contents[] = array('text' => '<br><b>' . $buInfo->file . '</b>');
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
default:
|
||||
if (isset($buInfo) && is_object($buInfo)) {
|
||||
$heading[] = array('text' => '<b>' . $buInfo->date . '</b>');
|
||||
|
||||
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restore') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE . ' ' . $buInfo->date);
|
||||
$contents[] = array('text' => TEXT_INFO_SIZE . ' ' . $buInfo->size);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COMPRESSION . ' ' . $buInfo->compression);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
466
src/catalog/admin/banner_manager.php
Normal file
@ -0,0 +1,466 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: banner_manager.php,v 1.73 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
$banner_extension = tep_banner_image_extension();
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'setflag':
|
||||
if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
|
||||
tep_set_banner_status($HTTP_GET_VARS['bID'], $HTTP_GET_VARS['flag']);
|
||||
|
||||
$messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success');
|
||||
} else {
|
||||
$messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']));
|
||||
break;
|
||||
case 'insert':
|
||||
case 'update':
|
||||
if (isset($HTTP_POST_VARS['banners_id'])) $banners_id = tep_db_prepare_input($HTTP_POST_VARS['banners_id']);
|
||||
$banners_title = tep_db_prepare_input($HTTP_POST_VARS['banners_title']);
|
||||
$banners_url = tep_db_prepare_input($HTTP_POST_VARS['banners_url']);
|
||||
$new_banners_group = tep_db_prepare_input($HTTP_POST_VARS['new_banners_group']);
|
||||
$banners_group = (empty($new_banners_group)) ? tep_db_prepare_input($HTTP_POST_VARS['banners_group']) : $new_banners_group;
|
||||
$banners_html_text = tep_db_prepare_input($HTTP_POST_VARS['banners_html_text']);
|
||||
$banners_image_local = tep_db_prepare_input($HTTP_POST_VARS['banners_image_local']);
|
||||
$banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['banners_image_target']);
|
||||
$db_image_location = '';
|
||||
$expires_date = tep_db_prepare_input($HTTP_POST_VARS['expires_date']);
|
||||
$expires_impressions = tep_db_prepare_input($HTTP_POST_VARS['expires_impressions']);
|
||||
$date_scheduled = tep_db_prepare_input($HTTP_POST_VARS['date_scheduled']);
|
||||
|
||||
$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) ) {
|
||||
$banner_error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($banner_error == false) {
|
||||
$db_image_location = (tep_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);
|
||||
|
||||
if ($action == 'insert') {
|
||||
$insert_sql_data = array('date_added' => 'now()',
|
||||
'status' => '1');
|
||||
|
||||
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
|
||||
|
||||
tep_db_perform(TABLE_BANNERS, $sql_data_array);
|
||||
|
||||
$banners_id = tep_db_insert_id();
|
||||
|
||||
$messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
|
||||
} elseif ($action == 'update') {
|
||||
tep_db_perform(TABLE_BANNERS, $sql_data_array, 'update', "banners_id = '" . (int)$banners_id . "'");
|
||||
|
||||
$messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
|
||||
}
|
||||
|
||||
if (tep_not_null($expires_date)) {
|
||||
list($day, $month, $year) = explode('/', $expires_date);
|
||||
|
||||
$expires_date = $year .
|
||||
((strlen($month) == 1) ? '0' . $month : $month) .
|
||||
((strlen($day) == 1) ? '0' . $day : $day);
|
||||
|
||||
tep_db_query("update " . TABLE_BANNERS . " set expires_date = '" . tep_db_input($expires_date) . "', expires_impressions = null where banners_id = '" . (int)$banners_id . "'");
|
||||
} elseif (tep_not_null($expires_impressions)) {
|
||||
tep_db_query("update " . TABLE_BANNERS . " set expires_impressions = '" . tep_db_input($expires_impressions) . "', expires_date = null where banners_id = '" . (int)$banners_id . "'");
|
||||
}
|
||||
|
||||
if (tep_not_null($date_scheduled)) {
|
||||
list($day, $month, $year) = explode('/', $date_scheduled);
|
||||
|
||||
$date_scheduled = $year .
|
||||
((strlen($month) == 1) ? '0' . $month : $month) .
|
||||
((strlen($day) == 1) ? '0' . $day : $day);
|
||||
|
||||
tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_scheduled = '" . tep_db_input($date_scheduled) . "' where banners_id = '" . (int)$banners_id . "'");
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'bID=' . $banners_id));
|
||||
} else {
|
||||
$action = 'new';
|
||||
}
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
$banners_id = tep_db_prepare_input($HTTP_GET_VARS['bID']);
|
||||
|
||||
if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) {
|
||||
$banner_query = tep_db_query("select banners_image from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");
|
||||
$banner = tep_db_fetch_array($banner_query);
|
||||
|
||||
if (is_file(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
|
||||
if (is_writeable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
|
||||
unlink(DIR_FS_CATALOG_IMAGES . $banner['banners_image']);
|
||||
} else {
|
||||
$messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
|
||||
}
|
||||
} else {
|
||||
$messageStack->add_session(ERROR_IMAGE_DOES_NOT_EXIST, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
tep_db_query("delete from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");
|
||||
tep_db_query("delete from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners_id . "'");
|
||||
|
||||
if (function_exists('imagecreate') && tep_not_null($banner_extensio)) {
|
||||
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');
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page']));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the graphs directory exists
|
||||
$dir_ok = false;
|
||||
if (function_exists('imagecreate') && tep_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">
|
||||
<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>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?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' => '');
|
||||
|
||||
$bInfo = new objectInfo($parameters);
|
||||
|
||||
if (isset($HTTP_GET_VARS['bID'])) {
|
||||
$form_action = 'update';
|
||||
|
||||
$bID = tep_db_prepare_input($HTTP_GET_VARS['bID']);
|
||||
|
||||
$banner_query = tep_db_query("select banners_title, banners_url, banners_image, banners_group, banners_html_text, status, date_format(date_scheduled, '%d/%m/%Y') as date_scheduled, date_format(expires_date, '%d/%m/%Y') as expires_date, expires_impressions, date_status_change from " . TABLE_BANNERS . " where banners_id = '" . (int)$bID . "'");
|
||||
$banner = tep_db_fetch_array($banner_query);
|
||||
|
||||
$bInfo->objectInfo($banner);
|
||||
} elseif (tep_not_null($HTTP_POST_VARS)) {
|
||||
$bInfo->objectInfo($HTTP_POST_VARS);
|
||||
}
|
||||
|
||||
$groups_array = array();
|
||||
$groups_query = tep_db_query("select distinct banners_group from " . TABLE_BANNERS . " order by banners_group");
|
||||
while ($groups = tep_db_fetch_array($groups_query)) {
|
||||
$groups_array[] = array('id' => $groups['banners_group'], 'text' => $groups['banners_group']);
|
||||
}
|
||||
?>
|
||||
<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 $bInfo->expires_date; ?>",scBTNMODE_CUSTOMBLUE);
|
||||
var dateScheduled = new ctlSpiffyCalendarBox("dateScheduled", "new_banner", "date_scheduled","btnDate2","<?php echo $bInfo->date_scheduled; ?>",scBTNMODE_CUSTOMBLUE);
|
||||
</script>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr><?php echo tep_draw_form('new_banner', FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'action=' . $form_action, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('banners_id', $bID); ?>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo TEXT_BANNERS_TITLE; ?></td>
|
||||
<td class="main"><?php echo tep_draw_input_field('banners_title', $bInfo->banners_title, '', true); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo TEXT_BANNERS_URL; ?></td>
|
||||
<td class="main"><?php echo tep_draw_input_field('banners_url', $bInfo->banners_url); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main" valign="top"><?php echo TEXT_BANNERS_GROUP; ?></td>
|
||||
<td class="main"><?php echo tep_draw_pull_down_menu('banners_group', $groups_array, $bInfo->banners_group) . TEXT_BANNERS_NEW_GROUP . '<br>' . tep_draw_input_field('new_banners_group', '', '', ((sizeof($groups_array) > 0) ? false : true)); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_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 tep_draw_file_field('banners_image') . ' ' . TEXT_BANNERS_IMAGE_LOCAL . '<br>' . DIR_FS_CATALOG_IMAGES . tep_draw_input_field('banners_image_local', (isset($bInfo->banners_image) ? $bInfo->banners_image : '')); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_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 . tep_draw_input_field('banners_image_target'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_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 tep_draw_textarea_field('banners_html_text', 'soft', '60', '5', $bInfo->banners_html_text); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo TEXT_BANNERS_SCHEDULED_AT; ?><br><small>(dd/mm/yyyy)</small></td>
|
||||
<td valign="top" class="main"><script language="javascript">dateScheduled.writeControl(); dateScheduled.dateFormat="dd/MM/yyyy";</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="main"><?php echo TEXT_BANNERS_EXPIRES_ON; ?><br><small>(dd/mm/yyyy)</small></td>
|
||||
<td class="main"><script language="javascript">dateExpires.writeControl(); dateExpires.dateFormat="dd/MM/yyyy";</script><?php echo TEXT_BANNERS_OR_AT . '<br>' . tep_draw_input_field('expires_impressions', $bInfo->expires_impressions, 'maxlength="7" size="7"') . ' ' . TEXT_BANNERS_IMPRESSIONS; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_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') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). ' <a href="' . tep_href_link(FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . (isset($HTTP_GET_VARS['bID']) ? 'bID=' . $HTTP_GET_VARS['bID'] : '')) . '">' . tep_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="right"><?php echo TABLE_HEADING_STATUS; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from " . TABLE_BANNERS . " order by banners_title, banners_group";
|
||||
$banners_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $banners_query_raw, $banners_query_numrows);
|
||||
$banners_query = tep_db_query($banners_query_raw);
|
||||
while ($banners = tep_db_fetch_array($banners_query)) {
|
||||
$info_query = tep_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banners['banners_id'] . "'");
|
||||
$info = tep_db_fetch_array($info_query);
|
||||
|
||||
if ((!isset($HTTP_GET_VARS['bID']) || (isset($HTTP_GET_VARS['bID']) && ($HTTP_GET_VARS['bID'] == $banners['banners_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$bInfo_array = array_merge($banners, $info);
|
||||
$bInfo = new objectInfo($bInfo_array);
|
||||
}
|
||||
|
||||
$banners_shown = ($info['banners_shown'] != '') ? $info['banners_shown'] : '0';
|
||||
$banners_clicked = ($info['banners_clicked'] != '') ? $info['banners_clicked'] : '0';
|
||||
|
||||
if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id) . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?banner=' . $banners['banners_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . '</a> ' . $banners['banners_title']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo $banners['banners_group']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo $banners_shown . ' / ' . $banners_clicked; ?></td>
|
||||
<td class="dataTableContent" align="right">
|
||||
<?php
|
||||
if ($banners['status'] == '1') {
|
||||
echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . ' <a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=0') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>';
|
||||
} else {
|
||||
echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id'] . '&action=setflag&flag=1') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10);
|
||||
}
|
||||
?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . '</a> '; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $banners['banners_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<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, $HTTP_GET_VARS['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, $HTTP_GET_VARS['page']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'action=new') . '">' . tep_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' => tep_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['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>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']) . '">' . tep_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="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($bInfo->date_added));
|
||||
|
||||
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>' . tep_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>' . tep_banner_graph_infoBox($bInfo->banners_id, '3'));
|
||||
}
|
||||
|
||||
$contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . '<br>' . tep_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, tep_date_short($bInfo->date_scheduled)));
|
||||
|
||||
if ($bInfo->expires_date) {
|
||||
$contents[] = array('text' => '<br>' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, tep_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, tep_date_short($bInfo->date_status_change)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
179
src/catalog/admin/banner_statistics.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: banner_statistics.php,v 1.5 2003/06/20 00:30:15 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$type = (isset($HTTP_GET_VARS['type']) ? $HTTP_GET_VARS['type'] : '');
|
||||
|
||||
$banner_extension = tep_banner_image_extension();
|
||||
|
||||
// check if the graphs directory exists
|
||||
$dir_ok = false;
|
||||
if (function_exists('imagecreate') && tep_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_query = tep_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'");
|
||||
$banner = tep_db_fetch_array($banner_query);
|
||||
|
||||
$years_array = array();
|
||||
$years_query = tep_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'");
|
||||
while ($years = tep_db_fetch_array($years_query)) {
|
||||
$years_array[] = array('id' => $years['banner_year'],
|
||||
'text' => $years['banner_year']);
|
||||
}
|
||||
|
||||
$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">
|
||||
</head>
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_draw_form('year', FILENAME_BANNER_STATISTICS, '', 'get'); ?>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
|
||||
<td class="main" align="right"><?php echo TITLE_TYPE . ' ' . tep_draw_pull_down_menu('type', $type_array, (tep_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 . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
|
||||
break;
|
||||
default:
|
||||
case 'daily':
|
||||
echo TITLE_MONTH . ' ' . tep_draw_pull_down_menu('month', $months_array, (isset($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript><br>' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onChange="this.form.submit();"') . '<noscript><input type="submit" value="GO"></noscript>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php echo tep_draw_hidden_field('page', $HTTP_GET_VARS['page']) . tep_draw_hidden_field('bID', $HTTP_GET_VARS['bID']); ?></form></tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<?php
|
||||
if (function_exists('imagecreate') && ($dir_ok == true) && tep_not_null($banner_extension)) {
|
||||
$banner_id = (int)$HTTP_GET_VARS['bID'];
|
||||
|
||||
switch ($type) {
|
||||
case 'yearly':
|
||||
include(DIR_WS_INCLUDES . 'graphs/banner_yearly.php');
|
||||
echo tep_image(DIR_WS_IMAGES . 'graphs/banner_yearly-' . $banner_id . '.' . $banner_extension);
|
||||
break;
|
||||
case 'monthly':
|
||||
include(DIR_WS_INCLUDES . 'graphs/banner_monthly.php');
|
||||
echo tep_image(DIR_WS_IMAGES . 'graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
|
||||
break;
|
||||
default:
|
||||
case 'daily':
|
||||
include(DIR_WS_INCLUDES . 'graphs/banner_daily.php');
|
||||
echo tep_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 tep_banner_graph_yearly($HTTP_GET_VARS['bID']);
|
||||
break;
|
||||
case 'monthly':
|
||||
echo tep_banner_graph_monthly($HTTP_GET_VARS['bID']);
|
||||
break;
|
||||
default:
|
||||
case 'daily':
|
||||
echo tep_banner_graph_daily($HTTP_GET_VARS['bID']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']) . '">' . tep_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'); ?>
|
||||
131
src/catalog/admin/cache.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: cache.php,v 1.23 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
if ($action == 'reset') {
|
||||
tep_reset_cache_block($HTTP_GET_VARS['block']);
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CACHE));
|
||||
}
|
||||
|
||||
// check if the cache directory exists
|
||||
if (is_dir(DIR_FS_CACHE)) {
|
||||
if (!is_writeable(DIR_FS_CACHE)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
|
||||
} else {
|
||||
$messageStack->add(ERROR_CACHE_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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_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_CACHE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_CREATED; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($messageStack->size < 1) {
|
||||
$languages = tep_get_languages();
|
||||
|
||||
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
|
||||
if ($languages[$i]['code'] == DEFAULT_LANGUAGE) {
|
||||
$language = $languages[$i]['directory'];
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
|
||||
$cached_file = ereg_replace('-language', '-' . $language, $cache_blocks[$i]['file']);
|
||||
|
||||
if (file_exists(DIR_FS_CACHE . $cached_file)) {
|
||||
$cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cached_file));
|
||||
} else {
|
||||
$cache_mtime = TEXT_FILE_DOES_NOT_EXIST;
|
||||
$dir = dir(DIR_FS_CACHE);
|
||||
|
||||
while ($cache_file = $dir->read()) {
|
||||
$cached_file = ereg_replace('-language', '-' . $language, $cache_blocks[$i]['file']);
|
||||
|
||||
if (ereg('^' . $cached_file, $cache_file)) {
|
||||
$cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cache_file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$dir->close();
|
||||
}
|
||||
?>
|
||||
<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
|
||||
<td class="dataTableContent"><?php echo $cache_blocks[$i]['title']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo $cache_mtime; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CACHE, 'action=reset&block=' . $cache_blocks[$i]['code'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_reset.gif', 'Reset', 13, 13) . '</a>'; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="smallText" colspan="3"><?php echo TEXT_CACHE_DIRECTORY . ' ' . DIR_FS_CACHE; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</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'); ?>
|
||||
1025
src/catalog/admin/categories.php
Normal file
171
src/catalog/admin/configuration.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: configuration.php,v 1.43 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'save':
|
||||
$configuration_value = tep_db_prepare_input($HTTP_POST_VARS['configuration_value']);
|
||||
$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
|
||||
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$gID = (isset($HTTP_GET_VARS['gID'])) ? $HTTP_GET_VARS['gID'] : 1;
|
||||
|
||||
$cfg_group_query = tep_db_query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . (int)$gID . "'");
|
||||
$cfg_group = tep_db_fetch_array($cfg_group_query);
|
||||
?>
|
||||
<!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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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['configuration_group_title']; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_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_CONFIGURATION_TITLE; ?></td>
|
||||
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");
|
||||
while ($configuration = tep_db_fetch_array($configuration_query)) {
|
||||
if (tep_not_null($configuration['use_function'])) {
|
||||
$use_function = $configuration['use_function'];
|
||||
if (ereg('->', $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 = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
|
||||
} else {
|
||||
$cfgValue = tep_call_function($use_function, $configuration['configuration_value']);
|
||||
}
|
||||
} else {
|
||||
$cfgValue = $configuration['configuration_value'];
|
||||
}
|
||||
|
||||
if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $configuration['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$cfg_extra_query = tep_db_query("select configuration_key, configuration_description, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . (int)$configuration['configuration_id'] . "'");
|
||||
$cfg_extra = tep_db_fetch_array($cfg_extra_query);
|
||||
|
||||
$cInfo_array = array_merge($configuration, $cfg_extra);
|
||||
$cInfo = new objectInfo($cInfo_array);
|
||||
}
|
||||
|
||||
if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo $configuration['configuration_title']; ?></td>
|
||||
<td class="dataTableContent"><?php echo htmlspecialchars($cfgValue); ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration['configuration_id'] == $cInfo->configuration_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $configuration['configuration_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</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 = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
|
||||
}
|
||||
|
||||
$contents = array('form' => tep_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
|
||||
$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>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
default:
|
||||
if (isset($cInfo) && is_object($cInfo)) {
|
||||
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
|
||||
|
||||
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . $cInfo->configuration_description);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
|
||||
if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
203
src/catalog/admin/countries.php
Normal file
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: countries.php,v 1.28 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'insert':
|
||||
$countries_name = tep_db_prepare_input($HTTP_POST_VARS['countries_name']);
|
||||
$countries_iso_code_2 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_2']);
|
||||
$countries_iso_code_3 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_3']);
|
||||
$address_format_id = tep_db_prepare_input($HTTP_POST_VARS['address_format_id']);
|
||||
|
||||
tep_db_query("insert into " . TABLE_COUNTRIES . " (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) values ('" . tep_db_input($countries_name) . "', '" . tep_db_input($countries_iso_code_2) . "', '" . tep_db_input($countries_iso_code_3) . "', '" . (int)$address_format_id . "')");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_COUNTRIES));
|
||||
break;
|
||||
case 'save':
|
||||
$countries_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
$countries_name = tep_db_prepare_input($HTTP_POST_VARS['countries_name']);
|
||||
$countries_iso_code_2 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_2']);
|
||||
$countries_iso_code_3 = tep_db_prepare_input($HTTP_POST_VARS['countries_iso_code_3']);
|
||||
$address_format_id = tep_db_prepare_input($HTTP_POST_VARS['address_format_id']);
|
||||
|
||||
tep_db_query("update " . TABLE_COUNTRIES . " set countries_name = '" . tep_db_input($countries_name) . "', countries_iso_code_2 = '" . tep_db_input($countries_iso_code_2) . "', countries_iso_code_3 = '" . tep_db_input($countries_iso_code_3) . "', address_format_id = '" . (int)$address_format_id . "' where countries_id = '" . (int)$countries_id . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries_id));
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
$countries_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
|
||||
tep_db_query("delete from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_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; ?> </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($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $countries_query_raw, $countries_query_numrows);
|
||||
$countries_query = tep_db_query($countries_query_raw);
|
||||
while ($countries = tep_db_fetch_array($countries_query)) {
|
||||
if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $countries['countries_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$cInfo = new objectInfo($countries);
|
||||
}
|
||||
|
||||
if (isset($cInfo) && is_object($cInfo) && ($countries['countries_id'] == $cInfo->countries_id)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries['countries_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo $countries['countries_name']; ?></td>
|
||||
<td class="dataTableContent" align="center" width="40"><?php echo $countries['countries_iso_code_2']; ?></td>
|
||||
<td class="dataTableContent" align="center" width="40"><?php echo $countries['countries_iso_code_3']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($countries['countries_id'] == $cInfo->countries_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $countries['countries_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<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, $HTTP_GET_VARS['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, $HTTP_GET_VARS['page']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (empty($action)) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_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' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert'));
|
||||
$contents[] = array('text' => TEXT_INFO_INSERT_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_input_field('countries_name'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . tep_draw_input_field('countries_iso_code_2'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . tep_draw_input_field('countries_iso_code_3'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . tep_draw_pull_down_menu('address_format_id', tep_get_address_formats()));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'edit':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_COUNTRY . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=save'));
|
||||
$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_NAME . '<br>' . tep_draw_input_field('countries_name', $cInfo->countries_name));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_2 . '<br>' . tep_draw_input_field('countries_iso_code_2', $cInfo->countries_iso_code_2));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_CODE_3 . '<br>' . tep_draw_input_field('countries_iso_code_3', $cInfo->countries_iso_code_3));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ADDRESS_FORMAT . '<br>' . tep_draw_pull_down_menu('address_format_id', tep_get_address_formats(), $cInfo->address_format_id));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'delete':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_COUNTRY . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('countries', FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['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>' . tep_image_submit('button_delete.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id) . '">' . tep_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="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_COUNTRIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->countries_id . '&action=delete') . '">' . tep_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 ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
1
src/catalog/admin/create_order.php
Normal file
158
src/catalog/admin/create_order_process.php
Normal file
@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: account_edit_process.php,v 1.2 2002/11/28 23:39:44 wilt Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ORDER_PROCESS);
|
||||
// if ($HTTP_POST_VARS['action'] != 'process') {
|
||||
// tep_redirect(tep_href_link(FILENAME_CREATE_ORDER, '', 'SSL'));
|
||||
//}
|
||||
$customer_id = tep_db_prepare_input($HTTP_POST_VARS['customers_id']);
|
||||
$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
|
||||
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
|
||||
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
|
||||
$dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
|
||||
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
|
||||
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
|
||||
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
|
||||
$newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
|
||||
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
|
||||
$confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);
|
||||
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
|
||||
$company = tep_db_prepare_input($HTTP_POST_VARS['company']);
|
||||
$suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
|
||||
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
|
||||
$city = tep_db_prepare_input($HTTP_POST_VARS['city']);
|
||||
$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
|
||||
$state = tep_db_prepare_input($HTTP_POST_VARS['state']);
|
||||
$country = tep_db_prepare_input($HTTP_POST_VARS['country']);
|
||||
$format_id = "1";
|
||||
$size = "1";
|
||||
$payment_method = DEFAULT_PAYMENT_METHOD;
|
||||
$new_value = "1";
|
||||
$error = false; // reset error flag
|
||||
$temp_amount = "0";
|
||||
$temp_amount = number_format($temp_amount, 2, '.', '');
|
||||
|
||||
$currency_text = DEFAULT_CURRENCY . ", 1";
|
||||
if(IsSet($HTTP_POST_VARS['Currency']))
|
||||
{
|
||||
$currency_text = tep_db_prepare_input($HTTP_POST_VARS['Currency']);
|
||||
}
|
||||
|
||||
$currency_array = explode(",", $currency_text);
|
||||
|
||||
$currency = $currency_array[0];
|
||||
$currency_value = $currency_array[1];
|
||||
?>
|
||||
<?php
|
||||
|
||||
$sql_data_array = array('customers_id' => $customer_id,
|
||||
'customers_name' => $firstname . ' ' . $lastname,
|
||||
'customers_company' => $company,
|
||||
'customers_street_address' => $street_address,
|
||||
'customers_suburb' => $suburb,
|
||||
'customers_city' => $city,
|
||||
'customers_postcode' => $postcode,
|
||||
'customers_state' => $state,
|
||||
'customers_country' => $country,
|
||||
'customers_telephone' => $telephone,
|
||||
'customers_email_address' => $email_address,
|
||||
'customers_address_format_id' => $format_id,
|
||||
'delivery_name' => $firstname . ' ' . $lastname,
|
||||
'delivery_company' => $company,
|
||||
'delivery_street_address' => $street_address,
|
||||
'delivery_suburb' => $suburb,
|
||||
'delivery_city' => $city,
|
||||
'delivery_postcode' => $postcode,
|
||||
'delivery_state' => $state,
|
||||
'delivery_country' => $country,
|
||||
'delivery_address_format_id' => $format_id,
|
||||
'billing_name' => $firstname . ' ' . $lastname,
|
||||
'billing_company' => $company,
|
||||
'billing_street_address' => $street_address,
|
||||
'billing_suburb' => $suburb,
|
||||
'billing_city' => $city,
|
||||
'billing_postcode' => $postcode,
|
||||
'billing_state' => $state,
|
||||
'billing_country' => $country,
|
||||
'billing_address_format_id' => $format_id,
|
||||
'date_purchased' => 'now()',
|
||||
'orders_status' => DEFAULT_ORDERS_STATUS_ID,
|
||||
'currency' => $currency,
|
||||
'currency_value' => $currency_value,
|
||||
'payment_method' => $payment_method
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//old
|
||||
tep_db_perform(TABLE_ORDERS, $sql_data_array);
|
||||
$insert_id = tep_db_insert_id();
|
||||
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
//Comment out line you don't need
|
||||
//'new_value' => $new_value, //for 2.2
|
||||
'orders_status_id' => $new_value, //for MS1 or MS2
|
||||
'date_added' => 'now()');
|
||||
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
|
||||
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
'title' => TEXT_SUBTOTAL,
|
||||
'text' => $temp_amount,
|
||||
'value' => "0.00",
|
||||
'class' => "ot_subtotal",
|
||||
'sort_order' => "1");
|
||||
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
|
||||
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
'title' => TEXT_DISCOUNT,
|
||||
'text' => $temp_amount,
|
||||
'value' => "0.00",
|
||||
'class' => "ot_customer_discount",
|
||||
'sort_order' => "2");
|
||||
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
'title' => TEXT_DELIVERY,
|
||||
'text' => $temp_amount,
|
||||
'value' => "0.00",
|
||||
'class' => "ot_shipping",
|
||||
'sort_order' => "3");
|
||||
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
'title' => TEXT_TAX,
|
||||
'text' => $temp_amount,
|
||||
'value' => "0.00",
|
||||
'class' => "ot_tax",
|
||||
'sort_order' => "4");
|
||||
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
|
||||
|
||||
$sql_data_array = array('orders_id' => $insert_id,
|
||||
'title' => TEXT_TOTAL,
|
||||
'text' => $temp_amount,
|
||||
'value' => "0.00",
|
||||
'class' => "ot_total",
|
||||
'sort_order' => "5");
|
||||
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
|
||||
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $insert_id, 'SSL'));
|
||||
|
||||
|
||||
require(DIR_WS_INCLUDES . 'application_bottom.php');
|
||||
?>
|
||||
288
src/catalog/admin/currencies.php
Normal file
@ -0,0 +1,288 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: currencies.php,v 1.49 2003/06/29 22:50:51 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
require(DIR_WS_CLASSES . 'currencies.php');
|
||||
$currencies = new currencies();
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'insert':
|
||||
case 'save':
|
||||
if (isset($HTTP_GET_VARS['cID'])) $currency_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
$title = tep_db_prepare_input($HTTP_POST_VARS['title']);
|
||||
$code = tep_db_prepare_input($HTTP_POST_VARS['code']);
|
||||
$symbol_left = tep_db_prepare_input($HTTP_POST_VARS['symbol_left']);
|
||||
$symbol_right = tep_db_prepare_input($HTTP_POST_VARS['symbol_right']);
|
||||
$decimal_point = tep_db_prepare_input($HTTP_POST_VARS['decimal_point']);
|
||||
$thousands_point = tep_db_prepare_input($HTTP_POST_VARS['thousands_point']);
|
||||
$decimal_places = tep_db_prepare_input($HTTP_POST_VARS['decimal_places']);
|
||||
$value = tep_db_prepare_input($HTTP_POST_VARS['value']);
|
||||
|
||||
$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') {
|
||||
tep_db_perform(TABLE_CURRENCIES, $sql_data_array);
|
||||
$currency_id = tep_db_insert_id();
|
||||
} elseif ($action == 'save') {
|
||||
tep_db_perform(TABLE_CURRENCIES, $sql_data_array, 'update', "currencies_id = '" . (int)$currency_id . "'");
|
||||
}
|
||||
|
||||
if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) {
|
||||
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_CURRENCY'");
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency_id));
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
$currencies_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
|
||||
$currency_query = tep_db_query("select currencies_id from " . TABLE_CURRENCIES . " where code = '" . DEFAULT_CURRENCY . "'");
|
||||
$currency = tep_db_fetch_array($currency_query);
|
||||
|
||||
if ($currency['currencies_id'] == $currencies_id) {
|
||||
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '' where configuration_key = 'DEFAULT_CURRENCY'");
|
||||
}
|
||||
|
||||
tep_db_query("delete from " . TABLE_CURRENCIES . " where currencies_id = '" . (int)$currencies_id . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page']));
|
||||
break;
|
||||
case 'update':
|
||||
$server_used = CURRENCY_SERVER_PRIMARY;
|
||||
|
||||
$currency_query = tep_db_query("select currencies_id, code, title from " . TABLE_CURRENCIES);
|
||||
while ($currency = tep_db_fetch_array($currency_query)) {
|
||||
$quote_function = 'quote_' . CURRENCY_SERVER_PRIMARY . '_currency';
|
||||
$rate = $quote_function($currency['code']);
|
||||
|
||||
if (empty($rate) && (tep_not_null(CURRENCY_SERVER_BACKUP))) {
|
||||
$messageStack->add_session(sprintf(WARNING_PRIMARY_SERVER_FAILED, CURRENCY_SERVER_PRIMARY, $currency['title'], $currency['code']), 'warning');
|
||||
|
||||
$quote_function = 'quote_' . CURRENCY_SERVER_BACKUP . '_currency';
|
||||
$rate = $quote_function($currency['code']);
|
||||
|
||||
$server_used = CURRENCY_SERVER_BACKUP;
|
||||
}
|
||||
|
||||
if (tep_not_null($rate)) {
|
||||
tep_db_query("update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . (int)$currency['currencies_id'] . "'");
|
||||
|
||||
$messageStack->add_session(sprintf(TEXT_INFO_CURRENCY_UPDATED, $currency['title'], $currency['code'], $server_used), 'success');
|
||||
} else {
|
||||
$messageStack->add_session(sprintf(ERROR_CURRENCY_INVALID, $currency['title'], $currency['code'], $server_used), 'error');
|
||||
}
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $HTTP_GET_VARS['cID']));
|
||||
break;
|
||||
case 'delete':
|
||||
$currencies_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
|
||||
$currency_query = tep_db_query("select code from " . TABLE_CURRENCIES . " where currencies_id = '" . (int)$currencies_id . "'");
|
||||
$currency = tep_db_fetch_array($currency_query);
|
||||
|
||||
$remove_currency = true;
|
||||
if ($currency['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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_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; ?> </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($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $currency_query_raw, $currency_query_numrows);
|
||||
$currency_query = tep_db_query($currency_query_raw);
|
||||
while ($currency = tep_db_fetch_array($currency_query)) {
|
||||
if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $currency['currencies_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$cInfo = new objectInfo($currency);
|
||||
}
|
||||
|
||||
if (isset($cInfo) && is_object($cInfo) && ($currency['currencies_id'] == $cInfo->currencies_id) ) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency['currencies_id']) . '\'">' . "\n";
|
||||
}
|
||||
|
||||
if (DEFAULT_CURRENCY == $currency['code']) {
|
||||
echo ' <td class="dataTableContent"><b>' . $currency['title'] . ' (' . TEXT_DEFAULT . ')</b></td>' . "\n";
|
||||
} else {
|
||||
echo ' <td class="dataTableContent">' . $currency['title'] . '</td>' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo $currency['code']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo number_format($currency['value'], 8); ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($currency['currencies_id'] == $cInfo->currencies_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $currency['currencies_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<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, $HTTP_GET_VARS['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, $HTTP_GET_VARS['page']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (empty($action)) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php if (CURRENCY_SERVER_PRIMARY) { echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=update') . '">' . tep_image_button('button_update_currencies.gif', IMAGE_UPDATE_CURRENCIES) . '</a>'; } ?></td>
|
||||
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=new') . '">' . tep_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' => tep_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['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>' . tep_draw_input_field('title'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . tep_draw_input_field('code'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . tep_draw_input_field('symbol_left'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . tep_draw_input_field('symbol_right'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . tep_draw_input_field('decimal_point'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . tep_draw_input_field('thousands_point'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . tep_draw_input_field('decimal_places'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . tep_draw_input_field('value'));
|
||||
$contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $HTTP_GET_VARS['cID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'edit':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CURRENCY . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('currencies', FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=save'));
|
||||
$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_TITLE . '<br>' . tep_draw_input_field('title', $cInfo->title));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_CODE . '<br>' . tep_draw_input_field('code', $cInfo->code));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . '<br>' . tep_draw_input_field('symbol_left', $cInfo->symbol_left));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_SYMBOL_RIGHT . '<br>' . tep_draw_input_field('symbol_right', $cInfo->symbol_right));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_POINT . '<br>' . tep_draw_input_field('decimal_point', $cInfo->decimal_point));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_THOUSANDS_POINT . '<br>' . tep_draw_input_field('thousands_point', $cInfo->thousands_point));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_DECIMAL_PLACES . '<br>' . tep_draw_input_field('decimal_places', $cInfo->decimal_places));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_CURRENCY_VALUE . '<br>' . tep_draw_input_field('value', $cInfo->value));
|
||||
if (DEFAULT_CURRENCY != $cInfo->code) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('default') . ' ' . TEXT_INFO_SET_AS_DEFAULT);
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'delete':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CURRENCY . '</b>');
|
||||
|
||||
$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
|
||||
$contents[] = array('text' => '<br><b>' . $cInfo->title . '</b>');
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . (($remove_currency) ? '<a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' : '') . ' <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id) . '">' . tep_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="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CURRENCIES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '">' . tep_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 . ' ' . tep_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 ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
826
src/catalog/admin/customers.php
Normal file
@ -0,0 +1,826 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: customers.php,v 1.82 2003/06/30 13:54:14 dgw_ Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
$error = false;
|
||||
$processed = false;
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'update':
|
||||
$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
$customers_firstname = tep_db_prepare_input($HTTP_POST_VARS['customers_firstname']);
|
||||
$customers_lastname = tep_db_prepare_input($HTTP_POST_VARS['customers_lastname']);
|
||||
$customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);
|
||||
$customers_telephone = tep_db_prepare_input($HTTP_POST_VARS['customers_telephone']);
|
||||
$customers_fax = tep_db_prepare_input($HTTP_POST_VARS['customers_fax']);
|
||||
$customers_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']);
|
||||
|
||||
$customers_gender = tep_db_prepare_input($HTTP_POST_VARS['customers_gender']);
|
||||
$customers_dob = tep_db_prepare_input($HTTP_POST_VARS['customers_dob']);
|
||||
|
||||
$default_address_id = tep_db_prepare_input($HTTP_POST_VARS['default_address_id']);
|
||||
$entry_street_address = tep_db_prepare_input($HTTP_POST_VARS['entry_street_address']);
|
||||
$entry_suburb = tep_db_prepare_input($HTTP_POST_VARS['entry_suburb']);
|
||||
$entry_postcode = tep_db_prepare_input($HTTP_POST_VARS['entry_postcode']);
|
||||
$entry_city = tep_db_prepare_input($HTTP_POST_VARS['entry_city']);
|
||||
$entry_country_id = tep_db_prepare_input($HTTP_POST_VARS['entry_country_id']);
|
||||
|
||||
$entry_company = tep_db_prepare_input($HTTP_POST_VARS['entry_company']);
|
||||
$entry_state = tep_db_prepare_input($HTTP_POST_VARS['entry_state']);
|
||||
if (isset($HTTP_POST_VARS['entry_zone_id'])) $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['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 (checkdate(substr(tep_date_raw($customers_dob), 4, 2), substr(tep_date_raw($customers_dob), 6, 2), substr(tep_date_raw($customers_dob), 0, 4))) {
|
||||
$entry_date_of_birth_error = false;
|
||||
} else {
|
||||
$error = true;
|
||||
$entry_date_of_birth_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
|
||||
$error = true;
|
||||
$entry_email_address_error = true;
|
||||
} else {
|
||||
$entry_email_address_error = false;
|
||||
}
|
||||
|
||||
if (!tep_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_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "'");
|
||||
$check_value = tep_db_fetch_array($check_query);
|
||||
$entry_state_has_zones = ($check_value['total'] > 0);
|
||||
if ($entry_state_has_zones == true) {
|
||||
$zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "' and zone_name = '" . tep_db_input($entry_state) . "'");
|
||||
if (tep_db_num_rows($zone_query) == 1) {
|
||||
$zone_values = tep_db_fetch_array($zone_query);
|
||||
$entry_zone_id = $zone_values['zone_id'];
|
||||
} else {
|
||||
$error = true;
|
||||
$entry_state_error = true;
|
||||
}
|
||||
} else {
|
||||
if ($entry_state == false) {
|
||||
$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 = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' and customers_id != '" . (int)$customers_id . "'");
|
||||
if (tep_db_num_rows($check_email)) {
|
||||
$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_newsletter' => $customers_newsletter);
|
||||
|
||||
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender;
|
||||
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($customers_dob);
|
||||
|
||||
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'");
|
||||
|
||||
tep_db_query("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;
|
||||
}
|
||||
}
|
||||
|
||||
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id));
|
||||
|
||||
} else if ($error == true) {
|
||||
$cInfo = new objectInfo($HTTP_POST_VARS);
|
||||
$processed = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);
|
||||
|
||||
if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) {
|
||||
$reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
|
||||
while ($reviews = tep_db_fetch_array($reviews_query)) {
|
||||
tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews['reviews_id'] . "'");
|
||||
}
|
||||
|
||||
tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");
|
||||
} else {
|
||||
tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . (int)$customers_id . "'");
|
||||
}
|
||||
|
||||
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "'");
|
||||
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'");
|
||||
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customers_id . "'");
|
||||
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customers_id . "'");
|
||||
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customers_id . "'");
|
||||
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$customers_id . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action'))));
|
||||
break;
|
||||
default:
|
||||
$customers_query = tep_db_query("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 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)$HTTP_GET_VARS['cID'] . "'");
|
||||
$customers = tep_db_fetch_array($customers_query);
|
||||
$cInfo = new objectInfo($customers);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!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">
|
||||
<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') { ?>
|
||||
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 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
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr><?php echo tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('action')) . 'action=update', 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('default_address_id', $cInfo->customers_default_address_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) {
|
||||
if ($entry_gender_error == true) {
|
||||
echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . ' ' . MALE . ' ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE . ' ' . ENTRY_GENDER_ERROR;
|
||||
} else {
|
||||
echo ($cInfo->customers_gender == 'm') ? MALE : FEMALE;
|
||||
echo tep_draw_hidden_field('customers_gender');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . ' ' . MALE . ' ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE;
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
|
||||
<td class="main">
|
||||
<?php
|
||||
if ($error == true) {
|
||||
if ($entry_firstname_error == true) {
|
||||
echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"') . ' ' . ENTRY_FIRST_NAME_ERROR;
|
||||
} else {
|
||||
echo $cInfo->customers_firstname . tep_draw_hidden_field('customers_firstname');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"', 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 tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"') . ' ' . ENTRY_LAST_NAME_ERROR;
|
||||
} else {
|
||||
echo $cInfo->customers_lastname . tep_draw_hidden_field('customers_lastname');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"', 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 tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR;
|
||||
} else {
|
||||
echo $cInfo->customers_dob . tep_draw_hidden_field('customers_dob');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_dob', tep_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 tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR;
|
||||
} elseif ($entry_email_address_check_error == true) {
|
||||
echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
|
||||
} elseif ($entry_email_address_exists == true) {
|
||||
echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
|
||||
} else {
|
||||
echo $customers_email_address . tep_draw_hidden_field('customers_email_address');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"', true);
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (ACCOUNT_COMPANY == 'true') {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_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 tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"') . ' ' . ENTRY_COMPANY_ERROR;
|
||||
} else {
|
||||
echo $cInfo->entry_company . tep_draw_hidden_field('entry_company');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"');
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_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 tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"') . ' ' . ENTRY_STREET_ADDRESS_ERROR;
|
||||
} else {
|
||||
echo $cInfo->entry_street_address . tep_draw_hidden_field('entry_street_address');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="64"', 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 tep_draw_input_field('suburb', $cInfo->entry_suburb, 'maxlength="32"') . ' ' . ENTRY_SUBURB_ERROR;
|
||||
} else {
|
||||
echo $cInfo->entry_suburb . tep_draw_hidden_field('entry_suburb');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_suburb', $cInfo->entry_suburb, 'maxlength="32"');
|
||||
}
|
||||
?></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 tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"') . ' ' . ENTRY_POST_CODE_ERROR;
|
||||
} else {
|
||||
echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', 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 tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"') . ' ' . ENTRY_CITY_ERROR;
|
||||
} else {
|
||||
echo $cInfo->entry_city . tep_draw_hidden_field('entry_city');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"', true);
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (ACCOUNT_STATE == 'true') {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_STATE; ?></td>
|
||||
<td class="main">
|
||||
<?php
|
||||
$entry_state = tep_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_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($cInfo->entry_country_id) . "' order by zone_name");
|
||||
while ($zones_values = tep_db_fetch_array($zones_query)) {
|
||||
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
|
||||
}
|
||||
echo tep_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR;
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_state', tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR;
|
||||
}
|
||||
} else {
|
||||
echo $entry_state . tep_draw_hidden_field('entry_zone_id') . tep_draw_hidden_field('entry_state');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('entry_state', tep_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 tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR;
|
||||
} else {
|
||||
echo tep_get_country_name($cInfo->entry_country_id) . tep_draw_hidden_field('entry_country_id');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id);
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_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 tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR;
|
||||
} else {
|
||||
echo $cInfo->customers_telephone . tep_draw_hidden_field('customers_telephone');
|
||||
}
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true);
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
|
||||
<td class="main">
|
||||
<?php
|
||||
if ($processed == true) {
|
||||
echo $cInfo->customers_fax . tep_draw_hidden_field('customers_fax');
|
||||
} else {
|
||||
echo tep_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"');
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_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_NEWSLETTER; ?></td>
|
||||
<td class="main">
|
||||
<?php
|
||||
if ($processed == true) {
|
||||
if ($cInfo->customers_newsletter == '1') {
|
||||
echo ENTRY_NEWSLETTER_YES;
|
||||
} else {
|
||||
echo ENTRY_NEWSLETTER_NO;
|
||||
}
|
||||
echo tep_draw_hidden_field('customers_newsletter');
|
||||
} else {
|
||||
echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="main"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('action'))) .'">' . tep_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 tep_draw_form('search', FILENAME_CUSTOMERS, '', 'get'); ?>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
|
||||
<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
|
||||
</form></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_LASTNAME; ?></td>
|
||||
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$search = '';
|
||||
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
|
||||
$keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
|
||||
$search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%'";
|
||||
}
|
||||
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
|
||||
$customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
|
||||
$customers_query = tep_db_query($customers_query_raw);
|
||||
while ($customers = tep_db_fetch_array($customers_query)) {
|
||||
$info_query = tep_db_query("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['customers_id'] . "'");
|
||||
$info = tep_db_fetch_array($info_query);
|
||||
|
||||
if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $customers['customers_id']))) && !isset($cInfo)) {
|
||||
$country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$customers['entry_country_id'] . "'");
|
||||
$country = tep_db_fetch_array($country_query);
|
||||
|
||||
$reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers['customers_id'] . "'");
|
||||
$reviews = tep_db_fetch_array($reviews_query);
|
||||
|
||||
$customer_info = array_merge($country, $info, $reviews);
|
||||
|
||||
$cInfo_array = array_merge($customers, $customer_info);
|
||||
$cInfo = new objectInfo($cInfo_array);
|
||||
}
|
||||
|
||||
if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo $customers['customers_lastname']; ?></td>
|
||||
<td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="4"><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, $HTTP_GET_VARS['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, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
|
||||
?>
|
||||
<tr>
|
||||
<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_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' => tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
|
||||
$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>' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
default:
|
||||
if (isset($cInfo) && is_object($cInfo)) {
|
||||
$heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
|
||||
|
||||
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_orders.gif', IMAGE_ORDERS) . '</a> <a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($cInfo->date_account_created));
|
||||
$contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->date_account_last_modified));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_LAST_LOGON . ' ' . tep_date_short($cInfo->date_last_logon));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
193
src/catalog/admin/define_language.php
Normal file
@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: define_language.php,v 1.15 2003/07/08 21:51:37 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!isset($HTTP_GET_VARS['lngdir'])) $HTTP_GET_VARS['lngdir'] = $language;
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'save':
|
||||
if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
|
||||
if ($HTTP_GET_VARS['filename'] == $HTTP_GET_VARS['lngdir'] . '.php') {
|
||||
$file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
|
||||
} else {
|
||||
$file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['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($HTTP_POST_VARS['file_contents']);
|
||||
fwrite($new_file, $file_contents, strlen($file_contents));
|
||||
fclose($new_file);
|
||||
}
|
||||
tep_redirect(tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$languages_array = array();
|
||||
$languages = tep_get_languages();
|
||||
$lng_exists = false;
|
||||
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
|
||||
if ($languages[$i]['directory'] == $HTTP_GET_VARS['lngdir']) $lng_exists = true;
|
||||
|
||||
$languages_array[] = array('id' => $languages[$i]['directory'],
|
||||
'text' => $languages[$i]['name']);
|
||||
}
|
||||
|
||||
if (!$lng_exists) $HTTP_GET_VARS['lngdir'] = $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">
|
||||
</head>
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_draw_form('lng', FILENAME_DEFINE_LANGUAGE, '', 'get'); ?>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('lngdir', $languages_array, $language, 'onChange="this.form.submit();"'); ?></td>
|
||||
</form></tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<?php
|
||||
if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
|
||||
if ($HTTP_GET_VARS['filename'] == $HTTP_GET_VARS['lngdir'] . '.php') {
|
||||
$file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
|
||||
} else {
|
||||
$file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
|
||||
}
|
||||
|
||||
if (file_exists($file)) {
|
||||
$file_array = 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><?php echo tep_draw_form('language', FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $HTTP_GET_VARS['filename'] . '&action=save'); ?>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><b><?php echo $HTTP_GET_VARS['filename']; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $contents, (($file_writeable) ? '' : 'readonly')); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?php if ($file_writeable == true) { echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; } ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</form></tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td class="main"><b><?php echo TEXT_FILE_DOES_NOT_EXIST; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo '<a href="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
$filename = $HTTP_GET_VARS['lngdir'] . '.php';
|
||||
?>
|
||||
<tr>
|
||||
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="smallText"><a href="<?php echo tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $filename); ?>"><b><?php echo $filename; ?></b></a></td>
|
||||
<?php
|
||||
$left = false;
|
||||
if ($dir = dir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'])) {
|
||||
$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="' . tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $file) . '">' . $file . '</a></td>' . "\n";
|
||||
if (!$left) {
|
||||
echo ' </tr>' . "\n" .
|
||||
' <tr>' . "\n";
|
||||
}
|
||||
$left = !$left;
|
||||
}
|
||||
}
|
||||
$dir->close();
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'current_path=' . DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_file_manager.gif', IMAGE_FILE_MANAGER) . '</a>'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</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'); ?>
|
||||
2541
src/catalog/admin/easypopulate.php
Normal file
61
src/catalog/admin/easypopulate_functions.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: easypopulate_functions.php,v 2.76a 2006/10/16 22:50:52 surfalot Exp $
|
||||
|
||||
Designed for osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
function tep_get_uploaded_file($filename) {
|
||||
if (isset($_FILES[$filename])) {
|
||||
$uploaded_file = array('name' => $_FILES[$filename]['name'],
|
||||
'type' => $_FILES[$filename]['type'],
|
||||
'size' => $_FILES[$filename]['size'],
|
||||
'tmp_name' => $_FILES[$filename]['tmp_name']);
|
||||
} elseif (isset($GLOBALS['HTTP_POST_FILES'][$filename])) {
|
||||
global $HTTP_POST_FILES;
|
||||
|
||||
$uploaded_file = array('name' => $HTTP_POST_FILES[$filename]['name'],
|
||||
'type' => $HTTP_POST_FILES[$filename]['type'],
|
||||
'size' => $HTTP_POST_FILES[$filename]['size'],
|
||||
'tmp_name' => $HTTP_POST_FILES[$filename]['tmp_name']);
|
||||
} else {
|
||||
$uploaded_file = array('name' => $GLOBALS[$filename . '_name'],
|
||||
'type' => $GLOBALS[$filename . '_type'],
|
||||
'size' => $GLOBALS[$filename . '_size'],
|
||||
'tmp_name' => $GLOBALS[$filename]);
|
||||
}
|
||||
|
||||
return $uploaded_file;
|
||||
}
|
||||
|
||||
// the $filename parameter is an array with the following elements:
|
||||
// name, type, size, tmp_name
|
||||
function tep_copy_uploaded_file($filename, $target) {
|
||||
if (substr($target, -1) != '/') $target .= '/';
|
||||
|
||||
$target .= $filename['name'];
|
||||
|
||||
move_uploaded_file($filename['tmp_name'], $target);
|
||||
}
|
||||
|
||||
////
|
||||
// Recursively go through the categories and retreive all sub-categories IDs
|
||||
// TABLES: categories
|
||||
if (!function_exists(tep_get_sub_categories)) {
|
||||
function tep_get_sub_categories(&$categories, $categories_id) {
|
||||
$sub_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$categories_id . "'");
|
||||
while ($sub_categories = tep_db_fetch_array($sub_categories_query)) {
|
||||
if ($sub_categories['categories_id'] == 0) return true;
|
||||
$categories[sizeof($categories)] = $sub_categories['categories_id'];
|
||||
if ($sub_categories['categories_id'] != $categories_id) {
|
||||
tep_get_sub_categories($categories, $sub_categories['categories_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
2300
src/catalog/admin/edit_orders.php
Normal file
348
src/catalog/admin/file_manager.php
Normal file
@ -0,0 +1,348 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: file_manager.php,v 1.42 2003/06/29 22:50:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
if (!tep_session_is_registered('current_path')) {
|
||||
$current_path = DIR_FS_DOCUMENT_ROOT;
|
||||
tep_session_register('current_path');
|
||||
}
|
||||
|
||||
if (isset($HTTP_GET_VARS['goto'])) {
|
||||
$current_path = $HTTP_GET_VARS['goto'];
|
||||
tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
}
|
||||
|
||||
if (strstr($current_path, '..')) $current_path = DIR_FS_DOCUMENT_ROOT;
|
||||
|
||||
if (!is_dir($current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;
|
||||
|
||||
if (!ereg('^' . DIR_FS_DOCUMENT_ROOT, $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'reset':
|
||||
tep_session_unregister('current_path');
|
||||
tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
break;
|
||||
case 'deleteconfirm':
|
||||
if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
|
||||
tep_remove($current_path . '/' . $HTTP_GET_VARS['info']);
|
||||
if (!$tep_remove_error) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
break;
|
||||
case 'insert':
|
||||
if (mkdir($current_path . '/' . $HTTP_POST_VARS['folder_name'], 0777)) {
|
||||
tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($HTTP_POST_VARS['folder_name'])));
|
||||
}
|
||||
break;
|
||||
case 'save':
|
||||
if ($fp = fopen($current_path . '/' . $HTTP_POST_VARS['filename'], 'w+')) {
|
||||
fputs($fp, stripslashes($HTTP_POST_VARS['file_contents']));
|
||||
fclose($fp);
|
||||
tep_redirect(tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($HTTP_POST_VARS['filename'])));
|
||||
}
|
||||
break;
|
||||
case 'processuploads':
|
||||
for ($i=1; $i<6; $i++) {
|
||||
if (isset($GLOBALS['file_' . $i]) && tep_not_null($GLOBALS['file_' . $i])) {
|
||||
new upload('file_' . $i, $current_path);
|
||||
}
|
||||
}
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
break;
|
||||
case 'download':
|
||||
header('Content-type: application/x-octet-stream');
|
||||
header('Content-disposition: attachment; filename=' . urldecode($HTTP_GET_VARS['filename']));
|
||||
readfile($current_path . '/' . urldecode($HTTP_GET_VARS['filename']));
|
||||
exit;
|
||||
break;
|
||||
case 'upload':
|
||||
case 'new_folder':
|
||||
case 'new_file':
|
||||
$directory_writeable = true;
|
||||
if (!is_writeable($current_path)) {
|
||||
$directory_writeable = false;
|
||||
$messageStack->add(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path), 'error');
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
|
||||
$file_writeable = true;
|
||||
if (!is_writeable($current_path . '/' . $HTTP_GET_VARS['info'])) {
|
||||
$file_writeable = false;
|
||||
$messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $current_path . '/' . $HTTP_GET_VARS['info']), 'error');
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$in_directory = substr(substr(DIR_FS_DOCUMENT_ROOT, strrpos(DIR_FS_DOCUMENT_ROOT, '/')), 1);
|
||||
$current_path_array = explode('/', $current_path);
|
||||
$document_root_array = explode('/', DIR_FS_DOCUMENT_ROOT);
|
||||
$goto_array = array(array('id' => DIR_FS_DOCUMENT_ROOT, 'text' => $in_directory));
|
||||
for ($i=0, $n=sizeof($current_path_array); $i<$n; $i++) {
|
||||
if ((isset($document_root_array[$i]) && ($current_path_array[$i] != $document_root_array[$i])) || !isset($document_root_array[$i])) {
|
||||
$goto_array[] = array('id' => implode('/', array_slice($current_path_array, 0, $i+1)), 'text' => $current_path_array[$i]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
</head>
|
||||
<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>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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 tep_draw_form('goto', FILENAME_FILE_MANAGER, '', 'get'); ?>
|
||||
<td class="pageHeading"><?php echo HEADING_TITLE . '<br><span class="smallText">' . $current_path . '</span>'; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('goto', $goto_array, $current_path, 'onChange="this.form.submit();"'); ?></td>
|
||||
</form></tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
if ( (($action == 'new_file') && ($directory_writeable == true)) || ($action == 'edit') ) {
|
||||
if (isset($HTTP_GET_VARS['info']) && strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER));
|
||||
|
||||
if (!isset($file_writeable)) $file_writeable = true;
|
||||
$file_contents = '';
|
||||
if ($action == 'new_file') {
|
||||
$filename_input_field = tep_draw_input_field('filename');
|
||||
} elseif ($action == 'edit') {
|
||||
if ($file_array = file($current_path . '/' . $HTTP_GET_VARS['info'])) {
|
||||
$file_contents = addslashes(implode('', $file_array));
|
||||
}
|
||||
$filename_input_field = $HTTP_GET_VARS['info'] . tep_draw_hidden_field('filename', $HTTP_GET_VARS['info']);
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr><?php echo tep_draw_form('new_file', FILENAME_FILE_MANAGER, 'action=save'); ?>
|
||||
<td><table border="0" cellspacing="0" cellpadding="2">
|
||||
<tr>
|
||||
<td class="main"><?php echo TEXT_FILE_NAME; ?></td>
|
||||
<td class="main"><?php echo $filename_input_field; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="main" valign="top"><?php echo TEXT_FILE_CONTENTS; ?></td>
|
||||
<td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $file_contents, (($file_writeable) ? '' : 'readonly')); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="main" colspan="2"><?php if ($file_writeable == true) echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' '; echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</form></tr>
|
||||
<?php
|
||||
} else {
|
||||
$showuser = (function_exists('posix_getpwuid') ? true : false);
|
||||
$contents = array();
|
||||
$dir = dir($current_path);
|
||||
while ($file = $dir->read()) {
|
||||
if ( ($file != '.') && ($file != 'CVS') && ( ($file != '..') || ($current_path != DIR_FS_DOCUMENT_ROOT) ) ) {
|
||||
$file_size = number_format(filesize($current_path . '/' . $file)) . ' bytes';
|
||||
|
||||
$permissions = tep_get_file_permissions(fileperms($current_path . '/' . $file));
|
||||
if ($showuser) {
|
||||
$user = @posix_getpwuid(fileowner($current_path . '/' . $file));
|
||||
$group = @posix_getgrgid(filegroup($current_path . '/' . $file));
|
||||
} else {
|
||||
$user = $group = array();
|
||||
}
|
||||
|
||||
$contents[] = array('name' => $file,
|
||||
'is_dir' => is_dir($current_path . '/' . $file),
|
||||
'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($current_path . '/' . $file)),
|
||||
'size' => $file_size,
|
||||
'permissions' => $permissions,
|
||||
'user' => $user['name'],
|
||||
'group' => $group['name']);
|
||||
}
|
||||
}
|
||||
|
||||
function tep_cmp($a, $b) {
|
||||
return strcmp( ($a['is_dir'] ? 'D' : 'F') . $a['name'], ($b['is_dir'] ? 'D' : 'F') . $b['name']);
|
||||
}
|
||||
usort($contents, 'tep_cmp');
|
||||
?>
|
||||
|
||||
<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_FILENAME; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_SIZE; ?></td>
|
||||
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PERMISSIONS; ?></td>
|
||||
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_USER; ?></td>
|
||||
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_GROUP; ?></td>
|
||||
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_LAST_MODIFIED; ?></td>
|
||||
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
|
||||
if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $contents[$i]['name']))) && !isset($fInfo) && ($action != 'upload') && ($action != 'new_folder')) {
|
||||
$fInfo = new objectInfo($contents[$i]);
|
||||
}
|
||||
|
||||
if ($contents[$i]['name'] == '..') {
|
||||
$goto_link = substr($current_path, 0, strrpos($current_path, '/'));
|
||||
} else {
|
||||
$goto_link = $current_path . '/' . $contents[$i]['name'];
|
||||
}
|
||||
|
||||
if (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name)) {
|
||||
if ($fInfo->is_dir) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
|
||||
$onclick_link = 'goto=' . $goto_link;
|
||||
} else {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
|
||||
$onclick_link = 'info=' . urlencode($fInfo->name) . '&action=edit';
|
||||
}
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n";
|
||||
$onclick_link = 'info=' . urlencode($contents[$i]['name']);
|
||||
}
|
||||
|
||||
if ($contents[$i]['is_dir']) {
|
||||
if ($contents[$i]['name'] == '..') {
|
||||
$icon = tep_image(DIR_WS_ICONS . 'previous_level.gif', ICON_PREVIOUS_LEVEL);
|
||||
} else {
|
||||
$icon = (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name) ? tep_image(DIR_WS_ICONS . 'current_folder.gif', ICON_CURRENT_FOLDER) : tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER));
|
||||
}
|
||||
$link = tep_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link);
|
||||
} else {
|
||||
$icon = tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD);
|
||||
$link = tep_href_link(FILENAME_FILE_MANAGER, 'action=download&filename=' . urlencode($contents[$i]['name']));
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><?php echo '<a href="' . $link . '">' . $icon . '</a> ' . $contents[$i]['name']; ?></td>
|
||||
<td class="dataTableContent" align="right" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><?php echo ($contents[$i]['is_dir'] ? ' ' : $contents[$i]['size']); ?></td>
|
||||
<td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><tt><?php echo $contents[$i]['permissions']; ?></tt></td>
|
||||
<td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><?php echo $contents[$i]['user']; ?></td>
|
||||
<td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><?php echo $contents[$i]['group']; ?></td>
|
||||
<td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_FILE_MANAGER, $onclick_link); ?>'"><?php echo $contents[$i]['last_modified']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if ($contents[$i]['name'] != '..') echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name']) . '&action=delete') . '">' . tep_image(DIR_WS_ICONS . 'delete.gif', ICON_DELETE) . '</a> '; if (isset($fInfo) && is_object($fInfo) && ($fInfo->name == $contents[$i]['name'])) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name'])) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2">
|
||||
<tr valign="top">
|
||||
<td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'action=reset') . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
|
||||
<td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) . '&' : '') . 'action=upload') . '">' . tep_image_button('button_upload.gif', IMAGE_UPLOAD) . '</a> <a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) . '&' : '') . 'action=new_file') . '">' . tep_image_button('button_new_file.gif', IMAGE_NEW_FILE) . '</a> <a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) . '&' : '') . 'action=new_folder') . '">' . tep_image_button('button_new_folder.gif', IMAGE_NEW_FOLDER) . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
switch ($action) {
|
||||
case 'delete':
|
||||
$heading[] = array('text' => '<b>' . $fInfo->name . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=deleteconfirm'));
|
||||
$contents[] = array('text' => TEXT_DELETE_INTRO);
|
||||
$contents[] = array('text' => '<br><b>' . $fInfo->name . '</b>');
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_FILE_MANAGER, (tep_not_null($fInfo->name) ? 'info=' . urlencode($fInfo->name) : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'new_folder':
|
||||
$heading[] = array('text' => '<b>' . TEXT_NEW_FOLDER . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('folder', FILENAME_FILE_MANAGER, 'action=insert'));
|
||||
$contents[] = array('text' => TEXT_NEW_FOLDER_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_FILE_NAME . '<br>' . tep_draw_input_field('folder_name'));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . (($directory_writeable == true) ? tep_image_submit('button_save.gif', IMAGE_SAVE) : '') . ' <a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
case 'upload':
|
||||
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_UPLOAD . '</b>');
|
||||
|
||||
$contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'action=processuploads', 'post', 'enctype="multipart/form-data"'));
|
||||
$contents[] = array('text' => TEXT_UPLOAD_INTRO);
|
||||
|
||||
$file_upload = '';
|
||||
for ($i=1; $i<6; $i++) $file_upload .= tep_draw_file_field('file_' . $i) . '<br>';
|
||||
|
||||
$contents[] = array('text' => '<br>' . $file_upload);
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . (($directory_writeable == true) ? tep_image_submit('button_upload.gif', IMAGE_UPLOAD) : '') . ' <a href="' . tep_href_link(FILENAME_FILE_MANAGER, (isset($HTTP_GET_VARS['info']) ? 'info=' . urlencode($HTTP_GET_VARS['info']) : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
|
||||
break;
|
||||
default:
|
||||
if (isset($fInfo) && is_object($fInfo)) {
|
||||
$heading[] = array('text' => '<b>' . $fInfo->name . '</b>');
|
||||
|
||||
if (!$fInfo->is_dir) $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_FILE_NAME . ' <b>' . $fInfo->name . '</b>');
|
||||
if (!$fInfo->is_dir) $contents[] = array('text' => '<br>' . TEXT_FILE_SIZE . ' <b>' . $fInfo->size . '</b>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_LAST_MODIFIED . ' ' . $fInfo->last_modified);
|
||||
}
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
353
src/catalog/admin/geo_zones.php
Normal file
@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: geo_zones.php,v 1.29 2003/06/29 22:50:52 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
require('includes/application_top.php');
|
||||
|
||||
$saction = (isset($HTTP_GET_VARS['saction']) ? $HTTP_GET_VARS['saction'] : '');
|
||||
|
||||
if (tep_not_null($saction)) {
|
||||
switch ($saction) {
|
||||
case 'insert_sub':
|
||||
$zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
|
||||
$zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
|
||||
$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
|
||||
|
||||
tep_db_query("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 = tep_db_insert_id();
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $new_subzone_id));
|
||||
break;
|
||||
case 'save_sub':
|
||||
$sID = tep_db_prepare_input($HTTP_GET_VARS['sID']);
|
||||
$zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
|
||||
$zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']);
|
||||
$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
|
||||
|
||||
tep_db_query("update " . TABLE_ZONES_TO_GEO_ZONES . " set geo_zone_id = '" . (int)$zID . "', zone_country_id = '" . (int)$zone_country_id . "', zone_id = " . (tep_not_null($zone_id) ? "'" . (int)$zone_id . "'" : 'null') . ", last_modified = now() where association_id = '" . (int)$sID . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $HTTP_GET_VARS['sID']));
|
||||
break;
|
||||
case 'deleteconfirm_sub':
|
||||
$sID = tep_db_prepare_input($HTTP_GET_VARS['sID']);
|
||||
|
||||
tep_db_query("delete from " . TABLE_ZONES_TO_GEO_ZONES . " where association_id = '" . (int)$sID . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage']));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
|
||||
|
||||
if (tep_not_null($action)) {
|
||||
switch ($action) {
|
||||
case 'insert_zone':
|
||||
$geo_zone_name = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_name']);
|
||||
$geo_zone_description = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_description']);
|
||||
|
||||
tep_db_query("insert into " . TABLE_GEO_ZONES . " (geo_zone_name, geo_zone_description, date_added) values ('" . tep_db_input($geo_zone_name) . "', '" . tep_db_input($geo_zone_description) . "', now())");
|
||||
$new_zone_id = tep_db_insert_id();
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $new_zone_id));
|
||||
break;
|
||||
case 'save_zone':
|
||||
$zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
|
||||
$geo_zone_name = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_name']);
|
||||
$geo_zone_description = tep_db_prepare_input($HTTP_POST_VARS['geo_zone_description']);
|
||||
|
||||
tep_db_query("update " . TABLE_GEO_ZONES . " set geo_zone_name = '" . tep_db_input($geo_zone_name) . "', geo_zone_description = '" . tep_db_input($geo_zone_description) . "', last_modified = now() where geo_zone_id = '" . (int)$zID . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']));
|
||||
break;
|
||||
case 'deleteconfirm_zone':
|
||||
$zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);
|
||||
|
||||
tep_db_query("delete from " . TABLE_GEO_ZONES . " where geo_zone_id = '" . (int)$zID . "'");
|
||||
tep_db_query("delete from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)$zID . "'");
|
||||
|
||||
tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['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">
|
||||
<script language="javascript" src="includes/general.js"></script>
|
||||
<?php
|
||||
if (isset($HTTP_GET_VARS['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 tep_js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>
|
||||
|
||||
}
|
||||
//--></script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
|
||||
<!-- header //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
|
||||
<!-- header_eof //-->
|
||||
|
||||
<!-- body //-->
|
||||
<table border="0" width="100%" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
|
||||
<!-- left_navigation //-->
|
||||
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
|
||||
<!-- left_navigation_eof //-->
|
||||
</table></td>
|
||||
<!-- 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($HTTP_GET_VARS['zone'])) echo '<br><span class="smallText">' . tep_get_geo_zone_name($HTTP_GET_VARS['zone']) . '</span>'; ?></td>
|
||||
<td class="pageHeading" align="right"><?php echo tep_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; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$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 = " . $HTTP_GET_VARS['zID'] . " order by association_id";
|
||||
$zones_split = new splitPageResults($HTTP_GET_VARS['spage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
|
||||
$zones_query = tep_db_query($zones_query_raw);
|
||||
while ($zones = tep_db_fetch_array($zones_query)) {
|
||||
$rows++;
|
||||
if ((!isset($HTTP_GET_VARS['sID']) || (isset($HTTP_GET_VARS['sID']) && ($HTTP_GET_VARS['sID'] == $zones['association_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$sInfo = new objectInfo($zones);
|
||||
}
|
||||
if (isset($sInfo) && is_object($sInfo) && ($zones['association_id'] == $sInfo->association_id)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $zones['association_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo (($zones['countries_name']) ? $zones['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
|
||||
<td class="dataTableContent"><?php echo (($zones['zone_id']) ? $zones['zone_name'] : PLEASE_SELECT); ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($zones['association_id'] == $sInfo->association_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $zones['association_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<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, $HTTP_GET_VARS['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, $HTTP_GET_VARS['spage'], 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list', 'spage'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" colspan="3"><?php if (empty($saction)) echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($sInfo) ? 'sID=' . $sInfo->association_id . '&' : '') . 'saction=new') . '">' . tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<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" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
$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($HTTP_GET_VARS['zpage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
|
||||
$zones_query = tep_db_query($zones_query_raw);
|
||||
while ($zones = tep_db_fetch_array($zones_query)) {
|
||||
if ((!isset($HTTP_GET_VARS['zID']) || (isset($HTTP_GET_VARS['zID']) && ($HTTP_GET_VARS['zID'] == $zones['geo_zone_id']))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) {
|
||||
$num_zones_query = tep_db_query("select count(*) as num_zones from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)$zones['geo_zone_id'] . "' group by geo_zone_id");
|
||||
$num_zones = tep_db_fetch_array($num_zones_query);
|
||||
|
||||
if ($num_zones['num_zones'] > 0) {
|
||||
$zones['num_zones'] = $num_zones['num_zones'];
|
||||
} else {
|
||||
$zones['num_zones'] = 0;
|
||||
}
|
||||
|
||||
$zInfo = new objectInfo($zones);
|
||||
}
|
||||
if (isset($zInfo) && is_object($zInfo) && ($zones['geo_zone_id'] == $zInfo->geo_zone_id)) {
|
||||
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '\'">' . "\n";
|
||||
} else {
|
||||
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id']) . '\'">' . "\n";
|
||||
}
|
||||
?>
|
||||
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id'] . '&action=list') . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> ' . $zones['geo_zone_name']; ?></td>
|
||||
<td class="dataTableContent" align="right"><?php if (isset($zInfo) && is_object($zInfo) && ($zones['geo_zone_id'] == $zInfo->geo_zone_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zones['geo_zone_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><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, $HTTP_GET_VARS['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, $HTTP_GET_VARS['zpage'], '', 'zpage'); ?></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" colspan="2"><?php if (!$action) echo '<a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=new_zone') . '">' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($HTTP_GET_VARS['sID']) ? 'sID=' . $HTTP_GET_VARS['sID'] . '&' : '') . 'saction=insert_sub'));
|
||||
$contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . tep_draw_pull_down_menu('zone_id', tep_prepare_country_zones_pull_down()));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&' . (isset($HTTP_GET_VARS['sID']) ? 'sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['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>' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . tep_draw_pull_down_menu('zone_id', tep_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id) . '">' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['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>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id) . '">' . tep_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="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->date_added));
|
||||
if (tep_not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=insert_zone'));
|
||||
$contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . tep_draw_input_field('geo_zone_name'));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . tep_draw_input_field('geo_zone_description'));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID']) . '">' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['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>' . tep_draw_input_field('geo_zone_name', $zInfo->geo_zone_name));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . tep_draw_input_field('geo_zone_description', $zInfo->geo_zone_description));
|
||||
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . tep_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' => tep_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['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>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id) . '">' . tep_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="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=edit_zone') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=delete_zone') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' . ' <a href="' . tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '">' . tep_image_button('button_details.gif', IMAGE_DETAILS) . '</a>');
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_ZONES . ' ' . $zInfo->num_zones);
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($zInfo->date_added));
|
||||
if (tep_not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($zInfo->last_modified));
|
||||
$contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . $zInfo->geo_zone_description);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( (tep_not_null($heading)) && (tep_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'); ?>
|
||||
BIN
src/catalog/admin/images/Thumbs.db
Normal file
BIN
src/catalog/admin/images/ani_send_email.gif
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/catalog/admin/images/cal_close_small.gif
Normal file
|
After Width: | Height: | Size: 863 B |
BIN
src/catalog/admin/images/cal_date_down.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/catalog/admin/images/cal_date_over.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/catalog/admin/images/cal_date_up.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/catalog/admin/images/cal_del_small.gif
Normal file
|
After Width: | Height: | Size: 856 B |
BIN
src/catalog/admin/images/categories/Thumbs.db
Normal file
BIN
src/catalog/admin/images/categories/catalog.gif
Normal file
|
After Width: | Height: | Size: 549 B |
BIN
src/catalog/admin/images/categories/configuration.gif
Normal file
|
After Width: | Height: | Size: 543 B |
BIN
src/catalog/admin/images/categories/customers.gif
Normal file
|
After Width: | Height: | Size: 561 B |
BIN
src/catalog/admin/images/categories/localization.gif
Normal file
|
After Width: | Height: | Size: 652 B |
BIN
src/catalog/admin/images/categories/location.gif
Normal file
|
After Width: | Height: | Size: 598 B |
BIN
src/catalog/admin/images/categories/modules.gif
Normal file
|
After Width: | Height: | Size: 487 B |
BIN
src/catalog/admin/images/categories/reports.gif
Normal file
|
After Width: | Height: | Size: 623 B |
BIN
src/catalog/admin/images/categories/tools.gif
Normal file
|
After Width: | Height: | Size: 522 B |
BIN
src/catalog/admin/images/graph_hbar_blue.gif
Normal file
|
After Width: | Height: | Size: 42 B |
BIN
src/catalog/admin/images/graph_hbar_red.gif
Normal file
|
After Width: | Height: | Size: 50 B |
12
src/catalog/admin/images/graphs/.cvsignore
Normal file
@ -0,0 +1,12 @@
|
||||
banner_infobox-*.png
|
||||
banner_daily-*.png
|
||||
banner_monthly-*.png
|
||||
banner_yearly-*.png
|
||||
banner_infobox-*.jpg
|
||||
banner_daily-*.jpg
|
||||
banner_monthly-*.jpg
|
||||
banner_yearly-*.jpg
|
||||
banner_infobox-*.gif
|
||||
banner_daily-*.gif
|
||||
banner_monthly-*.gif
|
||||
banner_yearly-*.gif
|
||||
BIN
src/catalog/admin/images/graphs/Thumbs.db
Normal file
BIN
src/catalog/admin/images/graphs/banner_infobox-1.png
Normal file
|
After Width: | Height: | Size: 740 B |
0
src/catalog/admin/images/graphs/dummy
Normal file
BIN
src/catalog/admin/images/header_administration.gif
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/catalog/admin/images/header_checkout.gif
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/catalog/admin/images/header_support.gif
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/catalog/admin/images/icon_arrow_right.gif
Normal file
|
After Width: | Height: | Size: 81 B |
BIN
src/catalog/admin/images/icon_info.gif
Normal file
|
After Width: | Height: | Size: 540 B |
BIN
src/catalog/admin/images/icon_popup.gif
Normal file
|
After Width: | Height: | Size: 234 B |
BIN
src/catalog/admin/images/icon_reset.gif
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
src/catalog/admin/images/icon_save.gif
Normal file
|
After Width: | Height: | Size: 155 B |
BIN
src/catalog/admin/images/icon_status_green.gif
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
src/catalog/admin/images/icon_status_green_light.gif
Normal file
|
After Width: | Height: | Size: 292 B |
BIN
src/catalog/admin/images/icon_status_red.gif
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
src/catalog/admin/images/icon_status_red_light.gif
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
src/catalog/admin/images/icon_status_yellow.gif
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
src/catalog/admin/images/icons/Thumbs.db
Normal file
BIN
src/catalog/admin/images/icons/cross.gif
Normal file
|
After Width: | Height: | Size: 340 B |
BIN
src/catalog/admin/images/icons/current_folder.gif
Normal file
|
After Width: | Height: | Size: 132 B |
BIN
src/catalog/admin/images/icons/delete.gif
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
src/catalog/admin/images/icons/error.gif
Normal file
|
After Width: | Height: | Size: 193 B |
BIN
src/catalog/admin/images/icons/file.gif
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
src/catalog/admin/images/icons/file_download.gif
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
src/catalog/admin/images/icons/folder.gif
Normal file
|
After Width: | Height: | Size: 129 B |
BIN
src/catalog/admin/images/icons/locked.gif
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
src/catalog/admin/images/icons/preview.gif
Normal file
|
After Width: | Height: | Size: 377 B |
BIN
src/catalog/admin/images/icons/previous_level.gif
Normal file
|
After Width: | Height: | Size: 263 B |
BIN
src/catalog/admin/images/icons/statistics.gif
Normal file
|
After Width: | Height: | Size: 143 B |
BIN
src/catalog/admin/images/icons/success.gif
Normal file
|
After Width: | Height: | Size: 177 B |
BIN
src/catalog/admin/images/icons/tick.gif
Normal file
|
After Width: | Height: | Size: 211 B |
BIN
src/catalog/admin/images/icons/unlocked.gif
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
src/catalog/admin/images/icons/warning.gif
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
src/catalog/admin/images/oscommerce.gif
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/catalog/admin/images/pixel_black.gif
Normal file
|
After Width: | Height: | Size: 35 B |
BIN
src/catalog/admin/images/pixel_trans.gif
Normal file
|
After Width: | Height: | Size: 43 B |
20
src/catalog/admin/includes/application_bottom.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: application_bottom.php,v 1.8 2002/03/15 02:40:38 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
// close session (store variables)
|
||||
tep_session_close();
|
||||
|
||||
if (STORE_PAGE_PARSE_TIME == 'true') {
|
||||
if (!is_object($logger)) $logger = new logger;
|
||||
echo $logger->timer_stop(DISPLAY_PAGE_PARSE_TIME);
|
||||
}
|
||||
?>
|
||||
208
src/catalog/admin/includes/application_top.php
Normal file
@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: application_top.php,v 1.162 2003/07/12 09:39:03 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2003 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
|
||||
// Start the clock for the page parse time log
|
||||
define('PAGE_PARSE_START_TIME', microtime());
|
||||
|
||||
// Set the level of error reporting
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
|
||||
// Check if register_globals is enabled.
|
||||
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
|
||||
if (function_exists('ini_get')) {
|
||||
ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
|
||||
}
|
||||
|
||||
// Set the local configuration parameters - mainly for developers
|
||||
if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');
|
||||
|
||||
// Include application configuration parameters
|
||||
require('includes/configure.php');
|
||||
|
||||
// Define the project version
|
||||
define('PROJECT_VERSION', 'osCommerce 2.2-MS2');
|
||||
|
||||
// set php_self in the local scope
|
||||
$PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);
|
||||
|
||||
// Used in the "Backup Manager" to compress backups
|
||||
define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
|
||||
define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
|
||||
define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
|
||||
define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');
|
||||
|
||||
// include the list of project filenames
|
||||
require(DIR_WS_INCLUDES . 'filenames.php');
|
||||
|
||||
// include the list of project database tables
|
||||
require(DIR_WS_INCLUDES . 'database_tables.php');
|
||||
|
||||
// customization for the design layout
|
||||
define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)
|
||||
|
||||
// Define how do we update currency exchange rates
|
||||
// Possible values are 'oanda' 'xe' or ''
|
||||
define('CURRENCY_SERVER_PRIMARY', 'oanda');
|
||||
define('CURRENCY_SERVER_BACKUP', 'xe');
|
||||
|
||||
// include the database functions
|
||||
require(DIR_WS_FUNCTIONS . 'database.php');
|
||||
|
||||
// make a connection to the database... now
|
||||
tep_db_connect() or die('Unable to connect to database server!');
|
||||
|
||||
// set application wide parameters
|
||||
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
|
||||
while ($configuration = tep_db_fetch_array($configuration_query)) {
|
||||
define($configuration['cfgKey'], $configuration['cfgValue']);
|
||||
}
|
||||
|
||||
// define our general functions used application-wide
|
||||
require(DIR_WS_FUNCTIONS . 'general.php');
|
||||
require(DIR_WS_FUNCTIONS . 'html_output.php');
|
||||
|
||||
// initialize the logger class
|
||||
require(DIR_WS_CLASSES . 'logger.php');
|
||||
|
||||
// include shopping cart class
|
||||
require(DIR_WS_CLASSES . 'shopping_cart.php');
|
||||
|
||||
// some code to solve compatibility issues
|
||||
require(DIR_WS_FUNCTIONS . 'compatibility.php');
|
||||
|
||||
// check to see if php implemented session management functions - if not, include php3/php4 compatible session class
|
||||
if (!function_exists('session_start')) {
|
||||
define('PHP_SESSION_NAME', 'osCAdminID');
|
||||
define('PHP_SESSION_PATH', '/');
|
||||
define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
|
||||
|
||||
include(DIR_WS_CLASSES . 'sessions.php');
|
||||
}
|
||||
|
||||
// define how the session functions will be used
|
||||
require(DIR_WS_FUNCTIONS . 'sessions.php');
|
||||
|
||||
// set the session name and save path
|
||||
tep_session_name('osCAdminID');
|
||||
tep_session_save_path(SESSION_WRITE_DIRECTORY);
|
||||
|
||||
// set the session cookie parameters
|
||||
if (function_exists('session_set_cookie_params')) {
|
||||
session_set_cookie_params(0, DIR_WS_ADMIN);
|
||||
} elseif (function_exists('ini_set')) {
|
||||
ini_set('session.cookie_lifetime', '0');
|
||||
ini_set('session.cookie_path', DIR_WS_ADMIN);
|
||||
}
|
||||
|
||||
// lets start our session
|
||||
tep_session_start();
|
||||
|
||||
// set the language
|
||||
if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
|
||||
if (!tep_session_is_registered('language')) {
|
||||
tep_session_register('language');
|
||||
tep_session_register('languages_id');
|
||||
}
|
||||
|
||||
include(DIR_WS_CLASSES . 'language.php');
|
||||
$lng = new language();
|
||||
|
||||
if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
|
||||
$lng->set_language($HTTP_GET_VARS['language']);
|
||||
} else {
|
||||
$lng->get_browser_language();
|
||||
}
|
||||
|
||||
$language = $lng->language['directory'];
|
||||
$languages_id = $lng->language['id'];
|
||||
}
|
||||
|
||||
// include the language translations
|
||||
require(DIR_WS_LANGUAGES . $language . '.php');
|
||||
$current_page = basename($PHP_SELF);
|
||||
if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
|
||||
include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
|
||||
}
|
||||
|
||||
// define our localization functions
|
||||
require(DIR_WS_FUNCTIONS . 'localization.php');
|
||||
|
||||
// Include validation functions (right now only email address)
|
||||
require(DIR_WS_FUNCTIONS . 'validations.php');
|
||||
|
||||
// setup our boxes
|
||||
require(DIR_WS_CLASSES . 'table_block.php');
|
||||
require(DIR_WS_CLASSES . 'box.php');
|
||||
|
||||
// initialize the message stack for output messages
|
||||
require(DIR_WS_CLASSES . 'message_stack.php');
|
||||
$messageStack = new messageStack;
|
||||
|
||||
// split-page-results
|
||||
require(DIR_WS_CLASSES . 'split_page_results.php');
|
||||
|
||||
// entry/item info classes
|
||||
require(DIR_WS_CLASSES . 'object_info.php');
|
||||
|
||||
// email classes
|
||||
require(DIR_WS_CLASSES . 'mime.php');
|
||||
require(DIR_WS_CLASSES . 'email.php');
|
||||
|
||||
// file uploading class
|
||||
require(DIR_WS_CLASSES . 'upload.php');
|
||||
|
||||
// calculate category path
|
||||
if (isset($HTTP_GET_VARS['cPath'])) {
|
||||
$cPath = $HTTP_GET_VARS['cPath'];
|
||||
} else {
|
||||
$cPath = '';
|
||||
}
|
||||
|
||||
if (tep_not_null($cPath)) {
|
||||
$cPath_array = tep_parse_category_path($cPath);
|
||||
$cPath = implode('_', $cPath_array);
|
||||
$current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
|
||||
} else {
|
||||
$current_category_id = 0;
|
||||
}
|
||||
|
||||
// default open navigation box
|
||||
if (!tep_session_is_registered('selected_box')) {
|
||||
tep_session_register('selected_box');
|
||||
$selected_box = 'configuration';
|
||||
}
|
||||
|
||||
if (isset($HTTP_GET_VARS['selected_box'])) {
|
||||
$selected_box = $HTTP_GET_VARS['selected_box'];
|
||||
}
|
||||
|
||||
// the following cache blocks are used in the Tools->Cache section
|
||||
// ('language' in the filename is automatically replaced by available languages)
|
||||
$cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
|
||||
array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
|
||||
array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
|
||||
);
|
||||
|
||||
// check if a default currency is set
|
||||
if (!defined('DEFAULT_CURRENCY')) {
|
||||
$messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
|
||||
}
|
||||
|
||||
// check if a default language is set
|
||||
if (!defined('DEFAULT_LANGUAGE')) {
|
||||
$messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
|
||||
}
|
||||
|
||||
if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
|
||||
$messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
|
||||
}
|
||||
?>
|
||||
39
src/catalog/admin/includes/boxes/catalog.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: catalog.php,v 1.21 2003/07/09 01:18:53 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
?>
|
||||
<!-- catalog //-->
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
$heading[] = array('text' => BOX_HEADING_CATALOG,
|
||||
'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));
|
||||
|
||||
if ($selected_box == 'catalog') {
|
||||
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
|
||||
|
||||
'<a href="' . tep_href_link('easypopulate.php', '', 'NONSSL') . '" class="menuBoxContentLink">Easy Populate</a><br>'.
|
||||
'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');
|
||||
}
|
||||
|
||||
$box = new box;
|
||||
echo $box->menuBox($heading, $contents);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- catalog_eof //-->
|
||||
38
src/catalog/admin/includes/boxes/configuration.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: configuration.php,v 1.17 2003/07/09 01:18:53 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
?>
|
||||
<!-- configuration //-->
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
$heading[] = array('text' => BOX_HEADING_CONFIGURATION,
|
||||
'link' => tep_href_link(FILENAME_CONFIGURATION, 'gID=1&selected_box=configuration'));
|
||||
|
||||
if ($selected_box == 'configuration') {
|
||||
$cfg_groups = '';
|
||||
$configuration_groups_query = tep_db_query("select configuration_group_id as cgID, configuration_group_title as cgTitle from " . TABLE_CONFIGURATION_GROUP . " where visible = '1' order by sort_order");
|
||||
while ($configuration_groups = tep_db_fetch_array($configuration_groups_query)) {
|
||||
$cfg_groups .= '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $configuration_groups['cgID'], 'NONSSL') . '" class="menuBoxContentLink">' . $configuration_groups['cgTitle'] . '</a><br>';
|
||||
}
|
||||
|
||||
$contents[] = array('text' => $cfg_groups);
|
||||
}
|
||||
|
||||
$box = new box;
|
||||
echo $box->menuBox($heading, $contents);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- configuration_eof //-->
|
||||
33
src/catalog/admin/includes/boxes/customers.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: customers.php,v 1.16 2003/07/09 01:18:53 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
?>
|
||||
<!-- customers //-->
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
$heading[] = array('text' => BOX_HEADING_CUSTOMERS,
|
||||
'link' => tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers'));
|
||||
|
||||
if ($selected_box == 'customers') {
|
||||
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_ORDERS . '</a>');
|
||||
}
|
||||
|
||||
$box = new box;
|
||||
echo $box->menuBox($heading, $contents);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- customers_eof //-->
|
||||
34
src/catalog/admin/includes/boxes/localization.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: localization.php,v 1.16 2003/07/09 01:18:53 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
?>
|
||||
<!-- localization //-->
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
$heading[] = array('text' => BOX_HEADING_LOCALIZATION,
|
||||
'link' => tep_href_link(FILENAME_CURRENCIES, 'selected_box=localization'));
|
||||
|
||||
if ($selected_box == 'localization') {
|
||||
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CURRENCIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_CURRENCIES . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_LANGUAGES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_LANGUAGES . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_ORDERS_STATUS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_LOCALIZATION_ORDERS_STATUS . '</a>');
|
||||
}
|
||||
|
||||
$box = new box;
|
||||
echo $box->menuBox($heading, $contents);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- localization_eof //-->
|
||||
37
src/catalog/admin/includes/boxes/modules.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
$Id: modules.php,v 1.16 2003/07/09 01:18:53 hpdl Exp $
|
||||
|
||||
osCommerce, Open Source E-Commerce Solutions
|
||||
http://www.oscommerce.com
|
||||
|
||||
Copyright (c) 2002 osCommerce
|
||||
|
||||
Released under the GNU General Public License
|
||||
*/
|
||||
?>
|
||||
<!-- modules //-->
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$heading = array();
|
||||
$contents = array();
|
||||
|
||||
$heading[] = array('text' => BOX_HEADING_MODULES,
|
||||
'link' => tep_href_link(FILENAME_MODULES, 'set=payment&selected_box=modules'));
|
||||
|
||||
if ($selected_box == 'modules') {
|
||||
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=payment', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_PAYMENT . '</a><br>' .
|
||||
'<a href="' . tep_href_link(FILENAME_MODULES, 'set=shipping', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_SHIPPING . '</a><br>' .
|
||||
// START STS 4.1
|
||||
'<a href="' . tep_href_link(FILENAME_MODULES, 'set=sts', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_STS . '</a><br>' .
|
||||
// END STS 4.1
|
||||
'<a href="' . tep_href_link(FILENAME_MODULES, 'set=ordertotal', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_ORDER_TOTAL . '</a>');
|
||||
}
|
||||
|
||||
$box = new box;
|
||||
echo $box->menuBox($heading, $contents);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- modules_eof //-->
|
||||