示例#1
0
文件: report.php 项目: rrusso/EARS
require_once '../../config.php';
require_once 'lib.php';
require_login();
// Course id required
$courseid = required_param('id', PARAM_INT);
$course = has_reporting_permission($courseid);
// Print the header and heading
$blockname = get_string('blockname', 'block_student_reporting');
$heading = get_string('report', 'block_student_reporting');
$navigation = array(array('name' => $course->shortname, 'link' => $CFG->wwwroot . '/course/view.php?id=' . $courseid, 'type' => 'title'), array('name' => $blockname, 'link' => '', 'type' => 'title'), array('name' => get_string('select', 'block_student_reporting'), 'link' => $CFG->wwwroot . '/blocks/student_reporting/select.php?id=' . $courseid, 'type' => 'title'), array('name' => $heading, 'link' => '', 'type' => 'title'));
print_header_simple($heading, '', build_navigation($navigation));
// If they selected some members, then get those;
// otherwise prepare a report for every student
// in this course
if ($data = data_submitted()) {
    $referral_form = new report_form($courseid, $data);
} else {
    $referral_form = new report_form($courseid);
    $referral_form->users = get_all_students($course);
}
$referral_form->print_heading($heading);
if ($referral_form->submitted()) {
    // Notify students that they have been referred
    $referral_form->process($data);
    print_footer();
    die;
}
$referral_form->print_selected_users();
$referral_form->print_form();
print_footer();
<?php

include "../app/inc.php";
include "../app/class/classmanager.php";
include "../app/student/studentmanager.php";
$array = get_all_students();
function print_table($array)
{
    $new_class_id = 0;
    $old_class_id = 0;
    $student_no = 1;
    for ($j = 0; $j < count($array); $j++) {
        $new_class_id = $array[$j][1];
        if ($new_class_id != $old_class_id) {
            echo "<div class=\"col-md-6\">\n              <div class=\"box box-warning box-solid collapsed-box \">\n                <div class=\"box-header with-border\">\n                  <h3 class=\"box-title\">" . $array[$j][7] . "</h3>\n                  <div class=\"box-tools pull-right\">\n          <a href='classreportview.php?id=" . $array[$j][1] . "'><button class_id =\"" . $array[$j][1] . "\" data-toggle=\"modal\" data-target=\"#editClass\" class=\"btn btn-box-tool classNameEdit\"><i class=\"fa fa-fw fa-bar-chart-o\"></i> Report</button></a>\n\t\t\t\t  <button class_id =\"" . $array[$j][1] . "\" data-toggle=\"modal\" data-target=\"#editClass\" class=\"btn btn-box-tool classNameEdit\"><i class=\"fa fa-fw fa-edit\"></i> Edit</button>\n\t\t\t\t  <button class_id =\"" . $array[$j][1] . "\" data-toggle=\"modal\" data-target=\"#deleteClass\" class=\"btn btn-box-tool classNameDelete\"><i class=\"fa fa-fw fa-close\"></i> Delete</button>\n                    <button class=\"btn btn-box-tool\" data-widget=\"collapse\"><i class=\"fa fa-plus\"></i> Expand</button>\n                  </div><!-- /.box-tools -->\n                </div><!-- /.box-header -->\n                <div class=\"box-body no-padding\" style=\"display: none;\">\n                  <table class=\"table table-striped\">\n                    <tbody><tr>\n                      <th style=\"width: 10px\">#</th>\n                      <th>Name</th>\n                      <th>Code</th>\n            <th style=\"width: 40px\" >Report</th>          \n\t\t\t\t\t  <th style=\"width: 40px\" >Edit</th>\n\t\t\t\t\t  <th style=\"width: 40px\" >Delete</th>\n                     \n                    </tr>";
            //echo "<tr><td></td><td>table top</td><td></td><td></td><td></td></tr>";
            $old_class_id = $new_class_id;
        }
        echo "<tr>\n\t\t  <td>" . $student_no . "</td>\n\t\t  <td>" . $array[$j][3] . " " . $array[$j][4] . "</td>\n\t\t  <td>" . $array[$j][2] . "</td>\n      <td> <a href=\"studentview.php?id=" . $array[$j][0] . "\" class=\"btn btn-block btn-success \"><i class=\"fa fa-fw fa-bar-chart-o \"></i></a></td>\n\t\t  <td> <button student_id =\"" . $array[$j][0] . "\" data-toggle=\"modal\" data-target=\"#editStudent\" class=\"btn btn-block btn-warning studentNameEdit\"><i class=\"fa fa-fw fa-edit\"></i></button></td>\t\t\t\t\t  \n\t\t  <td> <button student_id =\"" . $array[$j][0] . "\" data-toggle=\"modal\" data-target=\"#deleteStudent\" class=\"btn btn-block btn-danger studentNameDelete\"><i class=\"fa fa-fw fa-close\"></i></button></td>\n\t\t</tr>";
        $student_no++;
        if (array_key_exists($j + 1, $array)) {
            if ($old_class_id != $array[$j + 1][1]) {
                echo "</tbody></table>\n                </div><!-- /.box-body -->\n              </div><!-- /.box -->\n            </div>";
                $student_no = 1;
                if ($j % 2 !== 0) {
                    echo "</div><div class=\"row\">";
                }
                //echo "<tr><td></td><td>table bottom</td><td></td><td></td><td></td></tr>";
            }
        } else {
            echo "</tbody></table>\n                </div><!-- /.box-body -->\n              </div><!-- /.box -->\n            </div>";
示例#3
0
<?php

/* 
 * Sameer Jain
 * sameejain@my.smccd.edu
 * CIS 380
 * OL
 * final
 * Sameer Jain
 * 12/18/15
 */
require '../model/database.php';
require '../model/product_db.php';
$action = filter_input(INPUT_POST, 'action');
if ($action == NULL) {
    $action = 'list_info';
}
if ($action == 'list_info') {
    $all_students = get_all_students();
    include 'all_student_info.php';
}