bankedit.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace WY\app\controller\mobile;
  3. use WY\app\libs\Controller;
  4. use WY\app\model\Bill;
  5. if (!defined('WY_ROOT')) {
  6. exit;
  7. }
  8. class bankedit extends CheckUser
  9. {
  10. public function index()
  11. {
  12. $bankno=$_GET['bankno'];
  13. $bankcfo = $this->model()->select()->from('cfo')->where(array('fields' => 'id=?', 'values' => array($bankno)))->fetchRow();
  14. $data = array('title' => '¹ÜÀíÒøÐп¨', 'bankcfo' => $bankcfo);
  15. $this->put('bankedit.php', $data);
  16. }
  17. function editsavecfo(){
  18. $id = isset($this->action[3]) ? intval($this->action[3]) : 0;
  19. $bankname = $this->req->post('bankname');
  20. $provice = $this->req->post('provice');
  21. $city = $this->req->post('city');
  22. $branchname = $this->req->post('branchname');
  23. $accountname = $this->req->post('accountname');
  24. $cardno = $this->req->post('cardno');
  25. if ($id == '' && $bankname == '' || $provice == '' || $city == '' || $branchname == '' || $accountname == '' || $cardno == '') {
  26. echo json_encode(array('status' => 0));
  27. exit;
  28. }
  29. $data = array('bankname' => $bankname, 'provice' => str_replace('Ê¡', '', $provice), 'city' => str_replace('ÊÐ', '', $city), 'branchname' => $branchname, 'accountname' => $accountname, 'cardno' => $cardno);
  30. if ($this->model()->from('cfo')->updateSet($data)->where(array('fields' => 'userid=? and id=?', 'values' => array($this->userData['id'], $id)))->update()) {
  31. echo json_encode(array('status' => 1));
  32. exit;
  33. }
  34. echo json_encode(array('status' => 0));
  35. }
  36. }
  37. ?>