operation.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * 网站设置
  4. *
  5. *
  6. *
  7. ***/
  8. defined('InShopNC') or exit('Access Invalid!');
  9. class operationControl extends SystemControl{
  10. private $links = array(
  11. array('url'=>'act=operation&op=setting','lang'=>'nc_operation_set'),
  12. );
  13. public function __construct(){
  14. parent::__construct();
  15. Language::read('setting');
  16. }
  17. /**
  18. * 基本设置
  19. */
  20. public function settingOp(){
  21. $model_setting = Model('setting');
  22. if (chksubmit()){
  23. $obj_validate = new Validator();
  24. $obj_validate->validateparam = array(
  25. );
  26. $error = $obj_validate->validate();
  27. if ($error != ''){
  28. showMessage($error);
  29. }else {
  30. $update_array = array();
  31. $update_array['promotion_allow'] = $_POST['promotion_allow'];
  32. $update_array['groupbuy_allow'] = $_POST['groupbuy_allow'];
  33. $update_array['points_isuse'] = $_POST['points_isuse'];
  34. $update_array['pointshop_isuse'] = $_POST['pointshop_isuse'];
  35. $update_array['voucher_allow'] = $_POST['voucher_allow'];
  36. $update_array['pointprod_isuse'] = $_POST['pointprod_isuse'];
  37. $update_array['points_reg'] = intval($_POST['points_reg'])?$_POST['points_reg']:0;
  38. $update_array['points_login'] = intval($_POST['points_login'])?$_POST['points_login']:0;
  39. $update_array['points_comments'] = intval($_POST['points_comments'])?$_POST['points_comments']:0;
  40. $update_array['points_orderrate'] = intval($_POST['points_orderrate'])?$_POST['points_orderrate']:0;
  41. $update_array['points_ordermax'] = intval($_POST['points_ordermax'])?$_POST['points_ordermax']:0;
  42. $update_array['points_invite'] = intval($_POST['points_invite'])?$_POST['points_invite']:0;
  43. $update_array['points_rebate'] = intval($_POST['points_rebate'])?$_POST['points_rebate']:0;
  44. $result = $model_setting->updateSetting($update_array);
  45. if ($result === true){
  46. $this->log(L('nc_edit,nc_operation,nc_operation_set'),1);
  47. showMessage(L('nc_common_save_succ'));
  48. }else {
  49. showMessage(L('nc_common_save_fail'));
  50. }
  51. }
  52. }
  53. $list_setting = $model_setting->getListSetting();
  54. Tpl::output('list_setting',$list_setting);
  55. Tpl::output('top_link',$this->sublink($this->links,'setting'));
  56. Tpl::showpage('operation.setting');
  57. }
  58. }