|
|
<?php
1 }. q+ w& O: H8 Tfunction Connect () {! O( B( o" E% U7 @
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB - h* q6 s- @( C, r+ W# F- ?: F5 f
" A+ D* S; }2 T; y9 ^3 f# \! ^
Failed.');
* f9 h' l5 }( E' x1 a1 [, F}# R0 ^' J$ n1 m% z+ X- d, u1 E6 x' N& g
Connect();
' d; F) P) h" B/ P2 s* _
8 S: O( Z, K) x) m" ]: N5 Cfunction InitForm(){
- u x% m9 @/ H: ^8 y/ u' ?//layout for the form
; U& I3 H' p! Q& Z6 ^- U2 Hecho "<strong>Send Items.</strong>1 g% R% Z6 e* b+ p+ r) K' W9 g
<form name='select' method='post'>' V+ i- k/ o7 b+ G' A
<lable>Character Name</lable><br/>$ Y% z3 ]3 h; @3 ^+ |
<input type='text' name='char'/><br/>
" L# p2 Q) `' d9 Y+ c<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>
& O3 Q1 o/ `) Z5 j0 Z; K- D<input type='text' name='item_name'/><br/>' E; `: b# d J: O$ M$ B
<lable>Item Amount</lable><br/>
3 e8 a9 ^) X5 R2 H<input type='text' name='item_amount'/><br/>
; A1 R% F# X+ B6 y, V( Q<lable>Item Upgrade Amount</lable><br/>$ [, g; [0 T0 g+ g) r5 w9 s0 g, s
<input type='text' name='item_upgrade'/><br/>- o! A2 ^7 W: X5 K' A! H
<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.); v3 {: C8 H9 X0 C2 ]+ s# z* O% @
/ ~8 d9 |9 I5 L</lable><br/>
! {! f" }' P, S+ V+ p<input type='text' name='item_element'/><br/>
* Y- F. B7 p4 r0 e$ x+ r8 y6 A) j, f<lable>Element Upgrade Amount</lable><br/>
8 G, B9 i7 }1 w# K8 I, G<input type='text' name='element_upgrade'/><br/>
4 l( a ?1 E; P3 c& {6 w9 j<lable>Pierced Amount</lable><br/># `# v, y/ C h3 V* ]
<input type='text' name='item_pierce'/><br/>6 q( B1 |1 ?! F. l
<input type='submit'/>
2 Q1 U; w( T) h8 N& ~</form>";
+ {5 o3 i @" x( ?) o4 M. q' }}
8 Q* u: O; w* B6 b( K2 ^3 l4 H, r! W) D
function PostListener (){. G7 K+ j+ l9 j
//Add more post variables if needed and add them to initform() function aswell
# C# a9 G( `7 r7 K6 V% L
/ O0 w: L/ u( r& p) j6 C6 Y0 X$ G8 Q################################
, q7 z9 ~1 u0 D; z( l9 m- ?##### Connection and Post ######
" f7 v. x' K/ r- s1 S! l( z################################
* }+ ^& q: i8 }6 K, G9 {! e$name = @$_POST['char'];, l6 }9 u5 U. }7 R
$ItemName = @$_POST['item_name'];3 @) b6 `1 }1 s `. ^
$ItemAmount = @$_POST['item_amount'];1 _2 Q2 p/ C9 J& H
$ItemId = @$_POST['item_id'];
* ~8 A+ ]( p- n$ItemUpgrade = @$_POST['item_upgrade'];: w; A4 n+ g. }* U# q8 ^
$ItemElement = @$_POST['item_element'];
3 _, W- Z) f' M$ElementUpgrade = @$_POST['element_upgrade'];8 g' Z8 z5 ?9 n' D; u
$ItemPierce = @$_POST['item_pierce'];
0 S& i0 y4 k7 p1 \4 d################################ a- i! M" i5 s9 }$ G7 s) t" q6 }
3 e$ e" h3 O# N//Check both variables for empty value- e0 E# r" B2 U% K
3 o, S1 X* @! O4 aif (!empty($_POST['char'])){
# s! a0 K; ]% j, G( q$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where
! l' s. X, w( G
; @4 A" ]/ x0 _) am_szName = '{$name}'");
* P2 m5 l5 @& z( u9 qwhile ($row = mssql_fetch_object($find)){
5 ]1 N5 b# k5 L S, e7 [0 J7 Fecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>"; c3 d0 H+ l4 ^. W
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer], 0 k9 X0 j0 P, m. L# I
* F, n# p: D9 W; b6 a3 S/ Y
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption],
" K2 }; D( a* M9 ]9 {
7 q& U5 [1 |5 W6 ]. B, p[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer',
9 F9 m7 G1 e( c1 P5 n
h3 `1 B. N! M" f) e+ ~/ ~& {N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
/ x" X1 h U( p- n/ X: _4 {7 l) ?8 q* t& J5 X: z+ B
'{$ElementUpgrade}', '{$ItemPierce}');");; @2 I/ K8 ^! O; Y8 q3 V4 @' v
}
5 `$ B. K g$ ~& v7 H, g' k8 }: e* k" k7 F6 q) f- G
}8 H4 M/ g( y8 h& Q7 X
; j( O& j: Z4 h! D1 t2 q
}% |6 l h: A; q5 |1 |4 [2 A
D+ ^( D4 k1 K, j$InitForm = InitForm();. I8 y+ K! [3 v; T# w( A$ q% q8 u
$Listener = PostListener();! x! z/ R; q/ D' l: d5 o
; s/ b1 Y) l1 I$ K T2 l7 G! C?>$ r8 A0 O+ a. U; a
3 M$ c" n/ Y# M: U t; t# e6 P _
& \7 z! n8 g+ m4 P! f
& V7 f6 ]) K* _; L2 [0 }9 a
& m+ {% y. x0 [) h) x( o2 {3 m |
|