$t = new Table("top"); $t->set("<div id=hh1>Rank</div>"); $t->set("<div id=hh1>Percentile</div>"); $t->set("<div id=hh1>Student</div>"); $rs = dbExec("select\n r.p_final,\n\t\t\t\t\t\t\tconcat(u.last_name,', ',u.first_name) as name,\n\t\t\t\t\t\t\tconcat_ws(' ',s.name,s.city,s.state) as school,\n\t\t\t\t\t\t\tu.school_code as sc,\n r.uid\n from\n results as r\n left outer join users as u on\n u.id = r.uid\n left outer join schools as s on\n s.code = u.school_code\n where\n p_final is not null\n\t\t\t\t\t\torder by p_final desc\n\t\t\t\t\t\tlimit {$topcount}\n\t\t\t\t\t\t"); while ($o = $rs->FetchNextObj()) { $id = $o->uid; $pcntl = $o->p_final; $name = $o->name; $name = "<a href='?rtype=indv&n={$id}'>{$name}</a>"; $sc = $o->sc; $school = $o->school; $school = "<font color=gray size=-1>{$school}</font>"; $t->row($rs->CurrentRow() + 1); $t->set($rs->CurrentRow() + 1); $t->set(percbar_str($pcntl, $pcntl)); $t->set($name . "<br>" . $school); } $t->dump(); } } ?> <p> <?php $id = rt("n"); $fc = rt("fc"); if ($id != "") { function sr($t, $v) { ?> <tr>
function percbar($n, $cat = "") { echo percbar_str($n, $cat); }