Files
HotLunches/messages.php
T
2026-10-19 15:22:52 -07:00

68 lines
2.8 KiB
PHP

<?php
include "db.php";
include "table.php";
$text_data_tbl = new Table("text_data");
$schools = db_query("SELECT * FROM schools");
while ($row = db_fetch_array($schools)) {
extract($row);
$school_num = $record_num;
if (strpos("hotlunches.net",$url) === false) $url = "www.$url";
$text_id = "Lunch Reminder - No Service This Week";
$data_code = "Lunch Reminder";
$date_added = date("Y-m-d",time());
$date_modified = date("Y-m-d",time());
$query = "select * from text_data where school_num = $school_num and text_id = '$text_id'";
$results = db_query($query);
if (db_num_rows($results) == 0) {
$text_data = "Note: There is no lunch service offered at school for the coming week.\n" .
"\n" .
"If you do not wish to receive the weekly hot lunch email reminder,\n" .
"please login into your account at our site: https://$url\n" .
"and edit your profile to disable the email message.\n";
$query = $text_data_tbl->BuildInsert();
db_query($query);
}
$text_id = "Parent Reminder";
$data_code = "Parent Reminder";
$date_added = date("Y-m-d",time());
$date_modified = date("Y-m-d",time());
$query = "select * from text_data where school_num = $school_num and text_id = '$text_id'";
$results = db_query($query);
if (db_num_rows($results) == 0) {
$text_data = "Welcome to the $school_name Hot Lunch Web Site. We have created a user account and password for you " .
"when we entered your child's hot lunch order that you submitted as a paper order. If you wish to place " .
"your hot lunch order using our on-line system for the upcoming session you will need the following user " .
"id and password information.\n" .
"\n" .
"Once you login you will be able to change your user id, update your password, place hot lunch orders, " .
"edit your contact information and view the on-line class list for your children's class. The contact " .
"information you enter will only be available to other parents with children in the same class as your children.\n" .
"\n" .
"To access the Hot Lunch web site:\n\n";
$query = $text_data_tbl->BuildInsert();
db_query($query);
}
$text_id = "Volunteer Reminder";
$data_code = "Volunteer Reminder";
$date_added = date("Y-m-d",time());
$date_modified = date("Y-m-d",time());
$query = "select * from text_data where school_num = $school_num and text_id = '$text_id'";
$results = db_query($query);
if (db_num_rows($results) == 0) {
$text_data = "Just reminder that you are scheduled as a hot lunch volunteer this week. We look forward to seeing you.";
$query = $text_data_tbl->BuildInsert();
db_query($query);
}
}
?>