|
|
<?php8 \' [4 |3 ^4 Q1 S8 Y" T3 L
function Connect () {8 Q* V* o8 a# _( }) C4 `/ W
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
; S: D0 K, o, M' H9 u! J e# b- s9 W! z( Y; p9 U( D1 }$ C' X
Failed.');9 n8 M3 }0 d& o( u
}
; e) L9 j- Q4 Y. z4 p4 JConnect();
9 k2 t/ ^( K+ p* Z: f4 P2 ~* J
! p; r. J) R$ L B3 ]: v9 Wfunction InitForm(){' A$ @- M7 _ P! m8 e s! k
//layout for the form2 N! A3 A+ G) d9 d! W; L, T
echo "<strong>Send Items.</strong>
( k# }! V& V1 W; q1 Z L<form name='select' method='post'>1 u; A- w5 m! E
<lable>Character Name</lable><br/>9 c d4 l; j7 |
<input type='text' name='char'/><br/>2 L# u& C- p* }! o8 Q
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>) O- V1 T( r1 W9 a- Z' v9 A
<input type='text' name='item_name'/><br/>4 O z4 J' o) z+ H! y% N' O
<lable>Item Amount</lable><br/>
7 y$ O2 A) k% e' p) V<input type='text' name='item_amount'/><br/>" J) q1 \( E' y$ o( K! Q- F
<lable>Item Upgrade Amount</lable><br/>
( ?, ^! A. ^$ f. Q5 ~$ H<input type='text' name='item_upgrade'/><br/>9 W4 |$ ?' l# a3 S8 X4 ~
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)8 V! k- s& K, @* l% ~( O. w! u
% |5 X6 G4 s3 l' Q</lable><br/>
+ [9 W' F' n2 D2 ^7 a<input type='text' name='item_element'/><br/>
, j8 \8 X, s& t" V5 ]<lable>Element Upgrade Amount</lable><br/>
! V5 b! H- b, m( n# I<input type='text' name='element_upgrade'/><br/>
- j& d7 C: l0 K<lable>Pierced Amount</lable><br/>
: W& L, Q+ j$ O+ w4 w, i<input type='text' name='item_pierce'/><br/>8 ^4 D: e. a/ b, o- d- f7 f
<input type='submit'/>5 n. p. } y$ H0 Z; R$ E- Z
</form>";
/ d+ a8 d" T( s1 F* z1 k1 _}; Q/ H4 t! O, H" b% l6 O: i9 s4 ^8 H; W
+ x' j* t/ e; R0 }& z( m
function PostListener (){
" m) J( Q; D( z) I//Add more post variables if needed and add them to initform() function aswell& h ? O& z8 p6 d V+ O. y
3 F" ~ a1 U$ I; E7 o4 v################################8 h" |% [% C& P
##### Connection and Post ####### A8 {1 r Z" ?
################################
' k: E( X' j0 q1 r( Y: k9 I6 S$name = @$_POST['char'];
7 r- h! }7 _5 s5 w. H8 Z$ItemName = @$_POST['item_name'];
2 w% X# _$ `- z% B* X* K$ItemAmount = @$_POST['item_amount'];
% ^- I% i' T' [' \- i$ItemId = @$_POST['item_id'];5 H1 W. ^1 h9 G1 ]$ u% l7 x
$ItemUpgrade = @$_POST['item_upgrade'];
' B! |$ W" y5 N) d: N; G* g( M$ItemElement = @$_POST['item_element'];
3 Z( |2 p8 ~! A$ElementUpgrade = @$_POST['element_upgrade'];
' j, M; J% H( q6 W7 G8 b$ItemPierce = @$_POST['item_pierce'];. j1 [+ X6 k) M3 S" B
################################3 k) `% w$ r7 |; G, G
2 _8 J$ c$ H* x3 s8 f! G
//Check both variables for empty value( m- I. m) E D
# v# P$ A3 M' v& Vif (!empty($_POST['char'])){8 c# c( G( N' B( o
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
/ f6 l; w8 Y& @1 [1 \' T6 W8 s: j+ M2 u H! }3 r
m_szName = '{$name}'");
$ _: i6 S, z8 N( ]7 Rwhile ($row = mssql_fetch_object($find)){
# x# }0 D/ r9 R: B2 B) n% m0 pecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
& a. P! C; Y" H$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 8 g+ M4 r. G: A2 O6 ?7 w
& V; Y5 I! @. r- B3 n+ U- G5 ^4 `[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
. K' K7 h& Y( _" `7 \' {/ x q
/ B- l% H# R$ `4 ~2 c/ X9 C) Q8 G[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', , ^9 c r+ |, M
% e7 k/ F. ]% P- S. ~
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', # n; E8 J* l; m
7 Z/ c3 a6 U- v9 D'{$ElementUpgrade}', '{$ItemPierce}');");
" v1 M: z$ S* E6 L8 M4 z}1 l) D1 Y S$ p) Z+ ^
& J. I1 F2 K; A6 J
}; t8 K: d! E& z' N3 T
! ?8 c. o4 Y+ W2 v' a6 {7 ?
}
" p# W/ A7 A; ~' a8 w
7 D7 C+ @ `' j" _+ C$ Y7 _" r$InitForm = InitForm();; t2 _* u7 D7 j" s
$Listener = PostListener();1 q2 J Q, K) g B _5 s
1 P0 l0 s. `8 I) J2 p4 S4 @
?>
- ]7 U" }+ y [7 C
4 W: k0 }( M6 p8 C1 r3 V& d9 m+ Q+ G$ ?! T4 L8 e
" _ o4 }, e9 x1 b" k5 Q$ q1 E/ m) e, X9 x7 S. i
|
|