logo
down
shadow

Searching for a complex and well-designed PHP OOP application to learn from


Searching for a complex and well-designed PHP OOP application to learn from

By : Luis Mé
Date : November 22 2020, 07:01 PM
hope this fix your issue I would recommend SugarCRM as a well written and extremely widely used application. Download their source code, and start from include/MVC/SugarApplication.php. For login etc, you might want to start from include/MVC/View/SugarView.php.
Incidentally, it appears from your previous comment on GSto's answer that you're looking for a consumer oriented application rather than one aimed at developers. After all, Drupal, Joomla and other PHP web frameworks ARE in fact complete applications, they're just targeted towards the developer community.
code :


Share : facebook icon twitter icon
Where to get well designed and coded applications written in C# to learn from them?

Where to get well designed and coded applications written in C# to learn from them?


By : AJ Avalanche
Date : March 29 2020, 07:55 AM
I wish this helpful for you You might also want to check out Scott Hanselman's weekly source code discussions.
Instead of just blocks of code he takes time to discuss it in detail.
How to implement searching on a vertically designed table?

How to implement searching on a vertically designed table?


By : user1623795
Date : March 29 2020, 07:55 AM
hope this fix your issue EAV table is a good thing as long as you don't need to search for multiple values at once in which case it becomes a bad thing.
You cannot index several values at once because they are located in different records.
code :
SELECT  *
FROM    tbl_UserAttributes tcity
JOIN    tbl_UserAttributes tsex
ON      tsex.userid = tcity.userid
WHERE   tcity.fieldname = 'city'
        AND tcity.value LIKE '%Mumbai%'
        AND tsex.fieldname = 'sex'
        AND tsex.value = 'M'
SELECT  *
FROM    tbl_UserAttributes tcity
STRAIGHT_JOIN
        tbl_UserAttributes tsex
ON      tsex.userid = tcity.userid
WHERE   tcity.fieldname = 'city'
        AND tcity.value = 'Mumbai'
        AND tsex.fieldname = 'sex'
        AND tsex.value = 'M'
Optimizing a Complex T-SQL Statement Designed to SUM Financial Data

Optimizing a Complex T-SQL Statement Designed to SUM Financial Data


By : JJose
Date : March 29 2020, 07:55 AM
hop of those help? If you make a couple of auxiliary tables, then the problem becomes straight forward. I've prototyped the solution and from what information you've provided so far, I don't see why this doesn't meet your needs.
SQL containing DML and queries
code :
SELECT 
    W.YEAR, 
    W.WEEK_NUMBER, 
    SUM(NETAMT) AS NETAMT, 
    MIN(RT.YTDAMT) AS YTDAMT /* we only want one row from the cross apply return */
FROM #ProfitLossDaily PLD
INNER JOIN #Weeks W ON PLD.TRXDATE BETWEEN W.WEEK_STARTING AND W.WEEK_ENDING
CROSS APPLY (   
    SELECT SUM(NETAMT) AS YTDAMT
    FROM #ProfitLossDaily PLD2
    INNER JOIN #Weeks W2 ON PLD2.TRXDATE BETWEEN W2.WEEK_STARTING AND W2.WEEK_ENDING
    WHERE W2.YEAR = W.YEAR
        AND W2.WEEK_NUMBER <= W.WEEK_NUMBER
) as RT
GROUP BY W.YEAR, W.WEEK_NUMBER
ORDER BY W.YEAR, W.WEEK_NUMBER
CREATE TABLE #Weeks (
    YEAR INTEGER, 
    WEEK_NUMBER INTEGER,
    WEEK_STARTING DATE,
    WEEK_ENDING DATE,
    PRIMARY KEY (YEAR,WEEK_NUMBER)
)
GO

CREATE TABLE #ProfitLossDaily (
    TRXDATE DATE PRIMARY KEY, 
    CRDTAMT DECIMAL(38,8) NOT NULL,
    DEBITAMT DECIMAL(38,8) NOT NULL,
    NETAMT AS CRDTAMT - DEBITAMT
)
GO

CREATE TABLE #ProfitLoss (
    YEAR INTEGER, 
    WEEK_NUMBER INTEGER,
    NETAMT DECIMAL(38,8) NOT NULL,
    YTDAMT DECIMAL(38,8) NOT NULL,
    PRIMARY KEY (YEAR,WEEK_NUMBER)
)
GO
MERGE INTO #ProfitLoss AS Target
USING (
    SELECT 
        W.YEAR, 
        W.WEEK_NUMBER, 
        SUM(NETAMT) AS NETAMT, 
        MIN(RT.YTDAMT) AS YTDAMT /* we only want one row from the cross apply return */
    FROM #ProfitLossDaily PLD
    INNER JOIN #Weeks W ON PLD.TRXDATE BETWEEN W.WEEK_STARTING AND W.WEEK_ENDING
    CROSS APPLY (   
        SELECT SUM(NETAMT) AS YTDAMT
        FROM #ProfitLossDaily PLD2
        INNER JOIN #Weeks W2 ON PLD2.TRXDATE BETWEEN W2.WEEK_STARTING AND W2.WEEK_ENDING
        WHERE W2.YEAR = W.YEAR
            AND W2.WEEK_NUMBER <= W.WEEK_NUMBER
    ) as RT
    WHERE W.WEEK_STARTING >= DATEADD(DAY, -7, CURRENT_TIMESTAMP)
    GROUP BY W.YEAR, W.WEEK_NUMBER
) AS Source ON Target.YEAR = Source.YEAR AND Target.WEEK_NUMBER = Source.WEEK_NUMBER
WHEN MATCHED THEN
    UPDATE SET NETAMT = Source.NETAMT, YTDAMT = Source.YTDAMT
