|
|
<?php
: T! {# ?4 f* H7 n- Sfunction Connect () {
# e) E' J: M( K5 Vmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
* W+ G$ j9 [7 E+ g" U+ B8 P: l$ e1 H. Q0 q9 D" e- l. v, j
Failed.');( M' l) Q# u5 c. e% {
}
. v c0 R9 N% e% ~2 S/ ?+ W$ ^Connect();
" V# z3 K7 z4 q6 T3 u1 L# c$ g+ `8 [. n6 i; g- P1 f
function InitForm(){
) W, m1 v! @& y; b& B' D5 _//layout for the form
5 Y4 h3 l9 U5 Cecho "<strong>Send Items.</strong>
% t' Y0 a6 ?- C( w5 L* S% J3 ^9 |* w. L<form name='select' method='post'>
- S& d* \, Q3 ~$ @ h<lable>Character Name</lable><br/>
+ G( V# v9 B8 |<input type='text' name='char'/><br/>
/ b4 g$ ~" w0 _# ?9 K! u& c0 o<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
; z& z9 B- M+ f, t<input type='text' name='item_name'/><br/>$ W* h ^! _% t+ s
<lable>Item Amount</lable><br/>7 K' S$ u* x% X/ @ r8 o' H+ N$ W
<input type='text' name='item_amount'/><br/>
* Y: L, M" o0 P0 N) [% O% ]! f<lable>Item Upgrade Amount</lable><br/>
2 {& \ n- h( C: x7 I2 |# D<input type='text' name='item_upgrade'/><br/>
B. Z/ ?" V" ]. j- J) x+ `<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
" Z+ b+ ^# ?% n8 \
: p! C6 B8 Z( C7 I4 ?</lable><br/>, I; u: t1 i9 d1 _9 i
<input type='text' name='item_element'/><br/>
5 l- f3 e& ~* e8 V7 \1 e/ j7 w" D<lable>Element Upgrade Amount</lable><br/>
" ]6 I: v- Q) v' Y! ^2 I7 {<input type='text' name='element_upgrade'/><br/> h$ R% n/ \4 ]" [- ?/ ~, Y
<lable>Pierced Amount</lable><br/>& N- P$ X) A* ^4 M& X0 S( ^+ c
<input type='text' name='item_pierce'/><br/>6 a* c" Y/ x7 L8 R1 N+ V- q+ J; s
<input type='submit'/>
( P. y0 X" G! N8 C</form>";& a6 I3 }! \. t; p
}; m+ a5 a, T/ w6 Z0 w
! b* |: V' A0 j4 I% x6 m# T8 p
function PostListener (){
" O; ?. Y2 \( q* ], o3 ?//Add more post variables if needed and add them to initform() function aswell! {) R* F: v c, f" E
9 s) p' U$ s8 h# I: g9 p: }" j
################################
/ t j, }/ L5 W" r/ u3 m, z##### Connection and Post ######
1 b* |! Z0 J2 n& k. \& f, I' A% y################################1 b1 `( {( U" _- F1 J+ Q$ [
$name = @$_POST['char'];2 u- q* o* L. ^
$ItemName = @$_POST['item_name'];" h$ i1 f+ G' u6 k0 i. b! G) C
$ItemAmount = @$_POST['item_amount'];3 `9 l9 D s" v e
$ItemId = @$_POST['item_id'];
) d4 E4 \2 @# r- P$ItemUpgrade = @$_POST['item_upgrade'];
; @/ [+ r2 L( I& x0 V0 i3 R- h& ]$ItemElement = @$_POST['item_element'];
' U5 F! M- A9 f9 Y1 J$ElementUpgrade = @$_POST['element_upgrade'];
5 v$ H4 S( V$ _& z9 N+ m# c$ItemPierce = @$_POST['item_pierce'];( F$ w# d3 E8 A4 ^, K, H
################################
9 b; j3 V0 O* \7 v1 @) e) a, k
: t$ O2 i/ |$ m//Check both variables for empty value
( n6 E, Z# J6 |0 |; k+ N @2 p* f0 _4 h' { M
if (!empty($_POST['char'])){
( G0 e1 k7 n0 i$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
/ K, B0 {4 k* Q2 t5 J7 V4 O5 h2 S: w @3 I5 a8 f
m_szName = '{$name}'");0 k8 Y) n: y U" s, V
while ($row = mssql_fetch_object($find)){+ g6 H, G5 I" I4 ?! P. C% a. p5 @
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";1 r1 O( I# }1 g7 l
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
0 d! \; n% D6 v
+ |" w, t/ z- F0 p. u. z[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], " }/ H* m' z/ [; Z! Y! s- ~) {5 t
7 j4 o7 V' I2 Q+ k[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
& U4 t8 r2 b1 D: w! E* f6 W, w; [0 {7 @* r/ I" f
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ! y+ T4 k; ~$ R' V7 @2 ?6 u& ^
" J3 m7 x |+ P8 V
'{$ElementUpgrade}', '{$ItemPierce}');");
1 R7 v7 L, ~: k" m3 q3 n( J5 D* F}+ ]& a5 p! g5 w2 o+ Y( _' s7 m ~0 l- g7 n
! Q5 f+ O$ U& P; p
}
0 u: @# a) D, n/ A7 n. b
" \( l& Z! D$ S$ q7 D( f0 A}
6 E8 a5 M* d* u% A' ^) H3 P
$ G; j. K5 O: z" V( b* M$InitForm = InitForm();9 a" j) K6 L" N3 C- t; Q9 @6 A) U
$Listener = PostListener();
5 v5 h% l$ h3 n0 A
1 x: c2 M' ^5 j) ^/ w: n?>
4 Y* |% v+ R7 D! J; l: F. }5 A% I( i& ^1 z! L* g2 I
' `# S3 J8 ~% V4 P
! I5 _, D. s! x7 r' U* v/ S
: V- ?6 _: Y9 y |
|