|
<?php
/ Z5 ~0 J. z0 v8 |function Connect () {
8 `9 _8 i9 x. ~7 |% {mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
3 E; x7 v: z; q" p1 d# r. U; x/ G/ W, {9 e/ [) u% D2 w, U
Failed.');
& ?9 M, }2 t2 X}/ S# d1 @$ T5 M; b, u" A* A6 c
Connect();
; h3 p) c Z: x9 X A0 a4 M" L1 `* Q& C' y4 ?# D0 T
function InitForm(){
6 x! ?1 R; x( a; I7 Y//layout for the form
7 G3 H7 u: D4 h8 [9 Hecho "<strong>Send Items.</strong>
1 c# o" |: x+ i8 Z& F<form name='select' method='post'>
! Y* s! r- _& N1 q+ u5 u* B( c<lable>Character Name</lable><br/># ^ a; X X9 g3 V. [# P
<input type='text' name='char'/><br/>
8 `8 D& a$ |8 Y# ~<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>9 T6 H: @8 ?7 [: }( G
<input type='text' name='item_name'/><br/>; h: v- v' g( H, r! W) @
<lable>Item Amount</lable><br/>; |9 P; B3 w. \! g/ e
<input type='text' name='item_amount'/><br/>
% F/ c( x# H2 ?' c<lable>Item Upgrade Amount</lable><br/>
, b4 o. t0 R# ~- Y<input type='text' name='item_upgrade'/><br/>
$ ~% m2 J \. L& b% C0 O<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)! S6 G! n6 x; ^
& u7 w1 T' E* }9 `( E/ }! t" H
</lable><br/>
2 A( e/ o Q( j. P B9 ^<input type='text' name='item_element'/><br/>- n4 u- G& i* ~4 T
<lable>Element Upgrade Amount</lable><br/>
7 z' t$ B2 X" |! M) t: z<input type='text' name='element_upgrade'/><br/>5 |' d1 f& \) w8 K4 ]) v
<lable>Pierced Amount</lable><br/>
7 ~: Z! e" p: g+ h. \' X# D<input type='text' name='item_pierce'/><br/>! P* d% Z# g3 n1 f
<input type='submit'/>4 v" D9 ~. M1 o4 |! H# H
</form>";7 N# o6 \' \: a$ }5 p$ w6 F& X1 _
}7 [) r* F2 E- t' {
+ W) B# w, W! Ofunction PostListener (){1 R7 j8 _5 I$ i
//Add more post variables if needed and add them to initform() function aswell
& H8 J S4 V% q6 ]( k) B1 `) J
2 ]$ x1 `- \% p) x$ T2 \5 _0 ]/ s################################
' \# ^9 y6 @- {- S##### Connection and Post ######6 Y( m8 ~; E ]& ^, Y4 }
################################- A! u( P( }9 Z
$name = @$_POST['char'];
$ p6 R. a0 l# y' M$ItemName = @$_POST['item_name'];- K# E) u* h) Q+ H
$ItemAmount = @$_POST['item_amount'];
# R7 w! u# p0 p8 H2 d. |$ItemId = @$_POST['item_id'];
; Y4 \' R' c5 m( m8 H$ItemUpgrade = @$_POST['item_upgrade'];
2 ^# q' K# x; L2 f- @. U3 |! X$ItemElement = @$_POST['item_element'];9 C4 z3 E/ \4 I# ?4 q( x+ M! Y5 h
$ElementUpgrade = @$_POST['element_upgrade'];
' c+ e' |" `+ h% U% F( w" ?. t7 ~2 W$ItemPierce = @$_POST['item_pierce'];/ s7 `$ [: ?1 X% ?7 E
################################+ N6 ~! I3 ~- h3 u1 ]1 W
s% y0 B- Z+ K/ M5 Z//Check both variables for empty value& B" k( j( u# ~
8 L& E% I" @! d$ g2 a( Pif (!empty($_POST['char'])){) w6 r. R7 p+ h- [: i
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where " m( J! F% e9 a" q
9 |5 Q- R8 F p$ W9 q2 U
m_szName = '{$name}'");, B# [6 ?9 |; z* O
while ($row = mssql_fetch_object($find)){
2 Z5 z8 K( w" J: iecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";; f: u7 l7 Y8 `: \9 I( I8 h& \
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
8 z% Y# V1 W% I: i. Z! C. r7 }* e) Q
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], ) c% L7 X% ?, ?) |8 Q7 \
0 J( i+ M8 h/ P[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
1 n. G3 T/ B8 m
1 M( k+ S2 F R# h; TN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', . D* H) H# Z: K2 E
7 F. R; w2 W+ `( s8 J'{$ElementUpgrade}', '{$ItemPierce}');");& J% B6 E" H( g( L! R. m: u3 r
}- X: E' W y8 r/ K- P* J! d, ^
+ D3 u% L. X: q0 `; C- Z& O# G) ?
}$ Z y* V' i8 W
6 U# ?4 t, l4 n}
% O8 U5 R/ I7 E/ W5 _+ t
- ^ q( o i8 q% a7 }% w$InitForm = InitForm();" u5 \ l! r5 S* | x0 f
$Listener = PostListener();
! O1 m' A; O& z% j3 K* @+ A7 O% |. \" Z- _6 E8 D( L
?>' s$ @4 {1 J$ z
3 F& l7 t0 D: E1 K3 ]. m2 l d0 P6 G( F/ G; w
+ k8 U* B3 J! G2 @- x* H" s" x/ Q N& r
|
|