|
|
<?php
& j( X G* L, P* l4 w5 R4 J: sfunction Connect () {
: W7 ^& O& U( F% I* Wmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
# s; V0 \# E# @
: S* A% Q, D" e* S+ \8 ]Failed.');
7 ^# \& Y+ x4 C}6 U" ~! C9 f, j7 J, ]
Connect(); A+ Q$ x7 ^% J; V# r4 Q L% U
- t$ [$ M& z3 n' G1 {8 T$ A' Nfunction InitForm(){6 k E' Q' l, @
//layout for the form
* h" t- y5 |1 l" W l qecho "<strong>Send Items.</strong>
+ H& e. F9 K: f<form name='select' method='post'>* P/ q9 l- P; g( E
<lable>Character Name</lable><br/>% q. t$ K$ y5 g Q
<input type='text' name='char'/><br/>% n2 A. [: _) f) K- s5 K
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
, i; a/ ~% S4 P8 U, u/ x<input type='text' name='item_name'/><br/>
) B+ s, y. z- Q<lable>Item Amount</lable><br/>3 r" N: {, D4 ~ g! S" e7 c
<input type='text' name='item_amount'/><br/>
# S, \ o; }5 F1 \3 C9 x9 n. S) s, Y<lable>Item Upgrade Amount</lable><br/>
' {# f7 U8 O. G4 N<input type='text' name='item_upgrade'/><br/>5 l' n# O3 s" r( p
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
7 I: C3 D3 `$ e/ N% O: n' |
( ?- R6 ?) v8 W</lable><br/>9 S0 o: l& R6 i, Q) {0 b
<input type='text' name='item_element'/><br/>6 [' v$ E& S4 N4 U T8 u& x4 b
<lable>Element Upgrade Amount</lable><br/>
4 r4 W# C) {$ ~7 W) z6 N<input type='text' name='element_upgrade'/><br/>2 N6 x5 H9 s5 Y/ J2 T
<lable>Pierced Amount</lable><br/>) ~+ e9 m2 ~- b5 Z3 `' s
<input type='text' name='item_pierce'/><br/>
( c+ t S0 U- }5 _<input type='submit'/>
" l3 q O5 |; T7 G. c3 c</form>";
& A7 }/ K9 I ~" m7 S$ \3 ]5 \- e}+ ~' Y! S. T9 j
) p( s% B( _# g2 \0 a1 f0 g7 v2 `function PostListener (){
: Y& q5 S& Y( i* ~, I//Add more post variables if needed and add them to initform() function aswell
2 I5 Y5 G+ N" Z5 Q, m" c
* j1 N. s% C) h" j8 j+ k################################
1 H/ D. [2 M5 j6 ^ y; [* e& C##### Connection and Post ######* V- x# \6 z% X
################################4 M& l/ k5 T# Y+ y, F
$name = @$_POST['char'];4 z5 o% V9 B+ x" S p' {
$ItemName = @$_POST['item_name'];4 q7 V4 H, C C: }7 r: n
$ItemAmount = @$_POST['item_amount'];
" _! T9 ]0 o3 R/ z$ItemId = @$_POST['item_id'];4 U$ j5 @+ i; v, s2 a; j
$ItemUpgrade = @$_POST['item_upgrade'];4 [ J, V! u( } `1 \. H4 Y/ l
$ItemElement = @$_POST['item_element'];
0 C8 O2 M" u6 y2 z$ElementUpgrade = @$_POST['element_upgrade'];
% ~# o6 X) F; A2 {0 q$ t1 J$ItemPierce = @$_POST['item_pierce'];5 U& H; [1 g" u2 h/ S; B: x
################################% }& }2 w+ b8 I" w0 [4 j+ Y: Y
1 q C3 N$ n7 r1 o( t" s
//Check both variables for empty value
% B3 {. K( o$ V K+ N: R6 q3 a! d+ }/ ]6 S" v! V R
if (!empty($_POST['char'])){
; q8 R2 L6 l7 r$ l$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where " ]9 r5 v: W' z
/ M5 G4 R; Q; e3 Dm_szName = '{$name}'");7 D' d% {3 r( G3 K$ B. R4 x4 D, A/ k4 I
while ($row = mssql_fetch_object($find)){0 X* s0 x/ a0 D& s; v- z4 R
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";% F& D/ K3 u0 u1 X# i
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
- \2 u8 Q9 ?/ } ?5 Y2 ]. Z, \+ }
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], . A( f$ b* H* H/ c: G9 ]) L
5 ]4 e! R$ T" Y" \/ |$ z[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
7 w8 F3 h2 g. h* \! h: U% A
, k" m! L4 u# ~% V% }5 x( u1 _N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
- x+ @( B2 m/ m
; i' z6 r3 L# g'{$ElementUpgrade}', '{$ItemPierce}');");
0 R w) `8 B4 C5 ?+ @6 E+ x}
" o+ ]1 o8 K; j0 y
4 m1 H2 z+ Q5 f# G}
. f; \- Z1 N+ F2 D7 B, M) x! i8 J3 Y1 \7 a
}
! y2 B, {" C3 h& @6 [3 w1 s
, X) N) r, F4 g: U$ n( M. P$InitForm = InitForm();
) \ U8 d* R/ j1 J$Listener = PostListener(); U! l- d& k) s. F
( |/ B* `0 w" V1 \: |
?>
1 h: U( B. Y. N9 R$ [! L8 W; h4 U$ M$ ?4 n( R ~
' m. |/ e. V* V. K4 C, Y, r+ s; \9 }! r0 ^6 o4 |
* j& L/ E" y+ ^; D. k7 h |
|