Beispiel #1
0
        $predata = NULL;
        $predata['subjectID'] = $row['subjectID'];
        $predata['name'] = $row['name'];
        $data['subject'][] = $predata;
        // 				$data['subject'][$row['subjectID']] = $row['name'];
    }
}
$strSQL = sprintf("\n      SELECT\n        stu.studentID,\n        stu.firstName,\n        stu.lastName,\n        stu.gradeYear\n      FROM\n        `student` stu\n      WHERE\n        gradeYear = '%s'\n      ", mysql_real_escape_string($gradeYear));
$objQuery = mysql_query($strSQL);
if ($objQuery && mysql_num_rows($objQuery) > 0) {
    while ($row = mysql_fetch_array($objQuery)) {
        $predata = NULL;
        $predata['studentID'] = $row['studentID'];
        $predata['firstName'] = $row['firstName'];
        $predata['lastName'] = $row['lastName'];
        $predata['gradeYear'] = getGradeYearName($row['gradeYear']);
        $data['data'][] = $predata;
        foreach ($data['subject'] as $mval) {
            foreach ($mval as $key => $val) {
                if ($key == 'subjectID') {
                    $predata = NULL;
                    $data['isStuReg'][$row['studentID']][$val] = isStuReg($row['studentID'], $val, $term, $year);
                }
            }
        }
    }
} else {
    $data['data'] = '';
    $data['srtSQL'] = $strSQL;
}
echo json_encode($data);
Beispiel #2
0
<?php

$term = $_REQUEST['term'];
$year = $_REQUEST['year'];
$strSQL = sprintf("\n      SELECT\n        regsub.gradeYear\n      FROM\n        `register-subject` regsub\n        INNER JOIN\n        `subject` sub\n        ON\n        regsub.subjectID = sub.subjectID\n      WHERE\n        registerID = (\n          SELECT\n            registerID\n          FROM\n            `registerinfo`\n          WHERE\n            term = '%s' AND\n            year = '%s'\n        )\n      GROUP BY\n        regsub.gradeYear\n      ORDER BY\n        regsub.gradeYear ASC\n      ", mysql_real_escape_string($term), mysql_real_escape_string($year));
$objQuery = mysql_query($strSQL);
if ($objQuery && mysql_num_rows($objQuery) > 0) {
    while ($row = mysql_fetch_array($objQuery)) {
        $result .= '<option value="' . $row['gradeYear'] . '">' . getGradeYearName($row['gradeYear']) . '</option>';
    }
} else {
    $result = '<option value="0">ไม่พบชั้นปี</optino>';
}
echo $result;
Beispiel #3
0
    ?>
</span>
				<!-- User avatar -->
				<img src="<?php 
    echo $studentPhoto;
    ?>
" width="110" height="110" draggable="false"/>
			</div>
			<!-- Name -->
			<h2 class="card-face__name"><?php 
    echo $studentInfo['firstName'] . ' ' . $studentInfo['lastName'];
    ?>
</h2>
			<!-- Title -->
			<span class="card-face__title">ชั้น<?php 
    echo getGradeYearName($studentInfo['gradeYear']);
    ?>
</span>
			<span class="card-face__ins">ครูที่ปรึกษา <?php 
    echo $insName;
    ?>
</span>
			<div class="card-face-footer">
				<?php 
    if ($confUserType == "instructor") {
        ?>
				<a href="?action=insReport" class="card-face__social" title="ย้อนกลับ">
					<img src="images/back.png" width="36" height="36" draggable="false"/>
				</a>
				<?php 
    }
Beispiel #4
0
        }
        if (!$error) {
            $strSQL = 'SELECT * FROM `register-subject` WHERE subjectID = "' . $subjectID . '" AND registerID = "' . $registerID . '" AND instructorID = "' . $instructorID . '" AND gradeYear = "' . $gradeYear . '";';
            $objQuery = mysql_query($strSQL);
            if (mysql_num_rows($objQuery) == 0) {
                $strSQL = 'INSERT INTO `register-subject` (subjectID,registerID,gradeYear,instructorID) VALUES ("' . $subjectID . '","' . $registerID . '","' . $gradeYear . '","' . $instructorID . '");';
                $objQuery = mysql_query($strSQL);
                if ($objQuery) {
                    $result = 'เปิดวิชารหัส ' . $subjectID . ' ในภาคการศึกษาที่ ' . $term . ' ปีการศึกษา ' . ($year + 543) . ' สำหรับชั้น ' . getGradeYearName($gradeYear) . ' เรียบร้อย';
                } else {
                    $error = true;
                    $result = 'ข้อผิดพลาด : ไม่สามารถเพิ่มข้อมูลการเปิดรายวิชาได้ โปรดติดต่อผู้พัฒนา ';
                }
            } else {
                $error = true;
                $result = 'ข้อผิดพลาด : มีการเปิดวิชารหัส ' . $registerID . ' ในภาคการศึกษาที่ ' . $term . ' ปีการศึกษา ' . ($year + 543) . ' สำหรับชั้น ' . getGradeYearName($gradeYear) . ' อยู่แล้ว';
            }
        }
    } elseif ($_POST['submit']) {
        $error = true;
        $result = "กรุณากรอกข้อมูลให้ครบทุกช่อง";
    }
    ?>
