Bonjour voila jai une erreur de type
Parse error: syntax error, unexpected $end in
dans mon script index.php mais je ne trouve pas l'erreur.
Pourriez vous m'aider s'il vous plait
Voila mon script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Leon Paul - Order Processing System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="fr" />
<meta name="Description" content="zwatla.com : template css, kit graphique css" />
<meta name="Keywords" content="template css" />
<link rel="stylesheet" type="text/css" href="centre.css" title="zwatla" />
</head>
<body>
<? $menu = $_GET['menu'];
include ('class/listing.class.php');
include ('class/sql.class.php');
include('class/fpdf/fpdf.php');
include ('class/pdf.class.php');
include ('class/forms.class.php');
include ('class/add.class.php');
include ('class/edit.class.php');
include ('class/CMailFile.class.php');
include ('class/mailing.class.php');
include ('class/functions.class.php');
include ('class/auto.class.php');
include ('class/search.class.php');
require_once('class/fax/nusoap.php');
?>
<div id="conteneur">
<div id="haut">
<!--<img src="images/cart.gif" alt="Your cart"/> -->
<?
/*
$sql=new sql();
$req = 'SELECT company.name from company INNER JOIN cart ON cart.company=company.id ORDER BY cart.id ASC';
$res = $sql->sqlop($req);
$i = 0;
while ($r = mysql_fetch_array($res)){
if ($i == 0) print '<h3>Your cart at '.$r['name'].'</h3>';
$i ++;
}
$req = 'SELECT product.description from product INNER JOIN cart ON cart.LPEpartnumber=product.LPEpartnumber ORDER BY cart.id DESC';
$res2 = $sql->sqlop($req);
$i = 0;
print '<p>';
while ($r2 = mysql_fetch_array($res2)){
if ($i <= 2) print ' . '.$r2['description'].'<br />';
if ($i == 3) print '...';
$i ++;
}
if ($i == 0) print '<h3>Your cart is empty</h3>';
print '</p>';
*/
?>
<!--<div id="header"></div> -->
</div>
<?php $url[]= explode ('/', $_SERVER['REQUEST_URI']); $sql= new sql();
//print_r ($toto);
//print '<br />'.$toto[0][1];
//print '<br />'.$toto[0][2];
//print '<br />'.$_SERVER['REQUEST_URI'];
if ($url[0][1] != 'class'){ ?>
<ul id="menu">
<li><a href="index.php">Home</a></li>
<li><a href="index.php?menu=add">Add entry</a></li>
<li><a href="index.php?menu=search">Place an order</a></li>
<li><a href="index.php?menu=pendingorder">Pending orders</a></li>
<li><a href="index.php?menu=pendinginvoice">Pending invoice</a></li>
<li><a href="index.php?menu=upload">Upload</a></li>
<li><a href="index.php?menu=auto">Auto</a></li>
<li><a href="index.php?menu=stats">Statistics</a></li>
<li><a href="index.php?menu=searchorder">Search Order</a></li>
</ul>
<?
}
else { ?>
<ul id="menu">
<li><a href="../index.php">Home</a></li>
<li><a href="../index.php?menu=add">Add entry</a></li>
<li><a href="../index.php?menu=search">Place an order</a></li>
<li><a href="../index.php?menu=pendingorder">Pending orders</a></li>
<li><a href="../index.php?menu=pendinginvoice">Pending invoice</a></li>
<li><a href="../index.php?menu=upload">Upload</a></li>
<li><a href="../index.php?menu=auto">Auto</a></li>
<li><a href="../index.php?menu=stats">Statistics</a></li>
<li><a href="../index.php?menu=searchorder">Search Order</a></li>
</ul>
<?
}
?>
<div id="deco"></div>
<div id="centre">
<div class="gauche">
<img src="images/img_002.jpg" alt="zwatla template css"/>
<img src="images/img_003.jpg" alt="template css cut"/>
</div>
<div class="droite">
<?
switch ($menu) {
case 'addcompany' :
print '<img src="images/add_company.gif" class="img_nompage" alt="Add a company">';
break;
case 'addproduct' :
print '<img src="images/add_product.gif" class="img_nompage" alt="Add a product">';
break;
case 'addsupplier' :
print '<img src="images/add_supplier.gif" class="img_nompage" alt="Add a supplier">';
break;
case 'perarticle' :
print '<img src="images/search_product.gif" class="img_nompage" alt="Search per product">';
break;
case 'percompany' :
print '<img src="images/search_company.gif" class="img_nompage" alt="Search per company">';
break;
case 'addorder' :
print '<img src="images/place_order.gif" class="img_nompage" alt="Place the order">';
break;
default :
//print '<img src="images/welcomme.gif" class="img_nompage" alt="Home page">';
break;
}
?>
<br /><br />
<?
$menu = $_GET['menu'];
$menu2 = $_GET['menu2'];
if ($menu == 'add'){
if ($menu2 == 'company'){
$form = new forms (); // We create a new Company listing
$form->addcompany(); // We go to the form to add a company
}
elseif($menu2 == 'product') {
$form = new forms (); // We create a new Company listing
$form->addproduct(); // We go to the form to add a company
}
elseif($menu2 == 'supplier') {
$form = new forms (); // We create a new Company listing
$form->addsupplier(); // We go to the form to add a compan
}
else {
print '<a href="?menu=add&menu2=company">Create new company</a><br /><br /><a href="?menu=add&menu2=product">Add jean Piere part</a><br /><br /><a href="?menu=add&menu2=supplier">Add a supplier</a><br />';
}
}
elseif ($menu == 'delete'){
$edit = new edit (); // We create a new Company listing
$edit->delete($_GET['table'], $_GET['id']); // We go to the form to add a company
}
elseif ($menu == 'search'){
$form = new forms(); // We create a new form object
print '<div id="return">';
$form->percompany();
$form->perarticle();
print '</div>';
}
elseif ($menu == 'editcompany'){
$form = new forms(); // We create a new form object
$form->editcompany($_GET['id']);
}
elseif ($menu == 'allorders'){
$search = new search(); // We create a new form object
$search->orderall();
}
elseif ($menu == 'editsupplier'){
$form = new forms(); // We create a new form object
$form->editsupplier($_GET['id']);
}
elseif ($menu == 'nospace'){
$functions = new functions(); // We create a new form object
$functions->nospace();
}
elseif ($menu == 'addtocart'){
$add = new add(); // We create a new form object
$add->addtocart($_GET['company'], $_GET['LPEpartnumber']);
}
elseif ($menu == 'test'){
$functions = new functions(); // We create a new form object
$functions->test($_GET['ordernumber']);
}
elseif ($menu == 'addorder'){
$form = new forms(); // We create a new form object
$form->addorder();
}
elseif ($menu == 'addinvoice'){
$form = new forms(); // We create a new form object
$form->addinvoice($_GET['ordernumber'], $_GET['currency']);
}
elseif ($menu == 'pendingorder') {
$form = new forms(); // We create a new form object
$form->pending_order();
}
elseif ($menu == 'pendinginvoice') {
$form = new forms(); // We create a new form object
$form->pending_invoice();
}
elseif ($menu == 'received') {
$received = new forms();
$received->received($_GET[ordernumber]);
}
elseif ($menu == 'searchorder') {
$search = new forms();
$search->searchorder();
}
elseif ($menu == 'invoiced') {
$invoiced = new forms();
$invoiced->invoiced($_GET[ordernumber]);
}
elseif ($menu == 'displaycompany') {
$listing = new listing(); // We create a new form object
$listing->displaycompany($_GET['id']);
}
elseif ($menu == 'closeinvoicing') {
$sql=new sql();
$req = 'Update orders Set invoice ="closed" where ordernumber="'.$_GET['ordernumber'].'"';
$res = $sql->sqlop($req);
print 'You correctly closed the invoicing for order #'.$_GET['ordernumber'];
}
elseif ($menu == 'displayinvoice') {
$listing = new listing(); // We create a new form object
$listing->displayinvoice($_GET['invoicenumber']);
}
elseif ($menu == 'stats') {
$form = new forms(); // We create a new form object
$form->stats();
}
elseif ($menu == 'upload') {
$functions = new functions(); // We create a new form object
$functions->upload();
}
elseif ($menu == 'auto') {
$auto = new auto(); // We create a new form object
$auto->listing($r['value']);
}
elseif ($menu == 'sendmail'){
$email = new mailing(); // We create the object//include ('class/valid_form.php');
$email->sendmail($_GET['ordernumber'],0);
}
elseif ($menu == 'sendfax'){
//$fax = new mailing(); // We create the object
//$fax->sendfax($_GET['ordernumber']);
$myfax = '00442083599996';
$ordernumber = $_GET['ordernumber'];
$sql=new sql();
$req = 'SELECT company from orders WHERE ordernumber="'.$ordernumber.'"';
$res = $sql->sqlop($req);
while ($r = mysql_fetch_array($res)){
$req2 = 'SELECT fax, name from company WHERE id="'.$r['company'].'"';
$res2 = $sql->sqlop($req2);
while ($r2 = mysql_fetch_array($res2)){
$fax = $r2['fax'];
$name = $r2['name'];
}
}
$username = "******";
$password = "******";
$faxnumber = $fax; // formatted like +654654654,
// i.e. +(country code)(area code)(phone number)
$file = "Docs/".$ordernumber.".pdf"; // binary file to fax
$filetype = "PDF"; // e.g. HTML, DOC, PDF, etc.; see
// documentation for complete list
$postponetime = "2001-04-25T20:31:00-04:00"; // e.g. 2001-04-25T20:31:00-04:00,
// use a past date/time to fax immediately
$resolution = "0"; // 0 for standard, 1 for fine
$csid = "6546546"; // your fax identifier, visible on
// the receiving machine's little screen
$subject = "Order #".$ordernumber." to ".$name; // for your reference, visible in the outbound queue
$replyemail = "6546546"; // optional address at which to receive an
// emailed confirmation
$fp = fopen($file, "r");
// Read data from the file into $data
$data = "";
while (!feof($fp)) $data .= fread($fp,1024);
$client = new soapclient2("
http://ws.interfax.net/dfs.asmx?wsdl", true);
$params[] = array('Username' => $username,
'Password' => $password,
'FaxNumbers' => $faxnumber,
'FilesData' => base64_encode($data),
'FileTypes' => $filetype,
'FileSizes' => strlen($data),
'Postpone' => $postponetime,
'IsHighResolution' => $resolution,
'CSID' => $csid,
'Subject' => $subject,
'ReplyAddress' => $replyemail
);
$result = $client->call("SendfaxEx", $params);
if ($_GET['cop']) {
$params2[] = array('Username' => $username,
'Password' => $password,
'FaxNumbers' => $myfax,
'FilesData' => base64_encode($data),
'FileTypes' => $filetype,
'FileSizes' => strlen($data),
'Postpone' => $postponetime,
'IsHighResolution' => $resolution,
'CSID' => $csid,
'Subject' => $subject,
'ReplyAddress' => $replyemail
);
//$result2 = $client->call("SendfaxEx", $params2);
}
if ($result["SendfaxExResult"] > 0) {
print 'You correctly sent the order #'.$ordernumber.' through fax to '.$name;
}
else {
print 'An error occured while sending the fax, please retry <a href="index.php?menu=sendfax&ordernumber='.$ordernumber.'">here</a>';
}
}
else {
//print 'Welcomme to the Leon Paul order Processing system. <br/>Please select a functionality in the top menu.';
}
}
?>
</div>
</div>
</div>
</body>
</html>
Configuration: Windows XP
Firefox 2.0.0.11