|
<?php" J ~9 T- M$ n& H1 F2 V9 w+ n2 A" g
function Connect () {
% Q. n3 W* d7 q# d$ N# umssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# \ B* i. t& Q) K1 q7 q/ e+ i& U- d, i3 p
Failed.');3 n2 e8 N# D0 r
}. a4 {& V% }! y# W; g2 M
Connect();
5 w! J: N- t; K+ O' T% D+ z3 ~# Q+ g% [ w
function InitForm(){
% }5 x) m$ ?# P* F//layout for the form& ]+ j! | o5 u8 O2 Z- m- b6 s2 `7 R
echo "<strong>Send Items.</strong>' N6 a9 X4 n. d9 w9 j+ w
<form name='select' method='post'>
|/ F+ _/ R- r3 N0 S, y |<lable>Character Name</lable><br/>
+ o. S* S/ V* b! W* R) a6 Y<input type='text' name='char'/><br/>
! w8 a- ?7 ]+ F& i( i<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>& c' m0 ~$ m) f1 {; ]7 Z
<input type='text' name='item_name'/><br/>
/ |! R$ w C% A" H, l& A) O9 Y<lable>Item Amount</lable><br/>& K4 o6 m2 l' Q+ K% a! e) Q
<input type='text' name='item_amount'/><br/>: ^8 B% _: }5 o3 N! R6 U/ v
<lable>Item Upgrade Amount</lable><br/>
4 D- T% O0 z; E" m0 f; v* R9 }- i<input type='text' name='item_upgrade'/><br/>
% t3 `6 }7 a9 I) o: ]" y<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
, w: i; ^9 h+ L: ?: C- ~
8 h, J' ]& o h' M$ f</lable><br/>+ L: b1 J( b& j9 L8 q8 X' h
<input type='text' name='item_element'/><br/>2 f' _* P; b1 T- V5 t
<lable>Element Upgrade Amount</lable><br/>
7 `# t; I9 w$ L, ~$ Q/ ^" B/ J: @<input type='text' name='element_upgrade'/><br/>
7 c& g$ m' {' j( ]1 ?, B' m ^<lable>Pierced Amount</lable><br/>% X6 |; |5 |5 L" J4 l1 h; }1 O
<input type='text' name='item_pierce'/><br/>: w y, m( j" q! D$ E/ D* z
<input type='submit'/>
" c+ P. ?# D2 x</form>";+ | n* G! c% v, w/ D) _9 x- C
}) M! L0 o8 f$ l
7 i7 A+ V# E5 I% j. F
function PostListener (){& ]5 C) X, z# q$ L
//Add more post variables if needed and add them to initform() function aswell
: _, L$ Y4 f' C0 l
) |" }9 c9 n O################################
( r" |, t0 R R, |/ f( I##### Connection and Post ######
2 w& m% ~ z n. U. G0 i################################! e. V, v+ D+ o3 R; H' h
$name = @$_POST['char'];
! B: `. U. y+ a& y8 o$ @' x$ItemName = @$_POST['item_name'];
; W, Z1 ^4 w0 Y) |& z$ D0 X D: S$ItemAmount = @$_POST['item_amount'];3 a/ k. {* n* O
$ItemId = @$_POST['item_id'];, a2 C3 `4 q5 q9 | a9 F. g
$ItemUpgrade = @$_POST['item_upgrade'];# {9 Q2 L8 s2 R K ?
$ItemElement = @$_POST['item_element'];& j5 ?. x# b7 a# t L2 f/ \
$ElementUpgrade = @$_POST['element_upgrade'];
4 {5 n' ]6 ?% q9 r$ItemPierce = @$_POST['item_pierce'];
) k$ N: t' n/ P! t2 y3 F' @7 }################################' x% `, o! ^( S! Z
2 K3 z( O' s/ e
//Check both variables for empty value
) ?6 i/ v: ~# m! Q4 b4 q+ {
9 L/ N* D9 C7 Hif (!empty($_POST['char'])){
, b# Y7 o& x0 P7 V4 ~. N0 y9 W0 z$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 _- O+ D4 T7 s3 I
9 q1 }1 S, s ]3 u6 ?
m_szName = '{$name}'");
6 ]+ K3 m" k. X9 _# @5 wwhile ($row = mssql_fetch_object($find)){
# r9 H6 ]8 C+ G2 q0 T% J$ mecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";$ I# V2 D8 u5 X8 V" K, P6 Q$ ~
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
) E; q& F- |# m1 R2 k) ]& t `! t3 o
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
1 T5 }/ @' k' C# Z5 g: h7 q0 o/ l$ a3 b6 k4 S; g
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
8 j1 c: Z' L4 U" D& g$ D
0 O* Z; r4 q% \* \9 q- ZN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 ~- ^) J" ]0 ~. J# j# J t+ m4 n7 O
, h3 V. s5 G( t: ?, A'{$ElementUpgrade}', '{$ItemPierce}');");0 s: e, E G) \- G: W7 }
}
7 N4 h- I4 E1 S+ K7 H# v6 N3 l. G6 x% i: O
}$ F2 ^, K9 f$ v7 O
, U: a O" O# E% M) @+ [" f# Y# y1 [}
0 m4 g x9 Y- _( E: [ U& R2 i7 q9 t& N
$InitForm = InitForm();6 V! H/ s. F: F
$Listener = PostListener();4 S" e% ^" {: f) h. h
+ p8 v5 |( m1 V4 B/ U/ v/ C* w?>5 `( J! C5 a* d8 L; k+ K7 B
$ o* E+ O" R( \, v" B$ [3 M) s- O* J$ a7 I4 |
8 g( `+ Y+ {0 [" o( E
: A$ g" o/ r/ P- U% _, S3 ? |
|