|
|
<?php2 \7 F; Y* K* l8 `7 J
function Connect () {0 }2 R5 l D+ ?/ ]: ~2 {
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% N3 e$ L' H5 }1 F* F
& c f$ K) d, c8 D$ M3 B7 bFailed.');% W& z0 B `7 _% s4 l8 }" A* A
}
& ?% ~& B7 D: `1 MConnect();. @; U1 U$ V% m3 Z8 p" b
3 z1 d5 }' a1 d
function InitForm(){
# ^; M( w8 f0 o9 p//layout for the form
: M. B$ a5 j4 Z. @9 I1 pecho "<strong>Send Items.</strong>
; r( \! o" u& ]6 C0 M- u. I T( p, K% D<form name='select' method='post'>4 n2 W3 X( v: P% {! Z( U7 h) f
<lable>Character Name</lable><br/>7 f1 z% A! I: u) J$ M9 e
<input type='text' name='char'/><br/>0 h, Z4 n" @: h& i- c
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>4 T; Y- R/ y! d3 i
<input type='text' name='item_name'/><br/>
) t$ S4 A$ m2 I M. D3 d V<lable>Item Amount</lable><br/>: y# D1 J$ g P+ e; W" S. s4 c, F
<input type='text' name='item_amount'/><br/>; {, J0 n" G* s
<lable>Item Upgrade Amount</lable><br/>
. c" `5 S/ @% P/ ]) Y. H& U<input type='text' name='item_upgrade'/><br/>( k. s) K$ R) Q( w# H" M9 m
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)0 d5 ]5 T+ T3 ?/ K0 D* {" H+ w
5 [1 l) t/ ~" K. }+ d: _; Z
</lable><br/>
6 D6 p$ i) w$ H5 ^<input type='text' name='item_element'/><br/>
* g+ S/ a# ^2 z3 j2 @" c<lable>Element Upgrade Amount</lable><br/>: i) Z; k0 {8 m0 N" M; |
<input type='text' name='element_upgrade'/><br/>
# P2 s' u% L" [/ o) P6 g f0 R7 L% |<lable>Pierced Amount</lable><br/>. }) \- n I! P! A% D% v1 L: S
<input type='text' name='item_pierce'/><br/>
; x( k, I3 _8 O. h9 s$ v" d<input type='submit'/>' x' ]+ B q4 \0 J7 a4 i
</form>";" h4 C8 V" Y) ^" C# E
}1 V. t! }; Q$ k& s7 ?* X6 {/ O) A
9 w/ W0 i/ _, `function PostListener (){
; X0 R$ F2 f7 K4 b2 M" r& e//Add more post variables if needed and add them to initform() function aswell
+ a' n, X& p' q& a) {, l! c3 |/ _) g+ z
################################
1 G5 t. E" M) U+ i ]) L; V##### Connection and Post ######
8 U% J% P( X" l2 m& i0 K################################
) f: c4 }7 U( x! [$name = @$_POST['char'];
/ a- a& Z3 g8 y6 B$ItemName = @$_POST['item_name'];
6 v3 g4 N. \, M h6 z2 Z6 {$ItemAmount = @$_POST['item_amount'];/ v, l, R, J. _( N
$ItemId = @$_POST['item_id'];
* |+ s8 F( H7 [+ K& }1 {4 D8 n+ v$ItemUpgrade = @$_POST['item_upgrade'];
! {$ t2 x5 o% W$ItemElement = @$_POST['item_element'];
`( b( O9 V$ H. I y& C$ElementUpgrade = @$_POST['element_upgrade'];* G2 Q, r. P7 Y; o# Q3 `
$ItemPierce = @$_POST['item_pierce'];
" J$ W8 O J9 Y9 `" D# }- a################################- q/ a+ T: V/ [3 M: A
( Z6 c) C/ L; d9 F
//Check both variables for empty value
/ }+ @4 u0 P6 y+ t: W2 u0 x" y
: {" P! V1 P" u3 Qif (!empty($_POST['char'])){* m) \+ r7 r+ l7 u
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
3 @# Y. b% K6 [/ O% T! J5 u
1 V. g( V" B' x# w" [m_szName = '{$name}'");( x& H: V$ r$ y
while ($row = mssql_fetch_object($find)){& E- \7 e) {2 U: T
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
5 M, p/ S' {# K3 i$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], % e. `: z; A8 R' U' G. z8 m
( G: m/ p g" y0 l( r0 x( d[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
7 H' i1 g6 p5 K9 J" f7 Q, ?/ k- J0 H* K
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : r6 x9 {" Y& c2 p- H8 I; y" ]
* r+ ]9 u3 l5 O9 B) yN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 4 f( N, `9 K( a* Z# q" O& F, N
' `+ F6 N# h: e. B6 `
'{$ElementUpgrade}', '{$ItemPierce}');");
* J8 i0 v5 f" X; {% z0 Z' R. a9 m$ e}% ?" D: Z- _' E7 r: B# T0 o
( L7 C. H3 C3 L- I; _3 b+ h1 c/ p
}; x) X# ^+ m% m% c0 U+ b3 B0 }, u, F
2 e* Q; A* [1 x8 N% i+ D3 r}
* F3 j6 c: S6 v c5 a0 A7 N9 B: q2 H4 Z& h$ A0 Z( @0 e
$InitForm = InitForm();% H) b% ~. h! [
$Listener = PostListener();6 ?4 X, S6 ]4 x7 Q6 x5 X
^) e9 ~9 s1 }, r- }3 h+ y1 O
?>
* p$ c1 @/ a4 p# a' p9 s6 A. z9 Y
8 _7 D3 ]" }" J4 w4 i
3 T% }& | Y$ C7 l" ^# n4 p4 S; w9 D) d. t4 A! t( Z
|
|