Skip to content

Instantly share code, notes, and snippets.

View rwaddin's full-sized avatar
🖥️
Freelance Full-stack web developer

addin rwaddin

🖥️
Freelance Full-stack web developer
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@rwaddin
rwaddin / set active nav
Created May 14, 2020 07:50
Function Menu CI3 case panel adminLTE 2.4.8
if (! function_exists('nav_active'))
{
function nav_active($type = false, $uri = false, $nav = false, $with_class = false)
{
if ($type AND $uri AND $nav) {
switch ($type) {
# just compare 2 string
# use nav_active("one",foo", "foo")
case "one":
@rwaddin
rwaddin / Setting with json.php
Last active June 30, 2020 14:18
setting web with json just 1 index, you can modify :)
<?php
if (! function_exists('setting'))
{
function setting($index = false)
{
if (file_exists("./setting.json") AND $index) {
$json = file_get_contents('./setting.json');
$data = json_decode($json,true);
return (isset($data[$index])) ? $data[$index] : false;
}
@rwaddin
rwaddin / BOX adminLTE .html
Last active July 7, 2020 15:56
For adminLTE 2.4.8
<div class="box box-primary">
<div class="box-header with-border">
<div class="box-title">Just title </div>
<div class="box-tools pull-right">
<a href="" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i> add</a>
</div>
</div>
<div class="box-body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
@rwaddin
rwaddin / adminLTE - Custom Tabs.html
Last active May 27, 2020 06:39
i use at adminLTE 2.4.8
<div class="nav-tabs-custom">
<ul class="nav nav-tabs pull-right">
<li class="active"><a href="#tab_1-1" data-toggle="tab">Tab 1</a></li>
<li><a href="#tab_2-2" data-toggle="tab">Tab 2</a></li>
<li><a href="#tab_3-2" data-toggle="tab">Tab 3</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Dropdown <span class="caret"></span>
</a>
<ul class="dropdown-menu">
@rwaddin
rwaddin / json-create.php
Created May 19, 2020 04:42
Create file json use php
<?php
// Data 1
$data [] = array(
'no' => 1,
'nama' => 'Rudi',
'alamat' => 'Nganjuk'
);
// Data 2
$data [] = array(
@rwaddin
rwaddin / json-read.php
Created May 19, 2020 04:43
Read a file json with php
<?php
// File json yang akan dibaca (full path file)
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-insert.php
Created May 19, 2020 04:44
Insert data to file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-update.php
Created May 19, 2020 04:45
Update file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);
@rwaddin
rwaddin / json-delete.php
Created May 19, 2020 04:45
Delete data file json with php
<?php
// File json yang akan dibaca
$file = "anggota.json";
// Mendapatkan file json
$anggota = file_get_contents($file);
// Mendecode anggota.json
$data = json_decode($anggota, true);