<?php
defined('BASEPATH') or exit('No direct script access allowed');

class ControllerWaLogs extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $tgl_hari = date('Y-m-d');
        $tgl_hapus = date('Y-m-d', strtotime('-7 days', strtotime($tgl_hari)));
        // Hapus WA Logs
        $this->db->where('tgl_kirim <=', $tgl_hapus . ' 23:59:59');
        $this->db->delete('logs_wa');
        // Hapus Login Logs
        $this->db->where('created_at <=', $tgl_hapus . ' 23:59:59');
        $this->db->delete('logs_login');
        echo '<pre>';
        echo 'Terimakasih!!!';
        die;
    }
}

/* End of file ControllerWaLogs.php and path \application\controllers\notifikasi\ControllerWaLogs.php */