|
<?php
1 A) z/ S! J" ~# `- X4 c* W# [7 o+ C7 Ffunction Connect () {
+ k, x& r6 t' e j$ ]( Ymssql_connect('Server','UserName','Password') or die('Error: Connection to DB % Y- D7 t% G1 [- b) I1 }" K* x, N/ s1 W
# j8 X3 f$ i/ |. D7 Z) YFailed.');5 F- ]) `$ C4 `8 W; @
}
6 X% R( k) l- ~9 y$ y) E- SConnect();
1 E$ T- N k7 q# e9 d/ U# A9 W
r9 L+ Q s$ s- \8 Efunction InitForm(){* x6 q) W9 z5 O
//layout for the form J5 w! Z L. V* m4 j- {
echo "<strong>Send Items.</strong>
. m0 U0 l! X# l<form name='select' method='post'>2 t; k; ~" B9 F5 r2 P8 \5 [% V: w
<lable>Character Name</lable><br/>
2 [, Z: |" R' A4 U<input type='text' name='char'/><br/>
( G" }; U* E9 r6 ^* h$ f<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>' y# |/ A( h( a/ m4 v
<input type='text' name='item_name'/><br/>5 l4 ^8 u6 U+ y/ @) W9 q3 a% R
<lable>Item Amount</lable><br/>
2 ~! S e( H+ j" A<input type='text' name='item_amount'/><br/>
6 g" l0 N! [( |$ Z: u<lable>Item Upgrade Amount</lable><br/>
# o; X4 U! }2 `& G# x<input type='text' name='item_upgrade'/><br/>
3 E F! y* {5 Z* `2 A8 d<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
; b2 H3 m2 q% ^& R4 |; x+ P$ q% {) K/ M4 v$ s& K& U0 A
</lable><br/>
^1 s( |, I" F9 a<input type='text' name='item_element'/><br/>
7 b" F$ ]" F! W' J<lable>Element Upgrade Amount</lable><br/>
) Y5 J, c; d" Z4 ^: S<input type='text' name='element_upgrade'/><br/>, A7 M1 [2 f z0 D/ O
<lable>Pierced Amount</lable><br/>
( _. M( y6 Q0 ^/ ~<input type='text' name='item_pierce'/><br/>
3 \" x! I% R0 C1 f% \7 G# j<input type='submit'/>( \& M. k4 D$ @( M# w; e& e9 B
</form>";3 z# e5 S( I1 R) n1 O
}
^# {( h' Y" ]% p/ z( ~: t/ K, m) N6 W( N9 h' t! `9 s, J
function PostListener (){/ E& l9 P/ s2 R! k
//Add more post variables if needed and add them to initform() function aswell
1 ^0 @7 `( Z! n0 m0 Z( }. H
, l, u0 v' t3 n, V* P/ ?$ r################################
6 g0 l$ ]7 S% R: E# U( C7 X##### Connection and Post ######
2 P7 ~* |; e& t$ K################################
# m' F6 s: \! h; s$name = @$_POST['char'];7 Y, S' b/ s/ c( C. S V& C9 a, P" W5 \
$ItemName = @$_POST['item_name'];+ S8 g5 |. H1 X5 h
$ItemAmount = @$_POST['item_amount'];
) T- c/ v2 U9 h: W- E- N$ItemId = @$_POST['item_id'];
: S4 l4 {9 L8 N5 K M# M$ItemUpgrade = @$_POST['item_upgrade'];9 D% R8 A6 ~- Z: v3 c2 h$ }1 q
$ItemElement = @$_POST['item_element'];
6 F) P, T8 M0 x- \$ _' ?# b$ElementUpgrade = @$_POST['element_upgrade'];
: M1 A! W' k+ E( ` I, k$ItemPierce = @$_POST['item_pierce'];
t3 |8 N3 n$ n& q################################
+ Q: |) Y P- p5 H$ t4 B/ T3 w1 v% B( h/ _, |
//Check both variables for empty value) s! e- O3 }; }$ v4 i! i1 X' X; n
: G8 t9 c/ P# Mif (!empty($_POST['char'])){
* i/ Z/ L% N' j" f8 l. G9 s3 X$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
$ f. X; ?# k" U4 N+ O8 B6 @1 V8 F
m_szName = '{$name}'");2 d, G( ]5 f q. q1 A+ f( D! ^
while ($row = mssql_fetch_object($find)){% Y- Y% s8 u7 o6 {( ]/ c. Z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
7 p+ ^' ^9 e" ? ^$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], # R1 G- F7 T s
9 X* `, I$ v: [0 Z; j
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 0 q: R9 s T" j: _; ?/ s( ^7 @
' |3 B$ V6 |) H- u p5 s) ~[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
1 q ^/ v3 W9 p# x, k* V% g/ P4 Q2 Q# S* K
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
+ k5 V3 ]5 d; f% \- J4 ~7 f8 I$ X, ?6 s1 P
'{$ElementUpgrade}', '{$ItemPierce}');");
! x$ `) e5 a8 ]* ^' j, Y}
0 A7 L" N# W5 {
# A1 ~9 C9 W! }3 Q! J: Q$ \+ q}8 s$ n% q8 A; h& `$ h& H$ }: N
6 v9 B+ w& N7 z
}, d8 I0 T. `$ L) R; O6 w% V6 X
+ J4 M8 x& y9 E8 l* I$InitForm = InitForm(); ~! S7 c, n1 k$ L' v
$Listener = PostListener();6 r# r" h5 D, Y2 M; Y
' j6 K& j0 f3 E8 o4 c# {9 h; P
?>, i5 @, D/ W8 ~2 `5 G( J" t
8 E: `! \# O% M
( y; B/ p6 g) a) b J% Q
- s$ O5 ^3 g0 o5 \( L. t# s% T
5 h1 a& k! B$ r. z' a n |
|