|
|
<?php& H5 P5 ~9 _! [( a! v+ [; d; b7 e
function Connect () {9 |; ?. X1 V5 D5 v3 ?7 h3 m3 `3 ?8 `
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ( a- R& ]7 I) N' I, b
; j6 Q& j1 `9 ?: x
Failed.'); L; w# N& i0 \0 ^2 b6 h
}- w' }$ b# d' O4 y1 F% a* j, N
Connect();
3 z" `+ l9 j' W# z( a$ i* Z* t9 o
0 k' p0 ~6 L% a3 j; ~" L4 lfunction InitForm(){
$ ]5 y% b, @/ m1 k; U//layout for the form
: |- i6 u& }" Recho "<strong>Send Items.</strong>
v/ _: p' \9 R% x w/ J1 w! Z& }6 L<form name='select' method='post'>3 I8 o* t) _% [) t! v- Q8 i5 Y
<lable>Character Name</lable><br/>/ \. p# i' i a0 h
<input type='text' name='char'/><br/>
. a; r- b9 m5 ^ c1 Q0 h7 X( Y<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
8 Z! s* O6 \2 u+ l<input type='text' name='item_name'/><br/>0 O7 N! M: `+ J3 a- u) w, Q
<lable>Item Amount</lable><br/>
k2 N: b5 |/ s2 I% \<input type='text' name='item_amount'/><br/>
) Z/ J- J# \4 k0 n [<lable>Item Upgrade Amount</lable><br/># I7 O- U' t6 j
<input type='text' name='item_upgrade'/><br/>0 o" q3 ?6 C% u- p4 ^
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
6 \* p8 j9 _8 C v+ t& ]- R
7 p5 z- B/ D& m</lable><br/>
9 K Q% y, [' M, c: M2 S<input type='text' name='item_element'/><br/>/ \: G/ B; z) ?( D+ ]
<lable>Element Upgrade Amount</lable><br/>
, _$ t: Q1 @; [6 t# o* E) ?<input type='text' name='element_upgrade'/><br/>8 e: s" C! T& w# Z; D- M9 u
<lable>Pierced Amount</lable><br/>
5 r( `* d8 h! Q<input type='text' name='item_pierce'/><br/>. d, E) O8 Q: z
<input type='submit'/>
' C0 \: P' O/ ]1 [; i0 U</form>";
* X9 |; \% f& T. P# ~}! B3 z4 {! l/ G2 q2 K
5 V7 b+ u; B& a9 s) T" d
function PostListener (){
5 X6 {# D3 L5 e- X4 \- O4 T) U% W: u//Add more post variables if needed and add them to initform() function aswell! K& \0 ^, Z. D1 {
3 r8 @6 ]1 g6 y( ~! d7 n: F8 e: f3 T################################
4 v. L8 l8 I5 M4 Z' O) \##### Connection and Post ######+ i4 H. V: v& [1 B& p% F) J
################################( A/ w& n' |. x
$name = @$_POST['char'];" e* j5 B! N) S
$ItemName = @$_POST['item_name'];; H* Z+ a4 R% O; V2 {
$ItemAmount = @$_POST['item_amount'];
; w$ X/ _( f) I+ W; @$ItemId = @$_POST['item_id'];* m% q) }- w3 r$ e' r5 [; {; {
$ItemUpgrade = @$_POST['item_upgrade'];
6 X9 y* M6 ^" p) f# J2 Q3 C$ItemElement = @$_POST['item_element'];5 |" q: s( \6 y( P% Y1 N
$ElementUpgrade = @$_POST['element_upgrade'];
8 Y. z0 [: q8 l, n) j$ItemPierce = @$_POST['item_pierce'];5 R1 y5 `3 V& q" V6 k6 b# @
################################
& [) i) K* H6 u; C! V! d) J- `, ~% ^2 p K
//Check both variables for empty value; T' Z! c7 Z) n
8 {+ [' [ ?. R: _' i! D$ n1 W* U
if (!empty($_POST['char'])){& i: z( x" J9 ]* D5 Y$ { ]- i
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
# h# ^% D7 B# ?0 [( M9 e- R& _4 S
m_szName = '{$name}'");; {4 o1 ?: T; H
while ($row = mssql_fetch_object($find)){
5 y4 s/ q/ P- h* } P0 M1 jecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";$ o9 H2 d( h( i' C1 s6 U0 n4 B
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
- g- R8 [. u0 l- s# g8 P+ Y7 H, A$ w0 F* f) |+ d
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
& d/ |! B N# z! f9 @0 H: A5 m8 D2 D; C6 T8 M- ]& P
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
1 I }, g3 M0 ~3 z, T; x2 }4 S5 |9 S9 _/ |( y
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ) C o# o. K9 \' y. N
/ D5 v+ H$ x l8 Q, K' S
'{$ElementUpgrade}', '{$ItemPierce}');");( s* E% A5 n, k# {& J: W
}
+ d+ C. e4 d b9 _/ E' z2 D1 w
9 r* Z% Y3 ]- K( L5 t/ b}
7 F+ V, u0 J$ A( p3 d; m" Y) e8 E* ?+ g) @8 t. G
}
. g2 `7 l% V/ q& G* r* p/ S
* w0 K" m7 M% v1 {6 e$InitForm = InitForm();* V0 m5 n. M1 \! \, q
$Listener = PostListener();1 a5 [* `+ {8 o5 G. X& O- Z
$ N3 z7 R6 I! L, S
?>6 B3 S; \6 b8 s7 Q) y+ {
' q- g& U( w% @$ {
7 |7 Y. M4 p: ^2 {2 L4 u) \7 L7 z
" {' Y$ o) k3 N4 Q2 y' h
/ i% l5 ], E! ~( P. E% [! } |
|