|
|
<?php- f( A. g, Q, j$ t9 }# m: N
function Connect () {
: C' e3 l+ z9 q: o0 Dmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 3 U0 \- u5 {" S3 n! p
& v/ o7 \9 j% H% D+ @# y- XFailed.');8 P6 {7 Z! x/ y* u) ]1 D0 {7 D4 J
}
4 v/ p `3 ]3 q2 }Connect();
0 P8 e( l* Y" U3 u# h" g) ?9 x8 }9 q7 J( |: x4 s& L) w
function InitForm(){
R8 C1 E$ L1 J' g0 Q: k9 p& J//layout for the form) Y( M7 b4 p, H1 G
echo "<strong>Send Items.</strong>
: ^, [: c$ C0 k' L" ~% z<form name='select' method='post'>
$ G4 O, P0 s" y<lable>Character Name</lable><br/>9 F1 R" K& X8 y$ Q) D0 C A, n
<input type='text' name='char'/><br/>
* x0 @$ K/ D+ X8 h# p% S8 |1 s<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
H' `) u" W( f$ n! ?; `<input type='text' name='item_name'/><br/>
! S6 ]6 }3 ^# Z9 L& p<lable>Item Amount</lable><br/>- c# k3 H( U/ D' t9 x+ U7 v
<input type='text' name='item_amount'/><br/>3 _* F% q9 G" {. h j, Z
<lable>Item Upgrade Amount</lable><br/>
7 F, `2 V0 O" ^9 ?: \3 m. @6 ~<input type='text' name='item_upgrade'/><br/>
: h V" z" r b* N: S+ W6 w<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.), r) [8 V' W i9 t! f
; p' j/ N7 s8 r2 c
</lable><br/>" `3 W/ j: x" d' `. \2 \
<input type='text' name='item_element'/><br/>
& z- h6 v$ e9 _ {! U<lable>Element Upgrade Amount</lable><br/>- B- a) h( u1 N5 X1 ?3 e/ z& a
<input type='text' name='element_upgrade'/><br/>6 ]/ V; ]- @3 m5 V: D1 J8 i* C
<lable>Pierced Amount</lable><br/>
, G; ]0 e) Q ^+ p<input type='text' name='item_pierce'/><br/>, a& Q3 h9 W6 U6 E' }9 n
<input type='submit'/>; Z3 D: U% c. u2 r. m
</form>";7 L7 G) P7 T4 H7 Z( {- z% P
}
/ ]; k/ Z: S ^' |- t! A; J i$ H$ N# F1 ?6 c- j/ v
function PostListener (){3 Y3 g, H- H7 ^8 @* [
//Add more post variables if needed and add them to initform() function aswell
* I1 M$ U# } n. L8 \3 [. A
9 R% z3 y; Y4 J8 a+ N" p# u, Z5 @' [################################
5 P8 b- V# t( j4 q! B9 ~7 w% s##### Connection and Post ######& h2 {* S" c: B1 C
################################1 E; {& Q$ R4 s# K) F0 d( B
$name = @$_POST['char'];
) S0 t6 c- b& b$ItemName = @$_POST['item_name'];! x) E- h6 c9 b
$ItemAmount = @$_POST['item_amount'];7 f [; w0 h9 g5 F
$ItemId = @$_POST['item_id'];% w" S7 E( ]3 U/ d7 h
$ItemUpgrade = @$_POST['item_upgrade'];: h, r0 {+ o/ s/ k1 K
$ItemElement = @$_POST['item_element'];
; s! Z; ?) r$ q7 |$ElementUpgrade = @$_POST['element_upgrade'];
0 ?8 ^$ a6 t5 p7 F& w$ItemPierce = @$_POST['item_pierce'];9 k' s1 ], U! Y3 H
################################5 i3 ^3 o) e; _, c) G/ r- K
) m R0 I+ z/ [( \& W: A. T* v//Check both variables for empty value
$ c2 G% [4 U& K) \& U6 V
! a) g; V3 Y' h/ f- ?6 Rif (!empty($_POST['char'])){; n0 {. p* o" j7 ?
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where * x% p: J6 L% z& ^6 V2 k
9 n, g" j7 k, u- {m_szName = '{$name}'");/ X. R& O0 b4 g+ s/ B
while ($row = mssql_fetch_object($find)){/ I8 R. s+ q3 v$ O7 q7 k. w4 D
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";! ^8 A! M1 x+ h( K( }
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
, z8 |, F; @6 r4 H/ z/ s/ T, G( D$ L$ Z* K. y- A! _0 ]
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], & y- y5 s: {) q E1 T S
, H7 j& q! [- t" ^, V8 {+ F
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
0 d9 e1 _1 `# R& U( _* ~* r1 E6 |
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
6 L" t4 H0 [9 k4 {& S
7 [4 h5 o# S0 E+ u9 u'{$ElementUpgrade}', '{$ItemPierce}');");4 A3 U5 r' [* }" r5 s2 g: d
}" u5 C. U- j: e( k5 C) Y+ o
) b9 j( z& K+ a- k( a
}
/ B. F! R8 u9 O0 m2 a/ R/ F8 c' c, o% }) K# Z T- L5 @
}
9 r: A/ x: T& e& w) U5 t
5 S6 ?: R( S) ^' T/ f* N; ^' m$InitForm = InitForm();
& F3 e/ P- l8 R( o$Listener = PostListener();
3 z3 F, n2 V# u, R% b/ j9 F/ Z( R. {
?>
/ e$ v9 Z9 p) b8 g/ x8 e7 N, p- H3 `; }, e) c+ c3 O
6 c" P R# p: }4 \2 Y/ O- g
! z+ ?) q( x6 } Z
/ J" p1 D f& `0 {; G4 ` |
|