|
|
<?php
' T( P. I2 ~$ ^function Connect () { O6 v3 G/ ]9 B; {
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB / Z+ F$ Z, M! C( u
2 m5 T* n8 D$ `) S
Failed.');
, B4 |: m" c0 x/ ? @& J r0 x}
+ B1 C. {9 d8 a! LConnect();
. b P4 j8 N( {+ H% w& P# D! ?
0 h) h# E1 N3 F' V* ?4 ^function InitForm(){
" ^5 F/ P8 ]; f; y//layout for the form6 N+ v5 K* W$ h' Q
echo "<strong>Send Items.</strong>9 e* U# Z' s) U& `
<form name='select' method='post'>" D _$ `* R# M5 Z2 F k
<lable>Character Name</lable><br/>
2 W& h9 J6 c! ~ E<input type='text' name='char'/><br/>
/ r! D5 S1 X& |7 G. f<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>$ _# e8 ~2 J2 |1 d
<input type='text' name='item_name'/><br/>6 _% m- c( P) A2 S4 M% v
<lable>Item Amount</lable><br/>! ~0 v7 y) C, Z$ b& ]8 [
<input type='text' name='item_amount'/><br/>- {6 g. P) B& G0 Y
<lable>Item Upgrade Amount</lable><br/>7 l1 z3 B# { {9 ?# {& s2 i5 ?
<input type='text' name='item_upgrade'/><br/>
/ Z2 \5 N- ?0 c; @$ r$ {0 u<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
. H8 x2 `7 U( V7 @2 I; m) c$ i1 a4 w {. {8 k% r
</lable><br/>; ]: Q" P7 t u/ p) K
<input type='text' name='item_element'/><br/>
- ~9 h4 y8 e6 D9 [0 j5 [( @8 U<lable>Element Upgrade Amount</lable><br/>
4 N G; g9 x0 B3 i6 {3 }/ T<input type='text' name='element_upgrade'/><br/>
3 C, T0 }) M3 W& i0 M<lable>Pierced Amount</lable><br/>
, L: W" q; g: D, a! m<input type='text' name='item_pierce'/><br/>
* G, s5 T7 f/ { q5 x% ^<input type='submit'/>" `7 X! A W. D7 n6 {3 X" L* }0 |
</form>";
( ^+ {' x* ^1 Z' G, o! e5 I b}5 c& m2 D. q( U
8 M6 S, t& i& a% P. y
function PostListener (){: G, d) m" n: a" c, c
//Add more post variables if needed and add them to initform() function aswell
/ P$ {7 H1 P/ m6 d4 m3 X& p5 q+ l0 A( r) x. _) ~6 s: ^; g4 `+ a+ h
################################9 o& k7 {, d9 A
##### Connection and Post ######
3 ~8 i+ U! F: E! N! z% r################################0 a6 {" X. s7 `6 G6 G
$name = @$_POST['char'];) ], h3 \7 M2 Z w3 E
$ItemName = @$_POST['item_name'];5 m" C6 ]; C/ e
$ItemAmount = @$_POST['item_amount'];
! K/ Q6 v2 P9 U6 w/ H$ItemId = @$_POST['item_id'];
" S" v! L. v, Y$ItemUpgrade = @$_POST['item_upgrade'];) ?( f0 [# \7 |
$ItemElement = @$_POST['item_element'];9 k. M. h7 P; x4 x
$ElementUpgrade = @$_POST['element_upgrade'];+ j& G1 t+ l1 C2 d! `; D: k
$ItemPierce = @$_POST['item_pierce'];, C w; Y0 X/ T+ a. K/ ]
################################1 d/ f: J8 O2 Y* D* j- X! d
8 I' ~4 i5 S; q, G' g1 P//Check both variables for empty value6 E! _& I+ Y+ F! I) \& N4 r
* A$ [: v7 ^8 [ u4 W2 Nif (!empty($_POST['char'])){
" i" ]$ A& N$ Y7 p" I; i8 e: S$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
/ E" G& k% B; Q, G! Z
3 X8 _2 p8 A; Om_szName = '{$name}'");3 Z2 l" s, j6 }# s$ C4 Y
while ($row = mssql_fetch_object($find)){
1 u& d7 n# U Hecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";2 `4 B- t5 U& O; v
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
* A, q+ P# \: n. A% F3 z2 X; H
+ `4 B3 l8 s+ I6 T, c( b[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
" e1 p* U0 s7 D' z9 i4 Q
. B4 W3 x' p! b[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 O, r; U: R5 b2 P4 W. y( u( {' `$ ?; D/ r2 e+ }
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 T3 E7 s6 ^7 |, \6 q
) I4 Q1 I: f2 s9 a. ?6 o1 v
'{$ElementUpgrade}', '{$ItemPierce}');");
4 @$ E1 E8 _! F; R. U}
, |0 y8 X, ?7 U6 K- O
7 @8 h G, C& ]- I$ J: Q}2 w3 F! l; y' q6 ^' d( M0 B7 l# {1 G/ Y
0 [; b) A4 f5 g
}$ {# z3 S2 p8 w. \; D6 R
% [, f( f4 y, O6 ^% w$InitForm = InitForm();; Z& A9 t) n) ]' G+ d, j: [
$Listener = PostListener();
( n3 `# `- |! f
$ }. X2 b! \/ A) D- g9 ?/ a3 Z?>, t. x; Y/ \. G! S* \$ [
6 k9 J/ b( L7 a+ M
5 g$ j# s; a! I9 J6 p4 _! c r; j9 W3 G6 {2 t
/ m' b) n0 c8 m# h! }% L0 L1 t+ J! J |
|