-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinuxaus
29 lines (19 loc) · 797 Bytes
/
linuxaus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$time_values = array(
'Weekly' => 60*60*24*7,
'Fortnightly' => 60*60*24*14,
'Monthly' => 60*60*24*30,
'Bimonthly' => 60*60*24*60,
'Quarterly' => 60*60*24*91,
'Half Yearly' => 60*60*24*182,
'Annually' => 60*60*24*365,
);
$query = db_query("SELECT * FROM {node} WHERE type = 'subcommittee'");
while ( $row = db_fetch_object($query) ) {
$subcommittee = node_load($row->nid);
$query2 = db_query("SELECT * FROM {content_type_report}, {node} WHERE content_type_report.field_report_references_nid = %d AND content_type_report.nid = node.nid ORDER BY node.created DESC LIMIT 1", $row->nid);
$last_report = db_fetch_object($query2);
if ( $time_values[$subcommittee->field_reporting_period] > ($last_report->created - time()) ) {
return true;
}
}
========== action