|
|
<?php
& J# O( g4 t: L9 V, {, K$ |7 L4 ?2 cfunction Connect () {& ~2 Y" C/ G, a9 v, c
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ; b6 T7 e" _( v" i$ l7 o: V1 g
6 _) G6 ~, o) e
Failed.');
' s9 F6 Y/ p5 V" z, m0 q}1 f* O8 F0 e/ G8 _1 f
Connect();
5 J' y0 x/ s9 v- O. n' N9 q# Y+ E Y7 A7 {9 o6 {( |4 Q
function InitForm(){
3 d( X' a9 q# B0 T6 Z1 _+ z- \* [//layout for the form7 u, l3 x2 L+ L/ k# `
echo "<strong>Send Items.</strong>' O O: Z. P. h% ~3 j
<form name='select' method='post'>0 }/ Y+ _6 G2 S2 R- t) w: O Q
<lable>Character Name</lable><br/>) E, L! ]8 V* A# s/ g
<input type='text' name='char'/><br/>
( \# k( r- J1 N* v! F8 p<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
. ~7 v1 _5 a( S<input type='text' name='item_name'/><br/>4 B2 s5 _" o3 E
<lable>Item Amount</lable><br/>
9 G; w5 y/ [$ h: M3 J; Y/ X+ x! q$ q# D<input type='text' name='item_amount'/><br/>
# Q* q/ w; V" Y- j/ @) c<lable>Item Upgrade Amount</lable><br/>( d, j; o. V2 |5 T! C+ }9 q
<input type='text' name='item_upgrade'/><br/>
+ H) `+ u& Q& k6 R6 Z<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)5 `, |6 F* v3 y
" {8 E5 p6 I; b$ a
</lable><br/>+ p( Z+ B9 Q' ~$ S
<input type='text' name='item_element'/><br/>' Q$ ^4 w d2 }; ]4 ]
<lable>Element Upgrade Amount</lable><br/>& a. d! u* ^# R9 Y9 L o
<input type='text' name='element_upgrade'/><br/>
* n+ b3 Z1 o7 F8 P! ^4 E! g<lable>Pierced Amount</lable><br/>
3 |8 E: \% U$ u: ~/ d<input type='text' name='item_pierce'/><br/>8 `1 ~5 m$ @2 \2 E9 e# E8 u
<input type='submit'/>
6 F8 y0 P4 M* c( y</form>";8 w+ h* }7 O- [, L* _3 r
}6 F- U/ G5 l& r
; m. @$ V( A# X
function PostListener (){
! v( p9 ?$ s! y2 `+ i, B4 @2 D//Add more post variables if needed and add them to initform() function aswell. I0 i8 V% N! T3 q
$ [) M$ }4 a% C, `5 M K* g
################################! Z' \( M- o- u' {
##### Connection and Post ######
3 ]3 g) F$ {! r2 D* P% ]" s################################3 \9 G) p/ M0 N6 _3 v: s# H
$name = @$_POST['char'];. E& D' _ @# [) c) ~' F" ^
$ItemName = @$_POST['item_name'];
, H6 d$ d' K# A6 O8 ~! w4 ]$ItemAmount = @$_POST['item_amount'];0 Y* C* [3 H; ~5 K8 m
$ItemId = @$_POST['item_id'];
- ?; F" \3 |* G H- r$ItemUpgrade = @$_POST['item_upgrade'];& C) B0 ?# Q' X/ _4 p+ n
$ItemElement = @$_POST['item_element'];
8 k4 W# Q8 F& t. y& Q# ~$ElementUpgrade = @$_POST['element_upgrade'];
7 \& s, M# l0 }- e: C/ D3 b9 c; _- S4 d7 K$ItemPierce = @$_POST['item_pierce'];
4 {4 z% _$ m4 F################################* q E$ Y/ |; @# o& i! C8 i
. Z F& G, m* j. h$ R//Check both variables for empty value
5 w. C3 u- t) C. H
+ J9 Q; }0 G! pif (!empty($_POST['char'])){) Z( [2 p0 W2 `0 C: c8 S j" N& ^
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
) } M8 q. h7 R8 [$ {" r: V; W0 Z: @
m_szName = '{$name}'");; s5 z. U0 g5 d0 P# K9 ^
while ($row = mssql_fetch_object($find)){
* H0 U! n6 T* e" B' p0 xecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";' w; C7 f: @$ T, T$ q
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
- Q+ y8 P* R9 G, e9 t- F4 k6 s5 N, c0 y# x( c- Q$ V. A
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], & o; K1 t. m' y* ~+ L( r2 X
5 |1 {5 B, \' T& j/ r% q1 F
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
; W1 c$ I: ?) O4 r/ C' q }& z1 h! s1 e/ Y5 q7 A% X0 a+ }, u p- T; T
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', . w; Q% e: g1 X" v9 E [' Q- ]
7 Z$ P: |: q+ {, ~; D% t8 Q x
'{$ElementUpgrade}', '{$ItemPierce}');");5 N% x4 k& s9 T: N
}
) e N& Y6 R; u
! P: S' t/ c9 ^; `& I}
, Z8 B# C+ z; A( T& ~# d" ~3 y& v1 F# H9 o
}( i. G7 }2 k+ W6 S& G/ i
2 p& q, L7 o* {/ B7 W# \- T& e# l: c
$InitForm = InitForm();
1 [9 V6 U- T+ L$Listener = PostListener();2 Y+ s3 l% H# k* g- H1 R* [+ U
4 ^, S& c) G" J# P?>% \! T2 i* o& \3 G$ ?6 z3 N
9 @0 Y9 ^5 V; k4 A! k; x3 ?
0 G, V8 }* q% I& w' x3 h. I7 m
6 V8 c* o- _4 g: s0 l0 b
( |/ S0 D0 Z) n |
|