/** * @param String type * @param Mixed rs * @param Number nPageSize */ public function exportTo($type, $rs, $nPageSize) { global $locale_info; if (substr(@$type, 0, 5) == "excel") { // remove grouping $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SMONGROUPING"] = "0"; ExportToExcel($rs, $nPageSize, $this->eventsObject, $this->cipherer, $this); return; } if ($type == "word") { $this->ExportToWord($rs, $nPageSize); return; } if ($type == "xml") { $this->ExportToXML($rs, $nPageSize); return; } if ($type == "csv") { $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SDECIMAL"] = "."; $locale_info["LOCALE_SMONGROUPING"] = "0"; $locale_info["LOCALE_SMONDECIMALSEP"] = "."; $this->ExportToCSV($rs, $nPageSize); } }
if ($listarray !== false) { $rs = $listarray; } elseif ($nPageSize > 0) { $rs = db_query($strSQL, $conn); } else { $rs = db_query($strSQL, $conn); } if (!ini_get("safe_mode")) { set_time_limit(300); } if (substr(@$_REQUEST["type"], 0, 5) == "excel") { // remove grouping $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SMONGROUPING"] = "0"; if ($phpVersion > 4) { ExportToExcel($cipherer, $pageObject); } else { ExportToExcel_old($cipherer); } } else { if (@$_REQUEST["type"] == "word") { ExportToWord($cipherer); } else { if (@$_REQUEST["type"] == "xml") { ExportToXML($cipherer); } else { if (@$_REQUEST["type"] == "csv") { $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SDECIMAL"] = "."; $locale_info["LOCALE_SMONGROUPING"] = "0"; $locale_info["LOCALE_SMONDECIMALSEP"] = ".";
if ($listarray !== false) { $rs = $listarray; } elseif ($nPageSize > 0) { $rs = db_query($strSQL, $conn); db_pageseek($rs, $nPageSize, $mypage); } else { $rs = db_query($strSQL, $conn); } if (!ini_get("safe_mode")) { set_time_limit(300); } if (substr(@$_REQUEST["type"], 0, 5) == "excel") { // remove grouping $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SMONGROUPING"] = "0"; ExportToExcel(); } else { if (@$_REQUEST["type"] == "word") { ExportToWord(); } else { if (@$_REQUEST["type"] == "xml") { ExportToXML(); } else { if (@$_REQUEST["type"] == "csv") { $locale_info["LOCALE_SGROUPING"] = "0"; $locale_info["LOCALE_SDECIMAL"] = "."; $locale_info["LOCALE_SMONGROUPING"] = "0"; $locale_info["LOCALE_SMONDECIMALSEP"] = "."; ExportToCSV(); } }
$row++; } //$x = (array)$cselected["students"][0]; //echo $x[7926]->id; //echo key_exists(109882, $x); if ($export) { //print_table($table, true); //$category = get_record('course_categories', 'id', $categoryid); $table->category = $category->name; $table->schoolname = $school->name; $table->semester = $semester; $durationend = strtotime("+{$temp_course->numsections} weeks", $temp_course->timemodified); $table->end_duration = date(" M jS, Y", $durationend); $table->start_duration = date(" M jS, Y", $temp_course->timemodified); //$table->duration = date("d M Y", $cselected["startdate"][0]).' to '.date("d M Y", time('now')); ExportToExcel($table); } else { /*foreach($cselected["id"] as $courseid){ $sql="select verified from mdl_grade_items where courseid=$courseid and itemname='Grades'"; //echo $sql; $verification=$DB->get_record_sql($sql); if(isset($verification->verified)) $grades_verification[]=$verification->verified; }*/ //print_r($cselected["id"]); echo '<div style="text-align: center; font-weight: bold;"><u>' . $school->name . '</u><br></div>'; echo '<div style="text-align: center; font-weight: bold;"><u>On Campus Semester Result Information</u><br></div>'; $Duration_end = strtotime("+{$temp_course->numsections} weeks", $temp_course->timemodified); echo '<div style="text-align: center; font-weight: bold;"><br/>Semester: ' . $semester . ' Duration: ' . date(" M jS, Y", $temp_course->timemodified) . '-' . date(" M jS, Y", $Duration_end) . '</div>'; echo '<div style="text-align: left; padding-left: 20px; margin: 5px 0;"> <form method="post" style="display: inline; margin: 0; padding: 0;">';
$datas[$i]["totalmarked"] = "<b>Total</b>"; $datas[$i]["missedlec"] = "<b>Lecture</b>"; $datas[$i]["missedlab"] = "<b>Labs</b>"; $datas[$i]["totalmissed"] = "<b>Total</b>"; $datas[$i]["remarks"] = ""; if ($sort or $export) { $i = 0; foreach ($courses as $course) { $data[$i]["sno"] = $i + 1; $i++; } } $data = array_merge($datas, $data); $table->data = $data; if ($export) { ExportToExcel($table, $perd, $weeks); } else { echo '<div style="text-align: center; font-weight: bold;">Missing Lectures Report<br></div>'; echo '<div style="text-align: left; padding-left: 20px; margin: 5px 0;">'; if (!$sort) { $perd = date("d-m-Y", $courses[0]->startdate) . " ) - ( " . date("d-m-Y", $endtime); } echo '<div style="text-align: center; font-weight: bold;">Period : ( ' . $perd . ' )</div>'; echo '<div style="text-align: center; font-weight: bold;"> Weeks: ' . $weeks . '</b></div>'; echo '<form method="post" style="display: inline; margin: 0; padding: 0;">'; echo '<input type="hidden" name="courses" value="' . rtrim($export_courses, ',') . '" />'; echo '<input type="hidden" name="id" value="' . $categoryid . '" />'; echo '<input type="hidden" name="perod" value="' . $perd . '" />'; echo "<b>Sort By:</b>"; echo "<select name='sortby' id='sortby'>"; echo "<option value='dept'>Department</option>";
{ $rs = db_query($strSQL,$conn); } else $rs = db_query($strSQL,$conn); if(!ini_get("safe_mode")) set_time_limit(300); if(substr(@$_REQUEST["type"],0,5)=="excel") { // remove grouping $locale_info["LOCALE_SGROUPING"]="0"; $locale_info["LOCALE_SMONGROUPING"]="0"; if($phpVersion > 4) ExportToExcel($rs, $nPageSize, $eventObj, $cipherer, $pageObject); else ExportToExcel_old($rs, $nPageSize, $strTableName, $eventObj, $cipherer, $pageObject); } else if(@$_REQUEST["type"]=="word") { ExportToWord($rs, $nPageSize, $strTableName, $eventObj, $cipherer, $pageObject); } else if(@$_REQUEST["type"]=="xml") { ExportToXML($rs, $nPageSize, $strTableName, $eventObj, $cipherer, $pageObject); } else if(@$_REQUEST["type"]=="csv") { $locale_info["LOCALE_SGROUPING"]="0"; $locale_info["LOCALE_SDECIMAL"]=".";
foreach ($courses as $course) { $sn = 1; $table->data[$i][] = $sn; $table->data[$i][] = $course->fullname; $sn++; $i++; } if (empty($courses)) { $table->data[$i][] = ""; $table->data[$i][] = "Not registered"; $i++; } } //echo html_writer::table($table); if ($export) { ExportToExcel($table, $uname, $uidnumber); } else { echo '<form method="post" style="display: inline; margin: 0; padding: 0;">'; echo '<input type="hidden" name="courses" value="' . rtrim($export_courses, ',') . '" />'; echo '<input type="hidden" name="id" value="' . $categoryid . '" />'; echo '<input type="hidden" name="user" value="' . $user . '" />'; echo '<input type="hidden" name="export" value="true" /><input type="submit" value="Download Excel" />'; echo "<br/><b>Name:</b>" . $uname; echo "<br/><b>Reg No:</b>" . $uidnumber . "<br/>"; echo html_writer::table($table); echo '</form></div>'; } } } else { $OUTPUT->box_start('generalbox categorybox'); echo '<form method="post" action="std_semestereport.php?id=2" style="display: inline; margin: 0; padding: 0;">';