Skip to content

Instantly share code, notes, and snippets.

@Znow
Created October 8, 2012 09:02
Show Gist options
  • Save Znow/3851524 to your computer and use it in GitHub Desktop.
Save Znow/3851524 to your computer and use it in GitHub Desktop.
If a item is clicked, record a session about that item
<?php session_start(); $_SESSION; ?>
[two-thirds-column]
<h3>Har du spørgsmål?</h3>
Så kontakt os på nedenstående formular og vi vil besvare hurtigst muligt.
[contact-form]
[/two-thirds-column]
[one-third-column]
<h3>Firma</h3>
<h5>IT Consult Management</h5>
Kim +45 51 51 00 44
Michael +45 26 23 35 57
Daniel +45 27 59 29 21
CVR: 34501157
<a href="mailto:[email protected]">[email protected]</a>
<h5>Find os på Facebook:
<a href="http://www.facebook.com/pages/ICM/211535088952351" target="_blank"><img class="alignnone size-full wp-image-57" title="facebook_icon&amp;32" src="http://icman.dk/wp-content/uploads/1340109986_Facebook.png" alt="" width="48" height="48" /></a></h5>
[/one-third-column]
[pricing_column icon="black/cloud_icon&amp;48.png" title="PC Tjek" amount="Gratis" amount_detail=""]
Vi tilbyder at lave et gratis tjek af deres PC.
[ul]
[li]Fejlfinding[/li]
[li]Tjek af sårbarheder[/li]
[li]Tjek af systemfejl[/li]
[li]Tjek af harddiskfejl[/li]
[/ul]
<?php session_start(); ?>
<?php if(isset($_REQUEST['button1'])) { $_SESSION['product'] = "PC Tjek" } else if(isset($_REQUEST['button2'])) { $_SESSION['product'] = "Optimering" } else if(isset($_REQUEST['button3'])) { $_SESSION['product'] = "Besøg på adressen" } ?>
[button id="button1" featured=1 url="kontakt"]Vælg[/button]
[/pricing_column]
[pricing_column featured=1 icon="black/box_icon&amp;48.png" title="Optimering" amount="250kr" amount_detail="/time"]
Vi tilbyder at optimere deres PC via Fjern-support.
[ul]
[li]Scanne for Anti-Virus, Malware & Spyware[/li]
[li]Defragmentere[/li]
[li]Rense harddisk for unødvendige ting[/li]
[/ul]
[button id="button1" featured=1 url="kontakt"]Vælg[/button]
[/pricing_column]
[pricing_column icon="black/dashboard_icon&amp;48.png" title="Besøg på adressen" amount="400kr" amount_detail="/time"]
Vi tilbyder at optimere/fixe deres PC ude på adressen.
[ul]
[li]Helhedstjek[/li]
[li]Fejl som ikke kan rettes over fjern-support[/li]
[/ul]
[button id="button3" name="button1" featured=1 url="kontakt"]Vælg[/button]
[/pricing_column]
[one-third-column]
Betaling sker via bank overførsel eller kontant afregning.
[/one-third-column]
// Button
// add_shortcode ('button', 'spark_button_shortcode');
// function spark_button_shortcode($atts, $content = null){
// $extra_class = ($atts['featured']) ? 'featured' : '';
// $extra_class.= ($atts['url'][0] =='#') ? ' animate' : ''; // Internal link?
// return '<a href="'.$atts['url'].'" class="button '.$extra_class.'">'.$content.'</a>';
// }
// Button
add_shortcode ('button', 'spark_button_shortcode');
function spark_button_shortcode($atts, $content = null){
$extra_class = ($atts['featured']) ? 'featured' : '';
$extra_class.= ($atts['url'][0] =='#') ? ' animate' : ''; // Internal link?
return '<a href="'.$atts['url'].'" id="'.$atts['id'].'" class="button '.$extra_class.'">'.$content.'</a>';
}
// Contact form
// Email address defined in ThemeOption page
add_shortcode('contact-form', 'spark_contact_form_shortcode');
function spark_contact_form_shortcode() {
$return = <<<FORM
<form action="{$template_url_path}/php/others/ajax.php" method="post" class="send-with-ajax">
<div class="row">
<div class="three columns alpha">
<label for="form-name">Dit Navn *<span></span></label>
</div>
<div class="seven columns omega">
<input type="text" name="name" id="form-name" placeholder="Dit navn" required="*" />
</div>
</div>
<div class="row">
<div class="three columns alpha">
<label for="form-email">Din Email *<span></span></label>
</div>
<div class="seven columns omega">
<input type="email" name="email" id="form-email" placeholder="[email protected]" required="*" />
</div>
</div>
<div class="row">
<div class="three columns alpha">
<label for="form-product">Valgt produkt<span></span></label>
</div>
<div class="seven columns omega">
<input type="text" name="product" id="form-product" value="{$_SESSION['product']}" readonly="readonly" />
</div>
</div>
FORM;
var_dump($_SESSION['product']);
$return .= <<<FORM
<div class="row">
<div class="three columns alpha">
<label for="form-message">Besked</label>
</div>
<div class="seven columns omega">
<label for="form-besked">* = Skal udfyldes</label>
<textarea name="besked" id="form-message"></textarea>
</div>
</div>
<div class="seven columns offset-by-three">
<button type="send">Send Beskeden</button>
<div class="ajax-response"></div>
</div>
</form>
FORM;
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment