|
|
<?php
; ?: R% O7 A; [, T1 y& _' i& D. ofunction Connect () {
1 V. A5 _; ]6 T$ P5 a$ Cmssql_connect('Server','UserName','Password') or die('Error: Connection to DB # X; \ i4 T7 X
0 k2 a% T5 {1 F W4 H* a
Failed.');
! s. S* c+ X4 o5 k1 Q x}8 T. k- d6 ]' @
Connect();7 B0 }1 o7 `) ~ }0 Y# }5 }4 S
$ I" a% D5 m0 U: e0 Z7 T. c1 cfunction InitForm(){
& E2 G; ^! n/ `. a9 K) \# N//layout for the form; ^, U5 O" s0 G5 H9 W8 v
echo "<strong>Send Items.</strong>
* ^9 W2 n- B4 K* p<form name='select' method='post'>+ H1 L1 j6 j) \( j
<lable>Character Name</lable><br/>
9 ^1 ?' \# S4 _/ d2 e$ Q! P% Y<input type='text' name='char'/><br/># D" h! H% I4 u. c
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
! e; K7 X# F1 M& W/ V' j<input type='text' name='item_name'/><br/>- @. ~: T% L1 C" N" D
<lable>Item Amount</lable><br/>4 [3 C, ?& C$ F1 q: E% d* ^
<input type='text' name='item_amount'/><br/>
- O& x, ^; J, O<lable>Item Upgrade Amount</lable><br/># J- k( B% A l- x
<input type='text' name='item_upgrade'/><br/>
9 e! q; J; K, {# I! B( q<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
7 e2 \5 X/ E. N! ?8 @5 Y/ ]* M) B
8 |# x# W2 l$ E2 Q9 z</lable><br/>+ L# P ?0 s$ P3 }0 l
<input type='text' name='item_element'/><br/>1 p9 U9 a$ s; V# M" p$ B6 y+ ]6 N
<lable>Element Upgrade Amount</lable><br/>
+ `7 _& k4 G, u- M<input type='text' name='element_upgrade'/><br/>/ s& Z9 I4 q; I3 c8 @
<lable>Pierced Amount</lable><br/>- ~$ P, ~$ i+ m9 S H5 A
<input type='text' name='item_pierce'/><br/>. N9 t) J, ?3 @: i
<input type='submit'/>
7 F+ K2 r0 l! e5 [</form>";- Q3 c$ D+ X1 Q+ T
}
5 b m9 z* d- e U* `; q
" ?8 W! i: O. g9 Z) I4 D0 x% Yfunction PostListener (){4 q, Z! B1 h) m- q
//Add more post variables if needed and add them to initform() function aswell
2 m/ P# z8 j% ~7 P; e6 O ?
7 x' B( s! ~ Q1 Q################################
* a, E2 i- W& d; d6 k8 \##### Connection and Post ######, w' k% K& x3 V
################################
( D/ j/ v, h7 I$ Z& |; M6 R3 R7 }$name = @$_POST['char'];8 c- r% V6 k. Q0 \
$ItemName = @$_POST['item_name'];
# q. u0 U4 q; ^2 z6 C4 F$ItemAmount = @$_POST['item_amount'];$ s) ?6 q8 {9 L! k1 I! N; W3 Q
$ItemId = @$_POST['item_id'];! _+ W* o' A$ A, f: r1 B
$ItemUpgrade = @$_POST['item_upgrade'];# P2 K' \9 J5 D% d" x. e: Y+ Y6 W
$ItemElement = @$_POST['item_element'];
1 R4 ~6 M0 Q1 `& J% q$ElementUpgrade = @$_POST['element_upgrade'];
& t j* {& T" s7 C$ItemPierce = @$_POST['item_pierce'];" G0 l- K U3 ?0 v# ?+ D
################################0 ^2 C$ g& u" d" e- O
p) `8 Z& {. ^9 O( {5 x3 V
//Check both variables for empty value
3 R$ }8 r' r- v) q U# k" e0 s8 M" i$ O0 D
if (!empty($_POST['char'])){
: j8 w, a. J% h# ?$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
3 R- E7 c2 E# _& i: p0 Q! h' s
5 `* M5 r; i# U, f( [ P/ Tm_szName = '{$name}'");& y3 c5 O* @6 A# ^9 b! E9 X3 k. P
while ($row = mssql_fetch_object($find)){
2 h" J7 |" N) w0 D2 Yecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% a5 x% R! a9 d/ t B
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
* e/ r# j, r* \ h4 D3 [4 Z$ W ?% w% v2 B) H$ c" a: b
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
8 ~. D6 f0 e- @" C+ b% x/ g; w$ j) |) |
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
: e! o; d8 ?1 `7 F
; o; M/ Y) a- q$ h- P# Q/ v$ [5 ON'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 9 L; e, l1 }% R
7 A9 c1 Z% w* O% i) k+ X
'{$ElementUpgrade}', '{$ItemPierce}');");
) s7 v. k- f2 `- y9 L}; M, h+ n5 R& S# D" b* S
- q7 J9 P& k! D: C' P}
% N. p1 H2 X1 U' c# y# l; c6 u( i2 l# |7 t' z0 W+ w
}+ n% B, w v) J* o& l" [- S0 O2 ~
g. ~7 n! h2 c$InitForm = InitForm();' Y; D4 a( T9 u; ~+ u' X2 }
$Listener = PostListener();) u4 F; H0 x0 `5 j, S6 a: f9 M: B
; z& p' I5 b7 r1 s3 [& ^. _2 M2 f?>
# D3 s" W& @0 ~- I `
1 d+ J$ F# a& }8 a( \& {) h9 ]+ g6 x( s5 V( C% p
% a) a7 _% t% _4 M: W! y! p9 K( t
) n. @! ?& a7 b |
|