|
|
<?php
! _) }0 f, ^9 ?4 x8 Yfunction Connect () {) Q& H1 h& S; |# `& L
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
$ b h- z0 J R8 i* v" ^
- E3 S G7 e# l2 A, H, FFailed.');' t; H5 e! _% e$ ]7 U4 w$ D1 W; j
}$ p' ]8 P$ n' a& Q8 O, b: o
Connect();$ B: P" k+ M" |) A6 h# h+ e' ^3 q: C
. l9 K8 @; M# |6 C# p/ B4 [: [1 l5 vfunction InitForm(){
( u/ |- h9 S$ h( r: H//layout for the form
+ N* ~1 }" Z+ r; `: Qecho "<strong>Send Items.</strong>
6 t$ @+ N7 `6 h9 q" R/ U# d- q<form name='select' method='post'>9 K5 V1 Q! t. p0 J j6 h
<lable>Character Name</lable><br/>
/ G" h( m; F8 |<input type='text' name='char'/><br/>
& l" p6 h. F3 S9 T7 R- d<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>% s$ p3 i- |8 a# b) ^
<input type='text' name='item_name'/><br/>( J' S+ T) g" X; J
<lable>Item Amount</lable><br/>
7 i1 y; C* `$ Y3 Z' g6 u. V<input type='text' name='item_amount'/><br/>/ L6 [' I2 z9 } G; K6 w
<lable>Item Upgrade Amount</lable><br/>$ F8 F" b& h: C" \$ ~
<input type='text' name='item_upgrade'/><br/>
8 r& b; ` p, z0 {# n! [& i+ r<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
2 C" y5 u4 Y7 K4 {3 Z- \2 y% p% x
- N4 o! q5 b8 l6 K5 h& A/ `</lable><br/># O0 L: I) T7 B. ?) n' m
<input type='text' name='item_element'/><br/>7 \% `7 N. V: g* A! ~6 m( ?) x: I
<lable>Element Upgrade Amount</lable><br/>: {; a" E1 e+ }6 t' j" ?
<input type='text' name='element_upgrade'/><br/>
6 { O `+ ~. _/ l* u7 T. }0 E1 k<lable>Pierced Amount</lable><br/>2 g0 w- L. h, ~! x! B7 Q. d5 y: A
<input type='text' name='item_pierce'/><br/>
% N& f0 C0 t8 F<input type='submit'/>
# m/ c0 E9 ^3 a6 a* z. e8 T6 e</form>";
! s3 B, S z* {* \6 m6 y& Y1 Y}
& J0 s' Y2 f9 F: M) M1 \$ C; h8 q8 A% z, L9 ?7 }3 ?
function PostListener (){6 `: W. D6 V% o- G$ H9 o; U* n
//Add more post variables if needed and add them to initform() function aswell( X& |1 Y4 E# \9 |$ h
% E* J5 B! u; U
################################0 ?( y/ Z: s2 p: n+ i6 _
##### Connection and Post ######3 j0 l+ H/ q3 Z; a8 ?
################################( C$ I7 D) I6 E6 u3 g' @6 M
$name = @$_POST['char'];6 F9 J3 D7 J4 k: G0 L
$ItemName = @$_POST['item_name'];
1 Q0 J$ q' F1 P7 `* @" i$ItemAmount = @$_POST['item_amount'];
+ V$ U( @0 s, s+ e$ m$ItemId = @$_POST['item_id'];5 a" o4 p o1 k- g$ [
$ItemUpgrade = @$_POST['item_upgrade'];( C8 U% e% [' z
$ItemElement = @$_POST['item_element'];
) k1 g9 Q Z- d$ElementUpgrade = @$_POST['element_upgrade'];# c" H; F3 j6 E7 J+ |2 c0 n( S
$ItemPierce = @$_POST['item_pierce'];
3 n7 p. Y6 f" T% V################################6 j1 G% r6 d, r5 b `0 I( [' p8 V
# p0 V+ R8 k1 }' R Z! h$ g//Check both variables for empty value2 U9 A$ x# }5 L2 _. N, |$ W, e
% p, r- ~/ d5 S' C5 wif (!empty($_POST['char'])){) O2 N8 i5 A- P9 S
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
" M1 O0 f- r" y, v8 `. p% \' M6 v9 ~) O- @
m_szName = '{$name}'");. [- H* R J7 P% n4 o2 O( O
while ($row = mssql_fetch_object($find)){
7 U7 J* u: q" p& w; E5 oecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
C7 {" n2 v2 P$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], / Z2 U1 J2 I6 Z' T" `! P
* Y3 F2 }, R' A, T9 D2 ^* Y! b[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
' ~! m$ N) o: T! b8 ^9 H* a/ d( ~- n7 B' c, H
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 1 \; O/ p2 L. z ?. W& s
+ V+ \7 e! \3 d) s3 o" j6 P) e* K
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', % e! g E- R; o5 q- e/ c" @3 ]
# h# r$ v1 y( \( j'{$ElementUpgrade}', '{$ItemPierce}');");
, \" G7 A2 F* X; |; }* N( v; l* }}
5 O5 e( Y6 S- p1 k- \% X( [5 p1 P( h% y% }$ P& s2 z
}
! W- n' h+ k* n. V! Y- u9 ?' _+ t
}& L- y; W: A0 O9 ~1 B5 f
9 A9 y" v- _6 r+ t1 F
$InitForm = InitForm();: ~" V& z; {$ h0 |: ]! `4 u) f1 s
$Listener = PostListener();$ b! a8 E5 X3 ]; y9 M' |& R- C
$ Z1 Z2 q$ y# a7 k?>
: F5 r/ V2 ?5 E) F5 X+ J0 z: D2 c, h8 Y- _
) v3 m4 c4 B5 ]$ W# \8 z
) F6 F6 }8 t9 ?" G/ N9 Q$ x9 y" v, x
|
|