|
|
<?php Q7 W0 i& t; u: R
function Connect () {
5 J6 G4 e7 N u s; ?4 Y$ W' Qmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
" ^5 W& b( |5 l$ y
$ f3 I3 i" s1 c% ]7 L# m. uFailed.');
6 s7 w. r) y& Z1 W}' ]" e% i: T' H' [8 m/ r2 J
Connect();
/ A- [; @8 c! j4 B/ O
& c1 @5 q! x6 efunction InitForm(){
8 F7 s3 i" O7 T//layout for the form3 i, K6 z5 v# I# Y
echo "<strong>Send Items.</strong>8 i3 w2 G/ S+ c. ]- T( {% a: O h
<form name='select' method='post'>- }" B6 l3 {* t9 G: n
<lable>Character Name</lable><br/>4 L6 Y) x2 y. ^
<input type='text' name='char'/><br/>
9 w1 t9 y! D/ v5 P8 ~7 U& i% V) C<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
0 g" Z4 M1 d- i9 l' z4 u. w<input type='text' name='item_name'/><br/>( n" i d* g; L; v
<lable>Item Amount</lable><br/>2 c. j9 A* C# T
<input type='text' name='item_amount'/><br/>
9 y; V" L0 d5 Y9 O/ E4 X) A<lable>Item Upgrade Amount</lable><br/> }8 Y# C- Q% d" ^
<input type='text' name='item_upgrade'/><br/>3 Q5 T% k' R- T b# w/ ?5 C" b9 X. d
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
) x' F) b. c3 T
+ y1 C- F' p; X* e; j</lable><br/>( C5 _& I( I" ]* A+ }' `
<input type='text' name='item_element'/><br/>
8 f: Z: J. O( M1 L<lable>Element Upgrade Amount</lable><br/>
7 I- t: d7 |) e# r<input type='text' name='element_upgrade'/><br/>
5 P" S) t) @+ i6 D- U<lable>Pierced Amount</lable><br/>
$ \* L7 w0 A, {# N8 A4 B<input type='text' name='item_pierce'/><br/>' @4 b5 ^6 u! J
<input type='submit'/>
! \5 [5 {- N: c# x' m</form>";
& P% D+ M: S8 ^* k( g}" V0 \" }. I2 t$ c' z% u, r
$ B9 @' x4 n# I2 `) M" n; lfunction PostListener (){
u3 V2 e. |8 x! @* w. W/ [//Add more post variables if needed and add them to initform() function aswell
# Y+ L4 K+ \8 ]) Q Z0 E4 ` `% S' K
1 `* d5 P+ P' `& {" d" _################################
% _* H6 d1 c7 z/ x##### Connection and Post ######% w6 w7 ?% y& h1 p k
################################+ ]' N# ^+ L; N7 t1 {4 m! x8 `
$name = @$_POST['char'];: ~1 f3 Y. Y5 p/ Z! S! C
$ItemName = @$_POST['item_name'];+ U# I) B1 e( b: Q+ i" c6 M' N
$ItemAmount = @$_POST['item_amount'];
3 g% W) N9 C$ H4 S/ G$ItemId = @$_POST['item_id'];& ~% P( n1 k. W y/ A( I- V
$ItemUpgrade = @$_POST['item_upgrade'];9 r$ N; _/ q9 Y% r; \
$ItemElement = @$_POST['item_element'];
3 J A, x1 T2 |$ElementUpgrade = @$_POST['element_upgrade'];
; D; m" @' c+ E j+ F6 p9 }( y$ItemPierce = @$_POST['item_pierce'];
* _" [! X- _7 Q* \, v################################# q$ l. _6 P. m) G0 q$ `2 k
0 N% w8 E6 O$ W$ D" l" P1 Z
//Check both variables for empty value4 ~ v' v8 |2 c
# t- D; s8 D9 f7 ~/ a
if (!empty($_POST['char'])){
S! J- l+ G9 N( `9 J3 ~$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ! j# r3 V# f5 u; B- k) ]
. R3 o0 L; n. t# l7 t, X' [' \
m_szName = '{$name}'");2 G. c, U* k3 f* u
while ($row = mssql_fetch_object($find)){
7 n2 @' |5 Y) s* A/ vecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
0 x" v) d+ B0 x3 i d$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
% `6 P. f8 v2 z% i0 _8 s3 T q9 e; }) p& N* p
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
/ t$ j; ^2 x8 f3 }6 ~5 R3 s z3 x! [* Y: |9 t9 A/ ?4 d$ n
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ' ?/ z4 S) z1 b/ J
- d) {7 L' Q! @6 d. X& A
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
7 C6 ~1 K, B! T' N6 M4 ^' T' v+ h" I
'{$ElementUpgrade}', '{$ItemPierce}');");. f4 @2 }# ?5 o! t9 j
}
8 Y( G% C" r+ E! X! a8 a" H& c' g6 X m0 F) c
}: Q, o5 ?7 a' ~- {# Z# U3 s
" W+ {: ^# k p6 t% U7 g}0 p" s6 d1 Q0 g. a B/ L
% \: d. f2 n* i8 ^: |
$InitForm = InitForm();6 J- U7 c7 ~) Y9 t8 B6 U% n) x. h
$Listener = PostListener();
+ T# l% K9 C' r1 N, R" L
9 c6 z* [6 w: ??>
; u8 T# J4 O: e! K3 E+ e& Q" e. w6 {' E1 `9 W% c
+ A+ N V. S! U, {+ d) L
1 M1 c* y! H# l$ ^4 Y3 {
# z N" K& b2 X/ n6 L- y, L5 v- h |
|