Ejemplo n.º 1
0
<?php

error_reporting(E_ALL ^ E_NOTICE);
include_once "includes.php";
update_log('', 'xlogout', 1);
@session_start();
//@session_unregister();
@session_unset();
@session_destroy();
@session_start();
$_SESSION['errmsg'] = "Anda telah logout. Terima kasih.";
?>

<meta http-equiv="refresh" content="0;URL=../login.php">
Ejemplo n.º 2
0
function new_hours(&$state)
{
    log_list($state, $state->row);
    //find this row's records
    //Do audits:
    if ($state->mode == "t") {
        $logdate = clone $state->from_date;
    } elseif ($state->row == 0) {
        //adding in List mode
        $logdate = clone $state->logdate;
        //created by DATE_PICK
    } else {
        $record = reset($state->records);
        //updating in list mode
        $logdate = clone $record["logdate"];
    }
    $status = array();
    if (!audit_hours($state, $logdate, $status)) {
        return;
    }
    //Do DB changes:
    //	adding a row but didn't select existing activity:
    if ($state->row == 0 && $state->activity_id == 0) {
        add_activity($state);
    }
    $columns = $state->mode == "l" ? 1 : $state->columns[COL_COUNT];
    for ($ndx = 0; $ndx < $columns; $ndx++, $logdate->add(new DateInterval('P1D'))) {
        switch ($status[$ndx]) {
            case 'a':
                //add
                add_log($state, $logdate, $ndx);
                break;
            case 'u':
                //update
                update_log($state, $ndx);
                break;
            case 'd':
                //delete
                delete_log($state, $ndx);
                break;
        }
    }
}
Ejemplo n.º 3
0
function new_hours(&$state)
{
    $logdate = clone $state->from_date;
    if ($state->columns < 0 && $state->row == 0) {
        //add a rec in list style
        if (!audit_date($state, $logdate)) {
            return;
        }
    }
    $status = array();
    if (!audit_hours($state, $logdate, $status)) {
        return;
    }
    //adding a row but didn't select existing activity:
    if ($state->row == 0 && $state->activity_id == 0) {
        add_activity($state);
    }
    for ($ndx = 0; $ndx < abs($state->columns); $ndx++, $logdate->add(new DateInterval('P1D'))) {
        switch ($status[$ndx]) {
            case 'a':
                //add
                add_log($state, $logdate, $ndx);
                break;
            case 'u':
                //update
                update_log($state, $logdate, $ndx);
                break;
            case 'd':
                //delete
                delete_log($state, $logdate, $ndx);
                break;
        }
    }
}
Ejemplo n.º 4
0
            $s_delete_pot = "DELETE FROM potongan WHERE kdunit = '" . $kdunit . "' AND bulan = '" . $y . "-" . $m . "'";
            $q_delete_pot = mysql_query($s_delete_pot);
            update_log("Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " berhasil.", "presensi", 1);
            $_SESSION['errmsg'] = "Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " berhasil.";
            ?>
				
				<meta http-equiv="refresh" content="0;URL=index.php?p=468"><?php 
        } else {
            update_log("Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " gagal.", "presensi", 0);
            $_SESSION['errmsg'] = "Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " gagal.";
            ?>
				
				<meta http-equiv="refresh" content="0;URL=index.php?p=468"><?php 
        }
    } else {
        update_log("Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " gagal. Data sudah diverifikasi", "presensi", 0);
        $_SESSION['errmsg'] = "Hapus presensi bulan " . nama_bulan($m + 0) . " " . $y . " gagal. Data sudah diverifikasi";
        ?>
			
			<meta http-equiv="refresh" content="0;URL=index.php?p=468"><?php 
    }
}
?>

	<form action="" method="post" name="xPresensi">
		<fieldset>
			<table class="admintable" cellspacing="1">
				<tr>
					<td class="key">&nbsp;</td>
					<td><font color="red">*Hati-hati!! Semua data pada bulan terpilih akan dihapus!!</font></td>
				</tr>
