|
|
<?php
& Q' r6 W/ K6 ~0 v8 Z7 rfunction Connect () {
: m- ^8 p! U- z' x) U! n" Amssql_connect('Server','UserName','Password') or die('Error: Connection to DB 5 }% p6 J8 [6 t. ~% {; r4 T
7 t! p/ d# }4 u- z7 d2 K# K% V" |Failed.');4 k6 A( a n8 i1 L. K Q( e5 A
}: O2 S. ^# V N3 `* K
Connect();- ]4 q. x9 L7 P+ S
1 l+ l! ?$ Z) n' ?, ?$ I
function InitForm(){
$ k. W* U; D0 `$ \: t//layout for the form
& z# I& I8 A: Z: Gecho "<strong>Send Items.</strong>
/ m% U; }5 Z U) t& U- _<form name='select' method='post'>
3 d* x$ ]1 u' i, l2 [<lable>Character Name</lable><br/>
0 e* N" t* u, \+ j$ a3 F<input type='text' name='char'/><br/>: P: ^2 b. f" N, T. I/ c6 T
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>. ?$ y2 ]4 L5 I/ Q6 j
<input type='text' name='item_name'/><br/>
. O8 N: M) ?5 n<lable>Item Amount</lable><br/>2 ?. h- V# t1 p9 D, a) D- E+ k0 H2 Q
<input type='text' name='item_amount'/><br/>; P! o' \3 y( [* q# b
<lable>Item Upgrade Amount</lable><br/>! N7 z1 b! R( Y' ^( D
<input type='text' name='item_upgrade'/><br/>8 z; W+ F% X, n/ H
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)2 ]/ b) S y, b; p
: ~& y3 L M1 I, ^) H8 g, B7 [6 E2 s. t
</lable><br/>* G* r" q( S' {$ y% O
<input type='text' name='item_element'/><br/>' M0 o+ T% U3 A: k s8 q) F
<lable>Element Upgrade Amount</lable><br/> _1 r4 p4 ^: A7 i; c
<input type='text' name='element_upgrade'/><br/>
6 F: S6 [' j# v" c! T/ |<lable>Pierced Amount</lable><br/>, t% D1 C4 n8 D' o' W, t, c F
<input type='text' name='item_pierce'/><br/>; m$ W: q l6 I+ J
<input type='submit'/>
; b: \/ u! c1 x8 R- U</form>";
: v( b0 @/ B* V% [6 F' C3 E}
9 x, l1 z8 w9 Q% d& r) a
, r7 {+ e! H! ^ T( ^, [& W3 C8 {( `! Afunction PostListener (){
0 A* u. K s- A& O1 k//Add more post variables if needed and add them to initform() function aswell
2 m* X5 W# v/ N* {5 H+ P% X$ r. R( r. E! X' w/ y% K# R
################################8 k. q7 C* ~' \- c" F
##### Connection and Post ######
, D5 _, m/ m% A6 y0 ]3 R################################; G9 b% t7 i4 E t0 {5 ~* r1 o
$name = @$_POST['char'];
/ i K& d$ @* f, b* W! N- l! ~$ItemName = @$_POST['item_name'];
7 {# U) c7 K% T, e- d$ItemAmount = @$_POST['item_amount'];
5 j i/ I. n* Y' w( l3 A7 i7 x1 d$ItemId = @$_POST['item_id'];
' ^0 p; z& q, W7 X- } q$ItemUpgrade = @$_POST['item_upgrade'];
& h; K$ a5 p4 Q$ItemElement = @$_POST['item_element'];4 m+ k- _% K: ~; Q: L7 V
$ElementUpgrade = @$_POST['element_upgrade'];
]) {; B+ J; i8 x$ItemPierce = @$_POST['item_pierce'];
) r+ b- p& k* K, n+ O################################) L1 x' u, e9 W5 s
; N# k5 J" }) I; @7 i//Check both variables for empty value
9 | C* k" a( I5 z; J6 X4 ]! r4 u0 I
if (!empty($_POST['char'])){
' v4 k0 |1 ?2 b3 i$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
1 n( ]8 e- N2 N9 ~ M' V0 @3 V& w
" c( H$ Q- ]' [m_szName = '{$name}'");) ?! q+ ?' Y3 K
while ($row = mssql_fetch_object($find)){2 p# C! T% C( e6 C! g5 ~
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
2 V/ n8 @) N9 ?8 V6 K8 {. I4 H$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ^+ a O9 U9 G3 b$ [% _1 e% L
1 \9 M, ?' P1 E' n: P) X$ j) b
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
5 {4 f3 s* W8 N# i* y: I! u! O* k, ~
* h- A) C2 z" j9 g7 \+ [4 u. O: ?' |[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, I" s" Q( V4 C' T$ n: T$ l7 }
: u5 G: t) q2 _8 \ o0 d# t4 KN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
6 j8 b* u9 z+ S( A& |# |9 ~# H' q5 K0 J6 I; A
'{$ElementUpgrade}', '{$ItemPierce}');");; d2 |* F) r: ^0 k1 c5 Q: B3 x
}3 Y4 ^7 a: R! D* g# j8 I* N
7 S7 K* B; _7 r
}$ c1 T$ l& Z0 J; u, r! u
3 A& l9 D/ t, v0 l }6 ]}
, d8 x! c% S _/ ^4 |# b! N) j4 t
# i+ Z# ?0 M' v, i" l+ {+ Y9 J9 o$InitForm = InitForm();0 Y0 K& V+ U# n. H
$Listener = PostListener();. {- L! g8 Q# R# w2 s6 y
% X; z2 E$ h" y# s, s
?>
4 |# y) k/ T4 F& ^
, q3 p/ n( E& W' s) j- L: d6 {* Z, Y2 N- B0 Q8 v
: M! }- J" e& ^# L4 ^# q
4 H' I( ^# W1 l/ L! s
|
|