|
|
<?php1 i) R$ c4 C9 U S9 z6 y
function Connect () {
4 j! F; e, w# {mssql_connect('Server','UserName','Password') or die('Error: Connection to DB , ~# O* N" T0 Y+ q0 u
Z: b* k3 g3 ?& @
Failed.');) }* U7 _/ u5 @( P
}
( \; i1 L4 l- Z# t& R( \& jConnect();
/ M8 Y O. Z: _1 o7 F( C
( D4 q2 Y. e9 ^function InitForm(){9 L1 n2 H5 W; _
//layout for the form
7 {8 q3 k( o- _0 y( uecho "<strong>Send Items.</strong>
2 @) }7 E% f; k<form name='select' method='post'>
, h5 N- R' W: u2 X# a" J9 W<lable>Character Name</lable><br/>4 B+ H( F7 g) R; W+ o
<input type='text' name='char'/><br/>
7 o' ~0 o# R5 A/ Z3 V( Z: t<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 ^5 f8 ]6 D* ]6 C<input type='text' name='item_name'/><br/>
) n( b/ |2 R& ?/ K) c5 g<lable>Item Amount</lable><br/>
6 |1 K7 t2 ~, [; Q<input type='text' name='item_amount'/><br/>
2 |: V; D2 p% p* y+ G<lable>Item Upgrade Amount</lable><br/>
$ s. {& T T' X& c<input type='text' name='item_upgrade'/><br/>9 @) s, g; n: w$ T
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.). X5 y5 s+ Q7 L3 |* Z6 i
9 z `" z$ s9 W) p2 j3 q</lable><br/>. v- ?& p6 O3 L% u9 q
<input type='text' name='item_element'/><br/>- ~6 {$ [2 y4 F* k) G- \1 B3 o
<lable>Element Upgrade Amount</lable><br/>* z! F0 F3 s& n5 D$ b8 ?
<input type='text' name='element_upgrade'/><br/>
) l T& ~) o' \5 |- o! ]<lable>Pierced Amount</lable><br/>* A. q+ a! c3 j( D- {) S
<input type='text' name='item_pierce'/><br/>9 u8 P' D) `" r* w/ z- e; |
<input type='submit'/>8 P2 ]# _8 W& h! K
</form>";
3 p2 I6 z4 J: A}. d# x& p. g3 g, c4 T6 W7 {( m% x
, [8 x; t$ f6 s' ]5 z+ o
function PostListener (){
2 y. h7 q2 J6 c) \//Add more post variables if needed and add them to initform() function aswell
6 t/ H! N) D+ m" n o( H* d
5 {! Q1 y- n) E2 q2 @& J# M0 i. F################################
6 `, O; ?% l' H9 v$ @$ I$ Y" o. [##### Connection and Post ######
2 G2 j- y0 B$ F/ ^% [5 u################################ r& J$ b O: ]$ |6 V# ]
$name = @$_POST['char'];
7 z* E h1 {/ F( ]5 G$ItemName = @$_POST['item_name'];& ~1 f9 a! x4 ]
$ItemAmount = @$_POST['item_amount'];. c3 d* G+ Y1 i: j* C) A& z0 s
$ItemId = @$_POST['item_id'];) ~$ \( h( ^7 i* V$ K
$ItemUpgrade = @$_POST['item_upgrade'];
) h- @' X7 c3 C* t$ItemElement = @$_POST['item_element'];6 p3 H, u+ z* p
$ElementUpgrade = @$_POST['element_upgrade'];1 |- ], K% ?6 B0 [
$ItemPierce = @$_POST['item_pierce'];- w, ]" j/ Z( d' `: A: U. H" u
################################: L0 X# D, U* p$ E* B, x1 }* |2 O
. }, Y: C, R, X) L" G- |- ^. D
//Check both variables for empty value
' L6 K& z" k, g {8 o- E$ F0 ?5 s2 C$ K0 B& ]5 x: h1 i
if (!empty($_POST['char'])){
+ `2 U6 Q* U, H" Y1 g G! j; z$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 4 r( {9 b$ w% s" B
/ I Z. a V3 j" T7 S# J# t- i f1 dm_szName = '{$name}'");
( _8 H; T" h$ T: T+ [9 X# D( J( B" uwhile ($row = mssql_fetch_object($find)){" m. d6 ], `- G6 d. U
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";2 W2 s: c: M3 k+ v: N t2 G6 k
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
$ w/ k( `( _7 T# W2 n. L5 N' c; ~) I( c: v( u" }
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 5 j" b$ }3 ^' e" x. j3 Q
) t v3 f9 Y2 s
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
5 G& F& Z% ^8 B+ W$ }/ l' X5 {/ W. c. v6 P4 l6 Q" E
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' O. W4 X5 S$ v8 N$ g2 Z
( x* v: P# y$ w: r M, z, k
'{$ElementUpgrade}', '{$ItemPierce}');");: h+ u/ E. E. Z8 g/ A$ s& T
}+ P3 ]* V6 k2 }
3 @" i& w8 \ ~. F& N% V2 \}
* i! j& y' D, I2 n2 F) j: l5 L
! P3 Q8 E* ` H3 T! Q* F0 _}" |- C- p& R8 f6 L
6 t7 p% u1 S& o; k. b$InitForm = InitForm();
* V2 E4 h; k& G4 A2 l5 A2 s8 l$Listener = PostListener();
9 g( j) b7 x3 J8 n
+ ^( B9 x4 C4 D! `9 y2 f' I?>* u1 p/ ~. V, ?/ B
; d2 Q- w6 c' F* M% A0 O3 p$ F0 t7 e: G% |. G* J0 B' h
" u& x/ g W3 M5 P: w
, O5 v2 f) i% G5 f; }' u, z |
|