|
|
<?php- p ?' C+ n; C% Q3 H+ ]
function Connect () {
: B/ t9 I1 r1 @; a0 hmssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) x6 P+ M( P1 ]* G R( u
4 H# ^; V0 ~6 V/ E1 a: ?9 q* |7 ~* v' aFailed.');" }) h2 e, F& k' m2 P7 R
}
) _9 |6 _. d% `; C2 [Connect();
1 q. F! D( _- [0 P% D1 c3 p1 m6 m7 h
function InitForm(){' \0 `; D% m0 R' O( v+ U
//layout for the form
, H, M* h$ F/ m# E- P$ Mecho "<strong>Send Items.</strong>2 J' u3 I/ w9 Q0 C" L( F0 B
<form name='select' method='post'>
+ w$ ~% t% F8 u" h* c4 K<lable>Character Name</lable><br/>% R! q: h, i: U
<input type='text' name='char'/><br/>$ q- b0 t1 \! L0 [: Q4 B/ d( G+ s
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>, M# d, B* k0 w% X
<input type='text' name='item_name'/><br/>, P. T7 a; ]' Z' z# l/ L; ]
<lable>Item Amount</lable><br/>5 B2 F- E9 @/ i7 y; Y
<input type='text' name='item_amount'/><br/>) j0 d$ h; B1 k& M8 b; G. `
<lable>Item Upgrade Amount</lable><br/> q" l1 u& s, ^8 L' M1 h3 W4 w6 R
<input type='text' name='item_upgrade'/><br/>9 d0 Z+ }, A8 b
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)3 Y3 B/ ? P/ `9 ?8 f
6 Y) r$ L% E3 t7 S( h
</lable><br/>
8 c2 S5 ?' J" e% B' D<input type='text' name='item_element'/><br/>: U' l3 I2 \- k1 {- t3 P0 s( a
<lable>Element Upgrade Amount</lable><br/>8 D5 c7 Y+ r) ?
<input type='text' name='element_upgrade'/><br/>$ s% j5 r$ A: w ^/ B' h* O" b% x
<lable>Pierced Amount</lable><br/>( f" }4 j* Y0 a
<input type='text' name='item_pierce'/><br/>
' _. |* U$ z% l<input type='submit'/>) `" S1 @ G+ i4 U: M! E& P: s
</form>";0 v# S2 a; v3 }
}" T* }. n9 \$ y* }; x2 u
* X6 A+ c% `; G cfunction PostListener (){1 q# N* i' g0 L6 Q) R& u* n
//Add more post variables if needed and add them to initform() function aswell' {5 f" A3 n) b. I! y4 [7 O
& N0 Y8 x$ x5 [2 u0 V" {, d' w################################
v6 e5 N H$ l& i' L- }0 w( X5 ^##### Connection and Post ######
+ L0 H; n2 p! e' R################################3 P" z4 C3 v' K" H9 e! V) [( c
$name = @$_POST['char'];
; p, D+ F9 {: S* c$ItemName = @$_POST['item_name']; h8 m) p* {4 w1 h3 {+ d6 h9 a
$ItemAmount = @$_POST['item_amount'];
* H( ^; R' B7 c8 \$ItemId = @$_POST['item_id'];
: @, ?0 x0 S% f8 L$ItemUpgrade = @$_POST['item_upgrade'];6 _$ [# ~% l- y8 w9 X, @* d# W
$ItemElement = @$_POST['item_element'];
3 \, ]2 o" d) c0 F6 L% @$ElementUpgrade = @$_POST['element_upgrade'];3 N2 D! n+ \/ C% H
$ItemPierce = @$_POST['item_pierce'];# k& d2 [; g: U- X" a8 P
################################
3 v5 w5 o+ o# _9 W* a/ }
; D3 @/ Q0 C9 I. M N0 P( {6 B//Check both variables for empty value" N& w1 o( ?$ V5 I! y
7 y) h6 Q4 n( `7 Q0 g1 o
if (!empty($_POST['char'])){* `& |/ w4 K& S, y
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where & p4 x1 Q: r' Q' M: N! t5 ^
) }- ^- R0 c8 E, T/ o9 N
m_szName = '{$name}'");
6 C" ?; ?% E& |1 q( `while ($row = mssql_fetch_object($find)){0 x! Q4 i- a# y0 M% H
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% P* [+ V! i5 ^% U/ e! U
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ! U4 j3 c% f# Z1 q5 p+ e
" i0 w2 R9 ]: Q( D# P+ F
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], $ S' c( R) s9 k- ]+ E, o
) m) S- z- H4 L7 P
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
/ n& k6 f! C8 T6 B0 q p7 m6 m2 X) T! k1 y5 F5 ~( o" \4 f
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 7 c+ H3 M* |5 C
& f7 j; f3 z- n5 E/ o
'{$ElementUpgrade}', '{$ItemPierce}');");
( X' |% i# ?# b1 L% N/ ~3 k}6 I9 Y0 \$ T- H: u) K1 ?
) j' h. \- W8 Y0 H9 a- ]! ^
}2 j2 b* |+ a) h& G: A) K) V
& R5 H6 t: s" D, C
}
V- E6 n( a) [+ x8 W0 E
% U4 |' D; H) @; T; G$InitForm = InitForm();
9 t1 u: \" s& F, ?5 C" f" L$Listener = PostListener();& _& ^9 h& D- V# O) L# \$ C D
6 m3 x4 C/ R4 j/ ^% v' |( G" B; J0 `
?>9 x: b: I- ^4 U' Z
6 _6 o p- G5 L( J( W# | s
! C: D" R, ~1 ^. U9 J, z
' r' L) O9 j# d. M* M+ O" P( Q# V( V" J6 }% N! k+ z m6 x# i; Z
|
|