|
<?php
. _7 V1 }5 v# T* X1 K+ I; `0 ^" vfunction Connect () {8 l; T& b2 N v! J% _' k5 _
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# p& C* _0 D1 Y0 [+ o) ^! N( `1 G
, q& y8 E/ H& A5 [6 o+ |8 yFailed.');
; y, T% v- }( E+ k. s' |}
V/ V4 j w y% f rConnect();
; M9 X6 y& a6 ^7 n8 Y/ [- H+ ~+ A, A' q5 n- e2 c0 S3 V' ]
function InitForm(){
7 r3 v5 y' A- y' X$ B W//layout for the form
9 }% |1 N% s9 y& H2 H) V1 Qecho "<strong>Send Items.</strong>
1 t2 w; `# @$ s, _<form name='select' method='post'>
) s G# U5 D" F% S" P<lable>Character Name</lable><br/>
7 L/ p7 s( n* w' i<input type='text' name='char'/><br/>( `% p6 P: }; G N2 e
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 l9 i2 }$ ~2 v& O1 ~<input type='text' name='item_name'/><br/># V7 z) v4 b: w' }$ l- j1 a9 h9 S( @
<lable>Item Amount</lable><br/>' o" n0 l' O$ X- W: s2 x
<input type='text' name='item_amount'/><br/>, C. O' N9 P, I( i% r
<lable>Item Upgrade Amount</lable><br/>
5 l9 r4 [( F, j: a' W9 v% j<input type='text' name='item_upgrade'/><br/>- a; h4 {5 ]+ Y q
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)7 U p2 r. |: W/ }
# W" y; o4 ^2 h! ^( d" T
</lable><br/>
# C# P2 P7 E" d7 L<input type='text' name='item_element'/><br/>
, U: Q o% Q& p<lable>Element Upgrade Amount</lable><br/>7 A9 K F, m. i; }3 H
<input type='text' name='element_upgrade'/><br/>; Y$ }6 `* d( g9 \! z
<lable>Pierced Amount</lable><br/>
5 W6 \3 d, c/ s r6 K$ F6 o4 o<input type='text' name='item_pierce'/><br/> q; [( y; w8 ?1 Z" f
<input type='submit'/>
& d; d3 \" E" K8 d. w" r</form>";0 G( R" _6 H2 [$ g
}" O$ c: g; S! g" [
5 q6 W7 B: A- n4 |# O1 a
function PostListener (){4 m0 k4 N: s& A" k& ?
//Add more post variables if needed and add them to initform() function aswell B) r# A2 f8 B/ v+ P, J
5 @2 v- v7 `# X. J################################7 I2 s: b, @$ n% R/ L) r
##### Connection and Post ######
1 Y7 I+ ?- D% }$ K2 Y- K/ i################################# D6 u. O" B% z8 T, H
$name = @$_POST['char'];
7 L: E4 K, ]- {+ @8 t$ItemName = @$_POST['item_name'];$ k+ j& @4 ?( I. X
$ItemAmount = @$_POST['item_amount'];
4 Q: ^8 l" C: O$ItemId = @$_POST['item_id'];
4 i6 S9 p1 h5 c9 J$ItemUpgrade = @$_POST['item_upgrade'];% y) o) O, F/ e) e5 P3 ]
$ItemElement = @$_POST['item_element'];
$ T; i$ S# l6 B: j! L8 C2 X/ J8 H* w$ElementUpgrade = @$_POST['element_upgrade']; N& W" l7 l: j9 U" X% n
$ItemPierce = @$_POST['item_pierce'];4 G4 b. \. r: n( N* f
################################
9 S4 j; u; n: L' C3 J- s8 i) E# l) M% ?) q C2 I
//Check both variables for empty value! d6 v7 {+ z3 w7 Z) f
) i/ q/ F0 k3 S2 p) A# K' M, e& m. u
if (!empty($_POST['char'])){
, s. e6 j+ O7 O! U. }$ q$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
# L! V) S) m1 s4 e- h3 Q/ s: d# S. K8 ^* q( V
m_szName = '{$name}'");7 ^4 ~# ?+ M6 J" l1 @3 m8 l
while ($row = mssql_fetch_object($find)){
( Z J' H2 i% w: l/ S Lecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
0 i8 B: S. \# L$ ]# V& q% B$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
6 x+ \; R" ]" P, V: p8 m$ u5 b% H3 O2 _1 z* o; p3 K
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
. O$ `% B& h( D7 u, d: z+ v% d
/ B5 z! M+ r- M+ D2 x/ G: z[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 9 f1 o d9 \9 j" C4 T
- r) `* ~7 @) Q! a4 QN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
& v, D7 l: o( d, g K2 |5 E, v4 A9 v% c9 h. }: y; ^+ D
'{$ElementUpgrade}', '{$ItemPierce}');");# t; t: y9 o# }1 m" `# {4 q
}
4 E9 F: N( J5 Q
6 M! F1 ~& f) x$ Z}3 g' Q+ K1 Q, E
* Q" k& p3 f9 ^}' a8 @5 @. [, A& ?5 e# P7 m' F
/ u% Q' P9 q8 I7 K# m
$InitForm = InitForm();4 c1 V& }3 `" z+ g% Z5 V
$Listener = PostListener();
d1 `. e3 J4 V0 `/ S: t% {, W6 @/ D. D' _) W, i |# N& {2 r
?>5 c* a' Y- @& E
' t3 e6 w6 e/ g# @- ?- D" s! ^ l! s" G: |8 X3 M4 n' }
9 ^! m( [6 F% q
/ j, A; q* I) P! i4 I j |
|