|
|
<?php- ~/ `8 k- O) S1 P
function Connect () {
& q+ b0 l2 D) e" `; h6 Jmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 7 R1 k) k$ ~& G
9 N6 l5 Z" s' }# D" KFailed.');
8 C+ \& c3 J" K/ ~- e- X+ P}
* _7 D3 n l7 U' J6 X, b3 rConnect();
& U; g( ^" }. D0 c8 V
% O! ]1 f6 j1 Y, Q b4 Qfunction InitForm(){
, C; @! n$ n9 ^. v//layout for the form8 _$ k- R: z4 z, Z1 f
echo "<strong>Send Items.</strong>7 t! a0 a6 ~, D# r
<form name='select' method='post'>
' F G. Y. Y& n* K( t& Y<lable>Character Name</lable><br/>0 p, y$ p) |; Y* a% Q
<input type='text' name='char'/><br/>
- z2 V( k4 O- T<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 R/ f. s6 \& o! j% r- ]5 B6 @<input type='text' name='item_name'/><br/>
4 @# L* ~; G- U; u( {<lable>Item Amount</lable><br/>
3 M( x9 u a3 M) e [! _: G6 N<input type='text' name='item_amount'/><br/>
- J/ r2 P: V8 V' t8 k$ G4 \' ?$ V<lable>Item Upgrade Amount</lable><br/>3 ?- B u; L9 H, ]; C9 }) M
<input type='text' name='item_upgrade'/><br/> L t) ?; a% t( ]% F' N B
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)" e4 M& g! {/ D5 }) Z
: y4 \$ @( u% p' g/ t; s) q. Y0 k8 J: Z
</lable><br/> N; x) ? T' ?3 w* x/ i0 @- g
<input type='text' name='item_element'/><br/>
/ D$ @- P) ]8 M4 h9 G<lable>Element Upgrade Amount</lable><br/>
: O. h) |% _+ M<input type='text' name='element_upgrade'/><br/>( t, i5 l5 F. T5 b# U
<lable>Pierced Amount</lable><br/>
6 m5 ^6 d+ q, u& N z* t# ~<input type='text' name='item_pierce'/><br/>0 z7 \; h7 \; B8 O( n1 p- @- b: \4 l2 a
<input type='submit'/>6 u, l6 i0 s% [; f7 t5 |
</form>";) v# t' s& v- _( m, g
}
8 s* T; G$ `2 s1 c# V8 F I' I. O" p5 T: b
function PostListener (){
: l. [7 Z* x+ {8 G' q' I: \$ q2 o//Add more post variables if needed and add them to initform() function aswell
D( \) r; T, g+ P3 n$ N7 }' u
################################
4 K7 q- N7 `3 } P+ n3 q##### Connection and Post ######
' E& |/ Q' O$ o7 f################################1 P2 Z/ |" H: _) \
$name = @$_POST['char'];& L4 u8 x; Z) x/ t
$ItemName = @$_POST['item_name'];% f* G4 ~5 ~( i4 ]' i8 O( i
$ItemAmount = @$_POST['item_amount'];7 }: X/ T: ^+ [- J9 v
$ItemId = @$_POST['item_id'];( |! v, E& P8 C" L6 E7 j% R2 Z' m
$ItemUpgrade = @$_POST['item_upgrade'];
& f; N$ q% S8 u$ItemElement = @$_POST['item_element'];( K) E) H/ w, r" u" f/ I+ s
$ElementUpgrade = @$_POST['element_upgrade'];9 A8 e+ Y3 x: I. P% i
$ItemPierce = @$_POST['item_pierce'];+ J0 O/ c- x: j- j6 i/ w9 e3 R
################################
. j, T" J0 s7 G/ o* W7 K; h9 K) e8 W2 i* _# c
//Check both variables for empty value
& `! @+ y+ V; }- ?; ~) v
. t! D" L G Y Y' o7 s+ c2 ~8 Fif (!empty($_POST['char'])){
% @: G* e- i9 g% C- a$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
2 z- y% |7 v: Q( d7 z" p) q/ t
1 V( z S {, j$ \" m2 \m_szName = '{$name}'");4 W/ K7 T4 e h1 p% z
while ($row = mssql_fetch_object($find)){1 i: s5 Q6 U3 t2 [5 N) K% u$ [
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";- i- o5 \8 ]3 C o2 J
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], * z0 }2 a i) T' I- ?8 C# M, Y
x! h$ [! Z4 C2 c[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], : G9 ?9 F' }( Q5 C& _, X0 N, `& `; U3 E
* U2 E+ s% m* ~* {4 p
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 4 ^; \" W! o7 ]/ B6 K% ^
s& G+ D- L" L0 A$ R3 i. m
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
; A; |2 ?* A7 G8 r E/ S' W) d1 c$ ^
3 W9 ?) `- R' z" w0 Z1 J0 i- O5 S'{$ElementUpgrade}', '{$ItemPierce}');");4 i4 `8 P& x) a) m# N3 _' T. Q9 n7 b
}
' l$ l; W5 }3 ~; r, A: o2 f2 y- S) p( z, q1 _
}: ^2 a) w9 B N4 M) t6 j
* t* r- }: ^: C9 f$ B
}3 `3 v0 b9 e) u* i. G0 Z' q
8 M+ k9 i/ s1 d8 v$InitForm = InitForm();
# L! E5 u1 G0 ^ W$Listener = PostListener();
5 r& ?" P7 u4 @7 j% C) [" @! G0 E7 U
?>
j: ^. `+ l$ W- H$ m6 l, X
; Q) f/ y, u% a+ g0 z/ C
3 K5 r4 d. x1 d, C" E7 Y4 s; E) {. |1 u4 s1 Y: E6 |5 n
& C' M1 S: L4 g1 A
|
|