Ejemplo n.º 5
0
function new_counts(&$state)
{
    log_list($state, $state->row);
    //find this row's records
    $state->recID = 0;
    if ($state->row > 0) {
        //updating (0 is add row)
        $record = reset($state->records);
        if ($record["ID"] == 0) {
            throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid POST 1", true);
        }
        $state->recID = $record["ID"];
    }
    if (!audit_counts($state)) {
        return;
    }
    if (substr($_POST["comments"], 0, 1) == "\n") {
        $_POST["comments"] = "---";
    }
    $logdate = clone $state->from_date;
    if ($state->row == 0) {
        //adding
        add_log($state, $state->logdate);
        return;
    }
    if ($record["event_id"] != $_POST["event"] || $record["account_id"] != $_POST["account"]) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
    }
    if ($_POST["sessions"] == 0) {
        delete_log($state);
    } else {
        update_log($state);
    }
}
Ejemplo n.º 6
0
<?php

checkauthentication();
$table = "sifatsurat";
$h = ekstrak_get($get[1]);
$q = ekstrak_get($get[2]);
$omenu = xmenu("parent", "id = '" . $p . "'");
$xmenu = mysql_fetch_array($omenu);
$p_next = $xmenu['parent'] . "&h=" . $h;
$sql = sql_delete($table, "IdSifat", $q);
$query = mysql_query($sql);
if ($query == 1) {
    $msg = "Hapus sifat surat berhasil. Id = " . $q . ".";
    update_log($msg, $table, $susername, 1);
    $_SESSION['errmsg'] = $msg;
} else {
    $msg = "Hapus sifat surat gagal. Id = " . $q . ".";
    update_log($msg, $table, $susername, 0);
    $_SESSION['errmsg'] = $msg;
}
?>
	
	<meta http-equiv="refresh" content="0;URL=index.php?p=<?php 
echo enkripsi($p_next);
?>
"><?php 
exit;
Ejemplo n.º 7
0
                    }
                    $c++;
                }
            }
            if ($exec) {
                $_SESSION['errmsg'] = "Upload data berhasil!";
                if ($date_from_text > $date_from) {
                    $date_from = $date_from_text;
                }
                if ($date_until_text < $date_until) {
                    $date_until = $date_until_text;
                }
                $sql = "\r\n\t\t\t\t\t\tINSERT INTO import (date_from, date_until, file, importby) \r\n\t\t\t\t\t\tVALUES ('" . $date_from . "', '" . $date_until . "', '" . $filename . "', '" . $Session['xusername'] . "')\r\n\t\t\t\t\t";
                $log_txt .= $sql . "\n";
                mysql_query($sql);
                update_log("Upload data berhasil!", "import", 1);
            }
        }
        fwrite($myfile, $log_txt);
    }
    ?>
			
		<meta http-equiv="refresh" content="0;URL=index.php?p=<?php 
    echo $p;
    ?>
"><?php 
}
?>

	<form action="index.php?p=<?php 
