|
|
<?php. }$ x1 h3 p7 a Y' K, b
function Connect () {$ b0 u% Q/ S S- z
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB : t2 _# M) \5 h( t+ b$ D
: Q3 G; E8 z( n; u4 NFailed.');2 Z: D' } N( {! S) u) \
}/ R& \, ^# R9 n- L
Connect();
* y9 ^3 f* @/ q4 N; v; e" }0 }2 B+ C" b
function InitForm(){7 b U! C6 h2 I$ s" J. f" H0 ~
//layout for the form
6 H2 p) f, F* u! k3 e, U* Z: Iecho "<strong>Send Items.</strong>
- b, `* S1 F. h& i! H8 E<form name='select' method='post'>
1 R# j8 j0 i9 f<lable>Character Name</lable><br/>
3 ~& P' \7 p+ f( g d<input type='text' name='char'/><br/>
9 j S' u$ R0 k' ]4 S- y<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>! v/ S" w7 v) M9 `( {
<input type='text' name='item_name'/><br/>! ~3 N* m( c8 a& [1 R' f7 S+ y
<lable>Item Amount</lable><br/>
9 ]' `1 p& R8 k9 S/ W<input type='text' name='item_amount'/><br/>! a) ?- U) y& t$ `- |# q
<lable>Item Upgrade Amount</lable><br/>( S1 ?7 k! z& J( F
<input type='text' name='item_upgrade'/><br/>0 s Y7 g- y. b, q& s2 s+ T w
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 d* P3 o6 ] r4 [6 H0 y
; Y- y3 d7 e1 q& k</lable><br/>9 `& b" c2 P- w/ ^/ }6 g
<input type='text' name='item_element'/><br/>
( w6 f/ o1 |: m! W<lable>Element Upgrade Amount</lable><br/># O5 Q; M8 x2 p, Q
<input type='text' name='element_upgrade'/><br/>! s) X$ F' C! G) D$ y2 Q
<lable>Pierced Amount</lable><br/>
* I6 a3 W; Z& n e, ]<input type='text' name='item_pierce'/><br/>7 R5 t# m% Y/ P# n
<input type='submit'/>2 y* V; g) T; i/ \- |/ r# L- s% ?
</form>";
# ^; C6 q5 L7 n5 Y/ O}
: H' K/ S: k8 L+ A, ^ E- Y6 h$ j5 t( W6 F+ d- K& i c
function PostListener (){
$ a9 f; z8 G2 j( c//Add more post variables if needed and add them to initform() function aswell
3 k2 z0 e* ^* d9 t$ J. X
8 j% q" ]& u& Q: x! ~2 M################################
0 t, {4 w4 ~5 f. E7 T! F2 Q% A6 }##### Connection and Post ######
* K" L5 ]! J9 d1 C################################
3 b1 |2 K: A! |9 @9 u0 O! Y$name = @$_POST['char'];$ K5 e# J9 l( h4 g; _9 r1 x" _& w
$ItemName = @$_POST['item_name'];
# r. W2 K- u+ @. B* y3 N) B P6 g* n$ItemAmount = @$_POST['item_amount'];
7 H; s1 b5 @' N% ^: G$ItemId = @$_POST['item_id'];
$ S6 Q. A+ `5 F. c+ n! o$ItemUpgrade = @$_POST['item_upgrade'];
: @" a' V4 G: h$ItemElement = @$_POST['item_element'];1 N% l( p/ K, X" {8 y
$ElementUpgrade = @$_POST['element_upgrade'];% z# [3 P H# D) E! o1 R6 t, n
$ItemPierce = @$_POST['item_pierce'];4 F4 D8 h) W# v1 ^" p' o
################################( H7 ]1 N7 I7 U" a7 A& b- v. M$ ~
' |# i9 Z6 V) Y8 c3 k4 S+ ^//Check both variables for empty value- e6 S" \) [# |) Z8 V; V8 k
( V" ]! y& o: P: {+ O# J, Y
if (!empty($_POST['char'])){
9 ]0 w" ], d, |$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
* B7 e/ G) q0 B: z; a0 r7 N4 N) I9 @' v& @. @3 z [2 y* f- H
m_szName = '{$name}'");
8 p/ L% Z) t% d( Dwhile ($row = mssql_fetch_object($find)){
( @2 Q' D* R* F2 A3 M7 i: V7 kecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
# b5 c A+ _" D: q% _- c$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ; b+ q' u Q1 v! P# k" x6 n r
. ~8 d: A2 n! G+ @/ V- L[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], & T0 k8 N. X" i$ K1 I
: _, x, J% c' ]" s
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
5 E3 y5 X7 Q1 r5 v0 _( R, w& h- G! t2 M' P
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', & v6 u4 ]6 Z* f& v, L* e' {
" L: z* ^+ u6 Z5 ?'{$ElementUpgrade}', '{$ItemPierce}');");) P) [( O2 |# _! p
}2 @2 T% E' u& W6 g. l0 Y" y
' w' z# t! {3 _/ r0 _
}" q8 ^/ v9 n- ^# q( n4 |" c
% J+ Z" {( t3 W* T. a
}( A) C/ Y q! l% p% H4 M
4 r7 H# f: v2 I/ T6 d* h5 L
$InitForm = InitForm(); K- a" f2 d) b8 K
$Listener = PostListener();0 F6 O: `! i9 U( q* X" M% m! \
) v% t+ n0 F$ R$ Z; n* o$ X0 M2 W?>( d% G% m4 l! I% P: W' n9 {' f! k# d
# I" W( ?) `. y* h) x' A# |
$ k# T1 O" Q7 K! g$ H3 L2 e& a3 V% k$ R: \& W5 G; R
1 c3 r6 J5 q3 a% v
|
|