|
|
<?php
$ J/ W& a, [' H: m+ F+ m4 kfunction Connect () {- y. [: ~$ ~2 {- Z6 d
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB 9 n$ z# c! m. W# c: ]. q
2 H, A( w9 u( G! O2 jFailed.');3 i! H- Y' ?* S i4 a. S9 Z
} O* t, Q4 K8 {5 ]
Connect();9 o4 Y0 @: ]* l2 g1 K/ j
5 s i$ p- E$ \! H+ c# j: qfunction InitForm(){
: L. Y2 F! m- T//layout for the form! g4 s1 y! S2 g
echo "<strong>Send Items.</strong>
( P; y8 D- C: o4 h! A<form name='select' method='post'>* v! K( T) Y, T$ \7 S
<lable>Character Name</lable><br/>
L8 W; l" O) r3 L<input type='text' name='char'/><br/>
' S0 p& T/ J* }9 R# P( a! l! S% `<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>& O2 n& v, x, i0 C/ U! ~; w6 _
<input type='text' name='item_name'/><br/>
6 i) I, e& [6 q7 U<lable>Item Amount</lable><br/>
1 ?% O1 z$ r u. O5 n+ u<input type='text' name='item_amount'/><br/>
: D9 Y E: E2 U4 e+ G, _ |<lable>Item Upgrade Amount</lable><br/>4 l, V- z1 e$ g, m) A4 s5 d6 N
<input type='text' name='item_upgrade'/><br/>% X% N$ v; [; w5 k9 j" T
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 R( q8 R3 x* g# i- L+ b& ?, r
" E) x" O1 j" G& b) P3 u
</lable><br/>8 l! ^$ p7 I" y2 L6 W
<input type='text' name='item_element'/><br/>+ e, n3 X; v5 F
<lable>Element Upgrade Amount</lable><br/>5 J: H L- @5 d9 O" W# h- x3 D
<input type='text' name='element_upgrade'/><br/>
4 G8 X6 U0 `* L+ c<lable>Pierced Amount</lable><br/>
, q+ ~) O9 F5 R) C; f1 o5 x8 ^% L9 `<input type='text' name='item_pierce'/><br/>; W" Z7 H+ e# r) T! B. A
<input type='submit'/> F; }5 u6 p+ S7 y- ~$ \$ ^# ~
</form>";
' I8 F! _- v' l1 ]7 N' @( o}
% ~' ?' s0 m$ c; R6 K% u+ k
! L" q, u( x1 sfunction PostListener (){
6 F- N& H) F% v/ ?/ d//Add more post variables if needed and add them to initform() function aswell5 C: K! u0 W7 S- j# |
; l2 d& l* h& w/ i################################& j- q7 k+ I# k2 t, T
##### Connection and Post ######5 N7 w; ~4 y; O" b
################################
2 N; g0 G. i, ?$name = @$_POST['char'];
~, b6 Q, C( r0 B. s$ItemName = @$_POST['item_name'];# \# ?8 E( ~+ Q- I0 k% b! X
$ItemAmount = @$_POST['item_amount'];
& R4 K0 }3 d/ K# K/ _$ItemId = @$_POST['item_id'];) C3 t7 B% m2 n& e2 D6 W% z
$ItemUpgrade = @$_POST['item_upgrade'];
2 _, f( `8 V6 h; D; c- b$ItemElement = @$_POST['item_element'];
% w) K! f; ]1 @- a$ElementUpgrade = @$_POST['element_upgrade'];
/ [1 |* S+ q6 N+ O; l; d, u) M. C, p- t$ItemPierce = @$_POST['item_pierce'];2 i# }9 e% j( E0 |
################################, R ~( r" \$ E
- Z2 p. l3 H1 e, k& |
//Check both variables for empty value
l d/ R2 D" c0 w" N) Q5 T" y0 ]* j# n9 t" L) C$ _
if (!empty($_POST['char'])){, Y9 ]: c9 }6 D8 e
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where + G+ Q( n l: s" s; `/ m: _: y# P4 G
* D5 Q" {* ^1 v! D& h- u0 C; o; S
m_szName = '{$name}'");
" q$ Y! Z% e9 k! d& Z8 q1 Twhile ($row = mssql_fetch_object($find)){
( ~1 s0 B% t$ \2 vecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";) U4 o8 g8 ^( x7 ?/ V: E- k
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
; Z, {) j A( |; ?. q6 o* i' h# m% }3 b* R# l+ d. k% v
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
- ~- l% Y4 ^2 j! _' c5 G4 d8 @6 n7 W/ y6 M
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', , T. x( @; s/ x. X6 q' D8 J
2 G" c, z! T' c) L6 L% U) c
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 0 Z _. B" I9 n
5 ]3 G3 F1 W# i9 C$ r! w'{$ElementUpgrade}', '{$ItemPierce}');");' |7 m# n5 {/ W$ T) f7 T
}
+ @) `2 u% e2 o$ R8 t3 X9 {
( r: O. V3 _1 h+ j! `9 {, c5 S8 [}
/ z Y0 i6 O) k( N2 ?0 `
/ ^- i! A u: {1 k$ h: h0 q; I6 y3 J}
p B! @& X9 N& A+ L: n( N
7 _4 H0 `3 Z4 u4 D4 c$InitForm = InitForm();
& O) U9 Q! ]$ ^: C4 \$ B: H M$Listener = PostListener();
+ b$ W0 r4 t* C$ Q7 K- ]) Z
) X- e& `. P' P4 H# k?>+ S; ^ a3 H1 A: @7 Q5 X r3 p$ V
! i* _& ?5 h8 L1 R
4 F* P% e: n- P. \' c- F( V3 ^1 \1 k
8 r% s1 ]7 i; l( s0 K6 g& Q) |
|
|