|
|
<?php
7 o* |$ I2 \7 d5 t; a4 I. Ifunction Connect () {; u& i6 r5 r# D3 E
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 3 L v3 t% a ]- O" h( k
t9 f$ S6 T* M7 F# ?5 F
Failed.');& o6 l+ [6 `# D# q
}
7 U* E' g+ k( X: S" `7 C7 v0 ~, PConnect();* D/ L* Y( D/ C+ J! a# V8 ~$ R, W
5 T( Q9 ?8 y2 i" e6 e' xfunction InitForm(){
; H. l/ n1 S8 h0 m1 m2 \5 W//layout for the form
3 C% o/ V# o$ p# x2 |echo "<strong>Send Items.</strong>+ n/ O3 u& ?1 b- |! ~( ?+ R
<form name='select' method='post'>( B5 t2 q* A M& B4 b+ S5 `8 A
<lable>Character Name</lable><br/>
- S% V5 u o9 K: y0 S* u<input type='text' name='char'/><br/>
# Z( F' |4 \1 q" k2 F. w<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>3 P! j% f- c+ ?7 m7 \
<input type='text' name='item_name'/><br/>" g6 i. u' c" u- L( G
<lable>Item Amount</lable><br/>5 [8 w }" Y" H+ R( l2 n# e
<input type='text' name='item_amount'/><br/>
) I- T: r# x3 B# U p: ^3 _) f<lable>Item Upgrade Amount</lable><br/>- k, d v5 f: v5 N6 L2 r
<input type='text' name='item_upgrade'/><br/>+ H: P0 D T; {
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
0 [) O6 f1 O* V6 U+ ^ H
& R2 B2 Z D/ d0 _8 _5 o</lable><br/>
1 c& d5 [. @4 f0 l; s<input type='text' name='item_element'/><br/># m' L( W% r5 w+ r7 k8 L u
<lable>Element Upgrade Amount</lable><br/>
! k1 p; v( X" e! ]- g' z4 l<input type='text' name='element_upgrade'/><br/>
s% X4 s- f ]) [<lable>Pierced Amount</lable><br/>
3 U* I7 G6 o1 o2 y. _3 x! Q<input type='text' name='item_pierce'/><br/>7 q+ |: s, E6 B/ ?" z& y3 s
<input type='submit'/>/ L p- u0 K- o! U6 D
</form>";
! G, Q9 o4 g4 _7 J4 I. i- l}
% J6 D; D% j% o* ~2 o. P1 O; y& j. L# o4 d+ B$ z( G; v' W
function PostListener (){: }# D1 _( `+ ?$ m
//Add more post variables if needed and add them to initform() function aswell* \; W" E# q/ J9 y
/ X8 V* w' n: T) w
################################; R, \4 b& @. e. R9 U( y# N7 k1 C
##### Connection and Post ######& M" z4 g4 @& d' u
################################/ a7 U4 U& z* ]* G. U9 w) X7 w
$name = @$_POST['char'];
" [; e% ^% D0 r: }, @$ItemName = @$_POST['item_name'];
! y* h$ P, j2 r3 E$ItemAmount = @$_POST['item_amount'];
( v$ v5 h9 L. m- \3 J! e: d$ItemId = @$_POST['item_id'];
% \: D' |5 d2 X- k- F. v$ItemUpgrade = @$_POST['item_upgrade'];' k: k4 J9 O) Q) j
$ItemElement = @$_POST['item_element'];
/ C6 G- a$ F, @4 Q1 @( C9 O- m$ElementUpgrade = @$_POST['element_upgrade'];) C# m5 M- I7 l# n
$ItemPierce = @$_POST['item_pierce'];
- U# b3 a, \3 V$ l################################
: ]5 d0 R& ], F, n
" s% \% |: [8 n8 t4 H+ [//Check both variables for empty value
D$ ~. {2 b8 F) b) w/ |7 W2 ]$ S% j4 ?
if (!empty($_POST['char'])){
# D/ m! p: l8 G$ I$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
' P/ K( B5 \9 V+ b2 B; Y! Z) P+ V" H6 r" e* V: H
m_szName = '{$name}'");4 n# }7 W! d' y7 u
while ($row = mssql_fetch_object($find)){
b7 G% ~9 Q3 u! Vecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";1 ?) `7 L, ^7 @, ~' I5 I- ^* B
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
3 h4 e# Z4 u9 C4 u6 y3 O+ b4 f0 a' z! M+ m, b0 K
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], , `5 [) f& p% S: I% l- |
5 Z( i# l) p! ^9 i
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 5 K4 n* B0 q# A. a- C5 Y5 b
1 ?# J N6 Y( f# V; G; \- G
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ' t0 y* l8 h8 p( F
3 `, {0 E; i; y'{$ElementUpgrade}', '{$ItemPierce}');");4 j( l2 M# s8 c
}4 o6 M S2 d! e Q1 S) z
+ T( b/ y* z4 h: {& q2 e* g}
: X# }. t3 }" s6 h0 P2 w% L6 K6 ~
}
8 D& Z0 V: E# }/ u5 f |, A- a ]
& h$ [8 H) w c. g% } U0 x7 ]$InitForm = InitForm();* a" O# Q+ |* q; H2 ` M
$Listener = PostListener(); h* d. N E7 m3 ?/ N! `
, @- Q1 l) L9 o0 M( L) H
?>: Q6 k% p9 _0 x% @5 ` G' j
; D6 _8 c, A2 C$ N3 [! i
! q: V; O9 I0 M) J# q
5 K6 H7 b; b! a1 U* `4 V" ~9 a, b5 H
|
|