|
|
<?php
) c5 K3 p; j% A8 Pfunction Connect () {
. P5 g9 B( r0 n( ?+ s/ ~mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 3 ?& \" |& X4 z7 y
3 }- n8 @! @+ k/ c
Failed.');
9 z) |* N0 a& \5 u z8 ]}! [' E# @2 l2 S/ W, q8 [% O
Connect();
, n. N; i2 f, k& u) v% q0 b- m" C+ Y" Q+ s7 V- V7 T
function InitForm(){
% A6 w: n4 I3 L, E6 _: z, n# T$ c; i- q//layout for the form9 L c' a h: c2 T
echo "<strong>Send Items.</strong>
# I5 o: a' x/ L<form name='select' method='post'>
0 c5 C9 }1 o/ `# I& d7 {<lable>Character Name</lable><br/>
, ]6 y) ]# g' E4 o; d<input type='text' name='char'/><br/>
- k" x j0 L* t4 P<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 U6 B" @ a% Z m/ Y- z% P! G<input type='text' name='item_name'/><br/>
! ^8 M: l1 b* v# j. I [$ d<lable>Item Amount</lable><br/>
; j0 m' n) m- T<input type='text' name='item_amount'/><br/>
2 U; y% C j, p$ u. d* F<lable>Item Upgrade Amount</lable><br/>7 [) C T. K/ x4 b `
<input type='text' name='item_upgrade'/><br/>
. V$ d9 |4 r0 }6 K3 T- g4 B<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)6 u& O- O& X6 P& {- U7 X
4 G! q, m3 l) ~# o t+ _# {
</lable><br/>
7 P# b" L5 n3 \! |<input type='text' name='item_element'/><br/>
: H6 r" ~" R3 w: f' W) y) _<lable>Element Upgrade Amount</lable><br/>
. u O; w. u N. O: F9 n<input type='text' name='element_upgrade'/><br/> x# G% w6 }! }: z" Q
<lable>Pierced Amount</lable><br/>
2 n. L1 k0 w! w% _& Q" K. \! v' f<input type='text' name='item_pierce'/><br/>+ B, R; c/ w7 V9 [$ Y/ S+ G
<input type='submit'/>
# ^/ O0 Z5 ` x' Q</form>";: K, Z' y! K1 n7 e2 V4 r& X Y4 a
}
, R6 N1 W9 m I4 i! u+ u( W- z" o% v3 k& {" B/ `3 L0 k# G+ A. _& ~8 j
function PostListener (){& S* B5 M5 q: g& w2 @7 N
//Add more post variables if needed and add them to initform() function aswell5 B$ C- u0 }; {, \
. a1 [9 {- y' k: E2 O1 Q################################
4 ~) d4 X5 G0 d1 z##### Connection and Post ######( f# N( S" V9 l+ y
################################. y/ j" s1 E2 a6 ^
$name = @$_POST['char'];5 W; Z4 \. S: Q7 o# M( A
$ItemName = @$_POST['item_name'];
# I' s; p+ f% f4 f! O% h( L3 y$ItemAmount = @$_POST['item_amount'];
; [* c' ^& R9 F: X) w$ItemId = @$_POST['item_id'];
$ V6 B4 p8 {5 {/ `$ItemUpgrade = @$_POST['item_upgrade'];
' V' N0 \# I8 h8 N- \6 ^1 y$ItemElement = @$_POST['item_element'];7 F4 h5 ^) W4 f. r; U/ X2 t
$ElementUpgrade = @$_POST['element_upgrade'];
. J4 I, S: v) S0 ?: D$ItemPierce = @$_POST['item_pierce'];
# m2 C! }. X8 _# G: `( k `################################
6 h2 h; V. a0 l% z1 M1 l8 w! D R9 E6 z* L# f
//Check both variables for empty value
5 u/ k( x+ d0 s. J0 R. b% y# L- w; Q! K; ]+ b
if (!empty($_POST['char'])){
% _' R T h" O5 t3 e+ F" N6 }" u$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where : J9 H& Z* \6 d
/ h5 _. G1 t* \8 \; b7 w6 J3 Hm_szName = '{$name}'");
* {" R. i& N, \9 t9 Q8 Mwhile ($row = mssql_fetch_object($find)){
$ d, Y3 n3 X! s$ Yecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
! W0 N Y; R# u' D$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
* O" k- S5 K c( S% j# X1 U% Y+ a+ C( d- o% E* V
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
+ F5 M/ E! A- s( [" w# \6 _. G$ p/ I5 p. q+ U; ~% ^1 q
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 8 U" B& C2 J7 }9 {7 D
% e) M- L; h9 O0 }
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
+ G" |$ l; H, B! a1 y- ^% p+ y% o. \1 {" ?2 {. J: t: r
'{$ElementUpgrade}', '{$ItemPierce}');");4 |5 ]0 N8 \7 \3 T: Z% z. V( q
} b4 q1 b. B6 ]9 X
& A: t0 v$ Y5 [* y! ?' N1 H% r}
2 F! `" C+ I$ N2 L5 s' y8 d3 a' C; t% n+ x) g8 N, B
}" t/ C' e9 g" N! d( C7 p
: `! F) S! E4 }$ a$InitForm = InitForm();% }; ~- E/ l1 l4 A+ Y3 h3 \( }4 U
$Listener = PostListener();
" j: K4 o* d' C5 B1 f' i; F$ J! S; y. R- P9 \) V6 @
?>
: `* r" {. D: X r! a& P4 m3 D$ y' D m( n/ z& _
7 K8 E/ S) j$ b3 A: o
/ g, r: p1 K4 X3 b" k( R" F! l) d) F
|
|