|
|
<?php
3 p+ i, x8 x# _# w# g9 r6 ?function Connect () {
H* p1 l( I3 h$ ~. q+ lmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
4 v# [# T/ w. y: u+ C+ B( D% b. a+ F/ a$ [! Q1 j0 m
Failed.');* Z1 K( A" s; z4 _! z& _
}
& n" r& P7 L, |5 C0 g1 H! {6 u8 qConnect();/ y2 }& {/ G9 X$ N# N# j8 l
$ w5 y6 q- l5 \" i) Z4 z& g. D2 `% ufunction InitForm(){
% A7 }2 `; f9 g2 h/ p//layout for the form
2 h, u) ?# `9 Lecho "<strong>Send Items.</strong>1 x% ?* n* I3 N) r! Z
<form name='select' method='post'>2 f3 @* M4 P c) u* A0 ?
<lable>Character Name</lable><br/>
" p+ E% d; i' i: K5 U2 t7 k% V<input type='text' name='char'/><br/>5 k$ e, o, P, ~! F3 s* u; N+ v
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>3 R6 i h6 [. `! s/ P8 O2 P
<input type='text' name='item_name'/><br/>( E' R8 \* U9 x$ Y* v ^4 U6 B
<lable>Item Amount</lable><br/># q& e! k$ k+ E: J4 q, Z4 ]
<input type='text' name='item_amount'/><br/>
$ G9 o, a/ |! Y0 ^* N0 V* [<lable>Item Upgrade Amount</lable><br/>
4 P6 v7 K6 b0 i* B<input type='text' name='item_upgrade'/><br/>
8 ~1 m I8 g ?5 Z5 z" L. o. H<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
! D2 I, \) P6 p1 c/ C% J
$ z% b1 G+ Q0 |! R9 o: O</lable><br/>
5 V% `$ b( d J. V3 D<input type='text' name='item_element'/><br/>
1 l* r" Z( n, p, }( {# k* Z4 O<lable>Element Upgrade Amount</lable><br/>
8 Q8 Y& }7 x7 g1 \3 v<input type='text' name='element_upgrade'/><br/>
2 z2 |$ R: t% ?( ?+ `<lable>Pierced Amount</lable><br/>
$ Q. W/ {" S. O( I<input type='text' name='item_pierce'/><br/>+ I; _4 l* Y+ b; P$ C* y5 n
<input type='submit'/>! ]( x* n& ]( I* K2 T3 Q0 k
</form>";
6 P. p0 y5 n, E1 x/ N! P1 ~}+ O( S# c( t% o# p% O! ^) a% s
: i# ^3 ~ y, G7 B; | t5 u" D3 cfunction PostListener (){8 V& c+ Z; y' \/ q0 C" i0 G: ?7 }/ \
//Add more post variables if needed and add them to initform() function aswell0 e. V) G" ?4 o u5 {
% I, r1 q* \7 P8 X, {
################################4 H7 ^5 l$ E3 J/ U0 G
##### Connection and Post ######
9 l0 ?8 Y. O% p; H I################################ x R0 N5 {* @" V$ R: y# B
$name = @$_POST['char'];# E- G, |0 E# n
$ItemName = @$_POST['item_name'];; \ m/ H" ]* @# }( M
$ItemAmount = @$_POST['item_amount'];
* ~6 X7 E8 z& o8 I, L( V3 K$ItemId = @$_POST['item_id'];
- g S, h$ w1 O; f* m8 p6 \$ItemUpgrade = @$_POST['item_upgrade']; d# l2 o4 @- o& J
$ItemElement = @$_POST['item_element'];: _! e5 E- i# W, ^
$ElementUpgrade = @$_POST['element_upgrade'];
4 j; e+ A d# P" Z' h$ItemPierce = @$_POST['item_pierce'];
# q) Q; h* m8 k4 R# `# a. O( s################################
" J: D; R9 |4 b1 ]' X( ^# ^2 T. h( W
//Check both variables for empty value- |+ }! X7 x- P5 c D4 i5 N$ i
/ p$ v' V3 ?* r
if (!empty($_POST['char'])){: t6 h' e4 ` W
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
& w! `# ~0 q& W8 a% g: M
3 D8 c& W, @- N6 X/ A" S! a( Om_szName = '{$name}'");
7 R K ?, i, C* P' d) C8 Gwhile ($row = mssql_fetch_object($find)){1 Z/ z5 j: ]2 m8 v; z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";. C! d+ @9 w" n2 Y
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
: m- T8 l+ l3 |" F0 Q2 O& _
9 f0 v# d8 ]9 |! z# @$ n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 9 N0 I. V' y) y1 {- R& x1 B$ M
0 Q0 ?0 p# g+ h P
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, X6 u7 B) W8 [5 a8 a/ N
* _& A5 m) F0 t! I$ sN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
o2 q2 V9 y& q1 I
K0 q n9 l$ C) o- u' C+ D'{$ElementUpgrade}', '{$ItemPierce}');");
4 i5 y1 H& s& @}, e( s# q% y* W9 l3 ~
0 F$ c/ @( i( B5 ~5 T5 y& v% h7 I# `}
9 A0 y+ m( Y) n! m F! O, L3 u9 }' J* P8 \
}
6 a& j- o+ r& i7 j. t
3 s/ n) ~( q& ?' e6 C0 X$InitForm = InitForm();: l0 [ x3 L, {4 Y
$Listener = PostListener();
+ K% G- w w" G# [# e+ o
. @' e5 t) d$ }# k4 O?>
" e, ` G# p" s
. Z/ ]: L$ |# a7 _/ S
5 ^, C- w1 Y( r- b: p
) d# C$ c" H, [1 e2 h+ V2 T5 d1 z3 ^. D" d% B, u; _. h( V
|
|