|
|
<?php
5 l. i8 p% f) }! b6 U0 O/ Rfunction Connect () {
; k! n9 K2 O% B! P& bmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% `! C0 ?. |' A; ~; q z1 h" L5 i2 R
Failed.');
3 W! }8 z7 }* d$ v: L6 T" ?}. k) c2 Y7 G4 g) h
Connect();
, n6 Z2 D; h: d& u! l1 E' P5 e) j% Y j: A
function InitForm(){
4 d- i" K9 m& z6 \5 W& \' }3 O//layout for the form7 @9 Q, @4 R9 I4 H7 c
echo "<strong>Send Items.</strong>
' ^* l( H+ m% S/ Q/ W4 t<form name='select' method='post'>- R( k/ o/ J2 E* K
<lable>Character Name</lable><br/>+ _& e: C0 Q" A3 y- k. E0 d5 V
<input type='text' name='char'/><br/>
/ _% K2 a9 {' l# G1 u0 w<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>8 f& X* E7 t$ V5 n1 u0 R
<input type='text' name='item_name'/><br/>
/ E9 {! d4 M# A5 u) |' f' j<lable>Item Amount</lable><br/>, c; v6 u' E* F% r' l' @
<input type='text' name='item_amount'/><br/>
) o" l9 B; M7 K+ ^<lable>Item Upgrade Amount</lable><br/>* j B5 ^9 @- _0 i' v
<input type='text' name='item_upgrade'/><br/>9 M* ^$ @4 y' T
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)' j) [, J7 Z2 d
8 e( V- n U3 v, V
</lable><br/>6 s. D- u% ]3 v1 y
<input type='text' name='item_element'/><br/>
( D6 t* E8 O5 v% o<lable>Element Upgrade Amount</lable><br/>9 I, h0 c! N& K2 l0 N5 _
<input type='text' name='element_upgrade'/><br/>* m' `( k( ]" U: m5 t, g
<lable>Pierced Amount</lable><br/>: B1 m9 \; @1 U9 Y0 R7 H+ F% D% P! N
<input type='text' name='item_pierce'/><br/>/ b( j% x$ v$ x5 B3 M4 `
<input type='submit'/>
8 g7 a, a0 U) A% K6 L% @</form>";5 x6 o2 l( C+ y+ D- G4 h
}
+ N. q/ `$ D6 w) e- Q4 r T) u1 t6 T* v
function PostListener (){. F/ Y6 j) R+ H( q
//Add more post variables if needed and add them to initform() function aswell
3 ?* l) S" L0 D" d& x4 [+ k3 M+ y
3 x* ?7 A; g3 @1 R( h+ W5 w################################
$ c$ r# }# G8 A* g; p: [' r. D3 p/ X##### Connection and Post ######$ r& j* ~6 T) i8 Q! H0 p9 E
################################
: N. M/ V3 i% b6 p x" N$ _$name = @$_POST['char'];9 a! y/ l3 F! W
$ItemName = @$_POST['item_name'];5 ] t% a. S2 C% Q3 {( b3 |
$ItemAmount = @$_POST['item_amount'];
0 @% A- Y7 {: Q! d* z$ItemId = @$_POST['item_id'];& `( P) K: _: T$ p6 O
$ItemUpgrade = @$_POST['item_upgrade'];; r. K& X( ^# I' a
$ItemElement = @$_POST['item_element'];
& D) j) P% ~( b9 d$ElementUpgrade = @$_POST['element_upgrade'];9 e |, a. f K+ W! }9 R
$ItemPierce = @$_POST['item_pierce'];
) O3 I/ G: p9 A& r################################
5 e2 P* Q% u' F3 [8 m8 ]% M) j1 h* p9 W% [& M7 r
//Check both variables for empty value, g. \ t7 d& `3 q
3 h6 N' b* O6 w! N/ s
if (!empty($_POST['char'])){
" R0 P' J4 z) n; @' ^$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ( u$ |, E. u6 T; z
- n' Z" [9 u( t
m_szName = '{$name}'");
" B& E9 V! h7 |$ s R* {% U* t1 R5 [while ($row = mssql_fetch_object($find)){
6 p& P+ @- \8 jecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";: P1 z$ u! s9 l- a* p) u# W
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], / ?& t: @# R$ `# _% h' [$ u
& d+ w$ h. `# l: p' R& \: J
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
% `5 \$ W/ b! w/ o$ X2 [5 q( W& h' L, P+ i0 C( h8 }1 s2 B$ A
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
6 c6 [* d* G# @7 y9 w& I5 `
4 d$ c7 O- i" U! R: q9 L; J* eN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
3 _% A `, }. o' H% L6 v) f5 X7 N0 T
'{$ElementUpgrade}', '{$ItemPierce}');");
+ j- q& d, G" x8 l' f3 ^) m3 |}
+ D* o k4 D+ f) j+ J2 d
& t* j/ Z# u3 Z# M t0 W% ?6 M}
6 k. ?) b0 \8 k( F$ q) {6 L3 r$ u: b( \3 S" A( m
}% t4 B: R7 ?5 O
; L7 \- I, N( w; }- x3 C b2 ]! {
$InitForm = InitForm();
8 A- ?9 _4 @1 B( d$Listener = PostListener();
7 q5 A6 H: e; T( a( }* x ^* {0 w0 @5 F
?>4 a0 F+ ]* K8 P: H; l" `
: d) w8 N( @: y- w ]' k* o, U5 d- v) {3 b+ N6 N# e* P5 r
( l( U3 b# \- _+ q9 b
7 Q, ^9 A: x8 J% F |
|