|
|
<?php4 a$ { \& A8 Z6 y" \
function Connect () {
% n; B' Q( r* Dmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% }3 J- s f7 O% U" ` G/ E5 Q
+ ]( j$ B# o/ c4 f+ oFailed.');
# B8 F' X# Q/ Y- g}; e% z* h5 O. G' ?
Connect();2 }7 `9 Z0 y9 i% b6 j" j6 \) X, ~
. a0 ]! Q" j6 W/ I
function InitForm(){
. ?3 v0 u4 F* b# i9 g//layout for the form _5 u1 P5 w% [4 ?
echo "<strong>Send Items.</strong>
/ e0 ~& v6 C% u: ?$ G2 ?# j9 ?<form name='select' method='post'>, y) T+ u6 L) s: [* f
<lable>Character Name</lable><br/>, {+ u/ \) r8 t5 H) @, G
<input type='text' name='char'/><br/>
: g" W4 z0 C' f% i2 p; S7 `2 J<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/># ~2 y; \# |8 c, s
<input type='text' name='item_name'/><br/>% a0 v+ Q- K- J: E
<lable>Item Amount</lable><br/>
/ ?/ P( h( z0 M1 j! K& R+ U<input type='text' name='item_amount'/><br/>! i1 _4 Y! c* I$ t. u
<lable>Item Upgrade Amount</lable><br/>5 n5 R( O* t" Q# J8 O( h: c
<input type='text' name='item_upgrade'/><br/>
$ `- G- p9 x7 M4 D( k, @& s2 U. f/ Q<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)# B- }( @+ X! r( ]# i" b
! j3 E6 r3 f& V( L$ l7 Z' ^3 X8 ?* p
</lable><br/>3 o. R9 `! q+ W% q7 F! P6 L
<input type='text' name='item_element'/><br/>8 q/ Q" R, k% y5 i
<lable>Element Upgrade Amount</lable><br/>
2 F, q9 j' B/ I- M6 q# u<input type='text' name='element_upgrade'/><br/>& ~5 @% @' o! s5 b0 |& Z
<lable>Pierced Amount</lable><br/>
/ }+ @% x+ I5 f; b* Z7 S<input type='text' name='item_pierce'/><br/>
; v4 ~$ L6 U/ F1 S0 ]) {( X0 |<input type='submit'/>. b0 v4 X% B+ F
</form>";' Y9 _. q3 X- D8 S
}# O9 y* E. q( g6 e0 [! v/ Y
2 ^* H$ _0 a3 o4 @) i+ F S4 f
function PostListener (){6 s. B7 Q* A3 e7 |( R0 A! [
//Add more post variables if needed and add them to initform() function aswell8 G$ d7 A6 j( L5 T9 g* o* ]- [
# Y- f$ @) F0 K" F
################################
* i/ ^2 o* Z- a& j% t8 U##### Connection and Post ###### o. e) y3 O; R3 K, o
################################3 Z8 _7 c4 y6 {' {& @2 C5 a1 o
$name = @$_POST['char'];( d' C! X9 R+ K' T7 W
$ItemName = @$_POST['item_name'];
* R! d5 S! P- I1 u* R# V4 F$ItemAmount = @$_POST['item_amount'];: z. v7 u) q/ V
$ItemId = @$_POST['item_id'];& D3 O5 _/ D6 ^
$ItemUpgrade = @$_POST['item_upgrade'];
, o( d" T$ f# O3 y' Q! L% r$ItemElement = @$_POST['item_element'];
/ X! n4 H1 n! d9 z) i0 A$ElementUpgrade = @$_POST['element_upgrade'];4 N. N- q) p3 c9 H$ j2 h
$ItemPierce = @$_POST['item_pierce'];2 V- w! g% z- ^9 a
################################( |! I0 G4 |/ Y2 O
# R& G0 d" b" r; P6 Y# ?
//Check both variables for empty value) j6 f% D+ D8 \$ P) J
( M8 v- s" e8 \$ w! P8 u
if (!empty($_POST['char'])){
5 W- _5 _# E+ a, g$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where , R& p ?, C5 ]' }) Q- `
, U4 t5 N; }2 ym_szName = '{$name}'");- G/ d' C# {- _+ i+ A c/ {
while ($row = mssql_fetch_object($find)){
$ M5 R+ v: H0 N6 cecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";. D$ J% Z! g* N @! j
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], , P" c% A5 D9 P1 |
% m% T1 z \. f) x* N& f3 v
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 5 I3 B# L5 u% B' z
4 D# B- ^. p M
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ) P" t+ Y2 }, P# s! u5 S
2 `: z8 k5 ]( j3 H, V
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 2 d: I% |1 t& W! T0 P9 ?4 ]7 n7 f
" N' P/ C- p E% B' ?
'{$ElementUpgrade}', '{$ItemPierce}');");; |! I- R2 ?% \* _
}5 Z; A1 y% b4 B( m7 g4 \! l
4 m. d, l9 o* A6 X}
* ]* R F4 v- g+ F7 \# j, \2 ]& _1 N Q6 Z
}
# V( M4 s- J2 x, E! K
2 Z8 b/ F/ z: C. l" _% c% S7 q0 |$InitForm = InitForm();3 U1 p t% `9 P+ F9 g/ L7 ?' l" z" U
$Listener = PostListener();( I2 r; Q: U. |
) B$ O8 r! _+ S' P. y3 B
?>5 c; m9 N! {, |: U4 w
8 R, F2 V+ j& d: A6 }3 R" L H
: }) |& r) J6 d* ]+ z0 k
. b1 t. r( h: S8 Z, D$ G }( q: x/ n
|
|