|
|
<?php
. U2 a; h" h$ i( K, Ofunction Connect () {
% r$ X4 W. C, I: Zmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
3 K0 A# A7 W! i- Z3 D* H7 u: f4 J+ b! E1 L- Y" m- d; _, f
Failed.');# C! g# z5 L$ ^1 m. B+ b+ b* N
}
0 A7 B3 V, ^3 J3 v! }; _Connect();: I4 M- _& C; I5 D5 Q
. ~$ j. D: j$ O: k. @function InitForm(){
# f$ ~7 a, ~7 M* L//layout for the form
3 M' ?7 Y' ^& E( X9 l m4 e7 z. B& vecho "<strong>Send Items.</strong>
' g- c) ?' v: S3 d; A<form name='select' method='post'>
/ ^+ Z$ ]5 L, a5 ]* H% p<lable>Character Name</lable><br/>
9 B# n0 i% s0 C9 k<input type='text' name='char'/><br/>* j; C* @9 H+ q) h9 w
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
$ p8 m8 Y. s W8 p2 {& A! p<input type='text' name='item_name'/><br/>
5 Q" p9 L$ z$ e6 @/ w( p<lable>Item Amount</lable><br/>% r, a- w' H; O. K. h
<input type='text' name='item_amount'/><br/>+ \8 x0 S0 F5 y' _, Q
<lable>Item Upgrade Amount</lable><br/>
* i' u& a3 `& A+ Z) X2 C<input type='text' name='item_upgrade'/><br/>( R, Z5 U. K& z" J" Y- f) Y
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)/ z+ Y* H! x6 A1 \& T
6 Z7 I; R" A& S1 t* ^2 | o
</lable><br/>
! v7 `# f6 A) S& G5 m- U<input type='text' name='item_element'/><br/>* w" f, w$ s: D. O; v
<lable>Element Upgrade Amount</lable><br/> \$ W; M$ p- p! o- ~
<input type='text' name='element_upgrade'/><br/>4 G& d) Z" l% t' J
<lable>Pierced Amount</lable><br/>
, g: M; A' Q" r4 P$ n4 }<input type='text' name='item_pierce'/><br/>
" A' b5 J6 _/ e+ Q% S' _$ I4 }<input type='submit'/>
0 _: a. F8 F5 [/ b</form>";
1 r o, O: r$ ]6 j$ C4 a3 y}
" H" F) H3 L q; n* ~) ~# I* J1 ?" I
function PostListener (){
% h4 W( c% S6 ] h6 @. a: K$ @//Add more post variables if needed and add them to initform() function aswell4 v) x. z. J- O1 Q9 ^* \# K: P
% T( c8 g- t+ i# h################################0 ~& Y: v7 L" d
##### Connection and Post ######
+ C; C3 r/ ^1 g################################
$ D# d0 l& V" ^" z$name = @$_POST['char'];8 U% @' x% a) y% C
$ItemName = @$_POST['item_name'];
# m( W# c1 `8 G9 X+ Q: k" V% I3 H9 }$ItemAmount = @$_POST['item_amount'];: D. L& h, L: M% H$ r! z, s6 x0 v; y
$ItemId = @$_POST['item_id'];
: v" ]% a/ N4 j! j* Y8 |$ItemUpgrade = @$_POST['item_upgrade'];7 J# m: R7 S, M; W' n; u2 ?. {+ y
$ItemElement = @$_POST['item_element'];
& H% \ R1 a, l p1 E/ w5 q0 R$ElementUpgrade = @$_POST['element_upgrade'];
$ B: `' F1 I) Z7 W, ]8 Y$ItemPierce = @$_POST['item_pierce'];
2 V4 R$ Q9 Z# W- e: S. g. c7 v& R################################* M+ p& Y4 X- c& s: G- Y% a& o
% y9 q( u$ d2 k4 B$ p: {" \# W
//Check both variables for empty value
: {2 l" }5 k# _4 @8 U- _. o0 C2 _1 H% c) E
if (!empty($_POST['char'])){+ P# I3 R7 `; G' y
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where # t/ J$ d8 s& m3 r |& s5 r/ K
8 p( H& t$ U: F% m5 x4 C; _m_szName = '{$name}'"); @# A0 u) d" m& J
while ($row = mssql_fetch_object($find)){" Y* w% M% Y' [5 i3 n w4 T" I6 ~ H
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";; _5 j# J# `1 K( U+ a V. v
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ! t; R. J. @2 `; n8 O+ {
6 i7 t7 ~9 v: a0 n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
! V# @" |! P' p6 Q* ?7 t K0 k; N
% x6 `$ @ B# U4 E[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', & O& G$ T' F6 d- ?
4 x8 D6 m J% [# ]- m2 Y6 i- c
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
6 I5 k2 d, @4 x; O& V. w
# r: o+ _1 g' A'{$ElementUpgrade}', '{$ItemPierce}');");
* f" k0 b9 e- F. [6 R}3 ~+ ]2 z+ h# M1 C3 ^
' i* ?# g( o1 |6 |7 C& O) P: ]
}
9 `: T' Z# ]% ?6 N' ^ f/ e( e( m! z1 X
}% c6 E: n5 Z% W. I7 j1 A* o; B. D6 h; i
9 g0 X* k- @2 f% W
$InitForm = InitForm();
( v, H# P/ q) |- Y6 L8 c$Listener = PostListener();
# O% ^6 s4 G# p, ~* U2 Q$ S
# X( h9 n* o( ~?>
2 X, L7 Y, Y6 x$ l* C2 y' F& S3 W1 B; T1 h; a
9 |" S( ~# D8 X. H. W0 M
p6 K1 V4 }4 z7 H3 b
& X* u" c2 H* i/ e$ O7 h |
|