本文整理汇总了PHP中catat函数的典型用法代码示例。如果您正苦于以下问题:PHP catat函数的具体用法?PHP catat怎么用?PHP catat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了catat函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_kepala
get_kepala();
$kas = new db();
if (isset($_POST['tombol']) && isset($_SESSION['nama'])) {
$val = mysql_real_escape_string($_POST['val']);
$ket = mysql_real_escape_string($_POST['ket']);
$type = $_POST['jenis'];
$skg = date('Y-m-d');
$sal_akhr = $kas->single("SELECT saldo FROM tbl_kas ORDER by id DESC LIMIT 0,1");
if ($type == 'keluar') {
$saldo = $sal_akhr - $val;
$cat = "Pengeluaran";
} elseif ($type == 'masuk') {
$saldo = $sal_akhr + $val;
$cat = "Pemasukkan";
}
catat($_SESSION['nama'], "{$cat} sejumlah {$val}");
mysql_query("INSERT INTO tbl_kas SET {$type} = '{$val}', tgl = '{$skg}', ket='{$ket}', saldo='{$saldo}'");
}
?>
<script type='text/javascript'>
function cek_ok(){
var valu=document.forms['frm-kas']['jenis'].value;
if(valu=='pilih'){
document.forms['frm-kas']['tombol'].disabled=true;
}else{
document.forms['frm-kas']['tombol'].disabled=false;
}
}
</script>
<script type='text/javascript'>
function uang(num) {
示例2: addslashes
$row[$j] = addslashes($row[$j]);
$row[$j] = ereg_replace("\n", "\\n", $row[$j]);
if (isset($row[$j])) {
$return .= '"' . $row[$j] . '"';
} else {
$return .= '""';
}
if ($j < $num_fields - 1) {
$return .= ',';
}
}
$return .= ");\n";
}
}
$return .= "\n\n\n";
}
//simpan file di folder yang anda tentukan sendiri. kalo saya sech folder "DATA"
$nama_file;
$handle = fopen('./data_backup/' . $nama_file, 'w+');
fwrite($handle, $return);
fclose($handle);
}
$file = date("DdMY") . 'lukstron' . time() . '.sql';
$tanggal = date('Y-m-d H:i:s');
backup_tables("localhost", "root", "", "e-pegawai", $file);
mysql_query("insert into backup_data values(NULL,'{$tanggal}','{$file}')");
include "../../include/catat.php";
$user = $_SESSION['KODE_PETUGAS'];
$aksi = "Melakukan pencadangan basis data";
catat($user, $aksi);
示例3: number_format
"/></td>
<td align="center" valign="top">
<!--ajie 18 june-->
<input name="nilai_capaian[]" id="nilai_capaian" type="text" size="5" value="<?php
echo number_format(nilai_capaian($nib_penilai, $id_skp, $skp_dtl['no_tugas']), "2", ".", ",");
?>
" onFocus="startCalculate(<?php
echo $no - 1;
?>
)" onBlur="stopCalc()"/></td>
<td align="center" valign="top">
<textarea name="catatan[]" id="catatan" rows="3" cols="30"><?php
echo catat($nib_penilai, $id_skp, $skp_dtl['no_tugas']);
?>
</textarea></td>
</tr>
<script type="text/javascript">
//edit terakhir 14 june 2013 ajie noorseto
function startCalculate(i){
//alert(i);
interval=setInterval("Calculate('"+i+"')",100);
}
function Calculate(i){
var a=document.form.jumlah_nilai[i].value;
var b=document.form.kualitas_nilai[i].value;
var c=document.form.waktu_nilai[i].value;
示例4: mysql_query
//Lets do the harlem shake.. :D
$convert_sql = "INSERT INTO tbl_kas SET id=\"{$id}\", tgl=\"{$tgl}\", ket=\"{$ket}\", masuk=\"{$masuk}\", keluar=\"{$keluar}\", saldo=\"{$saldo}\"";
if (mysql_query($convert_sql)) {
$berhasil++;
} else {
//echo "Error Insert data to new table";
$gagal++;
}
}
//Endwhile
echo "<p>Horreee.. !! Data Kas berhasil di upgrade. Berhasil di transfer {$berhasil} item, Gagal di transfer {$gagal} item. Selesai</p>";
if ($berhasil != 0) {
$finish_query = mysql_query("DROP TABLE buku, kas, pinjaman,tempo");
//Daffuk we
if ($finish_query) {
catat("SISTEM", "Berhasil Upgrade ke versi " . getVersion());
echo "<a href='?upgrade=finish' class='btn btn-success'>Selesai >></a>";
} else {
echo "Unable to drop old tables, do it manualy :D<br>" . mysql_error();
}
}
exit(0);
} elseif ($mode == 'finish') {
echo "<h1>Horeee..</h1><p>Versi Libska berhasil di update, versi saat ini adalah " . getVersion() . ".<br>Silahkan hapus / rename folder upgrade pada direktori utama :D.</p>";
echo "<a href='../index.php?upgrade=selesai' class='btn'>Kembali Ke laptop >></a>";
}
?>
</div>
</div>
</body>
示例5: buku
//Inisialisasi data buku
$cBuku = new buku();
$cBuku->setKode($dbuku);
$count = $cBuku->getCount() + 1;
//Petugas
$ptgs = $_SESSION['uid'];
//Sql Query
$peminjaman = mysql_query("INSERT INTO tbl_peminjaman SET siswa=\"{$dsiswa}\", buku=\"{$dbuku}\", tgl_tempo=\"{$tgl_kembali}\", tgl_pinjam=\"{$tgl_pinjam}\", id_petugas=\"{$ptgs}\"");
//Debug
// echo "INSERT INTO tbl_peminjaman SET siswa=\"$dsiswa\", buku=\"$dbuku\", tgl_kembali=\"2013-01-01\", tgl_pinjam=\"2013-01-01\", id_petugas=\"99\"";
if ($peminjaman) {
$buku = mysql_query("UPDATE tbl_buku SET status=\"0\", peminjam=\"{$dsiswa}\", count=\"{$count}\" WHERE kd_buku=\"{$dbuku}\"");
if ($buku) {
$qSiswa = mysql_query("UPDATE tbl_anggota SET count=\"{$meminjam}\" WHERE no_induk=\"{$dsiswa}\"");
if ($qSiswa) {
catat(get_pustakawan($ptgs), "Melayani " . $cSiswa->getNama() . " meminjam " . $cBuku->getJudul());
echo "<script>\$('#pop-pinjam').modal('hide');</script>";
echo "<script type='text/javascript'>window.location.reload(true);</script>";
} else {
echo "<div class=\"alert alert-error\">Terjadi kesalahan saat proses meminjam buku</div>";
}
}
}
//Stop eksekusi kode di bawah
exit(0);
}
//ENd Mode Pinjam
/*******Simpan Peminjaman**************/
?>
<script type="text/javascript">
示例6: mysql_query
}
}
/*Kembali Satu2*/
if (isset($_GET['kmb'])) {
$tgl_kmbl = $_GET["tgl_pinjem"];
$kmb = mysql_query("UPDATE tbl_peminjaman SET kembali='1', tgl_kembali='{$tgl_kembali}' WHERE siswa='{$cari}' && buku='{$kd_buku}' && tgl_pinjam='{$tgl_kmbl}'");
$buk = mysql_query("UPDATE tbl_buku SET status='1', peminjam='0' WHERE peminjam='{$cari}' && kd_buku='{$kd_buku}'");
//$tempo=
if ($kmb && $buk) {
$s = mysql_query("DELETE FROM tbl_telat WHERE buku='{$kd_buku}'");
if ($s) {
//echo "hapused";
} else {
echo "Gagal Menghapus Jatuh Tempo !!";
}
catat($_SESSION['nama'], "Mengembalikan Buku {$kd_buku} dari {$cari} ");
}
}
/*Ambil Peminjam*/
if ($cari != '' && $where == 'siswa') {
$pem = mysql_query("SELECT * FROM tbl_anggota WHERE no_induk = {$cari}");
$si = mysql_fetch_array($pem);
$hisi = mysql_num_rows($pem);
}
//**Page**//
$bates = $_GET['banyak'];
if ($bates == '') {
$bates = '25';
}
$bts = $bates;
$hal = $_GET['hal'];
示例7: mysql_query
$s = mysql_query("SELECT * FROM tbl_pustakawan WHERE user='" . $nama . "' AND kunci='" . $kunci . "'");
$c = mysql_num_rows($s);
if ($c == '1') {
$t = mysql_fetch_array($s);
$log = $t['login'];
$log = $log + 1;
mysql_query("UPDATE tbl_pustakawan SET login='{$log}' WHERE user='{$nama}'");
$_SESSION['nama'] = $t['nama'];
$_SESSION['level'] = $t['level'];
$_SESSION['uid'] = $t['id'];
catat($_SESSION['nama'], "Berhasil Login");
//header('location: index.php');
echo "<script>window.location='index.php'</script>";
exit;
} else {
catat($nama, "Gagal Login");
$script = "<script type='text/javascript'>";
$script .= "\$('document').ready(function(){";
$script .= "\$('#result').html('<p class=\\'alert alert-error\\'>Username dan Password tidak cocok !</p>');";
$script .= "})";
$script .= "</script>";
echo $script;
}
}
?>
<div class="login" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: block;">
<div class="modal-header">
<h3 id="myModalLabel">Login User</h3>
</div>
<form action='' method='POST'>
<div class="modal-body">
示例8: session_start
<?php
session_start();
/*
File: log.php
Fungsi: File untuk melihat aktivitas aplikasi.
Auth: ShowCheap
*/
require 'sistem/config.php';
cek_user();
sambung();
get_kepala();
$log = new db();
if (isset($_GET['reset']) && isset($_SESSION['level'])) {
$log->sql("TRUNCATE log");
catat($_SESSION['nama'], "Menghapus Log/Aktivitas");
}
$lihat = mysql_real_escape_string($_GET['item']);
$tambah = $lihat + 50;
if ($lihat == '') {
$lihat = '100';
}
$log->sql("SELECT * FROM log ORDER BY id ASC LIMIT 0, {$lihat}");
?>
<script type='text/javascript'>
function reset(){
var tanya = confirm('Yakin Reset Semua Aktivitas??');
if(tanya){
window.location='?reset';
}
}
示例9: siswa
$siswa = $_GET["siswa"];
$osiswa = new siswa();
$osiswa->setInduk($siswa);
$kmb = mysql_query("UPDATE tbl_peminjaman SET kembali='1', tgl_kembali='{$kembaline}' WHERE siswa='{$siswa}' && kembali='0'");
$buk = mysql_query("UPDATE tbl_buku SET status='1', peminjam='0' WHERE peminjam='{$siswa}'");
//echo "UPDATE pinjaman SET kembali='1', kembaline='$kembaline' WHERE siswa='$siswa' && kembali='0' <br>";
//echo "update buku set status='Ada', peminjam='0' where peminjam='$siswa' <br>";
//$tempo=
if ($kmb && $buk) {
$c = mysql_query("DELETE FROM tbl_telat WHERE induk ='{$siswa}'");
if ($c) {
//echo "Di Busek";
} else {
catat("Gagal Menghapus Jatuh Tempo dari " . $osiswa->getNama());
}
catat($_SESSION['nama'], "Mengembalikan Semua Buku dari " . $osiswa->getNama());
}
exit(0);
}
?>
<div class="well" style="padding: 10px;">
<a href="#" class="btn"><?php
echo $member->getNama();
?>
</a>
<a id="detail" href="#" class="btn" rel="popover" data-toggle="button">Detail</a>
<script>
$('#detail').popover({
html : 'true',
placement : 'right',
示例10: catat
echo "<script type='text/javascript'>alert('Berhasil di Simpan');</script>";
} else {
catat($_SESSION['nama'], "Gagal Menambah Buku {$jdl}");
echo "<script type='text/javascript'>alert('Gagal Di Simpan');</script>";
}
}
//jika hapus
if ($_GET['hapus'] == '1') {
$bukune = $_GET['buku'];
$guak = mysql_query("DELETE FROM tbl_buku WHERE kd_buku='{$bukune}'");
if ($guak) {
catat($_SESSION['nama'], "Menghapus Buku {$bukune}");
//header('location: buku.php');
echo "<script type=\"text/javascript\">window.location='buku.php'</script>";
} else {
catat($_SESSION['nama'], "Gagal Menghapus Buku {$bukune}");
echo "<script type='text/javascript'>alert('Buku Gagal di Hapus \n Mohon di chek kembali.');</script>";
}
}
if (isset($_GET['tBuku'])) {
$bukunya = $_GET['tBuku'];
$by = explode('/', $bukunya);
$kod = substr($by[2], 0, 2);
$bukunya = $by[0] . "/" . $by[1] . "/" . $kod;
//echo $bukunya;
$sq = mysql_query("SELECT * FROM tbl_buku WHERE kd_buku LIKE '{$bukunya}%' ORDER BY kd_buku DESC");
$arr = mysql_fetch_array($sq);
$scp = explode('/', $arr['kd_buku']);
$kd = substr($scp[2], 0, 2);
$akhir = substr($scp[2], -3);
$akhir = $akhir + 1;
示例11: session_start
<?php
session_start();
require_once 'sistem/config.php';
sambung();
catat($_SESSION['nama'], "Keluar Aplikasi");
unset($_SESSION['level']);
unset($_SESSION['nama']);
if ($_SESSION['level'] == '' && $_SESSION['nama'] == '') {
header('location:index.php');
}
示例12: doExport
public function doExport($sql)
{
$this->sq = $sql;
$nama_file = $this->nama . "-" . date('d-m-Y') . ".xls";
$conn = $this->k;
$db = $this->db;
//$sql = "SELECT * FROM biodata_siswa";
$rec = mysql_query($sql) or die(mysql_error());
$num_fields = mysql_num_fields($rec);
for ($i = 0; $i < $num_fields; $i++) {
$header .= mysql_field_name($rec, $i) . "\t";
}
while ($row = mysql_fetch_row($rec)) {
$line = '';
foreach ($row as $value) {
if (!isset($value) || $value == "") {
$value = "\t";
} else {
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line) . "\n";
}
$data = str_replace("\r", "", $data);
if ($data == "") {
$data = "\n Datane Ora Enek!\n";
}
catat($_SESSION['nama'], "Mengunduh File >>> {$nama_file}");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename={$nama_file}");
header("Pragma: no-cache");
header("Expires: 0");
$copy = "Generated by Libska 2012 ShowCheap";
print "{$header}\n{$data}\n{$copy}";
}
示例13: exit
exit(0);
}
/*Data Penambahan Siswa*/
$induk = mysql_real_escape_string($_POST['no_induk']);
$nama = mysql_real_escape_string($_POST['nama']);
$class = $_POST['kelas'];
$voc = $_POST['jurusan'];
if ($_POST['tambah'] && $induk != '' && $nama != '') {
$try = mysql_query("INSERT INTO tbl_anggota SET no_induk = '{$induk}', nama='{$nama}', kelas='{$class}', jurusan='{$voc}'");
if ($try) {
//echo "<script type='text/javacsript'>alert('Lunasss')</script>";
catat($_SESSION['nama'], "Berhasil Menambah {$nama}");
echo "<script type='text/javascript'>alert('Berhasil Di Tambahkan !!')</script>";
} else {
//echo "<script type='text/javacsript'>alert('Gagaasdfsdfl Di Tambahkan !!')</script>";
catat($_SESSION['nama'], "Gagal Menambah {$nama}");
echo "<script type='text/javascript'>alert('Gagal Di Tambahkan !!')</script>";
}
}
/*Ambil data Form*/
$murni = $_GET['cari'];
$cari = mysql_real_escape_string($_GET['cari']);
$dari = $_GET['dari'];
if (!isset($dari)) {
$dari = 'no_induk';
}
$kelas = $_GET['kelas'];
if ($kelas == '') {
$kelas = '%%';
}
$jur = $_GET['jurusan'];