This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array( | |
'hendra' => 78, | |
'nina' => 90, | |
'budi' => 80, | |
'chandra' => 77, | |
'anisa' => 92, | |
'dedi' => 90, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array1 = array( | |
array('b','d'), | |
array('c','a'), | |
array('b','d'), | |
array('a','d'), | |
array('c'), | |
array('c'), | |
array('a','d','e'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |