All pastes #431283 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-09 15:48 UTC
rendered paste body
<?php
/*
 * details.php, 26 mai 2006
 * 
 * This file is part of videotheque.
 *
 * Copyright © 2005 Johan Cwiklinski
 *
 * File :               	details.php
 * Author's email :     	johan@x-tnd.be
 * Author's Website :   	http://x-tnd.be
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 */

include('../parts/php_header.php');

$films = new Films();
$errors = array();


if(isset($_POST["Titre"]) && $_POST["modif"]==1){$films->load($_POST["Titre"]);}
if($_POST["new"]==1 || $_POST["modif"]==1){ //ajout d'un nouveau film
	$valid = true;
	if(trim($_POST["ident"])==""){
		$errors[] = $commons->getValue("film_require_Title");
		$valid = false;
	}else{$users->setLogin($_POST["ident"]);}
	if(trim($_POST["Genre"])==""){
		$errors[] = $commons->getValue("film_require_Genre");
		$valid = false;
	/*}elseif(!checkdnsrr(array_pop(explode("@",$_POST["email"])),"MX")){
		$errors[] = "le domaine sp&eacute;cifi&eacute; pour l'email n'est pas valide";
		$valid = false;*/
	}else{$users->setMail($_POST["Genre"]);}
	$users->setAdmin($_POST["admin"]);
	$users->setAuth($_POST["authorized"]);
	$users->setUseAjax($_POST["use_ajax"]);

	if($valid){
		if($_POST["new"]) $users->register();
		if($_POST["modif"]) $users->update($_POST["Titre"]);
		/*if($login->getLogin() == $_POST["Titre"]){
			$login->logIn($users->getLogin(), $users->getPasse());
			$_SESSION["login"] = serialize($login);
		}
	}elseif($_POST["new"]) $_GET["new"]=1;
}

/****************************************************/
/*                  Page HTML                       */
/****************************************************/
//inclusion en tete liste
$headCaption = $commons->getValue("titre");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<?php
include(_includePath.'html-header.php');
?>
</head>
<body>
	<div id="smalllogo"><img src="../images/logo.jpg" alt="" /></div>
<?php include(_includePath."top-divx.inc.php"); ?>
<?php include(_includePath.'films_menu.php'); ?>
	<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" onSubmit="return verifForm(this)" class="headline">
<div id="corpus">

<?php	if(!$valid && count($errors)>0){
		echo "\t<div class=\"error\">\n";
		echo "\t\t<p>".$commons->getValue("form_errors")."</p>\n";
		echo "\t\t<ul>\n";
		foreach($errors as $error)
			echo "\t\t\t<li>".$error."</li>";
		echo "\t\t</ul>\n";
		echo "\t</div>\n";
	}
?>
	<fieldset>
		<legend><?php echo (isset($_GET["new"]))?$commons->getValue("newfilm"):preg_replace("(%l)", $users->getLogin(), $commons->getValue("editfilm")); ?></legend>
		<div id="dates">
<?php/*
echo "<strong>".$commons->getValue("film_date_inscription")."</strong> : ";
echo utf8_encode(strftime("%A %e %B %G &agrave; %R", strtotime($films->getDateInscription())));
echo "<br />\n";*/
?>
		</div>
		<input type="hidden" name="<?php echo (isset($_GET["new"]))?"new":"modif"; ?>" value="1" />
		<input type="hidden" name="orig_titre" value="<?php echo $title->getTitle(); ?>" />
		<label for="ident"><?php echo $commons->getValue("Film_Title"); ?></label>
		<input name="ident" id="ident" type="text" size="20" <?php echo "value=\"".$films->getTitle()."\""; ?> /><br />
		<label for="genre"><?php echo $commons->getValue("Films_Genre"); ?></label>
		<input name="genre" id="genre" type="text" size="20" <?php echo "value=\"".$films->getGenre()."\""; ?> /><br />

<?php
echo "\t\t<input name=\"admin\" id=\"admin\" type=\"checkbox\" value=\"1\"";
if($users->isAdmin()) echo " checked=\"checked\"";
echo " />";
?><br />
		<label for="authorized"><?php echo $commons->getValue("user_auth"); ?></label>
<?php 
echo "\t\t<input name=\"authorized\" id=\"authorized\" type=\"checkbox\" value=\"1\"";
if($users->isAuth()) echo " checked=\"checked\"";
echo " />";
?><br />
		<label for="use_ajax"><?php echo $commons->getValue("use_ajax"); ?></label>
<?php 
echo "\t\t<input name=\"use_ajax\" id=\"use_ajax\" type=\"checkbox\" value=\"1\"";
if($users->useAjax()==1) echo " checked=\"checked\"";
echo " />";
?>
<input id="submit" type="submit" value="<?php echo (isset($_GET["new"]))?$commons->getValue("add_button"):$commons->getValue("save_button"); ?>" />
	</fieldset>
	<!--<table class="smalldetails" id="details">
		<tfoot>
			<tr>
				<td colspan="2">
					<input type="submit" value="<?php echo (isset($_GET["new"]))?$commons->getValue("add_button"):$commons->getValue("save_button"); ?>" />
				</td>
			</tr>
		</tfoot>
		<tbody>
		<tr> 
			<th class="none"><label for="ident"><?php echo $commons->getValue("Films_Titre"); ?></label></th>
			<td><input name="ident" id="ident" type="text" size="20" <?php echo "value=\"".$films->getTitle()."\""; ?> /></td>
		</tr>
		<tr>
			<th class="none"><label for="email"><?php echo $commons->getValue("Films_Genre"); ?></label></th>
			<td><input name="email" id="email" type="text" size="20" <?php echo "value=\"".$films->getGenre()."\""; ?> /></td>
		</tr>
			
		
		
		</tbody>
	</table>-->
<?php
include(_includePath.'copyright.php');
?>
</div>
</form>
</body>
</html>

===================================

erreur

[Mon Apr 09 17:39:00 2007] [error] [client 127.0.0.1] PHP Parse error:  syntax error, unexpected $end in /var/www/html/videotheque2/films/new.php on line 156