WHEN NOT MATCHED BY TARGET THEN
    INSERT (YEAR, WEEK_NUMBER, NETAMT, YTDAMT) VALUES (YEAR, WEEK_NUMBER, NETAMT, YTDAMT);
/* Populate WEEKS table with the financial reporting period definitions */
INSERT INTO #WEEKS VALUES (2008,1,'2008-06-01','2008-06-07')
INSERT INTO #WEEKS VALUES (2008,2,'2008-06-08','2008-06-14')
INSERT INTO #WEEKS VALUES (2008,3,'2008-06-15','2008-06-21')
INSERT INTO #WEEKS VALUES (2008,4,'2008-06-22','2008-06-28')
INSERT INTO #WEEKS VALUES (2008,5,'2008-06-29','2008-07-05')
INSERT INTO #WEEKS VALUES (2008,6,'2008-07-06','2008-07-12')
INSERT INTO #WEEKS VALUES (2008,7,'2008-07-13','2008-07-19')
INSERT INTO #WEEKS VALUES (2008,8,'2008-07-20','2008-07-26')
INSERT INTO #WEEKS VALUES (2008,9,'2008-07-27','2008-08-02')
INSERT INTO #WEEKS VALUES (2008,10,'2008-08-03','2008-08-09')
INSERT INTO #WEEKS VALUES (2008,11,'2008-08-10','2008-08-16')
INSERT INTO #WEEKS VALUES (2008,12,'2008-08-17','2008-08-23')
INSERT INTO #WEEKS VALUES (2008,13,'2008-08-24','2008-08-30')
INSERT INTO #WEEKS VALUES (2008,14,'2008-08-31','2008-09-06')
INSERT INTO #WEEKS VALUES (2008,15,'2008-09-07','2008-09-13')
INSERT INTO #WEEKS VALUES (2008,16,'2008-09-14','2008-09-20')
INSERT INTO #WEEKS VALUES (2008,17,'2008-09-21','2008-09-27')
INSERT INTO #WEEKS VALUES (2008,18,'2008-09-28','2008-10-04')
INSERT INTO #WEEKS VALUES (2008,19,'2008-10-05','2008-10-11')
INSERT INTO #WEEKS VALUES (2008,20,'2008-10-12','2008-10-18')
INSERT INTO #WEEKS VALUES (2008,21,'2008-10-19','2008-10-25')
INSERT INTO #WEEKS VALUES (2008,22,'2008-10-26','2008-11-01')
INSERT INTO #WEEKS VALUES (2008,23,'2008-11-02','2008-11-08')
INSERT INTO #WEEKS VALUES (2008,24,'2008-11-09','2008-11-15')
INSERT INTO #WEEKS VALUES (2008,25,'2008-11-16','2008-11-22')
INSERT INTO #WEEKS VALUES (2008,26,'2008-11-23','2008-11-29')
INSERT INTO #WEEKS VALUES (2008,27,'2008-11-30','2008-12-06')
INSERT INTO #WEEKS VALUES (2008,28,'2008-12-07','2008-12-13')
INSERT INTO #WEEKS VALUES (2008,29,'2008-12-14','2008-12-20')
INSERT INTO #WEEKS VALUES (2008,30,'2008-12-21','2008-12-27')
INSERT INTO #WEEKS VALUES (2008,31,'2008-12-28','2009-01-03')
INSERT INTO #WEEKS VALUES (2008,32,'2009-01-04','2009-01-10')
INSERT INTO #WEEKS VALUES (2008,33,'2009-01-11','2009-01-17')
INSERT INTO #WEEKS VALUES (2008,34,'2009-01-18','2009-01-24')
INSERT INTO #WEEKS VALUES (2008,35,'2009-01-25','2009-01-31')
INSERT INTO #WEEKS VALUES (2008,36,'2009-02-01','2009-02-07')
INSERT INTO #WEEKS VALUES (2008,37,'2009-02-08','2009-02-14')
INSERT INTO #WEEKS VALUES (2008,38,'2009-02-15','2009-02-21')
INSERT INTO #WEEKS VALUES (2008,39,'2009-02-22','2009-02-28')
INSERT INTO #WEEKS VALUES (2008,40,'2009-03-01','2009-03-07')
INSERT INTO #WEEKS VALUES (2008,41,'2009-03-08','2009-03-14')
INSERT INTO #WEEKS VALUES (2008,42,'2009-03-15','2009-03-21')
INSERT INTO #WEEKS VALUES (2008,43,'2009-03-22','2009-03-28')
INSERT INTO #WEEKS VALUES (2008,44,'2009-03-29','2009-04-04')
INSERT INTO #WEEKS VALUES (2008,45,'2009-04-05','2009-04-11')
INSERT INTO #WEEKS VALUES (2008,46,'2009-04-12','2009-04-18')
INSERT INTO #WEEKS VALUES (2008,47,'2009-04-19','2009-04-25')
INSERT INTO #WEEKS VALUES (2008,48,'2009-04-26','2009-05-02')
INSERT INTO #WEEKS VALUES (2008,49,'2009-05-03','2009-05-09')
INSERT INTO #WEEKS VALUES (2008,50,'2009-05-10','2009-05-16')
INSERT INTO #WEEKS VALUES (2008,51,'2009-05-17','2009-05-23')
INSERT INTO #WEEKS VALUES (2008,52,'2009-05-24','2009-05-31')
INSERT INTO #WEEKS VALUES (2009,1,'2009-06-01','2009-06-07')
INSERT INTO #WEEKS VALUES (2009,2,'2009-06-08','2009-06-14')
INSERT INTO #WEEKS VALUES (2009,3,'2009-06-15','2009-06-21')
INSERT INTO #WEEKS VALUES (2009,4,'2009-06-22','2009-06-28')
INSERT INTO #WEEKS VALUES (2009,5,'2009-06-29','2009-07-05')
INSERT INTO #WEEKS VALUES (2009,6,'2009-07-06','2009-07-12')
INSERT INTO #WEEKS VALUES (2009,7,'2009-07-13','2009-07-19')
INSERT INTO #WEEKS VALUES (2009,8,'2009-07-20','2009-07-26')
INSERT INTO #WEEKS VALUES (2009,9,'2009-07-27','2009-08-02')
INSERT INTO #WEEKS VALUES (2009,10,'2009-08-03','2009-08-09')
INSERT INTO #WEEKS VALUES (2009,11,'2009-08-10','2009-08-16')
INSERT INTO #WEEKS VALUES (2009,12,'2009-08-17','2009-08-23')
INSERT INTO #WEEKS VALUES (2009,13,'2009-08-24','2009-08-30')
INSERT INTO #WEEKS VALUES (2009,14,'2009-08-31','2009-09-06')
INSERT INTO #WEEKS VALUES (2009,15,'2009-09-07','2009-09-13')
INSERT INTO #WEEKS VALUES (2009,16,'2009-09-14','2009-09-20')
INSERT INTO #WEEKS VALUES (2009,17,'2009-09-21','2009-09-27')
INSERT INTO #WEEKS VALUES (2009,18,'2009-09-28','2009-10-04')
INSERT INTO #WEEKS VALUES (2009,19,'2009-10-05','2009-10-11')
INSERT INTO #WEEKS VALUES (2009,20,'2009-10-12','2009-10-18')
INSERT INTO #WEEKS VALUES (2009,21,'2009-10-19','2009-10-25')
INSERT INTO #WEEKS VALUES (2009,22,'2009-10-26','2009-11-01')
INSERT INTO #WEEKS VALUES (2009,23,'2009-11-02','2009-11-08')
INSERT INTO #WEEKS VALUES (2009,24,'2009-11-09','2009-11-15')
INSERT INTO #WEEKS VALUES (2009,25,'2009-11-16','2009-11-22')
INSERT INTO #WEEKS VALUES (2009,26,'2009-11-23','2009-11-29')
INSERT INTO #WEEKS VALUES (2009,27,'2009-11-30','2009-12-06')
INSERT INTO #WEEKS VALUES (2009,28,'2009-12-07','2009-12-13')
INSERT INTO #WEEKS VALUES (2009,29,'2009-12-14','2009-12-20')
INSERT INTO #WEEKS VALUES (2009,30,'2009-12-21','2009-12-27')
INSERT INTO #WEEKS VALUES (2009,31,'2009-12-28','2010-01-03')
INSERT INTO #WEEKS VALUES (2009,32,'2010-01-04','2010-01-10')
INSERT INTO #WEEKS VALUES (2009,33,'2010-01-11','2010-01-17')
INSERT INTO #WEEKS VALUES (2009,34,'2010-01-18','2010-01-24')
INSERT INTO #WEEKS VALUES (2009,35,'2010-01-25','2010-01-31')
INSERT INTO #WEEKS VALUES (2009,36,'2010-02-01','2010-02-07')
INSERT INTO #WEEKS VALUES (2009,37,'2010-02-08','2010-02-14')
INSERT INTO #WEEKS VALUES (2009,38,'2010-02-15','2010-02-21')
INSERT INTO #WEEKS VALUES (2009,39,'2010-02-22','2010-02-28')
INSERT INTO #WEEKS VALUES (2009,40,'2010-03-01','2010-03-07')
INSERT INTO #WEEKS VALUES (2009,41,'2010-03-08','2010-03-14')
INSERT INTO #WEEKS VALUES (2009,42,'2010-03-15','2010-03-21')
INSERT INTO #WEEKS VALUES (2009,43,'2010-03-22','2010-03-28')
INSERT INTO #WEEKS VALUES (2009,44,'2010-03-29','2010-04-04')
INSERT INTO #WEEKS VALUES (2009,45,'2010-04-05','2010-04-11')
INSERT INTO #WEEKS VALUES (2009,46,'2010-04-12','2010-04-18')
INSERT INTO #WEEKS VALUES (2009,47,'2010-04-19','2010-04-25')
INSERT INTO #WEEKS VALUES (2009,48,'2010-04-26','2010-05-02')
INSERT INTO #WEEKS VALUES (2009,49,'2010-05-03','2010-05-09')
INSERT INTO #WEEKS VALUES (2009,50,'2010-05-10','2010-05-16')
INSERT INTO #WEEKS VALUES (2009,51,'2010-05-17','2010-05-23')
INSERT INTO #WEEKS VALUES (2009,52,'2010-05-24','2010-05-31')
INSERT INTO #WEEKS VALUES (2010,1,'2010-06-01','2010-06-07')
INSERT INTO #WEEKS VALUES (2010,2,'2010-06-08','2010-06-14')
INSERT INTO #WEEKS VALUES (2010,3,'2010-06-15','2010-06-21')
INSERT INTO #WEEKS VALUES (2010,4,'2010-06-22','2010-06-28')
INSERT INTO #WEEKS VALUES (2010,5,'2010-06-29','2010-07-05')
INSERT INTO #WEEKS VALUES (2010,6,'2010-07-06','2010-07-12')
INSERT INTO #WEEKS VALUES (2010,7,'2010-07-13','2010-07-19')
INSERT INTO #WEEKS VALUES (2010,8,'2010-07-20','2010-07-26')
INSERT INTO #WEEKS VALUES (2010,9,'2010-07-27','2010-08-02')
INSERT INTO #WEEKS VALUES (2010,10,'2010-08-03','2010-08-09')
INSERT INTO #WEEKS VALUES (2010,11,'2010-08-10','2010-08-16')
INSERT INTO #WEEKS VALUES (2010,12,'2010-08-17','2010-08-23')
INSERT INTO #WEEKS VALUES (2010,13,'2010-08-24','2010-08-30')
INSERT INTO #WEEKS VALUES (2010,14,'2010-08-31','2010-09-06')
INSERT INTO #WEEKS VALUES (2010,15,'2010-09-07','2010-09-13')
INSERT INTO #WEEKS VALUES (2010,16,'2010-09-14','2010-09-20')
INSERT INTO #WEEKS VALUES (2010,17,'2010-09-21','2010-09-27')
INSERT INTO #WEEKS VALUES (2010,18,'2010-09-28','2010-10-04')
INSERT INTO #WEEKS VALUES (2010,19,'2010-10-05','2010-10-11')
INSERT INTO #WEEKS VALUES (2010,20,'2010-10-12','2010-10-18')
INSERT INTO #WEEKS VALUES (2010,21,'2010-10-19','2010-10-25')
INSERT INTO #WEEKS VALUES (2010,22,'2010-10-26','2010-11-01')
INSERT INTO #WEEKS VALUES (2010,23,'2010-11-02','2010-11-08')
INSERT INTO #WEEKS VALUES (2010,24,'2010-11-09','2010-11-15')
INSERT INTO #WEEKS VALUES (2010,25,'2010-11-16','2010-11-22')
INSERT INTO #WEEKS VALUES (2010,26,'2010-11-23','2010-11-29')
INSERT INTO #WEEKS VALUES (2010,27,'2010-11-30','2010-12-06')
INSERT INTO #WEEKS VALUES (2010,28,'2010-12-07','2010-12-13')
INSERT INTO #WEEKS VALUES (2010,29,'2010-12-14','2010-12-20')
INSERT INTO #WEEKS VALUES (2010,30,'2010-12-21','2010-12-27')
INSERT INTO #WEEKS VALUES (2010,31,'2010-12-28','2011-01-03')
INSERT INTO #WEEKS VALUES (2010,32,'2011-01-04','2011-01-10')
INSERT INTO #WEEKS VALUES (2010,33,'2011-01-11','2011-01-17')
INSERT INTO #WEEKS VALUES (2010,34,'2011-01-18','2011-01-24')
INSERT INTO #WEEKS VALUES (2010,35,'2011-01-25','2011-01-31')
INSERT INTO #WEEKS VALUES (2010,36,'2011-02-01','2011-02-07')
INSERT INTO #WEEKS VALUES (2010,37,'2011-02-08','2011-02-14')
INSERT INTO #WEEKS VALUES (2010,38,'2011-02-15','2011-02-21')
INSERT INTO #WEEKS VALUES (2010,39,'2011-02-22','2011-02-28')
INSERT INTO #WEEKS VALUES (2010,40,'2011-03-01','2011-03-07')
INSERT INTO #WEEKS VALUES (2010,41,'2011-03-08','2011-03-14')
INSERT INTO #WEEKS VALUES (2010,42,'2011-03-15','2011-03-21')
INSERT INTO #WEEKS VALUES (2010,43,'2011-03-22','2011-03-28')
INSERT INTO #WEEKS VALUES (2010,44,'2011-03-29','2011-04-04')
INSERT INTO #WEEKS VALUES (2010,45,'2011-04-05','2011-04-11')
INSERT INTO #WEEKS VALUES (2010,46,'2011-04-12','2011-04-18')
INSERT INTO #WEEKS VALUES (2010,47,'2011-04-19','2011-04-25')
INSERT INTO #WEEKS VALUES (2010,48,'2011-04-26','2011-05-02')
INSERT INTO #WEEKS VALUES (2010,49,'2011-05-03','2011-05-09')
INSERT INTO #WEEKS VALUES (2010,50,'2011-05-10','2011-05-16')
INSERT INTO #WEEKS VALUES (2010,51,'2011-05-17','2011-05-23')
INSERT INTO #WEEKS VALUES (2010,52,'2011-05-24','2011-05-31')
INSERT INTO #WEEKS VALUES (2011,1,'2011-06-01','2011-06-07')
INSERT INTO #WEEKS VALUES (2011,2,'2011-06-08','2011-06-14')
INSERT INTO #WEEKS VALUES (2011,3,'2011-06-15','2011-06-21')
INSERT INTO #WEEKS VALUES (2011,4,'2011-06-22','2011-06-28')
INSERT INTO #WEEKS VALUES (2011,5,'2011-06-29','2011-07-05')
INSERT INTO #WEEKS VALUES (2011,6,'2011-07-06','2011-07-12')
INSERT INTO #WEEKS VALUES (2011,7,'2011-07-13','2011-07-19')
INSERT INTO #WEEKS VALUES (2011,8,'2011-07-20','2011-07-26')
INSERT INTO #WEEKS VALUES (2011,9,'2011-07-27','2011-08-02')
INSERT INTO #WEEKS VALUES (2011,10,'2011-08-03','2011-08-09')
INSERT INTO #WEEKS VALUES (2011,11,'2011-08-10','2011-08-16')
INSERT INTO #WEEKS VALUES (2011,12,'2011-08-17','2011-08-23')
INSERT INTO #WEEKS VALUES (2011,13,'2011-08-24','2011-08-30')
INSERT INTO #WEEKS VALUES (2011,14,'2011-08-31','2011-09-06')
INSERT INTO #WEEKS VALUES (2011,15,'2011-09-07','2011-09-13')
INSERT INTO #WEEKS VALUES (2011,16,'2011-09-14','2011-09-20')
INSERT INTO #WEEKS VALUES (2011,17,'2011-09-21','2011-09-27')
INSERT INTO #WEEKS VALUES (2011,18,'2011-09-28','2011-10-04')
INSERT INTO #WEEKS VALUES (2011,19,'2011-10-05','2011-10-11')
INSERT INTO #WEEKS VALUES (2011,20,'2011-10-12','2011-10-18')
INSERT INTO #WEEKS VALUES (2011,21,'2011-10-19','2011-10-25')
INSERT INTO #WEEKS VALUES (2011,22,'2011-10-26','2011-11-01')
INSERT INTO #WEEKS VALUES (2011,23,'2011-11-02','2011-11-08')
INSERT INTO #WEEKS VALUES (2011,24,'2011-11-09','2011-11-15')
INSERT INTO #WEEKS VALUES (2011,25,'2011-11-16','2011-11-22')
INSERT INTO #WEEKS VALUES (2011,26,'2011-11-23','2011-11-29')
INSERT INTO #WEEKS VALUES (2011,27,'2011-11-30','2011-12-06')
INSERT INTO #WEEKS VALUES (2011,28,'2011-12-07','2011-12-13')
INSERT INTO #WEEKS VALUES (2011,29,'2011-12-14','2011-12-20')
INSERT INTO #WEEKS VALUES (2011,30,'2011-12-21','2011-12-27')
INSERT INTO #WEEKS VALUES (2011,31,'2011-12-28','2012-01-03')
INSERT INTO #WEEKS VALUES (2011,32,'2012-01-04','2012-01-10')
INSERT INTO #WEEKS VALUES (2011,33,'2012-01-11','2012-01-17')
INSERT INTO #WEEKS VALUES (2011,34,'2012-01-18','2012-01-24')
INSERT INTO #WEEKS VALUES (2011,35,'2012-01-25','2012-01-31')
INSERT INTO #WEEKS VALUES (2011,36,'2012-02-01','2012-02-07')
INSERT INTO #WEEKS VALUES (2011,37,'2012-02-08','2012-02-14')
INSERT INTO #WEEKS VALUES (2011,38,'2012-02-15','2012-02-21')
INSERT INTO #WEEKS VALUES (2011,39,'2012-02-22','2012-02-29')
INSERT INTO #WEEKS VALUES (2011,40,'2012-03-01','2012-03-07')
INSERT INTO #WEEKS VALUES (2011,41,'2012-03-08','2012-03-14')
INSERT INTO #WEEKS VALUES (2011,42,'2012-03-15','2012-03-21')
INSERT INTO #WEEKS VALUES (2011,43,'2012-03-22','2012-03-28')
INSERT INTO #WEEKS VALUES (2011,44,'2012-03-29','2012-04-04')
INSERT INTO #WEEKS VALUES (2011,45,'2012-04-05','2012-04-11')
INSERT INTO #WEEKS VALUES (2011,46,'2012-04-12','2012-04-18')
INSERT INTO #WEEKS VALUES (2011,47,'2012-04-19','2012-04-25')
INSERT INTO #WEEKS VALUES (2011,48,'2012-04-26','2012-05-02')
INSERT INTO #WEEKS VALUES (2011,49,'2012-05-03','2012-05-09')
INSERT INTO #WEEKS VALUES (2011,50,'2012-05-10','2012-05-16')
INSERT INTO #WEEKS VALUES (2011,51,'2012-05-17','2012-05-23')
INSERT INTO #WEEKS VALUES (2011,52,'2012-05-24','2012-05-31')
INSERT INTO #WEEKS VALUES (2012,1,'2012-06-01','2012-06-07')
INSERT INTO #WEEKS VALUES (2012,2,'2012-06-08','2012-06-14')
INSERT INTO #WEEKS VALUES (2012,3,'2012-06-15','2012-06-21')
INSERT INTO #WEEKS VALUES (2012,4,'2012-06-22','2012-06-28')
INSERT INTO #WEEKS VALUES (2012,5,'2012-06-29','2012-07-05')
INSERT INTO #WEEKS VALUES (2012,6,'2012-07-06','2012-07-12')
INSERT INTO #WEEKS VALUES (2012,7,'2012-07-13','2012-07-19')
INSERT INTO #WEEKS VALUES (2012,8,'2012-07-20','2012-07-26')
INSERT INTO #WEEKS VALUES (2012,9,'2012-07-27','2012-08-02')
INSERT INTO #WEEKS VALUES (2012,10,'2012-08-03','2012-08-09')
INSERT INTO #WEEKS VALUES (2012,11,'2012-08-10','2012-08-16')
INSERT INTO #WEEKS VALUES (2012,12,'2012-08-17','2012-08-23')
INSERT INTO #WEEKS VALUES (2012,13,'2012-08-24','2012-08-30')
INSERT INTO #WEEKS VALUES (2012,14,'2012-08-31','2012-09-06')
INSERT INTO #WEEKS VALUES (2012,15,'2012-09-07','2012-09-13')
INSERT INTO #WEEKS VALUES (2012,16,'2012-09-14','2012-09-20')
INSERT INTO #WEEKS VALUES (2012,17,'2012-09-21','2012-09-27')
INSERT INTO #WEEKS VALUES (2012,18,'2012-09-28','2012-10-04')
INSERT INTO #WEEKS VALUES (2012,19,'2012-10-05','2012-10-11')
INSERT INTO #WEEKS VALUES (2012,20,'2012-10-12','2012-10-18')
INSERT INTO #WEEKS VALUES (2012,21,'2012-10-19','2012-10-25')
INSERT INTO #WEEKS VALUES (2012,22,'2012-10-26','2012-11-01')
INSERT INTO #WEEKS VALUES (2012,23,'2012-11-02','2012-11-08')
INSERT INTO #WEEKS VALUES (2012,24,'2012-11-09','2012-11-15')
INSERT INTO #WEEKS VALUES (2012,25,'2012-11-16','2012-11-22')
INSERT INTO #WEEKS VALUES (2012,26,'2012-11-23','2012-11-29')
INSERT INTO #WEEKS VALUES (2012,27,'2012-11-30','2012-12-06')
INSERT INTO #WEEKS VALUES (2012,28,'2012-12-07','2012-12-13')
INSERT INTO #WEEKS VALUES (2012,29,'2012-12-14','2012-12-20')
INSERT INTO #WEEKS VALUES (2012,30,'2012-12-21','2012-12-27')
INSERT INTO #WEEKS VALUES (2012,31,'2012-12-28','2013-01-03')
INSERT INTO #WEEKS VALUES (2012,32,'2013-01-04','2013-01-10')
INSERT INTO #WEEKS VALUES (2012,33,'2013-01-11','2013-01-17')
INSERT INTO #WEEKS VALUES (2012,34,'2013-01-18','2013-01-24')
INSERT INTO #WEEKS VALUES (2012,35,'2013-01-25','2013-01-31')
INSERT INTO #WEEKS VALUES (2012,36,'2013-02-01','2013-02-07')
INSERT INTO #WEEKS VALUES (2012,37,'2013-02-08','2013-02-14')
INSERT INTO #WEEKS VALUES (2012,38,'2013-02-15','2013-02-21')
INSERT INTO #WEEKS VALUES (2012,39,'2013-02-22','2013-02-28')
INSERT INTO #WEEKS VALUES (2012,40,'2013-03-01','2013-03-07')
INSERT INTO #WEEKS VALUES (2012,41,'2013-03-08','2013-03-14')
INSERT INTO #WEEKS VALUES (2012,42,'2013-03-15','2013-03-21')
INSERT INTO #WEEKS VALUES (2012,43,'2013-03-22','2013-03-28')
INSERT INTO #WEEKS VALUES (2012,44,'2013-03-29','2013-04-04')
INSERT INTO #WEEKS VALUES (2012,45,'2013-04-05','2013-04-11')
INSERT INTO #WEEKS VALUES (2012,46,'2013-04-12','2013-04-18')
INSERT INTO #WEEKS VALUES (2012,47,'2013-04-19','2013-04-25')
INSERT INTO #WEEKS VALUES (2012,48,'2013-04-26','2013-05-02')
INSERT INTO #WEEKS VALUES (2012,49,'2013-05-03','2013-05-09')
INSERT INTO #WEEKS VALUES (2012,50,'2013-05-10','2013-05-16')
INSERT INTO #WEEKS VALUES (2012,51,'2013-05-17','2013-05-23')
INSERT INTO #WEEKS VALUES (2012,52,'2013-05-24','2013-05-31')
INSERT INTO #WEEKS VALUES (2013,1,'2013-06-01','2013-06-07')
INSERT INTO #WEEKS VALUES (2013,2,'2013-06-08','2013-06-14')
INSERT INTO #WEEKS VALUES (2013,3,'2013-06-15','2013-06-21')
INSERT INTO #WEEKS VALUES (2013,4,'2013-06-22','2013-06-28')
INSERT INTO #WEEKS VALUES (2013,5,'2013-06-29','2013-07-05')
INSERT INTO #WEEKS VALUES (2013,6,'2013-07-06','2013-07-12')
INSERT INTO #WEEKS VALUES (2013,7,'2013-07-13','2013-07-19')
INSERT INTO #WEEKS VALUES (2013,8,'2013-07-20','2013-07-26')
INSERT INTO #WEEKS VALUES (2013,9,'2013-07-27','2013-08-02')
INSERT INTO #WEEKS VALUES (2013,10,'2013-08-03','2013-08-09')
INSERT INTO #WEEKS VALUES (2013,11,'2013-08-10','2013-08-16')
INSERT INTO #WEEKS VALUES (2013,12,'2013-08-17','2013-08-23')
INSERT INTO #WEEKS VALUES (2013,13,'2013-08-24','2013-08-30')
INSERT INTO #WEEKS VALUES (2013,14,'2013-08-31','2013-09-06')
INSERT INTO #WEEKS VALUES (2013,15,'2013-09-07','2013-09-13')
INSERT INTO #WEEKS VALUES (2013,16,'2013-09-14','2013-09-20')
INSERT INTO #WEEKS VALUES (2013,17,'2013-09-21','2013-09-27')
INSERT INTO #WEEKS VALUES (2013,18,'2013-09-28','2013-10-04')
INSERT INTO #WEEKS VALUES (2013,19,'2013-10-05','2013-10-11')
INSERT INTO #WEEKS VALUES (2013,20,'2013-10-12','2013-10-18')
INSERT INTO #WEEKS VALUES (2013,21,'2013-10-19','2013-10-25')
INSERT INTO #WEEKS VALUES (2013,22,'2013-10-26','2013-11-01')
INSERT INTO #WEEKS VALUES (2013,23,'2013-11-02','2013-11-08')
INSERT INTO #WEEKS VALUES (2013,24,'2013-11-09','2013-11-15')
INSERT INTO #WEEKS VALUES (2013,25,'2013-11-16','2013-11-22')
INSERT INTO #WEEKS VALUES (2013,26,'2013-11-23','2013-11-29')
INSERT INTO #WEEKS VALUES (2013,27,'2013-11-30','2013-12-06')
INSERT INTO #WEEKS VALUES (2013,28,'2013-12-07','2013-12-13')
INSERT INTO #WEEKS VALUES (2013,29,'2013-12-14','2013-12-20')
INSERT INTO #WEEKS VALUES (2013,30,'2013-12-21','2013-12-27')
INSERT INTO #WEEKS VALUES (2013,31,'2013-12-28','2014-01-03')
INSERT INTO #WEEKS VALUES (2013,32,'2014-01-04','2014-01-10')
INSERT INTO #WEEKS VALUES (2013,33,'2014-01-11','2014-01-17')
INSERT INTO #WEEKS VALUES (2013,34,'2014-01-18','2014-01-24')
INSERT INTO #WEEKS VALUES (2013,35,'2014-01-25','2014-01-31')
INSERT INTO #WEEKS VALUES (2013,36,'2014-02-01','2014-02-07')
INSERT INTO #WEEKS VALUES (2013,37,'2014-02-08','2014-02-14')
INSERT INTO #WEEKS VALUES (2013,38,'2014-02-15','2014-02-21')
INSERT INTO #WEEKS VALUES (2013,39,'2014-02-22','2014-02-28')
INSERT INTO #WEEKS VALUES (2013,40,'2014-03-01','2014-03-07')
INSERT INTO #WEEKS VALUES (2013,41,'2014-03-08','2014-03-14')
INSERT INTO #WEEKS VALUES (2013,42,'2014-03-15','2014-03-21')
INSERT INTO #WEEKS VALUES (2013,43,'2014-03-22','2014-03-28')
INSERT INTO #WEEKS VALUES (2013,44,'2014-03-29','2014-04-04')
INSERT INTO #WEEKS VALUES (2013,45,'2014-04-05','2014-04-11')
INSERT INTO #WEEKS VALUES (2013,46,'2014-04-12','2014-04-18')
INSERT INTO #WEEKS VALUES (2013,47,'2014-04-19','2014-04-25')
INSERT INTO #WEEKS VALUES (2013,48,'2014-04-26','2014-05-02')
INSERT INTO #WEEKS VALUES (2013,49,'2014-05-03','2014-05-09')
INSERT INTO #WEEKS VALUES (2013,50,'2014-05-10','2014-05-16')
INSERT INTO #WEEKS VALUES (2013,51,'2014-05-17','2014-05-23')
INSERT INTO #WEEKS VALUES (2013,52,'2014-05-24','2014-05-31')
GO
/* In production, this would come from GL30000 or the history table  */
WITH integers(i) AS
(
    SELECT 0 AS i 
    UNION ALL
    SELECT i + 1 FROM integers WHERE i < 10
)
INSERT INTO #ProfitLossDaily (TRXDATE, CRDTAMT, DEBITAMT)
    SELECT 
        DATEADD(day,i, WEEK_STARTING) AS TRXDATE, 
        ABS(CHECKSUM(NewId())) % 1100 AS CRDTAMT, /* random number */
        ABS(CHECKSUM(NewId())) % 1000 AS DEBITAMT /* random number */
    FROM #WEEKS, integers 
    WHERE DATEADD(day,i, WEEK_STARTING) BETWEEN WEEK_STARTING AND WEEK_ENDING
        AND YEAR BETWEEN 2005 AND 2011
        AND DATEADD(day,i, WEEK_STARTING) < CURRENT_TIMESTAMP
