<?php
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
use App\Models\UcapanModel;
class Ucapan extends BaseController {
    public function index(){return view('admin/ucapan',$this->data+['title'=>'Ucapan & Doa','items'=>(new UcapanModel())->orderBy('id','DESC')->findAll()]);}
    public function approve($id){(new UcapanModel())->update($id,['is_approved'=>1]);return redirect()->back()->with('success','Ucapan disetujui.');}
    public function delete($id=null){(new UcapanModel())->delete($id);return redirect()->back()->with('success','Ucapan dihapus.');}
}
