|
|
<?php
3 m9 C. J6 [1 ~- _function Connect () {
; O$ K7 m! H# x/ o3 J" j1 pmssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) v3 X) ~) I5 G* }
. G* u& g! w5 k/ W0 ZFailed.');
1 `7 \" e! S' ^5 r: N, }}6 \3 k8 G2 l! l( p# U* U
Connect();9 D5 u% `2 h: z* p5 H6 Y! z8 C
5 C( Q6 _& e4 k) K5 F4 L% u
function InitForm(){/ Z, B# T8 A7 |
//layout for the form
' q/ I. {/ f& ?5 u9 t: uecho "<strong>Send Items.</strong>" |8 M/ y8 D6 V6 W
<form name='select' method='post'>
& Z1 l( s' H1 l: h<lable>Character Name</lable><br/>; M5 K' T* X$ M& z( Q: O
<input type='text' name='char'/><br/>% T8 I6 K0 u y( B
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>; u' A5 O6 |$ j3 D4 r! ~1 M
<input type='text' name='item_name'/><br/>2 f, F; X9 n- {9 M) l
<lable>Item Amount</lable><br/>
6 Q3 j G2 z5 y$ k# B<input type='text' name='item_amount'/><br/>
" D% X- B4 Q) D O$ c<lable>Item Upgrade Amount</lable><br/>
* D8 k1 _' C: Z. {; g<input type='text' name='item_upgrade'/><br/>' ]% I3 S3 a5 h1 D: R8 a7 {
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.); @% J' _0 @5 m, G+ u+ |- \
( {+ D4 b$ E \: n" r7 j</lable><br/>
% u+ x+ L6 Z5 F& f8 y<input type='text' name='item_element'/><br/>& D! H+ K7 F' i7 z- }8 |! N
<lable>Element Upgrade Amount</lable><br/>
; H: ^( l# j3 n<input type='text' name='element_upgrade'/><br/>
2 v6 B5 p7 n2 F' f' |, [8 z: F6 e<lable>Pierced Amount</lable><br/> |! Q1 ?: p) i q, u
<input type='text' name='item_pierce'/><br/>/ A! @- W7 _" v( g5 q
<input type='submit'/>
/ j8 W1 l2 c. i</form>";
0 J2 H1 ]6 i: `8 M; X. h}) |0 K J: b* m7 ]3 ~
% ~1 j- M* e5 f* j% Y) q* rfunction PostListener (){4 y! m" Q( S& A$ F# ?) h* x, [+ \
//Add more post variables if needed and add them to initform() function aswell4 ]8 ~ K% _( T! W( z$ d( x
* `. V2 p7 r2 c% s! z2 L: c. ~
################################
& ?( t( `5 B2 z, n3 W0 ?3 _##### Connection and Post ######% @- D: }% q Q% x- C8 u6 Q) A; M) y
################################
* m2 F+ Z' y$ a: W; b; |2 \$name = @$_POST['char'];
8 |3 w* k2 X( y4 O$ItemName = @$_POST['item_name'];" H# ?( x- b3 l! ~- Y/ Q9 Y
$ItemAmount = @$_POST['item_amount'];6 K: n. }" V$ x: \3 h: G* s/ a
$ItemId = @$_POST['item_id'];
4 c, e# R8 ?- ^9 `7 T$ItemUpgrade = @$_POST['item_upgrade'];) N3 ]8 o9 d$ M0 \" c
$ItemElement = @$_POST['item_element'];
$ y' \* r$ A) k. F9 i% s" a/ n$ElementUpgrade = @$_POST['element_upgrade'];
9 y. m" `/ e. _4 Q- Q5 A$ItemPierce = @$_POST['item_pierce'];/ ?6 y1 ?( K2 z0 |
################################! U5 N7 Y* Q- N* G7 @" \
3 q) ]; H' o8 p% _3 z9 T, _. K4 q# y
//Check both variables for empty value ?! ~: ?; W9 b
2 b: ]' z/ |6 Z! Y1 s2 yif (!empty($_POST['char'])){
8 M8 G( }9 b5 c5 i3 X0 T$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
# `/ ^5 }1 j$ |/ n; {1 V/ T) z
* }9 \6 l0 U9 @4 J: y' j' r7 \7 D" Z1 e" qm_szName = '{$name}'");3 I$ V" P7 \/ c5 N% [
while ($row = mssql_fetch_object($find)){
$ z6 }' _$ ~( A; v% O5 decho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
$ |( N3 z; K; `. o) F, g$ F8 R$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
( S3 A" w. Q9 X: {( ^4 o6 A& s0 G; @
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
) V0 H( O% ]* f" W) Y$ M0 w( S8 M0 U0 }9 L
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 r" k. v7 F; H' p+ E
, Y& ]0 _( [" CN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
2 M5 n! ~5 i4 J h( E4 Q) v# c4 Z8 Y1 A7 {7 F$ C: n8 C
'{$ElementUpgrade}', '{$ItemPierce}');");7 F* D2 Y9 X4 Y
}; h" U& J8 z6 g
+ M2 T# X. o! ]& u; _
}( g* v* k. q! \. t% o
3 o& o2 H' N: d1 A, U( c}
' G& u7 n$ \* A' ~. A# t J, V! L2 f0 p: o& d3 }) J! h2 y( J
$InitForm = InitForm();
6 Z' l7 a& P* _7 m$Listener = PostListener();
& ~( K% {! e4 V$ y7 l+ F8 G
( G/ ~% O7 i$ C6 B! M' E1 V* e' U# {8 b' Y?>
8 \ v! u/ O& k+ R2 [; U) \
7 a' s* b: @: E2 u- O, L2 X+ }4 d; ]) w9 ~2 T( F. T
/ _: f9 O N; e3 T' s1 [
# G; S3 i4 |* g |
|