|
|
<?php
" a3 @* m; @: B$ v3 r9 kfunction Connect () {% J; z9 k0 G1 X" Y
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB : V3 l* C5 r5 V9 r" M7 ^
. R$ F1 d6 ^3 G% R7 `Failed.');3 s6 Z$ K1 a. t7 t0 s1 {8 o" s+ N
}$ l( x) u. D3 h3 I6 d
Connect();$ I$ B" D9 i% ]1 ?
9 V6 z7 M* N+ l( U* Z! W
function InitForm(){ V! `* w" z# l1 ~0 b
//layout for the form+ e5 W s6 v* g% M( E5 T1 M
echo "<strong>Send Items.</strong>; D q$ E: Y Y8 g
<form name='select' method='post'>
% r% e2 t! o1 g<lable>Character Name</lable><br/>) O M2 v% {- z7 v
<input type='text' name='char'/><br/>
" [- L9 `3 h& T6 z; N<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>& F8 d2 a2 N: S2 ~# U+ x7 O
<input type='text' name='item_name'/><br/>
: Y( J6 h2 h. E: l X% w0 I/ U<lable>Item Amount</lable><br/>
4 H# e( i. o: f8 Q- X8 U7 G<input type='text' name='item_amount'/><br/>2 |# P/ B: Y1 b) I( `3 v
<lable>Item Upgrade Amount</lable><br/>
- G" J" v' o$ N: W" v5 p+ @<input type='text' name='item_upgrade'/><br/>
* I9 l4 b7 e8 _5 v8 p" Q- y, i<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)0 t% N% u L* o7 j5 O
. H! r' x8 C( H$ f0 I</lable><br/>& p5 y# }) B: ~" I7 B0 R5 T
<input type='text' name='item_element'/><br/>
]5 K) T3 n# H/ G) e* ?4 u<lable>Element Upgrade Amount</lable><br/>
T! I; s+ R) b6 L: R# g0 S<input type='text' name='element_upgrade'/><br/>
5 a' [' {+ m5 g/ ~4 Q7 M! y<lable>Pierced Amount</lable><br/>( E0 [% `, R1 L! o
<input type='text' name='item_pierce'/><br/>; q( Y) C( E$ v2 F0 z/ D
<input type='submit'/>/ g2 {$ ?- x6 I8 ?' y0 q5 w
</form>";
6 a) u% f& R9 ^# Y+ v; t" U" B}
+ V& A& w) n$ p4 o: }/ P U! d% v. ^6 I/ M
function PostListener (){+ B9 d, H& r, N, `- L4 R0 t0 Y0 ]
//Add more post variables if needed and add them to initform() function aswell
. A) f, J; G, y6 @+ V
* Z; b0 G. ^& \) ^9 F( `# y2 f4 u. n################################ [& X( ]& O! M( E
##### Connection and Post ######
3 V" y7 K1 m0 r1 b9 d/ \################################! ~3 Y0 k+ Z+ m6 {+ P f. Y
$name = @$_POST['char'];
6 x: S, t! x& Y7 D7 S% M r$ItemName = @$_POST['item_name'];( F' j# o5 r0 H' s; _
$ItemAmount = @$_POST['item_amount'];
' G- U. s4 g2 s# x8 [- A- }$ItemId = @$_POST['item_id'];
6 G4 P& P+ J: s5 U2 ?) l5 n$ItemUpgrade = @$_POST['item_upgrade'];" v/ J0 ^$ ]/ T
$ItemElement = @$_POST['item_element'];
, C, c0 P7 y& B$ElementUpgrade = @$_POST['element_upgrade'];/ \$ J* S7 h% @ i K
$ItemPierce = @$_POST['item_pierce'];
: y8 w( ~3 C f2 [* \$ r- y################################
" F6 ]0 A# ?! U" e) a# K5 \" y6 Q
//Check both variables for empty value
9 M" A) u# i% j( E# r# w0 {7 L- \$ ~( t9 `/ C7 f" N. B. k4 C+ J& {% u
if (!empty($_POST['char'])){
0 O: T. g& W3 d! p" T$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 3 B* M. A b/ H f$ O6 x; V1 n
( O& Q+ h/ B6 D* l! e! z
m_szName = '{$name}'");
! r. P+ h. a, x9 `9 g6 B" ~while ($row = mssql_fetch_object($find)){% O: x. Z3 }/ T0 Z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";& r5 W# J8 B' \* `5 J% }
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" F ~! K+ O5 F; x5 o) H7 `+ x; N0 E7 S: u2 O
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
! a/ |, f3 ]3 {0 H
# D8 H0 c! b: N- c S% y8 K$ A[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 1 ]# F& K& `; z0 H) t
# [* x8 M9 V0 O* E$ ]4 ]4 z' _
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
" l' l8 `* B0 W' ?+ k! U0 q1 u) o& ?& ]* O* A' Y7 }
'{$ElementUpgrade}', '{$ItemPierce}');");
2 @$ d! N& [6 A! ]} T7 ?+ b8 I5 H. p
9 }7 g9 Q8 P2 H! h! i
}* B w% F0 c5 q, `- ~
! L! @( x3 f u6 b* ^$ |}
" I; s, f/ ?; D! A" `8 X; J
7 {0 B, x- v7 P3 x, j$InitForm = InitForm();
+ W% V+ u9 d, F$Listener = PostListener();+ ^* m Z6 d# m0 C$ q
+ n9 H4 a& a% c6 \
?>
4 o: d E- D6 D$ l$ s% o. J# w# f; `. t
# |! g8 I/ @$ y0 L0 E
7 f8 o9 y( W7 B" N; m Y7 I& U n6 q* m$ h9 c& @9 b+ o1 L
|
|