|
|
<?php$ n. V/ a2 X( ~& u* r
function Connect () {
$ F2 s' w. ^0 Mmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# |* i P4 y# N/ m$ _5 B' U8 H1 i, I2 a, Q1 P
Failed.');
B& _4 P. _' r6 I4 l' q3 ~+ B}
0 I8 M( s% q4 `0 B" @Connect();6 d1 q2 T6 z+ C N9 R: F# P7 R
$ a/ H( Y% E# t# e0 _function InitForm(){% X, _, K# i' T. I2 i8 ^6 T
//layout for the form# E7 s/ F2 F6 ?9 h) M& m1 `
echo "<strong>Send Items.</strong>4 q$ z1 R3 j) a& t3 n8 q3 p4 j
<form name='select' method='post'>
. K& D* M3 S3 f% @; Q9 Z<lable>Character Name</lable><br/>
* q# n. X1 g4 s6 x4 }+ P<input type='text' name='char'/><br/>
& E K& S6 q/ v& g1 ]<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
* ]5 J6 k2 v' f5 a$ ~/ r<input type='text' name='item_name'/><br/>
s, q% j @2 E- v! A3 m<lable>Item Amount</lable><br/>* Q2 s4 S& _3 ^0 b/ C1 _2 B% x
<input type='text' name='item_amount'/><br/>1 k1 B4 W+ }: G( `8 h6 U" E
<lable>Item Upgrade Amount</lable><br/>7 i8 s4 s p( N. W
<input type='text' name='item_upgrade'/><br/>
`- r: _, r: [; |<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)2 h4 s4 H1 v+ a9 W! H
7 Y, d, s! [% s5 ]6 S5 g8 z
</lable><br/>
' V1 m" N1 t# X1 E/ u+ L6 I5 \<input type='text' name='item_element'/><br/>! Y8 k; a5 o5 V1 D8 F8 d8 D6 s
<lable>Element Upgrade Amount</lable><br/>
4 d0 q& c4 W3 c0 U6 q<input type='text' name='element_upgrade'/><br/>% }: R- S8 }' j; r, A! ^+ p
<lable>Pierced Amount</lable><br/>
# Y$ z, y2 ?5 P<input type='text' name='item_pierce'/><br/>
" B) A* V( Y6 [0 Y4 w<input type='submit'/>, e( w( {! [! y z
</form>";2 F. b( S/ a& _6 R; w
}5 |* b' h2 h: S, T; A! L6 ^" e
) p% j- g! N/ p# j1 ~& {
function PostListener (){
. ?3 [/ ]7 h4 x I7 g9 y% n' K6 ~//Add more post variables if needed and add them to initform() function aswell( \2 @* x" l4 y N7 B, z9 S
5 e+ g) f7 O+ f5 ~################################
( q% @, h4 e& K6 H/ Q7 U! {' V. z##### Connection and Post ####### o% }0 H/ A3 j: l9 T$ C' b
################################& P0 Q3 b# I. |% O, Z9 ]( L3 a
$name = @$_POST['char'];
' P, E; A' ?( A r H: ?3 g- n7 r$ItemName = @$_POST['item_name'];
9 B' l; D. j$ M1 _) ~6 J$ItemAmount = @$_POST['item_amount'];5 _# P# Z6 {, j% N9 d4 G. h4 O
$ItemId = @$_POST['item_id'];
4 p2 u, W- D- s7 ^2 T3 W* q! Z! _$ItemUpgrade = @$_POST['item_upgrade'];' K! ^' {! F9 h6 x2 v9 m
$ItemElement = @$_POST['item_element'];
% H ]/ a! B3 P( p$ElementUpgrade = @$_POST['element_upgrade'];
7 u j0 y: P J2 I$ItemPierce = @$_POST['item_pierce'];3 h$ |; z6 A7 o. u# X e+ A
################################
( @! q, S$ f/ v2 Q8 V9 p; M, l: W; _( w/ x: ]
//Check both variables for empty value5 b% i% R4 B" j0 r, O" f i
+ [' w3 g5 t0 t+ K7 n/ Jif (!empty($_POST['char'])){4 j$ r& _( G! e* A2 v
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
3 y, @8 X" H* N( B" d4 q
. L+ R' A0 ~+ r g- gm_szName = '{$name}'");
* y) D! N9 f, t5 g3 { Y! J( u8 N/ Fwhile ($row = mssql_fetch_object($find)){
3 f8 O2 \1 m4 x9 f3 [% a4 wecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
1 e+ y6 z: {8 e6 h2 i" g$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 4 d# \/ N3 D+ w/ c9 b; y) w/ ?
, A+ l# J T, {7 I[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], + d1 {3 m. q* }( T# a
4 d6 L( k, i8 N2 Z) X( u2 \; E[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : H5 g- T3 }) \2 m& C# K( |& @
8 d N* ^4 R2 q3 ? u2 b5 U
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', $ O5 K: e6 s- M( x( g
; X2 `) r) ]: G# R! Q% x; t
'{$ElementUpgrade}', '{$ItemPierce}');");
% ?/ V- n6 x8 v% L+ S6 Z! J}2 H$ K. |+ d- }6 j9 o
* `! Y) L/ v1 k; L6 `1 X. }}
P+ K+ K& U: E9 h" G: S) a8 l6 I0 p3 `
}6 I! u) s0 o9 n, v# s2 ~& d
8 e* z8 H$ j7 P$InitForm = InitForm(); t, r6 g* D( ] B: U
$Listener = PostListener();9 i2 F' L& G/ A
2 Y2 u9 ~/ G: d8 H' O, g8 N6 S7 y?>/ O, s1 `8 b6 V& V9 K7 i! c, R
6 ]9 ] t! t# j3 f8 h: I
( y$ k" ^8 D# v$ W) N; {* F
* r. _+ i8 R3 Y y" s+ E3 N, x
2 H% G l w) G/ F
|
|