|
|
<?php
* F; m0 b) j2 Z3 I6 g- Yfunction Connect () {
7 }+ F# O! O+ d" T O$ @mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
3 e. }' n. J7 [$ s
% E: Y* x x7 H) |8 f6 F( |" b" BFailed.');
9 G$ |0 D# g& \$ p. a0 c}0 m, W! U: Z6 Y8 E) J1 e% S- C
Connect();& M# p1 R' U7 d. o
7 b" w, i! {9 N8 h# k2 q% v: g
function InitForm(){
1 g* I3 H6 \; i/ V o//layout for the form( j1 G3 @/ H/ }; I1 {7 x
echo "<strong>Send Items.</strong>( J6 e$ Z+ o: U. O2 q1 Y9 o+ }7 V
<form name='select' method='post'>5 @7 f+ N \0 h8 j& ^
<lable>Character Name</lable><br/>* [/ b2 K1 g& }3 I9 [8 T6 Z
<input type='text' name='char'/><br/>& P4 v/ Z. o- b4 Q+ f8 W: C
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>5 V' k- H7 m- x
<input type='text' name='item_name'/><br/>4 m1 P1 ^) U' |8 N" p
<lable>Item Amount</lable><br/>5 z+ Q5 r, W* X8 g+ c$ Z5 S
<input type='text' name='item_amount'/><br/>8 {- n! i8 S$ j1 D e
<lable>Item Upgrade Amount</lable><br/>
. f6 W ^% l# |: y5 K<input type='text' name='item_upgrade'/><br/>
+ `/ c- n5 a' F4 k<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
5 i: w+ {& \5 }# v" ?" j4 A# a- e1 E, u$ y9 M
</lable><br/>
5 Z8 ^" _: z2 U6 F+ E4 y% l<input type='text' name='item_element'/><br/>2 V* _* N" \" G4 k( X: W n
<lable>Element Upgrade Amount</lable><br/>+ X1 k6 R. s4 F# ]/ i3 a1 j
<input type='text' name='element_upgrade'/><br/>
r, [4 c/ n+ q# ]; C8 G9 ?, J<lable>Pierced Amount</lable><br/>$ d4 f4 s. V2 @
<input type='text' name='item_pierce'/><br/>
" H {8 k; Q% I) r6 i" L<input type='submit'/>
1 @$ O: A! t: V! @</form>";3 A! C0 f7 Z% }3 c/ j4 x
}
* ]/ r+ ^; [- M; R4 {# j+ o$ S v( C
function PostListener (){
* p4 w) M( a( x$ p! S//Add more post variables if needed and add them to initform() function aswell# O0 E9 h: P/ e, c0 P8 g' N
& c7 ` i n: o) B1 C: l
################################5 }5 D! L q' C7 R
##### Connection and Post ######
, \$ ^0 A0 k. l! L$ }, Z3 Q$ t################################. A2 T) ], |# E% Y' t" V
$name = @$_POST['char'];3 x# j5 q9 |7 I
$ItemName = @$_POST['item_name'];
6 V; ^# d) {+ r# S, ?; F3 f0 Z6 Y0 Y$ItemAmount = @$_POST['item_amount'];5 R0 W2 |3 q3 D5 N/ L4 I
$ItemId = @$_POST['item_id'];7 Y |1 J; _5 Z6 \6 |
$ItemUpgrade = @$_POST['item_upgrade'];
; |0 f+ P s% V# ]+ M' i$ItemElement = @$_POST['item_element'];1 p0 `/ D2 O8 U* {
$ElementUpgrade = @$_POST['element_upgrade'];8 o8 L7 ]# J! P% X4 F5 _8 s2 e
$ItemPierce = @$_POST['item_pierce'];
1 M4 |/ j' ?: Z; j% j0 q6 m9 Z################################
6 O0 e9 X: g7 k3 E3 k
: W3 M Z3 S5 ]//Check both variables for empty value
' W. E( `( q! A' w- ?0 M& z1 w3 t" k* W0 S& p; g0 ?7 R0 V
if (!empty($_POST['char'])){
. l$ a! d* v8 y- b9 i& ^# Z$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
- H# Y9 C3 b: l- e, K. L# [$ |6 A5 [8 d* b) x0 W
m_szName = '{$name}'");: @* ~6 O- }- b; e6 {
while ($row = mssql_fetch_object($find)){
) x& ]3 U: d! becho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
4 i! C% p$ C# R0 o& c6 D3 Y% E. Q$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
7 {3 R0 x0 E6 ?" z" W' G' G, I" q9 V+ a: J3 r
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
* W0 K) @ ^$ ]' i: ]+ p4 `: D" H
! O+ c) @4 v U2 c* Z E; [[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', : F, p- J6 ^5 g
' k, X/ [- ]4 O( H" @) W2 J! D4 ~N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
( G( S& U, G4 k' ~/ o4 k, r6 v( j6 E+ `
'{$ElementUpgrade}', '{$ItemPierce}');");
9 r% ^8 O2 F7 M5 T' Y" h}$ m/ S7 L q& H% u/ H; s
4 I6 w# M0 a& } }3 c+ y
}. ^0 _) h8 l& u
0 i6 |, `$ t5 J; v}
$ a/ X3 E. G; F: W9 Q) Z6 T$ l+ i7 I0 w
6 w; Z; Z% Q }) U; H$InitForm = InitForm();# k( D6 n. t. U0 ^+ ]7 H
$Listener = PostListener();
7 `' v U2 F2 F# `; q/ K$ e5 n$ j' f a, n% n5 `) y. h/ k
?>5 r+ P0 W, D, p3 {
% [; e) X6 K$ E+ a
W3 G" K4 R, O$ E; Q" i4 ^6 t' }# `. e" n+ Y
- k9 i$ m/ J4 \. C
|
|