|
|
<?php5 `1 Y) z/ c2 `) u: }, e* h# |
function Connect () {1 }: c/ v8 c" @& z! p6 G
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB . S, A& q" S% p4 Z1 f v, [" O8 k
0 ^/ v( {( ^& p. KFailed.');
/ C6 {' w E4 ^* _: C T( T}6 i6 I% I' R0 u4 K( B5 B9 M! A
Connect();
6 ~7 |- [: ?( N# _ L+ K7 C9 U+ ?! ~% J G
function InitForm(){. ^, k4 v% ]7 Z. O, B/ U! i+ l
//layout for the form x4 _3 `8 U, ~3 e+ m$ z& A
echo "<strong>Send Items.</strong>& g* w4 S9 C8 S" m
<form name='select' method='post'> W. i5 Q4 ~0 o7 @$ r
<lable>Character Name</lable><br/>5 {, _4 p( Q7 b. A3 c% M3 z
<input type='text' name='char'/><br/>/ b5 e5 G& X, z/ o8 `
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>0 s: n( d. o, p/ o& Y
<input type='text' name='item_name'/><br/>4 I; K- J( L! C! O& O
<lable>Item Amount</lable><br/>" f' N+ U7 E" Q2 r% P; I/ }
<input type='text' name='item_amount'/><br/>
7 V0 u& L4 e6 u<lable>Item Upgrade Amount</lable><br/>
8 b3 W( \3 D! t" \<input type='text' name='item_upgrade'/><br/>
4 |+ n) z+ V: C3 h |5 o1 F" Q<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
& l( V V U# q6 \5 t( `6 b9 C! e0 Y$ t+ L% @- u" {
</lable><br/>
5 L& D n7 n) O8 K ?<input type='text' name='item_element'/><br/>
7 \) ^; |8 ?' \+ F& |<lable>Element Upgrade Amount</lable><br/>
$ V; m, r* r" a* u- _<input type='text' name='element_upgrade'/><br/>
; I( ]' v2 v6 [<lable>Pierced Amount</lable><br/>1 p: l5 S2 f$ C; Z2 A) {& x
<input type='text' name='item_pierce'/><br/>9 D6 K! m* N; k: X
<input type='submit'/>8 y, i1 `/ o# Q/ y' A8 Q) Q7 C- N/ n3 S
</form>";# R9 L6 \+ _, B' H
}+ z. i& j$ o( g2 K
9 O( _7 B0 ^+ e% s7 `9 e' Xfunction PostListener (){$ m8 w* \0 F3 v; M9 y
//Add more post variables if needed and add them to initform() function aswell
" H" r; E6 E. d* Q; o% e* i$ ^! m+ n0 z1 S
################################
- x0 N; A7 E2 v& W##### Connection and Post ######
R2 k/ I# A+ \4 Y% k' C################################
4 B: \, q1 B5 E+ h; F' U) F1 A$name = @$_POST['char'];
7 c9 |. a0 p# `9 c9 L: G$ItemName = @$_POST['item_name'];
+ Z4 Z. y0 p' T9 _0 `4 K$ItemAmount = @$_POST['item_amount'];2 P. m2 H, R* W: ~
$ItemId = @$_POST['item_id'];
% y8 {* T+ q" L' j) g$ItemUpgrade = @$_POST['item_upgrade'];
1 o J* C" J( g+ u- V* H H% V' X$ItemElement = @$_POST['item_element'];
% e- h8 k5 ^) ]0 Z2 N L- O3 N/ O0 e$ElementUpgrade = @$_POST['element_upgrade'];
' ?, D8 |5 n7 q' B0 K7 @9 a$ItemPierce = @$_POST['item_pierce'];
1 H8 C$ B9 N+ @( S, Q! V5 b################################8 d* L$ z- p" ^5 |
; Z0 |. G- H, r6 y" k- P7 \$ ^8 _* }
//Check both variables for empty value
5 I g3 H6 ?1 {# v; N2 m
4 T7 e$ G' \. L- Yif (!empty($_POST['char'])){3 B0 D9 j8 ~; J# ^% V
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, G2 c6 O. J. u' s( ?( I
+ ^; H+ h% c0 L: \$ X5 C. Z: |# Um_szName = '{$name}'");
7 h4 w, ^- G2 {" _. Cwhile ($row = mssql_fetch_object($find)){
; r/ M2 L. @7 Z1 Qecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% F* U3 e$ ?. {4 F/ V* d
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], " ?7 ` r; |1 r8 t; E! J) |* e
; Y3 P5 v- D6 v+ Z[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
/ |1 x$ P3 d) S2 l& Y8 ?
2 e ]; s6 v0 @4 B1 V[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 2 D, n3 j7 B1 s3 l7 j) A
3 g* J& _9 h7 \: V; Z* J! ~
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', . d# t% _8 d- x& N5 \
$ M) T# { @7 v/ w'{$ElementUpgrade}', '{$ItemPierce}');");
' f. q" D9 i0 T0 O4 `* ~- G}
8 ]5 N8 ^" d) X; g$ ]9 C, _* Y b! i7 i# R" ^
}6 q" G6 E- r1 G0 x( ?
' f, W" ]/ ~, F}
; }1 }+ ], m, E- o( @3 V5 z: Y* F; j8 W
9 j/ T0 p! ]5 b$InitForm = InitForm();
9 g+ `! o. ?2 ]5 U9 Z) @$Listener = PostListener();6 D" E( ^) A& i7 q
/ E$ Q2 o! x7 o1 |# ]
?>
" \6 h u+ [# p& |# D, q1 Y6 G0 \
/ O1 Z# D7 n ~; X. E' W) k( {8 k! }6 F& [
|4 y1 O! ~9 e! U: v/ p: n
|
|