|
|
<?php! I" ^; p/ g, S$ p% g' h/ }; y- [
function Connect () {
$ [# f; e, d; D6 e; Rmssql_connect('Server','UserName','Password') or die('Error: Connection to DB ; S! \& \7 h" J9 `! r' x0 k
3 @+ i/ K. h/ t6 H. ]8 ?2 tFailed.');
6 Q) O& `# x1 ?. H( W. M1 P, ]}
9 H6 |& C2 d4 I/ [0 ~1 m: lConnect();
" |/ ^3 x( n/ q1 q7 C- n+ M3 Y3 g" ]& h$ ^' U
function InitForm(){
/ x" r9 H# o8 |4 W//layout for the form
" b5 G3 \' M% v0 }2 secho "<strong>Send Items.</strong>- H/ s( Y$ y* f1 `" K! z
<form name='select' method='post'>
% f7 M; G. J; a; H" l2 _<lable>Character Name</lable><br/>
0 X7 o# D& z; o<input type='text' name='char'/><br/>
; j/ j6 B3 o! ^$ G- Z; N- l8 d, D<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
* R9 d* X& c1 j4 z: u: T* T% N<input type='text' name='item_name'/><br/>
: h+ l7 e2 j6 X, T; B<lable>Item Amount</lable><br/>
+ g+ I6 S( R' k5 S- x9 I<input type='text' name='item_amount'/><br/>5 ^. J2 m# J' O! ]
<lable>Item Upgrade Amount</lable><br/>( F7 d) S7 [" E: l
<input type='text' name='item_upgrade'/><br/>
4 e* X/ ~( y# @- j! B5 q. b<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)& {8 p7 x; L( X9 X. R F
1 ~$ ^6 |. T% A* f1 |7 c. X
</lable><br/>% I: `( C* m7 [4 `0 {
<input type='text' name='item_element'/><br/># ]' k2 t$ n0 t/ h
<lable>Element Upgrade Amount</lable><br/>
# @+ ]) B$ r7 P" L<input type='text' name='element_upgrade'/><br/>
( L' c: d- f) Y5 ~6 J3 l7 o0 V<lable>Pierced Amount</lable><br/> L4 D& j" J, I* H" [* x$ [
<input type='text' name='item_pierce'/><br/>
6 d! H3 T0 H( f ?<input type='submit'/>4 j5 d9 @* F+ V% k' T" s6 `
</form>";
5 n4 p3 V; A N+ I}
. f# y9 u$ K' q: G' x9 P: M8 V9 B: p# E4 I1 p
function PostListener (){& ^! S4 H) S1 d2 j; g
//Add more post variables if needed and add them to initform() function aswell
7 P7 G5 K* G9 |; r: v
, ^" J8 n; W# Z/ u################################
8 y" A) ~/ f1 H; @+ z##### Connection and Post ######
5 E' X) h; i* ?- e! ~################################
* k: S1 O7 Y5 A) n$name = @$_POST['char'];8 n4 B8 G+ f3 L. q+ G
$ItemName = @$_POST['item_name'];
& x1 L3 @+ ^: R$ItemAmount = @$_POST['item_amount'];
8 Z2 y' t+ w. }$ _" `7 v& Y$ItemId = @$_POST['item_id'];
) U: M( K3 z% b" h& K$ItemUpgrade = @$_POST['item_upgrade'];% g# s! ]7 t0 s: J) Q
$ItemElement = @$_POST['item_element'];
0 w7 O& C" ?# j, [! N3 f$ElementUpgrade = @$_POST['element_upgrade'];/ [( M* k4 b9 |0 m7 |
$ItemPierce = @$_POST['item_pierce'];
- u$ Q* i9 d$ [& g1 @################################' ]7 a% K; m1 u! |
8 X- t: v% S k
//Check both variables for empty value5 A3 `8 [7 ]( F+ ?3 X, s
" l- l6 N% X' C" O5 Pif (!empty($_POST['char'])){
/ N; a. Q5 t* p0 o7 S5 O8 D6 D$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
9 q* K& a1 K& w2 N/ g) e0 E7 ]9 Z2 \
m_szName = '{$name}'");
6 f7 N! f8 x1 t% Mwhile ($row = mssql_fetch_object($find)){2 L8 t/ ]% [ [/ f0 R* @8 X
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
/ U% p! t- H! J k$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
+ E' j/ y1 p- l
+ v% y8 R( h' d[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
/ i% o( |3 K7 ?) ~ F% T( M; A4 C0 s# @
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ' G' X6 V6 P5 ?2 B- _5 ]
0 u! k: x' ^8 iN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 2 u% q; ]8 y6 |
8 y" a+ K# [/ Q5 o& ~6 ?'{$ElementUpgrade}', '{$ItemPierce}');");3 ^! X# j/ q! l) \, @3 O
}
7 } g/ E ]; M7 \- U/ J0 f, Z- b0 T" h/ m
}; h5 x+ }8 y2 ?0 Y
' K5 J: m7 |- e3 G: R1 m E
}. T. S9 \! t" b6 g! _+ _, L* T3 ~
; j) ?8 d7 Y! Y7 v
$InitForm = InitForm();
, y9 W3 |/ X) T# A6 d$Listener = PostListener();
- n& a) u0 p+ @: n0 ^" C M9 G. E; c; J9 @5 b- p
?>2 W7 w# H+ T/ y2 \2 c8 N6 |/ W
, G y' M, m* ?# P$ ^+ W
: |- C# q! n4 E# Y, q" ~
+ j& g) I2 y0 {6 P2 I6 }; f$ C* N$ D. Z5 I, G, `9 d
|
|