echo $_GET['p'];
Ejemplo n.º 8
0
function new_info(&$state)
{
    $state->recID = 0;
    if ($state->row > 0) {
        //0 is add row
        log_list($state);
        foreach ($state->records as $recID => $record) {
            $state->recID = $recID;
            if ($record["row"] == $state->row) {
                break;
            }
        }
        if ($state->recID == 0) {
            throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid POST", true);
        }
    }
    if (!audit_counts($state)) {
        return false;
    }
    if (substr($_POST["comments"], 0, 1) == "\n") {
        $_POST["comments"] = "---";
    }
    $logdate = clone $state->from_date;
    if ($state->recID == 0) {
        //adding
        if (!audit_date($state, $logdate)) {
            return false;
        }
        add_log($state);
        return;
    }
    if ($state->records[$state->recID]["event_id"] != $_POST["event"] || $state->records[$state->recID]["account_id"] != $_POST["account"]) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
    }
    if ($_POST["sessions"] == 0) {
        delete_log($state);
    } else {
        update_log($state);
    }
}
Ejemplo n.º 9
0
            @session_id();
            @session_register('sukki');
            $_SESSION['sukki'] = 1;
            @session_register('xusername');
            $_SESSION['xusername'] = $xuser->username;
            @session_register('xlevel');
            $_SESSION['xlevel'] = $xuser->level;
            @session_register('xuserid');
            $_SESSION['xuserid'] = $xuser->id;
            @session_register('xuserpass');
            $_SESSION['xuserpass'] = $xuser->password;
            @session_register('xkdunit');
            $_SESSION['xkdunit'] = $xuser->kdunit;
            @session_register('xth');
            $_SESSION['xth'] = date('Y');
            update_log($sql, 'xlogin', 1);
            update_lastvisit($xuser->id);
            ?>
				<meta http-equiv="refresh" content="0;URL=../skpRistek/index.php" /><?php 
            exit;
        }
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
		<title><?php 
