|
|
<?php
0 W$ A# n8 w* s3 t: Nfunction Connect () {, \( J( y9 y% M4 ^5 z
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 2 ?; ]& d1 z0 s
/ d* }7 K. Z2 n8 R5 \
Failed.');; n: O" S2 L) P- _
}
3 S) t" @. y+ ^3 g) UConnect();9 L8 V/ f; M/ G
6 w0 a9 |! H$ vfunction InitForm(){! H( k) d4 f; J# c' E2 U
//layout for the form& {- i% Z7 s, p$ H t; s0 v* C' g
echo "<strong>Send Items.</strong>! A: O/ t+ H5 r# }" z2 [$ K9 e( m
<form name='select' method='post'>5 [3 a# V3 u/ |
<lable>Character Name</lable><br/>! f f0 e+ }# `4 @2 q& J
<input type='text' name='char'/><br/>
' T; K# n: u2 p( Z. k7 v# C& m<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 M" g4 W: |8 k
<input type='text' name='item_name'/><br/>
* ^9 T7 @, P2 g5 f" c) \& ~<lable>Item Amount</lable><br/>
3 C* F$ K& `) {5 V5 U o<input type='text' name='item_amount'/><br/>$ k( \' R3 H* i$ w) a# u5 i
<lable>Item Upgrade Amount</lable><br/>3 ?5 W1 n" Y/ u6 M6 A' {; G
<input type='text' name='item_upgrade'/><br/>3 V0 j3 O4 n7 w
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.): V% z5 {5 {2 P
& D7 f4 a" H4 ? L7 b</lable><br/>6 W ?) T% |& V9 [' M' N( s
<input type='text' name='item_element'/><br/>
! U5 L% L6 T. Y+ v$ D2 z0 `# `<lable>Element Upgrade Amount</lable><br/>
2 `1 `' e6 ~) G- O<input type='text' name='element_upgrade'/><br/>
5 e& C9 i% Z2 j: J' j+ M<lable>Pierced Amount</lable><br/>
1 j! N; B7 @7 ?9 W6 e' N<input type='text' name='item_pierce'/><br/>
# |" ~8 }$ z+ j" s<input type='submit'/>0 V: d, e$ m# f8 d9 g
</form>";* n) N; W' g9 j0 b# D* Q3 M
}- c9 M/ o) K$ D, H8 U; |
1 l$ x- E: R, O9 P# ]8 j8 y
function PostListener (){3 L9 \* p7 U z5 y5 B* y" @
//Add more post variables if needed and add them to initform() function aswell& W, G, C: I) P( v1 P
+ ], E a# G/ i& k) |5 h7 {% d
################################
" X) ?7 H) g% |4 N2 q##### Connection and Post ######
) F$ W9 i# x6 W% k" t3 W################################. M# v9 U+ p2 X1 L0 |. R
$name = @$_POST['char'];7 J( a$ d S: x% \0 \. s
$ItemName = @$_POST['item_name'];& F. _& z3 I4 h5 ~% y
$ItemAmount = @$_POST['item_amount'];
2 b! |( I* R- K; T* T% ~) h6 Y$ItemId = @$_POST['item_id'];
|3 V& s5 s6 B$ItemUpgrade = @$_POST['item_upgrade'];
" s$ u9 w! e0 E1 S$ItemElement = @$_POST['item_element'];
J) ^& k' i9 |, M* Q3 `" P$ElementUpgrade = @$_POST['element_upgrade'];
3 ?/ R2 ~0 R8 X1 Z5 Q$ItemPierce = @$_POST['item_pierce'];
3 M! ~* ^: v2 S$ Z7 E, p################################
# s. F/ J6 K( {: D) D# y0 s2 H6 l+ |1 h* B
//Check both variables for empty value2 e- G5 v& i$ Z# D; `. S( E0 }
9 M2 b' X2 H; }% r* F- d/ N% a& Nif (!empty($_POST['char'])){* G6 \2 @: A, a/ T k# I! X
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ( c' ~3 j7 h) f8 l- Z4 ~% \
5 K- m8 r0 a) m$ Hm_szName = '{$name}'");8 Z1 G+ _9 S. b9 w. s" j: V8 S* w
while ($row = mssql_fetch_object($find)){" V& r# d6 a& L& F6 L/ W
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";3 w8 l' t' X7 Q8 p
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
' a% p) i4 @: q. X/ w: F2 D; S3 l) T4 D( Z) M4 X
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], : m) j% ?0 t: f( I0 P7 }* b# i
q, X# @( H3 [5 ^7 _
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 9 S2 ?8 y. s2 R
1 F4 k4 J' k- W* L& ?0 U
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
. V& o: V; B0 r! f
* a6 T+ l; \ { i/ K. A0 w'{$ElementUpgrade}', '{$ItemPierce}');");9 j$ n. V$ L# D' G$ O! g
}* y# C. }; D1 E/ i
! E5 d( S# R# D}
( M7 N( p. C/ j) Q% ?* G8 u4 `9 \% {- U; W: [3 T. j: O
}
; |9 \ W( @/ R/ f* n( Q/ S
4 w$ ]: x [8 p9 f- c0 c$InitForm = InitForm();
! g% A/ ^$ t0 M- U9 L# R2 o% h9 k$Listener = PostListener();5 y2 `7 B; O% Q" p
4 h. Y. |. |7 c3 g' X
?>
. o/ X* L/ s+ t* j: B9 n) ?
/ @9 L8 ^; d0 A" [0 Z/ M" m/ {
# K* \9 l% Z8 x6 p3 ~8 @9 |
* n( w) `1 U& U* v; `6 M, Z) n/ o+ K5 |: Z% c* ~( M( V
|
|