本文整理匯總了PHP中kick函數的典型用法代碼示例。如果您正苦於以下問題:PHP kick函數的具體用法?PHP kick怎麽用?PHP kick使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了kick函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: kick
<?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: kick
<?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: kick
<?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: intval
{
$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: kick
<?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>';
示例6: abs
$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: kick
<?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>';
示例8: AccountTransactionContent
$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: kick
<?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">
示例10: kick
<?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: kick
<?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: process_get
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();
//.........這裏部分代碼省略.........
示例13: kick
<?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: kick
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);
示例15: kick
<?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);