|
<?php' j: a/ r8 ^& w
function Connect () {3 I3 U; x' w; c" R
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
: o3 o6 X+ ^: X) w: ?/ j( J* n# S5 r' L0 t* `
Failed.');
* q- l7 w o' ~) e2 T! Z+ m& [} B2 V+ g) G: o& e
Connect();
" T4 v: i; W& |* F! w
- `4 G' C' J9 I1 W# h' p0 B* Hfunction InitForm(){
8 I1 P8 Q! w% a( `//layout for the form3 Z- Y" J3 ^6 s2 _8 o( ^ {% M$ y
echo "<strong>Send Items.</strong>
( A. Y4 z* i8 Y9 b' D, l<form name='select' method='post'>* `9 Z' r9 l; f. |* ?) W
<lable>Character Name</lable><br/>- @$ o0 o8 }+ n. G
<input type='text' name='char'/><br/>
$ Y: t# ^& F* H7 O8 U9 r<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
8 a ^4 c8 u/ j% s& X$ i# {5 H<input type='text' name='item_name'/><br/>
9 Y6 e l% ?. r8 w<lable>Item Amount</lable><br/>
- ^3 ^% Q5 k$ s<input type='text' name='item_amount'/><br/>: m, J& J0 O% q y+ i% R
<lable>Item Upgrade Amount</lable><br/>
( u: l' H/ c- x. V5 S<input type='text' name='item_upgrade'/><br/># P5 c" R' v! I& J9 F
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
" f; n$ n4 t% z6 h$ f
6 b5 D& s' A2 n3 Q9 ?$ y( r' C</lable><br/>
( ~* f8 s- m$ H; R0 S<input type='text' name='item_element'/><br/>+ S( }% B, V$ l. D
<lable>Element Upgrade Amount</lable><br/>; a; f) F3 l8 q5 i2 W z
<input type='text' name='element_upgrade'/><br/>: }0 c3 i1 h3 E, K
<lable>Pierced Amount</lable><br/>8 i! K7 {% H( w% K$ |$ V
<input type='text' name='item_pierce'/><br/>+ u2 W# H1 B& t! r' y
<input type='submit'/>6 l( W' u$ l g) K
</form>";; W2 v7 k F6 ?# R4 f# z# {
}/ b8 N2 H r+ A# K5 m% Y
: _; Q9 l% N. R9 Q: q) l
function PostListener (){
5 R0 L0 o) Q' C0 c//Add more post variables if needed and add them to initform() function aswell
5 P. d3 k" b! k
( ^) M) I9 `% E8 J% n% b/ I, E################################$ @) N0 W6 f! B' N9 _3 \% ^
##### Connection and Post ######
( N* s4 R; {- K9 f- i$ _8 B################################
2 @) S5 V$ L8 y. S, \/ M$name = @$_POST['char'];% s7 I& a* O2 V0 f
$ItemName = @$_POST['item_name'];
3 j2 P8 m; x* ~$ItemAmount = @$_POST['item_amount']; \8 u7 `8 n4 v- ~- M
$ItemId = @$_POST['item_id'];$ z; I! I6 i" O, ~# n% s
$ItemUpgrade = @$_POST['item_upgrade'];
+ G% ^; ?7 B0 s8 J6 S- q0 p* H" Y$ItemElement = @$_POST['item_element'];
( l2 Y: f" p' r# h. x2 G$ElementUpgrade = @$_POST['element_upgrade'];
. K6 P1 R9 {7 X4 u3 b5 j4 L$ItemPierce = @$_POST['item_pierce'];
+ \; @+ z# ~" Y+ A; `8 K################################
4 ~& x; m; e- B* n
% i0 ]7 o/ r' n//Check both variables for empty value( r7 l, ]2 h1 i+ s
+ d( r& K' D- Y% o5 H4 C: Eif (!empty($_POST['char'])){! x/ t7 f: \1 M2 A
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where & b5 A5 ~- K* t+ X# x
# n$ q( }7 j# s* s6 u4 _: M
m_szName = '{$name}'");
. E. z8 v" V( v0 O, zwhile ($row = mssql_fetch_object($find)){5 K0 Y" _" y A: V. W1 [, b! t: D
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
2 b. H. I6 B+ [/ X$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], , f, g: C, Q6 ^8 \
) T2 K# r, ~8 ?% W7 n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 8 C, v! q3 B+ \: | M
- S+ q) s' i4 y* _. n[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', . g0 B6 @7 y X2 N1 s/ y8 j! c. }
4 C: C/ l9 X# E+ bN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
* g3 k- T; A) z n
7 R0 w5 X% p+ C/ I5 k: {'{$ElementUpgrade}', '{$ItemPierce}');");; \( k9 T2 r& q; \
}+ T$ C) m& f! i! `% [4 ~; C
# t3 T/ O, I: v L! Z+ w
}' H! K& e9 a: H8 i+ n% V
0 ?' \, L$ x' { S4 Y0 R
}- H: B# I) k! c8 P# k2 |' `
& e# c8 [9 R/ K. B6 ~$InitForm = InitForm();
( T+ r) E) e; m! b$Listener = PostListener();
6 O' J! r! w7 I$ [# Y! b" \
0 I/ l8 x. x) |) X?>
, [* D( Y$ M6 b, n$ T3 L" \
, E$ P2 v0 d0 O% ?3 ^" i+ H
8 W5 V; M* k) l8 h; K* V0 }
$ W/ p1 b# N4 D0 t# x; g- t5 i8 {$ \' g6 F0 a5 K: r- j; H
|
|