Skip to content

Instantly share code, notes, and snippets.

View erowsika's full-sized avatar

Edi erowsika

  • Makassar, Indonesia
View GitHub Profile
<?php
// file ssp.class.php
// https://raw.githubusercontent.com/DataTables/DataTables/master/examples/server_side/scripts/ssp.class.php
/*
* Helper functions for building a DataTables server-side processing SQL query
*
* The static functions in this class are just helper functions to help build
* the SQL used in the DataTables demo server-side processing scripts. These
<?php
// file connection.php
$con = mysqli_connect("localhost", "username", "password", "dbname");
// file login.php
require_once(__DIR__ . '/connection.php');
session_start();
<?php
// file connection.php
$con = mysqli_connect("localhost", "username", "password", "dbname");
// file login.php
require_once(__DIR__ . '/connection.php');
session_start();
<?php
// store result to file
$file_output = [
'unique_jabatan' => 'INSERT_MASTER_JABATAN',
'unique_subbidang' => 'INSERT_MASTER_SUBBIDANG',
'unique_bidang' => 'INSERT_MASTER_BIDANG',
'unique_unitkerja' => 'INSERT_MASTER_UNITKERJA',
];
foreach ($result as $_key => $_item) {
$f = fopen(base_path($file_output[$_key]), 'w');
<?php
function csv_to_array($filename, $delimiter = "\t")
{
$header = null;
$data = [];
if (($handle = fopen($filename, 'r')) !== FALSE) {
while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {
if(!$header)
$header = $row;
<?php
ini_set('memory_limit', '512M');
$inputFileName = public_path('mutasi.xlsx');
/** Identify the type of $inputFileName **/
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName);
/** Create a new Reader of the type that has been identified **/
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
<?php
$username = "blabla";
$pass = "3CVzq8MmV8U3TXDL";
$host = "localhost";
$db = "db_arsip";
$connect = mysqli_connect($host, $username, $pass, $db) or die(mysqli_error($connect));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<main>
<?php
$eror = false;
$pesan = 'Maaf';
//type file yang bisa diupload
$file_type = [
'jpg',
'jpeg',
'gif',
'bmp',
<?php
$eror = false;
$pesan = 'Maaf';
//type file yang bisa diupload
$file_type = [
'jpg',
'jpeg',
'gif',
'bmp',