|
|
<?php
) ~& j. g9 P4 ~function Connect () {
: A; p" W) `, g- ~0 \mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
; N* f6 e0 I. J& m) G, l' x9 R
# U% J b. C! |1 R' Q) Q MFailed.');6 C) ^, ]* Y+ N; h3 N9 h# A7 ~. B
}! w( e8 Y* d; e! x
Connect();; R2 L# k6 |2 K# t+ T" z" Y
$ }' Q) D" {2 a
function InitForm(){
- m+ b" N6 ]' S9 }//layout for the form6 t5 K0 ]* h, Q1 P3 ^2 L
echo "<strong>Send Items.</strong>
' r, j" k+ Z1 s% s- N; ~) {<form name='select' method='post'>
8 {4 @' ?* ?7 X/ V7 C8 u<lable>Character Name</lable><br/>
: \/ G5 D0 ?2 V; t9 E- Z' i, @<input type='text' name='char'/><br/>" G6 l B% I6 X$ ]) I
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
" V4 D' V" I4 \# T/ [<input type='text' name='item_name'/><br/>5 @% {+ q/ }6 _6 r6 c( a
<lable>Item Amount</lable><br/>
, P$ F* J, C( [+ @* `0 t9 R<input type='text' name='item_amount'/><br/>
* ^7 }# Z& S- F5 ]0 c' w O: n<lable>Item Upgrade Amount</lable><br/>
: D0 e! `# E7 `3 Q<input type='text' name='item_upgrade'/><br/>
" i+ {: ^2 ]4 l% `<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)3 i, q: j D6 [2 C& q- A+ G/ ?6 l
" Q% l2 L6 o. g# t+ @4 u q
</lable><br/>3 v0 K, P; g4 a" B
<input type='text' name='item_element'/><br/>0 N6 u% q6 c/ D# @6 b+ \
<lable>Element Upgrade Amount</lable><br/>& o% z7 V$ d( R4 F9 c, z% F! _' R- B
<input type='text' name='element_upgrade'/><br/>
O8 J7 R9 c3 A5 ~0 h/ E: E- W, L2 }<lable>Pierced Amount</lable><br/>
. \& l* d( x, z) F- ^/ _<input type='text' name='item_pierce'/><br/>) k+ g: `. `" O9 @; }3 F8 N
<input type='submit'/>
1 g9 ~7 h, f3 [8 O9 I3 A</form>";- Y/ D J# L ~" u
}
( L' k6 J1 E, t2 x/ f0 H. A9 O* z. _& Q# T. V
function PostListener (){9 N1 J& G" U7 f$ B
//Add more post variables if needed and add them to initform() function aswell
6 `8 O5 i: o( a% v6 W9 y
; C- g0 x$ U A: \, @! G################################) c( [. A8 {5 W: l$ y
##### Connection and Post ######
1 J( t! {. t' A" F' F; f7 E################################) t9 ^1 @, p/ T# ? [% D
$name = @$_POST['char'];* N, u# h; d8 J4 ` F7 F4 F4 T
$ItemName = @$_POST['item_name'];
# W2 @6 Y8 F+ A8 l$ b9 F3 K$ItemAmount = @$_POST['item_amount'];( u: u9 } @/ w" [$ u# a
$ItemId = @$_POST['item_id'];
2 [2 U/ d9 e" d, P9 E6 g$ItemUpgrade = @$_POST['item_upgrade'];) g+ ^; P. ^( P: L) V
$ItemElement = @$_POST['item_element'];2 ~0 e* d$ U# O6 S% ]' {7 R* V
$ElementUpgrade = @$_POST['element_upgrade'];
! R. L6 V8 d9 b0 w' d; ?( {$ItemPierce = @$_POST['item_pierce'];. c0 m _: \5 h" }% n( a
################################
r" C. V3 j0 q: f4 D* i1 a+ m8 D
//Check both variables for empty value/ m6 W/ p% @- J
" w% p$ C3 `/ g. p4 ?4 i8 o1 cif (!empty($_POST['char'])){ _+ J) N" {6 g
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
9 d, M3 H" n2 U( ^- V8 `0 X7 z! D5 m3 }6 h: p
m_szName = '{$name}'");
, L+ b8 |4 B9 x- lwhile ($row = mssql_fetch_object($find)){% t+ _$ H0 s! y: u3 W$ _
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";( G* ^: m5 z, c& d0 G' J
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
( S5 e' w3 v3 i# ~7 O% [1 S9 f0 [8 W' N7 {) ?5 ^) S
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
6 V1 {" W: A! \& z
" d+ i/ s$ U) v7 B5 k- k3 h p[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
2 K+ ]! j3 o- m
+ t& E% n# H4 ]5 K# j6 Q, cN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
4 H6 Q8 g; r, h3 v, K9 O9 B% e4 U/ Q) I( m5 V3 A; p( ^
'{$ElementUpgrade}', '{$ItemPierce}');");
) X% P" ^, N8 Z}
9 l) i; e' h+ }9 h
. I3 V. M% |% V. N}
! i, n V% t, I9 ]- g# k& b' v8 a. f& n8 K {4 ]# H. ]
}" q: k) @5 x4 O4 n
) B, o7 N! [1 r2 G O4 S$InitForm = InitForm();+ W. R" p x7 x- G* ^; ^
$Listener = PostListener();
+ r# J% _# V2 R" G# c+ i3 ^# y
9 ^& p/ N9 f9 V+ i" ? v( u S?>
5 U9 }, Z: h3 C( {
0 r8 g+ I3 H8 `' `- I2 m& O
. R( P5 _: c$ n: h- A: [
! K# ~2 w, R: A7 [. Z
& ^" |$ x' Y# |6 I |
|