|
|
<?php
' {) w' Z/ [! G' g+ t( rfunction Connect () {
9 T) ~# X7 A: @* Ymssql_connect('Server','UserName','Password') or die('Error: Connection to DB $ ^# Z8 i" u$ B1 M+ ?3 h
$ G' M6 G' D' X0 ~! @6 {: {1 M
Failed.');6 X S0 I* b: Z: t
}- Q5 ^6 N) x: S0 R& P9 M& \1 |) b
Connect();3 ]2 B" E7 g& i# w: {4 @
0 n5 }/ m5 W+ [3 a
function InitForm(){
/ U1 {# w# T0 m. _* q7 W//layout for the form
. ^. l$ G! r7 j y2 s4 qecho "<strong>Send Items.</strong># I$ s0 `7 P; ~. d8 d( k2 x# {
<form name='select' method='post'>' r7 x- A0 ^( U" o
<lable>Character Name</lable><br/>( V4 X' }# g9 F/ B/ h; k4 v
<input type='text' name='char'/><br/>
5 g& z3 S, J' r6 \<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>/ D5 H; h3 N* p! P1 S' h% s% m7 I
<input type='text' name='item_name'/><br/>6 s" F) a7 l' J
<lable>Item Amount</lable><br/>
4 W$ T+ O9 W( {5 J0 Y7 B<input type='text' name='item_amount'/><br/># X( W& r8 W7 c/ W
<lable>Item Upgrade Amount</lable><br/>
; C c4 y' ~5 w9 ?<input type='text' name='item_upgrade'/><br/>
& S2 `7 a$ x7 G1 R8 O$ I<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
! m! \3 Q X( Q3 q1 H/ s8 z
$ J+ }* D/ x" H$ @+ O</lable><br/>, T+ }9 ?2 {: N" k$ {% {$ _
<input type='text' name='item_element'/><br/>! _4 T6 O7 }) e( Q" v
<lable>Element Upgrade Amount</lable><br/> G* } Z/ g& C
<input type='text' name='element_upgrade'/><br/>) V" t, _, x/ B* l5 E6 W) N7 V
<lable>Pierced Amount</lable><br/>
$ E" z& r) A% x. W. i C<input type='text' name='item_pierce'/><br/>
$ w# a& f% C8 N7 ^7 P5 ^4 ?<input type='submit'/>
# z% Z1 R7 m; A" x' `" Z( `</form>";
9 }$ P6 ^/ U: i5 w; C}
# e+ j) t# j2 T3 V
5 A z; B8 r# |# a( E; qfunction PostListener (){1 ?! z, M% s/ R2 L; c' j: K; m
//Add more post variables if needed and add them to initform() function aswell
) N$ z3 c$ G5 z" B! J. z2 C9 n1 w9 n7 J' M7 S7 n
################################
6 v# A3 k+ Z& @) w" ?# p4 ?8 Y##### Connection and Post ######
. d+ t' C- Z- ~################################; y3 i0 l- K6 d; F' k0 n) ~
$name = @$_POST['char'];
4 z( d4 u4 J/ K1 p9 x7 h# a z9 v) h$ItemName = @$_POST['item_name'];% U2 }6 p* a$ u7 i+ ~" T
$ItemAmount = @$_POST['item_amount'];# a8 K/ ~5 s+ L' u4 z
$ItemId = @$_POST['item_id'];
% ~6 f. w' {2 o$ItemUpgrade = @$_POST['item_upgrade'];$ D, `. M# y& X- S1 H
$ItemElement = @$_POST['item_element'];
( e5 \ u) u2 c$ElementUpgrade = @$_POST['element_upgrade'];
, O0 I5 v, O! a- Y$ItemPierce = @$_POST['item_pierce'];
/ \. V/ k: \1 l6 [################################9 R2 @0 w3 u8 A% `
) u8 `; H4 G+ C* C$ A
//Check both variables for empty value
; N; r4 g% `- m& ]
8 `8 S+ C# H( P; g/ Pif (!empty($_POST['char'])){2 U! \/ V( l5 S0 Y0 Q
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where , c# e8 i O& x1 t; u9 O, [, v
: ~. L& [( y) [- `+ K' g* x$ i
m_szName = '{$name}'");1 J7 F: G2 ? F- Z
while ($row = mssql_fetch_object($find)){/ h; A& j- k: Q6 L# R
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
! F' q0 D. D' V. G+ A4 e) N, W$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 8 q$ @/ l) K0 r: k9 |8 q
8 @# ^6 z9 ]( \5 |[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
5 ^# d) e4 M6 A* I2 \+ }! v" H; O/ t0 n
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', / M( M7 s4 l* ?6 b" n
; n u h* N* ?3 `2 u2 u6 a0 |& FN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', & S3 j1 X8 B- i/ ^* ?, O) x, E
/ r5 @: k3 c1 p' H/ z9 Y1 G
'{$ElementUpgrade}', '{$ItemPierce}');");
) [3 H. n. H% Y* P- r7 E. Q0 m}2 \" }4 V* C' @0 I( C$ w* M9 Z5 r
1 i/ C% v' v* B1 m! ^
}
8 t- L7 y# a8 H6 A6 ?
% b; H+ n1 n" i- g+ X}& E `* x& Q1 l+ U% `
2 z. d7 Y1 O j( h. y3 H$InitForm = InitForm();
8 z) ~$ G$ Y9 X$Listener = PostListener();: p, C% w% W) j$ d3 L
2 S" q9 D* M- K$ j3 [" s?>
: F6 K( I! h& \9 m7 z& X i7 W
! F" t/ V- I1 \" ^4 F2 Y
$ N) z) E$ \% M7 J
, V1 y% h4 F5 [5 g) y- V( T# c. g/ Y
|
|