1+ <?php
2+
3+ /**
4+ * Headbook Management System
5+ * @version 4.x
6+ * @author Group DNTU
7+ * @license GNU/GPL version 3
8+ * @see https://github.com/phapdev/manage_headbook.git The Manage headbook GitHub project
9+ */
10+
11+
12+ if (!defined ('NV_IS_FILE_ADMIN ' )) {
13+ die ('Stop!!! ' );
14+ }
15+
16+ $ page_title = $ lang_module ['student_list ' ];
17+
18+ $ classid = $ nv_Request ->get_int ('classid ' , 'post,get ' );
19+
20+ $ page_addstudent = NV_BASE_ADMINURL . 'index.php? ' . NV_LANG_VARIABLE . '= ' . NV_LANG_DATA . '& ' . NV_NAME_VARIABLE . '= ' . $ module_name . '& ' . NV_OP_VARIABLE . '=addstudent ' ;
21+ $ array = [];
22+
23+ // Gọi csdl để lấy dữ liệu
24+ $ querystudent = $ db ->query ('SELECT * FROM ' . NV_PREFIXLANG . '_ ' . $ module_data . '_student WHERE ma_lop = ' . $ classid .' ORDER BY ho_ten ASC ' );
25+ // đổ dữ liệu
26+ while ($ row = $ querystudent ->fetch ()) {
27+ $ array [$ row ['ma_hoc_sinh ' ]] = $ row ;
28+ }
29+
30+ $ queryclass = $ db ->query ('SELECT * FROM ' . NV_PREFIXLANG . '_ ' . $ module_data . '_class WHERE ma_lop = ' . $ classid );
31+ $ dataclass = $ queryclass ->fetch ();
32+
33+ $ xtpl = new XTemplate ('student.tpl ' , NV_ROOTDIR . '/themes/ ' . $ global_config ['module_theme ' ] . '/modules/ ' . $ module_file );
34+ $ xtpl ->assign ('LANG ' , $ lang_module );
35+ $ xtpl ->assign ('GLANG ' , $ lang_global );
36+ $ xtpl ->assign ('PAGE_ADDSTUDENT ' , $ page_addstudent );
37+
38+
39+ // hien thi du lieu
40+ if (!empty ($ array )) {
41+ $ i = 1 ;
42+ foreach ($ array as $ value ) {
43+ $ value ['checksess ' ] = md5 ($ value ['ma_hoc_sinh ' ] . NV_CHECK_SESSION );
44+ $ value ['stt ' ] = $ i ++;
45+ $ value ['ten_lop ' ] = $ dataclass ['ten_lop ' ];
46+ $ value ['ngay_sinh ' ] = nv_date ('d/m/Y ' , $ value ['ngay_sinh ' ]);
47+ $ value ['url_edit ' ] = NV_BASE_ADMINURL . 'index.php? ' . NV_LANG_VARIABLE . '= ' . NV_LANG_DATA . '& ' . NV_NAME_VARIABLE . '= ' . $ module_name . '& ' . NV_OP_VARIABLE . '=addstudent&studentid= ' . $ value ['ma_hoc_sinh ' ];
48+ $ xtpl ->assign ('DATA_STUDENT ' , $ value );
49+ $ xtpl ->parse ('student.loop ' );
50+ }
51+ }
52+
53+
54+ $ xtpl ->parse ('student ' );
55+ $ contents = $ xtpl ->text ('student ' );
56+
57+ include NV_ROOTDIR . '/includes/header.php ' ;
58+ echo nv_admin_theme ($ contents );
59+ include NV_ROOTDIR . '/includes/footer.php ' ;
0 commit comments