I get Fatal error: Cannot redeclare getdatecreated() in /home/xxx/public_html/login/classes/user.php on line 158.
I have tried to debug this code by commenting out line 158, etc but it doesnt seem to help the situation. Any suggestions for advice would be very helpful. Thanks!
user.php:
<?
class User
{
var $m_FirstName;
var $m_LastName;
var $m_Email;
var $m_Phone;
var $m_PaymentType;
var $m_BillingCycle;
var $m_BillingStatus;
var $m_PromotionID;
var $m_Comments;
var $m_NextBill;
var $m_Password;
var $m_UserID;
var $m_DomainCount;
var $m_Current;
var $m_PaymentType;
var $m_PaymentTerm;
var $m_NextBillDate;
var $m_Address;
var $m_City;
var $m_State;
var $m_ZipCode;
var $m_DateCreated;
var $m_ArchivedInvoiceCount;
var $m_UninvoicedWorkCount;
var $m_Signature;
var $m_arrayUnsentInvoices;
var $m_arrayUnpaidInvoices;
var $m_UserGroupID;
var $m_LastSeen;
var $m_arrCustomFields;
var $m_SystemMessage;
var $m_IsOrganization;
var $m_Organization;
function CanViewModule($intModuleID){
GLOBAL $connection;
GLOBAL $tMODULE_GROUP;
$query = "SELECT viewable FROM $tMODULE_GROUP where moduleid=$intModuleID and groupid=".$this->m_UserGroupID;
$result = mysql_query($query, $connection);
list($intReturnString) = mysql_fetch_row($result);
return $intReturnString;
}
function CanViewAllOfModule($intModuleID){
GLOBAL $connection;
GLOBAL $tMODULE_GROUP;
$query = "SELECT viewall FROM $tMODULE_GROUP where moduleid=$intModuleID and groupid=".$this->m_UserGroupID;
$result = mysql_query($query, $connection);
list($intReturnString) = mysql_fetch_row($result);
return $intReturnString;
}
function getLastSeenPretty(){
if ($this->m_LastSeen!=0)
return strftime("%m-%d-%Y %I:%M:%S %p",$this->m_LastSeen);
else
return "Has Never Logged On";
}
function getOrganization(){
return $this->m_Organization;
}
function getLastSeen(){
return $this->m_LastSeen;
}
function getIsOrganization(){
return $this->m_IsOrganization;
}
function getUserID(){
return $this->m_UserID;
}
function getGroupID(){
return $this->m_UserGroupID;
}
function getUnpaidInvoices(){
$this->PopulateUnpaidInvoices();
return $this->$m_arrayUnpaidInvoices;
}
function getUnsentInvoices(){
$this->PopulateUnsentInvoices();
return $this->$m_arrayUnsentInvoices;
}
function getDomainCount(){
$this->PopulateDomainCount();
return $this->m_DomainCount;
}
function getArchivedInvoiceCount(){
$this->PopulateArchivedInvoiceCount();
return $this->m_ArchivedInvoiceCount;
}
function getUninvoicedWorkCount(){
$this->PopulateUninvoicedWorkCount();
return $this->m_UninvoicedWorkCount;
}
function getSignature(){
return $this->m_Signature;
}
function getFullName(){
return $this->m_FirstName." ".$this->m_LastName;;
}
function getFirstName(){
return $this->m_FirstName;
}
function getLastName(){
return $this->m_LastName;
}
function getEmail(){
return $this->m_Email;
}
function getPhone(){
return $this->m_Phone;
}
function getDateCreated(){
return $this->m_DateCreated;
}
function getPaymentType(){
return $this->m_PaymentType;
}
function getBillingCycle(){
return $this->m_BillingCycle;
}
function getBillingStatus(){
return $this->m_BillingStatus;
}
function getPromotionID(){
return $this->m_PromotionID;
}
function getComments(){
return $this->m_Comments;
}
function getAddress(){
return $this->m_Address;
}
function getCity(){
return $this->m_City;
}
function getState(){
return $this->m_State;;
}
function getZipCode(){
return $this->m_ZipCode;
}
function getDateCreated(){
return $this->m_DateCreated;
}
function getPaymentTypeEnum(){
return $this->m_PaymentType;
}
function getCurrentEnum(){
return $this->m_Current;
}
function getPaymentTermEnum(){
return $this->m_PaymentTerm;
}
function getNextBillDate(){
return $this->m_NextBillDate;
}
function getCustomFieldsValue($tCustomFieldID,&$tValue){
if (!is_null($this->m_arrCustomFields[$tCustomFieldID])){
$tValue = $this->m_arrCustomFields[$tCustomFieldID];
return true;
}else{
return false;
}
}
function PopulateCustomFields(){
GLOBAL $tCUSTOMUSERFIELDS;
GLOBAL $tUSER_CUSTOMUSERFIELDS;
GLOBAL $connection;
$query = "Select cf.id,c.value,cf.name from $tCUSTOMUSERFIELDS cf, $tUSER_CUSTOMUSERFIELDS c where c.userID=$this->m_UserID and c.customID = cf.id";
$result = mysql_query($query, $connection);
while (list($tID,$tValue,$tName) = mysql_fetch_row($result)){
$this->m_arrCustomFields[$tID] = $tValue;
if ($tName=="First Name") $this->m_FirstName = $tValue;
elseif ($tName=="Last Name") $this->m_LastName = $tValue;
elseif ($tName=="Email") $this->m_Email = $tValue;
elseif ($tName=="Organization") $this->m_Organization = $tValue;
}
}
function User($tID){
GLOBAL $connection;
GLOBAL $customertable;
GLOBAL $tGROUP_USER;
$query = "SELECT groupid,id,current,paymenttype,paymentterm,UNIX_TIMESTAMP(lastseen),UNIX_TIMESTAMP(nextbilldate),comments,promotionid,password,UNIX_TIMESTAMP(dateActivated),signature,isOrganization FROM $customertable where id=$tID";
$result = mysql_query($query, $connection);
list($this->m_UserGroupID,$this->m_UserID,$this->m_Current,$this->m_PaymentType,$this->m_PaymentTerm,$this->m_LastSeen,$this->m_NextBillDate,$this->m_Comments,$this->m_PromotionID,$this->m_Password,$this->m_DateCreated,$this->m_Signature,$this->m_IsOrganization) = mysql_fetch_row($result);
}
function PopulateDomainCount(){
GLOBAL $connection;
GLOBAL $domaintable;
$query = "SELECT count(id) FROM $domaintable where customerid=$this->m_UserID";
$result = mysql_query($query, $connection);
list($this->m_DomainCount) = mysql_fetch_row($result);
}
function PopulateArchivedInvoiceCount(){
GLOBAL $connection;
GLOBAL $billingtable;
$query = "SELECT count(id) FROM $billingtable where customerid=$this->m_UserID and archive=1";
$result = mysql_query($query, $connection);
list($this->m_ArchivedInvoiceCount) = mysql_fetch_row($result);
}
function PopulateUninvoicedWorkCount(){
GLOBAL $connection;
GLOBAL $invoiceentrytable;
$query = "SELECT count(id) FROM $invoiceentrytable where customerid=$this->m_UserID and invoiceid=0";
$result = mysql_query($query, $connection);
list($this->m_UninvoicedWorkCount) = mysql_fetch_row($result);
}
function PopulateUnsentInvoices(){
GLOBAL $connection;
GLOBAL $billingtable;
$query = "SELECT id FROM $billingtable where customerid=$this->m_UserID and sent=0 order by id";
$result = mysql_query($query, $connection);
$index=0;
$this->$m_arrayUnsentInvoices = array();
while($i = mysql_fetch_row($result)) {
array_push ( $this->$m_arrayUnsentInvoices, $i[0] );
}
}
function PopulateUnpaidInvoices(){
GLOBAL $connection;
GLOBAL $billingtable;
$query = "SELECT id FROM $billingtable where customerid=$this->m_UserID and paid=0 order by id";
$result = mysql_query($query, $connection);
$index=0;
$this->$m_arrayUnpaidInvoices = array();
while($i = mysql_fetch_row($result)) {
array_push ( $this->$m_arrayUnpaidInvoices, $i[0] );
}
}
}
?>
Line 158:
function getDateCreated(){
return $this->m_DateCreated;
}