|
|
<?php
; v% F$ U. u! R. m4 pfunction Connect () {
i1 E# t/ ]$ F9 Umssql_connect('Server','UserName','Password') or die('Error: Connection to DB 0 q3 C+ v7 h1 i8 q; Q
' x& w N ~% u9 m5 X* w7 NFailed.');+ b: Q8 D: {* A0 q% P/ s
}' I5 i9 l0 N2 T6 l" k5 C C
Connect();
4 X3 R# Y, L1 _0 G0 G+ k: b9 G* N( G8 S7 |
function InitForm(){- R' p. {7 P/ k# L3 N; B" L) ~4 w
//layout for the form
- N* j( g$ |( p$ r5 } oecho "<strong>Send Items.</strong>" Q$ C/ U) V$ j; L
<form name='select' method='post'>
1 P* @9 f: I* f1 h" y, N% l% ?<lable>Character Name</lable><br/>
; ?, N# q% q9 K$ Q; K. F<input type='text' name='char'/><br/>' N1 K$ n8 t/ v- `1 Y) C
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>6 \$ U k% T9 t" `7 H$ b( E
<input type='text' name='item_name'/><br/>( A) |2 a/ ~: L: h3 \$ Q4 M4 i- a) H$ F
<lable>Item Amount</lable><br/>
+ `0 S+ a/ S; [! j) _( c<input type='text' name='item_amount'/><br/>6 d/ `! z2 B! u5 A
<lable>Item Upgrade Amount</lable><br/>; v" P* @1 O% d+ n% J6 u
<input type='text' name='item_upgrade'/><br/>5 N! Z6 L" T/ S3 m+ C
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. K* U' |; ~+ M, e9 K4 i' @. d
</lable><br/>9 p) X7 S* Q! C3 Y6 I
<input type='text' name='item_element'/><br/>( [& W8 L) l) q
<lable>Element Upgrade Amount</lable><br/>
1 u( L4 Q- ]# J) z) z' S<input type='text' name='element_upgrade'/><br/>
& Q1 }0 @) r1 L- r9 j: z<lable>Pierced Amount</lable><br/>
* \) {" F' N6 i. J6 ], R# U<input type='text' name='item_pierce'/><br/>
7 x7 Z9 G7 o; w7 r<input type='submit'/>
' K+ F' J/ H8 ?2 m6 t* c$ C& e4 H</form>";
3 g* p0 F* q+ ^6 B" @- D}) V1 S2 p; ~' p$ m# s& l1 K
3 ]2 p/ D3 T j0 D" Yfunction PostListener (){
" h6 M. `* ?9 H9 }//Add more post variables if needed and add them to initform() function aswell8 y# R4 m& e- K! V
8 t. P, Z8 w( E& e################################
0 j5 N2 k2 O3 B' z) l##### Connection and Post ######/ k4 w, p) [! W1 C
################################
% M& Y: e% Q; N" H) }3 U5 P$name = @$_POST['char'];& m* ?1 |* M9 s2 D& Q6 Z! |) x* m
$ItemName = @$_POST['item_name'];
" c! L0 G0 \) s$ItemAmount = @$_POST['item_amount'];2 m) S) e9 h: k m
$ItemId = @$_POST['item_id'];/ e% I. t9 [6 u. `
$ItemUpgrade = @$_POST['item_upgrade'];1 ?8 ~6 T# g, R9 d0 m
$ItemElement = @$_POST['item_element'];
( P5 B! ]0 X5 e$ U$ElementUpgrade = @$_POST['element_upgrade'];; t% d- e' G& l5 \
$ItemPierce = @$_POST['item_pierce'];
( ~9 L+ x8 G8 q& v################################
" Y, S# C! `2 ^- {
, ?# q# Y5 w7 ?5 G( v1 v5 U//Check both variables for empty value* g; d! K" M6 A0 L* V: c4 ]/ X
& {! D: Z, G+ lif (!empty($_POST['char'])){
9 z, G+ j' P! l4 c0 F3 f& Q! ~$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, F0 b% R8 u/ B* C3 \* R/ T2 |+ d7 `, R G9 z) B
m_szName = '{$name}'");
( A" h7 T3 z; y- hwhile ($row = mssql_fetch_object($find)){/ [7 M `% N5 Q, V) Z
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";3 Z4 U' o/ r' f0 w- o# g
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ; }9 h! k2 M7 w! @$ @/ ~; @
; P3 e( z) g; o+ L- G[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 3 _' @" o7 M; y( |+ e# N
, F6 R0 H) H2 E: n
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
% O0 s) L7 \ @& D
) q% s4 t7 I! U4 {/ M: |N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
\: O' L( q Y, U
. X- [( U: d ~'{$ElementUpgrade}', '{$ItemPierce}');");
/ g0 `3 E+ }% `}
- F7 A, F2 v+ d1 b8 p$ a9 [9 c0 `9 S P# O$ X2 n
}4 O( d5 [* j- U( S
3 p! }% Z4 O4 [8 @2 D
}/ I% `9 {3 K- s7 j
9 M) e( x" t/ I- ^4 o6 |$InitForm = InitForm();
& j" g/ W6 r9 y/ |$Listener = PostListener();
6 T {/ X7 ]1 P' r; u5 e' T
$ V3 v+ X5 e, p7 v" N$ _) Y?>6 z( R9 e7 C* m$ J9 k) y- e
. M( w. P8 L r; g0 _+ q p
3 b8 n7 B9 T4 v
* t4 d6 P, S% F3 M( C2 D, a' f& R
7 h# Q8 K* u' S |
|