|
|
<?php0 F; Q7 P, W; C# g n
function Connect () {, d: z- s" ?7 k# J$ b
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
9 O6 J" B+ t3 p2 R2 B. k1 c8 L* ?5 e; g$ v% g& s% Q
Failed.');* F) [4 G) Z* i
}
' C5 H+ p/ w1 n0 b zConnect();
9 a; m6 h6 r" F, b. x
7 \* H% x m c& r4 ^function InitForm(){
& {; s# e" s; h- f {//layout for the form
& u# L' T% f4 F: U0 vecho "<strong>Send Items.</strong>; O% A4 y) ~' S4 ]3 x2 l1 O# W
<form name='select' method='post'>
3 z4 T7 q& z/ Q' t3 u0 Y1 B" k<lable>Character Name</lable><br/>% @7 m! X" b1 F
<input type='text' name='char'/><br/>
* i9 w8 C8 E) w& g# n' \<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>) a4 m. r$ g1 l# \4 u1 ~7 Y& `
<input type='text' name='item_name'/><br/>) ~/ c6 m8 i! z% K
<lable>Item Amount</lable><br/>
! `+ e' i9 c. Z8 C<input type='text' name='item_amount'/><br/>* W. d. v$ l$ ?! |7 g# f; ~. g
<lable>Item Upgrade Amount</lable><br/>4 b: f9 |- s2 _ G8 U' Y
<input type='text' name='item_upgrade'/><br/>
* | m! H4 P# N5 x<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)3 i+ c! g0 h7 Q5 v" u/ ^% w2 Z
& J' f' L1 g) A! ^, E
</lable><br/>8 Y% |1 B- k6 U- B" v4 f9 ]/ M% b
<input type='text' name='item_element'/><br/>
3 l8 G% e. W4 Y6 S. ~. O<lable>Element Upgrade Amount</lable><br/>
, X8 u% |! |, F' }<input type='text' name='element_upgrade'/><br/>2 ]1 @" ?0 x0 T4 ~0 E
<lable>Pierced Amount</lable><br/>
- V/ R$ v* x- ^+ f; y& M<input type='text' name='item_pierce'/><br/>
$ [* G6 t% i1 i ~<input type='submit'/>$ v3 i: D; W$ g% Z6 Z2 g
</form>";
/ ]3 v R) P2 c4 h1 Z U. a}
; b5 E) s. p* |6 p9 T9 S$ a
i5 _6 H, ^0 r2 Yfunction PostListener (){
9 ?, G; l2 |6 g2 a4 U# v( Q//Add more post variables if needed and add them to initform() function aswell7 n: L# ^/ f6 b3 ^
: i' y7 H9 Q# v6 w################################1 N% T! S9 z w1 [! Y( B1 G6 r: C. ]
##### Connection and Post ######
6 U4 F. N! Y, d7 k( E9 {' u################################
3 n" m* a+ W" J) G6 N# u+ \$name = @$_POST['char'];7 M& | G& E# x6 X. \
$ItemName = @$_POST['item_name'];3 f2 K" w& o4 Y/ Z9 O
$ItemAmount = @$_POST['item_amount'];) ~; r9 C3 p8 Z1 ]
$ItemId = @$_POST['item_id'];6 N3 R5 Q+ z0 @1 `0 g
$ItemUpgrade = @$_POST['item_upgrade'];1 N6 D. t9 p; I0 L; i
$ItemElement = @$_POST['item_element'];
6 E( ?9 j; h4 v% y& b5 L$ElementUpgrade = @$_POST['element_upgrade'];
" z3 U0 g3 {& j' u3 C) B$ItemPierce = @$_POST['item_pierce'];8 d* T5 ~, \& w& f( m# [0 S
################################. l& x: }4 v4 M, i+ R
, ?" s, h' w$ P; w+ { h, D//Check both variables for empty value( f# E+ E' N0 ?: S; |( S3 B
3 T1 ?# t% j, q$ V) l7 i* c# Uif (!empty($_POST['char'])){& x+ E/ k6 Z; s7 z5 b
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
( s9 B# j1 s/ g% q2 a/ U5 a
; P/ U0 G, J! f4 s* V- ]1 rm_szName = '{$name}'");
1 B, E1 W" ]! f8 d9 o8 L( awhile ($row = mssql_fetch_object($find)){$ e& t) w- ?9 C& g* Z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";- P! ^8 f) e; v6 X: N4 B
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], + d7 A7 g3 A0 b, l3 a2 H8 y
1 a! a7 d) o. g; b[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ! S" m1 G6 r7 o6 Q; K. |) l5 N
& C: B* D7 S; U- |/ D `) ]
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
1 }' b3 F% U! _: S* V. L8 ]7 ~4 T; c4 s6 l" Q/ }
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 `; g! Q/ s! {4 H( @# ]
& [8 l/ d& }$ F+ v4 ~# d: Z'{$ElementUpgrade}', '{$ItemPierce}');");9 U+ U5 U. r3 e6 B
}
9 ?( M& W) e; h9 v- C/ U% |8 W! i! T8 q0 k
}
" k0 D2 V8 ]- { i: l# o/ O6 w3 x# I7 `
}
0 R. x0 m$ o1 K. h: q, v
6 ]( f3 G% C" l; C& r1 Q8 |: b! C$InitForm = InitForm();
' y9 A6 v* o4 r$Listener = PostListener();
& @7 z( y- `4 N2 a: W. A% e' o) X7 e/ q) w4 ]8 k I, n
?>+ W" {+ a; b2 G$ ~4 ~- {
. I8 t1 Q: Q8 T/ A2 \
9 y9 c" V5 _& |
/ X5 v! b4 ]2 c! U0 B/ v1 r& r0 B' M0 t' y8 x- W
|
|