コード例 #1
0
function reportsBygrade()
{
    

    global $OUTPUT, $PAGE, $DB;
        $repObj=new custom_grade_report_db();

//$urlparams     =  required_param('value',0,PARAM_INT);
$processing    =   optional_param('processing',0,PARAM_INT);

$PAGE->set_context(context_system::instance());
 $values =$_GET['values'];
 
$selected_values = explode("@", $values);

$dept=$_GET["dept"];
$section=$_GET["section"];
$grade_type=$_GET["gt"];
$watchlist=$_GET["wl"];
$rank=$_GET["rank"];

  $course_name=$DB->get_field_sql("SELECT `fullname`
FROM `mdl_course`
WHERE `id` ='$selected_values[0]'");
$values_for_export="<b>Course    ".  $course_name."</b><br/><br/>";

if(!empty($selected_values[1]))
{

   $topic_name=$DB->get_field_sql("SELECT `name`
FROM `mdl_course_sections`
WHERE `section` ='$selected_values[1]' AND `course` ='$selected_values[0]' ");
$values_for_export.="<b>Topic  ".$topic_name."</b><br/><br/>";
}
if(!empty($selected_values[2]))
{
 $act= explode("-", $selected_values[2]);
 $tabl_name="mdl_". $act[1];
 $act_name=$DB->get_field_sql("SELECT `name`
FROM `$tabl_name`
WHERE `id` = '$act[0]'");
$values_for_export.=" <b>Acivity ".$act_name."</b><br/><br/>";
}
if(!empty($grade_type))
{
$values_for_export.="<b>Grade Type".$grade_type."</b><br/>";
}
if($watchlist!='undefined')
{
$values_for_export.="<b>WatchList".$watchlist."</b><br/>";
}
if(!empty($rank))
{
//$values_for_export.="<b>Rank".$rank."</b>br/>";
}
if(!empty($dept))
{
$values_for_export.="<b>Department".$dept."</b><br/>";
}

if($selected_values[2]!=""||$selected_values[2]!="0")
{


if($selected_values[3]=="both"&&empty($selected_values[1]))
{
$resultArr=getReports($values,$rank,$grade_type);


}
else if($selected_values[3]=="both"&&$selected_values[1]!="0")//by topic for all
{
$resultArr=getReports($values,$rank,$grade_type);

}

else if($selected_values[3]!="both"&&$selected_values[1]!="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}

else if($selected_values[3]!="both"&&$selected_values[1]=="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}
else if($selected_values[3]!="both"&&(!empty($selected_values[1])))
{
$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseSecActType($students,$courseId,$selected_values[1],$selected_values[3],$rank);

}

else{
 $resultArr=getReports($values,$rank,$grade_type);


}

}



else{
$resultArr=getReports($values,$rank,$grade_type);
}

if(strcasecmp($grade_type,"submitted")==0||strcasecmp($grade_type,"notsubmitted")==0)
{
  $grade_type="";
}
      

      

$reultHtml=$repObj->renderOutput($resultArr,$dept
  ,$section,$grade_type,$watchlist);
   
      return $values_for_export."#".$reultHtml;
 }
コード例 #2
0
ファイル: showreports.php プロジェクト: kmahesh541/mitclone
function reportsBygrade()
{
    

    global $OUTPUT, $PAGE;
        $repObj=new custom_grade_report_db();

//$urlparams     =  required_param('value',0,PARAM_INT);
$processing    =   optional_param('processing',0,PARAM_INT);

$PAGE->set_context(context_system::instance());
$values =$_GET['values'];
 
$selected_values=explode("@",$values);
$dept=$_GET["dept"];
$section=$_GET["section"];
$grade_type=$_GET["gt"];
$watchlist=$_GET["wl"];
$rank=$_GET["rank"];
//echo $selected_values[2];
if($selected_values[2]!=""||$selected_values[2]!="0")
{


if($selected_values[3]=="both"&&empty($selected_values[1]))
{
$resultArr=getReports($values,$rank,$grade_type);


}
else if($selected_values[3]=="both"&&$selected_values[1]!="0")//by topic for all
{
$resultArr=getReports($values,$rank,$grade_type);

}

else if($selected_values[3]!="both"&&$selected_values[1]!="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}

else if($selected_values[3]!="both"&&$selected_values[1]=="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}
else if($selected_values[3]!="both"&&(!empty($selected_values[1])))
{
$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseSecActType($students,$courseId,$selected_values[1],$selected_values[3],$rank);

}

else{
 $resultArr=getReports($values,$rank,$grade_type);


}

}



else{
$resultArr=getReports($values,$rank,$grade_type);
}

if(strcasecmp($grade_type,"submitted")==0||strcasecmp($grade_type,"notsubmitted")==0)
{
  $grade_type="";
}
      

$reultHtml=$repObj->renderOutput($resultArr,$dept
  ,$section,$grade_type,$watchlist);

      echo json_encode(array('html' => $reultHtml));
 }
コード例 #3
0
ファイル: report.php プロジェクト: gggeek/ggsysinfo
    case 'list':
        $cli->output('Available reports:');
        // get All checkers
        $reports = getReports($reportsExtensions);
        foreach ($reports as $report) {
            $description = $report->getDescription();
            $cli->output('  ' . $description['tag'] . ': ' . $description['title']);
        }
        $cli->output("Run: php extension/ggsysinfo/bin/php/report.php generate --reports=<name,name,...> to generate reports");
        break;
    case 'generate':
    default:
        // Report structure: [ { title: "xxx", data: [] } ]
        $report = array();
        // get filtered list of checkers
        $reportGenerators = getReports($reportsExtensions, $toGenerate);
        foreach ($reportGenerators as $reportGenerator) {
            $description = $reportGenerator->getDescription();
            $cli->output($description['executingString']);
            $data = $reportGenerator->getReport();
            $report[] = array('title' => $description['title'], 'data' => $data, 'format' => $description['format']);
        }
        $cli->output('Done!');
        if (count($reportGenerators) < count($toGenerate)) {
            $missing = array_diff($toGenerate, array_keys($reportGenerators));
            $cli->output('NB: the following reports are not available: ' . implode(', ', $missing));
        }
        $cli->output();
        $reportFormatter = new reportGenerator();
        $cli->output($reportFormatter->getCSV($report));
}
コード例 #4
0
ファイル: grade_export.php プロジェクト: kmahesh541/mitclone
function reportsBygrade()
{
    

    global $OUTPUT, $PAGE, $DB, $dat,$USER;
        $repObj=new custom_grade_report_db();

//$urlparams     =  required_param('value',0,PARAM_INT);
$processing    =   optional_param('processing',0,PARAM_INT);
    $pdfcreator='<h6 >Created by '.$USER->firstname.' on '.userdate(time()).'</h6>';

$PAGE->set_context(context_system::instance());
 $values =$_GET['values'];
 
$selected_values = explode("@", $values);

$dept=$_GET["dept"];
$section=$_GET["section"];
$grade_type=$_GET["gt"];
$watchlist=$_GET["wl"];
$rank=$_GET["rank"];

  $course_name=$DB->get_field_sql("SELECT `fullname`
FROM `mdl_course`
WHERE `id` ='$selected_values[0]'");





$values_for_export='';
$values_for_export.="<b>Course    ".  $course_name."</b><br/><br/>";

if(!empty($selected_values[1]))
{

   $topic_name=$DB->get_field_sql("SELECT `name`
FROM `mdl_course_sections`
WHERE `section` ='$selected_values[1]' AND `course` ='$selected_values[0]' ");
$values_for_export.="<b>Topic  ".$topic_name."</b><br/><br/>";
    //var_dump($pdfcreator);
}
if(!empty($selected_values[2]))
{
 $act= explode("-", $selected_values[2]);
 $tabl_name="mdl_". $act[1];
 $act_name=$DB->get_field_sql("SELECT `name`
FROM `$tabl_name`
WHERE `id` = '$act[0]'");
$values_for_export.=" <b>Acivity ".$act_name."</b><br/><br/>";
}
if(!empty($grade_type))
{
$values_for_export.="<b>Grade Type".$grade_type."</b><br/>";
}
if($watchlist!='undefined')
{
//$values_for_export.="<b>WatchList".$watchlist."</b><br/>";
}
if(!empty($rank))
{
//$values_for_export.="<b>Rank".$rank."</b>br/>";
}
if(!empty($dept))
{
$values_for_export.="<b>Department".$dept."</b><br/>";
}

if($selected_values[2]!=""||$selected_values[2]!="0")
{


if($selected_values[3]=="both"&&empty($selected_values[1]))
{
$resultArr=getReports($values,$rank,$grade_type);


}
else if($selected_values[3]=="both"&&$selected_values[1]!="0")//by topic for all
{
$resultArr=getReports($values,$rank,$grade_type);

}

else if($selected_values[3]!="both"&&$selected_values[1]!="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}

else if($selected_values[3]!="both"&&$selected_values[1]=="0")//activity type per course 
{

$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseActType($students,$courseId,$selected_values[3],$rank);

}
else if($selected_values[3]!="both"&&(!empty($selected_values[1])))
{
$courseId=$selected_values[0];
  $students=$repObj->getStudentsByCourse($courseId);
$resultArr=$repObj->getGradeByCourseSecActType($students,$courseId,$selected_values[1],$selected_values[3],$rank);

}

else{
 $resultArr=getReports($values,$rank,$grade_type);


}



}



else{
$resultArr=getReports($values,$rank,$grade_type);
}

if(strcasecmp($grade_type,"submitted")==0||strcasecmp($grade_type,"notsubmitted")==0)
{
  $grade_type="";
}
    $dat='<h2 style="text-align: center;text-decoration: underline;">Complete Report</h2><br/><br/>';
    $dat.=$pdfcreator;
    $dat.='<br/><br/><table >
<tr><td >Course</td><td >'.$course_name.'</td><td >Activity Type</td><td >--</td></tr>
<tr><td >Topic</td><td >'.$topic_name.'</td><td>Watchlisted</td><td >'.$watchlist.'</td></tr>

<tr><td >Activity </td><td >'.$act_name.'</td><td >Department</td><td >'.$dept.'</td></tr>

<tr><td >Submission Type</td><td >'.$grade_type.'</td><td >Section</td><td >'.$section.'</td></tr>
<tr><td >EAMCET Rank</td><td >'.$rank.'</td><td ></td><td ></td></tr>
</table>';



$reultHtml=$repObj->renderOutput($resultArr,$dept
  ,$section,$grade_type,$watchlist);
   
      return $values_for_export."#".$reultHtml;
 }
コード例 #5
0
ファイル: side_reports.php プロジェクト: bkolega/InventorySQL
    // Generates the sql query to return number of items in user's inventory (minus the sold items).
    // Runs the generated query against the database.  If the query fails to run, an ERROR will be returned, otherwise the number of items
    // will be returned.
    $result = mysql_query($sql_query, $database);
    if (!$result) {
        echo mysql_errno($database) . ": " . mysql_error($database) . "\n";
        echo $sql_query;
        echo "ERROR!";
        return 0;
    } else {
        $row = mysql_fetch_row($result);
        return $result;
    }
}
/*
 *  The following are the local variables to get the statistics about a user's inventory.  After the variables are given an initial value via
 *  their respective function, a check is done against the sum, depSum, and oldest to see if they are blank.  If so, they are given a default value.
 */
$result = getReports($database, $user);
$max = mysql_num_rows($result);
for ($i = 0; $i < $max; $i++) {
    // Fetch the top row of the result of the query (ptr moves to next query which then becomes 'top')
    $row = mysql_fetch_row($result);
    // Sets all values from the row returned from the query to their corresponding variables.
    $name = $row[0];
    // Generates and echos the html code to display a single item.
    echo "<a href=\"javascript:clickReport('{$name}')\"><li id=\"{$name}\">{$name}</li></a>";
}
//echo $max;
//Closes the connection to the database.
mysql_close($database);
コード例 #6
0
                 // inserts the report
                 // @todo : one for each tester, so update if existing
                 if (isset($tester) && isset($navigator_id) && isset($fixture_id) && isset($success)) {
                     mysql_query("select COUNT(*) from tests_report", $db);
                     // needed to set the autoincrement counter (?)
                     $statement = "insert into tests_report values(NULL,'{$tester}',{$navigator_id},{$fixture_id},'{$success}',CURRENT_TIMESTAMP,'{$comment}')";
                     echo "<div class='query'>{$statement} --&gt;";
                     $result = mysql_query($statement, $db);
                     echo "{$result}</div>";
                 }
             }
         }
     }
     // anyway, shows the whole db
     $fixtures = getFixtures($db);
     $reports = getReports($db);
     $navigators = getNavigators($db);
     printFixtures($fixtures);
     printNavigators($navigators, $fixtures, $reports);
     printReports($reports);
 } else {
     if (isset($action) && ($action == "new" || $action == "submit")) {
         if (!isset($fixture_id)) {
             if (isset($subject) && isset($regex) && isset($highlight) && isset($backref) && isset($results)) {
                 mysql_query("select COUNT(*) from tests_fixture", $db);
                 // needed to set the autoincrement counter (?)
                 $statement = "insert into tests_fixture values(NULL,'{$subject}','{$regex}','{$highlight}','{$backref}','{$empty}','{$stylesheets}','{$results}')";
                 echo "<div class='query'>{$statement} --&gt;";
                 $result = mysql_query($statement, $db);
                 echo "{$result}</div>";
                 $fixture_id = mysql_insert_id();
コード例 #7
0
 private function reportsGet()
 {
     if (!isset($this->request['filter'])) {
         return getReports(null);
     } else {
         switch ($this->request['filter']) {
             case 'new':
                 return getReports(1);
             case 'closed':
                 return getReports(2);
             case 'all':
                 return getReports(null);
             default:
                 $this->response['message'] = 'Incorrect filter';
                 $this->response['code'] = 400;
         }
     }
     //else
 }
コード例 #8
0
ファイル: runProgram.php プロジェクト: carobiscuit/PFA
    $division = $_GET["division"];
}
if (isset($_GET["status"]) && $_GET["status"] == "success") {
    echo "<p> {$count} imported and processed from {$division} </p>";
}
if (isset($_POST["division"]) && isset($_POST["date"])) {
    if (!$_POST["division"] == "") {
        $_SESSION['division'] = strtoupper($_POST['division']);
        $_SESSION['date'] = $_POST['date'];
        include 'inc/variables.php';
        require 'inc/initialSetup.php';
        loadData();
        $count = createTables();
        if ($count != null) {
            populateTables();
            updateCleanTable();
            sumLikeChecks();
            updateDups();
            getReports();
            $division = $_SESSION['division'];
            header("location:index.php?status=success&division={$division}&count={$count}");
        }
    } else {
        header("location:index.php?status=blank");
    }
}
?>
</div>

<?php 
include "inc/footer.php";