A bit of php programming…

I do this type of programming about 4 times a year and each time I have to lookup how to compare dates in php. There are so many options and some make it out to be so complicated I thought I would just thru my answer into the pool. The following code is used to display a message depending on the date. Basically it announces a business will be closed for a holiday.

I use a multidimensional array to hold the holiday information, then go thru it to see if it needs to be displayed. This is also setup so that more than one message could appear at any given time (usually around Christmas & New Years). As you can see from my array, I supplied 2 dates – start date and end date.

array definition: collection = array(start date, end date, first line of message, second line of message)

php code :

<?

$holidays = array(
“Easter”=>array(’2013-03-20′,’2013-03-30′,’Friday March 29th’,'in recognition of Good Friday’),
“MemDay”=>array(’2013-05-15′,’2013-05-28′,’Monday May 27th’,'in recognition of Memorial Day’),
“IndDay”=>array(’2013-06-25′,’2013-07-05′,’Thursday July 4th’,'in recognition of the 4th of July’),
“LabDay”=>array(’2013-08-15′,’2013-09-03′,’Monday September 2nd’,'in recognition of Labor Day’),
“Christmas”=>array(’2013-12-10′,’2013-12-26′,’Tues December 24th & Wed, December 25th’,'in recognition of Christmas’),
“NewYear”=>array(’2013-12-12′,’2014-01-02′,’Wed January 1st’,'in recognition of New Years Day’)
);

$txtMsg = ‘<p>We will be closed<br /> ‘;
$MsgCount = 0;
$today = date(“Y-m-d”);
foreach ($holidays as $value)
{

if (date($value[0])<$today && date($value[1])>$today)
{
$msgCount++;
$txtMsg .= ‘* <span>’.$value[2].’</span> * <br />’;
$txtMsg .= $value[3].’</p>’;
}
}

if ($msgCount >0) {
print $txtMsg;
}

?>

I could have had the php code write out the day of the week, Month name etc, but because of limited space where this is being placed on the web page, I wanted to control what was displayed. For example, where Christmas is 2 days, writing out the complete names of the days would have caused it to wrap around and look out of place on the web page. But you sure could do that if you wanted to.

I actually have an excel worksheet that has this data in it and does the calculations for me to set the start date 10 days ahead of the shutdown date.

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Digital, Internet, Web Design | Leave a comment

Passing along another giveaway – quick … 12/18 & 12/20

SVG Cuts is giving away away a Silhouette Cameo

12 Days of Christmas – Silhouette CAMEO Giveaway – Days 1, 4, 7, 10 and 12

You must enter the day of the drawing, but oh what fun you could be having!

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Scrapbooking | Leave a comment

Quick, Cute, Cuddle Blankie

PInkCamoCuddleBlankieTell me this isn’t the cutest little Pink Camo Cuddle Blankie you have ever seen! Come on, I dare you! It’s about 24″ square, just the right size for a little girl to grab it, hug it and giggle as she runs down the hall way!

It’s made out of that really soft minky material – it was a learning process and challenge to understand how to sew it together, but it turned out so cute! It was a great winter weekend project (only took about 2 hours to put together).

I saw the kit and pattern at a LQS and picked it up, threw out the pattern and did my own. Basically take the two pieces put them right sides together. I took a large bowl from the kitchen to use as the template for the rounded corners – cut right around the bowl with my rotary blade. Pinned it loosely, and sewed it together.

I left about a 5″ hole to get be able to reverse it. Pressed it lightly and sewed around the outer edge. There is no filling, no form to this at all, which makes it even more of a cuddle blankie in my opinion.

Snap, crakle & pop it’s done.

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Quilting | Leave a comment

YEAH!!!!!

“The path of peace is not a passive journey. It takes incredible strength not to open a can of ‘whoop-ass’, justifiably, when ones button is pushed.”
― T.F. Hodge

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in General | Leave a comment

Something has gotten lost in the world of today.

It is good to have an end to journey toward; but it is the journey that matters, in the end.”
― Ernest Hemingway

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in General | Leave a comment

MS Access Report – duplex, page breaks on Group Break

I haven’t done a computer related post for awhile so I thought I would write this up so that I can find it the next time I need to do this.

I am setting up a reporting tool to print out inventory counting sheets. We want them to break on a group AND start each group on an odd page number. So being the great googler that I am, of course, I googled. Boy did I ever get a hodge-podge of answers.  After trying about 8 of them and having them all mixed together and nothing was working, I decided to do an overall look of what they were doing and start from scratch.

So, here is what worked:

  1. Create your report, create a sort/group with header & footer displaying.
  2. In the footer itself -
    I put a line of text that says “This page is blank for pagination”
    On the Design Tab: Controls -> Insert Page Break
    This will appear as a set of small dots – nothing else.

On the Property Sheet:

  1. Group Header:
    FORMAT: Force New Page: Before Section
  2. Group Footer:
    FORMAT: Force New Page: Before Section
    EVENT: On Format: Event Procedure

    Here is the code that I have for that Event Procedure:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Me.GroupFooter0.Visible = ((Me.Page Mod 2) = 0)
End Sub

GroupFooter0 is the name of my group, you will have to change that to what your footer is named.

Goods & Bads:

  • Good: you get a blank page so that each group will start on a odd page number – for duplex printing
  • Bad: the page header also prints out on that blank page. This was okay with me, so I left it.

 

 

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Access Database Programming | Leave a comment

SVG Cuts is giving away a CAMEO

Hurry, the give away only has a few days left – but who wouldn’t like to have one of these machines? I know I would! This give away ends on 10/7/2013.

 

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Card Making, Scrapbooking | Leave a comment

It’s about the presents Block

One of the greatest things about joining these two flickr.com BEE groups is that I get to do blocks that I wouldn’t normally choose to do on my own. For September, the hostess chose “It’s about the presents” block. A block made up of 4 smaller individual blocks. My biggest challenge this month  was that I couldn’t find my whole bin of Christmas fabric. I know it’s here, but I just don’t know where. It’s probably buried under a dozen other projects. Ugggg – I’ve got to get some of those completed.

Presents Block

Once thing I did different from the pattern on this block is that I did 4 of the bows in more of a natural look; meaning: they are not picture perfect. They are a little lopsided. It’s a 50/50 for me, I like the individualism, but it’s not as neat. But I really like the individualism…It’s a never ending argument with me sometimes!

Happy Fall!

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Quilting, We BEE Learning - Flickr.com Group | Leave a comment

October – We Be With It – Walk in the woods Block

For my “We Be With It” Flickr.com group this month, I am the hostess.

Fall is my favorite time of the year – I love the crisp air in the morning & evenings, the warm sunshine during the day, and the cool nights make for great snuggling time with your honey!

So, for my block this month I have chosen the Shattered Chevron Block pattern and I am calling it “A Walk in the Woods”.  walkinthewoodsThe color palette I have chosen is black, grey, brownish for the middle chevrons (representing a path – so think rocks & dirt), and the long top and bottom pieces I would like fall foliage colors (muted yellows & greens, red, orange, brown – think fall colors).  In the tutorial for the Broken Chevrons pattern that I am referencing, they have you put a white border around the block, please do not do this. The pattern creates a 10″ (10.5″ unfinished) square.

I ran out of time last month, so I didn’t get a chance to make up a couple of actual blocks as examples, I will do that by this weekend. I hope that the illustration I have above will help you to understand my vision.

 

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in General, Quilting, We BEE With It - Flickr.com Group | Leave a comment

Strings attached – for We Be With It

This month’s block for my flickr.com group (We Be With It) are String Blocks.

They are an 8″ block and they went together so nicely I made 2 extra. They were a lot of fun to do.

8inch String Blocks

 

Click on any of these buttons to help us to maintain this website.      
CJO
Posted in Quilting, Sewing Bee, We BEE With It - Flickr.com Group | Leave a comment