|
|
<?php
& T: g) t& x$ E) {) C$ g! @function Connect () {
0 U; s1 z8 Z% p7 V" B0 C3 Dmssql_connect('Server','UserName','Password') or die('Error: Connection to DB
$ f& w, w. P' J; q1 E2 k7 K/ ` V/ T9 Y% H
Failed.');
$ e6 _3 e( @6 } i}& F" Q @$ z* D
Connect();; |1 i/ a+ r" X
) k( z% X+ j3 M: R
function InitForm(){& w- C9 L" Q: G5 E( a% d/ J
//layout for the form
- a5 r+ o% j* E h& _echo "<strong>Send Items.</strong>3 v1 j, u, \9 Q6 i& G5 U
<form name='select' method='post'>* f" B2 j |$ H# h9 I) f3 c
<lable>Character Name</lable><br/>
n0 n1 C% q8 }$ o* s<input type='text' name='char'/><br/>) Y @; A& w7 k
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
1 ^4 F* r( B* j8 T. u; |<input type='text' name='item_name'/><br/>
' G0 f9 H3 s' {% D+ e<lable>Item Amount</lable><br/>
' N/ |- o6 }# ?$ {5 o I1 i0 k<input type='text' name='item_amount'/><br/># K+ w9 E; M' D7 B- H3 A5 W
<lable>Item Upgrade Amount</lable><br/>) c. @+ u5 H I, I5 V
<input type='text' name='item_upgrade'/><br/>
; w" M, T7 P' G" i) |<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)1 t& v, x }* N
0 t5 y; G' m/ d" }$ F. x6 c2 X
</lable><br/>
; x9 }3 b B& N" P8 v( n9 p<input type='text' name='item_element'/><br/>
7 a) H1 l/ ~: {2 i<lable>Element Upgrade Amount</lable><br/>
" @, e" F9 j; P \ A; q" n0 ~<input type='text' name='element_upgrade'/><br/># t* m6 X+ p) y6 E* ?
<lable>Pierced Amount</lable><br/>2 Z& P! ^$ q' f0 k# u! H: A: J- V
<input type='text' name='item_pierce'/><br/>% |1 F; q6 `# N, f. U& u' L
<input type='submit'/>9 ~5 Y) V4 _# z0 j% G' u$ Z% ~
</form>";, r1 e# v4 i% X( I( H$ g+ }
}" g' Y) l* s+ H. K& l
& T" w) }7 A3 |0 a0 z; c; \function PostListener (){1 Q- w7 P3 U2 k) s2 S
//Add more post variables if needed and add them to initform() function aswell
+ Q% v6 L. U! J/ H& w1 p% [, k" k% Q) I
################################
6 z: k7 ?9 p; g G# g##### Connection and Post ######
3 b: R. f& E8 F+ x) d2 d################################
( f! |, G. m( F+ P* b ]. R$name = @$_POST['char']; u; R* E) B- p$ k1 q) m; h
$ItemName = @$_POST['item_name'];: O9 Q. v+ s, _ X& k" ?
$ItemAmount = @$_POST['item_amount'];8 p& l# ?% c9 u$ `% |2 W
$ItemId = @$_POST['item_id'];
9 K4 b3 @) _) m4 ` w$ItemUpgrade = @$_POST['item_upgrade'];+ O: H2 u1 L% W0 a8 C
$ItemElement = @$_POST['item_element'];, E! S2 J3 N; W" T5 Y. Z1 X- J
$ElementUpgrade = @$_POST['element_upgrade'];
3 M, T+ L! L7 w$ItemPierce = @$_POST['item_pierce'];
* |& k! G0 R) T. A1 [- T3 l################################
7 b) p- w: z- w6 C. z6 [# v% S: ?% a1 u; u$ [, s
//Check both variables for empty value
1 o( U- q4 ]# q, F) F
' K; c7 e7 ?" L k9 b+ Y4 uif (!empty($_POST['char'])){3 L' M0 u! O8 X
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
+ a, f& U1 D3 D, ?' |" X* R
3 t# d# ] p) i) j6 m- I: [m_szName = '{$name}'");9 v: r9 @( E4 |" }# ]# v9 p2 j) H
while ($row = mssql_fetch_object($find)){ M2 S+ T* o0 ]$ w4 r2 U$ ?
echo "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";& ?+ ~4 P3 s% \% g' M# e0 f; Z( N
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], " Z0 `) O) F% b& O4 _8 K9 U
5 j# C7 g8 \8 q: x
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
8 y' k7 ~5 [+ H, R5 y# {
+ P c9 I- S1 Y2 G[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', + S: }- `6 o0 F4 ?
) }; p) g8 @* [" K" a
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}', 2 x2 F+ L) Q% M! k5 n
' `( v0 ?9 J" H' w
'{$ElementUpgrade}', '{$ItemPierce}');");
5 h. j. N1 r, Z: ^' F0 ]5 {}' ~" ~; L" J9 p9 j5 P
. _5 M R3 U5 g
} o% P& H$ G% f0 J' p* _
' w0 L7 w- y" x}
, i: M/ s q4 p) G! W |1 v* I: q5 c5 u: M) g' @) y R
$InitForm = InitForm();% f* @; |* `. W* k! b
$Listener = PostListener();- t5 T% x7 Z/ P/ C
2 U6 w1 g. Q3 |: }# J" s- b?>! M- ^. q. C8 q% z
6 L! t% @% ?6 u5 d l' G) B7 Q: j2 ]4 L1 p
+ S/ f* N1 K: A/ d" V- X; b* o4 r) ]4 k, Q( m
|
|