|
|
<?php& d- f6 m) o( B9 x5 K X
function Connect () {
; F8 k7 o) }, d1 l1 Imssql_connect('Server','UserName','Password') or die('Error: Connection to DB # W9 _* i9 p! A& h5 ?
$ ~* }% U; n5 B6 `& K
Failed.');
4 V [ S1 u) A2 ^& e- a* N2 W1 Y$ P}9 B2 m2 j" H9 i# F
Connect();
+ O# ]5 {- G2 s2 s' z. j
) u+ Y0 H8 D8 K2 D4 A N3 Dfunction InitForm(){
' x; w1 S. e5 }+ K+ d% e9 J//layout for the form0 @' ?& o$ S+ t6 ?* |' \ f! C' y0 X
echo "<strong>Send Items.</strong>
- c% O) D$ k. M# ^. p( K<form name='select' method='post'>
4 `- u! k$ w' M# X2 c: L<lable>Character Name</lable><br/>' q* p3 X9 J+ E9 o' N" D7 E
<input type='text' name='char'/><br/>! F9 F9 a0 e4 c/ C+ d
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>2 _% g5 L5 y4 B3 a( @
<input type='text' name='item_name'/><br/>, c* P( W2 q9 W- i
<lable>Item Amount</lable><br/>
* T- l' @$ _7 k: E: ? D& j) G<input type='text' name='item_amount'/><br/>8 C3 ^2 T; B% y5 K% O$ P
<lable>Item Upgrade Amount</lable><br/>
# A* t6 Q: X5 X<input type='text' name='item_upgrade'/><br/>
: J' r5 Q3 e! K6 _( X9 r<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)# F, Y) U+ c2 c9 O: X0 Y
2 \: z3 ]- R- O c) D& x/ \
</lable><br/>
3 b$ H0 W8 i! k% G. \4 f; {<input type='text' name='item_element'/><br/>9 x/ ^" H* ^1 |4 `% D7 a0 ~ a
<lable>Element Upgrade Amount</lable><br/># D) J q$ A( x: L) E6 J9 r3 f
<input type='text' name='element_upgrade'/><br/>: ~+ S/ D5 t% O1 r" L7 K3 T6 a9 f
<lable>Pierced Amount</lable><br/>
2 n6 o8 A! z! M5 x7 B: y% _/ _7 P<input type='text' name='item_pierce'/><br/>" W. H* t b3 h
<input type='submit'/>9 R3 V4 Q0 X$ {* O. s& }. o" A
</form>";+ m( T& `) ~( a8 a, k
}" B0 p7 t& Z) y3 \
9 A; I7 J: g' ?function PostListener (){
, ^2 {7 u i; l* b. K F2 d//Add more post variables if needed and add them to initform() function aswell
7 V0 y7 [. L. i, H" s3 K+ x/ f; x- Z
################################
! y7 w, ?2 H9 f9 r##### Connection and Post ######* C; e9 b# J/ u( w; J7 c( h
################################
6 c6 ?+ e9 n8 e/ Y$name = @$_POST['char'];
|! \2 P6 K+ a- m V$ItemName = @$_POST['item_name'];
# ~" E, G: O. q- H$ItemAmount = @$_POST['item_amount'];
V) {+ ]0 y" r/ i4 [! r$ItemId = @$_POST['item_id'];8 H a. E4 a6 y8 o7 c6 y( f
$ItemUpgrade = @$_POST['item_upgrade'];+ A" L( @7 a5 r8 ^$ G: E- t, R
$ItemElement = @$_POST['item_element'];
6 r. B, W! n# L, E. k' B$ElementUpgrade = @$_POST['element_upgrade'];! a3 c' ?3 J* @
$ItemPierce = @$_POST['item_pierce'];; d. ?+ y/ k: q3 a: ~6 q/ i
################################
4 ?1 m7 Y/ W+ v- x. o$ n( q" l
2 o5 H- k. w( V# O//Check both variables for empty value6 e2 |: ]! j: z
) G* M- p: B+ P
if (!empty($_POST['char'])){( t3 |9 T, l! y$ \! `& }/ J# Y
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 6 A2 w& u" R6 |- K: S8 }* S& t' N
6 |* p0 E7 T) l3 t5 q& ` um_szName = '{$name}'");
x& W1 @3 ~ j1 uwhile ($row = mssql_fetch_object($find)){' q1 F8 {. ~2 U2 u/ k
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
$ b- p6 z9 ]( ]$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
5 A @! ^% A4 ]8 h3 L! w0 t& L m
& m( o) x3 D/ S4 q6 t[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ! y$ @* e! q6 N- @
* t4 r: A @) k7 j- t! z: Q
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
6 _( w# S& g+ Y9 a+ C
K4 _5 }9 ]# @; W2 ~N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 v/ B9 j( ]- V6 l# H
! X S. R9 R! @'{$ElementUpgrade}', '{$ItemPierce}');");8 u5 c/ b- g, r2 f5 ~7 \! ~
}
' p8 u( g+ P; l; N3 W4 N! B& R& |- u3 h8 s) F8 L
}3 a7 Z% S' I7 Y A. a3 \
2 S" D% r' k ^3 N2 }}
2 w# l) D3 k; n* G8 r, i' j; v' M, F7 O" J
$InitForm = InitForm();5 u8 U7 |, s2 m
$Listener = PostListener();& v1 D6 G! H! J" }& W
7 t2 \9 D h0 w( I; O7 l
?>' b9 ]8 r [9 Y: N$ V
8 r/ d% |- B* Y/ S
1 K$ m- ~1 c1 u( U7 u3 f8 x- M. a2 g6 N. m2 h) x0 `
2 ?; V7 c+ a6 w+ R5 [" s4 P- S% `6 f
|
|