|
|
<?php
: u; U/ D9 s( s* M7 vfunction Connect () {
4 F) }* @6 }( ~$ u) kmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
2 j `9 V m! H) B; J `3 y$ w% |$ i3 v$ ?5 S: i# d
Failed.');/ V# F1 P+ d6 W6 \; W
}9 D& p8 {& D4 k. g6 N
Connect();
0 _0 u, w* S; V/ { m' s, Q$ _4 F% {& u
function InitForm(){; j8 _( U" p: l
//layout for the form4 L8 M( I7 C7 |) |. @4 n3 n
echo "<strong>Send Items.</strong>
& n0 v/ b9 ]( J/ |; `3 Y5 P( O. D<form name='select' method='post'>
# v( U' _0 t' k# |4 C+ n4 K( Q8 t2 I<lable>Character Name</lable><br/>
5 w8 _7 S' \, N3 S% b! _<input type='text' name='char'/><br/>3 {* U- x6 w* s8 W0 E: e0 e3 e _
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>+ n! d% B9 _+ Y3 C
<input type='text' name='item_name'/><br/>
5 b' \& I K8 P+ I/ I<lable>Item Amount</lable><br/># b' U2 M; w5 |$ A
<input type='text' name='item_amount'/><br/>; ^; q$ r( r# o
<lable>Item Upgrade Amount</lable><br/>8 Q- l/ p0 a: X$ A! t4 X% X2 v
<input type='text' name='item_upgrade'/><br/>" s) g* V# ^4 M& i) O
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)+ a+ ?& v; ]& v
8 O$ ^( `4 R/ J" U J; ?
</lable><br/>7 C* k* q3 D/ A
<input type='text' name='item_element'/><br/>: B; X8 A' N3 \" i, `
<lable>Element Upgrade Amount</lable><br/>5 W& p& `$ _; _+ F9 Z
<input type='text' name='element_upgrade'/><br/>
, J! m: R' D) C! M* k- C<lable>Pierced Amount</lable><br/>
4 E# I" A( {0 P<input type='text' name='item_pierce'/><br/>4 b9 X( w6 g1 ?& t
<input type='submit'/>3 \) z' Y l) P* v
</form>";2 H0 O! ~0 o- p9 {% A. S
}
0 ~4 K r; g4 R E! T8 b
/ C/ |' W9 {" t4 `* yfunction PostListener (){7 J% M U0 \. u; ?, b
//Add more post variables if needed and add them to initform() function aswell
+ A1 r, S: |8 W' Z! G
% F( ?2 m3 h! L$ f8 R* H################################/ m, [: I" q9 x4 J
##### Connection and Post ######
/ ~( g$ l r* e5 ]! A, r) @7 f9 @################################) Q; H9 }9 x4 e; d% h5 r4 u
$name = @$_POST['char'];
+ m% h+ l$ f2 R- l$ItemName = @$_POST['item_name'];
k1 m0 Z* M9 {& q9 B" N1 L$ItemAmount = @$_POST['item_amount'];
$ H/ Q% s0 }; h( k. h- G$ItemId = @$_POST['item_id'];5 u, @" r& U1 j' L
$ItemUpgrade = @$_POST['item_upgrade'];9 T0 o: ~ s5 ?9 _$ E0 s% \- i
$ItemElement = @$_POST['item_element'];7 a. V& k7 x; h7 Z" g' y& \& Z$ ]" }
$ElementUpgrade = @$_POST['element_upgrade'];
9 n" X6 k( P- T3 E$ItemPierce = @$_POST['item_pierce'];* X' t6 ]9 p% A! o+ v! Y0 P/ k
################################9 F! i9 Y- {% f; x/ C* {: \
* R0 S% `9 p, b* b+ A- x# m//Check both variables for empty value
' [4 _. H' P7 U, }2 X" D5 X
+ K. Z7 H/ B4 f5 d* E, Qif (!empty($_POST['char'])){7 U B4 U4 Y# j( g# q# v4 _
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ) O8 [( B( f5 k3 a) Q1 ~8 S- ^0 w
8 E) @; a9 [* P1 ~' g
m_szName = '{$name}'");
: Q% o5 m: C9 H/ y4 y% W: L E& Iwhile ($row = mssql_fetch_object($find)){
j% x( F7 z" }4 Y n3 hecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
$ V6 u, W; q: y! e" }3 ^$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
5 q5 O7 G1 {" S; ?) G& @
. Q r4 s8 r6 L[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
2 W$ t- P& t+ _( P. U; s% V9 v
) _+ p8 p, F5 z8 }[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
, _+ g q% L! K, S
# x+ T$ }! k3 q7 L8 z1 kN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', - n' s+ h/ U/ ~7 X
4 A4 l" e8 Q" C
'{$ElementUpgrade}', '{$ItemPierce}');");( c1 G% \* \* ]
}
: f$ ~5 @) z0 d" \ j2 @- t# F) ~9 Y- }5 R) L2 ^8 j
}) Z+ b2 H/ z/ E/ X- {9 e+ z
4 t0 n% V4 e+ g7 @; a
}4 \2 }, E" D8 O' w. h
, n5 W0 d$ Z1 {; z, z$InitForm = InitForm(); Z9 `5 }' M% q7 i
$Listener = PostListener();
& ?. t! N( R( c1 P8 D; Q4 b% b* R2 y. R. I4 Y( I
?>4 Z- p7 D! I5 p+ C! \
; [% {3 r; A9 }: ?6 n) n+ H. L& l! E( l" b2 P* n
9 ^7 U9 ^3 K9 e6 \5 p
4 K& [1 L% [2 B- n
|
|