|
|
<?php
8 ?' U& l5 ?( a8 o$ P8 I, c% lfunction Connect () {' p# n' r% t' o
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
* H, ~9 d2 ?$ v/ F3 Y' p6 _1 D% r
Failed.');+ g0 H' i$ a) Z9 U* u
}8 D* r: B- B# V# N
Connect();& }) J2 ]9 b0 y& j8 _' G
x% o/ J* v: f- o. Yfunction InitForm(){
* ~( g1 f1 p8 [ X( @/ ^7 Q# C) s//layout for the form: @ d6 z. ^; W" j D& j5 G5 \
echo "<strong>Send Items.</strong>0 ]' j9 Q- b6 ^ F- ]6 t% `+ l% Q4 I
<form name='select' method='post'>
0 Z1 V4 t% e" a- `) b5 K<lable>Character Name</lable><br/>+ L# c% `4 o8 W- {1 r
<input type='text' name='char'/><br/>
; h4 f" P2 `- [<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
$ E' @2 c' Y% U5 g<input type='text' name='item_name'/><br/>: J3 [, Y/ ]) F) k, E( ^5 u
<lable>Item Amount</lable><br/>6 a l+ g% @8 H6 @4 l
<input type='text' name='item_amount'/><br/>
" q& G4 g4 ?6 E. Z2 U* ]<lable>Item Upgrade Amount</lable><br/>
3 y6 Y' N' a$ G7 I% H$ E<input type='text' name='item_upgrade'/><br/>
% t! K# k' G8 w d. E$ C0 p1 t: J. c<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. a+ G" p1 w) S! ^4 n) ]
4 M _+ i6 m0 n- ~- R% C' ?3 p# [</lable><br/>
: M& a# M# V9 ]3 q3 {: H. S& V. _<input type='text' name='item_element'/><br/>; ?! Z' h/ I0 F) {1 O2 U9 F
<lable>Element Upgrade Amount</lable><br/>8 z4 c3 X0 J( E* x( B. Q+ U9 H
<input type='text' name='element_upgrade'/><br/>
7 q! K8 m7 B/ E<lable>Pierced Amount</lable><br/>, l, _7 f2 }# w/ V2 j* k
<input type='text' name='item_pierce'/><br/>
; u& z; M% }8 v3 P<input type='submit'/>
' c; J1 q1 a4 P6 f</form>";
/ \& B7 n# L& N}
! b8 c+ `6 ^( ]+ s
5 k" K6 x( U+ T) }" pfunction PostListener (){
3 S6 g @$ _1 F" d3 Q//Add more post variables if needed and add them to initform() function aswell
: n4 k4 w; n7 i2 \
3 O7 c7 s% B& U. B, d3 t' W################################3 E& \. \/ D% N4 z! k0 \6 Q
##### Connection and Post ######
0 d6 ^, U- r9 U: \################################% g# z% W4 z8 z' ]* w
$name = @$_POST['char'];
) v; I$ @6 x) U8 A8 E$ItemName = @$_POST['item_name'];
& d# @9 h$ n1 J& T: ~$ItemAmount = @$_POST['item_amount']; S+ ^1 q0 r0 @) |
$ItemId = @$_POST['item_id'];; J6 _/ L, R# j+ H6 u8 [) d
$ItemUpgrade = @$_POST['item_upgrade'];, u0 H& o( B$ e0 h0 O4 d
$ItemElement = @$_POST['item_element'];
, t$ d( S9 U9 o( L: j; b# D$ElementUpgrade = @$_POST['element_upgrade'];2 A/ x! v* ?9 J( I- h! Q
$ItemPierce = @$_POST['item_pierce'];5 A6 n& Z) Q" \! g; W
################################
: O2 x4 _) j9 E$ N( J9 X2 }, P4 s% Z1 {
//Check both variables for empty value; v- q% t- g5 U& ?
8 X/ U0 s* L# C
if (!empty($_POST['char'])){
; e8 y2 B+ K! f) m+ D& r1 n o, X: K, w$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
2 U* [% K- ^+ l
& y* p- q2 n- N( S' U. Xm_szName = '{$name}'");
. u W( ?( d( @% ~1 n: w$ V/ d) Wwhile ($row = mssql_fetch_object($find)){
$ W& T7 _: c1 z3 fecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
6 |, O9 m- w+ V$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
8 l2 D- G, p( d2 S
! S9 j% n- K6 a: _$ Z0 E" v[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ; C; z# @2 }9 }) D/ u9 f+ E& C5 W
8 G( i* f* z+ N0 s! q[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ! U8 {) M3 C- P; [
- F* ^ r8 k. \: ]/ mN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 ^7 ?' H" Z8 O, R& k: v! {
, Z' C' F+ y) j9 |) u* X) G
'{$ElementUpgrade}', '{$ItemPierce}');");* `# h. h4 G! o9 P
}
. D9 F* _, u _ R( d* T% [( K) G* J# G' {) ~7 o
}
5 N+ n; l6 A( C+ }6 Z4 ]$ g ?. R8 [. u0 r1 o( \
}
5 u; z! k$ _% p$ d$ D# Y% c( y0 @2 x' T5 \; ^1 L7 f7 U
$InitForm = InitForm();6 Z: V- i: q: t
$Listener = PostListener();% n% q6 r; U1 G3 t6 B* J
6 T# q+ L w) N* O?>
- B( o% \2 i! H }# y
9 P2 O; @% e" C, G5 p5 P+ z3 G3 i3 S) i4 T
$ i9 o) X/ S5 E5 g. G7 u( f; N
7 k& Z# n. v) S D4 k; S9 ]) W |
|