Quantcast
Channel: ProjeQtOr free project management software - ProjeQtOr free project management software - Recent Topics - ProjeQtOr
Viewing all articles
Browse latest Browse all 6784

Accessing the objects which are made of classes - by: keloniton

$
0
0
Hello Dear Mr Babynus,
i am trying to access the the month field of Expense object which is made of model/Expense.php. In order to do this, in tool/saveobject i add the following code. But it does not work. Can you help me to understand the problem:

if ($className == "Expense") { //first i check whether the class is Expesne or not
$equilgregoriandate= gregorian_to_jalali( substr($newObj->day,0,4) , substr($newObj->day,4,2) , substr($newObj->day,6,2)); //I get the jalali date of the day field
if ($equilgregoriandate[1]<10) { //i check if the date is in correct format
$equilgregoriandate[1]='0'.$equilgregoriandate[1];
}
if ($equilgregoriandate[2]<10) { //i check if the date is in correct format
$equilgregoriandate[2]='0'.$equilgregoriandate[2];
}
$newObj->month = jdate('Ym',jmktime(0,0,0,$equilgregoriandate[1],$equilgregoriandate[2],$equilgregoriandate[0]),'','','en'); //i replace the month field with another string;
}
There is no error, but it does not work when i check the Expense table in Phpadmin.
Thank you

Viewing all articles
Browse latest Browse all 6784

Trending Articles