Enable and freeze switching and feature implementation on the HTML form page

Source: Internet
Author: User
For beginners.
  1. License information
  2. ?>
  3. Uniquely identifies
  4. Type of card
  5. Card Holder's name
  6. The balance of the card
  7. Bank card number
  8. Phone
  9. Status of the card
  10. Operation
  11. Startup settings
  12. {$c. ID}
  13. if ($c [' type ']==1)
  14. {
  15. Echo ' corporate card ';
  16. }
  17. ?>
  18. {$c. Name}

  19. {$c. Account}
  20. {$c. Idcard}
  21. {$c. Phone}
  22. if ($c [' Status ']==0)
  23. echo ' freezes ';
  24. if ($c [' Status ']==1)
  25. echo ' Enable ';
  26. ?>
  27. Modify Delete
  28. Enable/ freeze
Copy Code
  1. /**
  2. * co-branded card management
  3. * @author Shendoudou
  4. *
  5. */
  6. Import (' @.model.platform.commonmodel ');
  7. Class Icbccardmodel extends Commonmodel {
  8. Public Function Findallcard () {
  9. $result = $this->select ();
  10. if ($result = = = False)
  11. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  12. return $result;
  13. }
  14. Public Function Findonecard ($id) {
  15. $map [' id ']= $id;
  16. $result = $this->where ($map)->find ();
  17. if ($result = = = False)
  18. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  19. return $result;
  20. }
  21. Public Function Updatecard ($id, $data) {
  22. $map [' id ']= $id;
  23. $result = $this->where ($map)->save ($data);
  24. if ($result = = = False)
  25. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  26. return $result;
  27. }
  28. Public Function Deletecard ($id) {
  29. $map [' id ']= $id;
  30. $result = $this->where ($map)->delete ();
  31. if ($result = = = False)
  32. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  33. return $result;
  34. }
  35. Public Function Findstatusid ($status) {
  36. $map [' status ']= $status;
  37. $result = $this->where ($map)->field (' id ')->select ();
  38. if ($result = = = False)
  39. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  40. return $result;
  41. }
  42. Public Function Changecardstatus ($id, $status) {
  43. $map [' id ']= $id;
  44. $map [' status ']= $status;
  45. $result = $this->save ($map);
  46. if ($result = = = False)
  47. throw new Dbexception ($this->getmodelname (), $this->getdberror (), $this->getlastsql ());
  48. return $result;
  49. }
  50. }
  51. ?>
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.