|
|
<?php
! e8 e, q/ Z( j& k3 l$ V! z" tfunction Connect () {
8 W9 b; d9 e! Jmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 8 R( Z# v6 `/ |9 I" {1 |
3 @3 a5 n% p( j0 F# Z W: OFailed.');
* N! B; [# n2 l0 F}
& r. s! U% }& k9 C U1 n$ Y8 lConnect();$ e) T1 H9 A) k' \5 P) u: Y
. v0 C* b5 h* r! ?: R8 P
function InitForm(){
8 f; f9 q5 w" J( a//layout for the form
, x. B; I0 J; n! k2 s& W1 Lecho "<strong>Send Items.</strong>1 H! G; f' b, b9 L# k5 L) F# y
<form name='select' method='post'>" a" T) o4 Y; ?! o" B7 J4 K V5 W, U
<lable>Character Name</lable><br/>
% \3 N7 N6 S: t6 r" @4 f2 T1 i<input type='text' name='char'/><br/>
) h; F# b. Q9 y$ F, o$ Z3 o: F3 m<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>4 ?3 [5 e+ a/ G
<input type='text' name='item_name'/><br/>
1 |* _0 P; H) `<lable>Item Amount</lable><br/>
. z( \6 V: \! m) s& u1 d& g<input type='text' name='item_amount'/><br/> J8 O, e8 c% p/ u- i% W( F$ T7 P
<lable>Item Upgrade Amount</lable><br/>" B& a' n f3 N& ~( u
<input type='text' name='item_upgrade'/><br/>) ^) h% ?( ~, s# M/ q3 h/ I' ~
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)& V+ s9 P' K8 j2 y1 }+ J& ~ X: e
# [: I3 o& [( Z8 N& d: l
</lable><br/>
; F @+ y+ B4 o: ~$ a2 M<input type='text' name='item_element'/><br/>& D* b; u9 E8 a/ n6 P+ G
<lable>Element Upgrade Amount</lable><br/>: k9 r$ I, ^. h/ f
<input type='text' name='element_upgrade'/><br/>9 x( b- l- a" ]& i0 O# f( I5 k1 U
<lable>Pierced Amount</lable><br/> _6 J: _4 w8 h% Z. R6 W
<input type='text' name='item_pierce'/><br/>
) o( x2 V: g. C- E: ?4 w<input type='submit'/>1 T- G2 ^ ]8 @" n3 @- r% }; y" F
</form>";6 N2 Z; C8 N; @5 W% C7 G: b5 F
}6 m6 [) V$ q; o' d1 _
% D4 f. E3 V$ u# J) ffunction PostListener (){
- l8 y/ {' q, [//Add more post variables if needed and add them to initform() function aswell; K6 v+ [$ y6 M6 x9 ^
. q$ G/ V! h! S0 X% [5 N2 v4 C9 i################################# J3 z( S. }' H' V- p
##### Connection and Post ###### z! P. l' G( d) @7 K1 U/ Q) S
################################3 r! L5 [0 X6 i! A0 S5 d
$name = @$_POST['char'];
3 `2 v; @. h$ d1 G/ b( v, F) j8 H$ItemName = @$_POST['item_name'];$ `+ D. s" n1 b. n. I
$ItemAmount = @$_POST['item_amount'];- C$ x' |; ^5 g. J8 _/ D4 q8 V
$ItemId = @$_POST['item_id'];
/ Q) u. o. `1 p9 I4 d% g9 ^$ItemUpgrade = @$_POST['item_upgrade'];
- q" ]$ J+ W. O1 P" u, b( Z$ItemElement = @$_POST['item_element'];" h5 N7 ~4 a0 _1 F
$ElementUpgrade = @$_POST['element_upgrade'];" |$ c* `- j6 ^9 ~2 Y
$ItemPierce = @$_POST['item_pierce'];
# H: x4 |9 k. |5 I) |################################
/ X( u, z/ p) Y% Q6 E7 e2 l
E `" t! @/ v1 O, ~* z//Check both variables for empty value" x4 y- Y; O5 j3 g* J$ U: X0 M/ |
( |; c# ^3 a* U6 d, O% z- ^
if (!empty($_POST['char'])){
0 S' a( l, b8 Q) I$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where + e; \9 o) ?4 b0 q/ p( E- C
9 m- A3 l2 s3 ~& h# M& Gm_szName = '{$name}'");& v8 v. D2 z$ S+ }" d( i n
while ($row = mssql_fetch_object($find)){3 g' F( L7 q2 Y6 o8 m
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
- b, N0 m2 [& ?9 E3 _% W0 n9 I$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], / S) `4 s- O; Z f
2 o8 r) I4 q4 e- \* l
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 c; A: a6 e5 ]- t& f0 y9 q0 M2 z) f8 A7 y& ? s
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
2 ?4 _( u! v- i
- w% v; A) C! i: E# cN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
- q5 H+ q, J7 p7 O- Z" q! ?, d) w- D7 e
'{$ElementUpgrade}', '{$ItemPierce}');");
% o( \$ }5 ^2 j+ w}
0 y6 |' r) S4 h- Z3 \
8 V7 X( Z7 T9 M' h* ^" Z9 `}9 x; F9 L( x P: k+ G: R# R
1 @/ |7 ^4 `2 F5 O- d* @- E}% W1 n! }' h9 a. n
' m/ N ?9 r( O% j8 `$InitForm = InitForm();
; i, n0 |$ |+ B$ y& @& f N8 A& J$Listener = PostListener();
% l7 S. c5 {0 h( x9 T/ q: D7 K5 E) {2 J. A
?>5 u& S( c& y+ o7 P9 j7 D/ {* I
* ]( O8 `1 h9 G. B) x) _+ s
- i4 E% _2 c- Y9 N) I0 g# B' A! c* m' e) c+ B
- I# J" v1 _4 x' g) I6 V |
|