|
|
<?php
& c9 D/ s% _& v9 A% s/ |function Connect () {' |/ ^ @/ u; M8 d+ F
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
; z( c2 R; G- [" ~; e6 G
" v) M0 h) s+ H! `* vFailed.');/ {. K/ _# y4 @" ^# t) O3 }1 D
}
" q6 z* T3 |7 G) m1 H; @, zConnect();# |: b2 A& n: K, V
1 }1 S2 V& h( R) g! ]7 N8 N
function InitForm(){9 Y% w) ]7 ^) S+ H. T
//layout for the form- v' E! g" i. w2 s3 B+ w
echo "<strong>Send Items.</strong> F9 X3 e' P; N( s) Z h
<form name='select' method='post'>2 ?# x8 i+ ]. \% h e u% W
<lable>Character Name</lable><br/>
' e) f0 ^. g' N! y<input type='text' name='char'/><br/>' A# b4 h6 Q2 o! K( o" ~" N* F
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
. Y/ t( p- z1 h* X r) R2 }; ^<input type='text' name='item_name'/><br/>5 S$ I. z5 ]5 {2 s# {" F0 o
<lable>Item Amount</lable><br/>: B- L4 E, q! H
<input type='text' name='item_amount'/><br/>
+ V* n# [" O. u, p% f<lable>Item Upgrade Amount</lable><br/>
6 w) _3 f6 r. h7 I<input type='text' name='item_upgrade'/><br/>7 q$ m0 d7 B" R8 L: o0 i! s
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)& F/ S6 b8 c% H4 G" F; Z
9 F# ^; d: B4 Q; n$ Y6 I
</lable><br/>) E; G6 S ?! o6 i" R4 m* ?- k* o
<input type='text' name='item_element'/><br/>
% l( T3 \6 e9 Q<lable>Element Upgrade Amount</lable><br/>& H+ o6 l. y- D2 k% S0 w
<input type='text' name='element_upgrade'/><br/> L" V& U0 Y0 P/ k3 t) b$ L, T: {! _
<lable>Pierced Amount</lable><br/>
) Z' X' S9 d. K3 t5 H+ n<input type='text' name='item_pierce'/><br/>
. |4 G2 {* H$ @$ _<input type='submit'/>
7 s: i- V$ d) B! h# F' e% {* y</form>";9 L+ [3 p4 V3 [$ [
}
! R2 m$ v8 k; f# D: S* o# W# b) e
* O* z3 L8 ^- ?0 Z, o# O; s3 `function PostListener (){
! \+ r* q, x X: y//Add more post variables if needed and add them to initform() function aswell0 x9 j- l5 m) p5 M
# Z/ o5 N7 @$ d% D################################7 `9 y" S. q7 [7 H8 \. c
##### Connection and Post ######
7 T7 o3 v0 Y: z2 W, e3 I# j% r5 V################################
% \; Y+ i; `0 d9 g2 }+ N. w$name = @$_POST['char'];
& i; n) u+ ~. d: a' f! p7 r$ItemName = @$_POST['item_name'];- x1 B2 g% F2 q# k) z' D
$ItemAmount = @$_POST['item_amount'];) a. |3 T- r; G; a, t3 X: t7 @
$ItemId = @$_POST['item_id'];
, n% y( m- x& p) Q4 x$ItemUpgrade = @$_POST['item_upgrade'];+ o3 R1 M% T4 {
$ItemElement = @$_POST['item_element'];# p$ K A- H8 b" l. R
$ElementUpgrade = @$_POST['element_upgrade'];; f3 C& a/ u* F- q% e* s8 y4 {3 d
$ItemPierce = @$_POST['item_pierce'];/ M5 j$ c5 |& ]: ]$ s% k
################################) f9 t+ m0 b% A* |& s2 }
* r% w/ j7 b+ C! [; a) K
//Check both variables for empty value
. U# V8 N1 @8 \2 w* D4 @
# o4 b' O. e( kif (!empty($_POST['char'])){2 e: r" F, l. T* a* N, C
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 d( N6 p; F0 G7 \, u
* W2 K8 s5 w8 M/ Q1 ^, b- C9 Fm_szName = '{$name}'");
2 ?6 R G# y4 Qwhile ($row = mssql_fetch_object($find)){: a7 t% n7 ^! \4 f- {- Y# B
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>"; y, `- F- ]: j( _; X2 {# k
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
! S/ p% H/ T+ q4 j+ T. ^% W: F6 h: p; E4 {, {
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
x. q" E; |- {, A, t, n$ E
- V5 q, ]" g; F( O[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', . |8 A9 P% b' H8 i6 _
( p' o2 Q/ a8 f; E# I( F' WN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ( q' x/ u1 T4 j3 j
) A8 b. ^) b4 C+ l. z'{$ElementUpgrade}', '{$ItemPierce}');");' f0 G6 q: A/ t! w/ }" c: S
}
8 ^ E. p+ l% e% s$ G0 A. z8 I" y) {
}
+ f+ A q: j& B) Z8 u/ w) A. \# M
}
8 a4 n3 x; C' U3 o
4 c; L. i* {7 ^- }+ s7 z$InitForm = InitForm();
0 y5 a( s7 u3 p$Listener = PostListener();
" N& `5 ~# J( Y7 r* L. K
0 t3 P/ Q- g' R. O1 e?>
2 U) |% j U7 h% ^+ U+ o2 J3 e' v8 \/ K, Q. P, V
+ o% S: `) \' Z0 M% F# Q
4 F. H3 f3 I; w0 |
$ }7 g! M' G/ M ?8 ] |
|