|
|
<?php0 b; A4 V6 v7 a0 _
function Connect () {; [2 ]* U \) B, n1 R
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB " H; K3 O0 M" B/ i7 v& k
4 w- j0 Z+ ]' F) O/ p9 i$ \' iFailed.');% h# [% B. k0 J
}6 T; {" T5 D# F3 K' L
Connect();7 y4 j6 o' f2 \
) A* p, |: {: @# G3 n1 @! }" tfunction InitForm(){
, J6 Y, ?* t1 y//layout for the form
" K: B, ~! b; H' [ Secho "<strong>Send Items.</strong>) D2 h* F3 I% k7 w
<form name='select' method='post'>2 \2 T/ a, \, H8 I4 }1 g: _
<lable>Character Name</lable><br/>/ |# o, R+ \9 R7 t
<input type='text' name='char'/><br/>7 D/ M3 `: U$ U2 J
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>1 f2 a1 b8 h! A" ?9 z' j: A* y) F5 I
<input type='text' name='item_name'/><br/>
+ U2 a# H; m; ^4 ]/ |9 O<lable>Item Amount</lable><br/>
* g" C/ h+ Z" I; f2 p$ e<input type='text' name='item_amount'/><br/>5 m2 j- n4 @/ ~2 m" h7 e
<lable>Item Upgrade Amount</lable><br/>& b) d3 K) Y7 y& m
<input type='text' name='item_upgrade'/><br/>, L0 Q0 h9 p/ }4 r3 p: o. E% Z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)4 d. X0 h- ~0 t
' t/ H9 ^; j. i% o! k2 a p
</lable><br/>& ^) J6 \; j+ k1 S7 {( x9 m
<input type='text' name='item_element'/><br/>
1 K7 R5 W8 f( U' [) n* e8 X<lable>Element Upgrade Amount</lable><br/>( `( C5 {! B9 H6 K/ j+ \2 V
<input type='text' name='element_upgrade'/><br/>
& b1 ^) x$ H5 T* A<lable>Pierced Amount</lable><br/># A9 z, W9 ?% a8 ]3 O# ?4 J) E! }4 L
<input type='text' name='item_pierce'/><br/>
+ g" N2 @* } t5 i' H<input type='submit'/>6 d1 w- M" k* ]3 H* n Y. M
</form>";
4 F% R6 h3 h$ c1 Q- Q6 s3 M}8 q- m, Y$ d( x, C1 `( h) \) J3 e4 J
; Q7 }5 l, r# A8 ]function PostListener (){2 U1 O+ f* C& \) n& ]/ l( [) N
//Add more post variables if needed and add them to initform() function aswell
( G- [- Y+ O) j! O6 U. |6 T' r& J$ p. `3 `
################################
+ O: }2 ^3 j n2 T##### Connection and Post ######
; ~& ~- P0 H: @' J) e$ I################################! s# g" a* b8 ~5 k6 c" ^ Y
$name = @$_POST['char'];8 Q! A" D0 E9 h1 j
$ItemName = @$_POST['item_name'];$ M2 O$ i* T9 o3 {/ g" a8 X$ B
$ItemAmount = @$_POST['item_amount'];0 {) e7 I6 V* _; Q' O
$ItemId = @$_POST['item_id'];( V2 K4 J* x6 T
$ItemUpgrade = @$_POST['item_upgrade'];
! w! \2 Q: t" L5 x `+ H( ]; L: N$ItemElement = @$_POST['item_element'];
. S6 u/ ~/ \6 w a* e: s! F8 R& s$ElementUpgrade = @$_POST['element_upgrade'];$ e: @# V" t+ D
$ItemPierce = @$_POST['item_pierce'];
$ I( Q9 @" n' J. t4 l################################( n1 ~7 i3 |0 C( T
2 `6 A0 `$ K' A3 ]' Y
//Check both variables for empty value
. J+ _& p1 Q$ K
2 R$ l3 A/ P9 `; u. ]! yif (!empty($_POST['char'])){
$ `# C) W* r6 b/ P$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where % o! v( @, W7 X0 e9 t- y
6 D5 H5 z" m% K8 D( M9 jm_szName = '{$name}'");4 v0 m( o5 `9 h
while ($row = mssql_fetch_object($find)){
% b& i; F |, _echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";7 Y9 ^/ J" V& S3 r* V& h4 ]- K
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
, F' g9 ?7 E9 n7 E& w3 e) J. _: o1 k* Q+ j J
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ( k) ^" E' g& k. A
* b+ r5 W: N! B7 V# W* Q[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
/ j0 N/ N, D- d( ?8 p" X' W G3 _; ?
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
& g% s8 e! g3 C& y. r1 i; e( y+ p6 {- S0 M4 k2 ?6 |9 D( e* ~- c
'{$ElementUpgrade}', '{$ItemPierce}');");8 \! P1 l _4 O; {8 H2 S! M+ M
}
) I" c H& b1 `2 G
/ X, N6 x, D" G2 w& x* \}3 H* _7 @( m- I0 X! O0 U% y' {
, J% N9 w( X; S" `}
U% J0 A! T4 j+ S, P
6 x7 N4 h1 h- F$ P$ W' K: E$InitForm = InitForm();
! s* M0 F' N9 C5 H5 r' e/ ^$Listener = PostListener();) `/ n8 W4 m& n3 q- ]7 [/ }$ L5 i
* v7 B" E6 {8 A: H8 E5 G& j8 {$ P1 H?>! I. s% V* P8 J) o. v; w1 T
0 R$ k" e# F4 O+ o# q
$ k! P& c, ]3 S j
' l: [, M8 X i2 }
+ L6 h# ]1 r0 e& a1 D& n |
|