Skip to content

Instantly share code, notes, and snippets.

View cgsmith's full-sized avatar
👋
Available to work on your projects!

Chris Smith cgsmith

👋
Available to work on your projects!
View GitHub Profile
@cgsmith
cgsmith / emailclient.php
Created March 15, 2012 16:50
Gearman - Mass email PDF's
<?php
# create our client object
$gmclient= new GearmanClient();
# add the default server (localhost)
$gmclient->addServer();
# run email client in the background
$arr = array($_GET['id'],$_GET['msg']);
$data = serialize($arr); //serialize to send data
@cgsmith
cgsmith / invoice-to-pdf.xml
Created April 9, 2013 23:31
Invoice to pdf error.
<!--
Copyright 2012 CGSmith.net, LLC (http://www.cgsmith.net/)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
<?php
$valveOpen = true;
$valveClose = true;
if ($valveOpen && $valveClose) {
$light = 1;
}elseif ($valveOpen && !$valveClose){
$light = 2;
}else{
$light = 3;
@cgsmith
cgsmith / paypal.php
Last active December 20, 2015 03:19
<?php
# Prepare Data to send
$params = array(
'USER' => trim($this->config->get($classname . '_mid')),
'VENDOR' => trim($this->config->get($classname . '_vendor')),
'PARTNER' => trim($this->config->get($classname . '_partner')),
'PWD' => trim($this->config->get($classname . '_key')),
'CREATESECURETOKEN' => 'Y',
'TRXTYPE' => $this->config->get($classname . '_mode'),
'AMT' => $amount,
<?php
$proxy = new SoapClient($host.$path);
$session = $proxy->login($user,$pass);
try {
$order = $proxy->salesOrderInfo($session,$increment_id,array(),'Test Addition',1);
try {
$shipmentId = $proxy->salesOrderShipmentCreate($session,$increment_id);
try {
$proxy->salesOrderShipmentAddTrack($session, $shipmentId, $carrier, 'FedEx Ground', $tracking_id);
echo 'Tracking created for '.$increment_id.'<br>';
@cgsmith
cgsmith / config.php
Created August 22, 2013 14:27
PHP Mail Configuration
<?php
/*
=========================================================================
General settings for language and database
=========================================================================
@cgsmith
cgsmith / header.php
Created October 4, 2013 00:16
Standard Jetz File
<link rel="stylesheet" href = "<?php echo $this->getThemePath(); ?>/css/jetz_css.css" />
<link href='http://fonts.googleapis.com/css?family=Audiowide' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Alex+Brush' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="header-container"><!-- start main container -->
<!-- logo section -->
@cgsmith
cgsmith / info.php
Created October 8, 2013 17:39
PHP Info Test
<?php
echo phpinfo();
?>
<input id="qty" type="text" value="" name="qty[]">
<input id="upc" type="text" value="" name="upc[]" disabled>
<input id="name" type="text" value="" name="name[]" disabled>
<input id="price" type="text" value="" name="price[]" disabled>
<input id="extprice" type="text" value="" name="extprice[]" disabled>
<br/>
<?php
// This is what the delete method looks like now
function delete($id) {
$bean = R::load($this->className,$id);
R::trash($bean);
$this->render($this->className.'/all','deleted');
}