|
|
<?php
; Q# d9 D& o7 c' e- l& I1 J9 k' t9 jfunction Connect () {
' s$ R: W. x4 A7 }mssql_connect('Server','UserName','Password') or die('Error: Connection to DB # K) K+ l. d/ a+ v& Y
) l. p8 l, ?2 t3 J
Failed.'); Y, S/ Z3 R+ ` g3 F6 U, m( l
}( l# Q) }3 @+ G$ Q7 t s% f
Connect();
* T* e1 c) a# q2 Z
% k* o, Q+ R; R/ G, ?9 rfunction InitForm(){" i6 {) V# p( E; K
//layout for the form
8 q; J/ R3 E0 M; {& Vecho "<strong>Send Items.</strong>
3 |, ^& b& X! m<form name='select' method='post'>
# |/ T; ?8 Q7 E4 d<lable>Character Name</lable><br/>
, v S0 L% \. s+ z% C/ i, d5 k<input type='text' name='char'/><br/>7 W% \# z! d' I( j6 ^
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
9 C' e/ Q) L1 T- K' W2 W. l<input type='text' name='item_name'/><br/>5 n0 W9 K( `6 J# r) R3 a$ |+ n
<lable>Item Amount</lable><br/>0 E& u, z( j! x1 p8 O! S
<input type='text' name='item_amount'/><br/>
4 o/ C/ j7 I& P! E- y' o<lable>Item Upgrade Amount</lable><br/>! c- t2 } f R* O
<input type='text' name='item_upgrade'/><br/> [9 y/ E+ Q: a3 t% H G# B) z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
9 a3 `& K u$ {( X" b- D
- r( f: U4 i, z& i7 q</lable><br/>* n! y, r* G7 C0 w6 F
<input type='text' name='item_element'/><br/>
$ F# X* p9 |& D3 q# h8 J# Q0 o7 r<lable>Element Upgrade Amount</lable><br/>
) y9 U/ i4 ^" K; |9 z/ n<input type='text' name='element_upgrade'/><br/>9 g9 @2 Z- h4 N. J/ F
<lable>Pierced Amount</lable><br/>
* i/ d/ ]5 ~. F<input type='text' name='item_pierce'/><br/>/ A6 Q @4 J9 I) ?3 G+ y
<input type='submit'/>
: d/ r+ U+ t( }6 E</form>";
& _, J$ Q2 X! b3 ~3 x8 A5 S) [3 K}
+ C' r0 [# m" |% Y0 T: \: D3 I9 c2 w6 C! ~, Z& P5 ^- |
function PostListener (){
$ ~, ~2 H9 y# i& }: d- G//Add more post variables if needed and add them to initform() function aswell
# ^9 Q& p7 C7 \
' H/ f) d4 m0 C" H################################# k3 A% H0 T7 X. z
##### Connection and Post ######) x3 G; X. s6 B5 U* `
################################: s( Q; Q0 U. e0 J ~
$name = @$_POST['char'];
& D' `3 S0 D$ ]$ItemName = @$_POST['item_name'];, T1 ~6 G( M8 d- ^4 i2 d
$ItemAmount = @$_POST['item_amount'];
4 v1 F& D3 B8 D/ s3 Q9 j$ItemId = @$_POST['item_id'];
5 g9 b* u4 x3 }" S0 H4 J% K$ItemUpgrade = @$_POST['item_upgrade'];+ t$ g1 i p, z) o2 m2 H
$ItemElement = @$_POST['item_element'];5 c8 K, c( F) `/ D9 V
$ElementUpgrade = @$_POST['element_upgrade'];
0 m' J: |) `8 k4 [) k$ItemPierce = @$_POST['item_pierce'];2 i; k; F6 L6 F, K( i" H
################################
$ w7 `% D) X% d( z# y* {4 i& W o+ Y' w5 I, E+ F8 F" G4 M# d* x
//Check both variables for empty value
+ E5 }, Z& j# m
, V K6 z& j7 \3 D4 f. _: g: tif (!empty($_POST['char'])){$ f# l! q& r e: X4 I W
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
3 l; \5 t( p7 A ]2 W, L' n
5 Y# K7 b# A3 l( x2 vm_szName = '{$name}'");/ q$ D$ G x# G8 P: g8 G
while ($row = mssql_fetch_object($find)){1 T& h! x' Y. ~( f! [$ u4 K# R/ Q) a
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
; h% a3 i. T( S( J2 s- ]7 E L$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
' t' i8 `( J' m5 z6 |$ Q9 [" z6 Q- z' @ }0 k, s6 b' @: \5 |
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 {+ s8 z2 ?! L4 w/ i! ]3 @
2 a' }% A+ W4 Y" [3 E( d0 u* H M[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', " V% t- d. f( \$ F
. l+ a: U. v: S' r+ b. R* L
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
! G' E6 O! O% o# P
4 \& |; B$ {/ M' n( q'{$ElementUpgrade}', '{$ItemPierce}');");
- j o' m6 V& o3 L# G}
& M+ `8 z& A6 O8 K6 `- u& }) }, C3 f# x% }8 G# D
} G4 x9 x- d( @/ V
, `9 E7 G' s% S& X7 n}
: Z8 c9 l& e+ H6 V9 O7 G
) R. O! ~. y/ g$ S0 N* d1 L5 t$InitForm = InitForm();1 ]8 g! M+ Y8 }7 K3 \
$Listener = PostListener();
+ U# B+ F' Q& p$ m
6 w* r. }* p& R?>
: p0 w1 U( L4 T6 p7 F4 w7 K; f" J7 @$ e. z, L
6 s0 D" A1 f8 j% P/ w) |" F) r2 o) M* x
3 N7 }5 ^& l" n' v( k/ W
|
|