|
|
<?php
4 ^8 E. ]2 w z3 w% K sfunction Connect () {0 A5 g* e2 P$ L4 ^1 u. P
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
8 ~) F# o1 H4 ?8 x6 j& ]9 D, u, @+ E, q5 f
Failed.');' b8 R8 h" O7 {) E$ P
}
; B* v" y1 r* ~6 O% BConnect();
- w/ L! N9 y- T, v1 V7 o% {/ T% z1 o+ [& _% G, [% ^
function InitForm(){% o# T+ q# |5 `9 H @
//layout for the form
1 @) `. R) j/ O/ ?5 W# T! ~: M) Y/ Decho "<strong>Send Items.</strong>- k% s2 ]6 i# g: v/ i
<form name='select' method='post'> b: t( W. h2 Y4 M1 U, H! p$ `% G" @! X
<lable>Character Name</lable><br/>; X. N( @' V. [4 V6 @" d6 B
<input type='text' name='char'/><br/>
1 P8 D K8 c: U8 o3 J<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
l( Q' {5 v+ N; Z, t4 L<input type='text' name='item_name'/><br/>" n. s' M. Y/ C, Q
<lable>Item Amount</lable><br/>
5 l- Y a) @% {; \, x( ^7 O<input type='text' name='item_amount'/><br/>
# m' I4 V' ]. c( w<lable>Item Upgrade Amount</lable><br/>
! N/ e# K, Y6 ^' d2 R4 C/ {9 M<input type='text' name='item_upgrade'/><br/>8 `& R( Z% a. \- n
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
3 J- w1 T8 q4 i( G5 N) P2 F& f; c4 u, \1 B
</lable><br/>
0 d* U. @# Q: g<input type='text' name='item_element'/><br/>
" |! [, \) s. ]) u% O! N3 p0 n' i* `9 h<lable>Element Upgrade Amount</lable><br/>8 K4 l2 \& ?1 x6 ^5 f k# `
<input type='text' name='element_upgrade'/><br/>3 A# \1 h+ a4 T+ p$ t# A Z8 J
<lable>Pierced Amount</lable><br/>
5 x Y* C5 W; N! T, U<input type='text' name='item_pierce'/><br/>0 J; o0 I! J6 A' k- |
<input type='submit'/>
. c; e: F3 q1 J0 A4 a% Z% }</form>";' }" l9 a7 L& g6 h" z h
}
" d6 U- |: M7 ? b T3 p2 C
+ F9 h9 c# x0 vfunction PostListener (){
" Q3 L3 v/ h# v8 s+ H//Add more post variables if needed and add them to initform() function aswell
* Z8 V/ r3 L& X+ d" q; z4 G& o) ]9 u
################################# }$ P8 }" ]4 M ~) }
##### Connection and Post ######* K" y. R1 r6 }$ o7 u6 i6 C
################################# Q- t/ U4 ?0 \2 y# b9 g
$name = @$_POST['char'];
, ?+ `* j/ _4 A2 l/ q$ItemName = @$_POST['item_name'];
! X* W, y1 o5 u1 }8 A$ItemAmount = @$_POST['item_amount'];2 d; @& D- N' }" e8 |6 e
$ItemId = @$_POST['item_id'];
6 k5 V' M4 m( x% C$ItemUpgrade = @$_POST['item_upgrade'];
% `/ }4 z6 \+ i- I G* g- k$ItemElement = @$_POST['item_element'];
9 M a5 b) s. K" A$ElementUpgrade = @$_POST['element_upgrade'];/ X! C$ U, d9 B+ ?
$ItemPierce = @$_POST['item_pierce'];: w$ H2 i$ ^; z5 B( S! D
################################' s2 M( p% ^) Y% n" n- l
2 \% c& b0 E U% J9 o' G- o/ [$ g
//Check both variables for empty value
, ^, {8 l+ x; b8 R- P& ]) N7 s) W3 E J# ^0 m
if (!empty($_POST['char'])){, t) E$ A! B1 F, F# I$ d& r A, V
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 3 P O; ^1 `- i# a- F' x
3 i& w E+ Z) [m_szName = '{$name}'");
( L0 {2 W) X" T! j$ lwhile ($row = mssql_fetch_object($find)){
9 y: ?: \- R. ~/ {3 l+ Q; b) q3 a; fecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% N% J9 C6 P( f- x6 u6 H: C
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
2 P5 M1 D }" @; {% i% S& b& G: Y/ ~+ _' J8 I) [
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
- M! D* G0 V4 E, m$ ~0 T/ q- {# \
' W0 F7 |; v, ~[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ) K2 R; ?( A, G5 A8 D4 T6 p/ _
1 A! n# p; Y4 EN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 1 N9 f) I! Q- a& S7 u6 k, u' Q
* A" V6 _/ z" i3 i'{$ElementUpgrade}', '{$ItemPierce}');");
7 P, O4 k( J* h! l+ N3 e}/ t8 K* b; j+ c$ [2 _! e
9 c b. r" f5 d- R: k# A7 x, M}
' T# E3 T5 @5 n( w$ Q) d1 O
' P8 N: O1 {$ L, y) t}
8 O" n$ H9 @' S# u8 p! S$ P" m# s. i6 _+ t- t, Y4 ]( x7 U6 \. H- T
$InitForm = InitForm();
# [( z0 y* [# t1 Y$Listener = PostListener();
4 N7 [7 E1 U6 n5 |* Y: T3 f* z! X* u4 W) W4 C3 Z. u
?>; d; G& L; v2 w5 `; v
$ R% S% L+ ]* R y, ~% Q; J; h' G$ W3 P) i
+ L2 A3 b" z4 d
' o* W2 J0 [, r |
|