|
|
<?php
2 ~! b7 Y6 [; k+ J2 a tfunction Connect () {
+ ^$ B" T" \1 z+ H% y0 A% T' Omssql_connect('Server','UserName','Password') or die('Error: Connection to DB # F" U. r2 T9 u9 H
% c' D; [1 D- G$ C- I
Failed.');: y0 [( n& v. C1 B( e! p- u$ v& o
}
% N1 n8 s3 Y# i* j1 YConnect();
: G& ^: u+ _6 Q! Z: S( |
# Y4 r+ g( |& _* Ifunction InitForm(){* D& a* `, |* o6 U' B) g
//layout for the form
0 A2 t: _0 G: R: C: M' Necho "<strong>Send Items.</strong>
& D$ G9 n9 B E7 F" A4 N; X<form name='select' method='post'>
# F, J- |; ]! m2 [+ l3 C<lable>Character Name</lable><br/>' X% j1 {" N R3 S$ }1 }- z4 k
<input type='text' name='char'/><br/>
! g" P; Z4 {+ A5 I( e7 A; U) @9 I8 K, V<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
4 h- q& @; H" P( x) G<input type='text' name='item_name'/><br/>: k8 o' J/ \; E) i @, n
<lable>Item Amount</lable><br/>0 N9 z8 `. i. x- `5 }5 T3 ?/ p
<input type='text' name='item_amount'/><br/>* ~5 p6 |) k5 ^* W: U! ?" H" n
<lable>Item Upgrade Amount</lable><br/>$ T- \! H( F0 _: f2 B
<input type='text' name='item_upgrade'/><br/>7 g' e& X; C0 f4 s) _, K
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
( A" c" \$ E O# p6 ^: k$ f ?. Z& K+ _
</lable><br/>
. ~, J I# d& a! v8 ]+ n<input type='text' name='item_element'/><br/>
9 t. f: W! _& ?3 `<lable>Element Upgrade Amount</lable><br/>
4 a3 Q' a9 ]' |, U<input type='text' name='element_upgrade'/><br/>: r* I6 r7 E" ^* d; z) Y" k
<lable>Pierced Amount</lable><br/>& ^3 q$ p, f% @) ^ N
<input type='text' name='item_pierce'/><br/>
6 Q8 G, {& [, a' k& a9 P a6 I* R& N<input type='submit'/>( m X/ \* Q7 A6 d
</form>";1 O5 l% |8 ]7 x5 n w' u
}
4 c+ U+ R) m7 O6 f0 D& m
, l' t5 C5 n% [- t- o8 ], ?function PostListener (){! u6 w( N) t, d C+ Z; d7 G
//Add more post variables if needed and add them to initform() function aswell3 }8 h/ g0 r0 C/ n4 {6 x
/ d4 L5 w$ L7 w################################
9 y( T9 @ n4 V6 y1 N3 r##### Connection and Post ######
2 r7 j% d2 k4 n+ `2 V, |################################0 x! \$ F- I0 K0 I& \% F2 B+ X
$name = @$_POST['char'];
( ~+ k. r+ b# I$ItemName = @$_POST['item_name'];
/ z9 i6 _9 t5 A7 w4 m. \" g$ItemAmount = @$_POST['item_amount'];
: X& i, K0 ^( v0 J; Q$ItemId = @$_POST['item_id'];
- k( d$ t z# y9 B& n$ItemUpgrade = @$_POST['item_upgrade'];- w6 _5 {; u" W( V* m
$ItemElement = @$_POST['item_element'];
5 J3 C8 ?/ h- B- s" ^* x$ C U' `$ElementUpgrade = @$_POST['element_upgrade'];/ ]+ v- m8 V( I0 n5 q, s: g
$ItemPierce = @$_POST['item_pierce'];2 B7 ?8 K. {; G
################################ s' D" i) U9 g0 T( X/ m
: C- O9 @2 e0 A. _
//Check both variables for empty value
$ l0 d; c1 P4 r7 X* g+ n, L* a, D, N0 h) e$ m$ A3 l' l
if (!empty($_POST['char'])){" H. \7 ` e/ F G
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ' n! T1 K& H$ I3 w) B! b
& Q9 r4 e# D2 K' ~& `0 P9 e- @
m_szName = '{$name}'");
) u* E& N A, P5 j5 s9 d8 m7 R" a; Jwhile ($row = mssql_fetch_object($find)){) y7 Y" A: I" Z* l$ l
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";* M) }, G1 ]& C( s% a
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], # P" }, T9 B, k
" S8 ]* a" |& M. H
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
2 S) J; w; \8 [* `; ?% A/ D
! Z5 X# T, m1 m0 ?3 K3 ~[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
% \9 E/ D2 \6 |5 u; ^+ m0 ~5 V0 i L
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
6 E4 t. Z( G6 I$ e, K1 C9 I; U- D- r8 ^
'{$ElementUpgrade}', '{$ItemPierce}');");
& Q2 Z, L3 G, m+ v! c}
1 [: }: `* @4 w- I# c. L
2 y- ]; f1 B! k}% Q0 R, ` k) i: ]# M. {- v8 T
# U) Q" D: u5 T0 t
}
; C- {& c L$ H, q/ Z/ g0 y) {) b" i9 p% Q5 F& E/ f/ ~% ~
$InitForm = InitForm();
( ?% V l7 X3 }/ g7 L- _$Listener = PostListener();* C- p& B; p3 u9 l8 D
: Z, j# G5 R& P: U; F% ^; y
?>( X' W& w5 @9 @* J) v
9 A5 B" g! m" b1 L+ [0 _
7 V4 v) d. G2 Z% \1 Z/ q% B5 W3 U% [2 Q/ y0 o! N! G E! O
1 | U3 {0 ?8 l, c
|
|