|
|
<?php5 `5 `2 _$ q& R) v7 e# J
function Connect () {
& `, Q1 Q9 r$ {$ s3 K5 o5 {3 I6 _mssql_connect('Server','UserName','Password') or die('Error: Connection to DB # B& J0 R6 ?+ c# K' G
, H) @/ l# c2 O1 b, `0 A" sFailed.');
) H' H2 q% z6 ?2 U}
8 o' j0 C- |# Q, oConnect();( w# D9 ]' a. L( ^( A3 e
# o5 Q. d [2 J. e" @+ F
function InitForm(){
8 Y! ?' }3 \" o9 s6 d0 Q% {//layout for the form
! L, c& ]9 Q6 u! b: becho "<strong>Send Items.</strong>
7 k9 Y$ W- v5 @) L9 c* B<form name='select' method='post'>
% K9 t2 d% k$ N2 v<lable>Character Name</lable><br/>) ~- c# V, Z' M! P& k" M- E
<input type='text' name='char'/><br/>/ J: C& `( u7 i5 D1 R5 A
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
7 k* g4 ?, n' w3 I<input type='text' name='item_name'/><br/>
: z2 S5 J# r4 A( e<lable>Item Amount</lable><br/>4 P8 X* p* n% Z5 X8 b
<input type='text' name='item_amount'/><br/>$ ~/ G0 s8 h) a1 X+ P+ D3 i6 Q) P
<lable>Item Upgrade Amount</lable><br/>
2 L: D1 R: U( Q<input type='text' name='item_upgrade'/><br/>/ G3 ~& _7 V4 I+ N6 z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
0 Q$ n: V7 e) P0 \
" i2 V3 s2 c- Y3 X( Y5 W</lable><br/>- K' s5 V. s$ a3 y1 k
<input type='text' name='item_element'/><br/>
4 r7 F! s: Q, z<lable>Element Upgrade Amount</lable><br/>
0 l- b/ q# F- E1 w, ^4 L, ]<input type='text' name='element_upgrade'/><br/>7 k- C. Z D$ [1 F
<lable>Pierced Amount</lable><br/>5 {) Z1 c; K: N+ g% V
<input type='text' name='item_pierce'/><br/>' t+ O3 k/ {7 k# ^
<input type='submit'/>* o. g, i I# r& ~8 `6 P
</form>";% }2 t$ a: s4 W1 J# D. w; F
}
% @) I1 \4 H# C d% L3 T$ x. Y1 M! h
function PostListener (){. I9 ^3 R0 @% c9 ]
//Add more post variables if needed and add them to initform() function aswell
; }7 }+ `9 Q7 I/ p# k* |1 k0 `, \& f" c. M0 D/ J8 c1 F3 l
################################* O5 ]8 M7 Z$ y6 L* u5 c
##### Connection and Post ######
d( I h- |/ U7 _ f1 z) S: x" c################################
]) o# V% U2 \$ z$name = @$_POST['char'];
7 J) a8 C4 H5 K9 Z: |5 b- w' ^$ItemName = @$_POST['item_name'];- ^! V" X- J8 q, a
$ItemAmount = @$_POST['item_amount'];
V; N" z+ ?9 v$ o$ItemId = @$_POST['item_id'];
: Y, Q f6 a3 @0 q6 l1 i$ItemUpgrade = @$_POST['item_upgrade'];
5 h5 t1 V4 W& I" A9 N0 }1 w$ItemElement = @$_POST['item_element'];
" Q e. _/ I$ R4 }' }$ElementUpgrade = @$_POST['element_upgrade'];7 ]% {- V+ O7 Q4 Z% e
$ItemPierce = @$_POST['item_pierce'];+ J% C+ _# ~% J" N& W) d
################################" [" G! v# K' ~! m3 h' h' H7 F
7 I" B" o- Q: V0 g$ \; o//Check both variables for empty value
" x W. N$ l" z& ^- R0 g5 {0 \7 y: e' V, P6 w% f: A2 [
if (!empty($_POST['char'])){6 r2 n% e' U3 v8 x, f* I3 ?
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 7 q' T) h9 Q# T1 }
R& v5 X1 L9 Z/ m3 c5 _2 Rm_szName = '{$name}'");
* @/ C" A( A: Z( o/ ~- wwhile ($row = mssql_fetch_object($find)){8 G$ _' n4 n8 d( v$ \ F
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
3 b5 v! d$ u' G; E- E$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], " x0 y0 H+ v0 i" q
) N* O0 S" E' V
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 3 G+ Z- p* ^& G8 ]
* U% }. J+ Q9 E8 B- R3 l
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, H% e/ D# h6 N) C0 m; P& D: O3 [3 P5 C; B7 o# x
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
: m3 B2 c. p" X" ^+ c% C! T4 ^3 E+ R; k+ d
'{$ElementUpgrade}', '{$ItemPierce}');");
, M; d5 O" [7 n/ s0 B}$ v3 ?+ G* p3 P
( N+ N+ c: Q6 C- w) H( B
}
6 g0 y( z# p9 B, ~0 ^' l) V2 o2 ~' M4 h
}
% h' w0 {2 A" i/ R- b: i3 H" y0 x7 H9 }
$InitForm = InitForm();5 h9 @, Y# @1 n/ w
$Listener = PostListener();: t4 }7 w0 Y3 x
- l1 C9 h9 i0 {
?>
/ ~5 S9 I& D! l" } U' e, t5 O0 \2 p$ }( K7 d& G
" A/ r4 w0 }' {4 y. H9 L U2 @' D
+ i/ X0 r4 i- |5 L
1 k2 L1 R" X! c# y2 C1 E, g
|
|