|
|
<?php$ Z2 k0 r5 O' v5 P8 r P
function Connect () {
3 P! g+ t; Z' ]6 ~mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
" _% F% v- A% u, U! i$ F+ q
' C" R$ K9 l9 \4 J5 g) F: Q5 TFailed.');
+ Y+ c( x6 Q+ b}
4 z5 F7 }: w2 q5 Z' c" D: AConnect();" A1 l- K) F G( U2 N, }
5 C( N8 I9 [& X2 Z# @$ W9 `/ J
function InitForm(){. O0 Y; _+ [3 h; }8 y
//layout for the form
4 o; I0 k; z1 zecho "<strong>Send Items.</strong>. q4 b0 y3 |5 J! S( O; V
<form name='select' method='post'>
& E+ X a# d. ]" t7 G<lable>Character Name</lable><br/>
- g( q8 R7 t3 J/ a) i* ]<input type='text' name='char'/><br/>
% c$ h d/ A7 i! o<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>' R: t$ x7 q/ n( ^+ p, y
<input type='text' name='item_name'/><br/>7 [7 ~' m4 T- K. e: d
<lable>Item Amount</lable><br/>' |( B: a$ D" G7 K- p+ M2 E
<input type='text' name='item_amount'/><br/>
5 v: j- `: d9 ?6 j3 ?" m6 H<lable>Item Upgrade Amount</lable><br/>6 H& z) E" |1 Y( J( D6 U% y9 B
<input type='text' name='item_upgrade'/><br/>, ^2 M% h8 x. Z7 n3 r( w! u
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
& F% C" Z0 _8 s! o5 D5 A" u3 U9 s9 n7 ?% U6 [
</lable><br/># i7 i/ V8 p( w$ V! L$ G z
<input type='text' name='item_element'/><br/>: P! F& {3 l1 `; n/ B6 [
<lable>Element Upgrade Amount</lable><br/>
; q% X- C8 l1 c<input type='text' name='element_upgrade'/><br/>8 J* Q2 P4 s: W& S
<lable>Pierced Amount</lable><br/>
, `& d" }3 X2 C) a) o$ Q<input type='text' name='item_pierce'/><br/> p7 E2 z/ B* Y2 c' u+ O8 I
<input type='submit'/>
9 m" v: s& k- U$ @' Z</form>";
}6 ~5 U3 o1 `, s}
, C9 p+ J3 H. H: A: E( _; B$ K! y* S( {4 A, e) q$ |1 [
function PostListener (){
# |8 s# B7 ]5 X) p//Add more post variables if needed and add them to initform() function aswell
! c* J1 b! h, o' ~; o8 U
, ]6 }# m! M; @( I################################7 h$ Z+ I0 w8 o$ ?: C8 Q% T
##### Connection and Post ######
0 N4 |0 [; w( a1 p7 Q1 A################################! l) H/ X3 M3 v- {& l, n
$name = @$_POST['char'];
' h Z; r, `* r+ y1 R$ItemName = @$_POST['item_name'];- f5 U, x. N9 T+ S4 i
$ItemAmount = @$_POST['item_amount'];2 i [: [( g8 N% l. Q: d- @3 |
$ItemId = @$_POST['item_id'];( @ Q; l- S6 Y+ S
$ItemUpgrade = @$_POST['item_upgrade'];
/ G6 C5 a% j0 ~8 ?7 E: Z6 M$ItemElement = @$_POST['item_element'];
' g$ V; M( q) A/ L3 e$ElementUpgrade = @$_POST['element_upgrade'];
7 ` s' z2 ?# U! X8 M0 \/ d$ItemPierce = @$_POST['item_pierce'];
' G8 A, f$ P- I: \ A8 F: J g################################3 n. ]4 o) _% ]
e9 d0 X( ^# g1 f2 Y. o, {* Z
//Check both variables for empty value( R4 k% [ ]. C, w# d
/ H6 r8 T5 c2 _$ f% ~( u" _( `4 Cif (!empty($_POST['char'])){
" b! I! W0 M7 B5 b. r% }, l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 8 {. C7 z: H: E8 t4 }! ^
! w/ m! Z: K. }6 n% U2 \' r
m_szName = '{$name}'");; ]9 i; Y) e; A0 B6 p A8 e
while ($row = mssql_fetch_object($find)){
) \+ @) C! c2 m( U# F1 O2 ~" Secho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";; h2 G" G( O" T' E5 v! Q3 ^
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
" |6 M! n- K8 A! G
) E* ~- }' l6 M/ r1 _[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
; a* q1 H" n- K' I2 A4 V. `; [! w. X( q
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ) _+ a' O# z3 B8 j2 J
; u8 i, Y" I* l2 p$ H
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
0 v7 ~% e5 i% [5 }/ X6 {0 L u. p ?, J) a" ]) e9 s
'{$ElementUpgrade}', '{$ItemPierce}');");
5 \( x/ i' O3 S6 x# f$ ^} B4 P* L g, z0 c
5 E* G# B b, l( l* U q. s, p* a
}
" w+ j* e3 S4 n) N3 _. D% s% r A- s9 e; `1 P4 D
}
' J. H: u8 L( f0 n7 j/ H/ X. e+ l2 S/ l
$InitForm = InitForm();
6 N2 D' ~7 |+ B! [$Listener = PostListener();
( r& Y$ B0 D4 G, [, x! L1 s: M0 Y
?>
; y0 ?7 ~9 G. Q' u# q5 D
- W' }1 g; i5 P3 }0 p1 L6 x k! q2 ?8 l
7 ]" v& X$ }1 q: \$ U+ B- H4 m4 }
" R' {& A& v, G. j# d# u% C |
|