|
|
<?php
1 v l: E5 |1 |0 A& [function Connect () {' k* O9 m$ U: f; k$ a1 a. I- T5 f
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB + K7 w/ S; S4 g* Y, a4 ?
3 ^9 d6 j ~7 F+ @! y. A
Failed.');; h, Q, e; v% j7 [% W- e
}8 v& X% m. _$ q# t. \8 h. q( A
Connect();
$ b, ^/ w. a* N( g6 c b
2 r; m, k" T' @0 ]7 f/ s1 Dfunction InitForm(){
" \5 \. R! I* \//layout for the form
# `( ^9 {7 G) V7 e9 S& _8 Oecho "<strong>Send Items.</strong>1 }4 n3 L+ \3 X4 a
<form name='select' method='post'>; d/ P" Q" V) V
<lable>Character Name</lable><br/>8 ]1 N9 ]( Z, a! r2 v; G
<input type='text' name='char'/><br/>
/ `# m. d+ B$ w2 ~) J5 r$ r<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
7 Z) Z) k) K/ b3 `+ A2 C+ L/ ]<input type='text' name='item_name'/><br/>. W2 G& Z. X5 K
<lable>Item Amount</lable><br/> P, H B% n2 s
<input type='text' name='item_amount'/><br/>
0 B( M! M' k9 I h0 G0 n0 |<lable>Item Upgrade Amount</lable><br/>
) P$ P8 v- v" J' L+ y! N4 H+ Z1 j<input type='text' name='item_upgrade'/><br/>
6 A! Z4 a# G/ R6 f( K* p* |& z<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)7 G, k$ ^' M0 q z' \. e
! j$ n1 P. \' ]2 o, l2 D# }</lable><br/>- p. J9 a& p3 H( m
<input type='text' name='item_element'/><br/>
+ |0 ~; R8 K2 i0 C<lable>Element Upgrade Amount</lable><br/>
1 v2 J$ L5 C( Q+ ~* ?9 Q7 q<input type='text' name='element_upgrade'/><br/>
( e& _2 s& g6 h) O+ f% F) Z8 c<lable>Pierced Amount</lable><br/>9 q/ ^5 w5 K/ u: y
<input type='text' name='item_pierce'/><br/>
, I; n( O9 V# |8 e<input type='submit'/>
6 X5 q8 r9 u5 O9 P</form>";3 m5 m( ]7 E t% `) ^3 ~
}' Z0 k- E1 K2 H
; t2 L1 R7 ?8 i4 U6 m1 \ j: k4 U
function PostListener (){
R. C. E2 h! d( L//Add more post variables if needed and add them to initform() function aswell
4 }1 u" D4 `+ H3 f2 |) j' N9 o3 S( C2 ~2 h6 d6 O0 P
################################
; ?, _2 F E! y8 Z$ V##### Connection and Post ######
- M) v, @9 d! F8 J################################1 d4 n- R' p6 Q. {1 ~2 [3 r! h
$name = @$_POST['char'];
, U% b3 ^) X( X$ItemName = @$_POST['item_name'];; P. ]. E( c9 F- n
$ItemAmount = @$_POST['item_amount'];
( | f( ]: Y8 `) a) V$ItemId = @$_POST['item_id'];6 X! z2 n8 j$ B; e* }" o
$ItemUpgrade = @$_POST['item_upgrade'];
7 c* U, N9 @; k$ItemElement = @$_POST['item_element'];$ Z1 C/ Z* k g5 M8 D/ y% D
$ElementUpgrade = @$_POST['element_upgrade'];+ n- D) [4 _! h) r, S# ~: }
$ItemPierce = @$_POST['item_pierce'];) c4 d1 R4 K( D" s L5 V/ T5 S% U
################################# \) j$ `% d w2 O3 u% t" W! D
S, Y, ~ ~$ }9 M% F$ m
//Check both variables for empty value
{9 H2 U. S5 |. ~( G! A* i+ a* \( ?$ S& y) `- i3 f) z
if (!empty($_POST['char'])){3 i! T/ X% O! M f$ N0 A0 D
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
( c/ u0 _0 G! e& ?8 ^3 x8 h
$ b/ m2 B- Y [ m7 t; a- d; Em_szName = '{$name}'");/ ?+ d$ s" t6 T9 }2 u
while ($row = mssql_fetch_object($find)){4 m( m9 p8 j2 Y t( f" q) d2 a# ~
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";* L6 j6 \( g2 ?% v2 j) R" S
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 4 G) z: f' ^- K: y# j; ?
6 t2 B4 z& ~& R# T5 d4 O5 w3 n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
f& ^& c# v% I5 G. h, f. ^: m1 e( Q! Z. F4 D
[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 6 V! }, G* n: y9 O5 ]. A s w
( J N6 c; K$ y- ~; |N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
, z+ n# _& v& v7 b3 `( S+ O
( s! Y0 j0 j, ~) r% L'{$ElementUpgrade}', '{$ItemPierce}');");
" }3 I( P/ w3 J" G" a) s! k}6 i- O( O: z; P8 R
5 Q+ \/ |) [. O0 _8 t}
) l2 ~. H, a4 B6 n* e5 Y# y9 F
0 w9 O4 I8 ~- H! n- D9 U7 b}9 x6 P; d" f1 H/ k0 C7 B# |: V
: m, D8 I/ }6 r& H0 C
$InitForm = InitForm();; ^' @$ I$ |. h/ F5 c3 @
$Listener = PostListener();% ]8 u; n9 E) k
# k, d+ _' H* `1 X' D
?>: B9 f1 I6 ]4 @" D2 r6 F# b
( o/ G" D) G; T2 w1 B$ j% ?7 ~. u) K# A [4 z: z
; O( c, d: k3 Y+ [ d+ i9 U! ]5 I. q
' l4 O4 a1 s& `6 u' W/ x |
|