|
|
<?php. [8 T4 m& ^; j" |
function Connect () {
; ?" P3 c/ y" ]1 ]% D; {" X& F$ Umssql_connect('Server','UserName','Password') or die('Error: Connection to DB
2 [2 X/ {" A' d' ]; s T
`8 q6 Z# Q- q+ z5 kFailed.');
6 d& H$ V9 w! r0 h}
3 R# e# y! P9 b2 a2 WConnect();
* H& \2 V! v, d! E% T! `
, B! G+ m7 [3 |8 Q! r! ^( g! cfunction InitForm(){
. m+ A) h3 }" }" y//layout for the form$ l3 s3 U { `8 x& U
echo "<strong>Send Items.</strong>
6 r9 e c$ Q @% u6 U1 i) g; t<form name='select' method='post'>
, ~/ ^( h+ I7 `4 b% J/ m# p1 L<lable>Character Name</lable><br/>4 ~7 |1 @% M7 V% J
<input type='text' name='char'/><br/> }+ s$ O3 c* A6 s; a/ R% N6 K9 R
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>/ n1 H+ |* [9 Q! }
<input type='text' name='item_name'/><br/>' @' w$ V! V5 Y7 S
<lable>Item Amount</lable><br/>1 M0 [' w t' q
<input type='text' name='item_amount'/><br/>% l9 s# ~* u' o7 M
<lable>Item Upgrade Amount</lable><br/>" ^. i$ O M+ ^1 }/ M- B& A
<input type='text' name='item_upgrade'/><br/>' T! x6 O* r4 |& f
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)+ L9 @' x/ u: k: Q" u- ~; c. O
* j2 B; q* L7 `0 c( X. h</lable><br/>
- W2 k& |' P& T' V; N<input type='text' name='item_element'/><br/>
# Q9 W5 @/ a+ ~) B: S3 I7 K<lable>Element Upgrade Amount</lable><br/> o2 e! Q0 m/ L; q" l# `
<input type='text' name='element_upgrade'/><br/>
' ?+ D( R6 s" r- E<lable>Pierced Amount</lable><br/>
) Q# [/ ~4 E% Q( W/ d<input type='text' name='item_pierce'/><br/>
! Q9 b) ~' \/ R<input type='submit'/>
$ r+ `' [9 c$ v1 D1 w; Y) Z</form>";
+ @' f% j( `; s; `5 x& c; U' D}
) `# ` d2 I( l
/ ~4 G( W- l( X) M% @function PostListener (){' C+ S# W1 y. E" y
//Add more post variables if needed and add them to initform() function aswell
+ R) F+ T* v) W! {) f* I- f0 h& O3 B# m3 } k* M% ]( U
################################
- ^0 Q4 J4 D6 ^##### Connection and Post ######
! B; i0 y3 m- M) H################################* ^0 u0 e3 s- m! N V+ [1 y$ U
$name = @$_POST['char'];
) t/ F% O1 z# K8 L7 X# P6 e8 w$ItemName = @$_POST['item_name'];1 O: [. \2 G/ \3 T
$ItemAmount = @$_POST['item_amount'];
O6 k6 \9 U: l+ S$ItemId = @$_POST['item_id'];
5 ^8 I" n" j# T" y1 s* f$ItemUpgrade = @$_POST['item_upgrade'];
' o- D% V) N" e7 Q: X1 Y/ b$ItemElement = @$_POST['item_element'];
' @ h) @' C9 n, H- p, f$ElementUpgrade = @$_POST['element_upgrade'];
; G; V$ Z% J" y9 l* M1 H$ItemPierce = @$_POST['item_pierce'];
2 X6 f. n4 k- y0 M$ S################################
( a$ P' A& H/ n- h! s* M' B0 _0 D* V7 C" i! ?* @2 t
//Check both variables for empty value
( W* j5 G) N7 L! o2 p
) N% o8 Z' N z s* ]1 @! \; A8 oif (!empty($_POST['char'])){& l3 U j- g* Y- S
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 9 L W4 Z$ \5 D# I% h
& D) i5 z ?' \
m_szName = '{$name}'");9 V; O, g& y7 ^* H6 B
while ($row = mssql_fetch_object($find)){
0 i2 V7 \# i2 n8 R( x4 `# Recho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";8 K( {+ s8 A9 V$ {9 b
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], ( J& v8 J* k7 h/ l4 w1 y4 g' O, A
2 h1 e* J1 e) G6 H/ c- {7 R: b8 w[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 7 K7 {6 n& m+ i4 u& H2 u& f- ?
0 C; h: V4 l4 i8 C9 g" G9 b) U* `' Y. P
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ? x, X6 q; |
N& g, W: r \& \8 V" ON'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
' C4 E7 O; T; e1 y" f% a
; j6 U' i9 x: K: N* Q! ]'{$ElementUpgrade}', '{$ItemPierce}');");
! Y) }1 X# V- O# ~' ^}" J, e8 y8 Q% o0 |; t
* |$ ]$ H; q+ i}
, J/ L$ c( C. [ U) a& a' ?" ^
- l0 ?% Q3 B) x}
/ c2 p" Z& l0 `, a* U
- I9 v4 N/ i) u5 T; F$InitForm = InitForm();
0 e% ]" E/ D/ K: n5 h$Listener = PostListener();
0 q9 S4 ~: r( g; L1 \- P5 i' |
( z4 y. o% C4 O9 F( c?>8 L9 B& p" G: b5 }% v
, {/ u( |% ?$ A( w6 B. m1 N* k) H
; x. O0 b( T( u! [2 H* x# V9 d9 ?# ]7 z$ ]! D. @
) K$ E, j1 t2 r) g9 m1 j |
|