|
|
<?php
5 {( |7 N1 c( Q0 Wfunction Connect () {
' M4 `9 x: Y1 q% imssql_connect('Server','UserName','Password') or die('Error: Connection to DB t1 @/ I: V8 i" J; Y7 x( u- t
3 U5 v+ R' o6 _4 z4 LFailed.');+ r' k+ [: R9 Z: d( k/ T- u
}% j; ?9 J* }, r* v3 X6 F! M
Connect();; M" C0 {, H3 ?1 \1 y/ S4 B; R
4 [/ R/ m- a2 bfunction InitForm(){( s v6 X/ X* @. H
//layout for the form
' c4 V& ]+ J( N6 ^echo "<strong>Send Items.</strong>7 h) J, S7 w% c* o
<form name='select' method='post'>
" B$ y8 E# I3 m4 @! F8 K* f7 T<lable>Character Name</lable><br/> ^: V& r+ @9 _
<input type='text' name='char'/><br/>& a$ o5 X( i; o
<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>: A6 P8 x1 |) I
<input type='text' name='item_name'/><br/>
/ K# Q9 B1 K) n4 m8 f- _1 j/ x" r<lable>Item Amount</lable><br/>
8 _- j7 p% O( l4 a8 S<input type='text' name='item_amount'/><br/>+ K' `! _. q: x! P7 T! _% P; e
<lable>Item Upgrade Amount</lable><br/>
/ M0 x8 g" B. s6 h<input type='text' name='item_upgrade'/><br/>
}: o* w+ M# W6 e8 C6 l, k<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)
! ^4 h- d2 D$ q2 d- ]! O0 m) g' E8 h8 u
</lable><br/>) S2 p* w& v |1 Y I
<input type='text' name='item_element'/><br/>
) p0 C! ]: R9 V T. x7 ]<lable>Element Upgrade Amount</lable><br/>
# z7 y% |7 N& H" g4 h6 R<input type='text' name='element_upgrade'/><br/>5 G. O3 ?+ y( l: S
<lable>Pierced Amount</lable><br/># ^: E4 A2 ]! y, J& L J
<input type='text' name='item_pierce'/><br/>( J2 q2 `/ [" U6 p, W
<input type='submit'/>
$ p3 v2 G' R) T3 F</form>";
& C" a; e7 Z/ k$ M4 J2 o3 G4 w* F}
, G+ c4 z, H& ]) m3 V q8 [
; ? y+ U$ d5 o) v+ d! Ifunction PostListener (){
3 L3 e1 ?" T5 E% \9 _4 U6 y9 r//Add more post variables if needed and add them to initform() function aswell1 p2 d3 `) G# f6 s; s) W. S; b7 C
( Y0 S- {/ a1 \! P3 }# E# U
################################
& [0 I; E2 o- h9 f##### Connection and Post ######
~: H1 C) h0 B; o" _* G################################
+ T5 q7 y5 q4 m, A# d) J4 d+ G2 j' N$name = @$_POST['char'];
4 t% _+ l; [$ T1 M' Q$ v; u, m$ItemName = @$_POST['item_name'];
7 b4 Y0 e* i5 o: C' h6 [7 t* T$ItemAmount = @$_POST['item_amount'];1 \/ {( M$ K. d' A
$ItemId = @$_POST['item_id'];" S3 {' V" [: b- T6 q
$ItemUpgrade = @$_POST['item_upgrade'];4 h. k) S0 v$ e3 V; ?
$ItemElement = @$_POST['item_element'];7 P" c7 i; h( i4 }
$ElementUpgrade = @$_POST['element_upgrade'];
9 S$ X. u O: ?! `$ItemPierce = @$_POST['item_pierce']; `, T( D( z1 W6 X4 \2 y0 F
################################+ ]0 e' ~0 ~) h6 p; Q/ Q- I. d( B
$ n' s# W7 g1 h
//Check both variables for empty value
3 M8 C. `& S' ?" Z! p! k$ w N- [0 F0 J v* I$ v
if (!empty($_POST['char'])){# M6 ]$ g' \* t9 x5 {# ~
$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 5 c4 g# S" V) L, z6 n3 i
3 V3 x7 ^, e& u( H5 S1 Zm_szName = '{$name}'");
. _4 b, Q- j5 j1 k3 p* Ywhile ($row = mssql_fetch_object($find)){
; h$ ]1 ]% P1 ?% D+ mecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";5 u* I" t) A% i2 M; ^, b( q
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
* X1 m. V1 t5 b
0 B! |) B1 L* Z+ n[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
7 ^9 f+ z! s1 ^* X- e" z) ]8 ]3 f
# i0 I; H. z2 U. o. k5 T[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', ) c2 K0 ]! L+ [3 q8 g
1 Z& X- b% m$ G. t3 Z' \
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
( S, A5 o7 N9 B' T# E v
* \( F( D5 C2 e: r+ n'{$ElementUpgrade}', '{$ItemPierce}');");
& D0 S) o& n- P: l' c r; O- W' V}
4 F) ]4 X9 @* ?; l
; ]; r* w: n i/ _}
|0 ^, e% n/ g" n& ^ d8 _* R7 I8 D, l# q6 _
}- t8 x, o' N' r1 e9 ^- _$ G! Z
0 Y( u; U+ F7 I
$InitForm = InitForm();
, ]: R- i6 z! x. v' u) x$Listener = PostListener();
8 Z1 W: V" J( b: B0 R, V
8 w! g- E' n+ A) _+ K' l- c2 `! W4 W?>
& j) s8 N0 h8 P9 H4 t( c* n: O% f l
9 T9 a$ `& q3 H. h2 t+ G! M' ~( J8 n3 M& z) k2 d, O U; F
* i1 i7 _5 Y" `. m& g+ C/ y3 c
+ D; [$ v# }2 c6 {1 z& a! t |
|