<div id=inset>
<div style="background-color: #89a; width: 650px;">
<table width=100% border=0 cellpadding=0 cellspacing=1>
	<tr>
		<td id=grpmembershead>Role</td>
		<td id=grpmembershead>Student</td>
		<td id=grpmembershead>Action</td>
	</tr>
						<?php 
        for ($i = 3; $i <= 6; $i++) {
            ?>
<tr>
	<td id=grpmembers>
		<?php 
            echo roleName($i);
            ?>
	</td>
							<?php 
            $sql = "select * from users where active=1 and teacher_code={$teacher_code} and group_id={$gid} and class={$i}";
            $grs = dbExec($sql);
            if ($grs->RecordCount() == 0) {
                $u = "?action=assign";
                $u .= "&g={$gid}";
                $u .= "&c={$i}";
                $u .= "&anchor=a_{$gid}";
                ?>
	<td id=grpmembers width=100%>
	</td>
	<td id=grpmembers>
			<select
Exemple #2
0
 if ($email == "") {
     $email = $user->email2;
 }
 $user_type = $user->user_type;
 $first_name = $user->first_name;
 $last_name = $user->last_name;
 $school_code = $user->school_code;
 $teacher_code = $user->teacher_code;
 $group_id = $user->group_id;
 $class = $user->class;
 if ($group_id != 0) {
     $sql = "select * from groups where id={$group_id}";
     $rs = dbExec($sql);
     $user->group = $rs->FetchNextObj();
     $group_name = $user->group->name;
     $role = roleName($class);
     $user->role = $role;
 } else {
     $group_name = "(not yet assiged to a team)";
     $role = "(not yet assiged to a team)";
 }
 $sql = "select * from users where teacher_code={$teacher_code} and user_type='t'";
 $rs = dbExec($sql);
 $user->teacher = $rs->FetchNextObj();
 $teacher = $user->teacher->first_name . " " . $user->teacher->last_name;
 $sql = "select * from schools where code={$school_code}";
 $rs = dbExec($sql);
 $school = $rs->FetchNextObj();
 $user->school = $school;
 $school_name = $school->name;
 $school_city = $school->city;
Exemple #3
0
        $rs = dbExec("select\n\t\t\t\t\t\t\t\tu.id,\n\t\t\t\t\t\t\t\tu.first_name,\n\t\t\t\t\t\t\t\tu.last_name,\n\t\t\t\t\t\t\t\tu.username,\n\t\t\t\t\t\t\t\tu.password,\n\t\t\t\t\t\t\t\tu.class,\n\t\t\t\t\t\t\t\tg.name,\n\t\t\t\t\t\t\t\tg.id as gid\n\t\t\t\t\t\t\tfrom users as u\n\t\t\t\t\t\t\tleft outer join groups as g on \n\t\t\t\t\t\t\t\tg.id = u.group_id\n\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tu.active = 1\n\t\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\t\tu.user_type = 's'\n\t\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\t\tu.teacher_code = " . $u->teacher_code . "\n\t\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\t\tu.username not like '%-delet%'\n\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\tu.last_name\n\t\t\t\t");
        $ns = $rs->RecordCount();
        $t->setspan(2, "<br>Students ({$ns})");
        $t->setidrow("head");
        $t->nextrow();
        while (!$rs->EOF) {
            $s = $rs->FetchNextObj();
            $name = $s->first_name . " " . $s->last_name;
            $name = "<a href='?userqry={$userqry}&user_id=" . $s->id . "'>{$name}</a>";
            $up = $s->username . " / " . $s->password;
            $team = "(no role/team)";
            if ($s->gid) {
                $team = $s->name . " [" . $s->gid . "]";
                $team = $s->name;
                $team = "<a href='?userqry={$userqry}&group_id=" . $s->gid . "'>{$team}</a>";
                $team = roleName($s->class) . " for {$team}";
            }
            $t->setspan(2, $name . " &mdash; " . $up . " &mdash; " . $team);
            $t->nextrow();
        }
    }
    $t->dump();
    ?>
		<br>
		<?php 
    if ($u->user_type == 's') {
        $t = new Table("s");
        $t->set("Game Data");
        $t->set("Tracking");
        $t->set("Progress");
        $t->nextrow();
Exemple #4
0
}
?>
				<p>
			</div>
		</td>
	</tr>
	<tr><td style="padding: 2em;">

		<?php 
$studs = array();
$sql = "select * from users where active=1 and user_type='s' and teacher_code={$teacher_code} and group_id != 0 order by last_name";
$rs_studs = dbExec($sql);
while (!$rs_studs->EOF) {
    $o = $rs_studs->FetchNextObj();
    $o->eid = "stud" . $o->id;
    $o->role = roleName($o->class);
    $o->name = $o->last_name . ", " . $o->first_name;
    $o->tracking = getrecobj("tracking", "where user_id=" . $o->id);
    $studs[$o->id] = $o;
}
$teams = array();
$sql = "select * from groups where teacher_code={$teacher_code} order by name";
$rs_teams = dbExec($sql);
while (!$rs_teams->EOF) {
    $o = $rs_teams->FetchNextObj();
    $o->eid = "team" . $o->id;
    $o->studs = array();
    $teams[$o->id] = $o;
}
foreach ($studs as $o) {
    $t = $teams[$o->group_id];
Exemple #5
0
function dump_students($rs)
{
    while (!$rs->EOF) {
        $id = $rs->fields("users.id");
        $first_name = $rs->fields("first_name");
        $last_name = $rs->fields("last_name");
        $full_name = "{$last_name}, {$first_name}";
        $group_id = $rs->fields("group_id");
        $class = $rs->fields("class");
        $task = $rs->fields("week");
        $w1v = $rs->fields("w1vendor");
        $w1c = $rs->fields("w1cost");
        $w2v = $rs->fields("w2vendor");
        $w2c = $rs->fields("w2cost");
        $w3v = $rs->fields("w3vendor");
        $last_login = $rs->fields("last_login");
        $gi = "";
        $track = '';
        $error = '';
        if ($group_id != 0) {
            $gi .= roleName($class) . "[{$class}]";
            $gi .= " <font color=gray>for</font> ";
            $gi .= "<font color=#660066>\"" . group_name($group_id) . "\"[{$group_id}]</font>";
            if ($task == 0) {
                $track .= '<font color=blue>&nbsp&nbsp&nbsp In Tutorial . . . </font>';
            }
            if ($w1c > 0 and $w1v != "" and $task > 0) {
                $track .= '<font color=green>&nbsp&nbsp&nbsp Task 1 Completed . . . </font>';
            } else {
                if ($w1c <= 0 and $w1v == '' and $task == 1) {
                    $track .= '<font color=black>&nbsp&nbsp&nbsp Task 1 In Progress . . . </font>';
                } else {
                    if ($task >= 1) {
                        $track .= '<font color=red>&nbsp&nbsp&nbsp Task 1 Incomplete . . . </font>';
                    }
                }
            }
            if ($w2c > 0 and $w1v != '' and $task > 1) {
                $track .= '<font color=green> Task 2 Completed . . . </font>';
            } else {
                if ($w2c <= 0 and $w2v == '' and $task == 2) {
                    $track .= '<font color=black> Task 2 In Progress . . . </font>';
                } else {
                    if ($task >= 2) {
                        $track .= '<font color=red> Task 2 Incomplete . . . </font>';
                    }
                }
            }
            if ($w3v != '' and $task > 2) {
                $track .= '<font color=green> Task 3 Completed . . . </font>';
            } else {
                if ($w3v == '' and $task == 3) {
                    $track .= '<font color=black> Task 3 In Progress . . . </font>';
                } else {
                    if ($task >= 3) {
                        $track .= '<font color=red> Task 3 Incomplete . . . </font>';
                    }
                }
            }
            $currentDate = date('Y/m/d h:i:s', time());
            $diff = intval(($currentDate - $last_login / 60) / 60 / 24);
            if ($last_login > 0 and $diff > 10) {
                $error .= 'style="background:#faa;"';
                $track .= $diff . ' Days since last Login';
            }
        }
        //else{
        //	$track .= '<font color=red>&nbsp&nbsp&nbsp UNREGISTERED USER: NO GROUP </font>';
        //	}
        $sup = "(" . $rs->fields("username") . " / " . $rs->fields("password") . ")[{$id}]";
        $sup = "<font color=gray>{$sup}</font>";
        ?>
		<span <?php 
        echo $error;
        ?>
><font color=#004488><?php 
        echo $full_name;
        ?>
 <?php 
        echo $sup;
        ?>
 </font>&mdash; <i><?php 
        echo $gi;
        ?>
</i> <?php 
        echo $track;
        ?>
</span><br>
		<?php 
        $rs->MoveNext();
    }
    echo "( " . $rs->RecordCount() . " students )";
}
Exemple #6
0
					<span class="bodyCopy_list"> <?php 
                    echo $num_teams;
                    ?>
 </span>

					teams in your class.

				</div>

				<?php 
                } else {
                    $sql = "select * from users where active=1 and group_id={$group_id} order by class";
                    $rs = dbExec($sql);
                    while (!$rs->EOF) {
                        $role = roleName($rs->fields("class"));
                        $u = $rs->fields("id");
                        $vendor = getField("tracking", "w" . $week . "vendor", "where user_id={$u}");
                        if ($week == 4) {
                            $did1 = "arrested";
                            $did2 = "selling counterfeit tickets";
                        } else {
                            $did1 = "hired ";
                            $cost = getField("tracking", "w" . $week . "cost", "where user_id={$u}");
                            $did2 = "\$" . $cost;
                        }
                        ?>

					<span class="bodyCopy_list"><?php 
                        echo $role;
                        ?>
Exemple #7
0
    ?>
<b>You haven't created any student accounts yet.</b><?php 
} else {
    while (!$rs->EOF) {
        $id = $rs->Fields("id");
        $un = $rs->Fields("username");
        $fn = $rs->Fields("first_name");
        $ln = $rs->Fields("last_name");
        $pw = $rs->Fields("password");
        $wk = $rs->Fields("week");
        $name = "{$ln}, {$fn}";
        $gid = $rs->Fields("group_id");
        $assigned = "";
        if ($gid != 0) {
            $cls = $rs->Fields("class");
            $rl = roleName($cls);
            $gn = getField("groups", "name", "where id={$gid}");
            $assigned = "{$rl} / {$gn}";
        }
        $rmstudent = "?action=xstudent&s={$id}&tab={$tab}";
        ?>
		<span style="white-space: nowrap; font-size: 10pt; ">
			<table cellspacing=0 cellpadding=0 border=0 style="margin-bottom: 10px;"><tr>
				<td>
				<?php 
        if (!$nodelimg) {
            if ($wk != 0) {
                ?>
<div class=lilwk>Task<br><?php 
                echo $wk;
                ?>