|
|
<?php- C, t1 l2 C! l) g
function Connect () {+ h) g+ {" F' \: p h. B
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 1 [1 S, Q4 [. H
4 C& u. G/ g/ u- W6 P. L5 h l
Failed.');
, R8 p* G! a) G) g- F}$ a3 I- Q/ y$ G1 J4 x0 K, Q0 y
Connect();
/ Z, B7 B5 w$ u d3 U* b( t- \1 |) W% k1 }8 W- c" E7 [
function InitForm(){ R) D0 ?4 V' {5 B* H2 }
//layout for the form
& b4 ?. Z7 ]/ g' Secho "<strong>Send Items.</strong>
& i( |0 j4 s) J$ E3 i' `# }! v<form name='select' method='post'>' d; l5 l, @7 I3 d5 Y
<lable>Character Name</lable><br/>
R$ }. C& U8 i" |& y" e" h<input type='text' name='char'/><br/>" G2 B. V2 ]; q
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
* U- p9 N" s& X4 m: |$ L8 C<input type='text' name='item_name'/><br/>
& V) H* C( Q! a# G7 t: j& n<lable>Item Amount</lable><br/>+ i1 s# q1 J, g1 _, ~( L5 {
<input type='text' name='item_amount'/><br/>
v& Z* w, n8 |( v* x+ Q<lable>Item Upgrade Amount</lable><br/>% j9 m5 Y/ M, u3 W0 ^; J0 G
<input type='text' name='item_upgrade'/><br/>
4 m" Z. ?" L6 I& S<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
8 _: z2 x, b& `& y& b" {; l1 \
9 Y* Y4 M# I) O6 k. ?- n0 E</lable><br/>! A: G, T$ A( J0 ]# C- [
<input type='text' name='item_element'/><br/>3 U5 i, ^! n- z) o" M/ c7 [8 h( n6 R
<lable>Element Upgrade Amount</lable><br/>- i: z3 t4 B7 M& s% ~
<input type='text' name='element_upgrade'/><br/>. `. v3 q' [, _5 d" ^; ?. r
<lable>Pierced Amount</lable><br/>7 n! s! o4 |. m6 u
<input type='text' name='item_pierce'/><br/>9 A* D+ c% V4 |7 n/ {
<input type='submit'/>" q# @% F# W/ \- \0 Q
</form>";9 D1 T' Y7 ]6 x( G/ P
}
) c+ `' J s6 D! r M+ c6 L. K- G( Z2 L; C7 H% F% g
function PostListener (){' p- A+ P3 j/ w2 l. E
//Add more post variables if needed and add them to initform() function aswell
" N( s1 U( u* [1 O
0 V! j0 c A3 x/ e: W5 I% n################################. k d5 Q/ C/ o# h
##### Connection and Post ######4 [* M8 F- t7 z* I/ p
################################
' ~7 {' \ {: O( O, P3 Y9 {9 {$name = @$_POST['char'];* d8 U) U0 U; _' m! y6 {! G" _
$ItemName = @$_POST['item_name'];3 s) q+ T m: ~
$ItemAmount = @$_POST['item_amount'];
0 B2 g1 b2 s4 k4 Q0 y$ItemId = @$_POST['item_id'];
( V1 J( K3 b% [: p. a! l$ItemUpgrade = @$_POST['item_upgrade'];
2 K/ }! h1 Y2 |( E b: I& f' Y* [8 N$ItemElement = @$_POST['item_element'];# i" h6 r0 R' @: x8 u: {, y
$ElementUpgrade = @$_POST['element_upgrade'];
8 c0 V8 v% C4 F9 L$ItemPierce = @$_POST['item_pierce'];
4 g, f9 F# Z {+ A- M3 J' I################################; U* i0 A0 [6 }7 t& \% ]
: O, Y- _$ q& n//Check both variables for empty value( [' z9 t/ P. N$ K3 C9 c% v9 P
8 K$ L3 {% X/ m5 K
if (!empty($_POST['char'])){
: x8 `. s0 F9 E! |0 ]: r$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
. ~( x3 r' C [, K- T3 B/ K
1 c( ^$ w! \, @; k+ dm_szName = '{$name}'");! j. H) ^; d* ?6 Z2 w2 f$ ?* \
while ($row = mssql_fetch_object($find)){
/ w3 o, y0 ^7 `2 F- p& r/ Xecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";! G! `7 Y& J) i- }7 Y
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], - K2 F0 _6 r; r3 F1 Y
! T' q# J' p5 Q8 H% V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ! r3 q ~$ q6 |; j% Z0 l# Q
- T3 m7 \& F8 v" H1 r1 L$ P[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : z+ b, w% p. i
/ n9 g3 g% E/ V2 B
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', % l) U% ?' `1 M' t, d
. }! t3 E# H4 E8 n8 O+ h'{$ElementUpgrade}', '{$ItemPierce}');");; r$ z& n3 v2 U& X
}
3 W( k5 s* K/ a
2 a; {- M0 |6 N7 K+ i5 f}3 I* d# W8 W/ |0 Z
) H& ~. X" l( P- K6 ]
} k8 v* j- H) ^, D
5 e! Y( q2 _: \+ |' G$InitForm = InitForm();
% O% S$ |- K! i$Listener = PostListener();
: M7 u! W9 Z7 O: U% B# [$ y
2 ]3 x( a* \6 h. t?> q2 i, y) J. O2 s
0 ?/ T- b1 x* W* h8 g
0 I2 T7 b( @5 v& O) z L; E& g2 I) f6 R1 r9 X- ]2 @
4 N2 c5 f6 N1 b9 R9 M. E |
|