echo $title;
?>
</title>
Ejemplo n.º 10
0
						<meta http-equiv="refresh" content="0;URL=../login.php" /><?php 
                }
            } else {
                $msg = "Nama pengguna tidak terdaftar.";
                $_SESSION['errmsg'] = $msg;
                update_log($msg, 'xlogin', $xusername, 0);
                ?>
				
					<meta http-equiv="refresh" content="0;URL=../login.php" /><?php 
            }
        } else {
            $msg = "Kata sandi kosong.";
            $_SESSION['errmsg'] = $msg;
            update_log($msg, 'xlogin', $xusername, 0);
            ?>
				
				<meta http-equiv="refresh" content="0;URL=../login.php" /><?php 
        }
    } else {
        $msg = "Nama pengguna kosong.";
        $_SESSION['errmsg'] = $msg;
        update_log($msg, 'xlogin', $xusername, 0);
        ?>
			
			<meta http-equiv="refresh" content="0;URL=../login.php" /><?php 
    }
} else {
    ?>
	
		<meta http-equiv="refresh" content="0;URL=../login.php" /><?php 
}
Ejemplo n.º 11
0
                }
            }
            $s_update_cs = "UPDATE potongan SET CSRI = '" . $potongan_cs . "' WHERE id = '" . $potongan['id'] . "'";
            $q_update_cs = mysql_query($s_update_cs);
            #END 30 Nov 2014 ###########################################################################
            if ($rs) {
                update_log("Ubah data presensi berhasil. NIP = " . $nip, "presensi", 1);
                $_SESSION['errmsg'] = "Ubah data presensi berhasil.";
                ?>
					
                    <meta http-equiv="refresh" content="0;URL=index.php?p=468&<?php 
                echo $url;
                ?>
"><?php 
            } else {
                update_log("Ubah data presensi gagal. NIP = " . $nip, "presensi", 0);
                $_SESSION['errmsg'] = "Ubah data presensi gagal.";
                ?>
					
                    <meta http-equiv="refresh" content="0;URL=index.php?p=468&<?php 
                echo $url;
                ?>
"><?php 
            }
        }
    } else {
        ?>
			<meta http-equiv="refresh" content="0;URL=index.php?p=468&<?php 
        echo $url;
        ?>
"><?php 
Ejemplo n.º 12
0
function new_amount(&$state)
{
    log_list($state, $state->row);
    //find this row's records
    //Do audits:
    $record = reset($state->records);
    if ($state->type == "") {
        $state->type = $record["type"];
    }
    $status = "";
    if (!audit_amount($state, $status)) {
        return;
    }
    //Do DB changes:
    //	adding a row but didn't select existing activity:
    if ($state->row == 0 && $state->activity_id == 0) {
        add_activity($state);
    }
    switch ($status) {
        case 'a':
            //add
            add_log($state);
            break;
        case 'u':
            //update
            update_log($state);
            break;
        case 'd':
            //delete
            delete_log($state);
            break;
    }
}
Ejemplo n.º 13
0
<?php

include_once "includes.php";
update_log('Logout success.', 'xlogout', @$_GET['u'], 1);
session_start();
session_unset();
session_destroy();
session_start();
$_SESSION['errmsg'] = "Logout success.";
?>

<meta http-equiv="refresh" content="0;URL=../login.php">
Ejemplo n.º 14
0
function new_info(&$state)
{
    global $_DB;
    $state->recID = 0;
    if ($state->process == "u") {
        log_list($state);
        foreach ($state->records as $recID => $record) {
            $state->recID = $recID;
            if ($record["row"] == $state->row) {
                break;
            }
        }
        if ($state->recID == 0) {
            throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid POST", true);
        }
    }
    if (!audit_counts($state)) {
        return false;
    }
    if (substr($_POST["comments"], 0, 1) == "\n") {
        $_POST["comments"] = "---";
    }
    if ($state->recID == 0) {
        //adding
        add_log($state);
        return true;
    }
    if ($state->records[$state->recID]["event_id"] != $_POST["event"]) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
    }
    if ($_POST["sessions"] == 0) {
        delete_log($state);
    } else {
        update_log($state);
    }
    return true;
}
Ejemplo n.º 15
0
function new_info(&$db, &$state)
{
    if (!isset($_POST["recID"])) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid POST", true);
    }
    if (!audit_counts($db, $state)) {
        return false;
    }
    $recID = $_POST["recID"];
    if ($recID == 0) {
        //adding
        add_log($db, $state);
        return true;
    }
    log_list($db, $state);
    if (!array_key_exists(strval($recID), $state->records)) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid recID " . $recID, true);
    }
    if ($state->records[$recID]["event_id"] != $_POST["event"]) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid record " . $recID, true);
    }
    if ($_POST["sessions"] == 0) {
        delete_log($db, $state);
    } else {
        update_log($db, $state);
    }
    return true;
}
Ejemplo n.º 16
0
            $q_update = mysql_query($s_update);
        }
        $s_update_ver = "UPDATE proses_verifikasi SET status_verifikasi_potongan = '" . $ver . "', tanggal_verifikasi_potongan = '" . date("Y-m-d") . "' \r\n\t\t\t\tWHERE id = '" . $id_ver . "'";
        #echo $s_update_ver."<BR>";
        $q_update_ver = mysql_query($s_update_ver);
        if ($q_update_ver) {
            update_log("Verifikasi potongan berhasil.", "potongan", 1);
            $_SESSION['errmsg'] = "Verifikasi potongan berhasil.";
            ?>
					
                    <meta http-equiv="refresh" content="0;URL=index.php?p=475&<?php 
            echo $url;
            ?>
"><?php 
        } else {
            update_log("Verifikasi potongan gagal.", "potongan", 0);
            $_SESSION['errmsg'] = "Verifikasi potongan berhasil.";
            ?>
					
                    <meta http-equiv="refresh" content="0;URL=index.php?p=475&<?php 
            echo $url;
            ?>
"><?php 
        }
    }
    #}
}
?>

