<?php

//Hak Cipta dilindungi Undang-undang. Hak Cipta : Khamdi Rahmani, Reg. Kemenkum HAM No : 000121327. Dilarang merubah isi File tanpa ijin tertulis dari pemegang Hak Cipta. 

class toast
{
    public function show($act, $title, $subtitle, $class, $body)
    {
        $show = "
        <script>
            $('.{$act}').ready(function() {
                $(document).Toasts('create', {
                    title: '{$title}',
                    subtitle: '{$subtitle}',
                    class: '{$class}',
                    autohide: true,
                    delay: 1800,
                    body: '{$body}'
                })
            });
        </script>";
        return $show;
    }

    public function redirect($getkey, $getval, $window)
    {
        $getkey = md5($getkey);
        $getval = md5($getval);
        $window = md5($window);
        $redirect = "
        <script type='text/javascript'>document.location.href='./?{$getkey}={$getval}&p463={$window}';</script>";
        return $redirect;
    }
    public function redirecInvalid($getkey, $getval, $window)
    {
        $getkey = md5($getkey);
        $getval = md5($getval);
        $window = md5($window);
        $redirect = "
        <script type='text/javascript'>document.location.href='./?{$getkey}={$getval}&p463={$window}';</script>";
        return $redirect;
    }
    public function redirectID($getkey, $getval, $id, $window)
    {
        $getkey = md5($getkey);
        $getval = md5($getval);
        $window = md5($window);
        $redirect = "
        <script type='text/javascript'>document.location.href='./?{$getkey}={$getval}&i4={$id}&p463={$window}';</script>";
        return $redirect;
    }
    public function redirectTR($getkey, $getval, $id, $id_tr, $tahun, $window)
    {
        $getkey = md5($getkey);
        $getval = md5($getval);
        $window = md5($window);
        $redirect = "
        <script type='text/javascript'>document.location.href='./?{$getkey}={$getval}&i4={$id}&id_tr={$id_tr}&tahun={$tahun}&p463={$window}';</script>";
        return $redirect;
    }
}
