예제 #1
0
파일: Taxes.php 프로젝트: askzap/ultimate
 public function update($id, $params)
 {
     $status = Response::STATUS_BAD_REQUEST;
     $data = array();
     $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
     $tax_id = fn_update_tax($params, $id, $lang_code);
     if ($tax_id) {
         $status = Response::STATUS_OK;
         $data = array('tax_id' => $tax_id);
     }
     return array('status' => $status, 'data' => $data);
 }
예제 #2
0
파일: taxes.php 프로젝트: askzap/ultimate
 }
 //
 // Delete taxes
 //
 if ($mode == 'm_delete') {
     // Delete selected taxes
     if (!empty($_REQUEST['tax_ids'])) {
         fn_delete_taxes($_REQUEST['tax_ids']);
     }
     $suffix = '.manage';
 }
 //
 // Update selected tax data
 //
 if ($mode == 'update') {
     $tax_id = fn_update_tax($_REQUEST['tax_data'], $_REQUEST['tax_id'], DESCR_SL);
     $suffix = ".update?tax_id={$tax_id}";
 }
 if ($mode == 'apply_selected_taxes') {
     if (!empty($_REQUEST['tax_ids'])) {
         $tax_names = fn_get_tax_name($_REQUEST['tax_ids']);
         foreach ($_REQUEST['tax_ids'] as $v) {
             db_query("UPDATE ?:products SET tax_ids = ?p", fn_add_to_set('?:products.tax_ids', $v));
             fn_set_notification('N', __('notice'), __('text_tax_applied', array('[tax]' => $tax_names[$v])));
         }
     }
     $suffix = '.manage';
 }
 if ($mode == 'unset_selected_taxes') {
     if (!empty($_REQUEST['tax_ids'])) {
         $tax_names = fn_get_tax_name($_REQUEST['tax_ids']);