|
|
<?php
x+ r* L) w/ e& Q: F8 Xfunction Connect () {; S( X/ ]* p1 l. v% l3 f4 R* p
mssql_connect('Server','UserName','Password') or die('Error: Connection to DB
! y! d7 W4 C; ~0 c
: ? V8 T+ Y' i7 u* {' U, C; K1 kFailed.'); f! Y9 Z" b5 y \
}, j: E# q8 O. ? a
Connect();# i& E: }) x: f0 [4 _- C) {
^ C' T. d4 l& r/ n' Gfunction InitForm(){
$ g7 V0 d: D& f2 o- c& x6 f, @//layout for the form
/ \2 N+ Y/ c% g* d# ~: A& Cecho "<strong>Send Items.</strong>4 O: R, Z3 m" c# H# r
<form name='select' method='post'>
) G0 a/ S; @; e$ T- k<lable>Character Name</lable><br/>
. Y1 N5 l& G" @+ g! r<input type='text' name='char'/><br/>
& p# C1 M, c7 A<lable>Item Name (Needs to be Exact or can use Item ID.)</lable><br/>% \7 y8 f& ^0 \9 u; E. i
<input type='text' name='item_name'/><br/>" g; U! w2 X+ B1 L0 K% N1 m
<lable>Item Amount</lable><br/>
' C0 u) E; n, R, f& t. v- N: v<input type='text' name='item_amount'/><br/>
/ e; Z: N. Z8 s# V<lable>Item Upgrade Amount</lable><br/>
7 z9 o* _4 v# a& Y, s/ v' T ^* W<input type='text' name='item_upgrade'/><br/>
9 X2 {5 V1 p; w# [<lable>Element Type.(0-None, 1-Fire, 2-Water, 3-Electricity, 4-Wind, 5-Earth.)9 ]6 c0 B0 e' z; s1 j1 H
' X6 \/ K; r9 M</lable><br/>% @0 x/ H9 o$ n4 X" v0 \
<input type='text' name='item_element'/><br/>
% Z5 B* Z& Y. a8 @<lable>Element Upgrade Amount</lable><br/>
5 `; r0 ^- o' D& ~2 @, T, ~<input type='text' name='element_upgrade'/><br/>
* P8 }. V( Q9 L ?7 m2 F4 F<lable>Pierced Amount</lable><br/>
3 c4 E6 o8 g2 s) D9 ?. j<input type='text' name='item_pierce'/><br/>
6 J% i& X4 o$ h" [<input type='submit'/>! {+ A+ p* g, O0 T/ p
</form>";& y* x" n( k" G' ?
}
* e3 I* y" X" P) B+ s8 L! T1 T$ }# b- ?2 @& ~' r7 q6 T7 v
function PostListener (){; G) y6 Y8 z+ E, S5 L
//Add more post variables if needed and add them to initform() function aswell) }0 b- X- l) Q
( m1 g& D( r6 j9 X
################################
( \! i0 w9 E+ v8 n( @) y: k6 d##### Connection and Post ###### k. D% h# ?( o; Y% t7 e' a
################################
/ V7 \: M6 X& Q' k+ y; @$name = @$_POST['char'];
( n' S2 g. p( |$ItemName = @$_POST['item_name']; ~: ~( _% S% d
$ItemAmount = @$_POST['item_amount'];
' o: n8 G3 O' _, A, c+ E$ItemId = @$_POST['item_id'];
# n' R* \3 J4 o$ItemUpgrade = @$_POST['item_upgrade'];
( S A E# u n) R9 L5 X$ItemElement = @$_POST['item_element'];8 D: ?# R# l2 V
$ElementUpgrade = @$_POST['element_upgrade'];3 r& y5 X& t, q1 E: u9 Y
$ItemPierce = @$_POST['item_pierce'];
2 H- |/ f( Q2 X% n* T# k################################
% W! ~- C5 Z! ~ B7 }4 ~/ D G4 G% N( \- ^2 j5 q
//Check both variables for empty value, D U/ g9 J$ i' _/ }& E
& u% ^- Z( y- a+ g$ jif (!empty($_POST['char'])){
1 G r4 w5 s+ j, |: w8 j' b+ P1 c$find = mssql_query("select * from [CHARACTER_01_DBF].[dbo].[CHARACTER_TBL] where 8 s; n: ~! [8 V
8 R/ x. y" e: @6 y/ c; n( Am_szName = '{$name}'");3 F) X3 Q% o( i
while ($row = mssql_fetch_object($find)){
7 p4 _+ N: P" yecho "You Just Sent {$ItemAmount} {$ItemName}(s) to {$name}<br>";$ R8 C1 b7 Y' }" J/ p# m
$logs = mssql_query("INSERT INTO CHARACTER_01_DBF.dbo.ITEM_SEND_TBL([m_idPlayer],
. u$ [1 A/ l, [8 K% D6 M( W+ D% t1 J1 u; w2 Y' S
[serverindex], [Item_Name], [Item_count], [idSender], [m_nAbilityOption], / h$ D/ d$ B6 o9 L) _+ ?
, T2 h. J5 c2 D( N, Z; [[m_bItemResist], [m_nResistAbilityOption], [nPiercedSize]) VALUES(N'$row->m_idPlayer', 0 G4 U0 L) s( y) t X! A; c6 i4 C
* Z( S7 a6 ?7 X, g/ ?5 F
N'01', N'{$ItemName}', '{$ItemAmount}', N'0000001', '{$ItemUpgrade}', '{$ItemElement}',
+ H9 l( w" T" J B3 X2 H N ?+ D% B8 t, D% y
'{$ElementUpgrade}', '{$ItemPierce}');");9 r7 T e- l: U6 | ^' N
}, c. x- J1 {7 R; L
' k6 r% P4 ~( O& j8 r
}
9 }* X5 y% Y9 K# L6 n
/ F, s: X5 c( u% \4 l8 ?}
4 p4 c$ D- K8 ]9 A. }# z8 N% N
# |9 I1 m* S& V2 E" i! \$InitForm = InitForm();
" v+ b) T0 ~/ S( G$ j- \4 g$Listener = PostListener();7 Z+ d+ G* H9 c" G3 E) G/ I0 H" [3 ^
" G: y. Q- q [/ E4 \0 A! m0 H?>
6 C7 C& \8 g" ]. F% v! {% s' e: C+ G! `2 ~" o7 \
I( Q0 A) ]9 g/ c- q
6 Q- ?* S& w$ R8 b2 j" I4 j
+ L1 C e+ ?. ?; _ L |
|