Display file:
This file controls the arrangement of the individual article informations like article number, price etc.
At present, there are three versions available
- show_items_0.inc.php: Most detailed display including picture. The various informations are generously spread.
- show_items_1.inc.php: Without picture, but including generous arrangement of information.
- show_items_2.inc.php: Most concise display in tabular form. All information in one row.
All available files are listed in the drop-down menu.
For marking a file as a display file, the second line has to include:
## itemlist
[ The file itself has to be in the directory above admin/. ] The file show_item_x.in.php is a template for creating one's own list views.
top

Automatic conversion:
There is an option for automatic conversion for relieving the admistrator. For this purpose, the currency with the ID==1 will be used as a base. Because of this, there is no need to change all prices separately only because of a change in the exchange rate. One entry for the first currency in the article menu will be completely sufficient.
[ If this option is enabled, there is no longer a possibility to offer an article in a currency without price indication or for free while offering it in another one with a price. ]
top

Automatic conversion (article administration):
Finds the prices in the other currencies based on exchange rates. This function is dependent on the option " automatic conversion".
top

Create Backup:
Alle files will be read off the data base and saved to a file in the directory admin/backup/. The file name will be displayed at the end of the page after writing. It includes the word backup as well as the current data and time. This file can be read in with "Read Backup". Even considering this is a text file (CSV) you shouldn't make any modifications on it, as it doesn't look nice and is not clear ;-) This just is not the purpose of the backup. Except creating a backup file all tables will be optimized (mySQL only?).
top

Restore Backup:
All data in the tables will be deleted at first (!) and will be read into the data base from the file created with "Create Backup" next.
top

Types of payment:
In the column formfile there can be given a PHP file which will be displayed at the corresponding kind of payment, i.e. a form for credit card details.
All form fields have to include the attribute name="pfield[]" for allowing further processing of their contents. Every input element can have a hidden form filed attached appearing in the e-mail before the entered value:
<input type="hidden" name="pname[]" value="designation">
<input type="text" name="pfield[]" value="contents">
becomes the line:
designation: contents
in the e-mail. The following variables are available for customer data, allowing pre-occupation of the pfield fields.

Besides user data, there are information available on the shopping basket allowing to consider minimum order values or to adapt shipping costs, for instance. Besides these variables, all texts from the language file are available as well.
Please, do not include your own <form> elements. screen shot
top

Data import :
During import, the second comment line has to include the sign of the currency again as it will be exported. Articles including a quantity not included in the data base will not be entered. Articles already present will be updated; those not present will be updated. Articles without a valid article group ID will not be imported, as well.
The file may include unencrypted passwords (3rd column). Those will be written MD5 encrypted into the data base. If the column pw is empty, the password will not be changed for existing customer entries as well. Users with an invalid group assignment will not be imported. In case of the import of files created by yourself it is important to make sure that the IDs of the departments and article groups, resp., are correct. The pictures belonging to the imported fiels have to uploaded via FTP.
top

Data export:
The data exported will be saved into the directory admin/backup (Naming: Table_name_backupcurrent date/time). They can be further processed using for instance a spreadsheet program. The names of the individual columns will be given in that file, too. Lines starting with "## " will be considered as comments. Passwords will not be exported.
top

Integration of the sessionID:
You can insert links for instance for detailed view of an article into the texts of the departments and user groups as well as articles. For visitor identification it is important to pass the sessionID as well. Attached to this sessionID are also the shopping basket as well as the language and currency settings of the user.
For handing over this value, write #sessionID# in the place where this value has to be handed over later. Please, consider capitalization!
Within the text the line
<a href="detail.php?#session#&art_id=5">article with the ID 5 (where the ID is not the articel number!)</a>
creates the HTML code for a link including the detailed view of the article with the ID 5:
<a href="detail.php?sess=32characters&art_id=5">article with the ID 5 (where the ID is not the article number!)</a>
The ID of an article can be found within the article administration menu entry.
- Within the column Art.Nr, article numbers are linked to the change mode. The status line of the browser will display something like:
item.php?chg=edit&art=5
The number following "art=" is the ID looked for.
- During change of an article, the ID will be displayed.

top

Size (or other properties):
The article name in the header line leads back to the change mode of the article.
The link autofill writes the contents of the first form field (= designation 1st langauge) using JavaScript into the further form fields of that size.
Designations will not be taken over into the data base - i.e. deleted - if the field "Availability" is empty.
Moreover: While we are always talking on "Sizes ": It is understood, that colors, shapes ore more can be inserted in this place as well. This designation is derived from the name of the table size.
The JavaScripts haven been successfully tested with Netscape 6.2, Opera 6.01 and InternetExplorer 5.
top

