Changing Active status


/ Published in: PHP
Save to your folder(s)

This is a model method to change active status. If it is 1 then change to 0 and vis verse


Copy this code and paste it in your HTML
  1. function WeekStatus($id){
  2. // getting status of page
  3. $weekinfo = array();
  4. $weekinfo = $this->getweek($id);
  5. $status = $weekinfo['active'];
  6. if($status ==1){
  7.  
  8. $data = array('active' => 0);
  9. $this->db->update('omc_week', $data);
  10.  
  11. }else{
  12.  
  13. $data = array('status' => 1);
  14. $this->db->update('omc_week', $data);
  15. }
  16.  
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.