$cryptinstall="../crypt/cryptographp.fct.php"; include $cryptinstall; include("../include/_connection.php"); include_once( "../include/_antispam.php" ); $id = GetValDefault( "id", null ); $typeAvis = GetValDefault( "typeAvis", null ); $libelle = null; $lib = null; $hereIs = ORIGIN_IS_AVIS; $url = null; $aError = null; // formulaire $auteur = GetFormDefault( "auteur", "" ); $code = GetFormDefault( "code", null ); $email = GetFormDefault( "email", "" ); $suivi = GetFormDefault( "suivi", 0 ); $titre = GetFormDefault( "titre", "" ); $critique = GetFormDefault( "critique", null ); $bAdd = ( !is_null( GetFormDefault( "ajout", null ) ) ); // gestion des erreurs if ( $id != null && !is_numeric( $id ) ){ redirectError(); } $lib = ""; $query = null; // y a t il une erreur sur l'id passé en paramètre ? switch( $typeAvis ){ case AVIS_FILM: // infos films $query = " SELECT titre, rewriterules FROM film WHERE fiActif = '1' AND id = $id "; $lib = "film"; break; case AVIS_DOSSIER: $query = " SELECT doTitre, NULL FROM dossier WHERE doId = $id "; $lib = "dossier"; $url = "/dossier/dossier.php?doId=".$id."&from=".$hereIs; break; case AVIS_PERSONNE: $query = " SELECT COALESCE( CONCAT( pePrenom, ' ', UPPER( peNom ) ), UPPER( peNom ) ), NULL FROM personne WHERE peId = $id "; $lib = "artiste"; $url = "/personne/personne.php?peId=".$id."&from=".$hereIs; break; default: redirectError(); } $rs = $dbh -> do_query( $query ); $rows = $dbh -> total_rows( $rs ); if( $rows == 0 ){ $dbh -> finish_sth($rs); redirectError(); }else{ list( $libelle, $rewriterules ) = $dbh -> fetch_array( $rs ); $dbh -> finish_sth($rs); switch( $typeAvis ){ case AVIS_FILM: $url = rewriteRules_film( $rewriterules, $hereIs ); break; case AVIS_DOSSIER: case AVIS_PERSONNE: } } // ajout BDD if( $bAdd ){ if( is_null( $code ) ){ $aError[0] = "L'anti-spam est obligatoire"; } if( $auteur == "" ){ $aError[1] = "Le pseudo est obligatoire"; } if( $titre == "" ){ $aError[2] = "Le titre est obligatoire"; } if( $email != "" ){ if ( !EMail_Verification( $email ) ){ $aError[3] = "Le format de l'e-mail saisi est invalide"; } } if( !chk_crypt( $_POST['code'] ) ){ $aError[4] = ""; } if( count( $aError ) == 0 ){ NewAvis( $typeAvis, $critique, $suivi, $libelle, $auteur, $id, $email, $titre ); $auteur = ""; $email = ""; $titre = ""; $critique = ""; } } PutHtmlHeader( "Vos commentaires sur '".$libelle."'" ); ?>
PutHtmlFooter( null, null ); ?>