|
|
<?php) a2 ~) H4 l8 h F _; {
function Connect () {! R" L! Y! X! P+ X Q
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
; \7 a! n8 h, Y+ h1 d* J
5 Z' o8 h9 T& E! _* yFailed.');
" T+ g, W* H) ?( r}4 [- P$ s: p* } g( ]2 E5 f
Connect();
( S& ?" }% k& o) k E- j7 b2 D: `9 Y9 ^. R
function InitForm(){1 X" j) t n7 v( x( z5 M
//layout for the form! {1 } S; p6 k
echo "<strong>Send Items.</strong>$ Q$ _' {* W7 f, P$ [6 l
<form name='select' method='post'>
$ S( ~) \) D+ }3 ?8 |" p<lable>Character Name</lable><br/>
- y! |' k! N- o. D n! O<input type='text' name='char'/><br/>, D6 r3 x6 Y( s) Q y) ^
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>7 Z( K3 T3 X. _- {) I' J+ T
<input type='text' name='item_name'/><br/>
J, f( \. T* _. X) c5 j( }1 ?+ {<lable>Item Amount</lable><br/>
, i: d2 A& D. ^5 x: w. _<input type='text' name='item_amount'/><br/>/ V5 a) S7 A% {- w4 A0 L8 H; d9 `# a
<lable>Item Upgrade Amount</lable><br/>6 H2 @1 e' P3 ^! a: Y- F( H* k
<input type='text' name='item_upgrade'/><br/>) u S1 H! ~! P0 a
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.): r S6 N! _2 y* ^6 V/ j
& M9 N8 Y2 L" n; ~. a
</lable><br/>. _2 @% b, q' a" ?/ m. L. U
<input type='text' name='item_element'/><br/>
2 l& T- P% r( C+ b/ i<lable>Element Upgrade Amount</lable><br/>2 E3 o5 |9 W( ^
<input type='text' name='element_upgrade'/><br/>
`% M' m% y$ n( v( H; U<lable>Pierced Amount</lable><br/>
! X2 I" B; |; [2 i# y6 ~' K) t9 z<input type='text' name='item_pierce'/><br/>
# M1 T/ S% x1 b3 `6 k: c<input type='submit'/>1 p. n& B8 }/ k8 f7 F( n0 }
</form>";) \& _1 P1 h- ~- t4 A
}, B3 _' G8 u) ]0 D% k
! _/ I( Z2 z q4 Rfunction PostListener (){5 T2 K) ~: \' l7 h
//Add more post variables if needed and add them to initform() function aswell3 l; q& |; `7 R
0 K; `" [, u5 w7 M################################& `( Y9 P/ W+ P- b
##### Connection and Post ######2 y9 C! d" E" z8 _% j* [8 o: b2 A1 F
################################9 E- y y% f& ?. X' V/ i. b2 x% r+ g
$name = @$_POST['char'];
2 L( O5 [1 V, s( K9 `) Z4 L$ItemName = @$_POST['item_name'];
! J5 T+ W* X/ M+ p# Z1 K$ItemAmount = @$_POST['item_amount'];
2 J( p# ~; |/ Y' q% ~$ItemId = @$_POST['item_id'];$ h! B0 g$ r; ~* w7 _; E' {
$ItemUpgrade = @$_POST['item_upgrade'];0 f$ U1 `/ ]1 J9 `2 A0 [( M# j
$ItemElement = @$_POST['item_element'];) c& x1 P1 g3 l" b, D& X' J$ O$ A: l0 M
$ElementUpgrade = @$_POST['element_upgrade'];" Y& B1 F d6 |! P1 ?' ?- G
$ItemPierce = @$_POST['item_pierce'];% s7 B) S' t2 l. a3 R
################################. {. j0 K5 v6 W( A# s
: i& ~/ r0 [% N& P# J: i//Check both variables for empty value
4 S$ i( E+ y+ N) n: B* c/ I$ D- }1 ^& p: f* w6 e' ?; ?) Y3 r0 v
if (!empty($_POST['char'])){/ j! d' ?. _8 F& E
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
7 V+ M0 F& ^8 O3 I* w2 B& Y" @, p9 J
m_szName = '{$name}'");
4 i9 l# `+ F$ n% Y3 lwhile ($row = mssql_fetch_object($find)){
% H! S5 s, `2 _" h# y, fecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";9 |# {" o2 [1 B$ d! `
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; R3 \" s" H# H0 L- @3 |7 g( g5 S5 ~' U6 U# Z! r3 }
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 4 F/ j- k3 J& |( }1 g8 ^
2 X$ R! e% z% r% w[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', , E7 Y" O( n3 r) v9 O% f
# k+ ~9 T. N3 T4 V4 ~! y2 w: m
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
- c9 d) ~8 j2 x* s' n+ ~' J9 j. A
% `& U' Q; L* P" u1 K'{$ElementUpgrade}', '{$ItemPierce}');");' o; S2 s! w o, ]
}
- w! @! L3 V* Z
8 Y% n) U6 P) q1 c, h}6 R3 A- H( F( A) V& G
9 q/ f7 x _# ^( l U
}
& {! P, R$ V2 C! V8 O/ i
) d* [6 r; _" u, N1 {! l$InitForm = InitForm();$ o( Y0 f' j" {7 A8 v
$Listener = PostListener();7 {5 X( b1 b3 x; J8 o) x
0 i& ~ S% [2 t, |; r- Q! z! C
?>' S M8 _4 y) t
/ P1 Y; C1 w' c, ^
: I% @- t! r! h) a* Z$ H
+ O) z& I5 _' k3 x$ q
; t) m* O1 Z/ Z& J1 G |
|