|
|
<?php7 \4 \3 T, d! g4 V
function Connect () {% ^3 [7 X: _# B5 }: D: |: B8 V
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB ) j+ {% D; N" d6 p$ H& w) m$ l7 K
d# Z( N5 O6 ]. K! O MFailed.');% {6 E3 H* ?% {# b8 v' _2 ^3 y
}
8 t7 F6 X5 n) _, NConnect();
2 p4 {2 S4 n4 m4 W: H. D% g! V: a7 b0 `- {' G( A. _& h( r/ {
function InitForm(){
4 e: C6 |2 D# q+ V ^" I9 o2 y//layout for the form9 O6 |; }! \- u9 ?" G
echo "<strong>Send Items.</strong>
6 a" W# Y. j z, n5 g/ V<form name='select' method='post'>
2 V! b4 E; y* U4 ?<lable>Character Name</lable><br/>" U/ w! X) e! k4 a! `
<input type='text' name='char'/><br/>
2 `2 B) y( a7 o<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
( M; N3 t2 j$ p# }8 ~<input type='text' name='item_name'/><br/>
/ [/ \4 E; e, S" Y: i! g<lable>Item Amount</lable><br/>
" ~+ D( X2 L+ q" K0 m, D; n<input type='text' name='item_amount'/><br/>2 g6 r5 E3 {4 {/ r7 e
<lable>Item Upgrade Amount</lable><br/>6 l3 x1 @8 M# [+ P
<input type='text' name='item_upgrade'/><br/>
& _& s o! B' Z( X% e<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
7 n) b/ R, w, _/ M {' g* {. {
</lable><br/>, r8 [/ @* t# O1 Y# v
<input type='text' name='item_element'/><br/>4 a* B2 Z; \8 V& i% O% ~5 Y
<lable>Element Upgrade Amount</lable><br/>* }1 T0 n4 i) W8 J5 |/ G
<input type='text' name='element_upgrade'/><br/>
( i+ x+ @$ n5 G* \0 h<lable>Pierced Amount</lable><br/>
! W% o/ ^: H9 s- a5 S3 s! i/ |<input type='text' name='item_pierce'/><br/>
5 ~5 ?8 L" b) I& x, m; J' W<input type='submit'/>
9 x; x1 ^3 W9 w2 P6 w</form>";
" \' t \ ^1 w- c# ?6 K }0 Y3 H}
* D' \3 ?/ S: |, \/ }5 N
/ k" X& k3 B+ E8 Wfunction PostListener (){
& C7 y* s+ u& a* r4 Z0 V+ \//Add more post variables if needed and add them to initform() function aswell; J$ q0 k* g% H, N# w, A# g
2 _9 H3 p( t/ p! w; x
################################0 f1 ^$ C8 b7 Z
##### Connection and Post ######
9 q+ n5 x9 u& i( m: T0 }################################1 r! R5 C% P G/ U, ~
$name = @$_POST['char'];4 T# O5 j+ K2 `8 X$ h, r; N" k% q' ~
$ItemName = @$_POST['item_name'];
& `. q3 A8 g6 X8 e$ u/ Z$ItemAmount = @$_POST['item_amount'];
- e6 n$ e) `# n2 g0 d! K$ItemId = @$_POST['item_id'];3 m9 _8 ~* H: W! c" L0 `* D
$ItemUpgrade = @$_POST['item_upgrade'];$ Z7 ~/ x! ^7 O7 z
$ItemElement = @$_POST['item_element'];( [9 [ h) `2 ?" ]
$ElementUpgrade = @$_POST['element_upgrade'];3 d+ \& U9 V# F* Y& a' W" E
$ItemPierce = @$_POST['item_pierce'];
$ V& e- w7 P9 R( a1 R) c& J, y################################/ F. w* k8 F+ [! i+ U/ H1 b
2 q0 g+ W" V c$ v8 e
//Check both variables for empty value5 u+ _; s @7 @9 I8 C
# [7 @' ~; s: z
if (!empty($_POST['char'])){2 j/ b r" L- g' d1 x9 `
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
8 U0 c- q$ U( b5 Z. E" ^" ^) }; m9 n- G9 `' x8 ?
m_szName = '{$name}'");1 k- @- s5 b, E) h) O
while ($row = mssql_fetch_object($find)){/ ?+ ^$ M4 N$ A/ A8 N6 {" h
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 X5 b+ Y3 z6 b$ g/ T
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
/ J% l! v3 h1 k+ p
. S- c/ w8 s# ]7 V[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
9 e" e6 v* O; C! p% ~. G2 d( p2 n, \' l. Y% X2 j: e+ Q
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
" g4 y, p5 m* @, O! p/ N3 j4 {4 M0 K* t2 P3 D
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 Q& D4 s7 w# y( V
% d9 }( R+ W# V0 M+ G! k {
'{$ElementUpgrade}', '{$ItemPierce}');");; K) d- ]/ Q9 z) E1 q6 g
}
" q' p7 F* b. F3 z
. \/ E, W" z) ?' T2 Q! _4 f}+ Q, D# v# r2 K) Y: t. l5 S, r% k
! b0 O7 o7 m( f& @4 e5 y}0 J6 O# z- [' ]- h, E! \) Z
/ ? `; I* w9 u7 E7 C) Q! c$InitForm = InitForm();( v- Z% O% z) H" `3 _
$Listener = PostListener();
" s7 R: m8 M& S" U5 F' o+ A, J. w; \
6 \& j/ l9 r+ Q! x" d& O?>5 r% ^& F5 j% g5 r! D2 ]
0 X! w" e1 s* Y
6 x8 X+ D7 M( A* c, T$ s- F9 c" f1 E
* N# ~) z* d! r% \ |
|