GO
Where to find practical well-designed database schema examples to learn from?

Where to find practical well-designed database schema examples to learn from?


By : Sean2013
Date : March 29 2020, 07:55 AM
I hope this helps you . This is a great source of example database schema's.
I can also recommend Beginning Database Design, published by Apress. I own this book and can confirm that it is of high quality. The book looks at a number of real world scenarios and explains the impact a certain design decision could have on the way the database works and the quality of the data and its output.
Is approx() designed to be used with complex numbers?

Is approx() designed to be used with complex numbers?


By : JAY KSHATRIYA SHAKTA
Date : March 29 2020, 07:55 AM
it helps some times Looks intentional and reliable to me, as approx() calls regularize.values(), which calls xy.coords(), which includes this code block:
code :
else if (is.complex(x)) {
    y <- Im(x)
    x <- Re(x)
    xlab <- paste0("Re(", ylab, ")")
    ylab <- paste0("Im(", ylab, ")")
}
Related Posts Related Posts :
  • Problem PHP with cURL
  • JQuery and PHP validation problem?
  • Join with three tables
  • Using windows authentication with php?
  • Uploading images from server using Php
  • Adding a third table to a Join
  • how to write this conditions in php
  • MySQL: Get only count of result set
  • PHP OOP about reference
  • the data can't display in the form
  • Pass-by-Reference Error
  • php boolean help
  • Problem with PHP & MySQL
  • How to implement a Bloom Filter in PHP?
  • Calling C/C++ library function from PHP
  • Fancybox for .flv
  • <? ?> tags not working in php 5.3.1
  • Remove a child from an array in PHP?
  • problems with sending mail
  • shadow password
  • change password
  • how to convert object into string in php
  • sort associative array PHP
  • encryption in php
  • PHP: line charts
  • Rewrite URL in PHP without htaccess
  • PHP import functions
  • PHP AND SOAP. Change envelope
  • Is this query vulnerable to sql injection?
  • how to submit a from with validation in PHP?
  • Enter ID instead of name on submit (form)
  • using a href (html)tag along with PHP
  • About Php development
  • Paypal integration with PHP
  • how to use a pear package?
  • How to enable PDO_MYSQL for CLI?
  • php variable scope in oop
  • Why can't I use a constant in a php object?
  • select top 50 records from sql
  • encoding problem
  • How do I make a HTTP POST request to an url from within a c++ dll?
  • Saving image to server with php
  • help with validate field
  • PHP Get only a part of the full path
  • How to declare more than one header on PHP
  • How to write in pdo method
  • Options for PHP CLI on windows
  • Which is the best php opensource e-commerce for handle 5 million prducts import daily?
  • $_SERVER['HTTP_X_REQUESTED_WITH'] seemingly not available on PHP 5.1.6
  • radio value lost by $_post array
  • Tool to add code highlighting and export to HTML
  • youtube video downloaded successfully on local, but on server(online) only 0 byte flv is downloading
  • Populating a Dropdown list in PHP dynamically
  • Why is turning magic_quotes_gpc on considered a bad practice?
  • Replace html text in javascript include
  • OOP Design - Where/When do you Validate properties?
  • RSA Encrypt in PHP to decrypt in .NET
  • Encrypting with Perl CBC and decrypting with PHP mcrypt
  • Code equivalence between Javascript and PHP
  • How to track DHL in our site from DHL site , by PHP
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk