|
|
<?php
7 A% ]1 k7 r. i9 z8 ^function Connect () {% R$ s) j( B8 t" h) S
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
0 W7 c' o& P s8 |
" b1 i9 s" A# DFailed.');
9 J& b/ O2 Y7 J% N' `& p, c# o$ s: ]$ l}' \- [* m$ F. p; m/ V
Connect();
0 u0 w6 J4 e' d8 a. [9 M/ m/ m/ c1 ~" t' H
function InitForm(){
: w% h5 F+ {1 }- \! u* I( p//layout for the form( D, Y" l: ~& V6 l- G) @; V9 W+ H
echo "<strong>Send Items.</strong>
( ?! I; i( }+ C. b9 a+ E<form name='select' method='post'>
* {0 l8 x2 Y+ R$ p0 `$ V# A* H H6 S<lable>Character Name</lable><br/>9 E* k; a, G h- q! E+ t
<input type='text' name='char'/><br/>) {# t: J: |/ U$ `3 t; f x' N
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>; x) G) ]% ^2 \8 Y) {
<input type='text' name='item_name'/><br/>
3 M1 t6 v$ n- B9 o9 [6 P5 l<lable>Item Amount</lable><br/>7 E7 s3 t$ z$ Q/ m# n9 I* [
<input type='text' name='item_amount'/><br/>
% v1 g0 J8 K9 o<lable>Item Upgrade Amount</lable><br/>
- B- l' T8 x7 N0 e<input type='text' name='item_upgrade'/><br/>
! s8 h( i8 U/ ^: p" |<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)( n1 P0 t/ D- P1 e s0 V
0 M9 \ Z% ]- m* K1 Z5 ]0 o5 ]</lable><br/>
8 }, O4 T/ G! b, w6 e) A<input type='text' name='item_element'/><br/>; J1 [+ J- k# k$ X- ~
<lable>Element Upgrade Amount</lable><br/>
! X1 k1 e& N/ h0 h" f<input type='text' name='element_upgrade'/><br/>" s$ K: c- E3 |2 M: P# i. e
<lable>Pierced Amount</lable><br/>( |" O; X- R; f+ w' k2 P1 [
<input type='text' name='item_pierce'/><br/>9 b, Y6 f7 S2 D7 t5 V
<input type='submit'/>$ U6 S& v3 r- v0 O4 i( D- l t, a
</form>";
( T k* w( [8 g}
" y: n0 P+ G4 i% [) a/ N
4 Z" N0 r; Q5 a2 ?function PostListener (){
# ?" e- j7 s* V5 f5 T//Add more post variables if needed and add them to initform() function aswell
$ B" e" ?1 ]$ ~# r- ^" @) j9 ]' z
################################; ~4 H; u2 I7 [
##### Connection and Post ######
' M( O1 _. P7 h# R################################' I; J, n8 q6 Q! g- s# ]
$name = @$_POST['char'];) j. v: M. j; Q0 o8 \
$ItemName = @$_POST['item_name'];" u7 \; } w4 t- r: K
$ItemAmount = @$_POST['item_amount'];+ v0 _5 a; P4 l) y0 ~
$ItemId = @$_POST['item_id'];
3 V0 J! C7 a0 v4 ?8 M5 V$ItemUpgrade = @$_POST['item_upgrade'];- w. P# Y; A* M2 M" c
$ItemElement = @$_POST['item_element'];
& N3 j% J$ }. F& c6 A" C0 ~6 q$ElementUpgrade = @$_POST['element_upgrade'];
! ]$ ?0 t; P$ G! i- z4 k& x+ c3 J, ~$ItemPierce = @$_POST['item_pierce'];
+ M% Q. D# n/ N/ S9 @3 \################################9 _" C6 M* X n% p9 t% `% f
) E1 [8 O$ L# d; p# y+ N
//Check both variables for empty value
6 n$ E9 i/ M4 Z/ o/ z
2 d% |: y u9 A& f# D# o4 l- Yif (!empty($_POST['char'])){# N9 n8 a. U U1 b/ n, A7 \
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
) N7 V0 C8 d) @4 p# d K5 e% s( u; P
m_szName = '{$name}'");
4 J7 m; ^2 w: Y' d9 y8 H2 Hwhile ($row = mssql_fetch_object($find)){
* r" K, {: S# z% W3 secho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
. ]6 O# d1 U/ g7 j& a+ r0 }$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], , k& z% C6 p3 J" W3 j' y, ^' v
9 O4 H5 b0 [! w. m
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ; r7 i9 x! x- U. @0 F& A1 s
6 P# N2 I0 u/ k' a# [
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ) A* D! L, S d7 t* Q
" I& n P3 I" O+ W: d) \8 T3 J" gN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', * l6 c7 K0 {) o
$ o6 K7 p7 R* O3 u m
'{$ElementUpgrade}', '{$ItemPierce}');");+ D! d4 Y7 D7 ]; [# Y
}
: s0 E9 n+ ~9 p9 j2 U9 L7 n3 G' J
}
2 R8 e# p' x# ]. ^3 C# y# r( O0 |9 J
/ t0 _. |8 x& Y9 m A9 Q6 X}
7 c( _3 N- `4 `6 i6 U0 o& x4 q+ C2 i# I7 V% B
$InitForm = InitForm();4 c" X y1 a3 o/ F( d, ]: q
$Listener = PostListener();2 o& Y2 A7 K# ~$ S6 L0 E
4 a8 q; s6 \8 q, d
?>
" \6 ^: T9 N+ {- [3 G+ p! L5 `8 H. y; v: G
" j U. q1 j% j$ o( s9 p# N7 R4 Y+ z0 N; s6 `' y
2 f) ^6 }+ }6 l) I8 ^: Z |
|