parse error, unexpected $
Posted: Wed Oct 22, 2008 4:11 pm
Hi Everyone,
I am new to PHP and working on table updation. My company has its own style of writing the code. I am getting a blank page on including this file. On using a debugger. i got parse error: unexpected $
Here is the code:
I have no idea what am i doing wrong. Any help will be appreciated.
Thanks
I am new to PHP and working on table updation. My company has its own style of writing the code. I am getting a blank page on including this file. On using a debugger. i got parse error: unexpected $
Here is the code:
Code: Select all
<?
//////////////////////////////////////////////
// PrintInv Class
// Represents the date of print invoices
/////////////////////////////////////////////
require_once ("$inc_path/db/db_record.inc");
require_once ("$inc_path/db/clinic.inc");
require_once ("$inc_path/db/patient.inc");
require_once ("$inc_path/db/purchase.inc");
require_once ("$inc_path/transaction.inc);
class PrintInv extends DBRecord {
var $patient;
var $clinic;
var $purchase;
var $transaction;
//////////////////////////////////////////
// CONSTRUCTOR
// called when new object is instantiated
/////////////////////////////////////////
function PrintInv($id=0) {
$this->DBRecord('invoice_print', 'inv_id', $id);
/////////////////////////////////////////////////////////////////////////////
//where invoice_print is the new table to store current date .
//patient_id, clinic_id and purchase_id are the foreign keys in this table
////////////////////////////////////////////////////////////////////////////
//Patient constructor is called
if ($this->get('patient_id')) {
$this->patient = new Patient($this->get('patient_id'));
if (!$this->patient->get('patient_name')) {
$this->patient = 0;
}
}
//Clinic constructor is called
if ($this->get('clinic_id')) {
$this->clinic = new Clinic($this->get('clinic_id'));
if (!$this->clinic->get('clinic_name')) {
$this->clinic = 0;
}
}
//Purchase constructor is called
if ($this->get('purchase_id')) {
$this->purchase = new Purchase($this->get('purchase_id'));
if (!$this->purchase->get('purchase_type')) {
$this->purchase = 0;
}
}
//Transaction constructor is called
if ($this->get('transaction_no')) {
$this->transaction = new Transaction($this->get('transaction_no'));
}
}
function storeNew() {
$this->set('invoice_no', this->transaction->get('invoice_no'));
$this->set('print_date', date('Y-m-d'));
$id = parent::storeNew();
return $id;
}
}
?>Thanks