\n"); $message_width = $default_form_width; include "form.messages.php"; ?>
BuildInsert($data); db_query($cquery); $cquery = ""; } } // If there is no uid check for sid if (!isset($uid)) { if (array_key_exists('sid',$_GET)) $sid = intval($_GET['sid']); if (array_key_exists('sid',$_POST)) $sid = intval($_POST['sid']); if (isset($sid)) { $sid = intval($sid); $query = "select concat_ws(', ',c.last_name,c.first_name) as parent, concat_ws(', ',p.last_name,p.first_name) as student, " . "c.user_num,home_phone,home_email,c.record_num as contact_num, p.record_num as student_num " . "from contacts as c,people as p " . "where c.user_num = p.user_num " . "and p.record_num = $sid " . "and p.people_type = 'Student' " . "and p.school_num = $school_num " . $lookup_where . "order by c.last_name,c.first_name,student"; } } if (!isset($query) || strlen($query) == 0) { if (!isset($lookup_where)) $lookup_where = ''; $query = "select concat_ws(', ',c.last_name,c.first_name) as parent, concat_ws(', ',p.last_name,p.first_name) as student, " . "c.user_num,home_phone,home_email,c.record_num as contact_num, p.record_num as student_num " . "from contacts as c left join people as p on c.user_num = p.user_num " . "where c.school_num = $school_num " . "and p.people_type = 'Student' " . $lookup_where . "order by c.last_name,c.first_name,student"; $DisplayRow = "contacts.display.row.admin.php"; } $DisplayRow = "contacts.display.row.admin.php"; } $results = db_query($query); if (db_num_rows($results)) { while ($row = db_fetch_array($results)) { extract($row); $bgclass = "data-odd"; if (($count % 2) == 0) $bgclass = "data-even"; $count++; include $DisplayRow; } } // // If there are no contacts found display a polite message // if ($count == 0) echo("

No Records Found

\n"); // Add a new contact button $addButton = "?action=$action&naction=add"; if (isset($uid)) $addButton .= "&uid=$uid&mode=$mode"; if (isset($_SESSION['mode']) && $_SESSION['mode'] == 'parent') $addButton .= "&mode=parent"; ?>