Example #1
0
 function first_page()
 {
     $coverpage = new Coverpage();
     $coverpage->where("status = 'approve' and active = 1")->get();
     if ($coverpage->id != "") {
         redirect("coverpages/index/" . $coverpage->id);
     } else {
         redirect("home/index");
     }
 }
Example #2
0
 function approve2($id)
 {
     if ($_POST) {
         $coverpage = new Coverpage($id);
         $coverpage->from_array($_POST);
         $coverpage->save();
         $coverpage->clear();
         $coverpage->where('id <>', $id)->get();
         $coverpage->update_all('active', 0);
     }
 }