|
<?php) D X& s- _$ m' }4 W1 _: n
function Connect () {
; ?2 n, z2 s3 k. }( ~& U5 j# cmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
. @7 G1 w0 o) X, d0 s
+ Z% ?2 }$ h/ p7 D- xFailed.');
1 |$ Z' V) N& U: Y% M}
+ w- u' ^4 ?3 pConnect();. j- n1 @. h# u+ G
' O3 T5 T# m; Z3 z9 y$ f2 s) o( Wfunction InitForm(){) q) `4 r9 I5 O( N1 z$ i
//layout for the form
* w' Q/ [: i( Q; m6 U9 O- k3 s3 Gecho "<strong>Send Items.</strong> I; z+ x1 I$ K' Y& q) r; o$ w
<form name='select' method='post'>
( {' }3 }! Q2 B8 i7 e$ c<lable>Character Name</lable><br/>+ A2 {8 H* {3 J# M3 f4 U
<input type='text' name='char'/><br/>4 X$ ]# D1 N9 ?, z& a3 |5 O
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
; d1 {+ I+ H. Y0 o<input type='text' name='item_name'/><br/>
$ B3 Z4 k* h: h/ b8 k<lable>Item Amount</lable><br/>, {7 s% B E3 p" u4 G
<input type='text' name='item_amount'/><br/>2 V2 k8 D% m5 T9 o: y
<lable>Item Upgrade Amount</lable><br/>
- l7 f4 J/ s p/ v# D6 w<input type='text' name='item_upgrade'/><br/>
$ m+ N/ @" G2 k<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.); D4 w7 ^* R: w3 m4 U% ~) K$ Q5 w
5 U3 z( U; U. l' }1 I
</lable><br/>
7 y7 Y, d- X1 O, R<input type='text' name='item_element'/><br/>& [- c: E* ~, l* S j
<lable>Element Upgrade Amount</lable><br/>
; O f6 `; [2 K) z8 L% `& q( C<input type='text' name='element_upgrade'/><br/>
/ V( a2 c1 K4 n) R7 C D<lable>Pierced Amount</lable><br/>1 v5 ]- J a" b" h( p
<input type='text' name='item_pierce'/><br/>9 n/ v: C% B) }; X. z# ?5 k$ m. X) f
<input type='submit'/>
' X \7 N# C* T1 X& y</form>";
# \8 A- x3 J" C. Y/ Y}0 n. d2 ?* c \8 I) y( T# _
" C8 @$ o! Q% i
function PostListener (){' a4 g$ v2 k1 a0 ?; `" K: W# Y
//Add more post variables if needed and add them to initform() function aswell$ s1 U; e m5 Y+ c
- z' E# l2 c# {- l) w" R# y; p
################################1 O- J( L( @8 o+ Y) `, e
##### Connection and Post ######
( a- h z: Q7 R! v. v l0 ?################################
7 X! E; ]6 |$ `. i8 g: e: Q$name = @$_POST['char'];# Z5 q+ w, \+ H# g9 p6 T2 B
$ItemName = @$_POST['item_name'];$ ]. L, L9 T ?, |
$ItemAmount = @$_POST['item_amount'];- G( u; z' g( Y6 B8 G: t ]: Z
$ItemId = @$_POST['item_id'];
! V1 n* ?+ p; |5 K" b0 N$ItemUpgrade = @$_POST['item_upgrade'];$ L& X( b% j) i7 o
$ItemElement = @$_POST['item_element'];' v$ C$ i- j( U
$ElementUpgrade = @$_POST['element_upgrade'];
9 Z4 `: F5 e8 R* j4 j8 A3 q4 C v$ItemPierce = @$_POST['item_pierce'];& H+ ]! l4 ?) W3 K w
################################
; t: @" [( s- g; g1 t% x! k
0 R3 X" X& z( I- m; U//Check both variables for empty value
' F" N4 }7 z# q/ z$ h
# M8 W" P9 R9 [if (!empty($_POST['char'])){
; v9 Q! L; F, m) h" }$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, c) P" [* V* u4 T: w u8 R5 d. h% d9 J; _, M7 ~. g8 ^7 j6 u
m_szName = '{$name}'");
V3 }1 S! }! |, A. dwhile ($row = mssql_fetch_object($find)){
5 P# V. V! P; Yecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
+ q$ \# R8 Z; Y. O$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" U' E4 h- U3 @) J7 @' x. K: w; L8 y* i0 u
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ! i/ B9 U* A5 H8 U( O& |. P+ V
4 p E, y5 J2 k' W# Z# R
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
2 ]) H1 J# ~0 N1 i; E0 W& m& p- f) r+ L6 D
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
! p$ b+ S& Z+ `+ H2 L& {& L/ w- x0 D! Y+ G+ W7 _& e& o
'{$ElementUpgrade}', '{$ItemPierce}');");* k) O: X8 C5 I x9 f, E5 i
}# o1 `2 F% S, N8 e9 c( E
( w; w: w) o8 t! ?1 G; D Y}2 i7 u* M, u' C0 U
: T9 y% w0 q0 g' ^}( D! x) L: r/ Z H; a, [. a
& k7 H, E! S/ p& V/ U
$InitForm = InitForm();
- b" ?6 p3 A4 w$Listener = PostListener();4 Z5 n8 k' e$ f& q f# n! P$ @2 E
5 v" ~* d; Y. f8 F
?>
& z7 S( W- }) ]3 |8 T/ V d
V; S) Y8 q: K' B( l# C
! n7 f9 i; Z `2 S5 n, J9 l7 @8 g
4 |! n$ r5 m( z4 U6 s& T( A3 y* |
|
|