SELECT handphone,NO_TELP_KONTAK_DARURAT,
PARSENAME(REPLACE(handphone,',','.'),2) 'Hp' ,
PARSENAME(REPLACE(NO_TELP_KONTAK_DARURAT,',','.'),1) 'Telp'
FROM spg_pegawai
Rabu, 30 November 2016
Kamis, 29 September 2016
Load Page Tanpa Menghilangkan Data Sebelumnya
window.onload = function() {
var nama = getCookie('nama');
document.getElementById('nama_field').value=nama;
}
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname+"="+cvalue+"; "+expires;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i var c = ca[i];
while (c.charAt(0)==' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function cek_tanggung_jawab(uname,val) {
if (val != "" && val != null) {
setCookie("temp_tanggung_jawab", val);
}
}
var nama = getCookie('nama');
document.getElementById('nama_field').value=nama;
}
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname+"="+cvalue+"; "+expires;
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i
while (c.charAt(0)==' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function cek_tanggung_jawab(uname,val) {
if (val != "" && val != null) {
setCookie("temp_tanggung_jawab", val);
}
}
Jumat, 12 Agustus 2016
Oracle. Query menghitung umur berdasarkan tanggal lahir
select trunc(months_between(sysdate,tgl_lahir)/12) year,
trunc(mod(months_between(sysdate,tgl_lahir),12)) month,
trunc(sysdate-add_months(dob,trunc(months_between(sysdate,tgl_lahir)/12)*12+trunc(mod(months_between(sysdate,dob),12)))) day,tmt_jab_peg
from (Select to_date(tanggal_lahir) tgl_lahir,to_date(tanggal_lahir) tanggal_lahir from tabel_mahasiswa order by nim desc)
trunc(mod(months_between(sysdate,tgl_lahir),12)) month,
trunc(sysdate-add_months(dob,trunc(months_between(sysdate,tgl_lahir)/12)*12+trunc(mod(months_between(sysdate,dob),12)))) day,tmt_jab_peg
from (Select to_date(tanggal_lahir) tgl_lahir,to_date(tanggal_lahir) tanggal_lahir from tabel_mahasiswa order by nim desc)
Minggu, 28 Februari 2016
Jquery : Mengirim paramter ke file php tanpa url
pastikan file jquery.js sudah ada
echo "
?>
di bawah ini script di file tampil.js
================== start =====================
var nip="";
$(document).ready(function() {
nip = $("#nip").val();
selesai();
});
function selesai() {
setTimeout(function() {
update();
selesai();
}, 200);
}
function update() {
$.getJSON("tampil.php", {nip:nip} ,function(data) {
$("ul").empty();
$.each(data.result, function() {
$("ul").append("Pilih Kompetensi("+this['total']+")");
});
});
}
=================== end =====================
di bawah ini script di file tampil.php
=================== start ====================
include("$DOCUMENT_ROOT/koneksi.php");
$sql = "SELECT count(*) as total FROM table_siswa WHERE nip='$nip'";
$rs = $f->get_last_record($sql);
$total = $rs['total'];
$result = array();
array_push($result, array('total' => $total));
echo json_encode(array("result" => $result));
?>
=================== end====================
echo "
- data akan tampil disini secara otomatis tanpa load halaman
?>
di bawah ini script di file tampil.js
================== start =====================
var nip="";
$(document).ready(function() {
nip = $("#nip").val();
selesai();
});
function selesai() {
setTimeout(function() {
update();
selesai();
}, 200);
}
function update() {
$.getJSON("tampil.php", {nip:nip} ,function(data) {
$("ul").empty();
$.each(data.result, function() {
$("ul").append("Pilih Kompetensi("+this['total']+")");
});
});
}
=================== end =====================
di bawah ini script di file tampil.php
=================== start ====================
include("$DOCUMENT_ROOT/koneksi.php");
$sql = "SELECT count(*) as total FROM table_siswa WHERE nip='$nip'";
$rs = $f->get_last_record($sql);
$total = $rs['total'];
$result = array();
array_push($result, array('total' => $total));
echo json_encode(array("result" => $result));
?>
=================== end====================
Langganan:
Postingan (Atom)