2014-10-02 65 views
-1

运行下面的代码时出现此错误消息。下面是给我错误消息的代码。这是错误消息在我的php脚本中出现语法错误

Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\jq\fines\admin\portal.php on line 218 

我的代码:

<body class="easyui-layout"> 
<div region="north" class="title" border="false" style="height:40px;"> 
Client Services Admin Portal 
</div> 
<div region="center" border="false"> 
<div id="pp" style="position:relative"> 
<div style="width:30%;"> 
<div title="Time" style="text-align:center;background:#f3eeaf;height:170px;padding:5px;"> 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100" height="100"> 
<param name="movie" value="http://www.respectsoft.com/onlineclock/analog.swf"> 
<param name=quality value=high> 
<param name="wmode" value="transparent"> 
<embed src="http://www.respectsoft.com/onlineclock/analog.swf" width="100" height="100" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed> 
</object> 
</div> 
<div title="Current Users Logged On" collapsible="true" closable="false" style="height:250px;padding:3px;"> 
<center> 
<?php require_once "fines/admin/usersloggedon.php"; ?> 
</center> 
</div> 
</div> 
<div style="width:70%;"> 
<div title="Search for receipt" closable="false" style="height:170px;padding:10px;"> 
<center> 
<form action="" method="post" id="receiptnumSearch"> 
<input type="hidden" name="check" value="submitted"> 
<input class="easyui-searchbox" style="width:200px" name="receiptnum" data-options="prompt:'',searcher:doReceiptSearch"> 
</form> 
    <br/> 
<div style="background-color:#3FF; height:1px">&nbsp;</div><br/> 
<?php 
require_once"functions.php"; 
if($_POST['check']=='submitted')//open1 
{ 
//checking for errors 
$receiptnum=trim($_POST['receiptnum']); 
if($receiptnum=='')//open 
{ 
//System error 
echo SysError('Search field empty', 'index.php?t='.urlencode(base64_encode("admin_fins")).'&o='.md5(date('Y-m-d : t')).''); 
die(); 

}//closed 
elseif(!empty($receiptnum))//open 
{      
?><table class='tablestyle2' width=95% cellpadding=2 cellspacing=0> 
<tr valign=top> 
<td ><table width="100%" border="0" cellspacing="0" cellpadding="0" class='tablestyle_inner'> 
<tr> 
<td width="40%" class='tableheader' height="25">Paid From Library</td> 
<td width="30%" class='tableheader'>Patron Name</td><td width="30%" class='tableheader'>Receipt Number</td> 
</tr> 
<?php 
$db1w = new PDO('mysql:host=10.40.254.229;dbname=koha_msulibrary;charset=utf8', 'root', 'philly'); 
$gt_r=$db1w->query("SELECT * FROM fine, borrowers,branch_libs where borrowers.cardnumber=fine.cardnumber AND branch_libs.brunchid=fine.brunchid AND fine.receiptNum='$receiptnum' LIMIT 0,1"); 
$gt_r_results=$gt_r->fetch(PDO::FETCH_ASSOC); 
echo' 
<tr> 
<td class=\'label\' height="25" align="center">'.$gt_r_results['branch_name'].'</td> 
<td class=\'label\' align="center">'.ucwords(strtolower($gt_r_results['firstname'].' '.$gt_r_results['surname'])).'</td> 
<td class=\'label\' align="center"><a target="_blank" href="http://www.msu.ac.zw/libraries/jq/fines/receipt.php?invoice='.base64_encode('invoce_view').'&t='.base64_encode($gt_r_results['receiptNum']).'">'.$gt_r_results['receiptNum'].'</a></td> 
</tr>'; 
    ?> 
</table></td></tr></table> 
<? 
}//closed 

}//closed 
?> 
</center> 
</div> 
<div title="Library Fines Statistics" closable="false" style="height:250px;text-align:center;"> 
<center> 
<br/><form action="" id="date_range" method="post"><table width="70%" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
<td width="39%"><input type="hidden" name="date_r" value="date_r"><input name="data1" class="easyui-datebox" value="Start Date" width="200px"></input></td> 
<td width="37%"><input name="data2" class="easyui-datebox" value="End Date" width="200px"></input></td> 
<td width="24%"><a href="javascript:doViewFines()" class="easyui-linkbutton" plain="true">View Fines</a></td> 
    </tr> 
