Hello
I'm receiving the following error:
Parse error: syntax error, unexpected T_STRING in /home/valuesbo/newvbc/trunk/app/code/local/Oggetto/School/controllers/ViewController.php on line 95
Here is my code. I have put line 95 in bold:
<?php
class Oggetto_School_ViewController extends Mage_Core_Controller_Front_Action
{
protected function _getSchoolSession()
{
return Mage::getSingleton('school/session');
}
protected function _isLoggedIn()
{
return Mage::getSingleton('school/session')->isLoggedIn();
}
public function printableAction()
{
$id = $this->getRequest()->getParam('id');
set_time_limit(0);
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
$DataArr = array();
$id = $this->getRequest()->getParam('id');
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$query_i = "select catalogdata from interactivecatalog where catalogid='" . $id . "'";
$interactice=$write->query($query_i);
$interactice_row = $interactice->fetchAll();
$DataArr = unserialize($interactice_row[0]['catalogdata']);
$flag = false;
if (count($DataArr) > 0) {
$flag = true;
if (!isset($pdf)){
$pdf = Mage::getModel('sales/order_pdf_orgpdf')->getPdf($DataArr);
} else {
$pages = Mage::getModel('sales/order_pdf_orgpdf')->getPdf($DataArr);
$pdf->pages = array_merge ($pdf->pages, $pages->pages);
}
}
if ($flag) {
$filename = "interactive_catalog_".date("Y-m-d_H-i",time());
return $this->_sendUploadResponse($filename.'.pdf', $pdf->render(), 'application/pdf');
}
die;
}
public function catalogpdfAction()
{
set_time_limit(0);
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
$DataArr = array();
$id = $this->getRequest()->getParam('id');
$html = '';
if(!empty($id))
{
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$readresult=$write->query("select school_name,school_login_email,school_contact_email_1,school_contact_email_2 from school where school_id in (" . $id . "0)");
$org_rows = $readresult->fetchAll();
$page = 0;
foreach($org_rows as $v_key => $v_value)
{
if($v_value['school_name'] != '')
{
$school_name = $v_value['school_name'];
}else
{
$school_name = 'Values Book Club';
}
$DataArr[$page]['title'] = $school_name ." Fundraiser!";
$DataArr[$page]['Headermessage'] = "Choose from hundreds of great books, CDs and DVDs for all ages at www.valuesbookclub.com.";
$DataArr[$page]['Headermessage1'] = " Everything is discount-priced and shipped to your home. " . $school_name ;
$DataArr[$page]['Headermessage2'] = " will receive a check for 15% of all books ordered and 10% of all CDs and DVDs.";
$DataArr[$page]['Headermessage3'] = " Order $20 or more and your shipping is free. If you don't see your desired product after searching, check back in a few days. Many times we can secure the item. Here are this month's features.";
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('interactivecatelog', '1')
->addAttributeToFilter('status', 1)
->addAttributeToFilter('visibility', 4)
->addAttributeToSelect('*')
->addRandonSelect();
$productData = $collection->getData();
$html .= '<div><table align="center" width="100%" height="1200" border="0">';
$html .= '<tr>';
$html .= '<td colspan="4" align="center"><strong><font color="#1F497D" size="+2">' . $school_name . ' Fundraiser!</font></strong></td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td colspan="4" align="center">
<table align="center" width="100%" border="0">
<tr>
<td align="left">
<font color="#1F497D" face="Times New Roman" size="12">
Choose from hundreds of great books, CDs and DVDs for all ages at [url]www.valuesbookclub.com[/url]. Everything is discount-priced and shipped to your home. ' . $school_name . ' will receive a check for 15% of all books ordered and 10% of all CDs and DVDs. Order $20 or more and your shipping is free!;
If you don't see your desired product after searching, check back in a few days. Many times we can secure the item. Here are this month’s features.; </font>
</td>
</tr>
</table>
</td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td colspan="4" align="left"><font color="#1F497D" size="14">Books:</font></td>';
$html .= '</tr>';
$columnCount = 4;
$collectionSize= count($productData);
$i = 0;
$cd = array("(CD/DVD)","(CD)", "(DVD)", "(Blu-ray)");
$Books = array("(Hardcover)", "(Paperback)");
// Book //
$i11 = 0;
foreach($productData as $prod){
$_product = Mage::getModel('catalog/product')->load($prod['entity_id']);
$Prodata = $_product->getData();
$imageUrl = substr($_product->getImageUrl(), 30);
$description = trim($_product->getshort_description());
if(in_array($description,$Books))
{
if($i<4){
if($i++%$_columnCount==0):
$html .= '<tr>';
endif;
$DataArr[$page]['Books'][$i11]['image'] = "/home/valuesbo/newvbc/trunk".$imageUrl;
$DataArr[$page]['Books'][$i11]['url'] = $_product->getProductUrl();
$DataArr[$page]['Books'][$i11]['listprice'] = number_format(round($Prodata['price'],2),2,'.','');
$DataArr[$page]['Books'][$i11]['vbcprice'] = number_format(round($Prodata['special_price'],2),2,'.','');
$DataArr[$page]['Books'][$i11]['productname'] = $_product->getName();
$html .= '<td>';
$html .= '<table>';
$html .= '<tr>';
$html .= '<td>';
$html .= ' <img src="..'.$imageUrl.'" width="125px" height="125px"/>';
$html .= '</td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td>';
$html .= '<font face="Arial" size="10"><a class="product-name" href="'.$_product->getProductUrl().'" title="'.$_product->getName().'">'.substr($_product->getName(),0,60).'</a></font>';
$html .= '</td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td><font face="Times New Roman" size="10">List Price: $'.number_format(round($Prodata['price'],2),2,'.','').'</font><br />
<font face="Times New Roman" size="12"><strong>VBC Price: $'. number_format(round($Prodata['special_price'],2),2,'.','').'</strong></font></td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</td>';
if($i%$_columnCount==0 || $i==$_collectionSize):
$html .= '</tr>';
endif;
}
$i11++;
}
}
// Book //
$cd = 0;
foreach($productData as $prod){
$_product = Mage::getModel('catalog/product')->load($prod['entity_id']);
$Prodata = $_product->getData();
$imageUrl = substr($_product->getImageUrl(), 30);
$description = trim($_product->getshort_description());
//if($description == '(CD)')
if(stristr($description,"CD"))
{
$cd++;
}
}
if($cd >0)
{
$html .= '</tr><tr>';
$html .= '<td colspan="4" align="left"><font color="#1F497D" size="14">CDs:</font></td>';
$html .= '</tr>';
}
// CD
$i=0;
$i12=0;
foreach($productData as $prod){
$_product = Mage::getModel('catalog/product')->load($prod['entity_id']);
$Prodata = $_product->getData();
$imageUrl = substr($_product->getImageUrl(), 30);
$description = trim($_product->getshort_description());
//if($description == '(CD)')
if(stristr($description,"CD"))
{
if($i<4){
if($i++%$_columnCount==0):
$html .= '<tr>';
endif;
I appreciate your help.