Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $getSYList = loadSchoolYearList();
- $loadSemCount = getTotalStudListEverySem();
- function loadSchoolYearList(){
- include '..assetsdatabaseconnect.php';
- $list = array();
- $i = 0;
- $query = "SELECT DISTINCT schoolYear FROM tblschoolyear";
- $result = $conn->query($query);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- $list[$i][] = $row['schoolYear'];
- $i++;
- }
- }
- return $list;
- }
- function getTotalStudListEverySem(){
- include '..assetsdatabaseconnect.php';
- $i = 0;
- $count = 1;
- $sem = 1;
- $semList = array();
- $schoolYearCount = 0;
- // Count tblschoolyear record
- $query = "SELECT COUNT(syId) as totalSY FROM tblschoolyear";
- $stmt = $conn->prepare($query);
- $stmt->execute();
- $stmt->store_result();
- if($stmt->num_rows > 0){
- $stmt->bind_result($schoolYearCount);
- while($stmt->fetch()) {
- $schoolYearCount=$schoolYearCount;
- }
- }
- for($count;$count<=$schoolYearCount;$count++){
- $query = "SELECT COUNT(r.infoId) as totalSemCount FROM tblreg as r ";
- $query .= "INNER JOIN tblschoolyear as sy ON sy.syId=r.syId ";
- $query .= "INNER JOIN tblstudinfo as i ON r.infoID=i.infoID WHERE sy.syID=". $count ." AND sy.SchoolSem=". $sem ."";
- $result = $conn->query($query);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- $semList[$i][] = $row['totalSemCount'];
- $i++;
- }
- }
- if ($sem==2){
- $sem = 1;
- }else{
- $sem++;
- }
- }
- $conn->close();
- return $semList;
- }
- <?php
- $data = [[
- 'label' => "2017-2018-1",
- 'value' => 3000
- ], [
- 'label' => "2017-2018-2",
- 'value' => 4000
- ]];
- ?>
- <script>var chartData = <?=json_encode($data)?>;</script>
- <?php
- $data = [[
- 'label' => "2017-2018-1",
- 'value' => 3000
- ], [
- 'label' => "2017-2018-2",
- 'value' => 4000
- ]];
- ?>
- <script>var chartData = <?=json_encode($data)?>;</script>
- <?php
- $data = [[
- 'label' => "2017-2018-1",
- 'value' => 3000
- ], [
- 'label' => "2017-2018-2",
- 'value' => 4000
- ]];
- ?>
- <script>var chartData = <?=json_encode($data)?>;</script>
- <?php
- $data = [[
- 'label' => "2017-2018-1",
- 'value' => 3000
- ], [
- 'label' => "2017-2018-2",
- 'value' => 4000
- ]];
- ?>
- <script>var chartData = <?=json_encode($data)?>;</script>
- Morris.Donut({
- element: 'morris-donut-chart',
- data: chartData,
- resize: true
- });
Add Comment
Please, Sign In to add comment