|
|
<?php. Y8 r/ r' _& x8 g0 ~+ e& q! l
function Connect () {
! {* F1 v2 m2 H+ q1 C) M: }; s, Wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
: I$ U# P: L/ P8 }( h* V* N B/ M1 s- x0 a6 H* Q
Failed.');$ S5 \$ H0 z& I+ o
}
8 k" P k6 j5 s& T2 nConnect();
" Q* J B4 ?$ ~9 b" l' d1 Q* j# N
0 }& m' @* v( o: K, g! _function InitForm(){
* S9 S$ j) `$ Q* J- Z1 Z5 d* T* V$ n//layout for the form4 r: s u) n( c2 ?- @2 H7 W& J" {
echo "<strong>Send Items.</strong>
' i- J0 w) S" g% o- r<form name='select' method='post'>
2 f, N2 m( A% t p<lable>Character Name</lable><br/>
, v, u& ~+ Y Z2 d<input type='text' name='char'/><br/>
8 ]2 Q' o" W6 B<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
7 H& c6 K' O$ C+ _/ J% w<input type='text' name='item_name'/><br/>4 W( G* ~- U3 l7 c- \( M- q
<lable>Item Amount</lable><br/>7 A9 o+ {+ s6 o# E. u2 O) \5 Y Y1 H
<input type='text' name='item_amount'/><br/>; Z- Y# U- x: b
<lable>Item Upgrade Amount</lable><br/>, ]1 |' m2 O% f; H6 l( j
<input type='text' name='item_upgrade'/><br/>) m" t6 `2 n0 B; e( D/ h) k2 r3 M9 P
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
" t# c# R6 \( E+ L2 K: W( w: V+ ]9 b% I- D' h* V
</lable><br/>0 p( G; W; `: \
<input type='text' name='item_element'/><br/>5 Q' q7 |% g L; z# \$ a$ f% M
<lable>Element Upgrade Amount</lable><br/>
% F1 y/ z) Q8 i<input type='text' name='element_upgrade'/><br/>
/ b5 E& N% w9 @3 }5 G<lable>Pierced Amount</lable><br/>
* M8 c+ S/ o$ O9 M. Q4 L" F) r* w<input type='text' name='item_pierce'/><br/>
4 s8 v( w# ?( {# u2 }( w O<input type='submit'/>
1 c( k& H; H' r v* J</form>";
% v" L' [5 _/ G7 M! B}
% L! p$ O' x0 a# O$ O/ s+ ]1 {7 d* T0 L7 b7 |2 R& A
function PostListener (){7 O' [, T L2 h1 |1 e
//Add more post variables if needed and add them to initform() function aswell
+ Q$ s' p% H! X0 G1 s) F' p2 s5 Y7 F! f* a- z
################################1 W# S% ?/ _' S2 i. a% z
##### Connection and Post ######
$ o K: K/ p. a& y################################
) w F v( G: x' `, i2 S$name = @$_POST['char'];
; M2 T+ ^* }" ^4 g0 w, r$ItemName = @$_POST['item_name'];
" X4 A. P% n. V2 `$ItemAmount = @$_POST['item_amount'];! a A' {6 f0 f; ~ \8 r: r8 @
$ItemId = @$_POST['item_id'];
+ U" }* e( \' g* T4 f2 Z. ~% z$ItemUpgrade = @$_POST['item_upgrade'];
. D2 c9 O) T# x9 m& M( X# g$ItemElement = @$_POST['item_element'];% r z3 A2 Q0 a( k4 u$ ^7 B6 R, c& `
$ElementUpgrade = @$_POST['element_upgrade'];5 b/ q0 l8 p9 p/ ~3 `9 l" ]' C
$ItemPierce = @$_POST['item_pierce'];
: @2 w! n H' F& ?################################
6 @& \/ L7 K9 u. ~, I9 ^5 H3 |
9 s# M; U+ u4 O% C3 Z0 h4 r//Check both variables for empty value( E' Z$ U0 ]/ Z, J/ c2 o
! Q6 C+ r2 @! m
if (!empty($_POST['char'])){
1 {$ f6 S2 p K' p( ^( }$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, J* y9 W& ^" o$ ?; V( ]% \! Z9 B
m_szName = '{$name}'");3 m1 y! {5 z0 i" V
while ($row = mssql_fetch_object($find)){
- W) o$ Y6 ~; N! `2 ?3 wecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";6 i1 g0 ~7 R$ |# n
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
/ X* L9 F$ O6 b6 y, c/ x
+ C/ i$ p5 C+ _0 T( D0 f[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], + ~5 _6 c8 ~, U9 B- L
5 O5 k+ R3 j) a: h+ O3 J+ j
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
5 ?8 W( k# n: {8 Z5 K
c: r6 y8 N4 Q" ]* X7 ]( a3 @0 Y2 DN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', ! j% m& W7 G+ C, Y, q/ ?. Q' V; E
$ g6 I; s3 _; a n. Z, v t( l1 T'{$ElementUpgrade}', '{$ItemPierce}');");: J! q; \0 P3 d2 T
}- P5 h& P4 b, ]- x& k% C5 o& ]
7 `- i! n4 j c4 n
}+ V& u$ L Z6 Z, E9 x% J0 t
G; q, X% n3 l% g' d5 I8 _/ `2 ~}7 p( Q/ ^! z1 N3 {
1 [6 d3 V" h( Z; j, Q) x
$InitForm = InitForm();
0 Y# I1 h4 Z+ p$Listener = PostListener();. k$ A2 h) ~4 |9 y
! X2 h# E4 ~" H$ L# y- n
?>% ~' K3 _8 `! I8 G
8 H E* d- B$ f# U9 x- o
: N6 `- L9 h" x, A$ l) T" b
; b4 Z' I6 l9 y0 Y
* n3 I$ u7 M: k0 f+ I3 O |
|