Skip to content

Instantly share code, notes, and snippets.

View ruliarmando's full-sized avatar
🎮
Playing

Rully Ramanda ruliarmando

🎮
Playing
View GitHub Profile
@ruliarmando
ruliarmando / index.html
Created April 13, 2014 13:27
ajax frontend
<!doctype html>
<html>
<head>
<title>Ajax WebService</title>
<script src="jquery.js"></script>
</head>
<body>
<form id="calc">
<input type="text" name="operand1" />
<select name="operator">
<?php
class AdminModule extends CWebModule
{
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
@ruliarmando
ruliarmando / base_url.php
Created April 12, 2014 09:19
get site base url
function base_url()
{
$protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"], 0, 5)) == 'https' ? 'https://' : 'http://';
$path = $_SERVER['PHP_SELF'];
$path_parts = pathinfo($path);
$directory = $path_parts['dirname'];
$directory = ($directory == "/") ? "" : $directory;
$host = $_SERVER['HTTP_HOST'];
return $protocol . $host . $directory;
}
<?php
array(
'name'=>'name',
'type'=>'raw',
'value'=>'$data->name',
'filter'=>$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model'=>$model,
'attribute'=>'name',
'source'=>$this->createUrl('user/usersAutoComplete'),
'options'=>array(
@ruliarmando
ruliarmando / main.php
Created April 3, 2014 12:30
yii configuration for yiistrap and yiiwheels
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Sistem Pakar',
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<?php
$data = array(
'hendra' => 78,
'nina' => 90,
'budi' => 80,
'chandra' => 77,
'anisa' => 92,
'dedi' => 90,
);
@ruliarmando
ruliarmando / check_matakuliah.php
Created March 11, 2014 07:04
check mata kuliah
<?php
$kd_matkul = 'ABC'; // ini bisa diambil dari inputan atau form POST
$nim = '100449983'; // ini bisa diambil dari inputan atau form POST
$query_prasyarat = "select kd_matakuliah_prasayarat from mata_kuliah where kd_matakuliah = {$kd_matkul}";
$result = mysql_query($query_prasyarat) or die('query gagal');
$row = mysql_fetch_row($result);
<?php
$array1 = array(
array('b','d'),
array('c','a'),
array('b','d'),
array('a','d'),
array('c'),
array('c'),
array('a','d','e'),
@ruliarmando
ruliarmando / sriwijaya.php
Last active August 29, 2015 13:56
search sriwijaya flight
public function actionSearchSriwijaya(){
Yii::import('application.vendors.*');
require_once('curl/curl.php');
require_once('simple_html_dom.php');
$curl = new Curl;
$curl->options['CURLOPT_SSL_VERIFYPEER'] = false;
$response = $curl->get('https://agent.sriwijayaair.co.id/b2b/secure/home.jsp');