|
|
<?php4 K6 a) w8 d( g, S! A! D% Q4 G" D
function Connect () {
, v t8 F5 k7 w: a( G1 imssql_connect('Server','UserName','Password') or die('Error: Connection to DB
9 g. \" C m# s
9 V. s/ L* ^4 c% mFailed.');! t/ |, M* X5 k
}
* q7 ^# ^' K9 M- R" W5 \" N. aConnect();
" D4 q2 h+ x, M1 H. P9 L9 r' y0 M& `
" g$ h+ g9 d* g2 i% Afunction InitForm(){$ V% Z$ x6 u- Y. J. ^
//layout for the form
5 o1 [% o& F7 k5 N( k" ?echo "<strong>Send Items.</strong>* k: y- ^& U3 v
<form name='select' method='post'> w% S0 }# _ l, _& e0 E
<lable>Character Name</lable><br/>
# F$ T* n) x# B+ n- S' G6 a% P9 T# q<input type='text' name='char'/><br/>& i2 q* E( |: Z; p) J$ E! } z
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
3 K; J: [1 Z# S) \$ x8 U. V/ Q<input type='text' name='item_name'/><br/>
2 n6 J8 u$ q9 @5 d0 h<lable>Item Amount</lable><br/>6 B4 ?* b; G c% Y4 n( e; y: ~/ s4 M ]
<input type='text' name='item_amount'/><br/>
- M) B9 n# K, ]<lable>Item Upgrade Amount</lable><br/>' Q4 h" C/ A6 T6 l: n6 ^" R2 N# R
<input type='text' name='item_upgrade'/><br/>
7 Y* t2 P4 M0 V y+ r% D8 J8 L, d/ r<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. a$ \! t" D" c. O- ^6 d" S" t$ D$ z3 B G4 F L
</lable><br/>. L( B4 d; s9 T$ j5 L/ o
<input type='text' name='item_element'/><br/>4 Q- g) p! h f( N. |/ U9 F" p
<lable>Element Upgrade Amount</lable><br/>
( z* m/ Q2 x; p& [: R5 c9 W<input type='text' name='element_upgrade'/><br/>
& Y9 g- v' O6 M$ P0 u) I<lable>Pierced Amount</lable><br/>. S* J- _$ \; N h+ w1 v" ^$ A6 q
<input type='text' name='item_pierce'/><br/>
5 H0 ~1 R- G) C# N<input type='submit'/>
& v8 T" } t$ ~! t$ x% S; U3 U</form>";5 \- B. v* b) O: J1 D4 ^: c
}
- o0 ~, ~* E* C, b2 X! _# r2 X7 O0 B
. P# p1 O$ Y" q! \9 d: o, S8 ^function PostListener (){) U4 P7 m2 Y# J
//Add more post variables if needed and add them to initform() function aswell
7 |6 S5 r8 D" k' K& A6 }* A, X1 {) ~) M* o' ?1 i2 P
################################3 a! c" p' ~! F; f4 K5 y8 f4 ~
##### Connection and Post ######
4 I D3 `% J" ^. R; K* d A/ Z. j################################
& T- J9 c" Y- J4 E$name = @$_POST['char'];* B% @3 R4 W% Q9 _; g a# p
$ItemName = @$_POST['item_name'];3 D) z( b8 j7 T! F, Z% k6 K
$ItemAmount = @$_POST['item_amount'];: D3 T9 x1 S' e9 e/ X( T: E& N
$ItemId = @$_POST['item_id'];
, L# P3 z* h4 _# a& A' D$ItemUpgrade = @$_POST['item_upgrade'];' y( j" b# u7 ~1 d
$ItemElement = @$_POST['item_element'];4 W) U2 R3 k% U" Z/ i
$ElementUpgrade = @$_POST['element_upgrade'];
. i. Z3 `( d0 {* n4 v$ItemPierce = @$_POST['item_pierce'];
' k( d$ m& M: B$ k# \0 T: T################################# u! I4 o3 R/ c' m4 v, p
( t; K. u' }' o. j
//Check both variables for empty value) W0 a. t p5 J
3 @- z) X, f- h+ D
if (!empty($_POST['char'])){
0 G1 s' e( _8 w+ ^% B5 e$ s( y$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
}( o# F" h9 `+ ]2 i, l# E+ x8 h8 q: X6 N% k' Z
m_szName = '{$name}'");. a) _8 i. z4 @6 C$ c7 \+ T' T
while ($row = mssql_fetch_object($find)){
# E, t$ r& }, \- R/ F% P* c1 Pecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";0 H$ s8 ] H8 _; b
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ; Y. J6 T- Z9 G+ A9 M8 G& |& U
. ^- _* T% `1 z+ Z; z4 U) @[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
5 b! \! O0 W g) p
* O8 r$ i' r7 ] L" j[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
/ g; ^( E7 ^: T H6 {5 V6 l
, e: I9 H% E/ ]1 f% H% K7 rN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
! Y/ J; T( x- p% [- m
0 x- z9 I3 L: ?4 Z' e0 }'{$ElementUpgrade}', '{$ItemPierce}');");
[/ q1 T9 c' K: B+ J}
$ S$ [+ H! @( P) N* H
4 p% }3 t+ z; F5 ]7 L}
1 P- h: x b' J" c; H0 f+ u& r0 r0 }% o" O: V
}
# S! @% B! |: C% z- s2 T8 A8 j% ~+ Q
$InitForm = InitForm();$ m8 O& M& G6 p
$Listener = PostListener();
7 d$ U8 F2 b* d+ ^" D+ n5 p9 u; t5 w% O
?>
: C0 `% E' V6 m, V1 l. j
" f" t8 }: L t0 d9 K7 _% ~' x3 t! u9 v! a, k4 F' K% T
5 z$ g# v9 q3 q7 R! _0 y. n, U, c
3 Q. F9 n0 P! E0 s |
|