|
<?php6 {) j* h/ m- q5 @0 E5 C$ ~" q
function Connect () { h" ~- l9 W* _' G
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
* N7 y+ o# m/ @8 s# B% p. I& @8 F9 A9 K |8 v
Failed.');, c7 q% O, z, D- D5 G( l
}9 J9 ?/ i6 m8 Z# ^! J
Connect();( Q5 @* w& l" {9 P# K
5 }' E8 {) J8 A3 V- U7 [
function InitForm(){
^" x3 C* \( R7 R//layout for the form7 O5 a& s0 Q( Z% d$ ^1 i2 U
echo "<strong>Send Items.</strong>
. B; {; Y, u/ t) ?0 k/ C4 |# [" D<form name='select' method='post'>/ i3 }$ A' v' y
<lable>Character Name</lable><br/>
9 o0 ^$ k v% E' W<input type='text' name='char'/><br/>
; W' a6 b- [) T' b<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/> a4 s+ f* W( O3 L$ t$ h
<input type='text' name='item_name'/><br/>4 u! {8 `6 _; ?3 d$ C; a" g0 \
<lable>Item Amount</lable><br/>4 k/ y4 ~8 T% p7 z; K- C
<input type='text' name='item_amount'/><br/>, \/ q" C2 z' k# B, a* q
<lable>Item Upgrade Amount</lable><br/>
6 t3 X! z, y. A& {<input type='text' name='item_upgrade'/><br/>
7 u. L! Q6 Q/ {+ T& m<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)4 _/ ?9 \8 z$ } O
( d2 F- H* k- q2 q$ j$ K$ W: G% v
</lable><br/>7 t. {" E4 O1 f9 ]; q3 o
<input type='text' name='item_element'/><br/>
0 [* M5 y1 M5 Z8 B<lable>Element Upgrade Amount</lable><br/>6 e9 i4 U% J$ i6 C/ H5 a4 l7 W* l+ \; ]
<input type='text' name='element_upgrade'/><br/>
I2 g6 a _% n% Q( |: V$ i<lable>Pierced Amount</lable><br/>; \ X6 e5 O5 k" l, v5 |* b
<input type='text' name='item_pierce'/><br/>) i5 c3 Q. L1 U. Q, Y' x+ E* A- G' w
<input type='submit'/>
3 a9 }% d; y8 X</form>";
& T; K& G+ s% d' u! t}
9 [( V4 h6 ~/ `1 ?
5 E6 u9 e& n0 w" B# S9 T8 U' S3 Bfunction PostListener (){/ ^, g/ ^& t Q( L
//Add more post variables if needed and add them to initform() function aswell
6 n9 b" h) p7 p$ P0 H/ a5 J6 h) j# f" J/ m$ w+ t9 _
################################- J+ L1 M2 r$ l! {0 g+ R7 H* l z
##### Connection and Post ######: N5 N0 W' x0 Z" J! G8 P
################################+ z1 [ v8 R* l. O( X
$name = @$_POST['char'];
; k5 s) I' P) F2 ]: L o. E$ItemName = @$_POST['item_name'];' t6 P3 Y. q( r' L8 U
$ItemAmount = @$_POST['item_amount'];
" [8 p; @& M" r& o/ g) B0 q- n$ItemId = @$_POST['item_id'];
F1 U% a! M# v0 W: \ |$ItemUpgrade = @$_POST['item_upgrade'];
1 j; y' j3 }; S" j8 @4 `6 E$ItemElement = @$_POST['item_element'];
9 N5 H2 q7 E# n2 X; }/ R$ElementUpgrade = @$_POST['element_upgrade'];
+ ^- a' ^+ N+ N; F) r! u7 o# O$ItemPierce = @$_POST['item_pierce'];0 N9 \* N; ^# ~( Q$ B
################################0 x" N- h* W3 {4 f- ~# n! T
; o9 o) P" E7 u6 t//Check both variables for empty value5 j3 y) y$ l6 g3 I
& s. J X2 d7 D% r! C- @- U5 Iif (!empty($_POST['char'])){
8 x* P: r, W6 e0 _2 g* n& ?( f$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where & H- E; ]0 i5 e2 F$ I
) B: [6 A0 J+ D( L9 Um_szName = '{$name}'");; r5 d8 H% ]( }! w( p
while ($row = mssql_fetch_object($find)){, q& D7 A) c1 o5 ?; b2 T
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";7 l: ^5 O1 a) G- w9 ~* a' p1 V
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], & g$ P4 @5 V- i* r. b6 x& M
7 |0 T0 N* c* s1 P[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], , B; S3 \1 e: N( H- Q
# H- v/ g4 b; D/ }& F[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 p+ E3 C/ k- x1 f
) l4 K. f, `: U R/ {. W
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
) R+ ~2 e& j2 e7 C7 E* ]9 `3 ]5 I0 j Q7 j
'{$ElementUpgrade}', '{$ItemPierce}');");
- l/ H+ u5 ^( C- S r3 q, S1 r}; \! F, y4 Q1 L( g) R! \' m
+ [4 n/ _+ D, x2 \& _2 y9 D
}& ^. |* Z4 O: H5 O6 Q3 I5 ?
, M+ E9 h. L8 v% r+ c: Q' u
}6 r! G g. q' a" \6 {3 x0 J
: F3 w. b) {9 V
$InitForm = InitForm();
* y: E# [% E$ Q; |% A- ^ t$Listener = PostListener();; _# y, v' Y/ L$ {; h
" P4 ?9 L+ U9 Q* [* {?>
3 B1 G1 D& x$ H$ Q' B" C; g
! G+ W/ D6 w, F' N
; N! V/ n. U' `2 l+ T1 g1 W
1 U- D) Z5 x1 v& ?' {6 A) \' g" H" t" d* x* V- R# A
|
|