|
|
<?php7 ^. u8 F, }( y9 z+ ^4 q+ L) @
function Connect () {+ F" r# e9 h% z1 U, e7 E% W. [
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 9 X! H. h7 X$ v' h& g$ J1 W
9 i. X" Y/ u+ u! ]" @. W; gFailed.');
% ]3 j4 K5 ^4 W- H}6 f* E4 x! O. w! R9 B% H
Connect();
; U, K5 L) H3 n$ o/ m7 ?* E5 I V) ~, x" L$ Y8 h6 L. X
function InitForm(){9 E0 r6 |. p( V8 U" h7 b/ o
//layout for the form
~: ?/ r# A H" O4 V. ?5 [5 Fecho "<strong>Send Items.</strong>
, u8 S6 X0 m, `<form name='select' method='post'>
" q) ]* B* B7 o! X3 r2 n# z+ x' _<lable>Character Name</lable><br/>7 [4 _0 E% b' `, f/ {: M) w
<input type='text' name='char'/><br/>
/ t! r6 D8 N, q' n<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
3 v2 F: z% {0 Y4 D' e( Q<input type='text' name='item_name'/><br/>0 y: Z2 V3 P1 ^! Q. S9 d; n# R
<lable>Item Amount</lable><br/>7 d7 T9 y- B* n4 |" D. o c
<input type='text' name='item_amount'/><br/>
% V5 p3 T5 T! @" i- c<lable>Item Upgrade Amount</lable><br/>/ |) `* Y* Q$ p0 l9 A
<input type='text' name='item_upgrade'/><br/>
3 V9 ?2 S, [& E+ _. X' P<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)% U6 z* @# [( e S' r; p
' O* R9 x# m+ w! s+ m& Y7 D
</lable><br/>1 I/ j: W% Q" T. j B! r
<input type='text' name='item_element'/><br/>5 X7 }" d' a. L) t0 p. R
<lable>Element Upgrade Amount</lable><br/>
J, Y* i% u) ?<input type='text' name='element_upgrade'/><br/>, V0 C. U* c% ^7 X
<lable>Pierced Amount</lable><br/>
# o( j; a b9 T a7 D4 \<input type='text' name='item_pierce'/><br/>% v/ ?$ e* H3 }* C: g$ E/ i
<input type='submit'/>8 {! r& _% L' j5 i0 M% P' \) D
</form>";8 y, m* Q' S+ W% q
}
' |' b! s5 A! r4 r
3 x+ G2 y' S8 _6 qfunction PostListener (){
' y" x. h8 X7 v8 e7 W& `//Add more post variables if needed and add them to initform() function aswell
; k4 O( }5 A( G9 j9 l, ]; Z B0 p. }/ |6 K: \' X" ~# j3 m
################################
3 M, r3 f. R) l, _8 P& p J4 a##### Connection and Post ######
) O7 e' Z. Y0 M% s2 h: l################################- B X3 u$ b; Q9 Y- J( D* |
$name = @$_POST['char']; Y* A; R2 M0 |( s1 J0 Z6 z$ n% Q
$ItemName = @$_POST['item_name'];
' ]6 a. J7 q- E( u% Y$ItemAmount = @$_POST['item_amount'];
& A0 {5 a+ M. V5 l: q$ Q4 S$ItemId = @$_POST['item_id'];
: _/ q. \+ I$ u* N: j2 m! S+ w$ItemUpgrade = @$_POST['item_upgrade'];
" N/ E0 p# H9 ?+ i5 b$ X1 x4 h6 _! q$ItemElement = @$_POST['item_element'];
8 Y5 A; l6 J4 ~1 T* P7 e5 O$ElementUpgrade = @$_POST['element_upgrade'];
% }9 @% x& h3 L& M. {$ItemPierce = @$_POST['item_pierce'];! b4 ]! Z0 T+ h! E6 X5 ?: {& _
################################
! H4 O" h! t4 Y6 t
- K* L; R+ _ [- P//Check both variables for empty value
* n/ ]6 t. U3 F- v/ T5 b7 I# p
5 W1 Q( d. v# @9 V/ |; d8 I! ~if (!empty($_POST['char'])){! j! p& D4 G ~% w! F$ _; A( ~5 S
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ; o7 B# }: d9 ]) \6 t( S
4 ?# W1 [; F* t) s. ym_szName = '{$name}'");7 [' [( O% @, l& c* M
while ($row = mssql_fetch_object($find)){
4 G1 v7 _! C. ]0 lecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
" A. u' y9 D+ V* ?$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], " {7 W- y, N6 ]3 J+ {/ n: `0 b
, L& i+ l$ e+ I* o5 r# R8 K# o o
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 @ a3 A* d. ]+ r1 X6 o* Y; S- B4 H4 d3 `0 E+ [
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; T1 v; h+ `3 v9 l( Q8 _5 v, N& ?8 q$ y
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 5 m5 J# \- `/ \9 I+ S" e! b
3 s- Z: A# d% T% T9 U
'{$ElementUpgrade}', '{$ItemPierce}');");* S" h3 Y) x+ H0 {$ @' l6 o
}0 v0 K/ a6 Z3 [' q1 \- g
) J8 \) R& w, y2 T& i F/ P# Y}
( u' ~5 @+ @/ h% B' Y5 I- C3 x; i% y8 a! p( |8 c
}
* Y8 ]! \ Q+ @5 i4 o
/ N3 c9 S" o/ A3 x8 v: {$InitForm = InitForm();- s: C& s# M4 T( t: a/ H+ c) L' ^
$Listener = PostListener();
% d, a) V$ R X' @# m* F5 C( J9 G& Z/ A v
?>
5 p6 B8 n9 A% r- `, R4 y. [+ K. S X5 H' \
" ]/ |- s7 s- d9 f r. r3 ?2 \
; N. ^* W1 n6 s+ q2 @5 S
" C& A, `( V8 G; }: s' H |
|