-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
84 lines (76 loc) · 2.21 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?PHP
/**
===================================
Ôàéë: index.php
-----------------------------------------------------
Âåðñèÿ: 1.1v
-----------------------------------------------------
Íàçíà÷åíèå: Ãëàâíûé ôàéë
===================================
**/
define ('WEB_MODER',TRUE);
define ( 'WM_ROOT_DIR', dirname ( __FILE__ ) );
define ( 'WM_ENGINE_DIR', WM_ROOT_DIR . '/engine' );
define ( 'WM_MOD_DIR', WM_ENGINE_DIR . '/mods' );
include_once WM_ENGINE_DIR."/functions.php";
include_once WM_ENGINE_DIR."/classes/excelwriter.inc.php";
if($_POST['student_idd'] != null){
if($_GET['date'] != NULL){
$date = explode("-", $_GET[date]);
$year = $date["0"];
$month = $date["1"];
$day = $date["2"];
}else{
$year = date("Y");
$month = date("m");
$day = date("d");
}
$date = $year."-".$month."-".$day;
$student_id = $_POST['student_idd'];
$less_id = $_GET['less'];
$group_id = $_GET['group'];
if($_POST['check'] == 'on'){
WM_add_date($date,$less_id,$group_id,$student_id);
header("location: ".$_SERVER['REQUEST_URI']."");
}
if($_POST['check'] == null){
WM_delete_date($date,$less_id,$group_id,$student_id);
header("location: ".$_SERVER['REQUEST_URI']."");
}
}
if($_GET['mod'] == 'exel' && $_GET['date'] != null && $_GET['less'] != null && $_GET['group'] != null) {
$students = WM_select_students($_GET['group']);
if($_GET['date'] != NULL){
$date = explode("-", $_GET[date]);
$year = $date["0"];
$month = $date["1"];
$day = $date["2"];
}else{
$year = date("Y");
$month = date("m");
$day = date("d");
}
$date = $year."-".$month."-".$day;
$less_id = $_GET['less'];
$group_id = $_GET['group'];
$output = "¹\tÈìÿ\tÏ\tÇàìåòêà\n";
$i=1;
foreach($students as $student){
$a = WM_select_date_stud($date,$less_id,$group_id,$student['id']);
$b = WM_select_date_stud($date,$less_id,$group_id,$student['id'],2);
if($a and $b) $data = false;
if($a and !$b) $data = true;
if(!$a and !$b) $data = false;
if($data) $act = "+"; else $act = "-";
$output .= "$i\t".$student['student']."\t$act\t\"\n\"line break\"\n";
$i++;
}
header("Content-type: application/vnd.ms-excel");
header('Content-disposition: attachment; filename="report_' . $date . '.xls"');
print $output;
exit;
}
else{
WM_mod_content();
}
?>