Initially I hard coded all of the email addresses in the script (not very user friendly) and only sent email reminders if an event was going to happen "tomorrow". I reasoned that occasionally it may be desirable to notify the users at an earlier or later date i.e. 1 week prior to the event to allow ample time to make arrangments to attend .. or the morning of the event to ensure the event is remembered for that day or perhaps a reminder will be needed multiple times.
So, I went about adding an E-mail Notification tab to JEvents ... I figured at minimum, to have a single reminder date, I needed 3 fields ...
[list]
email_notify - tinyint(1)
notify_date -datetime
email_recipient longtext
[/list:u]
I created the additional fields in the admin.events.html.php file and added the requisite fields to mosEvents in events.class.php ...
Since everything is already installed, I simply added the DB fields manually ...
When I edit an event, I can read the values stored in the DB easily enough and save the values back, with the exception of my checkbox for email_notify.
The checkbox code is:
function checkNotify(){
var check = 0;
if (document.adminForm.notify_date.checked==true){
var check = 1;
}
return check;
}
<span><input type="checkbox" id="email_notify" name="email_notify" value="0" onclick="checkNotify();"
<?php if ($row->email_notify == 1) echo "checked"; ?>/></span>
The event code is:
$email_notify = mosGetParam( $_POST, 'email_notify','' );
if( $email_notify == 1){
$row->email_notify = 1;
} else {
$row->email_notify = 0;
}
I am not the smartest cookie when dealing with forms transactions, although it seems to be pretty straightforward ... I know it is something relatively simple ... I'd appreciate a nudge in the right direction.
Thanks