|
|
<?php! H s# Q5 L. b. [9 n5 v
function Connect () {
" B5 j r( }# C8 imssql_connect('Server','UserName','Password') or die('Error: Connection to DB
2 `0 Q* X0 d: F# D7 }$ l! `1 z/ `5 i; b6 j3 b) Q8 Z' H- l q
Failed.');
' c: Y- P6 A) B4 W \, F0 q}3 B" |$ f2 z+ I% n
Connect();% s6 |8 q# E7 @2 r$ L( G7 r0 U
" X& P7 P$ u7 D l0 Y d2 @
function InitForm(){
, v" Y3 e8 \. o4 e3 s2 K, ]//layout for the form. x* s* B1 l! |! i
echo "<strong>Send Items.</strong>+ r: {- b& L+ h% ]
<form name='select' method='post'>
; H! R, Q9 o* |) G4 ~3 q<lable>Character Name</lable><br/>
9 `5 P9 d5 \1 n9 T. z6 U<input type='text' name='char'/><br/>
# x& s0 K6 D) \. T& Y6 f: C<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
& ^5 J) n; Y' k& T<input type='text' name='item_name'/><br/>: G x2 m$ K% i' k% z7 D
<lable>Item Amount</lable><br/>' A* r' i# [ h! I. |/ \
<input type='text' name='item_amount'/><br/>3 t+ D# k) q' H4 M; x0 N6 _
<lable>Item Upgrade Amount</lable><br/>
3 t! _1 H k4 \: U% g<input type='text' name='item_upgrade'/><br/>
" N( |8 f( F$ H3 h<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)2 J& U2 x6 a9 |1 s p- o2 c6 w
$ H4 J+ Q6 F) C, V3 j
</lable><br/>
5 r4 k* A% U1 c/ s$ V<input type='text' name='item_element'/><br/>
; L7 a3 a& n: h<lable>Element Upgrade Amount</lable><br/>
6 @9 |4 g f5 p* s<input type='text' name='element_upgrade'/><br/>3 J1 u" z2 M5 Q5 v5 F
<lable>Pierced Amount</lable><br/>
' c. s2 a8 a3 ^8 M( l" C+ X2 @ Z<input type='text' name='item_pierce'/><br/>
& L# y4 ~# Y3 q/ i5 x# \' Z, \<input type='submit'/>$ C- i1 ` [& p5 m+ U2 i
</form>";/ W- c$ p6 @& ~) T
}) w3 @( H/ q* L3 Y/ A
( z3 K# I7 M" J7 k' Xfunction PostListener (){& [) W# O( ]5 G. W
//Add more post variables if needed and add them to initform() function aswell
; m' I& _' F' r. W* I
! M; {8 g" n( ]+ c) a################################
b B6 x3 v, R2 U8 |##### Connection and Post ######$ D8 O3 G L/ w3 U- X: N; R$ K
################################& E9 k, v7 B1 {5 g2 G+ U) w
$name = @$_POST['char'];
# L6 j+ H! ?% Y$ItemName = @$_POST['item_name'];
. g) B- H2 _, C G7 K( v+ n$ItemAmount = @$_POST['item_amount'];
: Y% R' ?( F, i$ F: A$ i5 J$ItemId = @$_POST['item_id'];8 w X- b; j! J6 }2 S
$ItemUpgrade = @$_POST['item_upgrade'];" ^+ B4 Z, B" [& C/ M
$ItemElement = @$_POST['item_element'];
$ A/ ]. v2 ^- B/ G1 N$ElementUpgrade = @$_POST['element_upgrade'];" E; u) [# f3 H1 [
$ItemPierce = @$_POST['item_pierce'];
# h) R/ k% r: P O' O+ Q################################: Z+ J( G# m3 L# e3 `: O" y. m
% x& i: X% T& @" m7 W* ^
//Check both variables for empty value5 n$ D- N, o- s0 e' i2 ? ] S' T
0 e% {4 k" W' {; K) z0 [( t
if (!empty($_POST['char'])){
6 p- G# e3 d6 W! l- o$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ; e7 y9 l& u) |( N! e
" v4 |* ^. `" o1 x2 Y: e6 G
m_szName = '{$name}'");+ _+ B9 M" A; t; A2 |0 U) Q" M
while ($row = mssql_fetch_object($find)){
) c7 b" A3 f1 r6 X% {. w. b* {1 zecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";+ j8 {$ E! q7 A2 B, v' v/ K
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
7 G J: m- h2 `) e, B
/ T O3 b8 U: z- S& G: n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
4 w+ B' R' J+ Q/ ~9 e7 n9 _( l( j8 b# Q) I6 }. J0 y
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 6 V) e8 q1 I. Y3 r* s
4 U2 b/ g" C' a% ?) TN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 6 q2 _7 Q' p" g
# u% a8 K! X+ M! v, q) ^" x
'{$ElementUpgrade}', '{$ItemPierce}');");2 P+ o# e1 D$ ~+ N
}" x* \. O; e( X4 T0 a
" L3 s6 \0 \3 t4 |# T7 b}
. s$ x" d0 e: i. x6 Q. s
9 D2 r/ O8 }( g5 V8 p}1 T+ p# O( o# p2 N
% q% S- U$ t E0 y' A/ w# V
$InitForm = InitForm();+ M; s0 E/ d6 X2 p: S
$Listener = PostListener();
* `. ?, E* g9 H( k5 \$ n
/ g- O7 l3 \$ b. L6 {3 k/ c+ o5 q4 K?>
5 H% T/ m; h. d, D, ?7 M. H8 O3 b8 z
4 @7 i O p! R: R; j; e% Q: J! _ W& ]- l/ r
) y" g5 y& C( s3 K |
|