Skip to content

Instantly share code, notes, and snippets.

View chabibnr's full-sized avatar
🏠
Working from home

Chabib Nurozak chabibnr

🏠
Working from home
View GitHub Profile
@chabibnr
chabibnr / Yii_Library.php
Last active March 5, 2022 00:53
Library Yii2 for Codeigniter
<?php
define('YII_ENABLE_ERROR_HANDLER', false);
/**
* Class Yii_Library
* @package Libraries
*/
class Yii_Library
public function actionReadImportFile($id) {
$data = Yii::$app->session['import_kuesioner'];
$path = \Yii::getAlias('@webroot') . '/uploads/kuesioner/' . $data . '';
try {
$inputFileType = \PHPExcel_IOFactory::identify($path);
$objReader = \PHPExcel_IOFactory::createReader($inputFileType);
libxml_use_internal_errors(true);
public function actionExportExcel($id) {
$kuesioner = \app\models\Kuesioner::find()->where(['id' => $id])->one();
$sqlProyek = "SELECT * FROM proyek WHERE id = '" . $kuesioner->proyek . "' ";
$rowSqlProyek = Yii::$app->db->createCommand($sqlProyek)->queryOne();
$filename = 'Indosurvey - Export Kuesioner ( ' . $kuesioner->judul_kuesioner . ' ) ' . date('Y-m-d') . '.xlsx';
$columnName = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q'];
$column[] = ["No","Judul Kelompok","Pertanyaan","Kolom","Jenis","Opsi","Tanggal dibuat","Tanggal diupdate","Urutan","Min","Max","Default","Keterangan","Wajib","Score", "Pertanyaan Selanjutnya", ""];
<?php
namespace app\components;
use yii\web\View;
/**
* Class Controller
* @package app\components
* @author chabib nurozak <[email protected]>
* @version 1
@chabibnr
chabibnr / index.html
Created November 26, 2017 14:51
jQuery plugin terbilang
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script type="text/javascript" src="ss.js"></script>
<script type="text/javascript">
$(function () {
$(".test").terbilang();
@chabibnr
chabibnr / client
Created December 16, 2017 09:31
Socket
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
<iframe src="http://localhost:8087" height="300" width="200"></iframe>
@chabibnr
chabibnr / AuthLibrary.js
Created March 21, 2018 15:31
Implementasi pada aYom
'use strict';
import {AsyncStorage} from 'react-native';
let Auth = {
async getIsLogin(){
try {
let isLogin = await AsyncStorage.getItem("@SESSION:isLogin");
return '1' === isLogin;
}catch(err){
<?php
/**
* Class ApiController
*
* File Location : application/core/ApiController.php
*
* @property CI_Input $input
* @property CI_Output $output
*/
@chabibnr
chabibnr / FavoriteMenu.dart
Created July 30, 2019 07:33
Temp Delete view
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:submission_4/database/database_helper.dart';
import 'package:submission_4/page/detail_page.dart';
class FavoriteMenu extends StatefulWidget {
final String foodId;
final String foodName;
final String foodImages;
final String locationPage;
@chabibnr
chabibnr / view.php
Created December 5, 2019 04:43
Yii - enter as tab
$JS = <<<JS
$('body').on('keydown', 'input, select', function(e) {
if (e.key === "Enter") {
var self = $(this), form = self.parents('form:eq(0)'), focusable, next;
focusable = form.find('input,a,select,button,textarea').filter(':visible');
next = focusable.eq(focusable.index(this)+1);
if (next.length) {
next.focus();
} else {
form.submit();