|
|
<?php
) H# l* ~' w1 C; J0 }function Connect () {( L/ Y6 }7 y$ D g/ X
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 3 v4 a$ s# l9 F! H3 j6 Q
& y) I, l$ Q1 F K/ I
Failed.');
, X: I3 U" \% [: g9 j8 L$ {}
6 {) t# L' @' ` m: ?! n9 P8 K/ L QConnect();2 D* z# `, @ N
6 Q" d. P6 F9 m9 V. j) yfunction InitForm(){
7 p6 y, a- P9 I# o//layout for the form
, J* `3 W& I' W, O( Fecho "<strong>Send Items.</strong>/ q' o8 H5 ^- l
<form name='select' method='post'>
Q C# ]8 d6 o<lable>Character Name</lable><br/>! |' T, n: U/ |
<input type='text' name='char'/><br/>
* F* r" q, P1 t; T. O S9 m<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>2 Z* w0 @0 t- B9 B
<input type='text' name='item_name'/><br/>7 Y; V! T& V- }0 `5 b
<lable>Item Amount</lable><br/>" Q( P; U3 a+ B. F6 v
<input type='text' name='item_amount'/><br/>
$ v. M, A; s4 Y. b<lable>Item Upgrade Amount</lable><br/>
U; m# ]; F& @& a& w5 d S<input type='text' name='item_upgrade'/><br/>2 G( ?/ W( G: S5 }
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 C4 J+ t) X! Z
( _+ O& E+ i3 d# a5 d</lable><br/>
7 }/ C( E. t% J<input type='text' name='item_element'/><br/>2 q% O( N: _) [# o9 b
<lable>Element Upgrade Amount</lable><br/>9 B' R- M- m. r/ S: v
<input type='text' name='element_upgrade'/><br/>
) P9 E3 h0 x0 H% p! A c<lable>Pierced Amount</lable><br/>, _- @% k& U7 W7 e9 ]
<input type='text' name='item_pierce'/><br/>
! v) d, y. T0 w1 T9 j" W% [; r<input type='submit'/>, I. {! F) q9 i: w0 K! t6 C# i# ?
</form>";
5 t0 i" W9 {7 ]* n# B7 {. x}
" X0 b0 _% J; B8 Z( M/ ~3 l
+ M9 v0 J9 q7 X+ ` S! ~# _function PostListener (){
! \$ ~; Y4 m9 a" j3 {4 Y# v1 U) h//Add more post variables if needed and add them to initform() function aswell
' A K; B" ~# j
2 g* N% m8 r5 |% P$ y! y1 a6 U################################
2 I B6 c9 C, N) h% y$ f/ Q##### Connection and Post ######
3 o4 d4 c3 M c9 x% A& j8 v) f# O################################% y2 l5 ^- f& ~: w8 b2 c) j
$name = @$_POST['char'];+ K: f) {" V& ], a# N, f
$ItemName = @$_POST['item_name'];1 b; ~5 U! P" S; \: j, Z
$ItemAmount = @$_POST['item_amount'];: @8 j8 x$ m; V
$ItemId = @$_POST['item_id'];
3 J8 Z% F4 {. [; e$ItemUpgrade = @$_POST['item_upgrade'];! O+ O/ q. ?, @8 f1 l
$ItemElement = @$_POST['item_element'];4 p( @: r; X8 i3 b! s! W( [
$ElementUpgrade = @$_POST['element_upgrade'];
* X( `" W9 d4 I0 ~, s$ItemPierce = @$_POST['item_pierce'];
: @/ V4 k4 k* ^3 I9 J5 T################################' ?9 e1 c) i3 w' h% X
8 w3 Q1 ]" I2 q
//Check both variables for empty value
1 M* M- b9 c4 K+ D5 p8 ^ r* `6 k. L4 F4 A" q% X
if (!empty($_POST['char'])){
# D+ u0 l4 a7 t$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
N1 p0 g" \/ D4 t5 u: M( _; }* t! Y$ A* i% M4 s8 e
m_szName = '{$name}'");7 v( X9 @( X/ g
while ($row = mssql_fetch_object($find)){
! [6 b4 T; S4 A* ^1 J4 V, Wecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 `& M: V9 d1 [% @! j% h! V
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], [; S1 p& X$ }6 V5 k& u! ?/ r
* Y3 ]6 H; }4 _% }
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
3 `0 s' H) C- @! A
) o& r) f; t6 M3 R5 L4 \[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', / \) S9 C2 T i; k
3 q o6 z& c% |) d, c/ I- xN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
2 I' H0 g* B3 d+ J- R& n+ i
! b# j( A1 a7 j t) D3 m'{$ElementUpgrade}', '{$ItemPierce}');");7 a0 J# I+ C; @1 t8 L# t
}/ F' P: \/ h: X* Q. O4 L. J" K
: k; Q5 _! A! y0 n+ \$ l9 ?$ G}
. R" X: G" ^9 |0 c+ i0 g
9 G8 I; @& b. a" y$ ]}
; I; h% I1 j1 a2 s& i- r( q
% U& U) O, A+ R5 J/ `$InitForm = InitForm();8 F0 m! u9 T0 l' c
$Listener = PostListener();
s3 \) g: h+ x, H# T; N9 e# X7 q f* X' G* w( W% v. D' q( i, ?0 j
?>
( Z! L& U3 e$ l1 E* M
$ u" ` i# B5 P
7 H P% ~/ u& ]) @/ N) X, f3 f
R7 X% A. u; C0 D2 t
8 S, n- x" Y) ^: P8 S) k |
|