|
|
<?php2 U: D {' _4 L
function Connect () {7 U7 w O4 V6 [3 y
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) @/ L4 x# r3 f# O4 V
* Q2 H, Y' m4 x! Q
Failed.');
+ Q& q. a: V R% d9 V}0 d9 n8 M: U/ T( y6 k
Connect();
, N8 C) Z# C% k6 p+ V- [ y' z9 s
% y/ Y3 u) ^/ Q( n6 N7 Sfunction InitForm(){
! \( z* \3 {# |6 \+ H//layout for the form7 F- X3 \- M# _7 F. G0 l' v
echo "<strong>Send Items.</strong>
% D7 P6 F' R9 S3 n: G/ z<form name='select' method='post'>
0 @9 K# [% z2 C( ^; _- V8 Q9 n, M0 T<lable>Character Name</lable><br/>
5 t; v+ R) Q* Q2 u0 u/ X( X<input type='text' name='char'/><br/>
# ]* g% g& J8 I6 \! A<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>' M; O4 W6 _5 r
<input type='text' name='item_name'/><br/>
3 f1 z4 H* B( t# x: Y7 m8 X<lable>Item Amount</lable><br/>7 B: l9 i. F+ `( ^9 I7 Z
<input type='text' name='item_amount'/><br/>" l9 S1 b! [0 V- s
<lable>Item Upgrade Amount</lable><br/>9 ]5 I p4 u' G" }+ R* d
<input type='text' name='item_upgrade'/><br/>3 i9 s7 P9 |7 R* \& E( \
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.), Z) p3 `+ T; L. {
1 b4 B( A5 o3 Y1 J: |</lable><br/>0 r% p( H. h( C5 a
<input type='text' name='item_element'/><br/>5 A6 g! |' D `+ M
<lable>Element Upgrade Amount</lable><br/>
6 o$ ?$ F2 |) }2 u" Q& |( |<input type='text' name='element_upgrade'/><br/>
; n: P+ I: l9 Q/ |( W3 d<lable>Pierced Amount</lable><br/>
" f1 ^: b# [$ n' V. o) k<input type='text' name='item_pierce'/><br/>( w: a0 S) l! T8 t
<input type='submit'/>0 l6 B2 I/ `7 x. y
</form>";
: m5 T' W8 Q9 D% M3 Z* q9 E7 o) s}0 N" V% h( S2 k' n* c7 i/ l
! |: o! ^8 I% Y. m3 z3 wfunction PostListener (){
7 L6 j1 ]1 C# y//Add more post variables if needed and add them to initform() function aswell' w; X. G* e5 S k- _
7 R1 M$ g" h* e################################3 u* s* U6 e& i/ \
##### Connection and Post ######
* ?5 e; Q2 }8 Y################################
3 e4 |' f u: ^$name = @$_POST['char'];
' j* O& x& E4 \( l$ItemName = @$_POST['item_name'];
9 v% O `# J/ w( s; q$ItemAmount = @$_POST['item_amount'];
" o/ U+ O Y* e, E. U! Y' X3 A/ Q! C$ItemId = @$_POST['item_id'];
C* e- D( ^0 d6 E$ItemUpgrade = @$_POST['item_upgrade'];
. p+ s/ K8 W2 N" d. ]$ItemElement = @$_POST['item_element'];
$ S: @' v" u& `. ?3 z" ~$ElementUpgrade = @$_POST['element_upgrade'];
* P# ?) s' o% c7 r3 A& n4 z$ItemPierce = @$_POST['item_pierce'];
, q0 r$ ]+ }" z" q################################
- x2 I- Z& G Z7 B* C/ T$ h/ I' }, ^* f9 `
//Check both variables for empty value
& H7 c- P* [* x; u6 E) Q8 q2 r# V4 ` X3 B9 Y" `
if (!empty($_POST['char'])){
! m' h* H0 g! `+ D6 G' g$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ! l4 R8 `& f8 o/ L0 ?* d9 q
1 R6 O, \ G9 G! bm_szName = '{$name}'");5 [+ s' H1 }, Y
while ($row = mssql_fetch_object($find)){2 D6 R8 X. O" w4 g
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";9 ~+ I) ~0 P8 d u2 z& d
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], : u: m2 W N) }+ Z ^5 I
! w* _/ J8 \0 A2 ^* h
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
) ]7 I4 s! c- M z4 q' d$ e& l2 V+ p
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ! p0 w$ {! P% H3 r) j+ P6 n* o/ y
! M: j& I$ ~7 { B, |
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
) \% {- W- X4 X& v; J g5 x( w _2 R3 y' _( o: F
'{$ElementUpgrade}', '{$ItemPierce}');"); l7 O2 ?$ y5 }& }: ^# S
}
9 k U" v' R& F4 M+ P; I3 s& [* [# v; @1 j/ u5 |* s3 R9 K' s, s
}
/ e' ~0 H3 T; @. c) @+ c% e! K
T3 D3 ?* k$ d* d}9 q5 \6 O) v+ y. o2 U: h; o9 S, y) S, x
# y0 u6 i) {/ B8 [! o
$InitForm = InitForm();: J }; L" F/ Q- y* J0 e
$Listener = PostListener();, a/ f" |- u6 ~6 r$ d8 x' \
; ^, P6 W6 n8 L+ `9 B: K?>
6 c% [9 m, @# a \3 x C" l. X' H) h! Y! i: {
3 q4 G/ D3 N6 k0 V) J G/ G1 S
C+ t b% F% o& E$ q4 l3 y. z9 p5 L* k8 r. w
|
|