|
|
<?php
) Y$ E% H, r; t" B( I9 Cfunction Connect () {
" c7 b) A& H4 O# X3 _( dmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% f& u- Q+ M7 A7 X6 _
- M' @5 S) X- G6 o# y' Y( Q# \. K# KFailed.');
) _* ]& y# l3 ]4 N. Q' G/ n}0 v, ^+ j( q+ m+ h
Connect();* j( V) P# D' F. n) `
. L' c5 y: ^0 M9 x4 rfunction InitForm(){
* ~$ A8 e, r+ a. c1 t//layout for the form
/ p( q" V$ S! `0 {" O( M; J8 J' secho "<strong>Send Items.</strong>
$ [' q3 P6 s2 k+ t/ H' v<form name='select' method='post'>
9 r+ I/ O$ _* O4 G* V: L3 Y D$ ]<lable>Character Name</lable><br/>
v. D! j9 k2 F<input type='text' name='char'/><br/>
) B/ e% h0 Q! M, O# I<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>& n2 K0 p; n3 E% | @
<input type='text' name='item_name'/><br/>9 R5 J0 A3 W6 K+ N) Q
<lable>Item Amount</lable><br/>5 I' ?* h" \1 _5 { D
<input type='text' name='item_amount'/><br/>7 H( Z6 I8 K* n6 I5 ~
<lable>Item Upgrade Amount</lable><br/>
% w8 b8 h! G- i! o( F<input type='text' name='item_upgrade'/><br/>& G8 M) L, }5 e& `# m5 F" b6 c& y
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)* o: Q$ \9 B( t7 a/ Q6 m9 _
4 i7 P0 O; b5 o- k; X( K
</lable><br/>
# ^" @0 r3 \0 |3 @; x Y<input type='text' name='item_element'/><br/>
$ T, N6 ]' a- a9 p4 O* u$ W$ a7 d<lable>Element Upgrade Amount</lable><br/>% I* E8 U# `; u6 ^ |' o; S2 Y
<input type='text' name='element_upgrade'/><br/>( p. E6 u9 d, O$ ^" ?/ k" h
<lable>Pierced Amount</lable><br/>
& S) k. f/ {) N9 T/ P* W<input type='text' name='item_pierce'/><br/>) ~' k4 [- _! ~9 y
<input type='submit'/>
8 Z d/ H- T2 r5 Z; ?</form>";
4 d! L: b& N5 D3 L( `}
8 q& h: [: Z$ \$ H# _! B ?. e3 H1 b; Z( A6 ~0 J8 `% x7 c% Q
function PostListener (){8 u3 H: H* i$ D+ m# R! F
//Add more post variables if needed and add them to initform() function aswell
* o/ R. J9 R0 ^; o) Z" ~* `9 C+ z1 U1 p) Y1 B1 U* [8 g
################################
* X! [. [( o- k, y2 @##### Connection and Post ######, {% j* k! C; Y7 K( q. e( E
################################1 k& Z/ G( j) X
$name = @$_POST['char'];
2 k! {. U# b5 E5 I7 s$ItemName = @$_POST['item_name'];
9 _3 g7 N( V! ?) {7 t+ m6 v$ItemAmount = @$_POST['item_amount'];
, u- Y$ m: f1 p4 v6 X( s$ItemId = @$_POST['item_id'];
5 \* e# C! V: R* R: n S$ItemUpgrade = @$_POST['item_upgrade'];0 ]3 z% M3 m7 d1 z
$ItemElement = @$_POST['item_element'];2 G. n. t8 |# L5 o8 ?
$ElementUpgrade = @$_POST['element_upgrade'];
& _8 Y* l% x$ U; H* Z9 [, O* g$ItemPierce = @$_POST['item_pierce'];
+ d) b# j- N& _8 [* o################################
* M m% F4 O; q! P& f9 {2 Z# A! y! m8 s5 T
//Check both variables for empty value9 Y# n, z8 V$ I0 c
( b3 j- _0 h; K' U' iif (!empty($_POST['char'])){
! P) B# e% C( @1 F2 l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
7 V1 k! ~# P* ?: I% }
' s, E- R! `1 b+ u% M& q7 Nm_szName = '{$name}'");
- t! ?$ b/ I0 r/ b4 N# Zwhile ($row = mssql_fetch_object($find)){: W, s& [0 L2 Y- m' |
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
4 E" }. j, U0 l. U% _; r, u$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; a/ I! |( j; f2 X% y) L0 s. P5 R+ w1 S) e/ S
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 7 z9 Y" V9 V) b! x5 h$ K
3 h9 R1 o% x' M2 B4 s
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 9 {; P2 Q# ^& p/ ^
/ O, Z" c0 t' [3 K* ]6 C% r6 e& w( ~
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', # z/ t% q' v( d7 w$ ~( z0 v+ D4 Q
% F% Z% Y1 m' b! n) q'{$ElementUpgrade}', '{$ItemPierce}');");9 ^! N4 A- i# d# d. R
}
N& w9 l* g$ G$ H1 j
' ^! k2 |3 m4 |6 z2 x: U q}
! {; s Q2 [0 T0 N- Y& O9 b2 p- o; [. E7 W- G- C" Q
}0 e* v* ^0 _) |
# q- h: R( {5 s7 r6 u1 f& L* Z$ k( H3 }$InitForm = InitForm();
3 {* U2 A8 e( B) J6 L' H6 M$Listener = PostListener();: y% G: e# i0 b0 r& j
( `& u8 c8 W1 ^0 F
?>( Z4 l* u F6 ]% k5 j5 Q- A
4 s8 g$ i0 `, ^0 z
' |; S$ |. C |) m6 i* S: K; q8 }& F1 q1 L0 {. I
0 U9 \ q) W* P# Y1 {( D0 E
|
|