31 lines
881 B
PHP
31 lines
881 B
PHP
<?php
|
|
include "/m/data1/app.hotlunches.net/db.php";
|
|
|
|
echo("support@hotlunches.net\n");
|
|
|
|
$query = "SELECT DISTINCT s.school_name, cl.contact_name, cl.contact_phone, cl.contact_email " .
|
|
"FROM school_contact_list AS cl, schools AS s " .
|
|
"WHERE s.record_num = cl.school_num " .
|
|
"AND s.status = 'Active' " .
|
|
"AND cl.active = 'Y' " .
|
|
"AND cl.contact_email != '' " .
|
|
"ORDER BY 1";
|
|
$results = db_query($query);
|
|
|
|
while ($row = db_fetch_array($results)) {
|
|
extract($row);
|
|
|
|
if (strlen($school_name) > 65) {
|
|
$words = explode(' ',$school_name);
|
|
$name = "";
|
|
for ($i = 0; $i < count($words); $i++) {
|
|
$name .= $words[$i].' ';
|
|
if (strlen($name) > 60) break;
|
|
}
|
|
$school_name = trim($name);
|
|
}
|
|
printf("%-70s %s: %s (%s)\n",$school_name,$contact_name,$contact_phone,$contact_email);
|
|
}
|
|
|
|
?>
|