|
|
<?php7 l+ k1 u$ I& h9 u$ l6 s
function Connect () {
, n2 z E2 P2 Q# |mssql_connect('Server','UserName','Password') or die('Error: Connection to DB * e4 C& H2 g9 K5 k
0 |7 z5 }) m9 ^+ z5 q& ?" x6 n* ~
Failed.');! ~3 [4 |: f4 r2 C
}
6 R$ T* j5 o3 h. e8 ^! ]Connect();
- ]% O/ i. l# U {7 v% p
$ N# n9 V- V) c! i" @: z: m$ U! y. Bfunction InitForm(){
% M) [' [7 R3 a; {//layout for the form
9 a b; M6 |$ C8 x3 z, A7 w1 lecho "<strong>Send Items.</strong>
0 m( c( P6 d% O. M9 P( {<form name='select' method='post'>4 I% U' o5 {$ l& n" n T2 B
<lable>Character Name</lable><br/>
; S5 A, T8 |8 H4 x3 j* O4 Y$ ~<input type='text' name='char'/><br/>( c0 G5 P4 c t4 T0 B
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>7 u$ m% ^3 L; i6 z4 S6 }
<input type='text' name='item_name'/><br/>
2 E. d5 J6 [, I- y! q3 b) z1 {8 ^<lable>Item Amount</lable><br/> ?- M' W" [6 {8 O
<input type='text' name='item_amount'/><br/>! X, R+ W, G; x! w* ^3 L
<lable>Item Upgrade Amount</lable><br/>
+ J$ y% f+ V& Y" {* ]! q( U" _. G<input type='text' name='item_upgrade'/><br/>+ g% B3 l8 _, f" _- w
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)* P u1 O/ N# V' p" J
+ j& X: \3 g6 k; q</lable><br/>
8 M1 S0 A3 e8 S; | o<input type='text' name='item_element'/><br/>
# L) u$ d, H. S8 h<lable>Element Upgrade Amount</lable><br/>
3 |1 L) `+ \9 k2 ^0 i1 L<input type='text' name='element_upgrade'/><br/>/ P6 ], }# G0 s D" V. C
<lable>Pierced Amount</lable><br/>
7 g. ~- a% y; z<input type='text' name='item_pierce'/><br/>
) A7 B K% |9 G<input type='submit'/>' {2 A$ I( x7 s1 V0 O, b
</form>";7 }2 z* ^+ K9 _3 b
}) D; s' D f9 J/ `% g) O4 ?9 S- w
% n( u& K+ \4 f; }! [
function PostListener (){
`, N; r+ d* ]//Add more post variables if needed and add them to initform() function aswell! F4 E5 ?$ G7 ~, A1 M- H8 m
W' L% p$ K" V* c$ d
################################2 y5 G1 B- Y; e- ~5 r7 J* C
##### Connection and Post ######
3 H0 [! D$ D; D% @################################
3 y" \* Y9 H) ?0 |* ~: @" h$name = @$_POST['char'];7 B0 }& h+ S" P# H$ @9 q( Z
$ItemName = @$_POST['item_name'];# L% n( m7 s1 W) ?' l
$ItemAmount = @$_POST['item_amount'];, N' { P" C: }* \
$ItemId = @$_POST['item_id'];! g$ w7 K# h. a6 R$ I: f
$ItemUpgrade = @$_POST['item_upgrade'];
7 K }: G; c( w" w$ h$ y; U5 `$ItemElement = @$_POST['item_element'];3 [( |7 I) ?" E W. J% ]& }8 R
$ElementUpgrade = @$_POST['element_upgrade'];2 P' z2 }: x% g$ m$ H2 Q# \
$ItemPierce = @$_POST['item_pierce'];9 d5 H p; m) |- q" N
################################$ R: G& d# N' `
+ W! x. [1 ~; X/ [" X
//Check both variables for empty value
" N) m3 @0 K% u6 L% f( e4 f- J2 K! d0 c- H$ B5 s \' T3 t
if (!empty($_POST['char'])){4 z; E( P5 p( o0 O; j" E! C P6 Q
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 z$ Y; O, l3 L4 c* I0 g1 v
i2 Y( F- X0 C$ I, I+ m: M* y( E) Am_szName = '{$name}'");
1 D. Z w- a; s2 S2 @4 t! Rwhile ($row = mssql_fetch_object($find)){3 x, c' S, G3 i( U3 u
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";; d b, p& k: Z
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
& |3 T+ \/ o# V& ^& {/ p8 t8 I* [3 \, i. J: N$ Z
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], $ q; x5 _) N5 o' D4 L& ^7 Q* _4 V# H
) X: L" O* V2 i3 {[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; i8 v: i' O* S7 D. ~3 H" i( W
8 g3 F" X6 y0 e; h/ H4 Y0 j6 qN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
4 C3 Z1 |2 a$ T" q( @6 s/ [% y/ z9 k4 u
'{$ElementUpgrade}', '{$ItemPierce}');");0 n0 n0 e- J5 o) Q# o* R8 L! x P
}1 Q# n! h/ R/ u* G; {1 s6 Z
9 V# g9 ?+ Q/ R! L8 h
}
1 c* V a: r* X5 L8 C
. l& v$ }$ S$ n+ `# n}7 f! D+ K% ~. o" `+ A) g
0 J. C* M% M0 N, }7 _
$InitForm = InitForm();+ S: E4 a' ^' ]: j. w, u ~
$Listener = PostListener();6 F! s( I, b( h( p0 c. B- W# \
T1 |7 Q, l( R2 B+ J?>* z- }# u# ]9 X5 l7 [
* p7 Q1 d# z( d8 X% k: N( v+ J
" l/ l& e# K' g( s. `/ B0 |. i# ?; u$ N3 j4 t- D& c
. A1 i. Q N1 y- ^5 p$ ~2 N; u6 `
|
|