|
|
<?php1 T# C; |, [7 L2 @! v2 U* r( a
function Connect () {! ]; [' {( a1 x+ u6 K
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 6 [4 V }5 `) r% D6 b+ G
) Y# {3 t& ]' g2 T9 w7 {' ZFailed.');& m1 R5 e% q% z }8 k2 j
}
7 U2 F& |4 ?+ x: d; a0 rConnect();
0 h8 i8 m* [# J3 ^! r; u
$ X% r5 K" Z7 Ofunction InitForm(){
: K! ]' ], N6 @! @/ _//layout for the form- x. r. `. ]( p4 D) W+ K
echo "<strong>Send Items.</strong>0 p2 D- i9 C, ^9 ^+ a
<form name='select' method='post'>
0 `" Y& Y" {" T6 q+ Z( m/ p<lable>Character Name</lable><br/>& L, f4 {' q6 V& b3 ^
<input type='text' name='char'/><br/>8 Y3 ]0 g7 U) f0 h
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>0 n/ O( D4 Y' O8 t# E
<input type='text' name='item_name'/><br/>
& w m) _4 U3 ]* n- O6 L o' {<lable>Item Amount</lable><br/>7 _# x# U$ ]$ E0 W* i' ~6 K
<input type='text' name='item_amount'/><br/>' ]6 X, Z2 a8 }3 f$ ]
<lable>Item Upgrade Amount</lable><br/>0 E" b b+ |1 F$ I5 m) V
<input type='text' name='item_upgrade'/><br/>: G# P9 B# P/ F- }
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
; k& i$ }0 A* n! [5 N# u! u" m! j$ Z4 F1 O& x3 B x
</lable><br/>
+ z( d; Y2 G5 {8 a# z' K: F<input type='text' name='item_element'/><br/>
8 A2 u& Y; _7 z9 c a<lable>Element Upgrade Amount</lable><br/>
# j7 S1 Y5 K% F/ Q: x<input type='text' name='element_upgrade'/><br/>
. a9 h8 N) x" t( ~% ]; [<lable>Pierced Amount</lable><br/>
4 u/ P; U$ E7 [2 c4 U<input type='text' name='item_pierce'/><br/>
8 K4 U, |! h9 w4 M2 d- x3 J<input type='submit'/>) m6 b; \' c/ A- J9 i; `4 ~
</form>";
* `* e! c: }# h9 P) e; ]2 f}# p+ y; w% \) M n. H; g% h
0 _" \- J) @- b/ R, x
function PostListener (){. M9 G) R9 `, U% _( Z( `
//Add more post variables if needed and add them to initform() function aswell
F) g+ Y+ E- o! X) x/ {; v2 Y; X
Y& N( i5 b2 v$ `* E) m0 A( [# k################################2 {, E! a) e, `, c- m
##### Connection and Post ######" L+ w% n* h9 a" ^' h( f% m' J4 r
################################& B7 [9 E: l# @9 D) l3 b
$name = @$_POST['char'];. ^# h' l! L' n1 J" n4 E
$ItemName = @$_POST['item_name'];
" @: i# i3 l5 X- b$ItemAmount = @$_POST['item_amount'];
" C) F) a7 J# ~$ _$ItemId = @$_POST['item_id'];
/ v: K% h! {5 T8 _! g' s. O4 |$ItemUpgrade = @$_POST['item_upgrade'];
' Q7 y ] c1 E: y; y5 p$ItemElement = @$_POST['item_element'];
/ l W* c6 U& W0 M5 y! |1 C$ElementUpgrade = @$_POST['element_upgrade'];2 q8 i( e; [; d7 P, L
$ItemPierce = @$_POST['item_pierce'];
, d; ^7 \1 i K0 x" i% ~################################
5 R/ q. Y2 }: G8 b2 T
8 r, x, ?# S2 J8 F: Q9 @2 L//Check both variables for empty value
! i( G) o7 i4 c; v# a4 Z3 t# u# C1 \9 M& s; x1 h6 @! [0 ?
if (!empty($_POST['char'])){
2 m$ I8 F. M3 q+ ~$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
4 H/ d4 ]$ f5 T+ Z7 [% {
" `! S6 B0 A- N' S* Um_szName = '{$name}'");. @# {6 @* ]" L% B
while ($row = mssql_fetch_object($find)){' F2 W d8 ~/ p+ c' U1 G* A
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 |- G8 A$ D ]1 ~. H
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
8 y$ W5 f7 `; c4 ~
, o' K( F( M+ g3 y& P0 Q8 V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
+ _" R* N' W) O+ B
% s# @0 M; @. V( M9 f8 e' O. f[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, u% r% N7 j6 B7 H& g- |. l u2 A' _) Q
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', - X1 k% B& e, b% r5 q
$ l: j# \: x! I- s0 v `
'{$ElementUpgrade}', '{$ItemPierce}');");/ X4 C3 Q! D: Y7 |' {2 h
}
; A7 K2 f- |) m7 }6 p# j- f$ A4 [+ \4 l, z2 H
}
; }% E8 ?' A$ U- t$ | T; G( u3 B1 r) r9 b+ {
}
' c" b) ?# o3 w( b, C+ q K. q) w4 N5 C
$InitForm = InitForm();
0 e' m; o1 R; y6 o! l6 S8 A c$Listener = PostListener();
4 p; m( @% [" I4 x4 t
; X+ ]; x6 l: Z5 P% _?>
3 `, M9 j5 L% d$ b6 I7 I
+ D6 L# W8 ]) \* z0 |+ `! m7 a* E6 A9 V4 Y! H- N5 h9 ]0 v9 V
# Y: Y( m' G' f2 B" K7 N
& x% F1 B$ @8 i! L8 T, F8 n9 f
|
|