|
|
<?php
, J, M$ L8 l" V2 d1 qfunction Connect () {' V1 o2 v) Q/ R: n% l
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 0 a- j' u w# u& O+ k. V* N& M9 {$ u
* }) f4 {, B( Q. ^) ~( ZFailed.');
% O8 d X s9 Q+ R}% \; k4 X6 i. B2 ~
Connect();4 A! h; ]; G1 @4 ^( D
: U) b) `9 X) U$ Y! E8 O7 x% t
function InitForm(){
; d- ]7 [; t6 ]. z0 v: N//layout for the form6 m& {2 g& [7 q& O/ R$ {
echo "<strong>Send Items.</strong>
Q+ D& i7 }7 y% o<form name='select' method='post'>
! c9 b( y' K( q' n8 H! J+ N2 ?<lable>Character Name</lable><br/>
& F! [/ Z+ a, |' N. Z3 q<input type='text' name='char'/><br/>
1 l$ c' E$ Z+ a$ o: q<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
* _3 f6 n7 |5 [<input type='text' name='item_name'/><br/>$ k9 K9 L M" n" G: O( E6 f
<lable>Item Amount</lable><br/>
/ z- O- K# L7 e0 q<input type='text' name='item_amount'/><br/>- @2 C6 O" n& `2 Q
<lable>Item Upgrade Amount</lable><br/>) {! |& ~6 }/ J
<input type='text' name='item_upgrade'/><br/>% R8 @2 U2 _& @5 B
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.). c. a$ ?3 G; O7 h; z$ a8 u
2 V4 p e4 K. y/ S5 A/ S9 \. q</lable><br/>. z" f; x2 M5 [0 K1 v
<input type='text' name='item_element'/><br/>, q [& v2 E. z" a& p" P, `
<lable>Element Upgrade Amount</lable><br/>) r8 [ A# Y# O/ D( N
<input type='text' name='element_upgrade'/><br/>
, U3 A5 S A( d* S<lable>Pierced Amount</lable><br/>* i8 _: Z) P5 m% T
<input type='text' name='item_pierce'/><br/>
0 n- K" C' q6 u* L<input type='submit'/>" l& O/ B" P. r( k3 |( b* I' q3 P% Y
</form>";
- q+ L, j8 S1 C" D; k# i7 g4 v}. S8 z( K" y( J! r" V$ h$ \ T- S
Y, Y1 a8 ?; c8 xfunction PostListener (){0 k$ {( R- S! L) y( F8 U& j
//Add more post variables if needed and add them to initform() function aswell6 d6 P0 |: ?; w1 P5 ~9 @
' z5 e( j6 l+ ?6 G5 A+ V
################################
7 F2 M; d+ Z v$ h+ I##### Connection and Post ######
& k2 I1 t8 E2 I c################################
/ C! }1 V8 x- Y" L' l$name = @$_POST['char'];
8 G3 }# z' u% K; U$ItemName = @$_POST['item_name'];. [" K8 |- W+ U) B, i+ F
$ItemAmount = @$_POST['item_amount'];. t5 A; q& B/ x9 n$ @
$ItemId = @$_POST['item_id'];9 l" \4 I. L7 W) I0 G, A
$ItemUpgrade = @$_POST['item_upgrade'];7 J- L: g1 G" D1 Y7 V' D5 l5 g" u! s
$ItemElement = @$_POST['item_element'];. ]# \. K3 ]6 r1 l. H
$ElementUpgrade = @$_POST['element_upgrade'];
$ {2 t' e$ j2 w0 c7 G2 c$ItemPierce = @$_POST['item_pierce'];1 `5 c |2 m5 B3 R' ^: _/ ~
################################4 M. f6 d1 }# L9 `$ G' ], Q
: |. r1 `- ` Y3 K
//Check both variables for empty value O7 ?" f/ n% e* R% F" v# p) s
4 Y4 a' `4 c. e5 N+ Uif (!empty($_POST['char'])){) n7 y3 @8 v6 z" V9 x
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
) d9 e& y; \( k- O! x/ _6 f! h7 \- b6 i$ {' _
m_szName = '{$name}'");
' V& W; n6 R; @ k5 o; nwhile ($row = mssql_fetch_object($find)){5 `' p g2 u9 K& h
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% L% {4 a, K) o7 A7 Z- \) H [
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], # m' C: {- _" ?6 ?5 h3 i% H2 y E% i
4 t4 X0 [) |% k/ g4 O/ O[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 ~: c/ |: T- D8 C6 s% k+ N
9 r% {' R4 `% D3 X[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', " l, S6 S% I5 q5 h2 b* s& ~; A6 X
5 m& s! t9 p: T! h2 A3 dN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 C* S' [( X$ p6 R& {& w# _0 _
" Z q2 D( y0 r0 W" }* Y7 `/ |/ W0 f'{$ElementUpgrade}', '{$ItemPierce}');");, r8 A/ X1 q5 ]" \
}
8 ^/ @8 D, x5 I$ E/ U# {( K8 r1 L2 Y. h6 |/ i5 f9 l6 r$ P9 L/ W; n
}
@0 P4 i" u1 C4 e' i# m- ^' e6 j
- G: }2 P% |; j5 N}
7 s- U: g- s- D1 s4 n$ ?- g
2 I3 Y* W4 t) F, R$InitForm = InitForm();
' b6 ?! g8 ~4 q0 p$Listener = PostListener();
t8 O5 n2 }' B% w$ \! o: \# }5 F" G' |* @" s
?>
, v9 X4 O; |( `# j% x7 p1 n( p: V" g
4 q. u9 t$ X% a* K) ~. K* ~- B$ ^* g
$ _* r0 O/ h7 J7 D6 b1 l& x! b
' a" O! ~9 f* V! \$ ]) Y |
|