|
|
<?php" D6 w2 D. a) i8 F! u
function Connect () {
. o9 H! m& X% Q+ j. Emssql_connect('Server','UserName','Password') or die('Error: Connection to DB
' [* A6 |7 K W8 E' f
, O: a2 g1 _0 ^% [Failed.');- a" \+ C1 z% x! z' B0 l
}0 _! N! |* R$ N% z
Connect();
l1 h) U, a' I2 q$ }& S# y& _* u& m7 Y7 }, \7 Q* w5 ~
function InitForm(){, m$ n7 A5 c3 p2 Y! w; o
//layout for the form
, R) L* ]% Z- D% a) gecho "<strong>Send Items.</strong>
# |( e% O: V% B- H7 w: ]<form name='select' method='post'>1 d8 r6 Y2 E9 U; A
<lable>Character Name</lable><br/>
- S5 ]' q9 K6 P3 Q7 ^<input type='text' name='char'/><br/>8 P; j. u, f P# E* U! P5 ?
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 H6 m& z1 g/ W<input type='text' name='item_name'/><br/>
1 N: m: O4 I8 a6 [' v7 l<lable>Item Amount</lable><br/>1 T P) O! S+ z) x) q& X+ o% X
<input type='text' name='item_amount'/><br/>
4 P: q1 I7 p2 S<lable>Item Upgrade Amount</lable><br/>8 P7 N. i, }6 u1 G, k
<input type='text' name='item_upgrade'/><br/>
' s* w( Z% S5 i9 ]1 s% u* X' }<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
& P2 z8 w& [5 k. H) P8 C3 d
3 m$ q9 c5 V9 ?" k; G8 O: B6 K</lable><br/>5 p. c$ o& l( T! p% E" s, e' { g
<input type='text' name='item_element'/><br/>
: y2 O0 Z# w+ i7 Q! Z<lable>Element Upgrade Amount</lable><br/>) O- k' P% R0 V( s6 l$ J" L! j: A* z
<input type='text' name='element_upgrade'/><br/>0 c* H$ K" h4 C; V
<lable>Pierced Amount</lable><br/>( b0 ^$ R" t0 K" ?% z5 {
<input type='text' name='item_pierce'/><br/>
5 J. R5 n% L3 J- j3 A, K3 U1 E: C<input type='submit'/>
' _3 h' V: I8 T2 E& W' y$ b f</form>";/ Z. E% b. k' _% [
}; g* G% n _ i0 H
* M' b) p- Z- ?! a U% U
function PostListener (){
/ J! X3 _; }8 d/ `( b5 n: T//Add more post variables if needed and add them to initform() function aswell# h. o' ^3 `$ z8 l0 c
0 U/ E1 A. V9 K% v" V; G
################################/ x* `3 J% M( `% {5 |7 I
##### Connection and Post ######: g7 A( {6 A( x& D* S
################################
N6 v8 Q) n% z" E$name = @$_POST['char'];
$ D$ y5 j% a' z8 d& T6 T8 O U$ItemName = @$_POST['item_name'];* [3 {- F1 G% D) ?. N& F! V
$ItemAmount = @$_POST['item_amount'];7 M7 F9 P! s5 _. ^
$ItemId = @$_POST['item_id'];) W5 J' @1 `1 _2 e
$ItemUpgrade = @$_POST['item_upgrade'];
0 H4 l9 I: {/ H. Z1 a2 x4 b: M$ItemElement = @$_POST['item_element'];7 ] s. V4 D4 g4 u% t
$ElementUpgrade = @$_POST['element_upgrade'];) C7 N: Q5 I H1 r0 j
$ItemPierce = @$_POST['item_pierce'];: L" {" n* [8 I+ P1 M
################################
+ q6 O( A E' I! m5 Y7 t' K
6 C* P! z& ^- S' r/ v! ]/ u& c* b* I//Check both variables for empty value& H# q, j5 E2 B- R+ q6 }
* @5 w, T# v$ ]( o4 }* Q1 J( @
if (!empty($_POST['char'])){
; u& n3 A8 P) T( d9 W0 h9 L3 I$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 0 r$ P' J, P& Z" k; e, ?2 p) e& B
" h1 U2 v+ b( o5 _2 ?0 [3 ~7 H# F
m_szName = '{$name}'");0 z# X$ k/ b6 @4 ^
while ($row = mssql_fetch_object($find)){
+ T# s6 k0 ?2 E0 Q) C# Iecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
7 p* G3 i! p7 h8 M, r4 P7 g$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], N/ X9 D; I6 G& C4 u; p( B; \6 S
$ G3 g9 t/ p/ K: f- d1 A
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
5 G! L6 p4 P# W* e( e- b7 y" e. n0 J6 B2 h. n1 o
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', # z7 F1 g. c0 l
6 A4 H& B% y. W+ ~( h5 R; VN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
9 o* A! i; k, [1 f
* y7 E. e+ I# b8 ?/ v'{$ElementUpgrade}', '{$ItemPierce}');"); q4 y# C3 e* Q) v# j5 `
}9 E7 @3 s% d( ~/ A: g. d6 b# w
5 A6 [5 b0 C) a/ ^0 J5 [ y}0 d5 }+ |( ^9 h7 f! _, U: v
+ j0 ~7 z: K' D; o+ f a
}8 r# }+ N7 R* w/ L
/ W, J6 x3 ?& | @* ~
$InitForm = InitForm();3 P% s' G$ c' ~( ~/ b# m% W. Y. I
$Listener = PostListener();9 k- m( I6 k% u6 @+ Q+ G" A
`- O% e( Y' N9 `?>/ J/ C a2 ~7 `' A* b
8 Q2 @* I. s T9 @
" N5 B4 X1 o( c9 o. x8 y# v. j- I. o8 a0 ?% @/ M# N
* J2 v% u& G, K7 |4 M' k
|
|