|
|
<?php
: w3 P2 \5 o4 R: r, w% gfunction Connect () {# Y! y2 m8 U' v! U. x* p
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
$ k7 j) G1 U0 J& |, c" e; O$ ]
9 Q6 Q- C* C5 E* o; j n( n0 eFailed.');8 O t, R* T; U( w
}$ j. c$ f- p/ _, S) ^
Connect();
+ c: v+ p& u1 S: \$ Y3 @, I3 X1 G* v
function InitForm(){ V% n# z2 r. Q6 Q5 G
//layout for the form* M) |& s9 o- G) j+ \
echo "<strong>Send Items.</strong>" G* \" w/ L$ {% r. d, E, {
<form name='select' method='post'>% {2 z# r4 a; @' l- o+ v! S- J
<lable>Character Name</lable><br/>
9 c* q, h* p6 u3 R) t<input type='text' name='char'/><br/>
4 H. m! K5 l) J' t<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>6 b/ }7 u/ a" B# r% P1 O/ ] v1 u
<input type='text' name='item_name'/><br/>
- M2 _. `6 ?. b f/ a/ q, O T<lable>Item Amount</lable><br/>; t( P9 e# n E' w5 y
<input type='text' name='item_amount'/><br/>
5 c" y& q8 w, s<lable>Item Upgrade Amount</lable><br/>
+ h9 I; ?) G0 J. ^<input type='text' name='item_upgrade'/><br/>7 _/ ^! N) I8 F' K. w2 c
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
4 u- z# \: `5 h# V* h
: t5 b3 w% }; G# ~9 x, q7 ~1 B</lable><br/>$ Z$ u4 o! [6 W) P
<input type='text' name='item_element'/><br/>% W9 Y! X8 @: ~3 Z& p
<lable>Element Upgrade Amount</lable><br/>2 d/ x/ C1 H8 U: I# d1 V" ^
<input type='text' name='element_upgrade'/><br/>7 q5 d% m7 A2 e; k$ U: }' S
<lable>Pierced Amount</lable><br/>+ S* q* c/ m X" W
<input type='text' name='item_pierce'/><br/>
" t6 B3 V- l+ k! W8 |# ?<input type='submit'/>& h# C+ ]- y# B. d- m4 L t
</form>";
: L9 m3 j! _0 p+ v L- f1 L9 R}! `& e3 \( V8 _& ^$ G
5 M8 X" S7 `, s; Z4 ]% rfunction PostListener (){/ F; [: c1 W6 @4 L/ ^
//Add more post variables if needed and add them to initform() function aswell
9 n/ ?4 u* f. c
) R# j+ K' o R6 L) b################################ o+ N% |4 y2 }( T$ B) C
##### Connection and Post ######
" K& C. V" C9 g+ J9 s################################
6 t! n# B3 N# o, u* [ X' b2 Q U$name = @$_POST['char'];
2 [& z/ n( l5 S: ~7 [$ItemName = @$_POST['item_name'];
+ D$ p0 q- g5 Z$ItemAmount = @$_POST['item_amount'];
7 h# W. d" Y6 b3 c; V# W) a2 _: S7 x4 c$ItemId = @$_POST['item_id'];9 m$ C* p7 { R8 K7 i0 t
$ItemUpgrade = @$_POST['item_upgrade'];
. P" I5 ~. `* X/ e" G. H i1 w! x$ItemElement = @$_POST['item_element'];
9 d+ X; ]5 n8 ]! p$ElementUpgrade = @$_POST['element_upgrade'];
+ [- ?; s' C% g9 P2 t: U" i9 j$ItemPierce = @$_POST['item_pierce'];
! n, c) y& M( ?, b################################, v" j0 Y. \2 q
2 L- M* f1 w/ p, |+ h8 J//Check both variables for empty value% K6 f: E, k. {# y: l4 f
& G% H v3 ~; |if (!empty($_POST['char'])){- W, W, \7 K. V5 V+ H( N2 P
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 W1 t# |2 Q& h! S9 m F
g u' W3 k' {* W/ R" R& Q9 F
m_szName = '{$name}'");& O8 t% a' B/ V6 H2 n2 M, q' x
while ($row = mssql_fetch_object($find)){: R- ^/ j2 X; p0 i. h$ k# d
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";, A$ |7 p9 ~, h
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
0 u" | w J! c
/ O z. s. m& w$ G[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 1 z" ` Z6 [- `: O+ u9 X7 t9 W2 S0 z
7 V7 [) ?9 ]+ @) Y L
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 Z' |+ @% ?+ ?5 V' D# i0 I
* u8 U% I2 n: Y/ J9 U% a7 AN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
; b+ T! O5 U" e' S9 b
- V7 h# \$ g3 E" t0 {'{$ElementUpgrade}', '{$ItemPierce}');");
' P) Y4 Q3 h" Q- K}
) |- J8 J, P* E
& f& ^3 I; @7 C* R! I) V m% s}& v. M7 a: s. ` W
' k% N! k# e9 O) Q( D9 I( j
}
& `. t. f4 v# I2 A0 z
, q0 ]. ^( K8 W; J$InitForm = InitForm();* V0 @, c" ?' j" W
$Listener = PostListener();0 [1 a/ S5 C1 [& m
% {" \7 r) h1 i$ K. l7 _" A. L
?>, A3 P" K& [5 A( t
) B9 C$ j- G9 p$ d& k$ J k' @) b9 t& J: @7 z/ d
9 ]. \5 z% v0 Q3 A: I# h! N7 u2 M" T9 f+ ~4 z( q0 V0 p' Q
|
|