|
|
<?php5 Y( w3 e1 C. \1 R" H
function Connect () {
8 D' p* O+ _8 [# m( W; {: Umssql_connect('Server','UserName','Password') or die('Error: Connection to DB
/ |2 e$ z" O: ` y. t% p) R
" ^8 f' S# G) R1 EFailed.');- C+ m9 d1 Q( A+ v
}$ u* Q- K, M2 i C" n8 P
Connect();
+ k# d! v. V+ s4 [/ Y6 g/ j6 x" z. k; D; o# D0 q5 k: A/ Y5 j
function InitForm(){$ C! w, |5 K7 H0 ~' @8 F
//layout for the form( Y# Z* r3 b( K" n& y- x1 P
echo "<strong>Send Items.</strong>
! c% [0 r( ^. `1 w% v) ]<form name='select' method='post'>
s n; T" A8 H$ }& P0 w<lable>Character Name</lable><br/>
" c% c5 J! n& c/ [! [<input type='text' name='char'/><br/>
$ o9 x" H0 L3 C2 n( o* X<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>3 i. r; X' |* i+ Q
<input type='text' name='item_name'/><br/>
2 v3 ~4 o, p' K+ C: c+ ^<lable>Item Amount</lable><br/>
! Q/ H- t' D' ]" |5 v/ v" H- p* ]! [9 b<input type='text' name='item_amount'/><br/>
" Y% p& S, |/ Y7 b6 m) r<lable>Item Upgrade Amount</lable><br/>
" J& {$ Y! K% U8 r5 ?0 I9 c<input type='text' name='item_upgrade'/><br/>) I! ?9 X* W+ n- ~; W( ]1 p9 Z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)1 W% X5 ~) z6 w
; {! G) \1 q( _# m6 b. ~</lable><br/>
# h& d9 @8 N7 H6 L0 U2 W/ d: n. e<input type='text' name='item_element'/><br/>: p5 r7 @* S) F: L
<lable>Element Upgrade Amount</lable><br/>
! p! g: v* \& R5 A$ a2 r/ S2 }8 v/ [<input type='text' name='element_upgrade'/><br/>; D' l X' P+ i7 M' l& e
<lable>Pierced Amount</lable><br/>6 Y% {6 G g% g5 @
<input type='text' name='item_pierce'/><br/>
/ f; v9 P) K8 I- _$ u& Q1 ?<input type='submit'/>, d e( I# C" ?# r6 r
</form>";( v, \! [; Y4 Z
}
# Q: Q$ R+ `1 E2 G
. F" I% f. \2 G5 a3 afunction PostListener (){
8 K$ {. y0 G: g1 k4 [//Add more post variables if needed and add them to initform() function aswell, `1 B- D- N! L" b7 J$ h7 R7 R. s! o
8 p* R8 C" a* k( l# a% |7 L################################
8 I& Z7 C, \6 m& {. e# K5 N# ~##### Connection and Post ######
" w* V* R% s! L1 C1 R################################; X8 O$ ]& j# E
$name = @$_POST['char'];4 T7 Y2 q" t! n4 O. a: ]8 a* Q# R
$ItemName = @$_POST['item_name'];% J0 j: a% e% u
$ItemAmount = @$_POST['item_amount'];2 m- x' Z+ t6 G7 B, x0 k
$ItemId = @$_POST['item_id'];/ |! E! [4 ^4 i# |0 J! L
$ItemUpgrade = @$_POST['item_upgrade'];; D1 @1 J) Z& ^1 w( T( z1 i! k
$ItemElement = @$_POST['item_element'];
' ?8 }, C4 b" i; T: n+ K$ElementUpgrade = @$_POST['element_upgrade'];7 c' m! O& {+ ~4 D U6 Q ?* Y
$ItemPierce = @$_POST['item_pierce'];
8 L- ~* }. Z* E% U################################7 X- T# _0 H& l7 {+ C' R( R3 ]
$ b/ A1 `% V% i* c- q//Check both variables for empty value- H+ B6 N: E8 f8 L& V& g2 h
5 g3 C) W8 O; c- K) @if (!empty($_POST['char'])){
1 ^% {0 D4 ?7 v5 _; h; o$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 0 u4 P; V; a$ O( }
" H) J' k7 k+ G( C& X: Tm_szName = '{$name}'");
. h% Y! T8 i/ D. M4 ]0 a: _while ($row = mssql_fetch_object($find)){$ `5 u& `1 i7 u7 H( F
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
; z; C# D+ D7 r6 m. c9 h% r! x$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], , T# f/ I( O, Q* T+ Q
& J( ~3 g& A- i2 ^[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 1 Y& d" K3 ^2 j; J) w! N. {
" z3 \: z( [2 [2 ~
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ( ~, z2 L7 O8 X1 ]6 g. S2 k r! F4 M
5 t+ X1 A5 b/ e9 w( x8 p! ON'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
* o+ c6 _, t0 z8 Y8 N2 c, s! R0 ?. _8 s7 j7 y; W: u$ U- X9 `
'{$ElementUpgrade}', '{$ItemPierce}');");
' N: b/ u8 g0 x3 ^" F9 d/ o}; I- U! _: Q+ v& j/ j
$ e1 L- B0 f% z7 s' y3 ^}
3 F) Z, h6 N9 n2 A; H
- W% t8 S$ S4 u- _}$ l7 U; q g* s5 p2 M
+ G4 S7 w5 J) D$InitForm = InitForm();, H, g; v1 K' u" _" ?0 T
$Listener = PostListener();# ?+ g% I! N2 W& d
( _6 P9 g( W7 n9 `1 a u) r
?>. K1 D$ d. T2 X) c8 s' Q
+ @- k0 j. B5 _# g; T% Y* Z. H
" X3 B( [: \. O2 F. A
/ {) D! v, t7 T% Y, S( R1 R$ Y4 i( A4 x0 [$ J I6 Q: ?0 q
|
|