|
|
<?php; I2 u* J; A. Y- V2 X4 Q1 R; `2 n
function Connect () {
! ~$ G# X6 ~, @mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
5 J+ s' u0 R8 P( E/ t; v+ f0 _% c. p; W& U
Failed.');1 T" |7 A* P( d0 b) O" H" M
}
' E6 s$ ~% K& ~- }: h/ Z5 }Connect();: h. b; J/ C/ a9 u0 B% b& S
: T3 a0 p7 q* l* `: }* V# e0 e3 D) Ifunction InitForm(){
* S6 B5 ^, A. T6 p4 }//layout for the form4 ]5 V' F8 |8 U
echo "<strong>Send Items.</strong>7 Z: a' ^' b5 c9 C; k& m0 h
<form name='select' method='post'>
- k4 R- z; ]3 A' y7 I7 \5 t<lable>Character Name</lable><br/>1 I! S5 G0 B% S' n4 S; n/ h8 e" O
<input type='text' name='char'/><br/>
1 I, l8 j/ b1 _* B* N<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
% x- L- y* u. t<input type='text' name='item_name'/><br/>
% H: Y" `6 {+ O! Y4 P7 W: K<lable>Item Amount</lable><br/>. v' H, i7 V0 C2 P% l/ O% X
<input type='text' name='item_amount'/><br/>8 E; g; X6 E2 T: o2 M; E3 D
<lable>Item Upgrade Amount</lable><br/> Z8 P4 M' e9 R- `/ N
<input type='text' name='item_upgrade'/><br/>* U6 I7 l& {1 t7 Y1 C
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
9 x \8 H$ }8 e d! P4 w9 r& J- @5 r: i2 B( W
</lable><br/>1 T" g. |" X1 l9 k* t
<input type='text' name='item_element'/><br/>
7 l# [: u8 l7 l" z' `<lable>Element Upgrade Amount</lable><br/>
9 @. I; W/ ]4 h+ M' G- b/ Q9 F8 ~+ b0 i<input type='text' name='element_upgrade'/><br/>
0 B }! M1 n0 v: O<lable>Pierced Amount</lable><br/>
' f2 |; q2 V7 ~+ T. T j; V<input type='text' name='item_pierce'/><br/>9 Q9 X" C- q3 q' ?
<input type='submit'/>+ E- n. f5 N: d4 C4 N. U% P% {
</form>";
/ A3 ?+ u, P% q2 F4 p}! H3 p: a+ x+ F: W. x. i
/ J# }# Z) v5 x' \5 }+ x- @1 ?0 ?6 lfunction PostListener (){3 f" n% z# y$ f" q/ F
//Add more post variables if needed and add them to initform() function aswell, D+ ~, B6 d: O- t
0 y6 k; Q. C0 j2 I: ?$ l3 A
################################9 P6 r0 s& d( j2 C7 Z& [/ U$ h
##### Connection and Post ######9 |% w, P! c( u& I
################################4 K5 P$ E' z4 h) @/ }1 d
$name = @$_POST['char'];& W, H$ z! l( R n) a
$ItemName = @$_POST['item_name'];
) q; \) V$ A; d: Y8 e' G9 s6 W$ItemAmount = @$_POST['item_amount'];
& T& g1 ~& C- K- i5 ?# d. }$ItemId = @$_POST['item_id'];
9 t; H# c7 |3 w% Y1 c$ItemUpgrade = @$_POST['item_upgrade'];3 z7 W' a2 k* O B# n/ M. d, b( Z# `
$ItemElement = @$_POST['item_element'];
7 S7 }1 D/ l# P, P0 G$ElementUpgrade = @$_POST['element_upgrade'];- i2 P' H" B, i" k
$ItemPierce = @$_POST['item_pierce'];8 v7 h. M, d3 D. _# i; u
################################
2 d0 Z* [( D+ c6 z! \% j$ [6 c
6 w( K$ O# C% {8 D0 z+ T//Check both variables for empty value
2 t- e, A6 {' K8 l2 }* }' o, _& p- Q$ X$ V: W6 z% P0 R; e r
if (!empty($_POST['char'])){3 f; b, Y" b1 j8 q8 e% A: Z
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 v% n! Y" K( z! K0 _$ Y
( z$ \2 j! p- k [. Pm_szName = '{$name}'");
0 @/ Q" X' x% ^: W/ P5 E) n' {- @while ($row = mssql_fetch_object($find)){
7 J/ x* w" n9 U+ T! @echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";2 ~7 ~8 t- \: ~( h" n& }% Q, Y
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], # {2 H- H4 X" M+ B- R
0 F& v4 _5 B6 Z' @3 z8 X) f
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
) p9 v& c8 `0 k3 T3 x' _3 T7 v2 F" V0 X5 ?! T$ `. H: m
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ; x6 N& Q' {0 w' K2 Y; i) z
! q$ S8 o$ [- D
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 7 z7 z1 `( `( A' N9 R4 b' r+ V
8 n; x. l/ @ @ m! t
'{$ElementUpgrade}', '{$ItemPierce}');");, I8 J) K' h1 X) q4 I: p" J
}
v1 B3 T( M! l
' ~; k _- j! L}
; e* G& ]$ c% I' z7 \6 W
0 M; r1 m2 K; f4 O2 l) q n}9 k# u7 W# _& k/ z
; t0 U6 [2 X, Q2 |1 f
$InitForm = InitForm();
, V0 _$ K2 p7 r, Y$Listener = PostListener();
) f0 W! K& V" K$ H# c
+ a% C) Z/ n% e, M# h- o$ t- |?>' d% W) A8 e" {. T( t
3 Z) W4 e. |; [# N S! u" i0 ^
6 N# @* N6 O: B6 F8 Q2 \1 n0 O( b/ k3 a" e2 T6 O& q
2 W) o2 Z/ Z1 G; k! K
|
|