|
|
<?php
2 t- f, A$ L# s$ zfunction Connect () {
7 G/ m6 m& s8 U6 ~/ [mssql_connect('Server','UserName','Password') or die('Error: Connection to DB . Y/ l0 Y& Q! A A
) U$ D# q% L# |2 Z% E7 U
Failed.');
+ H4 X: U. f! e4 \}
5 {2 a5 o0 Q3 ^) r% H# FConnect();
( I7 P; x1 b. P! w
2 h3 ?; n, \$ e4 ?$ D" @1 o' {function InitForm(){! l& @: L8 h# t0 y' A
//layout for the form$ L0 O$ b( [' f1 G4 h
echo "<strong>Send Items.</strong>
& F/ U0 F' D$ _. t<form name='select' method='post'>0 s/ z! L# Q y9 |' Q- w
<lable>Character Name</lable><br/>
, ~" I4 N; H$ _<input type='text' name='char'/><br/>
( a H! G4 L0 y/ R<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>5 ~5 P, s1 s# `( ^7 Z2 B/ e' s
<input type='text' name='item_name'/><br/>: I7 d& l' U+ C6 S
<lable>Item Amount</lable><br/>
# H6 M6 w4 U* A, X# B6 G<input type='text' name='item_amount'/><br/>7 s! N- O" R. d: J
<lable>Item Upgrade Amount</lable><br/>" w( |2 e8 d" Q5 ^+ K
<input type='text' name='item_upgrade'/><br/>- I! R; F; r; g. q& E6 o. n+ V0 r
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)6 k6 i- G M1 W$ {# N
. ~3 Q% h, V6 J/ R; G" M9 {8 Q
</lable><br/>
+ c2 ^1 ? L8 W s1 k<input type='text' name='item_element'/><br/>$ m* q$ t# G- X8 g
<lable>Element Upgrade Amount</lable><br/>
# p- E' x( P+ b( d( @) H) {<input type='text' name='element_upgrade'/><br/>
, m/ o% u( m2 @<lable>Pierced Amount</lable><br/>, T: b1 j% Z3 C3 b& V9 a9 \
<input type='text' name='item_pierce'/><br/>" F5 Z2 ^/ X* o; @) L! J- b v
<input type='submit'/>. v x- O% N, g, d' ^
</form>";6 e' r% u' Q* R4 B( \
}
( P+ f: J- d$ L) Y7 V# ]3 R2 l0 e+ Y: A
function PostListener (){
' ~' p& u6 m1 {( w$ [//Add more post variables if needed and add them to initform() function aswell9 t# w- ?0 t" d; j. p
5 P# E7 U9 x, W4 @8 l$ ]################################
+ \& U, X( Z/ J! d3 `# N* B##### Connection and Post ######! s# f" u; y" D; \1 x
################################: v1 @: R n) f
$name = @$_POST['char'];2 w6 L/ y8 f" H8 v* d/ w+ l
$ItemName = @$_POST['item_name'];+ V+ Y' y8 H! C
$ItemAmount = @$_POST['item_amount'];5 m1 x- _8 V7 @" `) m
$ItemId = @$_POST['item_id'];+ o1 Y" J& y# b0 q G1 J% l
$ItemUpgrade = @$_POST['item_upgrade'];
0 D% j+ e% L5 }, n$ItemElement = @$_POST['item_element'];! l% m9 g) [+ z4 F$ F
$ElementUpgrade = @$_POST['element_upgrade'];1 u. _. ~( w* f- V; z% @9 ]
$ItemPierce = @$_POST['item_pierce'];
( T; _) a" s' V5 [* g$ s& x################################
. T/ D7 b/ {: V. [7 W1 ^- C9 ~% U! T. k) F( N' T
//Check both variables for empty value
" ?; K' l! U7 a7 u
( U4 q: W/ ^1 m2 oif (!empty($_POST['char'])){
3 E9 f( z; }" t7 }: W$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 k: g* \0 b0 z
: I) p. X( M* f5 i/ xm_szName = '{$name}'"); Q5 l# O, L+ D( x6 i+ U" k7 h
while ($row = mssql_fetch_object($find)){) a$ x6 D; F$ T, Q: r2 L
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";; t& |+ x) b, T, ^4 ~- l
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
, [" y2 j) E/ ] U- Q
; U' J! q K! d: G[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], : @7 w- l8 X q/ S- f) [8 Z) t1 ~- r7 O
: Y; U( L. w0 M$ W. u$ \
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', . m- i/ A$ R: g6 u& X% X( e p
0 X# |0 o% ]3 V# U$ z
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 9 z6 f2 b4 R% e, u
# o' o- S, O5 p T8 @! G'{$ElementUpgrade}', '{$ItemPierce}');");* E: l* V% I; ^. Y% B
}
( b: E8 m8 i1 h/ N* H* _8 B2 D l, T, g0 U' S) b2 f
}
5 q& w/ |/ q. m1 f
0 | E2 w* O. A+ e0 c5 f( A$ L}7 F6 {: e x* E7 ^
& A8 i; \4 U7 G# G( \; T+ [. p0 A
$InitForm = InitForm();
1 A- Q. y6 Y% ?$ S3 M1 |# d, c6 U( m$Listener = PostListener();: l% z, e% i# h
) w0 V1 m: W! F% z, P3 Z?>
* R1 ^% \. @# e4 k9 j# L* o, ]" ?2 f6 P: q9 x% B
$ K* g( q& v" } }' B! L$ a
" M7 k2 o) ^2 s( l+ }* v& e3 | d( L! t$ G
|
|