|
|
<?php, M! V! y# L- z
function Connect () {
N/ ^& w$ o. m3 Qmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
, `/ G5 \4 w7 j- {! Y
) e5 j( j& b6 D/ hFailed.');
% H8 }& Y0 l$ X" b4 @/ K}0 W4 ?" ~, y2 Y- ~
Connect();
1 @9 ]* U9 S U7 F
. `: S$ E6 h& xfunction InitForm(){
9 i- h1 h" y Y' m//layout for the form
1 X2 B# `! n# P* wecho "<strong>Send Items.</strong>3 _- M4 S8 W6 R2 P3 P* ] V
<form name='select' method='post'>9 D0 w0 F3 n# r5 {) j
<lable>Character Name</lable><br/>
5 U0 U7 i0 ~# B/ F; Z- i6 X+ ~<input type='text' name='char'/><br/>, Q' f6 G3 P. d& i: ^
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
2 n7 ]. N" y# y5 ~! H<input type='text' name='item_name'/><br/>
" T: g* j/ I0 y<lable>Item Amount</lable><br/>
+ `# x$ Q; i$ T9 Q. e" m<input type='text' name='item_amount'/><br/>
7 O6 z4 ~$ ^- e8 j; _<lable>Item Upgrade Amount</lable><br/>
7 c+ V) P; ?( i, V$ G$ ~<input type='text' name='item_upgrade'/><br/>7 ~% b2 b+ j; y
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. h) j( I! `( @9 }# K' t( F$ d, r, q# B+ a. u& S. O) E
</lable><br/>
" r9 x! g t" @5 s r<input type='text' name='item_element'/><br/>$ s* ?" D! `' I% @
<lable>Element Upgrade Amount</lable><br/>
( J7 F$ J0 `* y r+ f, E& A<input type='text' name='element_upgrade'/><br/>
0 D9 g9 I Y9 m: s4 P3 a( M2 U X/ F<lable>Pierced Amount</lable><br/>. _8 m" a6 ?- p+ P9 P0 P* }
<input type='text' name='item_pierce'/><br/>
: [# \6 O1 _: L/ n* m4 l<input type='submit'/>) f) C+ x$ F$ m; I/ B4 N8 d0 u
</form>";! j$ k9 ?7 {) c$ J: f1 L" ^
}
0 g( G- ` e* z% D$ b2 k) U9 C$ i7 r4 d# i8 p. L1 ~0 `0 a, r
function PostListener (){. c) [5 k& H+ G
//Add more post variables if needed and add them to initform() function aswell5 P* |/ Y; a: t* J
+ }: D1 `! U+ q& A1 [' @ @0 j
################################
$ u: L; C- X# [" K8 O, k##### Connection and Post ######
- Z5 s2 I/ F5 Q) {################################
; o* p& ^ s$ G. \, _$name = @$_POST['char'];
. {' s/ b5 h& _+ h8 F$ItemName = @$_POST['item_name'];' X, I6 X j- o! m' W/ z& i" D
$ItemAmount = @$_POST['item_amount'];3 G8 u0 v+ ~) Y5 b
$ItemId = @$_POST['item_id'];; u0 I3 T2 p' |( ~8 t- c B
$ItemUpgrade = @$_POST['item_upgrade'];
6 m5 R* ?! C3 q0 I$ C4 I D- V+ a) C$ItemElement = @$_POST['item_element'];$ }$ f' u- f) T7 J, q! V
$ElementUpgrade = @$_POST['element_upgrade'];9 S3 G2 I1 H5 t+ E( b4 s" P9 j" i
$ItemPierce = @$_POST['item_pierce'];
; k" `3 t: Y# G5 G" ^8 Y O################################# c; ^$ d. U, g( o. R
. n7 }7 O* n$ X' s
//Check both variables for empty value
' i4 @" L/ _) F) k
( Q5 P) C) ~2 R0 M$ I: h/ iif (!empty($_POST['char'])){
& A3 M, r) Q$ D& c& ^" X$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
* V; n6 I4 Z$ C2 U- m! d# q
" g- z" o5 I+ M7 l9 ^0 Om_szName = '{$name}'");
/ _; L7 J# E) ^6 }* C) }" y% H7 |while ($row = mssql_fetch_object($find)){
: ]: K) O/ F+ o+ l: D4 h$ M5 \echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";4 A4 E" t* L, S4 C
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 3 i7 g" F$ S1 T! Z n) K
0 m7 j' D2 n: H
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], . Y' y% N0 K1 b$ L' U. n8 S8 z9 l: _
( b/ ^) C) P* H' ?5 ^, ] m+ [! x' C! f[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 4 ~ I+ Q* ~9 q" d$ @$ ?0 y
! R V( t! ]# s3 B( h) SN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', % L: G& O, V% e h
6 V1 y3 T$ [7 x1 z: N
'{$ElementUpgrade}', '{$ItemPierce}');");
+ l6 [, L2 _7 p. l8 k* k8 q}4 u& B' H! e( y
4 T( l. a, z/ O2 {3 F( p0 d+ J2 A
}6 ^& }& q% L6 D% G; \
. O7 @7 [4 J3 x+ \3 N
}
0 }& J7 o; H; \# k* M) S( W; {- V7 y
5 Q/ \. U7 g( a8 ]! {$InitForm = InitForm();8 B/ G9 V4 |, F
$Listener = PostListener();
P; B/ H. Q, ~( u7 Z2 t3 [5 N5 u0 d% l4 C4 s) y/ r0 j
?>
! A/ m4 b: q) a, b' a# E# I
" t7 S+ z& H l. s& Y ]2 |
5 g! [& S4 |. e3 _$ r5 Z$ g4 U8 @
" z) w! `/ s8 F; _- s5 I: ^
3 B. n% G- P3 r3 _0 b+ e |
|