Skip to content

Instantly share code, notes, and snippets.

View ahmadshobirin's full-sized avatar
😶‍🌫️

Ahmad Shobirin ahmadshobirin

😶‍🌫️
View GitHub Profile
error: function (xhr) {
console.log(xhr);
if (xhr.readyState === 4) {
if (xhr.status === 404) {
swal({
type: 'error',
title: 'Oops...',
text: xhr.responseJSON.error,
});
} else {
@ahmadshobirin
ahmadshobirin / detail product
Last active January 10, 2019 04:34
detail product
@extends('index')
@section("contentheader_title")
Detail Produk {{ ucfirst($product->product) }}
@endsection
@section('customcss')
<link rel="stylesheet" href="{{ asset('/plugins/datatables/dataTables.bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('/plugins/datatables/jquery.dataTables.min.css') }}">
@ahmadshobirin
ahmadshobirin / template product
Last active January 10, 2019 04:33
template product
@extends('index')
@section('contentheader_title','Master Produk')
@section('customcss')
<link rel="stylesheet" href="{{ asset('/plugins/datatables/dataTables.bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('/plugins/datatables/jquery.dataTables.min.css') }}">
@endsection
@section('content')
#############blade
<!-- Modal edit-->
<div id="modal-edit" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
@ahmadshobirin
ahmadshobirin / GENERATE CODE TRANSACTION STRING PHP MYSQL
Last active July 24, 2020 07:55
GENERATE CODE TRANSACTION STRING PHP MYSQL
`DEFINE FUNCTION`
protected function getCode()
{
/*PATTERN
'LINK' + year date + month date + '0000'
'0000' is generate number 4 digit
*/
@ahmadshobirin
ahmadshobirin / html, laravel blade
Last active October 15, 2018 15:26
html kursus online
@extends('index')
@section('contentheader_title','Master User')
@section('customcss')
<link rel="stylesheet" href="{{ asset('/plugins/datatables/dataTables.bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('/plugins/datatables/jquery.dataTables.min.css') }}">
@endsection
@section('content')
public function classes($teacherId)
{
$teacherClass =
TeacherClass::join('m_class','m_class.id','m_teacher_class.class_id')
->select('m_teacher_class.class_id','m_class.name as name_class',
DB::raw("(select COUNT(*) from m_student where m_student.class_id = m_teacher_class.class_id ) as student")
)
->where('teacher_id',$teacherId)->get();
dd($teacherClass);
}
@ahmadshobirin
ahmadshobirin / set locale and timezone indonesia in laravel.md
Last active May 13, 2024 16:27
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' =&gt; 'id']);
@ahmadshobirin
ahmadshobirin / jquery, laravel
Created November 24, 2017 03:15
multiple chekcbox delete
//view
<form action="you/url" method="get">
//this chekcbox on loop
<input type="checkbox" name="id[]" value="{{$gallery->id}}" id="child" class="child">
// chekcbox parent outside loop
<input type="checkbox" name="parent" id="parent">
//submit form
@ahmadshobirin
ahmadshobirin / laravel, jquery, bootstrap
Created November 17, 2017 07:13
Dinamically Slider Carousel Bootstrap in Laravel 5
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
@foreach( $trip->photos as $photo )
<li data-target="#carousel-example-generic" data-slide-to="{{ $loop->index }}" class="{{ $loop->first ? 'active' : '' }}"></li>
@endforeach
</ol>
<!-- Wrapper for slides -->