Tag: design

Calendar Blackout Dates

I’ve been working on a friends site over at JKBinstalls.co.nz It’s nothing too crazy but has a form or a couple forms that can help them with setting up appointments, the general put your name, email and a few details about what your looking for.

The interesting bit came through with adding a calendar so you can pick what day you want the guys to come around. General jQuery datepicker showing inline which is all well and good except we needed the ability to block out the dates they can’t get around as they are already booked out.

This doesn’t seem to be something that is done very often in the way I’m looking for, possibly because it’s in wordpress or php or html or mysql or maybe I just don’t know the right tools for doing this, or I’m just searching the wrong key words. I’m running a backend page that looks pretty much the same as the front end but behind a login and only has the datepicker, this drops the date in a mysql database but bringing that array back into the front end page to block off the dates took a minute to figure out.

The database comes back in as an array and needs to be converted a single variable which can then be thrown into the script tag, this is the front end form.




get_col( "SELECT dates FROM jkb_blackout;" );
$string = '';

foreach ($array as $key => $value) {
$string .= ",$value";
}
?>

 

Then the code for the functions.php file



// deals with variable set through form _POST
// Blackout
function prefix_admin_black() {

// deal with the upload
if ( ! function_exists( ‘wp_handle_upload’ ) ) {
require_once( ABSPATH . ‘wp-admin/includes/file.php’ );
}

// Extremley Important to set
global $wpdb;

// Whats inserted
$wpdb->insert( jkb_blackout ,
array(
‘dates’ => $_POST[‘dates’]
)
);

// this give the unid in the next url
$id = $wpdb->insert_id;

// fail safe if above zero was inserted to database
if ($id>0) {
// Redirect
wp_redirect( home_url() . ‘/black’ );

} else {
// Redirect
wp_redirect( home_url() . ‘/sorry’ );
}

exit();

}
add_action( ‘admin_post_black’, ‘prefix_admin_black’ );
add_action( ‘admin_post_nopriv_black’, ‘prefix_admin_black’ );

I’m missing stuff on the fail states, errors security and things like that but for right now it’s working and you can check out some dates that have been blacked out on http://www.jkbinstalls.co.nz/rangehood/

Skate Rooster

As one of those things I’ve always been meaning to do I got a un-cut blank for my next skate deck, I wasn’t exactly sure of how to make it into something and just made some of it up along the way, anyway the shape is kinda what I was skating with Santa Cruz and the graphic is freehand acrylic pen based on the srircha hot sauce bottle that for some reason I thought would work for a graphic on something or other.

skateboard graphic

CHK Pig Hunting Season

Apparently we are coming into pig hunting season so I’ve just worked up a new ad for Canterbury Homekill, running relatively small in the local paper, hence the need to push the name out stronger than just in the logo.canterbury homelike newspaper ad

JKB Re-branding & Card

I worked on the JKB logo a while back but as a small company the branding was pretty minimal but we had a little something happening but as it was a good time to update we have worked together to create this new logo and business card.
jkb buisness card
jkb business card back

Wedding Invite

I helped out a friend with an invite and a few other pieces for his big day, not in my usual style but nice to work on something different and with a little help of stock borders.
jania andrew wedding invites

Katerina.co.nz

As mentioned in my previous blog post I have been working on a new e-commerce site, well it’s live at katerina.co.nz, based on woo themes with a few tweaks, it’s cost effective but also has a few extra things that don’t come out of the packet.
Photography of garment and cover photo are also mine.
website preview

Sale Only Woocommerce

So away from my normal post of the media I’ve been creating and to a little something that I couldn’t find and took way too long to do something very simple. I’ve been working on a site that was almost done and they wished to have a Sale page so when anything goes on sale it automatically gets put onto the page, I’m only slightly editing a woo theme so used woo commerce which to be fair I’m not too familiar with but this is something I’ve seen on many site so didn’t hesitate at the request. I could be wrong in the best way to do this but the way I have found it possible and easy to do was

  1. head to my themes folder and find the page.php file
  2. copy this and rename page-sale.php
  3. add the custom-page template code to the top of the page
  4. <?php
    /*
    Template Name: sale
    */
    ?>

  5. get to the site’s dashboard and create a new page
  6. title it sale and in the text editor side of the content type 

    [sale_products]

  7. change the template to sale
  8. publish and done in a minute flat