Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_cache_limiter();
- session_start();
- $userGroup = $_SESSION['group1'];
- //include config and functions pages
- include ('config.php');
- include ('functions.php');
- //check for administrative rights
- if (allow_access('Administrators') != "yes")
- {
- include ('no_access.html');
- exit;
- }
- //Get the id from the previous page
- $id_routes = $_GET['id_routes'];
- //$id_routes = 1;
- //routes info query
- $sql = "SELECT ro.*, dl.dep_name, dl.dep_address, dl.dep_city, dl.dep_state, dl.dep_am, dl.dep_pm, ca.car_num FROM routes ro LEFT JOIN departure_lot dl ON ro.id_dep_lot=dl.id_dep_lot LEFT JOIN cars ca ON ro.id_cars=ca.id_cars
- WHERE ro.id_routes=$id_routes";
- $results = mysql_query($sql) or die(mysql_error());
- while ($row = mysql_fetch_assoc($results)){
- $rtn = $row['route_num'];
- $dn = $row['dep_name'];
- $da = $row['dep_address'];
- $dc = $row['dep_city'];
- $ds = $row['dep_state'];
- $dam = $row['dep_am'];
- $dpm = $row['dep_pm'];
- $cn = $row['car_num'];
- }
- //driver info query
- $sql2 = "SELECT ro.*, au.firstname, au.lastname FROM routes ro LEFT JOIN authorize au ON ro.id_auth=au.id_auth
- WHERE ro.id_routes=$id_routes";
- $results2 = mysql_query($sql2) or die(mysql_error());
- while ($row = mysql_fetch_assoc($results2)){
- $auf = $row['firstname'];
- $aul = $row['lastname'];
- }
- //region info query
- $sql3 = "SELECT cl.*, s.sch_name, s.sch_address, s.sch_city, s.sch_state, s.sch_start, s.sch_end, r.reg_name FROM clients cl LEFT JOIN schools s ON cl.id_schools=s.id_schools LEFT JOIN regions r ON s.id_reg=r.id_reg WHERE s.id_reg=r.id_reg";
- $results3 = mysql_query($sql3) or die(mysql_error());
- while ($row = mysql_fetch_assoc($results3)){
- $rgn = $row['reg_name'];
- $sn = $row['sch_name'];
- $sa = $row['sch_address'];
- $sc = $row['sch_city'];
- $ss = $row['sch_state'];
- $sst = $row['sch_start'];
- $se = $row['sch_end'];
- }
- //counts rows in table
- $sql = "SELECT COUNT(id_clients) FROM client_schedule WHERE id_routes=$id_routes";
- $result = mysql_query($sql) or die(mysql_error());
- echo mysql_error();
- $r = mysql_fetch_row($result);
- $numrows = $r[0];
- $day = date('l');
- $day = strtolower($day);
- $sql4 = "Select cs.*, cl.id_clients as client_id, cl.cl_fn, cl.cl_ln, cl.cl_address, cl.cl_city, cl.cl_notes, a.aides_fn, a.aides_ln FROM client_schedule cs LEFT JOIN clients cl ON cs.id_clients = cl.id_clients LEFT JOIN aides a ON cs.id_aides = a.id_aides WHERE ".$day." = 1 AND id_routes = $id_routes AND cs.time_in <> '' AND (start_date < NOW() AND end_date >NOW()) ORDER BY cs.order_num ASC";
- $results4 = mysql_query($sql4) or die(mysql_error());
- while ($row = mysql_fetch_assoc($results4)){
- $af = $row['aides_fn'];
- $al = $row['aides_ln'];
- }
- $day = date('l');
- $day = strtolower($day);
- $sql5 = "Select cs.*, cl.id_clients as client_id, cl.cl_fn, cl.cl_ln, cl.cl_address, cl.cl_city, cl.cl_notes FROM client_schedule cs LEFT JOIN clients cl ON cs.id_clients = cl.id_clients WHERE ".$day." = 1 AND id_routes = $id_routes AND cs.time_in <> '' AND (start_date < NOW() AND end_date >NOW()) ORDER BY cs.order_num ASC";
- $results5 = mysql_query($sql5) or die(mysql_error());
- ?>
- <div id="content">
- <table width="800" border="2">
- <tr bgcolor="#CCCCCC">
- <td width="400"><p><img src="images/connecticut transportation.jpg" width="285" height="74" />
- <h2>Itinerary</h2></td>
- <td colspan="2" align="center"><h2>555 Highland Ave<br />
- Cheshire, CT 06410<br />
- (203) 592-7213</h2>
- </tr>
- <tr>
- <td align="center"><h3>Run # / Lot</h3></td>
- <td width="100" align="center">#<?php echo $rtn;?></td>
- <td width="300" align="center"><?php echo $dn;?><br /><?php echo $da;?><br /><?php echo $dc;?>,<?php echo $ds;?></td>
- </tr>
- <tr>
- <td align="center"><h3>Vehicle # / Driver</h3></td>
- <td colspan="2" align="center">#<?php echo $cn;?>/<?php echo $auf;?> <?php echo $aul;?></td>
- </tr>
- <tr>
- <td align="center"><h3>Region</h3></td>
- <td colspan="2" align="center"><?php echo $rgn;?></td>
- </tr>
- <tr>
- <td align="center"><h3>School</h3></td>
- <td colspan="2" align="center"><?php echo $sn;?><br /><?php echo $sa;?><br /><?php echo $sc;?>,<?php echo $ss;?></td>
- </tr>
- <tr>
- <td align="center"><h3># of Students</h3></td>
- <td colspan="2" align="center"><?php
- echo "$numrows";
- ?></td>
- </tr>
- <tr>
- <td align="center"><h3>Assigned Aide</h3></td>
- <td colspan="2" align="center"><?php echo $af;?> <?php echo $al;?></td>
- </tr>
- <tr>
- <td align="center"><h3>School Hours</h3></td>
- <td colspan="2" align="center"><?php echo $sst;?> AM/ <?php echo $se;?> PM</td>
- </tr>
- <tr>
- <td align="center"><h3>Depart Lot: <?php echo $dn;?></h3></td>
- <td colspan="2" align="center"><?php echo $dam;?> AM/ <?php echo $dpm;?> PM</td>
- </tr>
- </table>
- <?php while ($row = mysql_fetch_assoc($result5)){
- ?>
- <table width="800" border="2">
- <tr>
- <td colspan="3" align="center"></td>
- </tr>
- <tr>
- <td width="198"><h3>Student Order: <?php echo $row['order_num'];?></h3></td>
- <td width="278"><?php echo $row['cl_fn'];?> <?php echo $row['cl_ln'];?><br /><?php echo $row['cl_address'];?><br /><?php echo $row['cl_city'];?>, <?php echo $row['cl_state'];?></td>
- <td>Mother = <?php echo $row['cl_mother_fn'];?><br />Father = <?php echo $row['cl_father_fn'];?><br /><?php echo $row['cl_home_ptn'];?>/<?php echo $row['cl_day_ptn'];?></td>
- </tr>
- </table>
- <?php
- }
- ?>
- <!-- end .content --></div>
- <!-- end content-container --></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement