|
|
<?php& h ^9 y, r" M
function Connect () {
0 l& T, V; N) _! ?+ i5 vmssql_connect('Server','UserName','Password') or die('Error: Connection to DB : u( _- r0 { Z
1 h6 L- j2 b* b3 P4 @0 zFailed.');. i' x, y" G4 o0 E$ y
}3 U4 Z( V' M( o1 s3 ]& l
Connect();
, y% t) S" B8 C5 c8 K7 n" u' f9 b* L8 K
function InitForm(){
1 b+ h7 S( T, r" n! f# h7 @//layout for the form
+ B. d9 @) }$ e# ]1 s7 \1 S: cecho "<strong>Send Items.</strong>3 s0 Y) D ~3 _% {3 {$ L
<form name='select' method='post'>
) a0 N7 |1 z* ?# b<lable>Character Name</lable><br/>
$ J; c( E& y4 s<input type='text' name='char'/><br/>0 V+ B7 S# Z2 v t1 ]- c. L
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
& H G% c1 V/ {<input type='text' name='item_name'/><br/>' x5 S, X; Y9 B/ X' Q
<lable>Item Amount</lable><br/>
$ J6 O$ F# q6 z7 A; {" r<input type='text' name='item_amount'/><br/>! F6 d' w& s! y# C
<lable>Item Upgrade Amount</lable><br/>, R! `1 D$ ?. f7 H' m7 T4 E
<input type='text' name='item_upgrade'/><br/>
0 ]0 p, R8 |- T# a* w<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)$ w1 M% ^7 j5 E! O* q: q& b
2 l/ d5 i6 H1 o% H% H</lable><br/>
/ {0 C+ o6 Z1 Z& e) @; w<input type='text' name='item_element'/><br/>5 y' ]" f" E8 \
<lable>Element Upgrade Amount</lable><br/>& T3 A1 }7 J2 X
<input type='text' name='element_upgrade'/><br/>* h& N" H/ r) N. J- i5 N6 H
<lable>Pierced Amount</lable><br/>7 M3 ~& J. k. f9 O! a3 K
<input type='text' name='item_pierce'/><br/>" D) H# _9 c, k$ w2 ?
<input type='submit'/>0 i' R! F6 ]" P$ ?: S% m$ V
</form>";$ M5 X+ ?9 F" V
}- s9 s# B3 r" L7 ]/ |0 c
# M& \6 d4 x6 L Sfunction PostListener (){
* O, P) K8 v; |0 d: z ~//Add more post variables if needed and add them to initform() function aswell
0 ?& O( R" x: s+ |6 y) W/ H( u7 X, W3 ]* u6 L" d# ^% V" w
################################
7 t3 Y5 K8 A; q1 d& ^5 M- ^( ^##### Connection and Post ######
1 s. S3 X, r& N################################: b! J) V' H) a8 B: f6 h# \
$name = @$_POST['char'];
- m; ]: D: E$ T' @+ u$ItemName = @$_POST['item_name'];
7 M6 |& S6 s4 o8 h: \$ItemAmount = @$_POST['item_amount'];
3 F; p& z( b3 p$ItemId = @$_POST['item_id'];
1 ?! ]% ^8 D* \ W$ z2 w! r; U$ItemUpgrade = @$_POST['item_upgrade'];
9 M! |6 G/ M7 I3 J$ItemElement = @$_POST['item_element'];/ y F, \9 t7 r, ?
$ElementUpgrade = @$_POST['element_upgrade'];; P3 b* Z, w; m9 `$ \
$ItemPierce = @$_POST['item_pierce'];5 g3 U) S6 G3 i# ~/ @% F
################################7 C) f2 ~4 H8 V1 t/ p1 X
6 Z6 M! {) t7 [1 A$ q( `( o//Check both variables for empty value
( K4 d6 W) c% m6 K5 V/ L0 f! b, `8 m% R0 M1 i% S$ |, R+ {+ E2 T6 _
if (!empty($_POST['char'])){
. w- Z8 ~6 X/ b7 u8 u9 U$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
% C! l- z1 l. Q0 Z
# r8 ^) O2 \0 Am_szName = '{$name}'");
' }2 t- Q" t1 Pwhile ($row = mssql_fetch_object($find)){
( E! H& |6 O: wecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
8 N0 [, _8 ^* U4 B( u$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
1 n+ j! Y' x/ a3 I0 f+ i* C1 n, M. N: k1 x$ J+ G' r# @3 ?
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
; d- F8 t) k6 `5 [. L! o4 k) n4 i& d
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', + C* i. j/ m& M: D& H
4 z. c" {! P2 K% |: Q8 U
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
w2 B' k( T; @6 u x) Y$ v" c
/ {( B- P+ N" l1 Q. k'{$ElementUpgrade}', '{$ItemPierce}');");
F! @4 ]: Y3 y% q}- G+ C4 j9 a/ t+ O
3 P* t( l# ~& v' [) X0 Z4 U/ ^
}( Q; Z# \8 O2 M: A
5 J" l, p& V2 D
}
9 R W+ P* X( V& B! c2 I
% l; G. |& R( n* F: ?. p) z$InitForm = InitForm();: {( Y. U0 M s% w5 M& J
$Listener = PostListener();
0 Y0 P% B Y8 v
/ Y, r' M4 } B6 z8 P?>) N/ D( \& t. g+ `. r5 j0 V
# b# S- n* N% u5 Z% S
+ v$ o; b6 a% ^9 m8 \) s4 M6 Z
2 r# y: L2 [' f% F$ Z" I- ?4 @8 V3 d& |/ [
|
|