|
|
<?php
/ m5 I1 ]* ^" d. ^1 h% ^8 S* ^function Connect () {' G( V& d( @" F. t
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
1 d" Q4 M& q$ A# x! X: H# w! p( U6 M' F0 v
Failed.');
/ }: _% V& X( M) ]+ @}! X {, @' _+ v: p" y
Connect();- G" v$ h( z. v% p
x4 k) W9 d$ y( _% J6 E5 |
function InitForm(){
# }. M5 G: T+ h% g% B4 q//layout for the form
) N5 @6 H! q% ]' `% Necho "<strong>Send Items.</strong>
" X5 h/ q0 N' N( E) Z- x; r<form name='select' method='post'>& i. s& C1 A+ M1 t m
<lable>Character Name</lable><br/>0 \3 S8 ~" j% ]+ Y- o$ [9 ~
<input type='text' name='char'/><br/>
4 p, @) h& V% V+ C' ?0 _5 a; ?) h<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
9 V( E8 c8 ?8 o<input type='text' name='item_name'/><br/>5 j; }/ Q5 G% l e+ r7 p
<lable>Item Amount</lable><br/>* X4 g& A( X+ }/ W" a$ l' \# Z
<input type='text' name='item_amount'/><br/>2 i+ K* d. G6 J- ~1 R ^. M
<lable>Item Upgrade Amount</lable><br/>
% n* c$ C; F% ]; A% ]9 w0 W( A<input type='text' name='item_upgrade'/><br/>
5 F1 h$ k# [; h$ b<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)0 V7 y1 c! \6 n3 n4 T* L
: k% `* S, N2 j9 z* ]
</lable><br/>+ `; d# k/ |# o I7 p: J3 g. R. a* n
<input type='text' name='item_element'/><br/>9 y1 ]' j W* y' j8 `4 Y" R
<lable>Element Upgrade Amount</lable><br/>
" C; R& N8 u0 S2 r5 o2 Q<input type='text' name='element_upgrade'/><br/>4 q; u8 Z. k5 L) B! {
<lable>Pierced Amount</lable><br/>; W1 m% { K0 Y i
<input type='text' name='item_pierce'/><br/>; ^% G; I6 e0 y+ F2 h7 Y
<input type='submit'/>
, U2 H% e# C7 C- F; I1 R! x</form>";
! j; C" ^- W# n/ {# }}3 N& O [' M4 U/ c8 a) ]+ J: k" P
( q7 S: \2 p/ | U7 B* yfunction PostListener (){. V* o7 c2 K8 ?4 w5 t
//Add more post variables if needed and add them to initform() function aswell2 y% R1 K' ]3 p4 |: b- T
$ ]0 a4 h7 u1 u
################################8 l$ e+ X. Y+ D$ m& K7 S$ ?; N
##### Connection and Post ######7 m% D1 B. @* I2 E: d9 F- L. a: O9 b
################################
% b. W5 q7 _" ~0 A+ C$name = @$_POST['char'];( @4 x; A- F+ \" ]1 T
$ItemName = @$_POST['item_name'];
U8 I- ^# b* m0 b1 H* w! g4 }, r$ItemAmount = @$_POST['item_amount'];9 B+ E0 l5 C! _3 U4 }8 N4 Z% l
$ItemId = @$_POST['item_id'];5 }/ ]+ p, I+ Q
$ItemUpgrade = @$_POST['item_upgrade'];
. e; f; V; y4 F! O$ItemElement = @$_POST['item_element'];
2 v, e0 i; I8 a# S5 ?% Q# C$ElementUpgrade = @$_POST['element_upgrade'];
* \2 v0 B% E+ H* l$ItemPierce = @$_POST['item_pierce'];4 t# ^" `: Q0 F. Y: s& y+ f
################################
# f$ r+ R/ Z+ O7 N- l2 Q. N5 d
% X9 [) D+ W/ r+ R//Check both variables for empty value: Y( y+ ]2 |- ?7 v6 d" ]
! }0 x' |& u" p- E0 V' eif (!empty($_POST['char'])){
# W" V8 |" T( F* j$ O$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where + h# d- Z) ?/ \
- p" j6 }8 `2 t7 s# ^# E2 u; u
m_szName = '{$name}'");
$ {2 K- ?4 _, a; H9 ]( ]while ($row = mssql_fetch_object($find)){, e# G) F5 x# C' Y! u; M6 N5 N
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
' b, K5 C; W2 m" G$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 2 N9 g) u# l: E7 ^4 D, B
$ V; o. o0 _, r+ w* H
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
( u0 ?5 o4 t% U. ]
8 x. S* S2 ~' X1 l9 H% M[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ! V0 N) g* ?/ c" ?! {
6 Z; j! [& w( H l9 o& J
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 4 C ^: |7 ?4 z. _4 L% j& ~
) s- V X1 B+ X8 m" M3 h" J2 m'{$ElementUpgrade}', '{$ItemPierce}');");
8 T8 z% X* w7 ^5 N" Q}2 { r8 D! \2 a
3 x% f3 w4 S+ H0 N, ~}1 Y% |: [- ?; z* a
C& C7 E2 C8 i# u
}& e* m2 l4 [) g* ?% {* j
' R6 y: a. K$ w4 h% F: ]6 D" l7 E+ q
$InitForm = InitForm();* }, x; c0 \, M6 c8 G
$Listener = PostListener();7 Q9 n! [4 {+ [. z9 l- S
; Q0 P% c, W2 L1 j1 c
?>
) _& C/ z" G, A4 ]9 u) n, M% a; ^% W8 n( z( b% u. p
" s( }2 S$ ~; Y/ H& e5 A$ U8 N, }( g3 A- I Q1 a& q
# g/ _; Q! {2 D1 g: h8 W5 o |
|