|
|
<?php$ b x" T, W: N" u' F0 w
function Connect () {
& _, e M2 P9 s$ h. c+ vmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
0 D( X4 f" S4 v! m% i' u# h1 Q% H, F/ K9 S! b; h
Failed.');; `, e& D+ N6 b' O/ E0 Q
}- w: o* [% O8 \; c
Connect();
m9 x L0 H) D7 q }/ c5 Q/ r c/ o) [# N2 \2 o2 `2 u. C, g/ N
function InitForm(){& T" [1 {* s0 F0 n7 }' {
//layout for the form
/ j6 ^8 X ~( G& U4 m* J% P: |echo "<strong>Send Items.</strong>, I/ H: J( @: g7 _
<form name='select' method='post'>8 ]; |5 L: J1 h; f! }
<lable>Character Name</lable><br/>8 I' ~1 T' E# t5 y/ C% p
<input type='text' name='char'/><br/>
4 I Q& P% X/ X% O<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
' U) Q9 j8 U: d$ x<input type='text' name='item_name'/><br/>7 a/ g' } b% f6 H7 Z
<lable>Item Amount</lable><br/>
' v/ ^, d" M. y+ i<input type='text' name='item_amount'/><br/> ?% y3 Y& [7 A8 I+ C
<lable>Item Upgrade Amount</lable><br/>, M5 H2 ]8 c6 P6 @
<input type='text' name='item_upgrade'/><br/>
. G u2 A* A' j* ?<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)2 q4 n1 L/ k! P- p7 O
7 e9 w9 ?+ [& T3 [( C4 }
</lable><br/>
0 g4 b6 Q c: y" X( T( A G<input type='text' name='item_element'/><br/>0 x. w N6 A/ H: S! p9 i
<lable>Element Upgrade Amount</lable><br/>
3 ]. m9 z+ [6 X( j/ T; v<input type='text' name='element_upgrade'/><br/>
- C# b) a; _' N+ K6 e<lable>Pierced Amount</lable><br/>; n2 [; S: W7 u g" Y7 y$ g
<input type='text' name='item_pierce'/><br/>/ h0 Y- W2 e2 j+ t# _
<input type='submit'/>
4 w' t! R5 @$ l5 o</form>";
! N% _4 D& x, Y0 i}; Y$ D$ O( ], F3 [: U$ f. Q3 x, p* U
& ~' T" A, i9 l7 nfunction PostListener (){
8 y& v) H5 G' f: z) K- k6 i//Add more post variables if needed and add them to initform() function aswell9 ^- C, I3 A: y+ t2 s2 w
# N6 b+ S0 p5 {9 u2 E4 C################################) w6 t' H5 z: {0 `
##### Connection and Post ######5 i5 C" w4 E$ X! ~. E( }) k1 k
################################
: a$ W* F' H9 U* h$name = @$_POST['char'];7 n+ p5 y* g) { B2 y5 L
$ItemName = @$_POST['item_name'];5 K& A' I* A2 f5 M% w+ q
$ItemAmount = @$_POST['item_amount'];! I$ Y% k. m9 m. o, x4 J
$ItemId = @$_POST['item_id'];
1 W; _5 B7 M ^5 x2 ^$ItemUpgrade = @$_POST['item_upgrade'];
1 U, h' B5 d7 B7 M& K5 V: c* m$ f$ItemElement = @$_POST['item_element'];
: R2 W3 r C- X; V8 ~$ElementUpgrade = @$_POST['element_upgrade'];
5 X+ S/ }3 s w$ItemPierce = @$_POST['item_pierce'];9 t0 z7 d' T0 b' p- p
################################" O) E( ]/ F) `& E6 K/ u% W K
) s5 k5 A' [+ I9 E% ]
//Check both variables for empty value
) o( |2 R2 k4 f
0 b% `+ i% Q2 W, ^if (!empty($_POST['char'])){
z: U2 u, {$ U- I2 A7 q4 n6 b5 r$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
0 ]. i. Z* s/ x6 h5 O* d, I% k0 T' q# d1 ^: x! t
m_szName = '{$name}'");: \: }& x' y6 w$ \4 @% K5 p
while ($row = mssql_fetch_object($find)){
! i! O3 |! ~0 K+ ?echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
0 R; n- [- k& j2 `: ?. i5 p$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; m( Y: H* j8 b. J, P0 e$ U; g
; u/ A1 {, P' V. t[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 E8 ]- W: a" _& h) P
: ?+ [9 @8 G5 `6 ~' r+ F+ P[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
# X6 s7 d5 Q+ ?2 Z9 w
2 K" |7 F0 ~) B/ HN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 B6 }# d% F I- x" ~! ]$ L
" S- D# U% y1 p1 `7 P' u'{$ElementUpgrade}', '{$ItemPierce}');");; r& }- z2 B; P/ H% v2 Z& \
}2 V: p V0 e: {
" s& z$ J- i8 C7 K; Q( Q}0 j) P9 F. Q2 i9 e
+ c1 x! `1 Q$ c: `}
( Z. c* `% T. F0 z4 _& v6 p$ b0 b: P3 h
$InitForm = InitForm();* `6 k2 s# f7 Y S4 X$ L
$Listener = PostListener();
( N: c+ @' ~5 G% y, |
3 q% F; o9 ~7 ^' C6 A. }?>* F. F# C3 e( g7 {/ I2 }( m0 m! ~
+ I* |7 ~$ r4 O2 g' [
4 M% |0 p0 [7 F/ f# X! S7 v
4 y$ e* U: ]: R' P% g9 Z) k4 s- p- l" T1 c) ~ k
|
|