|
|
<?php; A$ v$ N: P2 e* I
function Connect () {4 D& y7 e- Z( B# K- h8 I
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
% z3 ]: @( f# x6 Q- g
, g3 o3 n# ?* }- }Failed.');5 Y( X# p3 l1 B7 j& l/ r3 d
}# V- a$ u- R! y2 J
Connect();3 Q+ j. I' c3 _, Q' T* x& X- Z2 Q# ~6 w1 T
5 t& C8 y, X* V3 G6 N _$ s) g) W9 Q
function InitForm(){
9 B. V0 X9 c, b# S ~7 B2 }9 N//layout for the form$ U$ L4 Y4 V8 z. l' l) G# |
echo "<strong>Send Items.</strong>' f6 I4 l7 n3 o8 m' [& J3 h
<form name='select' method='post'>4 ]3 m9 b) k5 b' p$ D9 Q, }
<lable>Character Name</lable><br/>. K5 n" {: f& H
<input type='text' name='char'/><br/>
; f9 I8 K% W. E3 D" H9 B! S<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
: ^& `9 J& R0 R( k: u; b<input type='text' name='item_name'/><br/>7 q' l+ P3 ]# H! I$ F
<lable>Item Amount</lable><br/>; L5 Z% Q! F( x$ Z W7 |
<input type='text' name='item_amount'/><br/>
* t @. {& w' y7 s" h) m& H<lable>Item Upgrade Amount</lable><br/> a7 @8 `9 _& r* I
<input type='text' name='item_upgrade'/><br/>5 G" a" l3 f' w. l V
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)4 B% W& T2 P% ?2 c+ T) S
$ @7 a- o' V: j# M# q5 ?
</lable><br/>
# @/ G# ^* K. B<input type='text' name='item_element'/><br/>, o3 B! D% q4 Y. \% M( J
<lable>Element Upgrade Amount</lable><br/>
# j- U! T. x0 p# r7 u' u<input type='text' name='element_upgrade'/><br/>
+ d* D7 |- Y3 \7 `<lable>Pierced Amount</lable><br/>
* u, }- x! k/ Y<input type='text' name='item_pierce'/><br/>
5 S# `1 G& w- t6 }<input type='submit'/>1 p% |1 ~+ E9 P: x3 }
</form>";. q' E, \% A9 S! w4 {
}' ?4 A% V4 l8 j M% ?
q: G0 N, v0 e
function PostListener (){
+ U Z( d1 h3 _- J* y//Add more post variables if needed and add them to initform() function aswell
1 X! l" p* w: J; {$ D
' s6 j( b' w9 z################################
! n+ g+ y/ Q8 Q& w6 Q0 S0 H##### Connection and Post ######
* Z7 ]" G I4 }0 d4 k7 u% T################################
; K# C( D3 K( `& s$ f& a! D$name = @$_POST['char'];5 u) H. M2 V% ?9 z3 B8 R( I, F
$ItemName = @$_POST['item_name'];
; O4 r3 s5 l4 @0 I$ItemAmount = @$_POST['item_amount'];4 y5 H+ q0 A2 P ?
$ItemId = @$_POST['item_id'];
/ a5 q7 E- ^! ~$ItemUpgrade = @$_POST['item_upgrade'];2 B: i+ S9 E; d
$ItemElement = @$_POST['item_element'];% i0 N; g8 H2 ? J: d. G6 g
$ElementUpgrade = @$_POST['element_upgrade'];/ p+ M8 x% _1 n3 ]: d# q
$ItemPierce = @$_POST['item_pierce'];5 |. p/ ?3 U/ |4 k& ^+ R
################################
( B" @8 [8 ]* e" X0 R
# X- [ H4 b( d' R# T//Check both variables for empty value
8 q# `3 o4 T3 V9 G; E7 ]# \ b. z- A K' d
if (!empty($_POST['char'])){
" @3 j5 P* h, W5 \" M5 {+ d$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 6 O3 ?6 d3 W* I. P! }, L
7 Q+ w% ^+ C, `( R! Xm_szName = '{$name}'");
# R9 p! q _: H0 C, s0 t: m( ywhile ($row = mssql_fetch_object($find)){
r8 X/ \, j) w+ Zecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";
* \( S s3 r& {3 y/ K6 L- Q$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], * [) O" Z& b+ [) c! _) U
( t4 c' v$ p* @% z1 O: @6 X
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], 9 }. G$ J* ~( A
$ J; E/ d0 j5 ~4 P[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 7 k, }5 U1 }+ ?; o1 F4 Q
6 C# M" c; _+ N9 T( F) XN'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
) L0 J, }" j$ P- j4 J n( w
: C8 J! F, t0 K" \1 e'{$ElementUpgrade}', '{$ItemPierce}');");/ U. ~% m! l. X# ?
}
2 F. d+ {, P0 I1 d. Y, [4 g
2 Y: D0 {9 m7 @% V% Q: M- d# H! \}
7 W. K4 f1 _/ N; j% E/ a& [/ D5 Z
. w2 j9 p0 i3 g: r4 o6 P2 f}
8 f+ d; x7 b. M. |3 D* t: B
0 L' r9 ^, d, y; b) x3 L$InitForm = InitForm();
9 _0 I6 [. Y# U3 ^! [6 L j( h) K$Listener = PostListener();, ~" m$ }4 @& f. c
4 |3 G$ Q3 \3 z
?>& ?7 z9 M9 S2 l. V) o, b
. B" q0 Z' s& f8 A) q3 p* U% ^: n# R% W+ N
% t: \6 r( _ `/ e2 G" C: i
4 a3 P" g i7 N |
|