summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Pincon aka Sysde <sysde@else-projects.org>2007-11-29 20:23:45 +0100
committersysde <sysde@pagirus.pincon.net>2007-11-29 20:23:45 +0100
commitacd50f7c5de718f83ee3cfa6344216416566ef49 (patch)
tree13f06a5ba8434247ef4f7bad29c8c318377f5850
parentchange phone on phone card (diff)
downloadcommunication-acd50f7c5de718f83ee3cfa6344216416566ef49.tar.gz
Communications quotationHEADmaster
Adding the quotation system This system calcul quotation with number of usb-key and capacity of these one
-rw-r--r--quotation/index.php167
1 files changed, 167 insertions, 0 deletions
diff --git a/quotation/index.php b/quotation/index.php
new file mode 100644
index 0000000..a2786fd
--- /dev/null
+++ b/quotation/index.php
@@ -0,0 +1,167 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
+<head>
+<title>Calcul quotation</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta name="robots" content="noindex,nofollow" />
+<style type="text/css">
+
+body {
+ margin: 1em;
+ padding: 0;
+ font: .8em arial, hevetica, sans-serif;
+ text-align: left;
+ color: black;
+ background: white;
+}
+p#notes {
+ border-bottom: 1px dotted black;
+ padding-bottom: 1em;
+}
+p#footer {
+ border-top: 1px dotted black;
+ padding-top: 1em;
+}
+code {
+ font-size: .9em;
+}
+html>body code {
+ font-size: 1.3em;
+}
+
+#form_quotation {
+ border: none;
+ margin: 0;
+ padding: 0;
+ width: 25em; /*** Form large ***/
+}
+#titreForm{ /*** Layout of title ***/
+ font: bold 1.1em arial, hevetica, sans-serif;
+ color: white;
+ background-color:#DE5215;
+ /*background: black;*/
+ margin: 0;
+ padding: .5em;
+ border-top: solid 1px #DE5215;
+ border-left: solid 1px #DE5215;
+ border-right: solid 1px #DE5215;
+}
+#piedForm { /*** Layout of footer ***/
+ font: bold 1.1em arial, hevetica, sans-serif;
+ color: white;
+ background-color:#DE5215;
+ /*background: black;*/
+ margin: 0;
+ padding: .5em;
+ border-bottom: solid 1px #DE5215;
+ border-left: solid 1px #DE5215;
+ border-right: solid 1px #DE5215;
+}
+#corpForm { /*** Layout of form content (border,color ...) ***/
+ border: 1px solid #DE5215;
+ color: black;
+ background: #f8cd89;
+ margin: 0;
+ padding: 1em;
+}
+#corpForm fieldset {
+ margin: 0;
+ font-style: normal;
+ padding: 0 1em 1em;
+ border: 1px solid #DE5215;
+}
+#corpForm legend {
+ font-weight: bold;
+ color: black;
+ background: transparent;
+}
+#corpForm p { /*** Layout of form's ligne ***/
+ padding: .2em 0;
+ margin: 0 0 .2em 0;
+}
+#corpForm .focus {
+ background: beige;
+ color: black;
+}
+#corpForm fieldset#quotation label { /*** Layout of intitulate field ***/
+ float: left; /*** Very important, don't delete it***/
+ width: 50%;
+ text-align: right; /*** Aligne text into right ***/
+ margin: 0;
+ padding: 0 .5em 0 0;
+ line-height: 1.8; /*** vertical center ***/
+}
+#corpForm .normal {
+ background: white;
+ color: black;
+}
+#piedForm {
+ text-align: center;
+}
+#piedForm input {
+ font-weight: bold;
+ margin-left: 1em;
+}
+
+</style>
+</head>
+<body>
+<?php
+function prln($string){
+ echo $string."\n";
+}
+function calcul($number , $capacity){
+ $prices =array();
+ $prices["2G"] = 35.02;
+ $prices["4G"] = 60.97;
+
+ if (array_key_exists($capacity, $prices)){
+ $sentence = "For $number usb-key with $capacity capacity and Rim-Else pre-installed:<BR/>";
+ $price = $prices[$capacity] * $number;
+ return $sentence.$price." &euro; tax-free <BR/> For more informations about quotation please contact quotation@else-projects.org";
+ }else{
+ return "There is an error to calcul your quotation. Please try again";
+ }
+}
+if(count($_POST) > 0){
+ if(!(empty($_POST["usb_number"])) && is_numeric($_POST["usb_number"] )){
+ $usbnumber = $_POST["usb_number"];
+ $capacity = $_POST["capacity"];
+ $quotation = calcul($_POST["usb_number"] , $_POST["capacity"]);
+ }else{
+ $quotation = "Please enter a valid number of usb key";
+ }
+}
+
+
+
+?>
+
+<form method="POST" action="index.php" name="Quotations" id="form_quotation">
+<div id="titreForm">Calcul quotation</div>
+<div id="corpForm">
+<fieldset id="quotation">
+ <legend>Calcul quotation</legend>
+ <p>
+ <label for="key_number">Number of usb key : </label>
+ <input type="text" name="usb_number" id="usb_number" value=<?php if(isset($usbnumber)){echo $usbnumber;}else{echo 0;} ?> size="4" onfocus="this.className='focus';" onblur="this.className='normal';">
+ </p>
+ <p>
+ <label for="capacity">Capacity : </label>
+ <SELECT name="capacity">
+ <OPTION <?php if(isset($capacity) and $capacity == "2G" ){ echo "SELECTED"; } ?> VALUE="2G">2 GO</OPTION>
+ <OPTION <?php if(isset($capacity) and $capacity == "4G" ){ echo "SELECTED"; } ?> VALUE="4G">4 GO</OPTION>
+ </SELECT>
+ </P>
+
+</fieldset>
+</div>
+<div id="piedForm">
+<input type="submit" name="valid" id="valid" value="Valider" />
+</div>
+</form>
+<BR/>
+<?php
+prln("Quotation result : <BR/>$quotation");
+?>
+</body>