|
|
<?php+ b0 ?$ h2 z& w* h$ c }
function Connect () {5 m# y* P( `, x, C j$ }" [; w* _
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 7 E1 j) W: g. a* ^& F
- O0 k4 O& x p" M
Failed.');2 J+ j9 s* p X9 v7 y
}
i: y8 [" d5 ?) wConnect();0 b6 R9 R, W3 \2 R. [
r# {, l+ T/ H3 R1 ]$ Jfunction InitForm(){0 m. q2 u5 c6 W
//layout for the form8 w5 x1 {; v# t4 d
echo "<strong>Send Items.</strong>. P+ }6 _" m) N2 z& y; d6 `
<form name='select' method='post'>* _6 @& H& u) M2 ^* E
<lable>Character Name</lable><br/>
, S+ F$ `4 q8 Y<input type='text' name='char'/><br/>. v- y0 h' |6 W
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
! s: M- s9 d8 h0 x4 _8 \<input type='text' name='item_name'/><br/>2 E$ @) A7 A: t$ p2 F) }7 [1 b
<lable>Item Amount</lable><br/>
+ L! g* F k7 @- { [4 D% Y, [! r<input type='text' name='item_amount'/><br/>- O; v) ` B! u0 `: C8 V; s
<lable>Item Upgrade Amount</lable><br/>3 M* X6 {5 @- g
<input type='text' name='item_upgrade'/><br/>: q4 B: O3 X' o3 c
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)/ H& z/ l3 N' {/ G) e: W
5 m5 {! ^' k3 n" |8 k</lable><br/>
' r4 z0 [, a6 `<input type='text' name='item_element'/><br/>3 x: g' h% G- K/ @. c1 ^9 D9 ?# V
<lable>Element Upgrade Amount</lable><br/>
7 g; w& ^7 r5 u# \) P5 A<input type='text' name='element_upgrade'/><br/>" s$ r0 X+ B+ [/ r+ M/ F1 G
<lable>Pierced Amount</lable><br/>; Z/ d/ v- T) E( q' G
<input type='text' name='item_pierce'/><br/>/ V d- P" f& N' s6 u' v# T, g! B" T7 C
<input type='submit'/>% q0 k1 |9 G- q2 ]
</form>";
+ b+ k8 K8 x7 x- @- Z- Y3 B} l. M/ z5 s3 g
1 S( F$ ^; v% ]% Jfunction PostListener (){. H+ L7 J9 K; V8 P3 Y9 S
//Add more post variables if needed and add them to initform() function aswell
' o! j. w6 i( [4 w3 {+ e# h
( z A# p, [( c+ {0 D( X################################- d) E1 \- ?: g' }+ [6 Y: C
##### Connection and Post ######
: z5 N$ j% E- h0 J! m7 O2 m( n) L################################
! [, }$ x5 h ` I$name = @$_POST['char'];2 d4 c. [5 P6 m' s1 r5 p
$ItemName = @$_POST['item_name'];
' \% L V8 t- m* j$ItemAmount = @$_POST['item_amount'];
2 X# L1 C1 l! ^' e+ o7 P5 G$ItemId = @$_POST['item_id'];/ V. f1 z: ~" g5 q( P n; q
$ItemUpgrade = @$_POST['item_upgrade'];
9 K8 M0 M7 R, m& C& t3 L$ItemElement = @$_POST['item_element'];
" P( O* |1 a. U; Y# c5 o# p$ElementUpgrade = @$_POST['element_upgrade'];4 G$ q* r6 a5 h4 m" j! ?
$ItemPierce = @$_POST['item_pierce'];
U, _7 [# V6 S. W6 V0 u################################
7 x" \' n" ^% `; p9 o; H- x0 _! }2 l$ c \0 n; Z0 w
//Check both variables for empty value
7 n. ] E [+ G' @# [, z- Z2 a7 E" c5 a8 d5 h5 x, d, r( e
if (!empty($_POST['char'])){9 ~9 [7 a. v4 t8 \3 n1 P
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
! t4 w# Z( S; Q4 y5 H8 T, ?4 U( O0 F' b5 E, r
m_szName = '{$name}'");
$ ^+ j7 _" u T% }4 lwhile ($row = mssql_fetch_object($find)){
/ n U# w8 k2 y. c' A2 D }3 }echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";! G2 E" w' k( U/ Y6 h. G) n( c" z! @
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
9 I- [0 x& D# w: Y: @
; `/ K% Q" A1 F. Y+ Y, A[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
1 A* u; h' Q5 A
7 z9 z+ c2 ^# M( m[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
6 w6 \+ K/ A% ?# H t8 J# f0 L6 Q4 \# \, M
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', + H! e$ K! }5 N
: a+ f7 q! P7 |( U A. r'{$ElementUpgrade}', '{$ItemPierce}');");/ v! t$ A( e! G( W5 R8 n
}
5 l8 Y$ d; T; Z% o% S) \/ N6 g; K
}
( S( g/ Q' B1 h; j+ M& I _- I/ ]# d; D4 ?/ `$ S: e+ i
}; H3 D& v- ]' z o! p
8 _" Y% k% m9 b" D/ p! @3 J" T$InitForm = InitForm();
* o' i) T6 Z8 [& r t- m$Listener = PostListener();
1 y% n! o+ ^) k2 c8 ?4 i% P% Y0 k, B
?>
$ z# R8 G" u# w
! D& A* I/ g9 d' C
4 z, p( A; R! k8 x$ @; k8 M4 }: b- ^% V8 z8 e. w6 a) \
7 L) a1 S0 b P G |
|