Open and freeze switching and function implementation on form pages in HTML

WBOY
Release: 2016-07-25 08:50:18
Original
1532 people have browsed it
新手献上的
  1. 证照信息
  2. ?>
  3. < td>
  4. {$c.account}
  5. only Logo
  6. Type of card
  7. Cardholder name
  8. Card balance
  9. Bank card number
  10. Phone
  11. Card status
  12. Operations
  13. Startup Settings
  14. {$c.id}
  15. if($c['type']==1)
  16. {
  17. echo 'Corporate Card';
  18. }
  19. ?>
  20. {$c.name}

  21. {$c.idcard}
  22. {$c.phone}
  23. if($c['status']==0)
  24. echo 'freeze';
  25. if($c['status']==1)
  26. echo 'enable' ;
  27. ?>
  28. Modify Delete
  29. 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. ?>
    复制代码


  • source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!