|
|
<?php
6 M ?1 `# [; P! sfunction Connect () {: b, s7 E. A8 M' R( {% J( T: w
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 1 d0 `* V; W" E0 N7 L3 K6 i
. b' j! ?/ \6 u9 p9 G+ I9 qFailed.');' r) D3 {; N4 G9 @) @
}7 ?4 h# `: t5 f1 W# c
Connect();5 |8 M; ?" h, h D
. Z: e1 P! F+ |3 g
function InitForm(){. i! o7 `6 b9 }5 K. [
//layout for the form* R5 U9 ^; T1 Q8 F1 r
echo "<strong>Send Items.</strong>
& C# _1 K3 a+ M5 Y<form name='select' method='post'>
- q% Q* t! {: w9 |+ m( o2 E9 }<lable>Character Name</lable><br/>4 v/ M# x7 C' u- f
<input type='text' name='char'/><br/>$ A$ c0 E7 E. R0 I2 z" v4 o1 \
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>0 r5 U4 X- t& C8 \6 B
<input type='text' name='item_name'/><br/>% o$ z5 L+ T) I- \8 Y
<lable>Item Amount</lable><br/>0 E3 p: p i. b- H$ ?6 M2 q
<input type='text' name='item_amount'/><br/>
; Q4 j) L5 X( [3 G/ F, a2 p<lable>Item Upgrade Amount</lable><br/>
$ b6 V) T: b1 X3 R<input type='text' name='item_upgrade'/><br/>' T0 ` a+ K* z; v8 K) Y
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
: A5 r& c! C. g2 `( n7 |% k! h: {* H5 ]
</lable><br/>5 n( j G" r2 p4 a. f! j
<input type='text' name='item_element'/><br/>! w' U: ]( h- J
<lable>Element Upgrade Amount</lable><br/>' V, T- s8 M5 C$ Z5 H
<input type='text' name='element_upgrade'/><br/>
2 }4 w6 D% i* Z0 G4 s. R% w, E<lable>Pierced Amount</lable><br/>) d ^! T2 D# J: M2 t
<input type='text' name='item_pierce'/><br/>
; [: m$ r7 O6 h \9 |5 Z& ^. a<input type='submit'/>
, e9 w: Q I4 X</form>";
, \/ b: ]2 W! @+ I8 A}
6 v8 ]' \# R* N/ G
6 H8 l% n# N) g+ A- Yfunction PostListener (){: @5 c3 W" J7 R) c+ ?0 Z
//Add more post variables if needed and add them to initform() function aswell
7 t" L% c7 C* a7 Y) q
/ B" S# Z7 I$ a################################
2 `9 O3 s# b+ q' V% R" B##### Connection and Post ######
/ d7 o6 h0 b: q7 \3 E. G2 U6 Y################################
& c7 Y' l! w6 E: a+ V+ Y$name = @$_POST['char'];
7 Y7 J0 J, g8 }% ]9 H/ Q$ItemName = @$_POST['item_name'];5 H& i( x, {/ [4 z
$ItemAmount = @$_POST['item_amount'];
5 C) K% ]( Q4 C' \- l' D0 p3 g$ItemId = @$_POST['item_id'];& n2 f' m$ `* n& L" {% K3 G" u2 N
$ItemUpgrade = @$_POST['item_upgrade'];
% l0 j, o6 E2 ]0 O7 M: J$ItemElement = @$_POST['item_element'];
2 A) Y: i5 J& S) v5 Z! a. E! J$ElementUpgrade = @$_POST['element_upgrade'];0 ^+ e+ A# e: q
$ItemPierce = @$_POST['item_pierce'];
! m2 J( o( l8 ?$ Q) W3 q/ @/ }' B################################6 Y3 @9 S9 K# a3 y: | E$ h; F
6 g3 @/ R! z$ ^; I! F2 w7 B7 L; w/ e//Check both variables for empty value y+ Q$ y3 L+ U. z7 d, ^2 e, g
4 w7 N- v, ?2 e4 sif (!empty($_POST['char'])){
" |/ |$ ?- K8 Z6 d$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
! d9 Y4 w7 l* ?5 E) ~- f" g- X+ h8 M
! |: k/ }0 b: K- Um_szName = '{$name}'");3 K o9 V8 ` V; L
while ($row = mssql_fetch_object($find)){+ N8 f4 Z5 D/ f) s# H* d6 V* w
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 |$ H( o6 s4 B) _
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], V2 z. w4 g9 _( X
/ T- z/ I( Y1 e6 ?' ]
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], + W: @* p+ \( o! t1 f# m+ x
! [4 }, k" c1 W+ D8 }9 T0 E/ [/ M
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ( e5 s. U- ~. ^6 j$ m; t
4 t" V1 R: a) z h5 g* W
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
8 a- ]* d3 y% p, L0 P6 F% }. T
3 G6 ?* I) n% V7 o% _9 J'{$ElementUpgrade}', '{$ItemPierce}');");
# E( ~) G# j+ T; R0 W) O. F}
+ q2 H5 u1 `, P/ Y- m9 c( y* \: G/ w4 ?. `3 X: X2 k
}* G3 z+ X& x) G
& J' f. P- | |) I! E: I
}
5 e+ U. o$ R6 B6 b/ S: y) j" C+ Z9 R3 F6 q
$InitForm = InitForm();
8 J$ w3 [2 e" m1 |$Listener = PostListener();- M2 M$ s e0 Q4 \' E0 W% [
6 Y* G; q2 `9 r" e& C5 D
?>
% }5 ?- S, N$ x; z/ N$ T- h& x3 ~3 E3 [/ M
. C5 p& Z: G) A4 O
- y' h/ D0 T z- K& W
- b- L: Z9 [0 f4 J7 u |
|