|
|
<?php
$ E8 i S1 m* l i. Lfunction Connect () {
5 \1 t2 B4 y9 M) s8 B4 P0 X& E, r/ g7 imssql_connect('Server','UserName','Password') or die('Error: Connection to DB 1 X8 }; d) D( h9 @' I8 _! F/ m% K
6 k, R& C8 v j1 K
Failed.');4 f5 N* t- F/ L! a, V" }* A4 u7 c
}2 l( }: Q) K- a3 l3 q+ V" L
Connect();% h, b( @0 h$ ?& Z- P. L
9 g8 L$ Y) K$ ofunction InitForm(){
( d, H: c8 n- h" _6 n//layout for the form
# ~8 r( ^* E ]+ k8 Q% qecho "<strong>Send Items.</strong>
6 j+ ~: S1 y( x1 }* j" R: K<form name='select' method='post'>
) v6 k, m- u8 J- q# ^2 \; g, X0 |<lable>Character Name</lable><br/>2 @' N7 F. a2 s+ i: `
<input type='text' name='char'/><br/>
6 j: ?* {8 P! _4 R7 l1 ?5 |9 B<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
5 L. p T8 H- |: V# F( I* {<input type='text' name='item_name'/><br/>2 S" u# z# |/ a' g
<lable>Item Amount</lable><br/>+ h) f- D7 U- E1 c( F
<input type='text' name='item_amount'/><br/>
4 J4 q4 k$ f5 K6 E! f" f<lable>Item Upgrade Amount</lable><br/>$ r! J, r' q# B4 q0 }6 z
<input type='text' name='item_upgrade'/><br/>, I1 P. ~1 |6 q6 y6 y/ V
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.). j3 s& G& I$ N
! ^+ H' B0 P1 Q, _</lable><br/>0 [" e& r$ I4 L6 d- Y. t9 e
<input type='text' name='item_element'/><br/>( o% |' G' S6 o; F" ?2 e* q
<lable>Element Upgrade Amount</lable><br/>
8 _- e1 A3 v& j<input type='text' name='element_upgrade'/><br/>1 c! Q$ | t7 |% F
<lable>Pierced Amount</lable><br/>
. ~3 `: i2 s$ K; j* W' j9 N<input type='text' name='item_pierce'/><br/>
( ]+ t( o4 E3 r( k/ e' q<input type='submit'/>$ { L! X8 X" b. p- S. ?
</form>";
% y( j4 l1 k2 h$ r/ ~/ T}: p2 T$ v" y5 r; l# m2 ?
' d2 q: G* _ b7 o; W, s
function PostListener (){
% d2 l- K( i6 }+ X# W6 x8 A' y- P& I//Add more post variables if needed and add them to initform() function aswell+ f4 j x8 I1 |. q! C' A+ A& q
0 h0 y9 w/ }1 G) p' [################################0 F: L8 E; [4 g9 |8 M& z
##### Connection and Post ######
" [& C) Y# M/ }# W6 S+ Q################################) Y$ ?$ R7 d% Z3 Y
$name = @$_POST['char'];+ }/ V, ^7 }1 `3 F7 K" `) d: J
$ItemName = @$_POST['item_name'];( A+ |, Z" y/ X5 s8 Y
$ItemAmount = @$_POST['item_amount'];9 h* O) X; b( A* |! V
$ItemId = @$_POST['item_id'];
7 n) M6 W9 Z- H2 z! U7 D$ItemUpgrade = @$_POST['item_upgrade'];
( T7 ]" T1 I+ y# f$ItemElement = @$_POST['item_element'];
) w6 f3 }5 k& r$ElementUpgrade = @$_POST['element_upgrade'];4 T* d7 b# C2 E$ b) | b
$ItemPierce = @$_POST['item_pierce'];# r" a, g2 O% K: j1 n( P# T1 u0 S
################################
- C6 P; A. i! W! b) V, r O7 y: O) E. e
//Check both variables for empty value
5 F, @) T+ q# ?6 c) p9 e
5 w/ J( z1 {$ }1 Xif (!empty($_POST['char'])){
$ p2 \8 U3 P. z7 d+ N* _& `7 h9 z$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
, M9 Y; K3 g: D+ W4 G7 J: b
% ]* K8 n# n0 z! G* p3 u/ {m_szName = '{$name}'");) N; |# n% u. {8 @6 H9 ]: T
while ($row = mssql_fetch_object($find)){4 ?) ~" H9 l/ E/ f& D
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";, ~, L7 W( V- `6 J
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
# h* e( d9 P5 n( _) S3 G4 ~( w# v$ z0 r4 \! t
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
, E$ c3 @* x: ]* I6 a9 Z! X2 c
% z7 ^4 z; ~, e6 Q8 _[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', & X3 \! q0 y5 h& b. V/ }
+ u* w5 F! W$ k1 r, q6 m1 ?3 W
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 ^* B. b. }3 B# `# N$ d" i% M. j+ b; `: l) F7 H. W. v0 W, Q/ [
'{$ElementUpgrade}', '{$ItemPierce}');");
' |" |# F% e- _. V. U! E}
+ S# T8 ]" j5 h* ]6 d5 f5 \$ G4 Z8 o+ R) w, {* @2 O
}
% j N4 y- T( l( m9 P1 {/ c& p+ i2 n& m* N7 e; M5 c
}: t% ` W9 a6 E! [: x5 ~
5 D" ?3 a0 I- x) P& H) R1 t8 c" u$InitForm = InitForm(); h- x7 F+ A" G( T
$Listener = PostListener();! S1 I1 o- @) M$ ?3 u
; P$ {; W1 h8 a. Z" L: f
?>" R+ { A6 B3 l( ]
2 Z5 `# S" E7 q6 a
7 _5 ^5 T' h, k. Q8 k [& N0 N' {( N, b- W. T, C _
* c5 U2 P' q8 ~ |
|