<?php

require 'PHP/general.php';

if ( isset($_SESSION['LvL']) )
	if ($_SESSION['LvL'] == 0)

{
$loadPass = 'false';

$pageContents1 = <<< EOPAGE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="fr" xml:lang="fr" id="html" xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>Page maître</title>
	<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="css/style0.css" />

	<link rel="apple-touch-icon" href="CI/icons/touch-icon-iphone.png" />
	<link rel="apple-touch-icon" sizes="72x72" href="CI/icons/touch-icon-ipad.png" />
	<link rel="apple-touch-icon" sizes="114x114" href="CI/icons/touch-icon-iphone4.png" />
	<link rel="shortcut icon" href="CI/icons/favicon.ico" type="image/x-icon" />
	<script type="text/javascript">
	<!--
		var loadPass = $loadPass;
	-->
	</script>
	<script type="text/javascript" src="js/javascript_cookies.js"></script>
	<script type="text/javascript" src="js/module0.js"></script>
</head>

<body>
	<div id='msg0Container' class='messageContainer'>
		<div id='msg0Header' class='messageHeader'>Erreur</div>
		<div id='msg0Area' class='messageArea'>Le navigateur ne peut pas exécuter du code JavaScript.</br>Il faut l'activer afin de visualiser le site.</div>
	</div>
	<div id="mainContainer" class="mainContainer">
		<div id="rDiv1" class="right1BottomContainer" >
			<div class="right1BottomHeader" >Connectez-vous</div>
				<div class="right1BottomArea" style="text-align:center">
					<a style="color:red;" ></a></br>
					<form id="loginForm" action="index.php" method="post" onsubmit="processLogin();">
					<table id="passTable" align="center" border="0" cellpadding="1" cellspacing="0">
					<tr>
						<td align="right" nowrap="nowrap">Nom de compte:</td>
						<td><input type="text" name="Account" id="Account" size="18" onchange="checkSubmitLogin();" onkeyup="checkSubmitLogin();" /></td>
					</tr>
					<tr>
						<td align="right" nowrap="nowrap">Mot de passe:</td>
						<td><input type="password" name="Passwd" id="Passwd" size="18" onchange="checkSubmitLogin();" onkeyup="checkSubmitLogin();" /></td>
					</tr>
					<tr>
						<td align="center" nowrap="nowrap">
							<input type="submit" id="submitLogin" value="Connexion" disabled="disabled" />
						</td>
						<td align="center" nowrap="nowrap"></td>
					</tr>
					</table>
					</form>
					</br>
				</div>
		</div>
	</div>

	<script type="text/javascript" src="js/module1.js"></script>

</body>

</html>
EOPAGE;

} else {
if ($_SESSION['LvL'] == 9)
$pageContents3 = <<< EOPAGE
	<div class="leftBottomContainerHeader">
		History
	</div>
	<div class="leftBottomContainer">	
		Version 14 (2011-09-21)
		<br/>- Overall website coding increase (JavaScript) by 30%... DAMN that was long!!! ;-)
		<br/>- NEW FEATURE: iPad APN 3D rotate with gestures, 2 detail levels (normal and HD), Time-Sync (skips frames if the machine is too slow in order to keep up with the intended time period for the APN rotation) etc
		<br/>- NEW FEATURE: SlideShow in portrait mode (if data is available)
		<br/>- Othe minor improvements like text shadow for better contrast
		<br/>- New icon in order to detect which APN has 3D and which has 3D and slides. As the SlideShow is not yet implemented for PC browsers, the clickable "Slides&3D" icon is only available for the iPad. However, the small one will also be visible on PCs in order to notice the slides availability
		<br/>
		<br/>Version 13c (2011-09-13)
		<br/>- Added a new AutoInit feature which tries to automatically reset and initialize the database and the XML files and informs selected email recipients about the result: positive or negative.
		<br/>		
		<br/>Version 13b (2011-09-12)
		<br/>- The date at which the APN price was valid is now displayed in "T?/YYYY" format (i.e. T3/2007)
		<br/>
		<br/>Version 13 (2011-09-11)
		<br/>- NEW FEATURE: import & display of Technical Data for APN's!
		<br/>- NEW FEATURE: 3D model for APN's (where available)
		<br/>- New code that prevents picture dragging
		<br/>- New code that prevents unwanted text selection in Opera and IE
		<br/>- Fixed a bug resulting in incorect Printers information 
		<br/>- Small changes in the Main Page: history is now visible only to "Admin", Demo mode got pictures for easyer selection
		<br/>
		<br/>Version 12b (2011-08-30)
		<br/>- Login protection for main page and CI
		<br/>
		<br/>Version 12 (2011-05-01)
		<br/>- NEW FEATURE: import & display of Technical Data for inkjet printers!
		<br/>- New code that prevents unwanted element selection in Internet Explorer
		<br/>- The Comparateur's Icon for direct access is now also available on Android devices
		<br/>- Fixed a Firefox issue where product thumbnail was not resized properly
		<br/>- Removed the ability to open context menus inside the webpage
		<br/>
		<br/>Version 11d (2011-04-28)
		<br/>- Protection against PHP code revealing due to server's PHP compiler crash: the important code + config files are now located in a 2nd CI folder, located above the WWW level (above public_html).
		<br/>
		<br/>Version 11c (2011-04-27)
		<br/>- Implementation of JavaScript code protection using the new JSh1d3 algorithm & functions. Keeping in mind no JavaScript code can be 100% protected (as it has to load and execute locally) the protection includes most of the available techniques:
		<br/>* 1. Removal of comments, lines and unnecesary white spaces, making (the already complex code) difficult to restore to a readable form
		<br/>* 2. Compression algorithms, reducing the code size by approx. 50% (ex: 48% - from 50,429 bytes to 26,094 bytes - for the current version) speeding up the HTTP transfer and also resulting in an unreadable (compressed) form of the original code
		<br/>* 3. Encoding algorithm based on randomly generated numbers: one on clientside and one serverside providing different coding looks everytime the page is loaded and also ensuring that the code is only used by the requesting page
		<br/>* 4. A 2nd encoding using a modified 6 to 8 bit UUEncode algorithm, adaptive to the user browser and server host, preventing the copy/paste of "intercepted" code to a different webserver or in a different browser
		<br/>
		<br/>Version 11b (2011-04-21)
		<br/>- "AJUSTER AU ECRAN" button is now renamed "SCREEN ADJUST" 
		<br/>- changes in "initialize.php" in order to use the .csv information also for category _1 (previously: only for _2, _3, _4 etc due to EXIF info). If .csv info is not available, EXIF will still be used.
		<br/>
		<br/>Version 11 (2011-04-18):
		<br/>- The website is now fully compatible with the iPad: both portrait and landscape modes. Just turn the device and the page will reposition the elements accordingly ;-)
		<br/>
		<br/>Version 10b (2011-04-18):
		<br/>- The "other" iOS devices (ex: iPhone) can now resize the page (on iPad resizing is still disabled)
		<br/>
		<br/>Version 10 (2011-04-17):
		<br/>- MAJOR CHANGE: Completly new user interface, adaptive to the user's screen resolution (if enabled), "compatible" with the iPad (Landscape mode) and not only ;-)
		<br/>- MAJOR CHANGE: Now the cleaning procedure & image generation are registered in the database instead of ".lck" files ("temp" table) due to the fact that sometimes the webserver was not writing the locking files fast enough on the disk (due to write buffering) and other users could not detect that a cleaning or generation procedure was running, resulting in errors. Using a database will remove this problem.
		<br/>- Many changes in the website's code and logic due to the interface overhaul.
		<br/>- Fixed a bug in the touch screen navigation: moving the finger on the mini-thumbnails at very low speed produced no result
		<br/>- Fixed a bug in the category selection: selecting APN, then printers, then APN again showed printers in the APN product list
		<br/>- Mouse cursor now changes to pointer / move accordingly
		<br/>- Changes to "initialize.php" (see version 09b): now the special characters ( ', ", &, >, < ) are automatically handled ( no more need to write them as special codes in "config_SQL.php")
		<br/>
		<br/>Version 09b (2011-04-14):
		<br/>- Modified the "initialize.php" file to allow the use of special characters. For the moment, due to XML parsing rules which consider "&" as a special character, "&" shall be written as "&amp;" instead the "config_SQL.php" file (ex: "1 & 2" becomes "1 &amp; 2")
		<br/>
		<br/>Version 09 (2011-04-13):
		<br/>- Support for a 3rd category of printers: "Photo" which MUST be located in "Prienters/Photo/"
		<br/>- The printers are now splitted into: Inkjet / Laser / Photo in the dropdown menu box for an easyer selection
		<br/>- Workaround an Opera bug (it doesn't display empty table cells => bad page formatting)
		<br/>- Dropped some variables which were no longer used due to the recent changes
		<br/>- Workaround a javascript issue in Internet Explorer 8 (object variables cannot be compared to boolean values)
		<br/>- Modified the CFG_2.php for a thumbnail size of 300x300 pixels
		<br/>- The mini-images of products now respect the width/height ratio of the original "*_tn.jpg" files
		<br/>
		<br/>Version 08b (2011-04-12):
		<br/>- Change in the "initialize.php" file: now it sorts the .jpg files from the image folders (ex:  APN/*.*) to their corresponding folders
		<br/>
		<br/>Version 08 (2011-04-10):
		<br/>- The interogation procedure for obtaining the % when preparing files on the server changed: now only one request is sent to to the server no matter how many images are loading (previous implementation: one enquiry for each image). This should reduce server load and querries.
		<br/>- The CAT_0.XML file, containing the product categories (APN, Printers etc.) is now loaded together with "comparateur.php". This will speed up page loading by ping time (usually between 150-200 ms).
		<br/>- The CAT_?.XML file, containing product information is now loaded together with "comparateur.php" if the product is specified in the URL. This will speed up page loading by ping time (usually between 150-200 ms).
		<br/>- There is no more delay between the moment when an image finishes loading and the moment when the inactive menus activate.
		<br/>- Fixed an error which apeared during the XML files generation if the configuration file "config_SQL.php" did not contain info for the processed image category.
		<br/>- Modified the APN descripions in the "config_SQL.php" file for testing purposes (and to show how easy it is to modify them)  ;-)
		<br/>
		<br/>Version 07 (2011-04-09):
		<br/>- Major changes regarding the server interogation for product/images/types names and descriptions. Now XML files are used (static data) instead .PHP procedures that interogate the database resulting in less server requests and load. No more lag when navigating through the menus. The XML files have to be generated after the database initialization. After their generation, the database may be even erased as it´s no longer used.
		<br/>- If visible, the menu in which the product category is selected (i.e. APN or Printers) shall be disabled during image load
		<br/>- Fixed a bug under Opera in which the new menu was sometimes not displayed properly
		<br/>
		<br/>Version 06 (2011-04-08):
		<br/>- Changes in the SQL files "reset.php" and "initialize.php":
		<br/>* 1. If a ".csv" file is placed inside an image folder (ex: "/APN" or "/Printers") its info shall be read, inserted into the database and used in order to determine the product name and brand
		<br/>* 2. A configuration file "config_SQL.php" is now available (in the "config" folder) for the database generation. With it, description to all the categories, images and types can be easily assigned prior to the database generation. Use "_EXIF" in the type category in order to use the image's EXIF info.
		<br/>* 3. If in the EXIF info the brand name is also repeating in the begining of the product name (ex: CANON and CANON EOS 7D) the brand name shall be extracted from the product name (previous example becomes: CANON and EOS 7D) since some producers do not include their brand in the product EXIF info (ex: SONY Alpha series).
		<br/>* 4. Brand name shall always be written in capital letters
		<br/>- Minor changes in the "comparateur.php": invalid CFG files passed through the command line are no longer generating PHP errors & there is no more "-" between the BRAND and the Product_Name in the dropdown selection menus.
		<br/>
		<br/>Version 05 (2011-04-07):
		<br/>- Major changes in the image load engine / AJAX. Now the communication with the server should be faster and less data transfered
		<br/>- The serverside image preparation % should display properly in all browsers
		<br/>- Different corrections in the page behaviour: clicking/touching the small thumbnails will no longer reload the images etc
		<br/>- The PHP "filter_var" function is implemented again
		<br/>- Changes in "load_img.php": the "small_'scale_factor'.jpg" (the "big" reference picture) is generated again for all the image loads, not just for the reference thumbnail. This allows (due to the new load/AJAX engine) avoiding server requests in certain situations, improving the navigation experience etc.
		<br/>- Important UltraBuffer optimization: if an image is loaded more than once, only the initial loaded image shall be buffered, reducing data transfer/server querries&load
		<br/>- The "Images comparaison:" selection menu is now disabled while loading images
		<br/>- The small focus_window now starts in the center of the picture and if possible, its position is kept when changing the reference thumbnail, otherwise it resets to the picture's center
		<br/>- If a category is not available (ex: trying to compare ink2 with laser printers which only have laser1) the category name (ex: for the laser printer) shall be "Indisponible" instead "Sélectionez une image"
		<br/>- Implementation of a selection button and menus. If visible, they are disabled while an image is loading.
		<br/>- Many code optimizations
		<br/>
		<br/>Version 04b (2011-04-06):
		<br/>- Quick fix for the reload procedure in Version 04
		<br/>
		<br/>Version 04 (2011-04-05):
		<br/>- Implemented functions which reload the website's mini-thumbnails if the elapsed time since their load is > than 90% of the clean_time from the CFG file. This shall prevent "404: file cannot be found" errors due to the following scenario: "A person opens the webpage and leaves it open (or on iPad: exit Safari) for a long time. In the mean time, someone else accesses the website and the cleaning procedure is ran automatically. Therefore the files required by the 1st person are deleted due to the long inactivity period. At a certain point, the 1st person accesses the page again (on the iPad: reopen Safari, which memorises the last settings unless you manually close the page) and it gets 404 errors due to the fact that the files are no longer on the server."
		<br/>- The database querry results are now sorted in ascending order resulting in sorted menus/options
		<br/>- Changes in UltraBuffer - now only the latest window position is buffered, preventing buffer-overload due to chaotical mouse movement over the "big" image ;-)
		<br/>- The focus_start_X and focus_start_Y from the CFG file(s) are now corectly implemented
		<br/>- The images are now requested with "?0" at the end instead of "?<random_number>", allowing image caching between different browser sessions
		<br/>- Some of the requirements from your email were implemented and there are 3 configuration files at the moment, 1 that alows any comparison, 1 for APN and 1 for printers... check out the above links
		<br/>- Fixed a software bug that was preventing the focus window to be controlled in Firefox
		<br/>
		<br/>Version 03b (2011-04-04):
		<br/>- Added an error_treating procedure for the situation in which the mini-thumbnails cannot be generated on the server
		<br/>
		<br/>Version 03 (2011-04-04):
		<br/>- Improved page formatting, now the bottom margin has its intended height
		<br/>- The mouse move / touch is now recorded on the whole screen (also outside the document body)
		<br/>- Various javascript code optimizations
		<br/>- Changes in "load_img.php": the "small_'scale_factor'.jpg" (the "big" reference picture) is now generated only for the reference thumbnail consuming less server space and speeding up the data preparation process for the other thumbnails.
		<br/>- Implementation of restrictions in the CFG files: hide/show product categories; enable/disable reference product, image and type selection; Fixed image comparison: always try to compare (if possible) the same image, but different types.
		<br/>- New icon for PC browsers (favicon.ico)
		<br/>- Other minor tweaks
		<br/>Fixed bugs:
		<br/>- UltraBuffer % was displayed in the Thumbnails Buffer % area and vice-verse
		<br/>- The "Préparation données ??%" message was trying to be displayed even if the user reduced the number of thumbnails while the image was still loading and the object no longer exists. (ex: load an image into the 4th thumbnail, then reduce the global thumbnails number to 2 before the image loads resulted in multiple errors)
		<br/>- A bug related to the configuration file and imprimantes
		<br/>
		<br/>Version 02 (2011-04-03):
		<br/>- NEW FEATURE: touch support! Same as for the mouse, touch and drag on the big photo for fast panning or on the small ones for precision panning.
		<br/>- NEW ICONS for the iPhone/iPad when saving the page on the main screen
		<br/>
		<br/>Version 01 (2011-04-02):
		<br/>- NEW FEATURE: now you can move the 1:1 mini-image(s) pixel-by-pixel by clicking on it directly and dragging
		<br/>- UltraBuffer improvements / optimizations: new way to detect the buffering (moving) direction, other small tweaks
		<br/>- The cleaning function now creates the temporary directory if it doesn't already exist
		<br/>- Fixed a bug in the "load_img.php" file: sometimes the "small_'scale_factor'.jpg" files were not generating corectly
		<br/>- Changes in "load_img.php": the "small_'scale_factor'.jpg" (the "big" reference picture) is now generated with a quality factor of 80% (down from 100%) as the difference in quality does not justify the difference in size and load time. The quality of the 1:1 mini-images remains 100%.
		<br/>- Modified "cfg_1.php": max_width = 660 (down from 800) for the the "small_'scale_factor'.jpg" in order to be more "iPad-friendly" (as the iPad has a maximum width of 1024 pixels)
		<br/>
		<br/>Version 00 (2011-04-01):
		<br/>- First WWW version
	</div>
EOPAGE;
else
	$pageContents3 = '';
	
require("../CI/indexPWD.php");

$pageContents1 = <<< EOPAGE
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="fr" xml:lang="fr" id="html" xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>Page maître</title>
	<meta http-equiv="Content-Type" content="txt/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="css/style0.css" />

</head>

<body>
	<div id="bottomContainer">
	<div class="leftBottomContainerHeader">
		Demo
	</div>
	<div class="leftBottomContainer">
		<div class="linksToSite" onclick="location.href='CI/comparateur.php';">
			<div style="padding:5px 13px 6px 13px; ">
				<img src="css/001.jpg" with="124px" />
			</div>
			<a>COMPARATEUR D'IMAGE (CI) SANS PARAMETRES<br/><br/>Choix APN ou Imprimante</a>
		</div>
		<div class="linksToSite" onclick="location.href='CI/comparateur.php?Type_product_id=_2&Product_ref_id=i1180&Product_ref_img=_laser1&Product_ref_type=_1&CFG=2';">
			<div style="padding:13px 13px 13px 13px; ">
				<img src="css/002.jpg" with="124px" />
			</div>
			<a>IMPRIMANTES<br/><br/>CI avec 4 parametres et configuration 2 (300x300)</a>
		</div>
		<div class="linksToSite" onclick="location.href='CI/comparateur.php?Type_product_id=_1&Product_ref_id=1171&Product_ref_img=_D&Product_ref_type=_200&CFG=3';">
			<div style="padding:15px 13px 15px 13px; ">
				<img src="css/003.jpg" with="124px" />
			</div>
			<a>APN<br/><br/>CI avec 4 parametres et configuration 3 (300x200)</a>
		</div>
		<div class="linksToSite" onclick="location.href='CI/comparateur.php?Type_product_id=_1&Product_ref_id=1171&Product_ref_img=_D&Product_ref_type=_200&CFG=4';">
			<div style="padding:5px 13px 5px 13px; ">
				<img src="css/004.jpg" with="124px" />
			</div>
			<a>APN<br/><br/>CI avec 4 parametres et configuration 4 (300x300)</a>
		</div>
	</div>
	${pageContents2}
	${pageContents3}
</body>

</html>
EOPAGE;


}

echo $pageContents1;
?>
