|
|
<?php
8 E* R5 o' c* L% p" Yfunction Connect () {
' ^* s$ T6 M* Z" j0 x6 Z, f& Wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
9 i# U% m; I, M$ e0 T: @, F( C& d' `- k
Failed.');
) C# L# `5 t- `}
2 O, W7 d" i! R" m9 ZConnect();
$ l5 D. }2 f$ N/ I5 }7 x3 G$ d& J7 v8 k7 f
function InitForm(){( F. E- S0 j# L' u' q, G/ n( m
//layout for the form
2 ]4 g. q, s# U* z9 W) Q9 e2 M' f- ?% gecho "<strong>Send Items.</strong>
7 Q! _7 @: z# u1 f+ n<form name='select' method='post'>" a9 O" X1 X9 [7 i
<lable>Character Name</lable><br/>. p: ~1 {/ x8 Y0 K" i
<input type='text' name='char'/><br/>7 Y$ R0 m- `' P
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
! p& b0 o0 G! [: [<input type='text' name='item_name'/><br/>
7 ?, Z8 L* Q3 G! e0 H<lable>Item Amount</lable><br/>/ m/ a- K" B/ |8 c* u
<input type='text' name='item_amount'/><br/>
: p2 m' w7 w" t<lable>Item Upgrade Amount</lable><br/>% o2 g- R, E( |! z, \* [
<input type='text' name='item_upgrade'/><br/>: p; u" g w) M. @7 e
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
- \5 V5 ?2 B& V1 i. g, H1 V1 E8 F8 B1 G' a0 y5 Z
</lable><br/>* r1 L! f5 ]" P6 t3 f2 F
<input type='text' name='item_element'/><br/>3 W5 Y! g( V3 c6 ?( G8 e2 n7 S
<lable>Element Upgrade Amount</lable><br/>. ?/ C; b) o+ g0 j3 S
<input type='text' name='element_upgrade'/><br/>
$ p, C/ x& W2 N0 i<lable>Pierced Amount</lable><br/>
( k8 G O! D7 S' E+ J<input type='text' name='item_pierce'/><br/>
" k. v9 C8 U% P# x3 t<input type='submit'/> Q0 _7 Y) n) K8 R) z: g
</form>";
7 F+ s( @4 a' P0 ^2 m}, n9 B. i h: g; H) [( Q' ^7 ]" Y
/ r6 E5 P/ C0 I Q
function PostListener (){
( @$ W& z" ]% B9 X1 h$ o//Add more post variables if needed and add them to initform() function aswell
* g. X @& m* W; h" V4 C# e7 d9 \$ r: o+ Y
################################, }' X; z% K7 l i( O6 E2 K/ X
##### Connection and Post ######
; Y P4 Q' [5 m- ^, a3 \! }6 B {################################/ A y* g# A, t8 O" {7 ^
$name = @$_POST['char'];
7 V0 U- B. j) z* n3 F9 a- d1 }$ItemName = @$_POST['item_name'];
, m# i$ G# |; M Y; U9 V- N$ItemAmount = @$_POST['item_amount'];
7 B1 m2 ?6 d' _# v# ^& _$ItemId = @$_POST['item_id'];
1 e; S# r# P0 e: H( V( D# q" B$ItemUpgrade = @$_POST['item_upgrade'];9 G" p% z F7 m
$ItemElement = @$_POST['item_element'];
5 J. J8 m" h5 h$ K6 C# W( s7 I$ElementUpgrade = @$_POST['element_upgrade'];0 H: s+ }9 h7 k1 m# U }
$ItemPierce = @$_POST['item_pierce'];' V7 a+ b4 L' n/ c. Q0 k
################################
$ Q) M' f% @ p# _2 W; r( ~5 c. G0 k/ I# s- `) i4 }$ @
//Check both variables for empty value
B9 S2 Z, K% m7 |) Q$ R6 Z1 t/ f. d* z! C/ u
if (!empty($_POST['char'])){7 O0 l: C8 D7 J1 M, x
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 2 I) t- @: R) B4 y
k" R3 v3 a3 j5 e) K; S0 ]m_szName = '{$name}'");2 A3 W/ A9 a+ t! h7 M" a; ?
while ($row = mssql_fetch_object($find)){' k; ~/ w9 v1 d9 O8 r
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
6 K {7 J [. w6 k' {5 Z8 P1 \$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ( y5 [3 L/ i' v$ |% Q$ g7 U
# b9 w$ a$ r, M4 W0 Z3 z[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], / z& g- ^2 g1 V! w. y
/ E- j( i4 Y& C8 O2 C[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
: t, B& m/ @2 A1 z4 ~5 a* I1 z5 q6 }# E' x8 L
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
- v) s1 J4 D6 z) V9 W& `
- \% N8 F; K; ~3 Y5 K'{$ElementUpgrade}', '{$ItemPierce}');");
0 l- V0 I; Z' y* r8 ?7 y7 o/ A$ Q, }}
3 S& Q2 f3 [$ L( Q
2 N% i. P' o- e5 f" k1 Q}
, u9 Z9 l! B! D0 q- }& L( N. I# p! U$ p. k: t5 N5 @
}- w/ H2 a' ]! S. E
v8 K$ [& d. A; V8 J! t3 }$InitForm = InitForm();1 p0 Z0 O+ X& N- K. K' j4 K. S; `
$Listener = PostListener();, c9 c, |- Z- @) b. F; M. e- Y
0 z8 J, l3 q' Q4 R" t( d. I! g8 M) w8 r?>
( j0 ]0 d. n# P- N- u, {: d1 @/ L" F% U, z/ T. D( Y4 L$ d( y
& ?% a f% X5 |% A& w+ J
0 M" d- `" B! x, q9 g5 w3 W; K4 w8 b* I3 ^) @1 I, @7 \7 g8 i
|
|