|
|
<?php& h; E" r5 h" h- @& P& ^
function Connect () {
( x" c- v4 S4 y$ rmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 1 D$ U$ c% J# t* @2 ^
7 {' i$ [! l! N! j$ ~
Failed.');' i9 @6 @' j( H. O6 V
}
6 h) ^6 s6 V& k6 [Connect();4 e3 Q8 J: q. v: o, X- O
- s' }% }& M( O2 b7 |' S& u! Jfunction InitForm(){
$ O! \! b! R) n( o* |- Z- ~//layout for the form
3 L) ~/ S4 S( i" D; Mecho "<strong>Send Items.</strong>% c# c- o' b e( H& c
<form name='select' method='post'>, Y, V1 P8 D' G2 m4 D1 ?. z
<lable>Character Name</lable><br/>
' U7 j3 t1 I I- n! ^. e( O6 ~<input type='text' name='char'/><br/>
1 k9 U2 Y6 }2 T: ~4 T+ M, ^<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
{) D; k. b: c4 G. `<input type='text' name='item_name'/><br/>% V; g9 i6 g$ m Z) Z
<lable>Item Amount</lable><br/>4 Q& r' W. M0 q9 o
<input type='text' name='item_amount'/><br/>7 M9 P4 f I' h$ v
<lable>Item Upgrade Amount</lable><br/>
, E9 j: E- `( Y3 k3 c<input type='text' name='item_upgrade'/><br/>% a8 ^6 o/ ]. |
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
( V: @0 N ]( E2 z
, V, R# q; D; k0 s1 N9 \</lable><br/>% b7 M, ]* Y; `6 Z! P; Z& n: y# ~
<input type='text' name='item_element'/><br/>8 K/ J: t* I& E6 n( m h; M
<lable>Element Upgrade Amount</lable><br/>! x2 g# j* n3 e3 U3 L+ }0 s
<input type='text' name='element_upgrade'/><br/>
" z4 d# Q: B/ m4 b<lable>Pierced Amount</lable><br/>
5 v/ @8 ^7 ^5 p, }$ c- _<input type='text' name='item_pierce'/><br/>
" k8 M$ l8 _" o5 b X) P<input type='submit'/>
$ C' ^2 p y. D9 F</form>";
) D1 o1 u1 H3 K2 u* P( ?4 u: t! j}6 {# E" Y* n# j
* g0 t- k7 d( T3 v% c" f% j B5 I
function PostListener (){
6 d" w" o! Z" ]" D- `+ k//Add more post variables if needed and add them to initform() function aswell9 ^: m9 y: [+ F
3 f* S) [9 M5 E# i! q9 F* A################################
# O `! b2 F/ _4 x0 J##### Connection and Post ######
0 ^+ X g. z' {; j& a# x# z################################
7 F3 |1 m" v' J2 }7 k3 T" H! F$name = @$_POST['char'];9 M% |" ]3 T9 i/ Y8 t0 ?8 l
$ItemName = @$_POST['item_name'];6 B, T# ]* z5 O6 V
$ItemAmount = @$_POST['item_amount'];* h; Z& o3 i* t3 N# U
$ItemId = @$_POST['item_id'];# v5 U5 Z5 t2 U, i/ i3 ]' D. y
$ItemUpgrade = @$_POST['item_upgrade'];, q$ q) B5 o- \6 c0 N0 M! T
$ItemElement = @$_POST['item_element'];
3 X8 z6 j0 w$ j( P$ElementUpgrade = @$_POST['element_upgrade'];
5 d! O# y; L. M$ItemPierce = @$_POST['item_pierce'];
3 _3 N, I2 I% ^3 D; R |! B2 w################################
' w \7 b4 o+ m6 `( {; X6 A
# v y/ i. _: g/ ^//Check both variables for empty value- H, o& f, H2 |7 w5 B- O3 Z
' q3 X1 F" @6 X& R2 |; mif (!empty($_POST['char'])){5 r6 O( Q- {: J3 k- v
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ; Y% @/ j) e! O6 s/ _$ c& o
2 W2 h3 b+ {5 i2 g/ g
m_szName = '{$name}'");
3 n. B& F6 _3 d6 E, {9 W% Y9 Mwhile ($row = mssql_fetch_object($find)){
$ g. F+ w+ f0 j4 v3 b* l6 _echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 }* o. P, k- J9 m, z, P
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ; k7 p* l- b; {
7 `4 m1 l+ H* d, O' `- q[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 6 j0 Z" q$ t* V. K2 t
' Z4 E* c6 p; K2 Z& Q( R; i2 @. i
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
) }2 B3 v. T7 N: q3 m' D X. m; B/ j9 _
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', + _2 v) Q7 u2 @6 q/ r. |; L
# r% {% z3 l5 q4 a8 M'{$ElementUpgrade}', '{$ItemPierce}');");
: x( u' k: B- [4 H}; D Q; t& @ j
k& V( K+ B8 M. Q! R& p
}
: f2 r2 h2 p8 w$ c4 J
4 X9 \5 _% A4 J& M# [3 F}
1 b! ^! L; H+ u/ E3 C$ T6 ~5 B* a4 N$ F$ T) L3 C7 L
$InitForm = InitForm();
) u: a! d9 j/ q$Listener = PostListener();
% r2 c% K$ e# {& D9 @. ?8 I l M9 P/ O* c/ Z N
?>
: Y, _3 D1 t* X! J: e3 @/ c2 ~* C' E$ n
$ }% Z, m* P! i% L8 ?
- j6 b0 J# s+ y% P o+ c& W/ i6 O+ c8 m9 a
|
|