示例#1
0
<?php

kick('agendaadd', $menurole);
$error_tgl_agenda = "";
$error_hal_agenda = "";
$error_uraian_agenda = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_perekam = $_SESSION['id'];
    $tgl_agenda = sql($_POST['tgl_agenda']);
    $hal_agenda = safe($_POST['hal_agenda']);
    $uraian_agenda = safe($_POST['uraian_agenda']);
    //    validasi tgl agenda
    if ($tgl_agenda == "--") {
        $error_tgl_agenda = "Tanggal Agenda Tidak Boleh Kosong";
    }
    //    validasi hal agenda
    if ($hal_agenda == "") {
        $error_hal_agenda = "Judul Agenda Tidak Boleh Kosong";
    }
    //    validasi uraian agenda
    if ($uraian_agenda == "") {
        $error_uraian_agenda = "Uraian Agenda Tidak Boleh Kosong";
    }
    //    jika tidak ada kesalahan
    if ($error_tgl_agenda == "" && $error_hal_agenda == "" && $error_uraian_agenda == "") {
        $query = "INSERT INTO agenda (id_perekam,tgl_agenda,hal_agenda,uraian_agenda) VALUES \r\n                ('{$id_perekam}','{$tgl_agenda}','{$hal_agenda}','{$uraian_agenda}') ";
        $result = mysql_query($query);
        if (!$result) {
            echo die(mysql_error());
        }
示例#2
0
<?php

kick('agendadelete', $menurole);
$id_agenda = $_GET['id_agenda'];
$query = "DELETE FROM agenda WHERE id_agenda= '{$id_agenda}'";
$result = mysql_query($query);
if (!$result) {
    echo die(mysql_error());
}
$_SESSION['pesan'] = "delok";
echo '<script type="text/javascript">window.location="index.php?c=agenda&m=agenda"</script>';
示例#3
0
<?php

kick('penerimaanedit', $menurole);
$error_tahun = "";
$error_bulan = "";
$error_bm = "";
$error_cukai = "";
$error_piutang = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_perekam = $_SESSION['id'];
    $tahun = safe($_POST['tahun']);
    $bulan = safe($_POST['bulan']);
    $bm = safe($_POST['bm']);
    $cukai = safe($_POST['cukai']);
    $piutang = safe($_POST['piutang']);
    $id_penerimaan = safe($_POST['id_penerimaan']);
    //    validasi duplikasi
    $cekduplicate = "SELECT * FROM penerimaan WHERE tahun='{$tahun}' AND bulan='{$bulan}' AND id_penerimaan <> '{$id_penerimaan}'";
    $resultduplicate = mysql_query($cekduplicate);
    $jumlahduplicate = mysql_num_rows($resultduplicate);
    if ($jumlahduplicate > 0) {
        $error_bulan = "Penerimaan pada bulan dan tahun tersebut sudah ada di database";
    }
    //    validasi bm
    if ($bm == "") {
        $error_bm = "Bea Masuk Tidak Boleh Kosong";
    } else {
        if (!is_numeric($bm)) {
            $error_bm = "Bea masuk harus berupa angka";
        }
示例#4
0
		{
			$newItem->attach('ingredient', intval($ing));
		}
		
		foreach( $data['char'] as $char )
		{
			$newItem->attach('characteristic', intval($char));
		}
		
		$data['id'] = $newItem->itemid;
		
		kick(2, $data, 13);
	}
	else
	{
		kick(1, $data, 14);
	}
	
	function kick( $to, $data, $code )
	{
		if( $fwd != null )
		{
			throw new RedirectBrowserException($fwd);
		}
		else
		{
			if( $to == 0 )
			{
				$urlenc = urlencode("item.php?" . http_build_query($data));
				throw new RedirectBrowserException("/login.php?code=" . $code . "&fwd=" . $urlenc);
			}
示例#5
0
<?php

kick('sosmeddelete', $menurole);
$id_sosmed = $_GET['id_sosmed'];
$query = "DELETE FROM sosmed WHERE id_sosmed= '{$id_sosmed}'";
$result = mysql_query($query);
if (!$result) {
    echo die(mysql_error());
}
$_SESSION['pesan'] = "delok";
echo '<script type="text/javascript">window.location="index.php?c=sosmed&m=sosmed"</script>';
    $transaction_content->product_id = $product->id;
    $transaction_content->count = $count;
    $transaction_content->amount = $amount;
    $transaction_content->stock_usage = $count * $product->value;
    $contents[] = $transaction_content;
}
$sum = $transaction->amount;
$diff = abs(round($sum) - $sum);
if ($diff != 0) {
    $transaction_content = new TransactionContent();
    $transaction_content->product_id = 0;
    $transaction_content->count = 1;
    $transaction_content->amount = $diff;
    $contents[] = $transaction_content;
    $transaction->amount += $diff;
}
if ($transaction->amount > $recieved) {
    die("Det är för lite betalt. {$transaction->amount} < {$recieved}");
}
$transaction->commit();
foreach ($contents as $content) {
    $content->transaction_id = $transaction->id;
    $content->commit();
}
if (isset($_SESSION['random']) && $_SESSION['random'] == ClientData::post('random')) {
    die('Form was already submitted');
}
$_SESSION['random'] = ClientData::post('random');
$db->commit();
kick("retail?last_recieved={$recieved}");
示例#7
0
<?php

kick('penerimaandelete', $menurole);
$id_berita = $_GET['id_berita'];
$query = "DELETE FROM berita WHERE id_berita = '{$id_berita}'";
$result = mysql_query($query);
if (!$result) {
    echo die(mysql_error());
}
$_SESSION['pesan'] = "delok";
echo '<script type="text/javascript">window.location="index.php?c=berita&m=berita"</script>';
$sales->amount = -$sales_amount;
$sales->commit();
$till = new AccountTransactionContent();
$till->account_transaction_id = $transaction->id;
$till->account_id = Account::from_code_name('till')->id;
$till->amount = ClientData::post('till') - $old_till;
$till->commit();
$diff = new AccountTransactionContent();
$diff->account_transaction_id = $transaction->id;
$diff->account_id = Account::from_code_name('diff')->id;
$diff->amount = -($till->amount + $sales->amount);
$diff->commit();
$stock = new AccountTransactionContent();
$stock->account_transaction_id = $transaction->id;
$stock->account_id = Account::from_code_name('stock')->id;
$stock->amount = -$stock_amount;
$stock->commit();
$stock_usage = new AccountTransactionContent();
$stock_usage->account_transaction_id = $transaction->id;
$stock_usage->account_id = Account::from_code_name('stock_change')->id;
$stock_usage->amount = $stock_amount;
$stock_usage->commit();
$daily_count = new DailyCount();
$daily_count->time = $time;
$daily_count->amount = ClientData::post('till');
$daily_count->account_transaction_id = $transaction->id;
$daily_count->user = $_SESSION['login'];
$daily_count->commit();
$db->commit();
kick("/account_transaction/{$transaction->id}");
示例#9
0
<?php

kick('agenda', $menurole);
if (isset($_REQUEST['keyword']) && $_REQUEST['keyword'] != "") {
    $keyword = $_REQUEST['keyword'];
    $reload = "index.php?c=agenda&m=agenda&keyword={$keyword}";
    $sql = "SELECT * FROM agenda\r\n                WHERE \r\n                    hal_agenda LIKE '%{$keyword}%' \r\n                    OR uraian_agenda LIKE '%{$keyword}%' \r\n                ORDER BY\r\n                    tgl_agenda DESC";
    $result = mysql_query($sql);
} else {
    $reload = "index.php?c=agenda&m=agenda";
    $sql = "SELECT * FROM agenda \r\n                ORDER BY \r\n                    tgl_agenda DESC";
    $result = mysql_query($sql);
}
//pagination config start
$rpp = 10;
$adjacents = 4;
$page = intval($_GET["page"]);
if ($page <= 0) {
    $page = 1;
}
$tcount = mysql_num_rows($result);
$tpages = $tcount ? ceil($tcount / $rpp) : 1;
// total pages, last page number
$count = 0;
$i = ($page - 1) * $rpp;
$no_urut = ($page - 1) * $rpp;
//pagination config end
?>

<!--heading start-->
<div class="row">
<?php

if (empty($_SESSION['login'])) {
    kick('login?kickback=' . kickback_url());
}
$transaction = AccountTransaction::from_id(array_shift($request));
$contents = $transaction->AccountTransactionContent;
?>
<h1>Transaktion - <p><?php 
echo $transaction->description;
?>
</h1>
<table>
	<tr>
		<th>Användare</th>
		<td><?php 
echo $transaction->User;
?>
</td>
	</tr>
	<tr>
		<th>Tid</th>
		<td><?php 
echo $transaction->timestamp;
?>
</td>
	</tr>
</table>
<table>
	<thead>
		<tr>
示例#11
0
<?php

kick('sosmededit', $menurole);
$error_sosmed = "";
$error_link = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $sosmed = safe($_POST['sosmed']);
    $link = safe($_POST['link']);
    $id_sosmed = $_POST['id_sosmed'];
    //    validasi tgl sosmed
    if ($sosmed == "") {
        $error_sosmed = "Sosial Media Tidak Boleh Kosong";
    }
    //    validasi uraian sosmed
    if ($link == "") {
        $error_link = "Link Tidak Boleh Kosong";
    }
    if ($error_sosmed == "" && $error_link == "") {
        $query = "UPDATE sosmed set sosmed='{$sosmed}',link='{$link}'\r\n                        WHERE id_sosmed='{$id_sosmed}'";
        $result = mysql_query($query);
        if (!$result) {
            echo die(mysql_error());
        }
        $_SESSION['pesan'] = "editok";
        echo '<script type="text/javascript">window.location="index.php?c=sosmed&m=sosmed"</script>';
    }
}
$id_sosmed = $_GET['id_sosmed'];
$query = "SELECT * FROM sosmed WHERE id_sosmed='{$id_sosmed}'";
$result = mysql_query($query);
示例#12
0
文件: get.php 项目: nuxi/MiningBuddy
function process_get()
{
    global $page;
    global $MySelf;
    $ajax = 0;
    switch ($_GET['action']) {
        // Maintenance!
        case "maintenance":
            $page = maintenance();
            break;
            // a specific run is requested.
        // a specific run is requested.
        case "show":
            $page = listRun();
            $ajax = 20;
            break;
            // a profile is requested.
        // a profile is requested.
        case "profile":
            $page = profile();
            break;
            // a profile change is requested.
        // a profile change is requested.
        case "modprofile":
            $page = modProfile();
            break;
            // Admin request to delete an api key (NOT user deleting own!)
        // Admin request to delete an api key (NOT user deleting own!)
        case "delapi":
            $page = deleteAPIKey();
            break;
            // Quick toggle of login capabilities.
        // Quick toggle of login capabilities.
        case "toggleLogin":
            $page = toggleLogin();
            break;
            // Quick confirm an account.
        // Quick confirm an account.
        case "quickconfirm":
            $page = quickConfirm();
            break;
            // Change of eMail requested
        // Change of eMail requested
        case "changeemail":
            $page = makeEmailChangeForm();
            break;
            // Show corp hierarchy
        // Show corp hierarchy
        case "hierarchy":
            $page = showHierarchy();
            break;
            // Browser solar Systems
        // Browser solar Systems
        case "browse":
            $page = browser();
            break;
            // User wants to delete a run.
        // User wants to delete a run.
        case "deleterun":
            deleteRun();
            break;
            // User wants to see the preferences page.
        // User wants to see the preferences page.
        case "preferences":
            $page = makePreferences();
            break;
            // A banker wants to see the transaction log for a user.
        // A banker wants to see the transaction log for a user.
        case "showTransactions":
            $page = showTransactions();
            break;
            // User wants to manage his cans.
        // User wants to manage his cans.
        case "cans":
            $page = makeCanPage();
            break;
            // Print out fancy global statistics
        // Print out fancy global statistics
        case "globstats":
            $page = globalStatistics();
            break;
            // User wants to re-validate his email.
        // User wants to re-validate his email.
        case "revalidate":
            validate();
            break;
            // User wants to pop a can.
        // User wants to pop a can.
        case "popcan":
            $page = popCan();
            break;
            // Kick a user.
        // Kick a user.
        case "kickban":
            $page = kick();
            break;
            // User wants to toggle the empty/full setting of a can.
        // User wants to toggle the empty/full setting of a can.
        case "togglecan":
            $page = toggleCan();
            break;
            // close a run.
        // close a run.
        case "endrun":
            endrun();
            break;
            // Show ore values
        // Show ore values
        case "showorevalue":
            $page = showOreValue();
            break;
            // Show ship values
        // Show ship values
        case "showshipvalue":
            $page = showShipValue();
            break;
            // Show Corp Hierarchy
        // Show Corp Hierarchy
        case "hier":
            $page = showHierarchy();
            break;
            // manage payouts
        // manage payouts
        case "payout":
            $page = payout();
            break;
            // set/view the online time
        // set/view the online time
        case "onlinetime":
            $page = onlineTime();
            break;
            // Mods a template
        // Mods a template
        case "edittemplate":
            $page = editTemplate();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changeow":
            $page = makeOreWorth();
            break;
            // Some Admin wants to change the ore values.
        // Some Admin wants to change the ore values.
        case "changesv":
            $page = makeShipValue();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "changepw":
            $page = makePWChangeForm();
            break;
            // User wants to join the selected run.
        // User wants to join the selected run.
        case "joinrun":
            $page = joinRun();
            break;
            // User wants to part the selected run.
        // User wants to part the selected run.
        case "partrun":
            $page = leaveRun();
            break;
            // Password change request. We wont touch that.
        // Password change request. We wont touch that.
        case "lostpass":
            $page = makeLostPassForm();
            break;
            // Lotto: Create group
        // Lotto: Create group
        case "lotto_createGroup":
            $page = lotto_createGroup();
            break;
            // add ore from a haul to an open run.
        // add ore from a haul to an open run.
        case "addhaul":
            $page = addHaulPage();
            break;
            // Edit site configuration
        // Edit site configuration
        case "configuration":
            $page = configuration();
            break;
            // Add an event.
        // Add an event.
        case "addevent":
            $page = addEvent();
            break;
            // Show all events.
        // Show all events.
        case "showevents":
            $page = showEvents();
            break;
            // Join an Event
        // Join an Event
        case "joinevent":
            $page = joinEvent();
            break;
            // Show an event.
        // Show an event.
        case "showevent":
            $page = showEvent();
            break;
            // lists all ore runs.
        // lists all ore runs.
        case "list":
            $page = listRuns();
            $ajax = 60;
            break;
            // Manage wallet
        // Manage wallet
        case "manageWallet":
            $page = manageWallet();
            break;
            // Show current ranks
        // Show current ranks
        case "showranks":
            $page = showRanks();
            break;
            // delete a rank
        // delete a rank
        case "deleterank":
            $page = delRank();
            break;
            // delete an event from the database.
        // delete an event from the database.
        case "deleteevent":
            $page = deleteEvent();
            break;
            // lists all users.
        // lists all users.
        case "editusers":
            $page = listUsers();
            break;
            // lists one user.
        // lists one user.
        case "edituser":
            $page = listUser();
            break;
            // prints the form for a new run.
        // prints the form for a new run.
        case "newrun":
            $page = makeNewOreRunPage();
            break;
            // add a new user.
        // add a new user.
        case "newuser":
            $page = makeAddUserForm();
            break;
            // Toggle the charity flag.
        // Toggle the charity flag.
        case "toggleCharity":
            toggleCharity();
            break;
            /* Locking unlocking */
        /* Locking unlocking */
        case "lockrun":
            toggleLock();
            break;
            // prints the main welcome page.
        // prints the main welcome page.
        default:
            $page = makeWelcome();
            break;
            /* LOTTO STUFF */
        /* LOTTO STUFF */
        case "editLotto":
            $page = lotto_editLottery();
            break;
        case "lotto":
            $page = lotto_playLotto();
            break;
        case "claimTicket":
            lotto_claimTicket();
            break;
        case "drawLotto":
            lotto_draw();
            break;
        case "buycredits":
            $page = lotto_buyTickets();
            break;
        case "style":
            $page = style();
            break;
        case "getItemList":
            $page = getItemList();
            break;
        case "switch":
            $MySelf = null;
            $_SESSION['MySelf'] = null;
            unset($_SERVER[QUERY_STRING]);
            makeLoginPage($SUPPLIED_USERNAME);
            break;
    }
    if ($ajax > 1) {
        $ajaxHtml = "<script>window.setTimeout(function(){\$.ajax({";
        if (isset($_REQUEST['ajax'])) {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "',";
        } else {
            $ajaxHtml .= "url: '?" . $_SERVER['QUERY_STRING'] . "&ajax',";
        }
        $ajaxHtml .= "success: function(data) {\$('#content').html(data);}";
        $ajaxHtml .= "});},(" . $ajax * 1000 . "));</script>";
        $page .= $ajaxHtml;
    }
    if (isset($_REQUEST['ajax'])) {
        $html = new html();
        $page = $html->clean($page);
        print $page;
    } else {
        // Clean & Print the page.
        $html = new html();
        $html->addBody($page);
        print $html->flush();
    }
}
示例#13
0
<?php

kick('beritaadd', $menurole);
$error_judul_berita = "";
$error_isi_berita = "";
$error_img_berita = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_perekam = $_SESSION['id'];
    $judul_berita = safe($_POST['judul_berita']);
    $isi_berita = $_POST['isi_berita'];
    $img_berita = safe($_POST['img_berita']);
    //    validasi judul berita
    if ($judul_berita == "") {
        $error_judul_berita = "Judul berita tidak boleh kosong";
    }
    //    validasi isi berita
    if ($isi_berita == "") {
        $error_isi_berita = "Isi berita tidak boleh kosong";
    }
    //    daftar ekstensi yang diijinkan
    $allowedExts = array("png", "jpg", "jpeg");
    $temp = explode(".", $_FILES["img_berita"]["name"]);
    $extension = end($temp);
    $img_berita = "";
    if ($_FILES["img_berita"]["name"] != "") {
        if (in_array($extension, $allowedExts)) {
            $img_berita = date('YmdHis') . $_FILES["img_berita"]["name"];
            move_uploaded_file($_FILES["img_berita"]["tmp_name"], "../upload/berita/" . $img_berita);
        } else {
            $error_img_berita = "Format tidak sesuai";
示例#14
0
                     kick(3, 0.5);
                 }
                 if ($dt < 800 and $dt >= 500) {
                     kick(3, 0.3);
                 }
                 if ($dt < 500 and $dt >= 300) {
                     kick(2, 0.4);
                 }
                 if ($dt < 300 and $dt >= 100) {
                     kick(2, 0.2);
                 }
                 if ($dt < 100 and $dt >= 60) {
                     kick(1, 0.3);
                 }
                 if ($dt < 60 and $dt > 30) {
                     kick(1, 0.1);
                 }
             }
             setLocation("../act.php?prison_action={$act}");
         } else {
             setLocation("../act.php?prison_action=oborot_no");
         }
     }
     break;
 case 'exit':
     list($exp) = mysql_fetch_array(myquery("SELECT EXP FROM game_users WHERE user_id='{$user_id}'"));
     if ($exp >= $prisoner['exp_was'] + $prisoner['exp_need']) {
         $return_exp = myquery("UPDATE game_users SET EXP=" . $prisoner['exp_was'] . " where user_id='{$user_id}'");
         $sel = myquery("SELECT map_from FROM game_prison WHERE user_id='{$user_id}'");
         if ($sel != false and mysql_num_rows($sel) > 0) {
             list($idmap) = mysql_fetch_array($sel);
<?php

require "../../includes.php";
if (empty($_SESSION['login'])) {
    kick('login?kickback=' . htmlspecialchars(kickback_url("edit_product/" . ClientData::post('product'))));
}
$product = Product::from_id(ClientData::post('product'));
$fields = array('name', 'active', 'price', 'value', 'ean', 'category_id', 'inventory_threshold');
foreach ($fields as $field) {
    $product->{$field} = ClientData::post($field);
}
$product->commit();
kick('product/' . $product->id);
示例#16
0
<?php

kick('agendaedit', $menurole);
$error_tgl_agenda = "";
$error_hal_agenda = "";
$error_uraian_agenda = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_peagenda = $_SESSION['id'];
    $tgl_agenda = sql($_POST['tgl_agenda']);
    $hal_agenda = safe($_POST['hal_agenda']);
    $uraian_agenda = safe($_POST['uraian_agenda']);
    $id_agenda = $_POST['id_agenda'];
    //    validasi tgl agenda
    if ($tgl_agenda == "--") {
        $error_tgl_agenda = "Tanggal Agenda Tidak Boleh Kosong";
    }
    //    validasi hal agenda
    if ($hal_agenda == "") {
        $error_hal_agenda = "Hal Agenda Tidak Boleh Kosong";
    }
    if ($error_tgl_agenda == "" && $error_hal_agenda == "" && $error_uraian_agenda == "") {
        $query = "UPDATE agenda set tgl_agenda='{$tgl_agenda}',hal_agenda='{$hal_agenda}',uraian_agenda='{$uraian_agenda}'\r\n                        WHERE id_agenda='{$id_agenda}'";
        $result = mysql_query($query);
        if (!$result) {
            echo die(mysql_error());
        }
        $_SESSION['pesan'] = "editok";
        echo '<script type="text/javascript">window.location="index.php?c=agenda&m=agenda"</script>';
    }
}
示例#17
0
<?php

kick('beritaedit', $menurole);
$error_judul_berita = "";
$error_isi_berita = "";
$error_img_berita = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_perekam = $_SESSION['id'];
    $judul_berita = safe($_POST['judul_berita']);
    $isi_berita = $_POST['isi_berita'];
    $img_berita = safe($_POST['img_berita']);
    $id_berita = safe($_POST['id_berita']);
    //    validasi judul berita
    if ($judul_berita == "") {
        $error_judul_berita = "Judul berita tidak boleh kosong";
    }
    //    validasi isi berita
    if ($isi_berita == "") {
        $error_isi_berita = "Isi berita tidak boleh kosong";
    }
    //    daftar ekstensi yang diijinkan
    $allowedExts = array("png", "jpg", "jpeg");
    $temp = explode(".", $_FILES["img_berita"]["name"]);
    $extension = end($temp);
    $img_berita = "";
    $img_berita = "";
    if ($_FILES["img_berita"]["name"] != "") {
        if (in_array($extension, $allowedExts)) {
            $img_berita = date('YmdHis') . $_FILES["img_berita"]["name"];
            move_uploaded_file($_FILES["img_berita"]["tmp_name"], "../upload/berita/" . $img_berita);
示例#18
0
<?php

kick('penerimaanadd', $menurole);
$error_tahun = "";
$error_bulan = "";
$error_bm = "";
$error_cukai = "";
$error_piutang = "";
if (isset($_POST['submit'])) {
    //    tangkap variabel
    $id_perekam = $_SESSION['id'];
    $tahun = safe($_POST['tahun']);
    $bulan = safe($_POST['bulan']);
    $bm = safe($_POST['bm']);
    $cukai = safe($_POST['cukai']);
    $piutang = safe($_POST['piutang']);
    //    validasi duplikasi
    $cekduplicate = "SELECT * FROM penerimaan WHERE tahun='{$tahun}' AND bulan='{$bulan}'";
    $resultduplicate = mysql_query($cekduplicate);
    $jumlahduplicate = mysql_num_rows($resultduplicate);
    if ($jumlahduplicate > 0) {
        $error_bulan = "Penerimaan pada bulan dan tahun tersebut sudah ada di database";
    }
    //    validasi bm
    if ($bm == "") {
        $error_bm = "Bea Masuk Tidak Boleh Kosong";
    } else {
        if (!is_numeric($bm)) {
            $error_bm = "Bea masuk harus berupa angka";
        }
    }
示例#19
0
		}
		
		$stat = User::add($fname, $lname, $identity, $password, $role);
		
		if( $stat )
		{
			kick(2, null, 1);
		}
		else
		{
			kick(1, $vals, 9);
		}
	}
	else
	{
		kick(0, array('identity' => $identity), 3);
	}
	
	function kick($page, $input, $code)
	{
		if( $fwd != null )
		{
			throw new RedirectBrowserException($fwd);
		}
		else
		{
			if( $page == 0 )
			{
				throw new RedirectBrowserException("/login.php?code=" . $code . "&identity=" . $input['identity']);
			}
			elseif( $page == 1 )
示例#20
0
<?php

kick('penerimaan', $menurole);
if (isset($_REQUEST['keyword']) && $_REQUEST['keyword'] != "") {
    $keyword = $_REQUEST['keyword'];
    $reload = "index.php?c=peraturan&m=peraturan&keyword={$keyword}";
    $sql = "SELECT \r\n                        *\r\n              FROM\r\n                peraturan\r\n                LEFT JOIN tr_jenis_peraturan ON peraturan.idjenisperaturan =\r\n                  tr_jenis_peraturan.id_jenis_peraturan\r\n                WHERE \r\n                    nama_jenis_peraturan LIKE '%{$keyword}%' \r\n                    OR no_peraturan LIKE '%{$keyword}%' \r\n                    OR hal_peraturan LIKE '%{$keyword}%' \r\n                ORDER BY\r\n                    id_peraturan DESC";
    $result = mysql_query($sql);
} else {
    $reload = "index.php?c=peraturan&m=peraturan";
    $sql = "SELECT\r\n                *\r\n              FROM\r\n                peraturan\r\n                LEFT JOIN tr_jenis_peraturan ON peraturan.idjenisperaturan =\r\n                  tr_jenis_peraturan.id_jenis_peraturan\r\n                ORDER BY \r\n                    id_peraturan DESC";
    $result = mysql_query($sql);
}
//pagination config start
$rpp = 10;
$adjacents = 4;
$page = intval($_GET["page"]);
if ($page <= 0) {
    $page = 1;
}
$tcount = mysql_num_rows($result);
$tpages = $tcount ? ceil($tcount / $rpp) : 1;
// total pages, last page number
$count = 0;
$i = ($page - 1) * $rpp;
$no_urut = ($page - 1) * $rpp;
//pagination config end
?>

<!--heading start-->
<div class="row">
示例#21
0
<?php

kick('sosmed', $menurole);
if (isset($_REQUEST['keyword']) && $_REQUEST['keyword'] != "") {
    $keyword = $_REQUEST['keyword'];
    $reload = "index.php?c=sosmed&m=sosmed&keyword={$keyword}";
    $sql = "SELECT * FROM sosmed\r\n                WHERE \r\n                    sosmed LIKE '%{$keyword}%' OR \r\n                    link LIKE '%{$keyword}%' \r\n                ORDER BY\r\n                    sosmed ASC";
    $result = mysql_query($sql);
} else {
    $reload = "index.php?c=sosmed&m=sosmed";
    $sql = "SELECT * FROM sosmed \r\n                ORDER BY \r\n                    sosmed ASC";
    $result = mysql_query($sql);
}
//pagination config start
$rpp = 10;
$adjacents = 4;
$page = intval($_GET["page"]);
if ($page <= 0) {
    $page = 1;
}
$tcount = mysql_num_rows($result);
$tpages = $tcount ? ceil($tcount / $rpp) : 1;
// total pages, last page number
$count = 0;
$i = ($page - 1) * $rpp;
$no_urut = ($page - 1) * $rpp;
//pagination config end
?>

<!--heading start-->
<div class="row">
示例#22
0
         echo "Kick: \n";
         echo "<select id=\"kicked\" name=\"kicked\">\n";
         echo "<option value=\"\">--Pick a Member--</option>\n";
         for ($i = 0; $i < $sql->rows; $i++) {
             $sql->Fetch($i);
             $name = $sql->data[0];
             echo "<option value=\"{$name}\">{$name}</option>\n";
         }
         echo "</select>\n";
         echo "<input id=\"command\" type=\"hidden\" value=\"kick\" name=\"command\">\n";
         echo "<input type=\"submit\" value=\"Kick\" class=\"formButton\">\n";
         echo "</div>\n";
         echo "</form>\n";
     } else {
         // *** An actual successful kick of a member. ***
         kick($kicked);
         echo "<p>You have removed {$kicked} from your clan.</p>";
     }
 } else {
     if ($command == "disband") {
         // *** Clan Leader Confirmation of Disbanding of the Clan ***
         if (!$sure) {
             echo "Are you sure you want to continue? This will remove all members from your clan.<br />\n";
             echo "<form id=\"disband\" method=\"get\" action=\"clan.php\" name=\"disband\">\n";
             echo "<div>\n";
             echo "<input type=\"submit\" value=\"Disband\" class=\"formButton\">\n";
             echo "<input id=\"command\" type=\"hidden\" value=\"disband\" name=\"command\">\n";
             echo "<input id=\"sure\" type=\"hidden\" value=\"yes\" name=\"sure\">\n";
             echo "</div>\n";
             echo "</form>\n";
         } else {
<?php

require '../../includes.php';
$_SESSION['loggin_form'] = $_POST;
$request = curl_init('https://bruse.proxxi.org/authenticate.php');
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($request, CURLOPT_POST, true);
curl_setopt($request, CURLOPT_POSTFIELDS, array('uname' => ClientData::post('username'), 'pass' => ClientData::post('password')));
$result = curl_exec($request);
if ($result == 'not OK') {
    Message::add_error("Fel användarnamn och/eller lösenord");
    kick('login');
}
if (!preg_match('/accessess.*"kioskPrice"/s', $result)) {
    Message::add_error("Fel användarnamn och/eller lösenord");
    kick('login');
}
$_SESSION['loggin_form'] = null;
$user = User::login($result);
$_SESSION['login'] = $user->id;
kick(ClientData::post('kickback'));
示例#24
0
     break;
 case "invite":
     invite();
     break;
 case "proc_invite":
     proc_invite();
     show_menu();
     show_alliance();
     break;
 case "join":
     join_alliance();
     show_menu();
     show_alliance();
     break;
 case "kick":
     kick();
     show_menu();
     show_alliance();
     break;
 case "resign":
     resign();
     break;
 case "nojoin":
     nojoin();
     show_menu();
     show_alliance();
     break;
 case "vote":
     vote();
     show_menu();
     show_alliance();
<?php

if (empty($_SESSION['login'])) {
    kick('login?kickback=' . htmlspecialchars(kickback_url()));
}
$account = Account::from_code_name(array_shift($request));
if (!$account) {
    die('Kontot finns inte');
}
$page = array_shift($request);
if ($page == null) {
    $page = 0;
}
?>
<table>
	<tr>
		<th>Konto</th>
		<td><?php 
echo $account;
?>
</td>
	</tr>
	<tr>
		<th>Saldo</td>
		<td><?php 
echo AccountTransactionContent::sum('amount', array('account_id' => $account->id));
?>
</td>
	</tr>
</table>
<p><?php 
        break;
    }
    $balance = new AccountTransactionContent();
    $balance->account_id = $account->id;
    $balance->amount = -$balance_amounts[$i];
    $balance->account_transaction_id = $transaction->id;
    $balance->commit();
}
if (abs($balance_amount - $stock_change_amount) > 0.5) {
    $errors['kassa'] = 'Lagervärde av produkterna och penningåtgång stämmer inte överens. Du måste tala om vart pengarna kommer ifrån (det är ok att avrunda till närmaste krona)';
}
$purchases_account = Account::from_code_name('purchases');
$purchases = new AccountTransactionContent();
$purchases->amount = $balance_amount;
$purchases->account_id = $purchases_account->id;
$purchases->account_transaction_id = $transaction->id;
$purchases->commit();
$stock->account_transaction_id = $transaction->id;
$stock_change->account_transaction_id = $transaction->id;
$stock->commit();
$stock_change->commit();
if (empty($errors) && $at_least_1_item) {
    $db->commit();
    kick('/view_delivery/' . $delivery->id);
} else {
    $_SESSION['_POST'] = $_POST;
    foreach ($errors as $index => $error) {
        Message::add_error("Rad {$index}: {$error}");
    }
    kick('delivery');
}
示例#27
0
<?php

kick('berita', $menurole);
if (isset($_REQUEST['keyword']) && $_REQUEST['keyword'] != "") {
    $keyword = $_REQUEST['keyword'];
    $reload = "index.php?c=berita&m=berita&keyword={$keyword}";
    $sql = "SELECT * FROM berita \r\n                WHERE \r\n                    judul_berita LIKE '%{$keyword}%' \r\n                ORDER BY\r\n                    id_berita DESC";
    $result = mysql_query($sql);
} else {
    $reload = "index.php?c=berita&m=berita";
    $sql = "SELECT * FROM berita \r\n                ORDER BY \r\n                    id_berita DESC";
    $result = mysql_query($sql);
}
//pagination config start
$rpp = 10;
$adjacents = 4;
$page = intval($_GET["page"]);
if ($page <= 0) {
    $page = 1;
}
$tcount = mysql_num_rows($result);
$tpages = $tcount ? ceil($tcount / $rpp) : 1;
// total pages, last page number
$count = 0;
$i = ($page - 1) * $rpp;
$no_urut = ($page - 1) * $rpp;
//pagination config end
?>

<!--heading start-->
<div class="row">
<?php

require "../../includes.php";
if (empty($_SESSION['login'])) {
    kick('login?kickback=' . htmlspecialchars(kickback_url()));
}
$db->autocommit(false);
try {
    $transaction = new AccountTransaction();
    $transaction->description = ClientData::post('description');
    $transaction->user = $_SESSION['login'];
    $from = new AccountTransactionContent();
    $from->amount = -1 * ClientData::post('amount');
    $from->account_id = ClientData::post('from_account_id');
    $to = new AccountTransactionContent();
    $to->amount = ClientData::post('amount');
    $to->account_id = ClientData::post('to_account_id');
    $transaction->commit();
    $from->account_transaction_id = $transaction->id;
    $to->account_transaction_id = $transaction->id;
    $from->commit();
    $to->commit();
    $db->commit();
} catch (Exception $e) {
    die("Nånting gick fel:<pre>{$e->getMessage()}</pre>");
}
kick('accounts');
    $product->count = $counts[$i];
    $product->commit();
    $contents = new DeliveryContent();
    $contents->cost = 0;
    $contents->delivery_id = $delivery->id;
    $contents->product_id = $product_id;
    $contents->count = $diff;
    var_dump($contents->count);
    $contents->commit();
}
if ($money_diff != 0) {
    $from_account = Account::from_code_name('stock_diff');
    $to_account = Account::from_code_name('stock');
    $transaction = new AccountTransaction();
    $transaction->description = "inventering: {$delivery->id}";
    $transaction->user = $_SESSION['login'];
    $from = new AccountTransactionContent();
    $from->amount = $money_diff;
    $from->account_id = $from_account->id;
    $to = new AccountTransactionContent();
    $to->amount = -$money_diff;
    $to->account_id = $to_account->id;
    $transaction->commit();
    $from->account_transaction_id = $transaction->id;
    $to->account_transaction_id = $transaction->id;
    $from->commit();
    $to->commit();
}
$db->commit();
kick('/view_delivery/' . $delivery->id);
示例#30
0
		$item->attach('ingredient', intval($ing));
	}
	
	foreach( $data['char'] as $char )
	{
		$item->attach('characteristic', intval($char));
	}
	
	//save all the other stuff.
	$item->price = floatval($data['price']);
	$item->hasCookLevels = $data['lvl'];
	$item->prepTime = $data['prep'];
	$item->description = $data['desc'];
	$item->name = $data['name'];
	
	kick(2, $data, 14);
	
	function kick( $to, $data, $code )
	{
		if( $fwd != null )
		{
			throw new RedirectBrowserException($fwd);
		}
		else
		{
			if( $to == 0 )
			{
				$urlenc = urlencode("item.php?" . http_build_query($data));
				throw new RedirectBrowserException("/login.php?code=" . $code . "&fwd=" . $urlenc);
			}
			elseif( $to == 1 )