|
|
<?php0 b! Z) a/ W* b" r: h
function Connect () {
$ h/ d! ~; B0 O2 Wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB % } h, M C: v$ H2 v
6 O# ~. ?: }7 k. u7 r6 S9 _# GFailed.');( N- d2 E9 t% p6 }( M
}
7 M* t1 N# `4 z0 y2 M* X! iConnect();1 l: C8 H8 c0 C& @. `
# V8 M a* P- Q$ F; H$ s. U$ h
function InitForm(){' ]0 X) x$ b+ q# p7 O
//layout for the form" M: \/ C$ A) {9 C8 P
echo "<strong>Send Items.</strong>
7 {8 T; @- A# M+ ^4 y<form name='select' method='post'>+ r3 a% o, Y% F5 t$ I# |# ]0 N
<lable>Character Name</lable><br/>* w3 J" X! e0 S& q. c m! L
<input type='text' name='char'/><br/>
2 E: `! \; l8 V<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>; J! z& J& K) u2 V8 Y
<input type='text' name='item_name'/><br/>
* c) g: a, F$ T A, w) ]5 B<lable>Item Amount</lable><br/>+ }# E+ e E+ r" [! Z
<input type='text' name='item_amount'/><br/>
; A4 Y1 l) r" _! _7 | k<lable>Item Upgrade Amount</lable><br/>& H g7 F9 c& T$ r7 X
<input type='text' name='item_upgrade'/><br/>, \. c( ~; e; Z
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
( a6 t) }9 ]( N1 d) v# y7 w" g9 y
& O- [4 w% d- P4 r' n</lable><br/>
7 g( N- |5 z0 B<input type='text' name='item_element'/><br/>
9 H. Y2 P/ G6 L3 _' Q8 h<lable>Element Upgrade Amount</lable><br/>) f6 A0 O9 k* ]" Z3 U5 |+ m
<input type='text' name='element_upgrade'/><br/>
0 w/ v; z! w7 B' N: E6 J<lable>Pierced Amount</lable><br/>
, _/ `6 ]7 S% p5 I1 @) N! R<input type='text' name='item_pierce'/><br/>
+ H, ?" F% G1 H( _( W<input type='submit'/>
# Z+ |9 z1 ?6 U h</form>";2 ~7 |& V* n0 X
}4 Y8 ^6 F; n r; c3 p
: A. n8 F; d" H: o5 v4 vfunction PostListener (){
' K% `6 B9 ?) B/ r9 M* k$ U//Add more post variables if needed and add them to initform() function aswell( [+ F# {# \) Y* k
' ^: |+ I! S& M1 P. N* D, u
################################
' D3 F+ h. a/ Q" J##### Connection and Post ######. D" f9 p- ]. i4 Z( b
################################
0 e8 H- p' b A' R4 J. x3 N7 {7 d4 C$name = @$_POST['char'];( M5 f4 L$ k, w! N
$ItemName = @$_POST['item_name'];
7 u- J9 U& c; M$ItemAmount = @$_POST['item_amount'];" ^; U3 e) K. ^, x8 j
$ItemId = @$_POST['item_id'];* |$ [6 W; h/ s8 _$ U
$ItemUpgrade = @$_POST['item_upgrade'];5 `$ \0 R4 r: j' o" s
$ItemElement = @$_POST['item_element'];! R# w3 \1 C6 ? c
$ElementUpgrade = @$_POST['element_upgrade'];% ~8 @- g R) k
$ItemPierce = @$_POST['item_pierce'];
/ s t/ n0 k& t' }% a################################) a5 X: v0 n, T! k3 X
3 d% s& U" B; M- w//Check both variables for empty value) x/ ]6 y) d, Z
6 G- I3 _& F J! Wif (!empty($_POST['char'])){$ T# k$ }/ w" U0 e" i& o( O8 i& Y2 F
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 q% \7 b4 H0 x
& N: e* t4 P2 r: @1 |( N
m_szName = '{$name}'");
8 M4 N m) N8 F: R( Vwhile ($row = mssql_fetch_object($find)){
& t I% c: s' becho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
: {! F( m7 c4 w% A/ Q& @$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ' R7 q$ D6 z$ [1 E& j4 O& e+ d
# J x' ^9 H1 Z% E
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
) E- R6 A) ?- Z) P# ?: s* e7 f' n& ?8 k& q; X
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 5 I9 Y j. I$ @
3 j' I. I- ^/ }4 c! R) v' DN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
9 _9 W+ w6 B B4 j) n4 c
/ c, v8 D' }& t4 Y+ g'{$ElementUpgrade}', '{$ItemPierce}');");2 d5 d4 d8 \ _0 J( {6 N
}
8 b' o5 S: b1 w: w/ D! x; N: H1 U. ^& y8 E" i' i; F% h' K
}
- p+ A/ D+ W5 Q
) t/ {, d# f1 m; L/ o$ C}5 `6 j- C4 C$ }# O% i
8 y9 B3 @1 A3 y. S0 l5 t8 z$InitForm = InitForm();8 ]& U- z& } _( k4 y
$Listener = PostListener();
! ]7 w0 r5 B; X5 y6 T
2 G0 T4 s9 H, _?>
$ y& N/ T8 Y8 y. z( l: F; v" o# T0 {1 x
5 L8 G1 H3 W: j1 ~. `! g
6 q0 u" S8 T1 X" P* F6 G. M& g& K7 M' b8 [' W
|
|