|
<?php& ~+ z$ ~5 U: N; ]
function Connect () {
T. ]8 w, Q! `% omssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# y, o0 k; v2 W$ S q2 I5 H; y( x7 F
$ k: K8 A% [+ I) q DFailed.');$ j' a# C3 s4 f" B" E# r" y
}
' H* A; [- O; ^1 C9 VConnect();5 z% T& ?* {& @" y8 s
; s( L8 L/ |5 r1 |: _& F. C
function InitForm(){$ k4 }# n! i0 u; \) H! y' a0 o
//layout for the form
4 C( W4 M' S% v2 p# M ]echo "<strong>Send Items.</strong>2 v! `1 E- H4 e6 J- i6 a1 J
<form name='select' method='post'>
# O9 U$ p: j: b" H/ Y( i. z, b7 f5 ]<lable>Character Name</lable><br/> k3 m3 N& H" S+ R' S
<input type='text' name='char'/><br/>
6 ]2 v }- o) q5 `' \<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>2 r# e0 \3 H' F3 S
<input type='text' name='item_name'/><br/>3 ]9 Z8 {& n: a/ \
<lable>Item Amount</lable><br/>- Q3 @& C3 c6 ~1 K! J
<input type='text' name='item_amount'/><br/>4 R* s# R: j+ Z& Z; `) }) ]
<lable>Item Upgrade Amount</lable><br/>
1 Y$ ~% P ]% O# O3 Z+ l<input type='text' name='item_upgrade'/><br/>. f9 N3 P7 e) I5 K0 b7 ]/ {9 P! G
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)) M5 f! P: H2 l; I& Z
4 Z3 y& X" e8 ^8 D5 B. n2 Z$ B
</lable><br/>
; t" p# O2 z$ @# ?, m9 M& ^6 q1 x<input type='text' name='item_element'/><br/>
2 E f) T3 [9 o9 k8 b2 d A<lable>Element Upgrade Amount</lable><br/>% ~( ~9 I4 v1 b
<input type='text' name='element_upgrade'/><br/>4 A8 X0 I$ W& A9 b# w4 X/ i
<lable>Pierced Amount</lable><br/>% M+ \+ a0 t# w4 m) v
<input type='text' name='item_pierce'/><br/>
0 v& B2 O- o/ s c<input type='submit'/>
3 _& r/ h3 b* N</form>";
/ y2 j. ~8 y: `, G! o} e0 t2 L1 m& O- u2 X$ J1 v! J& P7 W
/ A% w! _& O% `4 n5 y; a6 @9 [function PostListener (){1 H' ], |* i6 q, o7 m: i
//Add more post variables if needed and add them to initform() function aswell, d* P; V& Z6 Z5 t, U9 p. t# i
* Q. \/ |1 G# ] [ _: X################################
8 m- H' o- [1 O% `3 }8 P" `8 I& @9 L##### Connection and Post ######4 j, g, t4 a* M1 ~8 ?% @4 K, \
################################
$ F; o/ [# V, ]) v5 d& B9 n5 F$name = @$_POST['char'];8 g/ S/ i5 v# _ s9 }" ]; D2 Z% V) d" a
$ItemName = @$_POST['item_name'];4 p$ |& N' O, F. C1 Z2 P5 R
$ItemAmount = @$_POST['item_amount'];
5 ~. h# w, ~( e2 V$ItemId = @$_POST['item_id'];
: L3 m* R/ C8 P8 z; x$ItemUpgrade = @$_POST['item_upgrade'];
9 F+ f b' R' L5 K( T$ItemElement = @$_POST['item_element'];
9 J' z- C# B$ k( M0 N$ f$ElementUpgrade = @$_POST['element_upgrade'];! E6 Y5 H. }0 w3 A* f9 e9 p
$ItemPierce = @$_POST['item_pierce'];
% A" F0 z9 D2 _. l- J+ Y################################$ m# M- ?: M, n1 ^
" k) h$ t8 i: F- u7 Q0 n//Check both variables for empty value
; O4 x) k* ?* U* \. Y# X8 o8 E) M. l I+ v2 S8 X' D5 x0 z! Q0 f B
if (!empty($_POST['char'])){' m0 l: T0 z7 X/ T; f
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 0 a6 C# _; x$ y# u5 v. M# [
: g! O1 v( L+ X6 U; E5 w$ j
m_szName = '{$name}'");
9 }2 {1 V& q0 owhile ($row = mssql_fetch_object($find)){' D( Y M/ ]% J8 u7 F2 s/ r2 D
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
6 {3 m' ^ s6 W! w$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ( P) k2 ^) T& f' S1 o
, G! W, }7 p& P& X7 N( G% V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
& f( L' _1 l H* K# L0 r# \; U& C
9 q% x2 R p; Q9 B+ ^: x `[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, X! K! {8 [4 @) P* R0 f
7 s, E1 H1 J$ Z, r7 Q( O; h; G: eN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
5 z* @! C. q9 E! j! b" Y2 o2 ]1 G' V0 Q. Y8 p
'{$ElementUpgrade}', '{$ItemPierce}');");# ~4 {* K( Z1 _7 G, s
}" k# q& v" c8 Z% ?1 }7 Q
7 ?( N. m8 ]1 p: s# R5 ~8 e
}# u$ c: X& j# y& t2 s. W, v
; u" M5 y. U5 V}6 C. H" _3 n& t" K+ Y9 I
8 E# D) z) s" |0 e! F
$InitForm = InitForm();5 z k" x. F: K: F
$Listener = PostListener();
1 x' r% P; E: |9 V3 P
& b! l3 u5 F/ q8 D, F; b5 B?>7 H3 d9 w3 Z. c X" l, r
$ a: O) X9 h9 I: d5 D& I$ R
D% b- X/ @0 p# l8 a) F9 w
g6 V! D7 T$ L
# c. J) _* t8 M( I# I8 k8 R |
|