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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/**
* 活动发布完成
* $Id: event_publishing_result.php,v 1.1 2020/01/03 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("14")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
// 参数取得
$id = ParamUtil::getRequestNumber("id");
$title = ParamUtil::getRequestString("title");
$comment = ParamUtil::getRequestString("comment");
$position = ParamUtil::getRequestString("position");
$position_longitude = ParamUtil::getRequestString("position_longitude");
$position_latitude = ParamUtil::getRequestString("position_latitude");
$scope = ParamUtil::getRequestArray("scope", array());
$province = ParamUtil::getRequestString("province");
$city = ParamUtil::getRequestString("city");
$district = ParamUtil::getRequestString("district");
$max_member_flg = ParamUtil::getRequestString("max_member_flg");
$max_member = ParamUtil::getRequestNumber("max_member");
$start_time = ParamUtil::getRequestString("start_time");
$finish_time = ParamUtil::getRequestString("finish_time");
$time_length = ParamUtil::getRequestString("time_length");
$enroll_time = ParamUtil::getRequestString("enroll_time");
$leader_name = ParamUtil::getRequestString("leader_name");
$leader_contact = ParamUtil::getRequestString("leader_contact");
$venue = ParamUtil::getRequestString("venue");
$venue_time = ParamUtil::getRequestString("venue_time");
$author= ParamUtil::getRequestString("author");
$volunteer_event_dat = VolunteerEventDat::getById($id);
if ($volunteer_event_dat == null) {
// エラー表示
$message = "对象不存在.";
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$volunteer_event_dat->title = $title;
$volunteer_event_dat->comment = $comment;
$volunteer_event_dat->start_time = $start_time;
$volunteer_event_dat->finish_time = $finish_time;
$volunteer_event_dat->enroll_time = $enroll_time;
$volunteer_event_dat->position = $position;
if(empty($position_latitude)){
$volunteer_event_dat->position_latitude = $position_latitude;
}
if(empty($position_longitude)){
$volunteer_event_dat->position_longitude= $position_longitude;
}
$volunteer_event_dat->account_id = $_account->id;
if(empty($author)){
$volunteer_event_dat->author = $_account->name;
}else{
$volunteer_event_dat->author = $author;
}
$volunteer_event_dat->author_role = $_account->role;
if($_account->school_id != 0){
$school_mst = SchoolMst::getById($_account->school_id);
$volunteer_event_dat->school_no = $school_mst->school_no;
$volunteer_event_dat->original_source = $school_mst->original_source;
}
if(in_array("school", $scope)){
if($_account->user_id != 0){
$user_mst = UserMst::getById($_account->user_id);
$volunteer_event_dat->province = $user_mst->province;
$volunteer_event_dat->city = $user_mst->city;
$volunteer_event_dat->district = $user_mst->district;
}else if($_account->school_id != 0){
$school_mst = SchoolMst::getById($_account->school_id);
$volunteer_event_dat->province = $school_mst->province;
$volunteer_event_dat->city = $school_mst->city;
$volunteer_event_dat->district = $school_mst->district;
}else if($_account->government_id != 0){
$government_mst = GovernmentMst::getById($_account->government_id);
$volunteer_event_dat->province = $government_mst->province;
$volunteer_event_dat->city = $government_mst->city;
$volunteer_event_dat->district = $government_mst->district;
}else {
$volunteer_event_dat->province = $province;
$volunteer_event_dat->city = $city;
$volunteer_event_dat->district = $district;
}
}else if(in_array("social", $scope)){
$volunteer_event_dat->include_social_user = true;
}
if($max_member_flg == "2"){
$volunteer_event_dat->max_member = $max_member;
}
$volunteer_event_dat->time_length = $time_length;
$volunteer_event_dat->leader_name = $leader_name;
$volunteer_event_dat->leader_contact = $leader_contact;
$volunteer_event_dat->venue = $venue;
$volunteer_event_dat->venue_time = $venue_time;
if(!empty($_FILES['front_image']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES["front_image"]);
$tmp_file_name = date("YmdHis") . "_" . trim($upload_file->name);
$aliHandler = new AliUploadHandler();
$aliHandler->delete(substr ( $volunteer_event_dat->front_image, strrpos ( $volunteer_event_dat->front_image, "/" ) + 1 ));
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
ErrorLogger::doOutput($url);
$volunteer_event_dat->front_image = $url;
}
$volunteer_event_dat->save();
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "event_edit_result.inc";
$layout_pages["menu_clicked"] = "3-1";
//require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/content_iframe.inc");
exit;