|
|
<?php
6 N! Y9 \' V: R: L5 t7 Y- Gfunction Connect () {
& J: }0 z- b' qmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% R4 U9 V5 I3 e; I, k. t9 R9 k8 x$ Z! B7 ~+ O9 {9 S. _
Failed.');
) {5 m+ Y( o1 d( G. |}% u! c4 y! ?% g* @
Connect();. ]4 Q6 _6 O0 o; K! G1 p4 s* M
$ _; ?5 {# U2 \4 J9 x0 k/ a
function InitForm(){
( x- o% g9 h6 W# Z+ b//layout for the form
. }( J; T0 M4 `5 W) b) |echo "<strong>Send Items.</strong>% T q, |8 Z3 r7 e6 q( U
<form name='select' method='post'>( A/ I; s1 _& Y+ M: P/ x4 H# D
<lable>Character Name</lable><br/>
# ^" f3 ^- o6 E$ L) ~<input type='text' name='char'/><br/>( D; i8 ~' W! g: p: P' q; l9 K: ~
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>3 R& Z: h9 \! j2 T+ n
<input type='text' name='item_name'/><br/>
" a( M' F2 j! M# I$ D+ K+ K<lable>Item Amount</lable><br/>
/ c1 }! M$ I6 D! D7 F<input type='text' name='item_amount'/><br/>& ^4 e: Q! t5 [
<lable>Item Upgrade Amount</lable><br/>
% Z4 I- e. ~' ]) a7 A1 q<input type='text' name='item_upgrade'/><br/>
' M4 [/ w3 G5 b) A- h<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
5 p# Z7 J7 d$ V `5 e0 m' H0 L5 m, v# Q. T4 B& c, p+ l% j: ^
</lable><br/>! c" E! `6 R" c
<input type='text' name='item_element'/><br/>) T$ h# G3 a+ _& l! U. Q) {1 z
<lable>Element Upgrade Amount</lable><br/>
$ ]% g( Q0 b! |<input type='text' name='element_upgrade'/><br/> i* y, W5 j6 U3 _' b! c
<lable>Pierced Amount</lable><br/>1 f$ l1 z5 Z- b' D6 {. s
<input type='text' name='item_pierce'/><br/>
7 u6 `) ^# c, L3 Y: ^. C1 e<input type='submit'/>
: @3 U% G% {. T8 y- \, r" u</form>";
+ t4 g' B! i/ S}
. R* J2 t' J5 U4 j4 u1 ]1 H$ m1 M' f7 U
function PostListener (){2 j' a( {# |) |, U6 M
//Add more post variables if needed and add them to initform() function aswell) H; F- w$ |/ F, B, n/ _
* |& g; ], g7 j( R6 D; w7 L
################################
5 _. G* i0 q3 n: J8 U7 c" P##### Connection and Post ###### f5 k, l% O" a4 P' f, X# c
################################
7 t8 a1 b; B( Q6 M4 d5 K6 y* ^$name = @$_POST['char'];/ A d0 i8 V% a& d# K
$ItemName = @$_POST['item_name'];" J5 B% L4 L3 L. I) w, z
$ItemAmount = @$_POST['item_amount'];9 U0 o4 {0 b! Z; B3 |- o" S$ \$ E
$ItemId = @$_POST['item_id'];
2 {9 w* ~& O3 C( g+ j$ItemUpgrade = @$_POST['item_upgrade'];
' w' ~' c8 j& A7 w6 j! v$ItemElement = @$_POST['item_element'];
; {! @' \# R" P! e+ A5 {$ElementUpgrade = @$_POST['element_upgrade'];; f0 D$ o% s0 q& q6 o+ u" j
$ItemPierce = @$_POST['item_pierce']; z% h2 f4 }7 I1 A- C
################################# T" B6 u6 a6 V, ?1 o' p5 ^& m5 c! Z
6 T; o- y/ j- u& @1 v6 a% e& Q. Z//Check both variables for empty value# H' x8 }/ r5 T% F3 v- a6 _' J( K7 a
. e: Y& ?6 T3 F9 ?6 y& T3 f$ B( M
if (!empty($_POST['char'])){4 g5 ~: G ]- S" z2 O! I+ B
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
" d& Z, K* ~* w. h3 P
' @+ H- @7 ]: H2 b5 J) lm_szName = '{$name}'");8 {7 v( S0 l& U
while ($row = mssql_fetch_object($find)){; }7 v; [1 ^- g
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
4 V4 P; A4 o- \1 O) J7 P' v4 |" H, n; g$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], * r& {+ o* {& e v9 R9 ]/ c
0 n2 U9 ]- R* I b. s! c) m9 f[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 3 u V3 g$ f7 X3 C2 i; W$ _
: U; P# S8 z! |' y0 `
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
% T4 a5 Q$ y# d- H1 x3 ], W( `: J8 G5 h, u! n
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
; n# ^; [4 i$ d) w) K1 |
7 [3 `) i) ~0 U* r" L8 S'{$ElementUpgrade}', '{$ItemPierce}');");
' D! l8 W& G( ^9 j( ?, ?2 T0 @}- U( }+ u/ }: s( t& G/ w% Z4 v* F% r5 P) v
" E1 _) u! E E+ R' |
}5 n. |( R2 ]$ \& @
0 @$ l1 E- J s- l4 O2 N}! u' {- h3 k: z# P* a$ U' Z
: y& E: R9 @ f; v" z, t
$InitForm = InitForm();1 @! n/ C7 {' D4 r# Z
$Listener = PostListener();
& ^* v' o, U6 ?
) {! u- g7 V' ] I; {1 L, u# Z?>5 d+ x& k5 ~: z! q! B
4 t; }. P) i! e+ k2 @: u I* A N8 Y0 B4 z; M* O2 b ]9 R
8 k1 H( g: _) I l8 n( u
2 o! l: m# b n& t/ f |
|