|
|
<?php
. z' h# `( M9 j r* q0 c9 Rfunction Connect () {
( f" h. Y8 B& S, Amssql_connect('Server','UserName','Password') or die('Error: Connection to DB
5 z1 K: j# Q; j" r* ^2 O9 K( s9 g; K) d2 K, e$ F+ a% ?
Failed.');; |) _0 ]8 v8 P. @+ t( s; W
}
' M7 r8 f* e; f. Q$ }8 lConnect();
& D+ h4 _- g7 V6 R9 }) Z; M9 Z: D+ K# _" ^7 E" i
function InitForm(){
1 G* ?/ X) K0 d" |" g//layout for the form
& q m% Y/ d& Q5 r( u% gecho "<strong>Send Items.</strong>
! r( _ J' z) E; w3 L3 ?' U<form name='select' method='post'>. P9 x' @; m7 V
<lable>Character Name</lable><br/>
9 ]7 _' H8 }' v<input type='text' name='char'/><br/>
' r$ s6 n; k( T- [) \ y<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>' {+ A; x3 _. p8 S$ b
<input type='text' name='item_name'/><br/>/ [) a0 g/ `6 {
<lable>Item Amount</lable><br/>% J {! {* N* v
<input type='text' name='item_amount'/><br/>: E$ R9 V7 f. Y% ^* d- m. `
<lable>Item Upgrade Amount</lable><br/>
( j# h0 [" h/ f$ w! ?: L<input type='text' name='item_upgrade'/><br/>
/ x( r& r U0 }( E1 h9 \( M<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! n) L" f$ Y& c+ N, y! y" c
" `- ~% `! t. _4 K3 J</lable><br/>
( e! _/ d3 H1 i ~" U6 L<input type='text' name='item_element'/><br/>
q: `- i: ^2 G8 \4 g<lable>Element Upgrade Amount</lable><br/>. x- C' b% y4 O# _8 b/ S/ [
<input type='text' name='element_upgrade'/><br/>3 D, x' a7 p1 Y, L0 d" q
<lable>Pierced Amount</lable><br/>
0 q6 D- h( g, U% e% G: j7 M+ P<input type='text' name='item_pierce'/><br/>
" ] F8 ]/ X! q/ b; Q1 k) w* h# i<input type='submit'/>( |: t, ~" m; z: i# J/ m; d
</form>";
3 I7 F& A3 r- g* u7 U' n$ V( V}# n, E# r" s0 I( G1 J
- |6 T) J$ x- c, v- f, K
function PostListener (){
& f& t0 y4 k" z0 R! W, D5 }2 h" b//Add more post variables if needed and add them to initform() function aswell
9 g8 M" W, ]1 O; [* ~
, H4 N) d8 v, T' h, ]################################
0 k9 j3 {0 g' }##### Connection and Post ######( X8 {% a F2 _( `% g
################################
) A/ @4 b i5 o) S$name = @$_POST['char'];
: x1 q; Z# D( c* K/ U$ItemName = @$_POST['item_name'];
5 b$ h* P" u% y7 J; ?% A6 y! O$ItemAmount = @$_POST['item_amount'];
# B' k* N* C. F3 G* v% b( o/ m/ G: i, w$ItemId = @$_POST['item_id'];
% W* P# U4 S3 X4 D1 ?1 U: r$ItemUpgrade = @$_POST['item_upgrade'];
. }6 D J% c; q$ItemElement = @$_POST['item_element'];
8 v: @( y6 t9 N7 ]# v$ElementUpgrade = @$_POST['element_upgrade'];/ r ]6 t" p$ l0 w* T9 x
$ItemPierce = @$_POST['item_pierce'];. r6 Q% H' q: h8 R, k# G
################################0 I* q- Y9 ~* Q7 H' p; A8 W: Z
1 L( M/ C( ^1 a. W5 C
//Check both variables for empty value
$ \8 a0 m i- Q# E9 y# `7 k$ ^+ R Z% d; S3 t% u# t4 l
if (!empty($_POST['char'])){
; g) s0 D( G2 s. r$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
9 r, B% l- Y- I+ U6 N5 \2 q' \/ m) i8 l5 M" g% Q
m_szName = '{$name}'");
$ }) e ]' q7 h: {% t; r vwhile ($row = mssql_fetch_object($find)){- f- ~0 s0 @$ b' C
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";* ` A! J2 O& G' ?) h1 H
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
. G# v# y2 _! g2 \, E$ X9 J# \( ?$ D9 h* K- h8 F
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 0 X1 n& @* g5 A3 }, j9 Z
4 w _) X- Q9 e- ~8 A
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
/ S- |7 b2 f+ ~) E4 h4 C* @& a
' J/ ?( f. G' X- zN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', * d9 j+ O5 Q& Z& t# p$ F9 H
; t- G/ [1 U! @, a
'{$ElementUpgrade}', '{$ItemPierce}');");9 k: C: \3 X" C" l" O- z7 f5 x! v+ j9 _
}7 C4 a4 L; \ N; f1 @
* Q2 J% c. C4 V2 _4 H
}
9 Z ?0 ]5 l3 A& a# j' T) m$ q- c: x9 K+ R- Y8 M( W' t; ~
}8 V- [% Y, T3 ~
\4 o( x) C2 A. \8 x: \$InitForm = InitForm();! A1 |0 d) }7 r2 x, G! K
$Listener = PostListener();, k, j% [( }& \) U/ \
4 ?, r/ K* \& B5 w9 p?>7 x3 r; T7 ^: @8 y# v2 I* Q
: J- B( t; o, l: Z9 F5 |9 A
) c8 n8 N! Q% v
/ f9 V& I& @+ z$ l% i2 T3 C4 v
# j% z5 i1 F9 u' C$ F# m/ w5 S3 L |
|