|
|
<?php; ~. C: r z$ _3 p4 e1 Y
function Connect () {
+ H5 t0 C/ l2 V- }' pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
- s. C4 \# j/ [! B& B3 I, }
. F( ?0 a z4 a7 |Failed.');
- G5 P. q) ^1 h}0 b* d; Y Q0 C
Connect();
( G* r8 ^* q, E" b. r7 h2 }$ _0 a4 T
function InitForm(){
7 j0 Y K! o. ^, c, h//layout for the form7 A1 h; H m$ B0 N/ U$ I
echo "<strong>Send Items.</strong>
1 e; W3 m& r* L( L<form name='select' method='post'>
: B1 p7 a8 d- m. _; r+ |3 Q) P<lable>Character Name</lable><br/>
2 T/ ?( v E5 F3 s# x<input type='text' name='char'/><br/>
1 P+ J# M1 J4 t9 b<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>* Y$ a- p+ {: b
<input type='text' name='item_name'/><br/>
. B- c$ [; F, V' `+ V<lable>Item Amount</lable><br/>! j+ W2 D7 |8 ]) G
<input type='text' name='item_amount'/><br/>5 y& l% D5 s, I- \8 E; y* |
<lable>Item Upgrade Amount</lable><br/>: K+ O& M1 s2 e3 K( W% k
<input type='text' name='item_upgrade'/><br/>4 G9 H% v2 j. n* J
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
) q$ A o. _. [# s5 J8 y* p! @% M; k2 E; H; S- K
</lable><br/>) E( Y2 y0 g( y! v4 a/ [
<input type='text' name='item_element'/><br/>
1 Q3 H1 N- c% D& ?! Z0 E' h3 Q2 K<lable>Element Upgrade Amount</lable><br/># I5 ` |2 @( b7 o) `" Q% A4 c
<input type='text' name='element_upgrade'/><br/>
6 S5 O- b/ E# Z3 l' T<lable>Pierced Amount</lable><br/>
* @. ?1 b+ P& ^8 H& V<input type='text' name='item_pierce'/><br/>
4 U/ e' @' y) s3 o) o' Y<input type='submit'/>
# G4 `& O0 Y4 W) S5 n3 l% x</form>";; J8 f9 d S0 l
}
1 h# R+ k/ x7 \/ B1 x% ?- l' X# M) ?1 S" l/ J0 W
function PostListener (){
: q2 s+ c0 D0 n//Add more post variables if needed and add them to initform() function aswell
; J7 j% ^4 R" H/ _7 Z
0 |, [/ {1 |0 \- H! X################################
6 g0 t' `8 g! j4 V J6 I" S##### Connection and Post ######. o6 |' b1 K2 p( ^7 Y ^$ v
################################6 ]! S& \$ p# k& W* J# U3 b
$name = @$_POST['char'];2 M) [4 j4 t, K2 @+ K% `
$ItemName = @$_POST['item_name'];
( _0 J1 e% @! h- u7 w9 {$ItemAmount = @$_POST['item_amount'];
; N3 i, a& c, c8 C$ItemId = @$_POST['item_id'];& S0 }- z. ^) f* o( y
$ItemUpgrade = @$_POST['item_upgrade'];- q" f1 K$ U; Z- o: c: e
$ItemElement = @$_POST['item_element'];* i0 u- w9 ], q. a" z
$ElementUpgrade = @$_POST['element_upgrade'];
1 ]" K# P2 T9 t5 W$ItemPierce = @$_POST['item_pierce'];
: t$ H% v$ s2 s# M/ [################################
7 }1 L8 z) A8 M* }5 U9 c# t
/ F5 T2 v% J$ o' m" O4 p4 ~9 o//Check both variables for empty value! K$ k/ U: X* O) P
?' M0 w" h9 g2 lif (!empty($_POST['char'])){# w, a8 c! T6 F- F3 j E1 N; `" Z
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
& p" A8 ~: ^6 c0 r) Z8 g
0 D$ s3 N7 K, A! X4 |7 B( x; p9 nm_szName = '{$name}'");. M6 r7 A& W9 p
while ($row = mssql_fetch_object($find)){6 \" Y; B% V$ U: Z7 B2 j, J
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";) d& F# y7 j2 T( B) `
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
' O9 W$ L( K1 O) `8 O3 u
+ a, F$ w( m u# g8 r+ {[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], , Q% A3 W& _" _0 N3 e; Z4 I( k
7 n; M K7 C1 G9 s9 W[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ; S" U4 |; T s
0 y5 U9 @/ r* WN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
* ?8 W' b3 s$ _( y) t: q( o+ Y/ g! \7 G! t: j* I- r5 E; A+ H. A% X) v# g; |
'{$ElementUpgrade}', '{$ItemPierce}');"); A% o- H& L; F7 u5 f
}
) R2 m: A- X/ g! P0 |! L" ~ L; A! e4 y
}
: F7 y2 C" r# H; q# y1 h9 J
: S8 o& y2 x/ \0 @9 r/ A( ]& E/ r}6 d( V' m7 H3 a/ h$ k2 d; J
# K& O* M* q* w; e9 b! E$InitForm = InitForm();" o1 b$ k+ x2 l4 P" w* D
$Listener = PostListener();
) T* V. P' q7 z+ D2 E, @: _) l* H1 ?3 B- b
?>
$ k) g3 {* W! s& n! n$ U; Q2 N$ e1 E4 O# O6 B3 j
9 O9 |6 M/ O6 Y$ z/ s) Z9 L# O- S! J* P) a7 G F) y1 T0 G; I
6 [1 f$ l- }& W4 Z0 y' g& w |
|