#!/usr/local/bin/php # RBS reminder mails, GPLv3, anselm at hoffmeister dot be and modified by carmean at sfu dot ca with help from others including Anselm. # See http://sourceforge.net/mailarchive/message.php?msg_id=25430126 # for more information. # I tested this by run the code from the website (e.g., the the file was email.php, and I ran it by (re)loading https://cgi.sfu.ca/~website/advising/email.php # (but made it so all emails went to me so others would not be bothered) # # (This used to be good source- http://www.ope nsource-arc hive.org/showthread.php?t=116053 but now is evil javascript advertising website) (UNIX_TIMESTAMP()+(1*86400))) ". " AND (e.start_time<(UNIX_TIMESTAMP()+(2*86400))) ". " AND (e.type='I') ". " AND (e.create_by!='dsandher') ". # Do not remind this person of appointments she made for others " ORDER BY e.start_time"); # " ORDER BY e.create_by, e.start_time"); $list = ""; $last = "----"; $lastmail = ""; $z = 0; while ( $a = mysql_fetch_row($s) ) { if ( $last != $a[6] ) { if ( $last != "----" ) { echo "reminder: ".$last.", ".$lastmail."\n"; sendnotific($z, $last, $lastmail, $list); } $last = $a[6]; $lastmail = $a[7]; $list = ""; $z = $a[1]; } $list = strftime("%a, %d %B %Y, %H:%M", $a[1])." : ".$a[4]." / ".$a[5]."\n"; } if ( $last != "----" ) { echo "reminder: ".$last.", ".$lastmail."\n"; sendnotific($z, $last, $lastmail, $list); } ?>