<script language="javascript" src="lib/autocombo/autocombo.js"></script>
<form action="" method="get" name="xRekapitulasi">
Ejemplo n.º 17
0
function __init()
{
    global $userdata, $username;
    global $user_id, $log_id;
    global $view, $hours;
    global $Y, $m;
    $userdata = unserialize($_SESSION['i3t']);
    $user_id = $userdata['user_id'];
    $view = $userdata['view'] ? true : false;
    $username = $userdata['username'];
    $hours = $userdata['hours'];
    if (!$view) {
        $log_id = update_log($user_id);
        $_SESSION['i3t'] = serialize(array('user_id' => $user_id, 'username' => $username, 'hours' => $hours, 'log_id' => $log_id, 'view' => $view));
    }
    if (isset($_GET['Y']) && is_numeric($_GET['Y'])) {
        $Y = $_GET['Y'];
    } else {
        $Y = date('Y');
    }
    if (isset($_GET['m']) && $_GET['m'] >= 1 && $_GET['m'] <= 12) {
        $m = $_GET['m'];
    } else {
        $m = date('m');
    }
}
Ejemplo n.º 18
0
if (!isset($_SESSION['id']) || !isset($_SESSION['ipaddress'])) {
    gotoindex();
}
check_login();
if (!isset($_GET['id']) || !isset($_GET['ans'])) {
    exit(0);
}
include "header.php";
$q_id = $_GET['id'];
$ans = $_GET['ans'];
$m_id = $_SESSION['id'];
if (update_answer($m_id, $q_id, $ans) != false) {
    $answer = get_answer($ans);
    $q = pg_fetch_assoc($answer, 0);
    $ans = getAnswer($q['answer']);
    update_log($m_id, $q['answer']);
    print "結果は{$ans}です。";
}
include "footer.php";
function get_answer($id)
{
    $db = new mydb();
    $query = "select * from choices where id = \$1";
    $result = $db->query($query, array($id), "getans");
    return $result;
}
function update_answer($m_id, $q_id, $answer)
{
    $db = new mydb();
    $query = "insert into answer (m_id, q_id, answer) values(\$1, \$2, \$3)";
    $result = $db->query($query, array($m_id, $q_id, $answer));
Ejemplo n.º 19
0
checkauthentication();
$table = "m_ikk_kegiatan";
$field = get_field($table);
$p = $_GET['p'];
$form = $_POST['form'];
$q = $_POST['q'];
$xmenu_p = xmenu_id($p);
$p_next = $xmenu_p->parent;
if (isset($form)) {
    $sql = sql_delete($table, $field[0], $q);
    $rs = mysql_query($sql);
    if ($rs) {
        update_log($sql, $table, 1);
        $_SESSION['errmsg'] = "Hapus data berhasil.";
    } else {
        update_log($sql, $table, 0);
        $_SESSION['errmsg'] = "Hapus data gagal!";
    }
    ?>
		
		<meta http-equiv="refresh" content="0;URL=index.php?p=<?php 
    echo $p_next;
    ?>
"><?php 
    exit;
} else {
    $value = get_value($table, $field, "id='" . $_GET['q'] . "'");
}
?>

<table width="551" cellspacing="1" class="admintable">
Ejemplo n.º 20
0
    } else {
        if ($_FILES['file']['error'] == 1) {
            die("Die Datei ist zu gro&szlig;!");
        }
    }
}
if (isset($_POST["pasteit"]) && $_POST["text"] != "") {
    $name = date("Y-m-d_His") . ".txt";
    $file = fopen(PATH . DATA . $name, "w");
    fwrite($file, $_POST["text"]);
    fclose($file);
    update_log($name);
    header("Location: ." . DATA . $name);
}
if (isset($_SESSION["password"]) && $_SESSION["password"] == PASSWORD && isset($_GET["delete"]) && is_file(PATH . DATA . $_GET["delete"])) {
    update_log($_GET["delete"], "deleted");
    unlink(PATH . DATA . $_GET["delete"]);
}
if (is_dir(PATH . DATA)) {
    $handle = opendir(PATH . DATA);
    while (($file = readdir($handle)) !== false) {
        if ($file != '.' && $file != '..' && is_file($path = PATH . DATA . '/' . $file)) {
            $entry = array('filename' => $file, 'dirpath' => PATH . DATA);
            $entry['modtime'] = filemtime($path);
            $entry['realsize'] = $entry['size'] = filesize($path);
            for ($i = 0; $entry['size'] / 1024 >= 1; $i++) {
                $entry['size'] = $entry['size'] / 1024;
            }
            $entry['size_extension'] = $sizes[$i];
            if (class_exists("finfo")) {
                $finfo = new finfo(FILEINFO_MIME);