|
<?php4 L. {% v. f* Q- O7 m
function Connect () {& q5 ^4 V2 b1 y" C0 r8 j" H
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
9 P( q- L5 q6 e5 ?( J' U- p2 K
/ v* W( Z6 [! _6 }% i$ `8 tFailed.');
0 O4 K6 K7 B+ ]* `* Y}- @/ C; X. f; S0 |+ D, E4 i; P
Connect();7 \( {2 n8 b" D6 s. m7 C
5 x1 L: i$ R, t* c
function InitForm(){4 D+ X. D3 ]6 L' B) [
//layout for the form
7 q* `5 V, _: |1 ?echo "<strong>Send Items.</strong>+ h+ d, U1 f/ H( k' }. s1 h: G
<form name='select' method='post'>
3 r4 l& `5 ~; r- E: B+ a9 Q<lable>Character Name</lable><br/>+ ]1 j+ H* J3 X% K- W+ b
<input type='text' name='char'/><br/>) D8 `9 Q2 E" G; G
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
. ]$ e/ a0 ?7 n0 f3 M<input type='text' name='item_name'/><br/>) m7 M2 P: v7 [" F4 `: y0 O T
<lable>Item Amount</lable><br/>4 j+ m4 S6 z ?" l( l! Z3 s
<input type='text' name='item_amount'/><br/>" R2 K$ \) U* ]4 G
<lable>Item Upgrade Amount</lable><br/># }9 U% H, k# g
<input type='text' name='item_upgrade'/><br/>
$ r( A; [$ h8 ?<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
) B. A% o8 D) t* g; `9 I
5 q- q% W; |2 M! w" ]</lable><br/>4 T0 C: F! }6 S7 ?6 I
<input type='text' name='item_element'/><br/>% u6 |" r# U3 |
<lable>Element Upgrade Amount</lable><br/>
) D5 }3 {- M w5 O' N<input type='text' name='element_upgrade'/><br/>
& ]( t; h4 g& o$ O% b<lable>Pierced Amount</lable><br/>
5 d5 l4 b" K) `<input type='text' name='item_pierce'/><br/>
$ s: K; D, Q8 J* }. y<input type='submit'/>3 ]8 m* n4 [7 b
</form>";
6 {( r3 w' `1 e}
* \/ x+ I! z: ]3 Q/ n/ f/ c
( ?1 n5 ~( p0 g @( n+ `function PostListener (){
5 {5 [; L4 o: i7 _. p//Add more post variables if needed and add them to initform() function aswell0 t* s0 W8 t% W
: N0 J2 d- J9 o: B
################################! _5 E' e4 x; h+ r# K
##### Connection and Post ######
5 g% i+ j: t0 V; r2 C, n################################
- l. S7 a# ]' e% r, q. s7 d$name = @$_POST['char'];
! }/ B0 q) M l6 u$ItemName = @$_POST['item_name'];
: K! l* I% V; f. S( ]$ItemAmount = @$_POST['item_amount'];& w, R3 C1 D; @8 `3 O* z$ ]! q4 X8 f
$ItemId = @$_POST['item_id'];/ \1 k7 G- b8 h& X7 g
$ItemUpgrade = @$_POST['item_upgrade'];5 x2 m% ^- h; S' T6 ?% I
$ItemElement = @$_POST['item_element'];% E7 n2 P: f$ _2 P/ R
$ElementUpgrade = @$_POST['element_upgrade'];
- f6 @7 x* B( M3 s& F$ A$ItemPierce = @$_POST['item_pierce'];
" ~- m3 v9 M3 f, d6 N################################
! k2 q8 B0 f# N: z' Q" ~ L( ~! q# b6 y( ~3 `" W
//Check both variables for empty value
# V" G" [( \3 B5 J0 M; g" @3 \; }$ G4 f2 L$ J& K/ F4 U
if (!empty($_POST['char'])){4 Z/ g! k4 _$ Z s( `
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
" K% ^; _: I1 o, p
1 ]% z/ d. W5 e5 X4 S$ |m_szName = '{$name}'");
3 d- H0 R8 N+ O$ iwhile ($row = mssql_fetch_object($find)){
2 n! b; U0 ~& v5 secho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
; e q. x7 L! x: z$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; U1 X; n. G$ ]0 G' V/ p# u2 A8 y
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], . L( Y3 S9 _; w4 A+ |
8 u' {% ?5 a9 T+ c+ v
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ' U+ B4 j- i1 E6 [ L
) f7 D6 o+ B; S- U: ?3 n4 G8 cN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
2 A% \5 L) |% i% [/ F' W: e: e8 [' y* N; a: b/ n# H2 }! Y
'{$ElementUpgrade}', '{$ItemPierce}');");! M+ i% L1 G7 H8 T, Z
}& i# Q& D* R6 A2 j
3 E. Y" H4 w5 m' ?% u, p5 w( S% g}
5 W2 G4 T! Q$ F- ^/ v6 V# k+ ]4 h9 _! x) n2 l7 q
}- Z) u" e; B8 k( H$ L5 ^/ G' c/ p
. v/ C* j% f L1 n$InitForm = InitForm();
; m+ e0 A5 M2 e" \9 q+ U. D: @( ~$Listener = PostListener();
. I5 P2 k3 e/ M" W2 z c- T) E+ c' k$ e- [7 [/ l1 O' H% q
?>% |' B* M0 v: v3 ?5 s, R
* k9 ^( }" ]$ {& [5 c
9 S7 A5 f n6 n' c) z K8 U9 F
# W3 N! Q' i" T% K. H' b
4 y% z# F9 N+ v v* c" h4 q |
|