|
|
<?php$ D' y5 ^2 j& s* s$ l; U( x5 Q- u
function Connect () {
8 I7 {1 {4 b& U6 Q* h/ r! y3 Qmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
( F/ U7 d3 t% z8 m# w& w+ O4 t& {: {4 @$ k
Failed.');
2 B- I! ]+ b3 T6 B}$ M: P0 _- n& f3 O5 \. [. O5 y
Connect();
! r e8 d3 v6 M& I' ~- N
) C; r! j9 I( T8 Ofunction InitForm(){% ~$ i, X' o! o6 e! W0 j$ d1 |% d A
//layout for the form/ n5 |3 i! X& N9 `1 }0 V
echo "<strong>Send Items.</strong>
$ B( w7 U3 q' ?5 h, e* G4 Q<form name='select' method='post'>. X9 g# r9 Q4 Z/ @* l
<lable>Character Name</lable><br/>
; O; _7 V9 t+ @<input type='text' name='char'/><br/>, Q2 i: T4 I ]8 o& c3 ^+ Z8 {$ l
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/># D) ?" P2 B% h; v
<input type='text' name='item_name'/><br/>
: g- }# G3 Q9 }. i<lable>Item Amount</lable><br/>
5 h) W4 Z- E! q2 a! N+ A<input type='text' name='item_amount'/><br/>- m4 V5 V9 U+ J# Y+ Z+ O/ |, b, a
<lable>Item Upgrade Amount</lable><br/>
2 f6 J) ?, G" f# u<input type='text' name='item_upgrade'/><br/>
: [; U0 B, \5 F, O<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)# x8 \0 V# ` B
' K# {$ f. g5 r( s: T6 F# V
</lable><br/>9 a# [, Z! K* N3 I9 K4 G- c, A" z
<input type='text' name='item_element'/><br/>6 W4 U7 _% J" ^5 ?
<lable>Element Upgrade Amount</lable><br/>
. v- w: z; p& J<input type='text' name='element_upgrade'/><br/>
& P4 O0 _! p) N1 T; D<lable>Pierced Amount</lable><br/>: z9 V0 I( O6 D/ z( \/ k
<input type='text' name='item_pierce'/><br/>
5 I! J: p) ^$ x. C<input type='submit'/>1 ^; L9 o/ c# \
</form>";
7 \ T9 ]5 B5 V/ M" ^: Q}/ Q+ b% D- `( ^2 W
- A9 z8 z3 n8 M, w7 C
function PostListener (){4 x" a2 T: l" T
//Add more post variables if needed and add them to initform() function aswell1 L: q& X2 B" P
( ?) q% W4 B k( F9 E8 [
################################
; ?+ I) V4 f: @. J+ \$ d: J# L##### Connection and Post ######* F, ~7 z! k: h: {5 Y
################################* Z" H+ v- o3 D, z
$name = @$_POST['char']; G" ?! @# A: P& g& V
$ItemName = @$_POST['item_name'];. M3 R, U' ]2 E* s8 [1 x2 Y6 O
$ItemAmount = @$_POST['item_amount'];
9 O3 ^" o9 W4 v$ItemId = @$_POST['item_id'];7 j0 r5 q1 {0 n. Y$ w
$ItemUpgrade = @$_POST['item_upgrade'];
, K$ a: t" P7 j, e, o2 A$ItemElement = @$_POST['item_element'];
/ s' m6 K" u, _: c3 t$ElementUpgrade = @$_POST['element_upgrade'];: A1 j- m! c! k; A% F# y
$ItemPierce = @$_POST['item_pierce'];
0 R, `+ o' k7 H################################) ~# F3 V. t# w( Y6 ]
* P1 y: d# r2 g! h" a
//Check both variables for empty value' t F0 Y8 Z3 A$ c* Z% o
; I* X! N# t# E, r( ]' j
if (!empty($_POST['char'])){
; n! Y1 V g% i; q- S$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
/ Z4 [# S( ?$ A2 y6 L" k( u3 [9 W" F( q% J
m_szName = '{$name}'");& r5 _0 t: A9 V: \ x% ^% b
while ($row = mssql_fetch_object($find)){1 B* H: X( C( U& u/ \* F9 U: D& ~0 }
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";( O2 `8 I0 F- f, u( t" t" T& F
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 3 _! \/ O" @- P0 q
$ _6 N2 {4 X! c! h1 ~( k& n
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
$ q/ X) d% O, Q% M5 A1 C+ p8 B9 Y: C
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', $ |/ R& Y7 ]9 J6 }' h( f# B" N
+ h; ]8 a7 y& M+ K" E1 iN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' g: g$ C2 w: U% h5 l6 a
+ [, V2 F6 g& y. ]) i( J. P1 s6 u' z'{$ElementUpgrade}', '{$ItemPierce}');");$ V' g/ _6 x w( r' t# ^. `
}
5 R/ {: b$ b! }3 t% ~* j$ t) k( u" B2 E' c* J( y2 _8 d
}1 b0 y$ q0 u, e1 d% h; n
" z- M- h0 T7 T* a& m' ?}
% Q+ a/ Z) q j/ k- f& Q0 s; r9 W" N* ~9 x. [* g5 c
$InitForm = InitForm();
& f9 m" e5 \: Z3 z+ i7 s$Listener = PostListener();8 E7 F; ?- ^1 n$ [; W8 I9 _5 B+ ]+ j
1 X, m# ]4 `. t?>2 b+ C8 r' J! l1 [* W! F5 `
- G6 K8 ^; i. N1 i
$ N! T" ?* W( J# r6 R' ^
% t6 P) t2 e- j( }7 s7 t
" J7 N8 U( L @8 B* h
|
|