|
|
<?php
- @; D2 m W" M/ s5 W) p" M+ Nfunction Connect () {
9 H9 v5 ]' X- q9 ]mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 4 [; Q% M( C" F/ g( q/ n
0 W/ S7 V0 L6 iFailed.');
P$ C; ]/ N+ @}: r( x: o7 g" E- W8 @- b/ c3 s; l: c
Connect();0 b+ v1 Q7 @$ {3 q# X. o0 t
: ]" T+ s, J; d. Cfunction InitForm(){
" L+ [3 ~; ?+ C/ {6 J3 B$ l//layout for the form3 ?7 Q& t; W, P. J5 w. f
echo "<strong>Send Items.</strong>( z" w1 Y7 H9 o( o
<form name='select' method='post'>; s1 w/ d9 h! K. L
<lable>Character Name</lable><br/>
: x# s' l. T1 G3 l% z+ T<input type='text' name='char'/><br/>
! F- f1 z) n/ H3 t) U* i2 `<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
% l( I% {8 i. d; t! O5 D<input type='text' name='item_name'/><br/> o/ ]) s A) S
<lable>Item Amount</lable><br/>
) P8 e% G8 t& W9 @. f2 i<input type='text' name='item_amount'/><br/>9 C/ S. j4 ?* c4 N" g% y3 J. V
<lable>Item Upgrade Amount</lable><br/>
5 F+ x1 P: C+ x. ?3 ]8 m<input type='text' name='item_upgrade'/><br/>( u9 ]% Y8 j/ v! g* s
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
8 N9 q# {9 X5 R$ Q& v3 t% |1 t! A( q2 ?4 y# |
</lable><br/>" I' ~& N# l! {9 j6 o
<input type='text' name='item_element'/><br/>
2 s, N2 h& s( W7 T- h<lable>Element Upgrade Amount</lable><br/>
' r* s+ X, C2 X<input type='text' name='element_upgrade'/><br/>: {0 C/ u1 [5 d& w3 a
<lable>Pierced Amount</lable><br/>
$ H% | N& c3 w; n% F+ c, e<input type='text' name='item_pierce'/><br/>4 T" H2 z1 T; ]+ N) m- u
<input type='submit'/>4 j8 F4 ^; Y9 n% r$ }0 n
</form>";
4 e. s) R6 n# o/ l7 S2 y1 V}
5 [( C; U1 _( g9 H& ~/ N, U8 D o) b! O% n$ m. u
function PostListener (){: @0 {4 A# F% ^' w
//Add more post variables if needed and add them to initform() function aswell( u2 u- {1 M. D2 Z; m' Q
$ x H% a' W& F- w' h7 U################################( r" X6 F( M/ b) I0 x
##### Connection and Post ######. h6 O$ x; w1 n& s
################################
$ ~$ [. t" }9 i ^$name = @$_POST['char'];
7 Z/ f6 ]% f1 K& R! L* u+ [$ItemName = @$_POST['item_name'];
6 \. F- Y) D5 Q2 \3 R. T2 y" S% ^$ItemAmount = @$_POST['item_amount'];
, z9 N! F% y( N/ s" D$ItemId = @$_POST['item_id'];
9 Y9 D9 d5 }" _/ |$ItemUpgrade = @$_POST['item_upgrade'];* E# z/ d6 i" F9 [; G
$ItemElement = @$_POST['item_element'];
* M; P6 x: v( H1 _: h% S$ElementUpgrade = @$_POST['element_upgrade'];
& G; b- t% }8 x7 H; L1 f% k$ItemPierce = @$_POST['item_pierce'];7 {* g4 j. _* u
################################
9 Q* ^9 K* U U L) Y3 V c6 K8 b
//Check both variables for empty value
, B; N0 L L. D$ }. h
O! j9 q" q- d0 D" M$ k3 lif (!empty($_POST['char'])){
U4 m O& u X' }5 Q$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 1 s/ D& z9 p" a+ I9 D& e: _/ T
' [$ }0 I- M2 X0 \
m_szName = '{$name}'");
& b" g) k" }0 V. ?6 c/ H8 {while ($row = mssql_fetch_object($find)){8 e0 f& J& x, R& ^2 u; k {
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";2 s1 N8 ^8 o# x: p
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" c: Z& W3 g7 M. S7 _$ l# d
- v4 y8 e0 e# G# R3 R[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ' D) L u# z- f! W% h* h
+ L2 j# H" O; J$ [; ^7 z5 B
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ( D6 A7 i+ P" Q. C, @
( T" V1 | t6 f/ w( S% k2 v8 S+ ^N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', / n$ R# H8 O7 ~) e7 u
. m D, D* l7 d) ?, e6 m4 ~
'{$ElementUpgrade}', '{$ItemPierce}');");) p* l3 ?( ^0 N; l( P8 o! e( S
}$ u7 L+ e ^- B( ^0 j% m0 e/ ~7 o6 y
, u; _& a0 @" N}
/ e! R% D: D% ~! d( Y
" ?$ t% U, D$ o* s2 Y6 S}" s% K0 Q7 {- l
% N, W g% o, M& |0 b$InitForm = InitForm();
' t& J/ Z+ X$ [5 ]) M% K9 d9 m% N$Listener = PostListener();7 o' D' _/ B# T r% e; b& o! h; t
2 b3 A" u6 ~* a9 A" h% ]
?>! A5 x2 b- ^2 Z! ]3 h3 n+ u B
# y7 @5 h- r, i+ ~. r$ y, s
+ k& z# m- w0 y# t d0 P/ n
$ ~9 x" w* T0 W7 X9 @
$ ?7 s: n7 @6 z6 B$ i |
|