Format tgl indonesia

MysqlPHP

SELECT CONCAT( CASE DAYOFWEEK(NOW()) WHEN 1 THEN ‘Minggu’ WHEN 2 THEN ‘Senin’ WHEN 3 THEN ‘Selasa’ WHEN 4 THEN ‘Rabu’ WHEN 5 THEN ‘Kamis’ WHEN 6 THEN ‘Jumat’ WHEN 7 THEN ‘Sabtu’ END,’, ‘, DAY(NOW()),’ ‘, CASE MONTH(NOW()) WHEN 1 THEN ‘Januari’ WHEN 2 THEN ‘Februari’ WHEN 3 THEN ‘Maret’ WHEN 4 THEN ‘April’ WHEN

Pencarian data dengan model

PHP

$tgl1 = date(‘Y-m-d’, CDateTimeParser::parse($tgl1, ‘dd-MM-yyyy’)); $tgl2 = date(‘Y-m-d’, CDateTimeParser::parse($tgl2, ‘dd-MM-yyyy’)); $data = Siswa::model()->findByAttributes(array(‘nisn’ => $nisn)); $nama = $data->nama;  

Delete File dengan SweatAlert

PHP

//VIEW <script> function deleteData() { swal.fire({ title: ‘<small>Apakah Anda Yakin akanmenghapus file ini?</small>’, icon: ‘warning’, showCancelButton: true, confirmButtonText: ‘ Import !’, cancelButtonText: ‘Batalkan !’, cancelButtonColor: ‘#d33’, reverseButtons: true }).then((result) => { if (result.value) { var _deleteData_url; <?php echo CHtml::ajax(array( ‘url’=>’js:deleteData._deleteData_url’, ‘data’=> “js:$(this).serialize()”, ‘type’=>’post’, ‘dataType’=>’json’, ‘success’=>”function(data) { if (data.status == ‘success’) { $(‘#ketr’).DataTable().ajax.reload(); swal.fire({ title: ‘Informasi’,