|
|
<?php5 b) ^! e4 t4 v4 ]: b
function Connect () {
! |3 D5 [9 }3 \) I! O- }$ j6 p! hmssql_connect('Server','UserName','Password') or die('Error: Connection to DB 1 |) a7 S' M) a, r. M1 B
% h# V3 U0 S: ^/ L4 L; o
Failed.');, N, Y8 m) U d: V$ M# F
}
# R0 R2 a; g- h, K1 _ D- N6 gConnect();
) E% V! s: N7 T- U+ [5 ]- H6 X9 R
function InitForm(){; N$ z% M1 G+ r0 z. t7 l& `/ J8 W- _! \
//layout for the form
4 M7 q" a# U$ N+ u' E% Fecho "<strong>Send Items.</strong>8 d) m$ N: A, ~3 A- X
<form name='select' method='post'>) j) ]/ F. f% T" u7 O
<lable>Character Name</lable><br/>
. Z) D. d' [" B7 L9 t% z1 s<input type='text' name='char'/><br/>$ f4 r' ~9 i9 G! z2 h
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
; ?3 {% S1 G+ Z: {3 o7 I<input type='text' name='item_name'/><br/>
3 r6 ?- h' L6 h: h [7 i<lable>Item Amount</lable><br/>* ~' h. l) O) Q5 k
<input type='text' name='item_amount'/><br/>$ F% G* b) C1 j- N
<lable>Item Upgrade Amount</lable><br/>( S$ p6 Y) R& j4 V0 D
<input type='text' name='item_upgrade'/><br/># R1 p+ H5 |: ]" ]7 k6 v! }
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)" n8 J& m3 ?( ~
: Y! Z6 l+ d% m/ p1 M/ v! p+ H) }# M</lable><br/>
% j; C; A; A- ]# V. b% V( R: J<input type='text' name='item_element'/><br/>
3 K% R% g! Y$ E9 U7 X: d$ [4 k<lable>Element Upgrade Amount</lable><br/># ]6 f0 N" A' l% d) v z
<input type='text' name='element_upgrade'/><br/>5 E" Y4 x$ b4 {$ M( }
<lable>Pierced Amount</lable><br/>7 B$ l" h+ N$ g
<input type='text' name='item_pierce'/><br/>
1 ~. o1 O* S( V7 ~<input type='submit'/>0 y+ ~9 D) k" x
</form>";
( N2 e0 m& B& z2 X}
. f# V6 j- q) J5 z
$ [9 J+ q7 j- ]' ]! Dfunction PostListener (){. P" e: |9 K) m# Y2 ]( ` R. ^
//Add more post variables if needed and add them to initform() function aswell0 Z0 G3 L2 D4 ]2 Q+ F% v; e/ j
' e4 Y$ d8 g, v2 D8 t
################################' ?" [6 x) F9 {3 |
##### Connection and Post ######
5 J; D: X. ^- H: L+ M################################
& k: _3 X5 q2 w& @1 s# U$name = @$_POST['char'];
1 r Z2 A- m5 T9 i3 B2 k8 z$ItemName = @$_POST['item_name'];
# Q2 C9 d4 C$ a2 k( K$ItemAmount = @$_POST['item_amount'];1 g3 R3 U# H- ~; E! E
$ItemId = @$_POST['item_id'];
4 W: \; W* d6 Y+ m! ^$ d$ItemUpgrade = @$_POST['item_upgrade'];6 N& H( V6 A, x" u4 F" O
$ItemElement = @$_POST['item_element'];+ c, G8 y2 q* h# Z
$ElementUpgrade = @$_POST['element_upgrade'];- l- ~/ X4 d, S# I2 p- y$ w0 W
$ItemPierce = @$_POST['item_pierce'];5 Z7 I- f* D; @4 X
################################" j! k- H' X% }, s2 J
% v' p" u$ g/ m% |6 o+ W
//Check both variables for empty value
1 s# x# c/ G& e# P
6 i8 s s$ Z* ~if (!empty($_POST['char'])){* D8 D; @- B6 }- o$ I4 d$ i, C
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ! D) A' \+ `" Z2 Y, Z+ V. {+ p8 o
. ~% q( W& c3 I6 h0 Ym_szName = '{$name}'");7 E2 K5 ~! \) P% z1 Q& U) L
while ($row = mssql_fetch_object($find)){
) z. R) u$ {/ I; Y9 ]- h' F5 ^9 Decho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";. |; ~7 Y) P: N4 L% Y2 x8 b2 F! ^
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
6 N+ Q# M5 m# e2 z3 V; r
0 R6 o8 ?# Y0 ]4 }2 D8 @+ h[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], : j- V9 _4 @. a
; q& ?) H# v$ [% }# z# B- N6 S
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
1 {9 ^, R" y0 y' G3 W1 s& U% `; M, n& _* R
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 3 r q$ F/ G& W3 ~
6 q8 z4 z6 [8 Q8 \, ]7 m! B
'{$ElementUpgrade}', '{$ItemPierce}');");
" k1 p. s% g% T}
2 | X: W- h( i6 U+ |8 i6 f7 e y' j1 g
}
2 H- l3 r# X* z' ?8 `7 \/ {' p4 }0 _9 @$ i- k% g% V7 F
}
, Q7 G6 O- m! J, t7 J% L
3 g) `# d, M( e0 l$InitForm = InitForm();
3 g' ^+ {) T( R, i$Listener = PostListener();. @3 N. s) `. g$ @
1 }* L5 X* o' j8 @4 R' z
?>
: [2 h. w; v7 ~: A; g$ c- J$ Z) Y8 n w7 q2 @" ^ @
! j/ g" p0 G) C% f$ O% d- M
: z# k% R( [+ g! z2 H
! d( H( d7 O/ _2 O, z
|
|