Installation:
- Unpack the archive
-> Use Winzip or similar
-> tar xzf archivename.tar.gz
- Upload files
- Some servers have problems creating configuration files. Use a chmod 777 (full access rights including write access for all) for the complete phPay directory during initial installation (data bank parameters). Basically, it will be sufficient if only the files config_db.inc.php (in the directory phpayv2 and in phpayv2/admin) and config.inc.php have these rights. Concerning the translation tool, the same applies to the directory lang/
- Use the browser for navigating to http://your-domain.com/phpayv2/admin/
- Invoke the menu entry Data base parameter: Insert user name etc. for the data base there (this creates the files config_db.inc.php)
You can create the data base and the table in this place, too.
- Next invoke Configuration and input the remaining options; this will create the config.inc.php for the Shop.
The archive *.orig includes versions of admin/config_db.inc.php as well as config.inc.php which are complete and are derived from the test environment. You will only have to insert the data base user and pass wort using a text editor in case the Admin tools will not work.
- Insert article etc.
------------------------
The directory admin should be protected against unauthorized accesses using something like .htaccess.
------------------------
There is a possbility to activate lines 3 and 4 in the file start.php (remove #) and comment out lines 7 and 8 (add #) instaed just in case the Web server does not support sessions.
Active lines Web server session handling (default):
session_start();
$sess=session_id();

phPay's own session handling:
srand ((double)microtime()*1000000);
$sess=time()+rand();

Please, do only use one of them ;-)
------------------------
In case no departments are shown in the navigation and only the main page loading infinitely something during normal startup of the shop, presumably the password of the user with ID == 2 is wrong. The password entered in the data base for this user has to be inserted unencrypted into the file start.php, line 17, as well.
$md_pw = md5("public"); the password will be public by default. There should be no reason to change it, as it is without any relevence for security.
top

JavaScript:
Article: The menu for the article groups will be dynamically adapated to the selection of the department menu to avoid selection of an article group not fitting to the chosen department. Also the functions autofill and autoconvert.
Data import/export: The two additional menus (language, currency) will be adapted based on the table choice.
Users will have no additional choice; otherwise the language in which informations are saved.
If articles will have to be exported or imported, currency of prices can be specified as well.
These scripts have been successfully tested with Netscape Version 4.x and 6.2, Konqueror 2.1, Opera 6.01 and InternetExplorer 5.
top

Keywords:
Similar articles are searched for using the keywords in the detailed view.
The article numbers of those articles to be given as recommendations in the detailed view have to be specified, separated by spaces.
top

Configuration file:
All available files are listed in the drop-down menu. For marking a file as a configuration file, the second line has to be:
## Config
[The file itself has to be disposed in the directory above admin/. ]
top

Known bugs:
- PHP4.02B does not know something as is_uploaded(). This produces an error during picture upload, of course.
File import from version 1.05 is still missing.
top

Layout:
If typefaces and font sizes are to be changed, this has to be done directly within the file header.inc.php. Here, only colors can be changed.

top

Price:
There is one price and one quantity possible per article. Price refers to minimum amount and packaging unit.
In case you want to use prices not detemined using the current ratio only, insert the other currencies.
Based on the first currency there will be a decision, if an article with 'on inquiry' or 'for free' will be displayed.
top

$show_null:
There is a possibility to input a text instead of 0,00 EUR. The variable $null_text contains the text to be displayed. The value of the variable $gratis will be displayed for prices lower than 0 (zero).
Both variables can be found in the beginning of the language file and can be changed using the translation tool.
top

Languages:
Assignment of the individual links and buttons of the Shop system to different languages will be realized via a file in the directory lang/.
The file name includes the shorthand for the language (2 characters!) and .inc.php together. Appointment of the shorthand will follow designations of top level domains.
The contents of the file can be optimally changed using the translation tool.
If the visitor has not made a different choice, the very first language in the table language will be used as a default.
top

Test and development environment:
- PHP 4.04pl1 and 4.06
- mySQL 3.23.39
- Redhat Kernel 2.4
- Apache 1.3.19


- PHP 4.2.0
- mySQL 4.01
- Windows2000
- Apache 2

top

Texts:
All texts, descriptions and names can include HTML elements. These may be formatting ones like <i> or <b> but also <ul> and <ol>. <a> and <img> are possible as well.
If you want to exploit <table> elements, do only use complete tabular definitions; otherwise phPay's own tabular structures may get mixed up.
<form> and <font> should not be used.
top

Availability:
Three statuses can be given. These refer to the question what will happen should the quantity be used up.

  1. Never: There simply exist always items in a store which are always available and can't be specified by a quantity, phone numers being an example.
  2. Topical: A current article, which can be re-ordered in case it is out; butter and milk as an example. These articles can be sold out temporarily, but just will not be available again immediately.
  3. Rest: Characterizes an article which cannot be re-ordered any longer. If it is out it is out; these are discontinued lines and remainders. Depending on the line of business, most of the articles being topical at present will enter this category at some point.
    These articles will still be displayed then, but cannot be added to the shopping basket.
The square brackets specify if there have already been given additional properties.
The link will be only present during change of an article, not during a new creation. See Sizes (or other properties)
top

$view_limit (Articles per page):
There will appear an additional navigation with back and forth button if the number of articles will be larger than the value for $viewlimit. Moreover, the total number of articles will be displayed. The design for this comes from the file limit_navi.inc.php.
The value directly at the beginning of the file has to be changed using a text editor in the admin area.
At present, this is possible for item.php and user.php.
top

Types of shipment:
The form file has the same sense as that for the Types of payment and there will be the same variables for customer data available for preassigning the sfield fields. All form fields must have the attribute name="sfield[]" for further processing of their contents. Every input element can have a hidden form field assigned appearing in the e-mail in front of the entered value:
<input type="hidden" name="sname[]" value="Designation">
<input type="text" name="sfield[]" value="Contents">
will become the following line in the e-mail:
Designation: Contents
Please, do not insert your own <form> elements.
top

Currency:
The first entered currency will be used as a base currency for the automatic conversion and as a default. Therefore, the conversion ratio remains at 1.00, and it cannot be deleted.
However, the name and designation can be changed, i.e. there will be another base currency possible in fact.
top