|
|
<?php& Z, e2 T! U" {& y
function Connect () {! ^8 B- x2 R- P4 D" S( J/ O# H
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
( l2 j W; `1 V' \- V v
. n; U* l6 F/ y; ]% S5 W$ yFailed.');
, ?$ Z. d) H& ?- T}. N; B1 z! E M2 B
Connect();: M+ X' p* u' n0 a% n6 f4 S$ r
; R0 p f. e A# X' @5 Wfunction InitForm(){$ v+ d3 |( I& {$ W2 v4 l
//layout for the form; M& Y9 C4 ]2 ~0 X' G
echo "<strong>Send Items.</strong>, x7 b' |4 b! K5 ^2 ~# k
<form name='select' method='post'>/ Q) k$ f: E+ W: U' b
<lable>Character Name</lable><br/>3 v7 w4 K( U7 M
<input type='text' name='char'/><br/>% S ~; {" `3 b, _' |
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>2 x! v& f& d* s* N4 D9 l. |1 \! z
<input type='text' name='item_name'/><br/>
; ?- l, i( g/ U: D0 ^<lable>Item Amount</lable><br/>
. Z K R. l: M# K1 M3 g& v: j<input type='text' name='item_amount'/><br/>4 O+ r+ m8 k* Y1 I) o- K( G
<lable>Item Upgrade Amount</lable><br/>& o! W: b a9 G$ E5 X5 @
<input type='text' name='item_upgrade'/><br/>
- F3 v# ^: w/ \0 H! m; m1 y<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 Y; w8 H9 |! D
* E8 a# x: \2 Q4 |# f
</lable><br/>
2 U$ B V% O+ Z4 K7 ~4 N3 ` F<input type='text' name='item_element'/><br/>% {, Y4 P8 \/ e( |: }* v* Y
<lable>Element Upgrade Amount</lable><br/>( Q$ ? D" P: |
<input type='text' name='element_upgrade'/><br/>
- ?3 }% i1 l9 E6 ]<lable>Pierced Amount</lable><br/>- _2 C4 u- X/ [, @: [: u3 m
<input type='text' name='item_pierce'/><br/>
+ d% N9 Z0 h+ ?1 p7 H ^<input type='submit'/>
" O, I3 N& h* p% t- p</form>";
9 W& w% Y7 f7 P& M8 T+ U7 Y7 U}
' I0 L4 N8 n. o3 ?! R: n6 ~6 {3 z4 P" q/ j6 Y" S3 F
function PostListener (){5 o$ o. b/ H" |0 J5 ? [; e9 v4 }
//Add more post variables if needed and add them to initform() function aswell6 W& t) P2 I* m
2 y# Q9 ] V F5 C8 h( {################################
+ w1 G3 f: G, @7 E9 ]! f6 ]##### Connection and Post ######) |4 c: u7 s& p8 v! d6 W o, k9 {: Y$ S
################################2 B2 Q1 _; {5 S- _
$name = @$_POST['char'];
D% B2 {: V. p$ItemName = @$_POST['item_name'];4 p' k* c0 o7 g1 e; B1 C
$ItemAmount = @$_POST['item_amount'];& B$ E2 e( j& V. w: ]/ \
$ItemId = @$_POST['item_id'];6 i; u& E! ~. A4 d
$ItemUpgrade = @$_POST['item_upgrade'];7 n" \5 }) K) I L- A0 j
$ItemElement = @$_POST['item_element'];
) }& ^( R8 S0 s7 c& q, q3 e$ElementUpgrade = @$_POST['element_upgrade'];
; L0 s" o4 `( k9 Y/ Y/ s" {- q$ItemPierce = @$_POST['item_pierce'];
# L6 t* j6 _) V################################
2 o& U1 T7 F/ |% b# O5 r
7 r+ f7 m4 N; R+ H0 U( R; B4 n//Check both variables for empty value* {# U9 C- r X, }! w; _9 L
* W' l3 ]9 N8 t, H/ g5 R
if (!empty($_POST['char'])){
5 R; M" z+ {# P. ^1 Y# n! h$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 U% J5 ^% P6 r5 A5 `# | F, ~" q" S9 ]+ V/ \: U
m_szName = '{$name}'");0 L, i2 A- z1 d% l
while ($row = mssql_fetch_object($find)){
% ^, u- x6 D" I E' F4 l) decho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";# N: | ?7 K1 V
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
( `/ V+ J/ J8 r4 r4 |0 _/ S
0 w5 Z& t- ?8 n3 D+ H+ D5 ?- K[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
: i. d$ ^/ R& u6 A& i" o/ k: R9 X F3 s! z( G' X
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : ]9 @- G* D2 A. Z% V- r5 _. z# c
2 P& s7 L$ n) `) O' A$ DN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' i3 S5 O B. C* V, Q& c9 g2 [
2 m% P# y: J' [; n# `& M9 v
'{$ElementUpgrade}', '{$ItemPierce}');");5 v- U; _2 w V8 p
}9 F$ h" L' E. `! B9 i, p- D: S2 W+ s
+ I8 L+ o7 K2 Z: c% b6 P6 P}, z* O2 k* A) X ^3 Q; Y
/ {$ ]3 y8 J+ t! V- _
}9 k; J+ T4 w4 k. J5 [7 g- \: Q
; |* y/ V* E7 l: }& Y
$InitForm = InitForm();
0 K, N- I- ~ o0 s! l$ e4 ^$Listener = PostListener();4 J' m& o0 X3 D3 P, @) j
# `# U/ R4 t) X8 X- j
?>
! F, B0 C7 [" @' W$ [7 C: n- q% R
% ?7 ?: o+ b, m
% Y! ?' g; v- ^8 b1 ~. e! O/ M; ?7 z
" F0 s( S' N- W; j |
|