|
|
<?php5 i& v/ E2 U2 _" L
function Connect () {* F& r$ ~. z7 ]5 p b, I! v9 w& \
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB : k0 G. U* U f" J7 H4 t/ U% N
4 M/ ]0 }0 X) Q0 F0 M
Failed.');
- l* l/ f7 e6 M5 h9 c3 R}
+ [$ b# b" v" Y a& z) DConnect();
B" Z; J0 \% U8 F: x* ~ r' ~5 s9 X3 T0 T1 c! b
function InitForm(){: m. L4 @% m r/ n6 z( y: I
//layout for the form
: h. ?% @6 y" \- d2 lecho "<strong>Send Items.</strong># A8 e( Q/ _$ P! H1 L+ |! i% g
<form name='select' method='post'>, g5 d" v4 h+ Z) m; e
<lable>Character Name</lable><br/>
5 \. R" O/ _: ]* |<input type='text' name='char'/><br/>
* A: T1 ~4 u3 I8 l& D" f<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
& {0 F7 `9 i- n<input type='text' name='item_name'/><br/>; H* k K. C d0 J0 |7 W" n
<lable>Item Amount</lable><br/>8 X4 N" I/ _8 f0 E$ I
<input type='text' name='item_amount'/><br/>
& A' Y9 `' L5 K# H. y5 Z<lable>Item Upgrade Amount</lable><br/>$ O2 V) N) s( p; Q" U8 w! @* H% C4 a
<input type='text' name='item_upgrade'/><br/>
" A, a; Y( z1 N6 N6 f5 A. C) W8 _5 y<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
2 B4 D* D! W6 _! h! b& l# |- Q/ W' l9 Y- n& A
</lable><br/>
z* N$ V( G: `" Y" ?<input type='text' name='item_element'/><br/>/ `+ [5 o1 L3 f% B% D/ ]. o
<lable>Element Upgrade Amount</lable><br/>
5 j9 _. p! m. E<input type='text' name='element_upgrade'/><br/>
! w, V |# B( |$ k; E<lable>Pierced Amount</lable><br/>
, m' t1 X. U5 i& K7 A) Z<input type='text' name='item_pierce'/><br/>, J3 o9 y2 |& b6 E
<input type='submit'/>8 R0 U: r6 ~; ~% a7 |; R* e" U
</form>";
3 Q) w7 S7 H8 ] u}
4 A) w# n0 R: {+ L
1 g3 e8 }: y" B) wfunction PostListener (){
1 b, {0 e1 T: u+ O, ]3 q+ Z//Add more post variables if needed and add them to initform() function aswell8 Y8 V7 |, l& s
% P2 v7 v: w$ n# X: f8 x################################4 z0 F$ V9 d% ^; @" s, C
##### Connection and Post ######
! y" |- y( Q; o8 g################################
; _+ n9 S0 _3 i$name = @$_POST['char'];9 V9 ^' }( l8 ]
$ItemName = @$_POST['item_name'];
S1 y; W8 f, o6 C$ItemAmount = @$_POST['item_amount'];. E9 ^3 n. y( ^$ G% ~
$ItemId = @$_POST['item_id'];
* O8 L/ o5 Q. L, X. E( G$ItemUpgrade = @$_POST['item_upgrade'];1 x8 X* U0 O! N& }! J
$ItemElement = @$_POST['item_element'];* h) Q' W* u: Y+ R+ x7 `' I, d
$ElementUpgrade = @$_POST['element_upgrade'];
& k, ?2 ]1 O* m. g B1 L$ h- G$ItemPierce = @$_POST['item_pierce'];: @! K2 ]7 |" v' n* o* g
################################
/ D3 n+ J+ p2 x$ J( v/ A+ C7 V* y+ P0 }8 s N* W) X0 O! |3 f7 Q I
//Check both variables for empty value6 h; ]9 x n# e" e' H
; B! y! `5 y) V) U9 Q$ B. R% ?if (!empty($_POST['char'])){
0 D+ O2 ]: b ] c* f$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where ) d7 q2 ~; O* T0 F" B* Z
" ]% w: G0 @" ]- A2 x1 B5 E2 S* Hm_szName = '{$name}'");
, Q2 U1 V y" P4 |while ($row = mssql_fetch_object($find)){- f) |! }; k( T9 K q. A
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
/ d' M: l/ | j0 { K# g: B; e) [4 M$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
+ A; M# J# e) i# a/ E. [) X# w$ x& I7 ?" Q# M5 n8 l
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
' M! J1 [4 P! w9 _7 o, M$ {3 f- Z9 G
1 h% D( Y, T/ _' X[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ( Z3 O7 |* T, t6 I- J
6 M& f( w* {6 C+ t8 ^; S, FN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', $ ?% [1 X U v; y! _
' N- ~$ F" t2 d0 [
'{$ElementUpgrade}', '{$ItemPierce}');");4 V4 b3 s' a( [4 L: S8 Z
}, ?( g' y% c0 {: l- {! w% B9 \
0 i" U6 L5 u7 q& h9 d}
- g$ Y# K+ a- q& C3 D9 | v6 s+ [0 \0 E: b' D
}
- w$ Z, L: t/ Q7 {- I8 I9 S' j/ I" I D* z
$InitForm = InitForm();( T) h# w/ g! c
$Listener = PostListener();
( ?$ t6 h W. y$ j3 _' a3 U n4 d7 T
?>
- C5 v/ \1 d; V; U# T, k( R9 P5 y' D( `! ~9 R
7 {( r, h* t/ a) r% {9 _& N
; T- Y7 M. n' m$ U# a
& L" S+ W. C) g X+ R |
|