header();

Extra! Extra!

Active Bulletins

/* Bulletins for "interest group = all" are selected if they are valid for today's date. */ bulletin_cursor_global=database.cursor('SELECT title, content, activationdate, DAY(activationdate) AS act_day, MONTH(activationdate)AS act_mon, YEAR(activationdate) AS act_year FROM bulletin WHERE interestgroupid = 1 AND activationdate <= TODAY AND expirationdate >= TODAY order by activationdate desc, title');

Bulletins for All Interest Groups

while(bulletin_cursor_global.next()){
write("

",bulletin_cursor_global.title);

// The following logic facillitates putting the "new" graphic next to bulletins which are two days old or less. var current_act_date = new Date; current_act_date.setHours(23); current_act_date.setMinutes(59); current_act_date.setSeconds(59); current_act_date.setDate(bulletin_cursor_global.act_day); current_act_date.setMonth(parseInt(bulletin_cursor_global.act_mon)-1); current_act_date.setYear(bulletin_cursor_global.act_year); var check_date = todayPlusObj(-2,"D"); if ((check_date.getTime()) <= (current_act_date.getTime())) {write('New!!');} else {write("

");}

write(bulletin_cursor_global.content);


} bulletin_cursor_global.close(); if (client.interestgroupid != 1) /*For user belonging to a specific interest group, the name of the group is obtained to print in the title line for that group. */ { intgrp_cursor=database.cursor("select interestgroup "+ "from interestgroup "+ "where interestgroupid = '"+client.interestgroupid + "'"); intgrp_cursor.next(); var int_group_name = ""+intgrp_cursor.interestgroup+""; var first_time = "Y"; // Flag used to prevent printing titles if no rows exist. intgrp_cursor.close(); bulletin_cursor=database.cursor("select title, content, activationdate, DAY(activationdate) AS act_day, MONTH(activationdate)AS act_mon, YEAR(activationdate) AS act_year " + " from bulletin " + " where interestgroupid ='" + client.interestgroupid + "'" + " and expirationdate >= TODAY and activationdate <= TODAY "+ " order by activationdate desc, title"); while(bulletin_cursor.next()){ if(first_time == "Y") { /*This statement ensures the header is only printed if a row from Bulletin exists for this interst group*/ write('

Bulletins for Interest Group: '+int_group_name+'

'); first_time = "N"; }
write("

",bulletin_cursor.title);

var int_act_date = new Date; int_act_date.setHours(23); int_act_date.setMinutes(59); int_act_date.setSeconds(59); int_act_date.setDate(bulletin_cursor.act_day); int_act_date.setMonth(parseInt(bulletin_cursor.act_mon)-1); int_act_date.setYear(bulletin_cursor.act_year); if ((check_date.getTime()) <= (int_act_date.getTime())) {write('New!!');} else {write('

');}

write(bulletin_cursor.content);


} // end of while loop bulletin_cursor.close(); } // end of interest group not = 1 logic
Sales Process Phase Knowledge Index Tools & Support
Generating Leads
Preparing the Proposal
Gaining Commitment
Delivering Value
Gathering Feedback
A thru E
F thru J
K thru O
P thru T
U thru Z
Search
System Administration
Help
About