Nama Source Code : certificate.php

Nama Element pada Custom Cert : code

Tanggal Dibuat : 05 Desember 2022

URL code : https://domain_situs/mod/customcert/classes/certificate.php

Download Plugin : Download




Source Code Text :

        public static function generate_code() {

        global $DB;


$getidna = $DB->get_record_sql("SELECT MAX(id) AS id FROM {customcert_issues}");

$kodeCert = $getidna->id;

$urutan = (int) substr($kodeCert, 3, 3);

$urutan++;

$kodeCertificate = sprintf("%08s", $urutan);


        $uniquecodefound = false;

        //$code =  rand(10,100).'/TA/P.IV/'.date('Y');

        $code =  $getidna->id.'/TA/P.IV/'.date('Y');

        while (!$uniquecodefound) {

            if (!$DB->record_exists('customcert_issues', array('code' => $code))) {

                $uniquecodefound = true;

            } else {

                $code = random_string(10);

            }

        }


Untuk Donwload Plugin silakan hubungi salah satu kontak berikut ini  :

e-mail : muhamad.fikri118@gmail.com
WhatsApp : 083134372868