|
|
<?php) f! |% H3 \9 N+ E
function Connect () {
' |, X9 e- Z& o8 U8 [1 y7 g% Tmssql_connect('Server','UserName','Password') or die('Error: Connection to DB " C: A* ] l4 S* d
2 b5 {* c& }, O% IFailed.');. i9 r3 x1 O, y
}
6 H5 p# a4 K9 u6 jConnect();
1 y! f' ?# c$ a- ^5 ^* U% E" L
) n2 Y, |- I ^: qfunction InitForm(){
% X6 p$ z) g8 J0 ?0 B- ^//layout for the form" K) w: B. W; F- e. ~: j
echo "<strong>Send Items.</strong>+ x8 j% |1 u" b! u" Y6 M
<form name='select' method='post'>
# l3 p( D5 ]6 d<lable>Character Name</lable><br/>
/ L+ Y9 t7 a1 d% _: W<input type='text' name='char'/><br/> E5 s; }# W6 n
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 [, n5 `2 Q8 m/ c
<input type='text' name='item_name'/><br/>2 e( b, z! N5 h2 j+ x
<lable>Item Amount</lable><br/>0 n! \. z5 D, i7 {/ U6 z# f
<input type='text' name='item_amount'/><br/>
' B. V3 s- U1 E k3 t- y3 \5 {; R<lable>Item Upgrade Amount</lable><br/> E: M/ X/ Q; H: D( M
<input type='text' name='item_upgrade'/><br/>& ^) e( k) |% G
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
3 r: G \2 s) m) B+ l3 v0 y& N! L0 t$ Y
</lable><br/>
- |$ s7 h' R( C0 p Y) ]! j1 D<input type='text' name='item_element'/><br/>
& a8 i8 A8 H( O' p0 K<lable>Element Upgrade Amount</lable><br/>
9 l/ y9 S8 p% b) i) s<input type='text' name='element_upgrade'/><br/>
* H; X! ]& t+ m<lable>Pierced Amount</lable><br/>9 n; ?/ g7 F4 a" q' Q4 i7 F2 |& \
<input type='text' name='item_pierce'/><br/>6 v- q+ y- x/ T: X
<input type='submit'/>9 j& T7 p) L" ]% l N3 g& y) a# I
</form>";
# P& I" }% l% G}0 X3 J, K. _6 U( h; Q1 p' x, u; G5 Q
6 }3 l' w ^9 W Wfunction PostListener (){5 m/ v2 v8 N$ W, n Q3 ?5 |8 [
//Add more post variables if needed and add them to initform() function aswell
1 x8 a* Q* M' l$ W9 V0 @, I4 J, t- M( X3 L Y8 Y
################################
% @) B( E: T, E2 ^##### Connection and Post ######" g; X, g0 y, W* F3 E9 @
################################
5 }5 M5 `/ y8 e" I5 E$name = @$_POST['char'];) |" ]5 ]6 _$ C$ A+ d8 }' b
$ItemName = @$_POST['item_name'];
0 a9 x" u2 J+ s0 o6 O$ItemAmount = @$_POST['item_amount'];) X' Y! p8 D) @+ P& I* O) ~9 o
$ItemId = @$_POST['item_id'];
3 p V$ b0 t, k- }4 A: R$ItemUpgrade = @$_POST['item_upgrade'];
7 h# C( y9 R( G( A$ItemElement = @$_POST['item_element'];' o$ S( D6 G& o5 s9 j: A
$ElementUpgrade = @$_POST['element_upgrade'];7 ^+ D$ Q% [) V7 N, l7 l
$ItemPierce = @$_POST['item_pierce'];
! k1 Y, e8 I$ V" T% f+ Z4 g8 n# e################################6 R4 I Z3 _$ V: C# ]
/ s1 _6 m# }) _3 [/ V i3 K0 j2 m2 y, j//Check both variables for empty value
4 ^) _' [! [9 Y5 ?+ X9 x$ ^2 k# q" y, f4 ^
if (!empty($_POST['char'])){
5 U. c. W1 w' b6 {# I5 D$ _" a$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where & M, B5 u s1 }. L7 Q/ O- l% J
- l: ~1 C" L" |2 x1 l- V
m_szName = '{$name}'");6 I4 s$ [4 O1 }/ ~$ f
while ($row = mssql_fetch_object($find)){
& @) U% `+ T8 [$ h; ^echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
+ R M1 g) H) F# {$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
8 }& o- P# ]/ S. A4 f5 [! X O! g+ h- b7 r% Z( H
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
; W$ V9 \- u- P- [0 [8 |7 p
2 r+ Q& Q1 w' F[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ; j4 p, N0 c. |
# e6 ]2 ^- N) W$ s% TN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
! J6 z' ]7 F! G, s" W& |; P* W! p* R# p
'{$ElementUpgrade}', '{$ItemPierce}');");
/ ~, O9 s$ O! \8 w}( r/ P. m9 \' q& P4 ]* J! C5 [
* Q/ D& F" p8 _}
1 F! o. _, G- @/ J
/ I/ y$ A4 ~) b5 u1 P9 i0 Y}7 j2 F2 m- w4 K2 E o# t
7 B t, n& j7 }3 y+ A$InitForm = InitForm();
' s6 X/ Q: b0 \* M; B( K! R$Listener = PostListener();8 P' J2 @( |1 [
6 p. N+ _$ \& }, G1 p9 Q# T: W+ D?>& P9 ]* o' C: t0 d: J8 y
9 t( ]( b( e: w1 k! Y( ?* ^
- A- J1 H* h, M& R: P' C. k
# Y# X9 S, |: N& m& g0 o# A/ S9 f( B$ F; `8 B
|
|