function editEvent() { $id = (int) $this->Get['id']; load::logic('event'); $EventLogic = new EventLogic(); $postman = $EventLogic->get_postman($id); if ($postman != MEMBER_ID) { $this->Messager("你无权修改该活动"); } $free = 'checked'; $all = 'checked'; $info = array(); $info = jconf::get('profileeventinfo'); $val = array(); if ($id) { $act = "edit"; $val = $EventLogic->get_event_info($id); $item_id = $val['item_id']; $title = $val['title']; $moneys = $val['money']; $content = $val['content']; $address = $val['address']; if ($val['image']) { $image = $val['image']; } $edit_fromt = date("Y-m-d", $val['fromt']); $edit_fromt_h = date("H", $val['fromt']); $edit_fromt_i = date("i", $val['fromt']); $edit_tot = date("Y-m-d", $val['tot']); $edit_tot_h = date("H", $val['tot']); $edit_tot_i = date("i", $val['tot']); if ($val['money']) { $money = 'checked'; $free = ''; } else { $money = ''; $free = 'checked'; } $qualification = unserialize($val['qualification']); if (count($qualification)) { $qua = "checked"; $all = ""; if ($qualification['fans_num']) { $fans = "checked"; $fans_num = $qualification['fans_num']; } if ($qualification['same_city']) { $same_city = "checked"; } if ($qualification['inqun']) { $inqun = " checked "; } } $need_app_info = unserialize($val['need_app_info']); if (count($need_app_info)) { foreach ($need_app_info as $value) { $info[$value]['checked'] = "checked"; } } } $rs = $EventLogic->get_event_type(TRUE); $event_type = jform()->Select("type", $rs, $val['type_id']); $province = $EventLogic->get_province(); $province_id = $val['province_id']; $hid_province = $province_id; $province_list = jform()->Select("province", $province, $province_id, "onchange=\"changeProvince();\""); $city_id = $val['city_id']; $hid_city = $city_id; $area_id = $val['area_id']; $hid_area = $area_id; $fromt = $edit_fromt ? $edit_fromt : my_date_format(TIMESTAMP, 'Y-m-d'); $edit_fromt_h = $edit_fromt_h ? $edit_fromt_h : false; $edit_fromt_i = $edit_fromt_i ? $edit_fromt_i : false; $hour_select_from = mk_time_select('hour', $edit_fromt_h, 'hour_select_from'); $min_select_from = mk_time_select('min', $edit_fromt_i, 'min_select_from'); $tot = $edit_tot ? $edit_tot : my_date_format(TIMESTAMP + 7 * 24 * 3600, 'Y-m-d'); $edit_tot_h = $edit_tot_h ? $edit_tot_h : false; $edit_tot_i = $edit_tot_i ? $edit_tot_i : false; $hour_select_to = mk_time_select('hour', $edit_tot_h, 'hour_select_to'); $min_select_to = mk_time_select('min', $edit_tot_i, 'min_select_to'); $member = $this->Member; $this->Title = "修改活动"; include template('event/event_create'); }
function need_info() { load::logic('event'); $EventLogic = new EventLogic(); $id = (int) $this->Get['id']; $post = $this->Post; $profile = jlogic('member_profile')->getProfile(); $event_info = $EventLogic->get_event_info($id); $qua = $event_info['need_app_info']; $qua_info = unserialize($qua); $qua_arr = array(); $time = TIMESTAMP; if ($qua_info) { foreach ($qua_info as $key => $val) { if (!$post[$val]) { json_error("请输入" . $profile[$val]['title']); } if ($profile[$val]['formtype'] == 'select' && $profile[$val]['choices']) { $choices = explode("\r\n", $profile[$val]['choices']); foreach ($choices as $v) { list($v1, $v2) = explode("|", $v); $v2 || ($v2 = $v1); $new_choices[$v1] = $v2; } if ($new_choices[$post[$val]]) { $post[$val] = $new_choices[$post[$val]]; } unset($new_choices); } $qua_arr[$profile[$val]['title']] = $post[$val]; } } $qua_arr['留言'] = $post['content']; $qua = serialize($qua_arr); $EventLogic->doApp($id, $qua); json_result("1"); }