</table></form> 
<br/> 
<?php 
$data1=$_POST['data1']; 
$data2=$_POST['data2']; 
$date_r=$_POST['date_r']; 
$dat=date('Y-m-d'); 
$da_1=strtotime($data1); 
$data_=date('Y-m-d',$da_1); 
//$da_2=strtotime($data2_); 
//$data2=date('Y-m-d',$da_2); 

//checking if date is real date 
if((!isRealDate($data1) or !isRealDate($data2) or $dat < $data_) and $date_r=='date_r') 
{ 
echo SysError('Incorrect date range', 'index.php?t='.urlencode(base64_encode("admin_fins")).'&o='.md5(date('Y-m-d : t')).''); 
die(); 
} 
//end of check 
else{ 
?> 
<table width=95% height="125" cellpadding=2 cellspacing=0 class='tablestyle2'> 
<tr valign=top><td ><table width="100%" height="122" border="0" cellpadding="0" cellspacing="0" class='tablestyle_inner'> <tr> <td width="50%" class='tableheader' height="19">Branch Library</td> <td width="50%" class='tableheader'> 
<?php 
if($date_r=='date_r') 
{ 
echo 'Fine collected between '.$data1.' and '.$data2; 
} 
else 
{ 
echo 'Fines Collected to Date'; 
} 
?></td> 
</tr> 
<tr> 
<td class='label' height="12" >Batanai Library</td> 
<td class='label' style="padding-left:10px"> 
<?php //checking if the date is real 
if($date_r!='date_r') 
{ 
echo GETbranchlibs('2'); 
} 
elseif($date_r=='date_r') 
{ 
echo GetBrunchLibsRange($data1,$data2,'2'); 
} 
?></td> 
</tr> 
<tr> 
<td class='label' height="6">GSBL</td> 
<td class='label' style="padding-left:10px"> 
<?php 
if($date_r!='date_r') 
{ 
echo GETbranchlibs('3'); 
} 
elseif($date_r=='date_r') 
{ 
echo GetBrunchLibsRange($data1,$data2,'3'); 
} 
?></td> 
</tr> 
<tr> 
<td class='label' height="3" >Law Library</td> 
<td class='label' style="padding-left:10px"><?php 
if($date_r!='date_r') 
{ 
echo GETbranchlibs('4'); 
} 
elseif($date_r=='date_r') 
{ 
echo GetBrunchLibsRange($data1,$data2,'4'); 
} 
?></td> 
</tr> 
<tr> 
<td class='label' height="3" >Main Library</td> 
<td class='label' style="padding-left:10px"><?php 
if($date_r!='date_r') 
{ 
echo GETbranchlibs('1'); 
} 
elseif($date_r=='date_r') 
{ 
echo GetBrunchLibsRange($data1,$data2,1); 
} 
?></td> 
</tr> 
<tr> 
<td class='label' height="2" >Total</td> 
<td class='label' style="padding-left:10px; font-weight:bold;"><u><?php 
if($date_r!='date_r') 
{ 
echo GETbranchlibs('0'); 
} 
elseif($date_r=='date_r') 
{ 
echo GetBrunchLibsRange($data1,$data2,'0'); 
} 

} 
?></u></td> 
</tr> 
</table></td></tr></table></center> 
</div> 
</div> 
</div> 
</div> 
+0

“意外的文件结束”意味着您在大多数情况下比您拥有花括号更多的花括号。如果你正确地设置了代码的格式,你很可能会很容易地看到它开始的不匹配。 – Erik 2014-10-02 11:05:02

+0

这是一些基本的东西来解析。评论一下,然后再补充一点。 – 2014-10-02 11:05:35

+0

错误:未找到代码格式。 – Azrael 2014-10-02 11:14:10

回答

0

你在某处写道

<? instead of <?php 

所以才改变,它会工作。测试http://www.compileonline.com/execute_php_online.php

+0

短标签,但建议使用正常的<?php标签,这与OP的问题无关 – Azrael 2014-10-02 11:26:02

+0

是的,它确实与问题有关。用<?它不起作用,它使用<?php它。如果你不相信,请自己试试。 – Juru 2014-10-02 11:28:39

+0

谢谢Juru。它的工作 – user2919149 2014-10-02 12:03:14

相关问题