|
|
<?php
6 R. _/ r5 u. Bfunction Connect () {
' n& } e- ^( ?# |0 Gmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 4 ~- b7 @3 n$ }$ v5 m( L
& l. Q" S8 V* V: t$ Y; T; O( A
Failed.');
$ f3 u9 s- ^! }% g4 C: F/ F5 h [}' w4 P0 E, M8 a* P6 |
Connect();
0 r+ P8 K4 A# ^
1 @" Z5 I$ c) R( ` \! Rfunction InitForm(){2 b+ f% M, X6 N: W# t/ U9 f
//layout for the form" N4 Z8 u7 i! g* ~" ~2 b
echo "<strong>Send Items.</strong>" C& D5 A( V1 Y6 e" ` I
<form name='select' method='post'>+ P0 [) w9 V7 A
<lable>Character Name</lable><br/>
; |' n+ D* c; u; b! X, f& }<input type='text' name='char'/><br/>$ @5 j* n9 q: y* \9 i' D
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>$ J9 f* m( O8 u, G
<input type='text' name='item_name'/><br/>
; T" l) @! P* c( J( Y<lable>Item Amount</lable><br/>6 C4 m& t; t* F' Q$ H8 e! K
<input type='text' name='item_amount'/><br/>3 o7 T' Y3 k+ D' W
<lable>Item Upgrade Amount</lable><br/>& y% w4 d& c/ c7 r5 i4 W
<input type='text' name='item_upgrade'/><br/>
, Z7 x) G0 H: \2 U<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! i* K( ]0 f* t% J% X: R5 x9 @
9 M$ C6 ]1 N0 m" d</lable><br/>
7 O1 W2 M/ y/ c; ~7 j# M<input type='text' name='item_element'/><br/>
0 |# Z) c, T( f* k5 A* W2 _<lable>Element Upgrade Amount</lable><br/>) v3 ?* | Q6 T5 y
<input type='text' name='element_upgrade'/><br/>
& x) a8 u' p! Z, U) S, | a<lable>Pierced Amount</lable><br/>
& \5 M* A+ M# ?" y4 ~8 j; c0 Z& _<input type='text' name='item_pierce'/><br/>
: d0 C0 b P" `<input type='submit'/>
}, ~! v! ?4 N9 M1 B# |2 ~</form>";
' T# b( `- d6 I+ c; @# V: r; e2 I}
# L7 ]& |" F- P& k7 w
p4 {1 t3 S7 d2 B; ~' Afunction PostListener (){
2 w- }7 R! R. J- k! C. K//Add more post variables if needed and add them to initform() function aswell. i p5 n. ~5 m" V. }# G
/ G, L' u J0 S9 }$ _4 v################################
) T. M* C$ R/ M) v! O, _##### Connection and Post ######2 |: |7 w- [ t! y0 H; k: v
################################0 i2 i/ @# |! w9 Q+ v
$name = @$_POST['char'];# ]4 R- E8 J8 }: W# x* |7 e
$ItemName = @$_POST['item_name'];
+ P9 z% ~: p0 \+ _2 h7 {4 }$ItemAmount = @$_POST['item_amount'];
# k# G9 H5 ^' m. k- j m# |$ItemId = @$_POST['item_id'];- n2 s/ d! ~, R2 J
$ItemUpgrade = @$_POST['item_upgrade'];9 ?9 R* }( n+ S
$ItemElement = @$_POST['item_element'];
# n" u# m+ ~8 ^" y0 v$ElementUpgrade = @$_POST['element_upgrade'];
, n) I- P2 t0 V1 o& G; b$ItemPierce = @$_POST['item_pierce'];- |+ g% A Z4 |* S" K3 s
################################/ S+ n% j H R2 B: f: \8 z
- H, u0 W+ `/ ?% u6 e- G
//Check both variables for empty value$ _6 Y2 Z3 f4 e$ a Z
; I5 U) y; V* m# w+ X0 [+ fif (!empty($_POST['char'])){
1 `7 b& `+ G' u7 ?$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
+ L+ @; {$ _$ q% M$ {4 H/ X2 u4 `
/ h8 j. R" I" k1 k9 A) Wm_szName = '{$name}'");
* N! E- k* C+ I }0 p9 Hwhile ($row = mssql_fetch_object($find)){- Z! r& t: p `+ z3 S
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
7 d- g0 m( A, n' E+ r4 W$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 1 v2 y# k% J2 Y- c% R3 j b
; t1 d& } \/ Y8 M4 n( H; r: g
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], . ?7 j+ Q. D: V( t
0 ~% ~3 @3 e2 A |[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 8 P. ], H4 x; _8 g7 T
0 x* E. w, n# \& c+ W2 a/ l
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ) C3 i) l8 ?' g0 l% U; [
3 g, ~3 v. v& D! Y& s- O, U
'{$ElementUpgrade}', '{$ItemPierce}');");
0 V4 F) p% F1 V; Y. L}2 [/ F9 q6 m, L5 d
$ \$ o3 }. T# {7 ]9 c- A
}
' ]& f' b! P9 Z9 E" D; F7 J( L1 ]. V; V8 v& t
}
1 L0 S$ Q2 S: m- B6 @5 w' {/ G o. @' W& Q
$InitForm = InitForm();
0 n0 r' F8 a+ ~ r0 C$Listener = PostListener();& E* m( ^0 y$ Z' H7 K
' A5 E! b, K, _6 d' f$ B7 S?>$ S4 D; U0 B [$ F% y
. C2 L: \3 S! S4 h6 J
( l" z0 u6 h, @' d
( J4 @8 \* t) J B0 s2 p
# z- B* E$ t9 [1 r, l |
|