|
|
<?php% d$ ~ \7 G& o- s9 y3 s
function Connect () {
3 V( y" @$ t' `6 Omssql_connect('Server','UserName','Password') or die('Error: Connection to DB
1 {' j" d. w Z% ~7 Z# p2 y5 Z0 m3 Y' t$ j7 F! ]
Failed.');
; W: h8 m: Z3 ~}# G: h' x8 E8 W$ i+ Y8 K
Connect();5 L: b& F% }2 r5 W
% J: f/ Q& x9 B6 N! Ifunction InitForm(){7 ? F& B. e0 ^; E( V+ h
//layout for the form1 N0 a% ]! X/ ?. d
echo "<strong>Send Items.</strong> G4 O# G+ a% V0 t
<form name='select' method='post'>5 |% M$ }+ I; R7 p. i5 N
<lable>Character Name</lable><br/># R! d+ p) j U0 P6 z% s. z1 \
<input type='text' name='char'/><br/>
3 T- {8 B2 y. H+ i1 r) S x<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
6 L( v2 E' E0 d) _4 I, {. A% a<input type='text' name='item_name'/><br/>8 O$ b h7 ?: w; |# Z' d
<lable>Item Amount</lable><br/>
' h; `3 m$ b' j8 \" E+ e<input type='text' name='item_amount'/><br/>0 k M+ f0 @% {) |$ x1 j6 |2 n
<lable>Item Upgrade Amount</lable><br/>1 |8 k$ t9 y) R$ ~- H/ m
<input type='text' name='item_upgrade'/><br/>7 v- k4 t% V8 d$ [
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
- F) z7 r" t0 U# G1 F4 n* r. v$ z7 \4 ]! I* I$ O& k& ? s3 ~
</lable><br/>) o! D k V) s$ y, X k
<input type='text' name='item_element'/><br/>
( ]8 ~1 G0 T3 H& D3 @% p<lable>Element Upgrade Amount</lable><br/>) v$ U8 b7 e r9 ~+ L- x% o) J s
<input type='text' name='element_upgrade'/><br/>7 E0 r5 A2 N/ L* B1 |
<lable>Pierced Amount</lable><br/># ^0 ^& h( U2 @8 T' d+ R% i7 C# z
<input type='text' name='item_pierce'/><br/>
6 r% [- K* \7 c$ G<input type='submit'/>
1 A) A# Q1 O( z</form>";1 R6 H$ V" f, B7 x' V5 `! i
}
7 a$ ?' l4 Z8 Z5 |
: u2 y: f8 V" r5 M1 g+ Sfunction PostListener (){
" {. u/ E7 K! q0 H//Add more post variables if needed and add them to initform() function aswell0 C$ f: m% j( `9 l# }, e" e+ D1 ~
, ^. L ]2 Q8 L
################################
$ @- s. o5 F8 s }0 [: z##### Connection and Post ######* u% D9 E8 `5 h! t2 ~
################################/ L6 u- S- I3 t
$name = @$_POST['char'];; X+ O* q9 ^' U. g1 X8 \! O
$ItemName = @$_POST['item_name'];; t* w" ?; X; V$ J# K5 u
$ItemAmount = @$_POST['item_amount'];: `# H8 \# M- z2 o/ A3 X# [
$ItemId = @$_POST['item_id'];
$ l5 I3 O& B* D$ItemUpgrade = @$_POST['item_upgrade'];0 _2 P0 U1 B; B6 l7 C
$ItemElement = @$_POST['item_element'];; h6 R) M1 J' |. C ]; @7 W- i ?+ t; x
$ElementUpgrade = @$_POST['element_upgrade'];* u. F% ]2 r! [7 m: F! P5 Z
$ItemPierce = @$_POST['item_pierce'];
& t) c3 D' Y$ R: q( Z. z: V% B################################# N% B# _9 K5 s$ E
' ?' v4 a3 w8 Y1 X! q3 Z9 I3 j//Check both variables for empty value
4 V7 v2 B/ J2 C" U/ I1 D
' N$ t+ E& n4 m( @& E* fif (!empty($_POST['char'])){
, B# @( X6 q4 v5 h7 r. R$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 Q1 Z5 D& K( Y1 }" o& t% W
! X" o& B1 h: b4 |m_szName = '{$name}'");
/ q2 [# ]$ A1 L! Z7 l+ p; ^( Ywhile ($row = mssql_fetch_object($find)){
/ j: g( p/ ~/ L8 a0 jecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
4 d) w. A2 s( h( r/ E$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 3 M4 @$ o9 v* p& [: H" n; h/ f. U
% v) B' ^1 M w% B4 f7 M3 r4 k K1 J
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
- y5 Y/ l9 C& k
$ U. L4 V) H N s- J+ i[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
& S$ o- _: Y1 M! g, {+ q/ ^! |! M" S& |3 k% Q" Z. B
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
" z/ i" n; ~' i1 m: d* }& S, @" L" K
p8 Q( ?0 X% {9 `" _2 ['{$ElementUpgrade}', '{$ItemPierce}');");/ \5 y. F9 Z; q( K6 n
}
5 k0 Y6 D: @+ C9 t$ g
) d- t, v0 x$ A} [7 }; g ]4 e: g& W
/ o/ G: w; n& p R2 h+ D6 A
}
$ B% V7 x J& R( I5 }! Z$ F% l" e( c' C. C5 w) h+ X
$InitForm = InitForm();8 S4 Z" ~3 D8 M+ U; ]7 S, G3 U
$Listener = PostListener();
+ N b4 |% Z: ^# _5 {, w% r
0 a3 k1 d x3 C: p; a* `?>9 A* W6 F- L8 E+ d! o
% u% ~1 y D' R8 T7 }/ o/ a$ w1 i0 _
! h" h; I9 v2 }# m# i# d3 V
: [0 A3 k. g8 N n4 C4 c, \; h) u# P: m, p" A
|
|