|
||||||
| Kayıt ol | Arkadaşını Davet Et | Yardım | Üye Listesi | Ajanda | Arama | Bugünki Mesajlar | Forumları Okundu Kabul Et |
| 1351 Prosedürler / Kodlar |
|
|
![]() |
|
![]() |
468x60
|
![]() |
|
|
LinkBack | Seçenekler | Stil |
|
|
#1 (permalink) | |
|
Bağımlı Üye ![]() ![]() ![]() Üyelik tarihi: Jul 2010
Yaş: 21
Mesajlar: 250
Oyun Parası: $26890 Teşekkür : 19
9 Konusuna 343 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 12 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Alıntı:
Gün Silmiyorsa !
Notice: This Ad only show to guest, please register now to disappear !
__________________
1351 Dß Editlemeye Başladım
![]() |
|
|
|
|
| Teşekkür edenler: |
| Sponsored Links |
|
|
|
|
#2 (permalink) |
|
Gelişmiş Üye ![]() Üyelik tarihi: Dec 2009
Yaş: 25
Mesajlar: 87
Oyun Parası: $3500 Teşekkür : 11
14 Konusuna 39 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 13 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Teşekkürler
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#3 (permalink) |
|
Gelişmiş Üye ![]() Üyelik tarihi: Apr 2010
Mesajlar: 53
Oyun Parası: $500 Teşekkür : 3
Bu saat içinde 1 teşekkür aldı.
P-K Puan: 0
Tecrübe Puanı: 12 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Teşekkürler
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#4 (permalink) |
|
Kıdemli Üye ![]() Üyelik tarihi: Dec 2009
Yaş: 19
Mesajlar: 752
Oyun Parası: $142992 Teşekkür : 12
8 Konusuna 10 teşekkür almış
P-K Puan: 5
Tecrübe Puanı: 13 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Teşekkürler kardeş
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#5 (permalink) |
|
Banned ![]() |
Paylaşım için teşşekürler.
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#6 (permalink) |
|
Banned ![]() ![]() Üyelik tarihi: Nov 2009
Bulunduğu Yer: C:\WINDOWS\system32
Yaş: 16
Mesajlar: 863
Oyun Parası: $212374 Teşekkür : 125
133 Konusuna 1.618 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 13 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Kod:
CREATE PROCEDURE [dbo].[LOAD_PREMIUM_SERVICE_USER] @AccountID varchar(21), @type int output, @days int output AS BEGIN -- Declare the variable @PremiumExpire (the date when the premium service expires) DECLARE @PremiumExpire datetime -- Retrieve the date the premium service expires SELECT @PremiumExpire = PremiumExpire FROM TB_USER WHERE strAccountID = @AccountID -- Set the number of days left to -- the day difference between the current time -- and the date the premium service expires SET @days = DateDiff(dd, getDate(), @PremiumExpire) -- Set @type to 1 as its a required output variable -- and there appear to be no ways to have silver/gold etc SET @type = 1 -- If the days are 0 -- or there's some error -- or the day count for whatever reason is empty/null IF @days <= 0 or @@ERROR <> 0 or @days is null BEGIN -- House cleaning: -- Setting the two below variables to 0 just in case. SET @type = 0 SET @days = 0 END RETURN END GO Kod:
CREATE PROCEDURE [dbo].[UPDATE_PREMIUM_SERVICE_USER] @AccountID varchar(21), @d24 datetime AS GO Kod:
CREATE PROCEDURE [dbo].[Premium]
@strAccountID varchar(50),
@strUserID varchar(50),
@days int
AS
-- Declarations.
DECLARE @currentDays int, @lastDate datetime, @dateDiff int
BEGIN
-- If the day field is null/empty or 0 (why would we add 0 days, that's just silly!)
IF @days IS NULL or @days = 0
BEGIN
-- Default the days added to 30.
SET @days = 30
END
-- If the account name isn't null/empty and not equal to ''
IF @strAccountID IS NOT NULL AND @strAccountID <> ''
BEGIN
-- Get the current premium expire time
SELECT @lastDate = PremiumExpire FROM TB_USER WHERE strAccountID = @strAccountID
-- How many days differ between now and the last premium expire date
SET @dateDiff = DateDiff(dd, getDate(), @lastDate)
-- Check if the last premium expire date is null/empty or
-- the days between now and the last premium expire date is below or equal to 0
IF @lastDate IS NULL or @dateDiff <= 0
BEGIN
-- We default the last premium expire date to now
-- Otherwise if they had existing premium
-- Say a month ago, it'd give them up
-- until now, and still be "behind" the current time.
SET @lastDate = getDate()
END
-- Update the premium date
UPDATE TB_USER SET PremiumExpire = DateAdd(dd, @days, @lastDate) WHERE strAccountID = @strAccountID
END
-- Now we check if the character name is being used :P
ELSE IF @strUserID IS NOT NULL AND @strUserID <> ''
BEGIN
-- Get the account ID from ACCOUNT_CHAR
SET @strAccountID = (SELECT strAccountID FROM [KN_World]..[ACCOUNT_CHAR] WHERE strCharID1 = @strUserID or strCharID2 = @strUserID or strCharID3 = @strUserID)
SELECT @lastDate = PremiumExpire FROM TB_USER WHERE strAccountID = @strAccountID
SET @dateDiff = DateDiff(dd, getDate(), @lastDate)
IF @lastDate IS NULL or @dateDiff <= 0
BEGIN
SET @lastDate = getDate()
END
UPDATE TB_USER SET PremiumExpire = DateAdd(dd, @days, @lastDate) WHERE strAccountID = @strAccountID
END
ELSE
BEGIN
PRINT 'You must specify an account ID (1) or character (2) to use this procedure.'
END
END
GO
Kod:
ALTER TABLE TB_USER ADD PremiumExpire datetime Defauld Value Columü = (getdate()) Olması Gerek Bide Bu Var Kimin Oldugunu Bilmiyorum Kullandıgım Bişey Bu Usko Eski Sürümündeki Gibi Day Tipinde Çalışır Oyundada Premiumun İçinde Kaç Gün Kaldıgını Yazar Day Tipinde Pre Bitince Oyundada Gözümez Premium Var Falan Filan işte
Notice: This Ad only show to guest, please register now to disappear ! Konu EveryBodyFooL tarafından (09-10-2010 Saat 20:27 ) değiştirilmiştir. |
|
|
|
|
|
#7 (permalink) |
|
Bağımlı Üye ![]() ![]() ![]() ![]() Üyelik tarihi: Nov 2009
Bulunduğu Yer: Elazığ
Yaş: 21
Mesajlar: 218
Oyun Parası: $176310 Teşekkür : 235
15 Konusuna 16 teşekkür almış
P-K Puan: 10
Tecrübe Puanı: 13 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Paylaşım İçin Teşekkürler.
Notice: This Ad only show to guest, please register now to disappear !
__________________
[Üye olmadan linki göremezsiniz.. Üye olmak için tıklayınız...] [Üye olmadan linki göremezsiniz.. Üye olmak için tıklayınız...] |
|
|
|
|
|
#8 (permalink) |
|
Gelişmiş Üye ![]() ![]() ![]() Üyelik tarihi: Dec 2009
Mesajlar: 35
Oyun Parası: $19555 Teşekkür : 47
3 Konusuna 4 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 13 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Güzel paylaşımlar yav
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#9 (permalink) |
|
Gelişmiş Üye ![]() Üyelik tarihi: Mar 2010
Yaş: 24
Mesajlar: 90
Oyun Parası: $5555 Teşekkür : 0
3 Konusuna 3 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 12 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
++++++++++++++++++++++++++++
Notice: This Ad only show to guest, please register now to disappear ! |
|
|
|
|
|
#10 (permalink) |
![]() Üyelik tarihi: Apr 2010
Mesajlar: 859
Oyun Parası: $171257 Teşekkür : 228
59 Konusuna 922 teşekkür almış
P-K Puan: 0
Tecrübe Puanı: 12 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Teşekkürler
Notice: This Ad only show to guest, please register now to disappear !
__________________
[Üye olmadan linki göremezsiniz.. Üye olmak için tıklayınız...] |
|
|
|
![]() |
| Bookmarks |
| Etiketler |
| 1351, paylasim, premium, reallizt, sistemi, sorunsuz |
| Seçenekler | |
| Stil | |
|
|