title: Syntax Error on my php script
body: <p>I  am getting this error message when run the code below. Below is the code that is giving me error messages. This is the error message </p>
  
  <pre><code>Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\jq\fines\admin\portal.php on line 218
  </code></pre>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>&lt;body class="easyui-layout"&gt;
  &lt;div region="north" class="title" border="false" style="height:40px;"&gt;
  Client Services Admin Portal 
  &lt;/div&gt;
  &lt;div region="center" border="false"&gt;
  &lt;div id="pp" style="position:relative"&gt;
  &lt;div style="width:30%;"&gt;
  &lt;div title="Time" style="text-align:center;background:#f3eeaf;height:170px;padding:5px;"&gt;
  &lt;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"&gt;
  &lt;param name="movie" value="http://www.respectsoft.com/onlineclock/analog.swf"&gt;
  &lt;param name=quality value=high&gt;
  &lt;param name="wmode" value="transparent"&gt;
  &lt;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"&gt;&lt;/embed&gt;
  &lt;/object&gt;
  &lt;/div&gt;
  &lt;div title="Current Users Logged On" collapsible="true"  closable="false" style="height:250px;padding:3px;"&gt;
  &lt;center&gt;
  &lt;?php require_once "fines/admin/usersloggedon.php"; ?&gt;  
  &lt;/center&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style="width:70%;"&gt;
  &lt;div title="Search for receipt"  closable="false" style="height:170px;padding:10px;"&gt;
  &lt;center&gt;
  &lt;form action="" method="post" id="receiptnumSearch"&gt;
  &lt;input type="hidden" name="check" value="submitted"&gt;
  &lt;input class="easyui-searchbox" style="width:200px" name="receiptnum" data-options="prompt:'',searcher:doReceiptSearch"&gt;
  &lt;/form&gt;
    &lt;br/&gt;
  &lt;div style="background-color:#3FF; height:1px"&gt;&amp;nbsp;&lt;/div&gt;&lt;br/&gt;
  &lt;?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")).'&amp;o='.md5(date('Y-m-d : t')).'');
  die();
  
  }//closed
  elseif(!empty($receiptnum))//open
  {                       
  ?&gt;&lt;table class='tablestyle2' width=95% cellpadding=2 cellspacing=0&gt;
  &lt;tr valign=top&gt;
  &lt;td &gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" class='tablestyle_inner'&gt;
  &lt;tr&gt;  
  &lt;td width="40%" class='tableheader' height="25"&gt;Paid From Library&lt;/td&gt;
  &lt;td width="30%" class='tableheader'&gt;Patron Name&lt;/td&gt;&lt;td width="30%" class='tableheader'&gt;Receipt Number&lt;/td&gt;
   &lt;/tr&gt;
  &lt;?php
  $db1w = new PDO('mysql:host=10.40.254.229;dbname=koha_msulibrary;charset=utf8', 'root', 'philly');
  $gt_r=$db1w-&gt;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-&gt;fetch(PDO::FETCH_ASSOC);   
  echo'
  &lt;tr&gt;  
  &lt;td class=\'label\' height="25" align="center"&gt;'.$gt_r_results['branch_name'].'&lt;/td&gt;
  &lt;td class=\'label\' align="center"&gt;'.ucwords(strtolower($gt_r_results['firstname'].' '.$gt_r_results['surname'])).'&lt;/td&gt;
  &lt;td class=\'label\' align="center"&gt;&lt;a target="_blank" href="http://www.msu.ac.zw/libraries/jq/fines/receipt.php?invoice='.base64_encode('invoce_view').'&amp;t='.base64_encode($gt_r_results['receiptNum']).'"&gt;'.$gt_r_results['receiptNum'].'&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;';
    ?&gt;
  &lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  &lt;?
  }//closed
  
  }//closed
  ?&gt;
  &lt;/center&gt;
  &lt;/div&gt;
  &lt;div title="Library Fines Statistics" closable="false" style="height:250px;text-align:center;"&gt;
  &lt;center&gt;
  &lt;br/&gt;&lt;form action="" id="date_range" method="post"&gt;&lt;table width="70%" border="0" cellspacing="0" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;td width="39%"&gt;&lt;input type="hidden" name="date_r" value="date_r"&gt;&lt;input name="data1" class="easyui-datebox" value="Start Date" width="200px"&gt;&lt;/input&gt;&lt;/td&gt;
  &lt;td width="37%"&gt;&lt;input name="data2" class="easyui-datebox" value="End Date" width="200px"&gt;&lt;/input&gt;&lt;/td&gt;
  &lt;td width="24%"&gt;&lt;a href="javascript:doViewFines()" class="easyui-linkbutton" plain="true"&gt;View Fines&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;&lt;/form&gt;
  &lt;br/&gt;
  &lt;?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 &lt; $data_ ) and $date_r=='date_r')
  {
  echo SysError('Incorrect date range', 'index.php?t='.urlencode(base64_encode("admin_fins")).'&amp;o='.md5(date('Y-m-d : t')).'');
  die();
  }
  //end of check
  else{
  ?&gt;
  &lt;table width=95% height="125" cellpadding=2 cellspacing=0 class='tablestyle2'&gt;
  &lt;tr valign=top&gt;&lt;td &gt;&lt;table width="100%" height="122" border="0" cellpadding="0" cellspacing="0" class='tablestyle_inner'&gt; &lt;tr&gt;   &lt;td width="50%" class='tableheader' height="19"&gt;Branch Library&lt;/td&gt; &lt;td width="50%" class='tableheader'&gt;
  &lt;?php
   if($date_r=='date_r') 
  {
  echo 'Fine collected between '.$data1.' and '.$data2;
  }
  else
  {
  echo 'Fines Collected to Date';
  }
  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;  
  &lt;td class='label' height="12" &gt;Batanai Library&lt;/td&gt;
  &lt;td class='label' style="padding-left:10px"&gt;
  &lt;?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');
  }
  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class='label' height="6"&gt;GSBL&lt;/td&gt;
  &lt;td class='label' style="padding-left:10px"&gt;
  &lt;?php
  if($date_r!='date_r')
  {
  echo GETbranchlibs('3');
  } 
  elseif($date_r=='date_r')
  {
  echo  GetBrunchLibsRange($data1,$data2,'3');
  }
  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class='label' height="3" &gt;Law Library&lt;/td&gt;
  &lt;td class='label' style="padding-left:10px"&gt;&lt;?php
  if($date_r!='date_r')
  {
  echo GETbranchlibs('4');
  }
  elseif($date_r=='date_r')
  {
  echo  GetBrunchLibsRange($data1,$data2,'4');
  }
  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class='label' height="3" &gt;Main Library&lt;/td&gt;
  &lt;td class='label' style="padding-left:10px"&gt;&lt;?php 
  if($date_r!='date_r')
  {
  echo GETbranchlibs('1');
  }
  elseif($date_r=='date_r')
  {
  echo  GetBrunchLibsRange($data1,$data2,1);
  }
  ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td class='label' height="2" &gt;Total&lt;/td&gt;
  &lt;td class='label' style="padding-left:10px; font-weight:bold;"&gt;&lt;u&gt;&lt;?php 
  if($date_r!='date_r')
  {
  echo GETbranchlibs('0');
  }
  elseif($date_r=='date_r')
  {
  echo  GetBrunchLibsRange($data1,$data2,'0');
  }
  
  }
  ?&gt;&lt;/u&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>