|
|
<?php; ?! |) l: y, G4 [2 E1 j. @
function Connect () {
9 P- y1 i( A, V8 x4 | O+ `3 ]mssql_connect('Server','UserName','Password') or die('Error: Connection to DB % ~% t! d9 k8 k( g4 B m) A
9 i( r$ R2 P7 \0 |
Failed.');
7 w: @: g0 u Y; U}& `$ |/ G3 z0 @
Connect();
( v5 c& ?4 F* S! B i- ?5 c" ~
' g6 F: H* s# {( ~4 Y5 Y$ W$ ufunction InitForm(){
7 r, t: z4 B* Q5 |% L0 p4 D# ]//layout for the form
9 d( _; Q& n- N ]2 eecho "<strong>Send Items.</strong>
( F: P& {5 n! J' j8 `+ B9 `<form name='select' method='post'>
) j6 F" h9 o& H$ g8 {# z<lable>Character Name</lable><br/>
7 s# d4 B x. A<input type='text' name='char'/><br/>
0 }; R Z. p4 y% l% P<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>- V3 ~ a7 j" s. R, R
<input type='text' name='item_name'/><br/>) x& p0 n" D' k/ E6 V9 e4 o
<lable>Item Amount</lable><br/>
! ~# @4 |2 n& ] ?. r<input type='text' name='item_amount'/><br/>
7 e3 n" i9 m. u( N/ j; I- F2 c<lable>Item Upgrade Amount</lable><br/>4 b5 b. y% p9 `& n- L
<input type='text' name='item_upgrade'/><br/>2 @& b" B) B6 j8 ?/ @) k) F) u: Z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
! \$ V# f a H( h, M1 F7 x5 R* l \ f: {
</lable><br/>
( x7 |( l$ `. h0 ^3 D5 _: v<input type='text' name='item_element'/><br/>: }3 y" u8 o: w
<lable>Element Upgrade Amount</lable><br/>/ a7 C+ K) |/ _* v
<input type='text' name='element_upgrade'/><br/>
2 q. r. X8 S! a- t* L1 R8 Y1 a l<lable>Pierced Amount</lable><br/>( X# H8 ~* G# V! g& |$ Q: H
<input type='text' name='item_pierce'/><br/>: u) d; O4 P6 D
<input type='submit'/>
( N: H( u) S( E</form>";0 ^* U1 a% f7 c7 q
}. J. U$ ?8 m; R6 B9 D$ ~
4 ]5 |$ ], `! C; K2 k" t/ k
function PostListener (){, u2 R/ y! y! v; E5 M/ |
//Add more post variables if needed and add them to initform() function aswell2 l; F% N4 Y' H. c+ b. E, D& ]
% h, \9 g( d# V
################################ w) _1 S/ {% W, S7 o
##### Connection and Post ######
% ~" |, C7 y( {; x1 J################################) }+ a. u& x& g
$name = @$_POST['char'];- v6 `/ T2 i% m6 A' V
$ItemName = @$_POST['item_name'];
8 N; w# v/ U% d$ItemAmount = @$_POST['item_amount'];
3 ?7 j0 Q, V* k5 `& X$ItemId = @$_POST['item_id'];7 x: P, h% |/ n) [; h+ I% J
$ItemUpgrade = @$_POST['item_upgrade'];
x- g+ M, o2 I; h. k# s: H% ^* {$ItemElement = @$_POST['item_element'];# z7 F( x u4 C6 B: _/ N2 a& F
$ElementUpgrade = @$_POST['element_upgrade'];
+ _- S9 o0 L* F8 b$ItemPierce = @$_POST['item_pierce'];6 b3 m* Q$ x/ ?; g$ T4 `
################################0 Z0 e5 W1 m! Q+ M$ S, A- H
9 f: C, c3 I j9 V6 H9 \$ e, F//Check both variables for empty value, I! L8 \" ] V# M L+ M
& I% s0 R5 U, ^0 G5 y! o
if (!empty($_POST['char'])){( b; H; A- p# z
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
1 t# a8 e: T0 F7 N) V7 r& B' N4 K, C0 m5 w0 i- N
m_szName = '{$name}'");
+ ~, L5 J( Z& x# Xwhile ($row = mssql_fetch_object($find)){
/ R5 p5 q& j8 I0 K: Zecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: [3 Y/ k& ~ {; Q/ G$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
2 l) K, {$ u! X' Q7 B
4 ]9 N( u. e6 ^0 b) r1 p) M4 ?* O[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
+ k; F7 l2 V9 }- g# O- z+ `. Q. ~) g& N: |
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 M4 M8 C* e$ @: P
( M# Z! Q4 L s; Y3 l* `N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
1 I$ O0 U' V1 b& E0 p4 x6 Q2 E# J/ Q" v6 w( A" o
'{$ElementUpgrade}', '{$ItemPierce}');");
6 U9 U6 `! n8 J( ?/ M) g3 ?}
f( L6 S: \6 N7 o8 @1 q* m6 q0 U( r& Z2 M& E9 b
}
}; ^: B5 x8 q" c8 C S1 Q. V4 S! c! y( Q5 ?" I" W
}
0 s6 l6 t6 O0 F# J! M; W1 Z# |. B! H5 H
$InitForm = InitForm();
# S7 M7 L0 Y' U; `: L$Listener = PostListener();: ~; d) J! F% i/ X c5 Y
' A- ^& E' E3 l; i/ M7 m* u$ B
?>
$ K. T+ j* n/ f: R8 U# U9 x$ y* c2 d# f) x; J
9 L" t7 _( V1 e# R
( g0 w3 H% Y: I2 T) o
, ~ {. \9 w8 V! N( Q
|
|