|
|
<?php
$ Y- ~/ A- ^, d8 W/ @function Connect () {
& g! G6 }8 L, S: S1 wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
- V. k* w0 j5 T# Q
' u9 z7 a6 B+ a* [! MFailed.');
9 c3 w* |, q' N: s: ~}& L( D; y1 w' ?) t
Connect();- H9 y$ |# \: h7 M8 G
$ N3 z, P8 {, h$ ^' T
function InitForm(){
( ~" T* x; \7 P+ V/ `" S( b//layout for the form
2 r7 v9 k3 r* W1 A4 D% Xecho "<strong>Send Items.</strong>
6 {2 T6 l5 v& ^/ D- g<form name='select' method='post'>0 d/ Y3 d( ?2 V `6 Q
<lable>Character Name</lable><br/>+ x+ m) G, a( w$ {' {, c# c' h: m
<input type='text' name='char'/><br/>
9 c4 _0 h J/ t( b+ z) P" h<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
* ^+ ^: E4 } e! a5 n" Z( Z j/ |: j<input type='text' name='item_name'/><br/>1 N& b5 H2 e* c, f( W# E
<lable>Item Amount</lable><br/>
Q* h1 K$ E3 o2 G1 w4 |7 {/ b<input type='text' name='item_amount'/><br/>8 T8 N% w( N% J* E! o( F) |# r
<lable>Item Upgrade Amount</lable><br/>
6 a" _7 @; d; F7 l0 H8 T, i) r& O<input type='text' name='item_upgrade'/><br/>
6 I2 c3 A: Z8 S; u<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
) [1 o( S0 V% _: X7 u+ N- m# t8 y! m( V4 z* L+ q
</lable><br/>
: J) F4 v7 G( m" ]<input type='text' name='item_element'/><br/>+ J' |& D5 V! w/ Q
<lable>Element Upgrade Amount</lable><br/>+ m& `5 u: X4 \8 U0 C. _
<input type='text' name='element_upgrade'/><br/>
4 ?5 h4 h! {) t! O. o2 W<lable>Pierced Amount</lable><br/>
3 @$ Z, f3 K4 r( `<input type='text' name='item_pierce'/><br/>' z+ T7 M: a4 n9 X% O
<input type='submit'/>
* E: V+ F7 C6 a- ]2 a</form>";
( N, D6 J% M: }( D8 ]}2 d8 {" t3 e2 V4 {2 l$ K
Y) D4 _/ x0 i
function PostListener (){+ Z- f+ @/ @4 z
//Add more post variables if needed and add them to initform() function aswell
; t Y8 \. l1 }. c' i
& b8 g+ p3 q1 ]; u+ C( Z( R8 r################################
) g- P# r8 V7 Y+ z" ]! A9 j9 T% C% Q##### Connection and Post ######: A E7 w+ q# \7 j v$ i
################################3 { [% l( ]1 m. t# |/ X# x+ i
$name = @$_POST['char'];
2 d! g/ O( c+ Y" z3 x$ B0 S$ItemName = @$_POST['item_name'];, P2 j/ H7 s$ d
$ItemAmount = @$_POST['item_amount'];9 i2 w4 [: T/ H2 L
$ItemId = @$_POST['item_id'];
3 P+ u* r1 |5 V) m0 z4 |6 D$ItemUpgrade = @$_POST['item_upgrade'];
( @+ n, f, I i' d" H% `+ @$ItemElement = @$_POST['item_element'];
5 `, w$ f6 H5 f( f% @' k4 ~$ElementUpgrade = @$_POST['element_upgrade'];
, p+ u) @2 X4 Q$ R; u$ItemPierce = @$_POST['item_pierce'];
, u. ^2 T8 P+ t2 X, o) k################################* Y, Y! o- Z* K" x: @3 `
) @: j4 a& H! m, L4 E
//Check both variables for empty value5 o) }; l! l4 G$ J8 W
# Y' l& U6 {/ V' Gif (!empty($_POST['char'])){6 E: x( O; G3 \; K- z. G8 l* l3 e
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
8 {" @) n3 T" u% b0 _' B) o2 _7 ~; S. r$ @; ?
m_szName = '{$name}'");: |$ D) X/ ~% T1 W5 w
while ($row = mssql_fetch_object($find)){5 z `5 C5 g( G% w* B6 E
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";1 l- g5 {! T) C9 N) q
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" b' b) |+ Z; T6 \* M' ^/ ^
! X" R( E8 f. [. s2 i& F[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], # |3 k) h$ u' q; F2 X4 v( J1 R+ Q
5 g+ f1 \/ M1 b, a3 n5 T* g3 }. N9 l
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
/ P' I% B4 z' [: ^$ ~# _9 k# j$ A5 [3 p
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 C( p7 z B- T2 l5 K p; S `- z1 J) p5 E1 B& b; N
'{$ElementUpgrade}', '{$ItemPierce}');");( g. U4 ?3 Z4 S t
}
' U3 J% F1 s5 R( w. R: v0 K, I
+ E5 c+ u8 P9 i5 ]3 i+ B}
, D0 s+ |/ f" c) p9 j- i! \
* |+ {/ V0 r* J1 `5 u}
) N! }$ @& v; h+ c- I+ J( q7 z3 R& v6 `$ n8 ~3 I
$InitForm = InitForm();
/ }% v& P1 p; H: L, X: E4 r: T \$Listener = PostListener();" n5 V# b- I9 `3 [, j- [
8 ^# B g c6 l?>
& V. c+ U# P& h) I; Q
$ |# |6 M1 M# q1 k; A; q9 c
- A5 s; Z4 b8 t }% Y1 p. T
8 [- [9 T1 a. u. y- \& ]
: x) t( K) J# [0 I& y/ q# W/ o1 g/ `# I |
|