|
|
<?php
& @8 D5 U0 Z1 x/ | xfunction Connect () {3 E: c1 {8 m% G. @7 I7 E
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
0 N! i, ~5 M" E* t
; m L/ R2 _ N% pFailed.');% y4 B/ S' ]5 `! X
}: O9 a' i* j w
Connect();7 B6 Y$ a. w1 l8 g1 `
6 y8 U- f9 E& e) Sfunction InitForm(){$ B; f, C: {) |9 R1 O( n
//layout for the form
) g; H8 J+ @ A$ vecho "<strong>Send Items.</strong>
) L* { O* O: k5 l3 Q<form name='select' method='post'>
, a3 |' w0 m# J% ?3 X+ ~<lable>Character Name</lable><br/>$ {$ k) e2 V* x5 e0 ^5 E# }6 e
<input type='text' name='char'/><br/>* L6 p9 Y* {7 A1 e! X
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
; K+ e& W' q) p8 g/ z) o2 a<input type='text' name='item_name'/><br/>9 w/ C" w n* A8 G) f9 i7 L+ \- ~
<lable>Item Amount</lable><br/>3 x$ l0 |- X$ ?9 h3 B
<input type='text' name='item_amount'/><br/>
4 S) P+ {9 M6 y4 _3 P<lable>Item Upgrade Amount</lable><br/>
. q( Z, k1 {3 F: n7 _<input type='text' name='item_upgrade'/><br/>/ b# g9 U( D/ P- \) S# n0 E
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)6 f4 q/ m3 l: u! ~0 k' W3 @
* E4 C8 j! C5 l- T# b) L, h/ S</lable><br/>
, R# b& q, C' s* @<input type='text' name='item_element'/><br/>$ P' W4 L/ X; Q3 P
<lable>Element Upgrade Amount</lable><br/>, F& E, f [* r; N& O) \% X- @
<input type='text' name='element_upgrade'/><br/>
8 n5 D: A4 [) P<lable>Pierced Amount</lable><br/>" Y; l* C s+ h! D5 u5 V7 ]# g
<input type='text' name='item_pierce'/><br/>
% M9 d6 b. p7 w( `- H7 \4 Q<input type='submit'/>
: F1 l4 D( _- U( W( F</form>";3 j; w( |" n! Z7 g- \. B! `3 r
}
' J1 g: c8 Z0 u4 O9 u0 {* i7 S- v: G6 k9 g0 B6 T4 `& K
function PostListener (){) P3 G) M7 z; O( s
//Add more post variables if needed and add them to initform() function aswell' E3 l' T, b. f; D
8 W" G! I ^% {7 o, H; A- f################################
- G. X5 `4 D2 ]2 Y4 _4 R" S/ K t0 r( F##### Connection and Post ######
: U p! o4 a" \- O5 D################################7 Q' @5 N( o; u# r
$name = @$_POST['char'];" F( Y3 `# W: d; e. j
$ItemName = @$_POST['item_name'];
; s. l$ l- i7 k$ItemAmount = @$_POST['item_amount'];5 G9 D; W) |# l# t
$ItemId = @$_POST['item_id'];
- Y1 G4 A0 m |4 v, U i- E4 y$ItemUpgrade = @$_POST['item_upgrade'];% h8 o4 Z( f: R7 e. E9 [ J) A
$ItemElement = @$_POST['item_element'];* a1 V" ?5 |, v' C1 I% h
$ElementUpgrade = @$_POST['element_upgrade'];
& k I) W0 c* i0 B9 ~( f$ N R, }$ItemPierce = @$_POST['item_pierce'];! H2 l; X' Y& A7 q
################################
+ x7 f" S: n0 y1 y8 @. m" M
" O- y3 k4 F( N7 w$ P3 D8 @* _7 i//Check both variables for empty value( y: B+ p& U" p% n
N' g& Q B! J. Oif (!empty($_POST['char'])){0 H8 N9 @# J$ }( J. v. [& [
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 0 p2 r( H2 x6 R" }$ O! \
- q/ W1 }7 m7 C0 j$ [" S: _m_szName = '{$name}'");1 o, ~. _9 [$ f5 b5 ]# x. w
while ($row = mssql_fetch_object($find)){8 H7 L* o6 X6 i+ _* C: m7 Z6 y
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
; v9 U6 _! | ?5 Q ]1 }$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 0 M0 M2 o, ?3 |) ^
* s3 ^% ~4 h6 o; o7 T4 E[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
E: C; P. u/ \8 ~' L) [# l* W. L9 {+ w; w' L
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', + V1 w$ J. I- `* U) p* V
+ k3 @3 c+ c- [4 G+ S6 A
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
4 P1 y5 U: ]4 l: _4 e+ S; i- T, T- @& G5 Y/ R
'{$ElementUpgrade}', '{$ItemPierce}');");
0 [5 D3 N/ m o. H% w}2 [7 O9 D9 m! U4 C" d3 s
' l/ X ^" O2 L" M/ \
}- Z8 O# a( C/ i5 v
1 ~; g C4 p V6 G% z6 Z
}
3 L4 E' ]$ h* ~/ L/ R% r* |
% k$ @) g# v; }- j$InitForm = InitForm();- C$ s- @7 d; B5 {3 p4 z
$Listener = PostListener();$ h& j7 b8 n P4 N! a( y2 M S
/ m8 n% g' s! P3 I: p?>
' W; _3 ~2 Y! S/ g* i8 b/ }. X# h( R! {
3 h/ L b$ F$ _& j* |. K
0 X/ S* ?3 s9 `2 L5 P, d: g9 x$ _/ N, J3 G
|
|