|
|
<?php7 C3 z E" ~: y3 k2 R9 K
function Connect () {4 P U B1 q# q
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ; Z. x! I; E3 H+ Q, Q. G' Z
7 Z8 [9 c C3 w6 b$ ]Failed.');5 {3 S# H7 V% C
}
. c( P' }2 i5 X* d- i( p+ |- C! DConnect();! \& F' @3 M" o% b, U* Y
3 ^) z" \: i# c, d( u
function InitForm(){+ G+ d) A( S, ^9 ^
//layout for the form
' A+ p" L9 f* Z9 C, V8 O( pecho "<strong>Send Items.</strong>+ g( n( Z+ R3 [/ a: M2 `
<form name='select' method='post'>0 s- A) W6 p5 X! A# k7 \
<lable>Character Name</lable><br/>
" e. ?/ c5 L1 x, E<input type='text' name='char'/><br/># O( A6 H6 ^ _: E) T
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>. j- V& M4 o* d5 R5 p3 g* H
<input type='text' name='item_name'/><br/>
# Q6 o5 y! p8 ]+ E& G$ j1 l8 Q<lable>Item Amount</lable><br/>
S' J/ N" ~) E1 k; N<input type='text' name='item_amount'/><br/>
' @7 i" I" D6 V<lable>Item Upgrade Amount</lable><br/>! @$ _- ^3 R/ w$ M2 Z3 r
<input type='text' name='item_upgrade'/><br/>& S2 t) p3 r$ f% `6 V
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)6 x4 i: T) D9 t/ ~* x
! W8 G; E! ?% R</lable><br/>
" G7 x3 [/ `: A1 e. F; y% ~<input type='text' name='item_element'/><br/>1 D. @0 Q0 V3 z4 B' {! y
<lable>Element Upgrade Amount</lable><br/>. ~; }. c! d: r. D9 B
<input type='text' name='element_upgrade'/><br/>
5 {6 L9 e* I/ U/ H( X/ D<lable>Pierced Amount</lable><br/>
% K% D9 P2 e* Z: c, ` D<input type='text' name='item_pierce'/><br/># \$ x6 y, p! ]7 e" |
<input type='submit'/>
, Q5 l$ e+ c1 B, ?: U- u. t# h; U) t</form>";
& x9 t, N& f' i# ]% n: N}
' z& w( w& i' Y2 g6 w# B) x8 j/ S: I( j! ~, Y1 @
function PostListener (){5 w( C5 {, Z0 C2 z2 K% b& [) [
//Add more post variables if needed and add them to initform() function aswell
. c% B, q3 g5 R! \* j" f$ ?& X8 O# g- d2 w W& \
################################
# t, r& j4 n5 h; D9 `##### Connection and Post ######
! {# [& _7 y2 e" I################################% F1 M$ B* H* i& h. c
$name = @$_POST['char'];+ C# J# A* G/ o) B% C' P9 v
$ItemName = @$_POST['item_name'];+ U5 |. t$ G0 I* K" o! P# p4 z
$ItemAmount = @$_POST['item_amount'];/ C! L; N& @8 A ~! L7 G& V5 E
$ItemId = @$_POST['item_id'];. `2 @8 ]8 E+ D5 ~! R
$ItemUpgrade = @$_POST['item_upgrade'];, f) `! V0 S7 j
$ItemElement = @$_POST['item_element'];
5 I1 p. Z3 ?# z& j/ @( u, z+ Z9 S$ElementUpgrade = @$_POST['element_upgrade'];- F* m9 U) @ i
$ItemPierce = @$_POST['item_pierce'];
6 k. s- s# | V& G$ e1 i# G################################; M0 B$ ?0 M' \
' z' d$ V$ g6 U4 a: W" t
//Check both variables for empty value4 C% w8 \( m! U: M8 [8 E
% _- n9 W/ _( l$ _ f, }' dif (!empty($_POST['char'])){2 |' _7 K$ t) f. S6 c
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
9 ^6 K8 Z0 E& T" v1 q h
4 V5 k, f7 d+ m4 u t' R& R! Nm_szName = '{$name}'");- R: o. V' ^, P; s- J$ H) b0 ^
while ($row = mssql_fetch_object($find)){
8 {4 v2 N3 F# c9 Kecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
+ n6 X$ V7 v6 w- ]- Z" [9 R( S" Z$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" ]* `# u* N, X) t) j! u) s1 E: G; h. `8 w; C. }, o
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
- T7 _3 p6 d5 o# g+ q
) P' h# e7 T# H: s[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 r2 }2 \4 p% \3 g: y# e
1 N6 Z+ J; F( w% w2 A+ E& RN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
7 J# d8 Y, H- i- m7 ~& A
' O' M, G; ]! O0 H6 ^* Y& o& Y'{$ElementUpgrade}', '{$ItemPierce}');");
- Y% ~5 S& M7 E& U" p} m% _* y, g( W" b; x
( w" U* q; U# N4 Q1 s- A}
7 W+ r- R; C: q- y' E; a
7 ~, r- V3 ^6 R. r0 v1 E5 E9 {}
% Z0 l! A5 `7 k* M: \/ t3 a7 u: @: x) o% V
$InitForm = InitForm();; C$ c; c( Y0 ^+ _8 x) o- ^
$Listener = PostListener();
/ [# L; `% z4 F# [) k, C
: q: @: S* S2 Z1 Q?>
( ^" \5 `. k+ i' a
# n& ^! Y) q! Q! [' K( f+ ]8 c2 X) K: `4 C1 \! A
$ @5 f9 D6 k g( [# @! v8 E1 [' L5 t/ ^" n+ t
|
|