Skip to content

Instantly share code, notes, and snippets.

View udibagas's full-sized avatar

udibagas udibagas

View GitHub Profile
@udibagas
udibagas / submit.html
Created March 28, 2013 05:35
ajax submit form dengan jquery
<!--
FORM DI SINI
-->
<div class="html-response"></div>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
<table style="background-image: url(http://office.travelairpng.com/images/11.png);" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td class="toptext" colspan="2">
Top text
</td>
</tr>
<tr>
<td class="lefttext" rowspan="2">
<div class="vertical-text">Mount Hagen</div>
<?php
$sql = mysql_query('SELECT * FROM jurusan WHERE jml_siswa < 30');
?>
<select name="pil_satu">
<?php while ($data = mysql_fetch_array($sql)) : ?>
<option value="<?php echo $data['id']; ?>"><?php echo $data['nama']; ?></option>
<?php endwhile; ?>
</select>
$('select').change(function() {
if (this.val() == 6) {
$('#un').disabled = false;
$('#uas').disabled = false;
} else {
$('#un').disabled = true;
$('#uas').disabled = true;
}
});
<?php
$json_string = '[{"overall":"25"}]';
$json_array = json_decode($json_string);
echo $json_array[0]->overall;
?>
<?php
$con = mysql_connect('localhost', 'root', 'xxx');
$db = mysql_select_db('[nama_db]', $con);
$per_page = 10;
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$query = mysql_query("SELECT * FROM [nama_table] ORDER BY ID ASC LIMIT $offset, $per_page");
while ($data = mysql_fetch_array($query)) {
<?php $kelasArray = CHtml::listData(Kelas::model()->findAll(array(
'select' => 'kelas',
'group' => 'kelas',
'distinct' => true
)), 'kelas', 'kelas'); ?>
<?php echo $form->dropDownListRow($model, 'kelas', $kelasArray, array('empty' => '-- Pilih Kelas --', 'id' => 'kelas')); ?>
<script>
<?php
$a = true;
while ($a == true) {
// your code here
}
<?php
/* Di view */
$this->widget('bootstrap.widgets.TbGridView',array(
'id'=>'my-grid', // perhatikan ini
...
'columns' => array(
...
array(
@udibagas
udibagas / QuizStack.java
Created April 12, 2013 03:04
Contoh implementasi stack (LIFO - Last In First Out) pada Java
public class QuizStack {
public static void main(String[] args) {
Stack st = new Stack(10);
Mhs mhs1 = new Mhs(1, "121", "Bagas", "SI");
Mhs mhs2 = new Mhs(2, "122", "Udi", "SI");
Mhs mhs3 = new Mhs(3, "123", "Sahsangka", "SI");
Mhs mhs4 = new Mhs(4, "124", "Udibagas", "SI");