acorsa | Bonjour, J'ai une erreur qui va me rendre folle... Voici le message d'erreur: Parse error: syntax error, unexpected $end in /...../translator/new_query.php on line 524 Sachant que la ligne en question est la dernière ligne...et qu'elle est vide...je vous montre mon code: Code :
- <?php
- include_once ("../auth.php" );
- include_once ("../authconfig.php" );
- include_once ("../check.php" );
- if (($check['user_type']!=1) && ($check['user_type']!=2) && ($check['user_type']!=3) && ($check['user_type']!=4))
- {
- ?>
- <html><head></head><body><p>Access only for *** members!</p></body></html>
- <?
- exit;
- }
- $project_pwd=$_COOKIE["project_pwd"];
- $login=$_COOKIE["login"];
- mysql_connect($mysqlhost, $mysqluser, $mysqlpass);
- mysql_select_db($mysqlbase);
- $query2=mysql_query("select distinct Project_name from Projects where Password='$project_pwd'" );
- while($query2 and $data = mysql_fetch_array($query2)) {
- $project_name=$data["Project_name"];
- }
- $ispwdcorrect=mysql_query("select * from Projects where Password='$project_pwd'" );
- $howmanyrows=mysql_num_rows($ispwdcorrect);
- if ($howmanyrows==0) {
- echo "You typed the incorrect project password ! Please try <a href=../index.php>again</a>";
- exit;
- }
- $project_pwd=$_COOKIE["project_pwd"];
- $login=$_COOKIE["login"];
- mysql_connect($mysqlhost, $mysqluser, $mysqlpass);
- mysql_select_db($mysqlbase);
- /****************************** Project name *****************************/
- $query1=mysql_query("select distinct Project_name from Projects where Password='$project_pwd'" );
- while($query1 and $data = mysql_fetch_array($query1)) {
- $project_name=$data["Project_name"];
- }
- /************************************************************************/
-
- /************** Check if the project password is correct ***************/
- $ispwdcorrect=mysql_query("select * from Projects where Password='$project_pwd'" );
- $howmanyrows=mysql_num_rows($ispwdcorrect);
- if ($howmanyrows==0) {
- echo "You typed the incorrect project password ! Please try <a href=../index.php>again</a>";
- exit;
- }
- /************************************************************************/
-
- /************** If the user click on "Create" button ********************/
- if (isset($_POST['add_new_query'])) {
-
- if(isset($_POST['author'])) $name=$_POST['author'];
- if(isset($_POST['language'])) $lg=$_POST['language'];
- if(isset($_POST['file']) ) $file=$_POST['file'];
-
- if(isset($_POST['upload'])) $upload=$_POST['upload'];
- else $upload="";
- if(isset($_POST['query'])) $query=$_POST['query'];
-
- if(isset($_POST['reference'])) $reference=$_POST['reference'];
-
- if(isset($_POST['proposal'])) $proposal=$_POST['proposal'];
-
- if(isset($_POST['type'])) $type=$_POST['type'];
-
- if (isset($_POST['context'])) $context=$_POST['context'];
- if(!empty($name) && !empty($lg) && !empty($file) && !empty($query) && !empty($reference) && !empty($proposal) && !empty($type))
- {
- $date = date("j-m-Y" );
- $querycount=mysql_query("select * from Queries where Project_name='$project_name' and Translator_name='$name' and Language_name='$lg' and Query_type='$type' and Query_text='$query' and Doc_name='$file' and Proposal='$proposal' and Reference='$reference' and Context='$context' " );
- $howmanyrows2=mysql_num_rows($querycount);
- /*test to know if the query is already into the database*/
- if ($howmanyrows2==0) {
- /*insert the query with the status : pending (1) */
- $sql = "INSERT INTO Queries (Project_name,Translator_name,Language_name,Query_type,Query_text,Doc_name,Proposal,Reference,Creation_date,Query_status,Replied, Context) VALUES ('$project_name','$name','$lg','$type','$query','$file','$proposal','$reference','$date',1,0,'$context')";
- mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
- }
- }
- /************************************************************************/
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd'" );
- /*************************** click on filter button **************************/
- if (isset($_POST['btn_filter'])) {
- if (isset($_POST ['filter'])) $filter=$_POST ['filter'];
- else $filter="";
- if (isset($_POST ['language'])) $language=$_POST ['language']; /* $language= Array['language']*/
- else $language="";
- /* list of selected languages */
- if ($language!="" ){
- if ($filter=="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name'" );
- }
- }
- }
- }
- if ($filter=="all" ) {
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd'" );
-
- if ($language!="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name'" );
- }
- }
- }
- }
- else if ($filter=="answered" ) {
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Replied=1" );
-
- if ($language!="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name' and Replied=1" );
- }
- }
- }
- }
- else if ($filter=="not_answered" ) {
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Replied=0 " );
- if ($language!="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name' and Replied=0" );
- }
- }
- }
- }
- else if ($filter=="answered_by_client" ) {
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Replied=1 and Query_status=4" );
- if ($language!="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name' and Replied=1 and Query_status=4" );
- }
- }
- }
- }
- else if ($filter=="answered_by_ln" ) {
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date, Query_status from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Replied=1 and Query_status=2" );
- if ($language!="" ) {
- for ($i = 0; $i < count($language); $i++)
- {
- $query54=mysql_query("select distinct ISO,language_name from Languages where ISO='$language[$i]'" );
- while($query54 and $data = mysql_fetch_array($query54)){
- $lg_name=$data["language_name"];
- $query51=mysql_query("select distinct customer_name,Translator_name, Q.language_name,Replied, Query_type,Doc_name, Reference, Proposal, Query_text, Creation_date from Projects P inner join Queries Q on (P.Project_name=Q.Project_name) where P.Password='$project_pwd' and Q.Language_name='$lg_name' and Replied=1 and Query_status=4 and Replied=1 and Query_status=2" );
- }
- }
- }
- }
- }
- ?>
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html;" charset="iso-8859-1/">
- <link href="./../css/styleQuery.css" rel="stylesheet" type="text/css" />
-
- <title>LinguaNet</title>
-
- <script type="text/javascript">
- <!-- <![CDATA[
- function wyslij(t) {
- t.target="odp";
- odp = window.open("","odp","toolbar=no,menubar=no,scrollbars=yes,resizable=yes,height=520,width=580" );
- odp.moveTo(0, 0)
- odp.focus();
- return true;
- }
- // ]]> -->
- </script>
- </head>
- <body>
- <!-- main table -->
- <table width="900" align="center" cellpadding="3" cellspacing="3" >
- <tr>
- <td width="100%">
- <table style="border-style:solid; border-width:1px; border-color:b2b2b2;" cellpadding="0" cellspacing="0">
- <tr>
- <td bgcolor="#E3E4E8">
- <table width="100%" cellpadding="0" cellspacing="0">
- <tr>
- <td width="100%">
- <img src="./../img/banner.jpg">
- </td>
- </tr>
- </table>
- <table width="100%" cellpadding="0" cellspacing="0" bgcolor="#E3E4E8">
- <tr>
- <td width="99%" height="15" align="right">
- <font color="#AC1100" face="verdana" size="1"><b>> My LinguaNet</b>
- </td>
- <td width="1%"></td>
- </tr>
- </table>
- <table width="100%" cellpadding="0" cellspacing="0" bgcolor="#AC1100">
- <tr>
- <td width="50%" height="20" align="left">
- <b><a href="http://***.net"><img src="./../img/home.jpg" border=0></a>
- </td>
- <td width="48%" height="20" align="right">
- <font face="verdana" size="1" color="white"><a href="./../logout.php"><b>Logout</b></font>
- </td>
- <td width="2%" height="20"></td>
- </tr>
- </table>
-
- <table width="100%" cellpadding="0" cellspacing="0" bgcolor="#E3E4E8">
- <tr>
- <td bgcolor="#E3E4E8" height="10"></td>
- </tr>
- <tr >
- <td align="center">
- <form method=post action="export.php" enctype="multipart/form-data">
- <b>Import a csv list:</b>
- <input type="hidden" name="MAX_FILE_SIZE" value="100000">
- <input name="export" type="file" style="width:240px; height:20px;">
- <input type="submit" name="btn_export" value="Import">
- </form>
- </td>
- </tr>
- </table></td></tr></table>
-
- <table width="100%" cellpadding="0" cellspacing="0" bgcolor="#E3E4E8" >
-
- <tr>
- <td bgcolor="#E3E4E8" height="10"></td>
- </tr>
- <tr width="100%">
- <td width="5%"></td>
- <td width="30%" align="center" bgcolor="#E3E4E8">
- <input type="button" value="Get a template" onClick="self.location.href='./../excel_template.xls'" style="width:130px; height:20px;">
- </td>
- <td width="30%" align="center" bgcolor="#E3E4E8">
- <input type="button" value="Create a new query" onClick="self.location.href='new_query.php'" style="width:130px; height:20px;">
- </td>
- <td width="30%" align="center" bgcolor="#E3E4E8">
- <input type="button" value="Search" onClick="self.location.href='search.php'" style="width:130px; height:20px;">
- </td>
- <td width="5%"></td>
- </tr>
- <tr>
- <td bgcolor="#E3E4E8" height=20></td>
- </tr>
-
- <table ="0" width="100%" height="100%" cellpadding="0" colspaccing="0" bgcolor="#E3E4E8">
- <form method="post" action="index.php">
- <tr>
- <td> <b> Filter by : </b></td>
- <td colspan="6" align="center">
- <input type="radio" name="filter" value="answered" > Answered
- <input type="radio" name="filter" value="not_answered"> Not answered
- <input type="radio" name="filter" value="answered_by_ln"> Answered by LinguaNet
- <input type="radio" name="filter" value="answered_by_client" > Answered by customer
- <input type="radio" name="filter" value="all"> All queries
- </td>
- </tr>
- <tr>
- <td bgcolor="#E3E4E8" height=10></td>
- </tr>
- </table>
- <table ="0" width="100%" height="100%" cellpadding="0" colspaccing="0" bgcolor="#E3E4E8">
- <tr width="100%">
- <?
- $query2=mysql_query("select distinct language_name from Projects where Password='$project_pwd' order by language_name ASC" );
-
- while($query2 and $data = mysql_fetch_array($query2)) {
- $lg_list=$data["language_name"]; /*$lg_list=EN;FR;IT;HU;... */
- $explode = explode (";",$lg_list);
- $count=substr_count($lg_list,";" ) ;
- for ($j=0;$j<$count;$j++) {
- $lg_iso = $explode[$j];
- $flag_name=$lg_iso.".png";
-
- /****** to divide the row second the number of flags ********/
- $div=100/$count;
- $cell_size=intval(abs($div));
-
- $query3=mysql_query("select distinct language_name, ISO from Languages where ISO='$lg_iso'" );
- while($query3 and $data = mysql_fetch_array($query3)) {
- $lg_name=$data["language_name"];
- echo"<td width=\"$cell_size%\" bgcolor=\"#E3E4E8\" align=\"center\">
- <input type=\"checkbox\" name=\"language[]\" value=\"$lg_iso\"></input><img src=./../img/flagues/$flag_name style=\"border-style:solid; border-width:1px; border-color:black;\" title='$lg_name' width=18 height=13>
- </td>";
- }
- }
- }
- ?>
- </tr>
- <table width="100%" bgcolor="#E3E4E8">
- <tr>
- <td bgcolor="#E3E4E8" height=10></td>
- </tr>
- <tr>
- <td align="center"><input type="submit" name="btn_filter" value="Filter" style="width:240px; height:20px;"></td>
- </tr>
- </table>
- </form>
-
- <tr>
- <td bgcolor="#E3E4E8" height=20></td>
- </tr>
- <tr bgcolor="#E3E4E8">
- <td colspan="4">
- <b>Project name: <? echo $project_name ;?></b>
- </td>
- </tr>
- <tr>
- <td bgcolor="#E3E4E8">
- <b>You will add a new query:</b>
- <form method=post action="new_query.php" >
- <table align="center">
- <tr>
- <td width="45%" align="center">
- <table>
- <tr>
- <td>Author</td>
- <td>
- <?echo "<input type=\"text\" name=\"author\" value='$login' style=\"width:266px; height:23px;\">";?>
- </td>
- </tr>
- <tr>
- <td>Language </td>
- <td>
- <?
- $result=mysql_query("select distinct language_name from Languages order by language_name ASC" );
- echo "<select name=\"language\">";
- while($result and $data = mysql_fetch_array($result)) {
- $lg=$data["language_name"];
- echo "<option value=\"$lg\">$lg</option>";
- }
- echo " </select>";
- ?>
- </td>
- </tr>
- <tr>
- <td>File </td>
- <td>
- <input type="text" name="file" style="width:266px; height:23px;">
- </td>
- </tr>
- <tr>
- <td>Upload </td>
- <td>
- <input type="hidden" name="MAX_FILE_SIZE" value="100000">
- <input name="upload" type="file" style="width:340px; height:20px;">
- </td>
- </tr>
- <tr>
- <td>Type </td>
- <td>
- <?
- $result2=mysql_query("select distinct type_name from Query_type" );
- echo "<select name=\"type\">";
- while($result2 and $data = mysql_fetch_array($result2)) {
- $type=$data["type_name"];
- echo "<option value=\"$type\">$type</option>";
- }
- echo " </select>";
- ?>
- </td>
- </tr>
- <tr>
- <td>String ID </td>
- <td>
- <input type="text" name="stringID" style="width:266px; height:23px;">
- </td>
- </tr>
- </table>
- </td>
- <td width="45%" align="left" valign="top">
- <table>
- <tr>
- <td>Source text </td>
- <td>
- <textarea name="reference" rows="1" cols="30"></textarea>
- </td>
- </tr>
- <tr>
- <td>Proposal </td>
- <td>
- <textarea name="proposal" rows="1" cols="30"></textarea>
- </td>
- </tr>
- <tr>
- <td>Query </td>
- <td>
- <textarea name="query" rows="1" cols="30"></textarea>
- </td>
- </tr>
- <tr>
- <td>Context </td>
- <td>
- <textarea name="context" rows="1" cols="30"></textarea>
- </td>
- </tr>
- </table>
- </td>
- <td width="10%" align="left">
- <input type="submit" value="Create" name="add_new_query" style="width:50px; height:130px;">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
-
-
- <form method=post action="popup.php" onsubmit="return wyslij(this);">
- <tr bgcolor="#E3E4E8">
- <td height="30" colspan="2"><b>Queries already wrote for this project:</b></td>
- </tr>
- <tr>
- <div style="width:100%;overflow:auto;">
- <table id=mainTable1 cellpadding="0" cellspacing="0" style="width:100%;overflow:hidden;">
- <tr>
- <td id=th1 width=33px>Date</td>
- <td id=th1 width=17px>Lg</td>
- <td id=th1 width=75px>File</td>
- <td id=th1 width=60px>Type</td>
- <td id=th1 width=124px>Source text</td>
- <td id=th1 width=123px>Proposal</td>
- <td id=th1 width=119px>Query/Comment</td>
- <td id=th1 width="1%">Reply</td>
- </tr>
- </table>
- </div>
- <div style="width:100%;height:188px;overflow-Y:auto;">
- <table id=mainTable1 cellpadding="0" cellspacing="0" style="border-collapse: collapse; width:100%; overflow:hidden">
- <?
- while($query51 and $data = mysql_fetch_array($query51)) {
- $author=$data["Translator_name"];
- $language=$data["language_name"];
- $doc_name=$data["Doc_name"];
- $doc_type=$data["Query_type"];
- $reference=$data["Reference"];
- $proposal=$data["Proposal"];
- $query=$data["Query_text"];
- $replied=$data["Replied"];
- $date=$data["Creation_date"];
-
- $query52=mysql_query("select distinct query_id from Queries where Project_name='$project_name' and Query_text='$query'" );
- while($query52 and $data = mysql_fetch_array($query52)){
- $query_id=$data["query_id"];
- }
-
- $query53=mysql_query("select distinct ISO from Languages where language_name='$language' " );
- while($query53 and $data = mysql_fetch_array($query53)){
- $iso=$data["ISO"];
- }
- echo "<tr>
- <td width=50px><div class=fix_cell_small><font size=2>$date</font</div></td>
- <td width=28px><div class=fix_cell_lg>$iso</div></td>
- <td width=100px><div class=fix_cell_large>$doc_name</div></td>
- <td width=80px><div class=fix_cell_type>$doc_type</div></td>
- <td width=160px><div class=fix_cell_large>$reference</div></td>
- <td width=160px><div class=fix_cell_proposal>$proposal</div></td>
- <td width=160px><div class=fix_cell_query>
- <a href=\"popup.php?query_id=$query_id\" onclick=\"return !window.open(this.href,null,'width=595,height=670, status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars=no, resizable=yes');\"><font color=\"blue\">$query</font></a>
- </div></td>
- <td id=td1 width=2px >";
- if ($replied==0) echo "<img src=\"./../img/checkbox_nc.JPG\"></td>";
- else echo"<img src=\"./../img/checkbox.JPG\"></td>";
- }
- ?>
- </form>
- </table>
- </div>
- </tr>
- </table>
- </table>
-
- </td></tr></table>
- </body>
- </html>
|
J'ai vérifié toutes les accolades, je comprends pas... Merci de bien vouloir m'aider!
Message édité par acorsa le 02-04-2007 à 10:28:30
|