|
|
<?php) A) p3 ^$ L- U; x! Q9 x X
function Connect () {3 ?# G D( C' b
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
/ f/ \2 u, y) D5 v8 `! A
. d. K) }' q* y2 U8 M! }Failed.');' o( @7 f* W! e, M/ ]0 K6 G
}. g" m% S* E. T9 `; ?
Connect();( P+ Q8 R7 T s$ W* x1 C1 {- u
% E: D0 `+ e3 Y X3 b" E1 h/ \function InitForm(){
* V" s+ e6 j& c//layout for the form
/ _3 @$ |* n8 H' K, Wecho "<strong>Send Items.</strong># M& {) a/ Y; k
<form name='select' method='post'>
& }, S4 Z+ x0 o( \<lable>Character Name</lable><br/>) e! Z% O, q8 L7 R
<input type='text' name='char'/><br/>
5 e' E* X: D. L( a" Y, e- S0 ]<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>% l8 Y* B0 l0 M$ s$ m. L
<input type='text' name='item_name'/><br/>
) L& w! |- S/ o: I3 n6 b<lable>Item Amount</lable><br/>* ]2 R K) w7 V1 z( M/ s
<input type='text' name='item_amount'/><br/>% O% H7 B* J5 X' S$ N
<lable>Item Upgrade Amount</lable><br/>
# p' `' I$ v# T# Z* v: u<input type='text' name='item_upgrade'/><br/>' w5 w/ n* z9 R: E) ~
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 j. H: H5 _4 Z
7 G6 o6 z' S$ T9 W+ b/ m</lable><br/>
/ P& N+ g l k7 C' v4 q<input type='text' name='item_element'/><br/>
2 [" \$ s+ Y5 x# @2 I) K k<lable>Element Upgrade Amount</lable><br/>
' Z) q3 y! ]- _5 H( R& d<input type='text' name='element_upgrade'/><br/>7 H4 f% Z3 N! |7 T5 R1 u5 [, ?) z
<lable>Pierced Amount</lable><br/>! v9 a+ D! C/ d9 K( u) o
<input type='text' name='item_pierce'/><br/>6 |1 z& W8 H6 h
<input type='submit'/>
" ]" Q. Z0 ] z- ?. [</form>";' m8 d( }* y8 m4 Q! R" r) k3 A: [
}
' K. g8 t3 L: p
: |; }( j5 } _* c5 X4 D# ~function PostListener (){4 R. i- I0 C, r7 a1 b3 P) y5 @+ T
//Add more post variables if needed and add them to initform() function aswell1 T; i- S9 m% K4 v6 c- w; r' ]
% @5 n9 R" E8 A/ t9 ?) ~
################################# w5 m$ i9 J* q; S6 E ~; X
##### Connection and Post ######
" A, E( ]+ v2 g3 g: u# t: h9 N################################
' d4 D$ Q% ]( U$name = @$_POST['char'];
$ |2 T# E8 o4 N- G$ItemName = @$_POST['item_name'];
9 R5 u& _* m; S- P$ItemAmount = @$_POST['item_amount'];/ B# J5 m. B2 H4 w; t1 }. e# Y8 j
$ItemId = @$_POST['item_id'];! W- B& a' V. i% N" J
$ItemUpgrade = @$_POST['item_upgrade'];
8 _+ D0 c! A- z! o/ Z3 f, ?$ItemElement = @$_POST['item_element'];
1 |7 Y5 F* B/ i! d- _! n/ @+ v$ElementUpgrade = @$_POST['element_upgrade'];
$ I: L% d; a. _ q7 S* U' X" m- N" d. S$ItemPierce = @$_POST['item_pierce'];6 f+ _" \( ^" {( B; |( O+ [8 a
################################
( d+ Z1 d% [$ z# c- D4 j, y# Y6 P4 d3 R% Z
//Check both variables for empty value7 `3 E* k: B, U5 |
7 s M) w6 p3 N8 }- yif (!empty($_POST['char'])){
" K( `, G3 T) J w0 m8 @$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
- J8 Z& F, e& f+ [( W* o6 a) Y8 H( M0 }; V$ d7 C
m_szName = '{$name}'");
3 Y! w9 ^: a; d. n2 p# U$ D ^while ($row = mssql_fetch_object($find)){. b9 D, t7 c Z' K
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: u3 |3 Q, ^. E3 r2 B$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
, d% V. V0 F; S+ Y! z
6 n0 G6 Q, M3 i[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 2 s+ v7 D) j, I& u
. c0 U X+ v$ ]" r# G
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 4 t; c3 U& K( J8 V% G, \7 f) |
' C1 `0 N. c7 f
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
( Z- o1 h I! ^" ]9 f9 Z3 s s! h/ L& A, O
'{$ElementUpgrade}', '{$ItemPierce}');");
9 y$ C1 y7 X6 z* W- x}) U: h! `9 Y" @* w. }( `
: \( i: ]8 W% t& f( F# J9 D
}% T4 R# D- \; ?3 w
* S' d; r$ K0 j1 F& o% G3 i, L}) z I0 S7 t3 G5 G7 `/ Z+ S* J7 q
7 U) X* w" I. x# f6 G# D$InitForm = InitForm();# c1 E- w6 t v8 j1 Y; y
$Listener = PostListener();/ {9 E" B8 W4 A* b" p0 d9 `
0 J: O4 {- I% r: @( d( x8 G- y?>
$ y6 H( M. r6 Z: c' P! w% k
/ ~6 ~9 C$ n" N
7 W3 w$ ?3 [. o. x
2 W$ s/ i1 O1 U0 S8 H5 h/ S
4 e: @' E# v: y4 a |
|