|
|
<?php/ ]' s; D8 G1 {. w
function Connect () {
) Y# V, k4 Z# B* M/ \0 Fmssql_connect('Server','UserName','Password') or die('Error: Connection to DB * y0 w" a8 K: o$ I' ^
% G j) j3 M+ u" J
Failed.');
% r' T7 S) w7 v4 V4 T}
4 s2 w( }* `: r0 o% vConnect();
# r- |+ Z0 e6 F) I7 o: Z& r! `+ d' t0 D; _
function InitForm(){+ X5 s5 U, b& f: a! I. F
//layout for the form
8 T7 C6 u0 d! W' g5 O1 E. e3 V Vecho "<strong>Send Items.</strong>5 B, L$ d# U/ y; K. z
<form name='select' method='post'>6 B; Y+ p M1 Z2 X6 `
<lable>Character Name</lable><br/>
- c- d. \' m# |) p1 e<input type='text' name='char'/><br/>0 u& ~- N. W8 F0 s
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
0 w' ~" ?% ~( _! \# A' j% ^0 R4 k' m<input type='text' name='item_name'/><br/>4 r: h: S9 d+ R V
<lable>Item Amount</lable><br/>
; r5 W3 L1 i; j' }<input type='text' name='item_amount'/><br/>
" M: y. a: L1 c- Q<lable>Item Upgrade Amount</lable><br/>: X9 @: {# R; }1 `
<input type='text' name='item_upgrade'/><br/>
0 \' f7 I1 b. i7 U j/ z<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
6 y. N; y0 \+ `# `
% ~* Z- y2 f+ Y5 ]6 u</lable><br/>
0 E& A$ w- }8 z% B7 f# `; ~' V<input type='text' name='item_element'/><br/>1 {. j: f8 W% {7 y; T1 q+ O
<lable>Element Upgrade Amount</lable><br/>* x7 g }8 V/ ^
<input type='text' name='element_upgrade'/><br/>
+ ]' y4 s& G+ L# g9 \ `- D1 C( q<lable>Pierced Amount</lable><br/>& [- n- f5 D/ W7 m8 A
<input type='text' name='item_pierce'/><br/>6 f8 Y4 ?( T' g4 H8 t
<input type='submit'/>" ?9 B0 m; z- p$ [( v" B) x
</form>";. l2 v* X$ A- S) b& U2 k, c$ p
}
* T A& W" e9 }
* G$ I6 Q z7 N( Hfunction PostListener (){8 z0 ]& S7 G. p& ^2 A1 ?5 }
//Add more post variables if needed and add them to initform() function aswell+ j# K8 E2 `3 W7 v
$ J# R x. C8 r3 P################################* f/ G, s8 t/ t% R% _
##### Connection and Post ######
$ p# }& O+ g# W; K+ r! {. q################################
# `% G/ [9 u+ z! C+ S9 t$name = @$_POST['char'];
* J, ?- X( F! H: v) r5 ]+ J$ItemName = @$_POST['item_name'];
- k6 `- O1 g- o3 R. z$ItemAmount = @$_POST['item_amount'];* W1 G, j1 ]+ _, }! m0 Z, O) ]0 Y
$ItemId = @$_POST['item_id'];
* u T3 K# \9 c- E# @& w8 I2 B$ItemUpgrade = @$_POST['item_upgrade'];* i8 O9 t3 B4 s
$ItemElement = @$_POST['item_element'];
8 O+ E) p( X1 N; a4 ^1 b, O& _. p$ElementUpgrade = @$_POST['element_upgrade'];( @3 w; m3 I' e) O6 I/ u8 H
$ItemPierce = @$_POST['item_pierce'];
" N& W. ~/ r: q- G& I P1 B################################
8 ?* B6 S2 t/ P9 C
( N: v' }) ]3 T6 u" o//Check both variables for empty value
5 p+ v; l- c, I: [, x; v* m0 b+ [5 e1 i8 t8 G' M( T9 k* z
if (!empty($_POST['char'])){
5 @7 J" s' W6 i2 u) [; `$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 o( J; h6 p/ n8 C j/ N; m7 _# ?8 \, b4 c1 |
m_szName = '{$name}'");
3 U4 C& R9 [/ h# C' r( Z) Zwhile ($row = mssql_fetch_object($find)){/ `$ b4 z# j- R& U% I1 K
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 |0 j5 H {: k1 r
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], & L; h/ K, D4 V& J
2 {2 c" `- y% V: Q# c5 V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
3 Z- u& f% C% J& ~/ D0 r1 C( |; b" }9 A' ~( z3 Y" f
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
( O( H# b* O/ h9 ~
% _) u. c* E; y4 s6 [6 n5 uN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 6 t6 ?$ ?4 I5 `/ G& D& u6 b
* B: z' a1 o/ C; m'{$ElementUpgrade}', '{$ItemPierce}');");1 O+ K! n( x. H2 j ~1 N0 c
}3 {# w# X; q& C& F& G* l) B
- T0 a0 e+ v+ _' U4 c/ x
}% L% S# Q& S+ B1 Y/ H. F& M
& |$ c. Z [8 k4 U' c+ s1 ^}
+ A: y5 e- I+ j0 T8 c0 [
& j" O# l/ M2 H! Q1 i( u$InitForm = InitForm();
7 a3 D) V7 B" \# R% z& y$Listener = PostListener();. c0 n% Z+ t, `( F# M% p
/ G! b* ^: Z" `) U* e1 b?>2 l0 Q" p+ Q& i( O% G
0 K' @4 u0 y3 P+ @
% k" q8 o4 B0 \$ F; K
- Y. d6 b7 z$ z, a- R2 I% @! Q8 Z' ~6 E& k# a* I$ Q
|
|