<style>
	  .custom-combobox-input {
	    margin: 0;
	    padding: 4.5px 5px;
	    width: 260px;
	  }
	  .ui-selectmenu-button {
		height: 30px;
			$predata['subjectName'] = $row['name'];
			$predata['hour'] = $row['type']=='BASIC'?'60':'40';
			$predata['weight'] = $row['type']=='BASIC'?'1.5':'1';
			$predata['durningScore'] = $durningScore;
			$predata['midScore'] = rand(0,20);
			$predata['totalDurningScore'] = $predata['durningScore']+$predata['midScore'];
			$predata['finalScore'] =  rand(0,20);
			$predata['totalScore'] = $predata['totalDurningScore']+$predata['finalScore'];
			$predata['grade'] = gradeCal(NULL, array(50,55,60,65,70,75,80,100), '0', $predata['totalScore']);
			$predata['beg'] = $predata['grade']=='0'?'<input type="text" value="1" />':'';
			$dataInfoBasic[] = $predata;
		}
	}
	$year = $year+543;
	$preName = $preName=='M'?'ด.ช.':'ด.ญ.';
	$gradeYearName = getGradeYearName($gradeYear);
	$level = getLevelName($gradeYear);
	$instructor = $insFirstName.'&nbsp;&nbsp;&nbsp;'.$insLastName;
	$data = array(
			logo						=>	'images/logo.png',
			schoolName			=>	'โรงเรียนชุมชนบ้านถ้ำสิงห์',
			title						=>	'แบบรายงานผลการเรียนรายบุคคล',
			director				=>	'นายประมวล&nbsp;&nbsp;&nbsp;พรหมศร',
			instructor				=>	$instructor,
			termInfo				=>	"ระดับ$level&nbsp;&nbsp;&nbsp;ภาคเรียนที่ $term&nbsp;&nbsp;&nbsp;ปีการศึกษา $year",
			studentInfo			=>	"$preName$firstName $lastName&nbsp;&nbsp;&nbsp;เลขประจำตัว $studentID&nbsp;&nbsp;&nbsp;ชั้น$gradeYearName",
			durningScore		=>	$confDurningScore,
			midScore				=>	$confMidScore,
			finalScore				=>	$confFinalScore
	);
//	Sample Data Generator Begin
Beispiel #6
0
<?php

$subjectID = $_POST['subjectID'];
$term = $_POST['term'];
$year = $_POST['year'];
if ($subjectID && $term && $year) {
    $strSQL = "SELECT stu.studentID AS studentID, stu.firstName AS firstName, stu.lastName AS lastName, stu.gradeYear AS gradeYear FROM `register-subject` regsub, `registerinfo` reg, `student` stu WHERE reg.registerID = regsub.registerID AND reg.term='{$term}' AND reg.year='{$year}' AND regsub.subjectID = '{$subjectID}' AND regsub.gradeYear = stu.gradeYear AND stu.status='NORMAL' AND stu.studentID NOT IN (SELECT regstu.studentID FROM `register-student` regstu WHERE regstu.subjectID=regsub.subjectID AND regstu.registerID=regsub.registerID );";
    $objQuery = mysql_query($strSQL);
    if (mysql_num_rows($objQuery) >= 1) {
        $i = 0;
        while ($row = mysql_fetch_array($objQuery)) {
            $data['data'][$i] = $row;
            $data['data'][$i]['gradeYear'] = getGradeYearName($row['gradeYear']);
            $i++;
        }
        echo json_encode($data);
    } else {
        $data['data'][] = array("studentID" => "", "firstName" => "ไม่พบ", "lastName" => "", "gradeYear" => "");
        echo json_encode($data);
    }
} else {
    $data['data'][] = array("studentID" => "", "firstName" => "", "lastName" => "", "gradeYear" => "");
    echo json_encode($data);
}