|
|
<?php0 B) \5 G6 t8 ` S1 ?3 s, Z
function Connect () {
4 z+ e2 u6 a3 G8 F+ Q I, Z& Pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB n! {6 f- `- k$ _+ i! Q$ {
0 A3 _; W& \( f, OFailed.');% M" R) A9 Y5 o( Y, |) B3 k+ a
}
: a1 ?" j# s6 \9 eConnect();
$ N/ ?0 L$ i' n* p! M& V! n- X/ B: N) H' `2 _- d9 Y
function InitForm(){& R+ y5 \% A& l- U5 v3 W; A
//layout for the form, N: ] E/ B" q0 y. t+ R0 L
echo "<strong>Send Items.</strong>
8 }; q) G' T3 b) G8 n* w# G<form name='select' method='post'>* J. Y( U. I3 x- z, w+ L
<lable>Character Name</lable><br/>0 h3 w$ `. s( H/ ^' Q. s
<input type='text' name='char'/><br/>
* D3 y! o/ x7 O( O p<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>. ?) M3 j& e8 s8 W& i0 c
<input type='text' name='item_name'/><br/>
, m. G x8 ^% [2 H X+ g<lable>Item Amount</lable><br/>' ?8 t6 z& d$ x
<input type='text' name='item_amount'/><br/>
* O/ Q$ N5 G9 Q; w. ?1 s5 N" R<lable>Item Upgrade Amount</lable><br/>, l0 ~2 ^3 V2 N' F% e
<input type='text' name='item_upgrade'/><br/>
7 L; U0 h! z. z2 f<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)( S$ I. p3 ?" n3 o
& f* B! `' ] o, e( n' o7 r% u
</lable><br/>
! b5 A& y9 h/ ^6 B6 s9 d& w* K<input type='text' name='item_element'/><br/>" U6 ^4 ]" z( q1 C' S3 I
<lable>Element Upgrade Amount</lable><br/>' L1 r1 H* A' A- }- Y" r
<input type='text' name='element_upgrade'/><br/>
+ n- y8 ~( _3 e! e4 s4 O+ e$ x<lable>Pierced Amount</lable><br/>
; C% i9 r. ^; a# G<input type='text' name='item_pierce'/><br/>( U" T1 M0 m) q$ i5 v; C; w5 k
<input type='submit'/>0 j: {% ~' i/ ^2 C4 y5 `
</form>";
: ~# f" P# I' l4 ]: g1 x9 L J$ a}7 w2 x# R/ R8 ~) C
B0 ^; A% i7 b" {1 {function PostListener (){
6 G# n3 b( n0 k5 Q. I o( e$ o//Add more post variables if needed and add them to initform() function aswell4 Y$ z: S/ p% X# S
: N+ g* Z! O4 n. a9 Q8 l+ B Z
################################
# F4 \- j y* l8 S. X. c##### Connection and Post ######& d' w* L6 ?) P* o% `! {5 _
################################
' E) w0 J& o. n' X6 \9 g$name = @$_POST['char'];
. w! B, c3 L+ Z" o N$ItemName = @$_POST['item_name'];; x$ u6 ~$ r3 b0 I$ o
$ItemAmount = @$_POST['item_amount'];! R* \5 r! q- p9 d' h! e
$ItemId = @$_POST['item_id'];
; ^* _4 J& ~2 _0 `. X$ItemUpgrade = @$_POST['item_upgrade'];/ }( A4 Y/ ?- ~' o9 X6 ]9 t
$ItemElement = @$_POST['item_element'];
- L" V% v$ J) ]5 Z$ElementUpgrade = @$_POST['element_upgrade'];* ?- y+ R; S9 G# D, K
$ItemPierce = @$_POST['item_pierce'];) P& j) c5 H C! ?- W
################################/ @. U6 f' p5 v# s: i
; l& R- }! L4 A
//Check both variables for empty value
% i, q( `6 E a6 J- s3 D4 {! y. P' b6 x l5 s* r
if (!empty($_POST['char'])){
* O& {' q2 Z: k# a7 l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ' x* ^( v. q( s& O
/ \9 A$ r$ t2 Q* D7 ?7 B! t/ r
m_szName = '{$name}'");
?9 q# u' A& e* n0 }while ($row = mssql_fetch_object($find)){/ w) ~) v( W& y& d
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: O' ~' \8 J1 a( n( X$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
- u1 w+ b; h/ Y5 T* ^. P- i! t% j$ m% G$ y) K
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ' T2 k3 f) M4 O
) O: Q' X9 ~. F" \0 F% t: k[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', - G3 ]/ V& z+ w5 j+ L8 b
: \; A6 Z9 C2 s' z7 iN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', " e3 Q% i e; |7 J" g: _% ]: [
% F6 @: g+ L5 ~# [ @/ Q8 [; w% W8 x9 |
'{$ElementUpgrade}', '{$ItemPierce}');");1 ^6 P4 l a. C9 }& |
}& x8 m& Q' J# g
7 f; G5 Z6 c9 R; C+ T! {+ e}% |; c* C" ?& p
2 `; n2 S/ p5 O5 \
}
# F* o) f" s2 |6 Q( |! V3 y3 L p) A0 o2 N5 r4 I% ~
$InitForm = InitForm();
6 |* |& T/ m2 ~+ Q1 _$ c$Listener = PostListener();
0 P4 T' k. i, Z; w. _, O% I/ m+ f4 l+ ~# A; c
?>
; m( {- t: z6 ~$ o! F9 u1 s: i
( `1 V. Z5 ^: }9 J* ~
5 L: V9 S$ \ j0 _; ?: [% y* {' o# v+ P0 O& U1 { i# g/ R7 l
; R* k( D5 X$ N2 @ |
|