Example #1
0
 public function handle_request_internal()
 {
     $req = APF::get_instance()->get_request();
     $res = APF::get_instance()->get_response();
     $params = $req->get_parameters();
     if (isset($params['add_submit'])) {
         $input_arr = array('name' => $params['reason_name'], 'is_disabled' => $params['disable'], 'is_deleted' => $params['delete']);
         $ret = Bll_DdCommonBiz::get_instance()->add_reason_by_admin($input_arr);
         $url = Admin_ReasonViewController::build_uri();
         $res->redirect($url);
     } else {
         return 'Admin_ReasonAdd';
     }
 }
Example #2
0
 public function handle_request_internal()
 {
     $req = APF::get_instance()->get_request();
     $res = APF::get_instance()->get_response();
     $params = $req->get_parameters();
     $id = $params['cid'] ? $params['cid'] : 0;
     if (isset($params['edit_submit'])) {
         $reason_id = $params['reason_id'];
         $input_arr = array('name' => $params['reason_name'], 'is_disabled' => $params['disable'], 'is_deleted' => $params['delete']);
         $ret = Bll_DdCommonBiz::get_instance()->modify_common($reason_id, $input_arr);
         $url = Admin_ReasonViewController::build_uri();
         $res->redirect($url);
     } else {
         if ($id != 0) {
             $reason = Bll_DdCommonBiz::get_instance()->get_common_by_id($id);
         }
         $req->set_attribute('reason', $reason);
         return 'Admin_ReasonEdit';
     }
 }
Example #3
0
 public function handle_request_internal()
 {
     $req = APF::get_instance()->get_request();
     $res = APF::get_instance()->get_response();
     $params = $req->get_parameters();
     if (isset($params['sort_save'])) {
         $new_sort = $params['reason_sort'];
         $reasons = Bll_DdCommonBiz::get_instance()->get_reasons();
         foreach ($reasons as $key => $row) {
             if ($row->sort != $new_sort[$key]) {
                 $modify_id = $row->id;
                 $input_arr = array('sort' => $new_sort[$key]);
                 $res_id = Bll_DdCommonBiz::get_instance()->modify_common($modify_id, $input_arr);
             }
         }
         $url = Admin_ReasonViewController::build_uri();
         $res->redirect($url);
     } else {
         $reasons = Bll_DdCommonBiz::get_instance()->get_reasons();
         $req->set_attribute('reasons', $reasons);
         return 'Admin_ReasonView';
     }
 }