This topic is locked
[SOLVED]

 month calendar

11/12/2012 5:54:14 AM
PHPRunner General questions
C
chrispa author

Hi,
1)i have a field called month (where the user select one of the 12 months ) and one years ( where the user select years i.e. 2011,2012,2013) on master table

2)i have a field called "date" on child table
i need to select a month and year from field month and year on master table and then to auto populate the dates on child table i.e.

if select november 2012 then to auto populate the following dates on child table on field month

1/10/2012

2/10/2012

3/10/2012

4/10/2012

etc.
is it that possibly thanks

C
cgphp 11/12/2012

In the "After record added" event you can popolate the child field based on the values of the master record. Check this article: http://xlinesoft.com/phprunner/docs/after_record_added.htm

C
chrispa author 11/13/2012



In the "After record added" event you can popolate the child field based on the values of the master record. Check this article: http://xlinesoft.com/phprunner/docs/after_record_added.htm


noted and thanks
i know how to autopopulate data to another table but i do not know how by selecting month and year on master table to get the month days on child table .

i mean i need help how to get / produce the data not how to create the insert sql .
pls help
ok looking around i add that on before add
$values['number']=cal_days_in_month(CAL_GREGORIAN,$values['month'],$values['year']);

echo("There was $d days in October 2005");
// Place event code here.

// Use "Add Action" button to add code snippets.
return true;
where it returns the number of days per month
now i need if for example select on field month 12 and year 2012 , the number of days will be 31 to add a script to add these 31 days of december one by one in the child table

on format like:
1/12/2012

2/12/2012

...

..

..

.

.

.

.

..

.
ok now i found it and trying following script that is not working
global $conn;
if ($values['number']='28')

{

$strSQLInsert = "update 28 set month='".$values['month']."',year='".$values['year']."'";

db_exec($strSQLInsert,$conn);

}

if ($values['number']='31')

{

$strSQLInsert = "update 31 set month='".$values['month']."',year='".$values['year']."'";

db_exec($strSQLInsert,$conn);

}

return true

;
updates both tables 28 and 31
can someone help please