Skip to content

Instantly share code, notes, and snippets.

View chukShirley's full-sized avatar

Chuk Shirley chukShirley

  • Sure Consulting LLC
  • Alabama
View GitHub Profile
@chukShirley
chukShirley / ItemsGateway.php
Created January 20, 2015 13:37
Zend Data Cache
class ItemsGateway extends AbstractGateway
{
protected $table = 'SCF906';
public function fetchAll()
{
// Try to fetch from the cache first
$response = zend_shm_cache_fetch('itemCodes');
// If itemCodes list isn't in cache
INSERT INTO MYLIB/MYTABLE
(PEDDLER, ITEM, SCHEME, TYPE, PERCENTAGE, DEDUCTION, FIXED_AMOUNT, UNIT_OF_MEASURE, DESCRIPTION)
VALUES (:peddlerId, :itemId, :scheme, :type, :percentage, :deduction, :fixedAmount, :unitOfMeasure);
# Created by Zend Server
<VirtualHost *:${port}>
# Make ZF2 path available as environment variable
SetEnv ZF2_PATH /usr/local/zendsvr6/share/ZendFramework2/library
# Tell apache to serve index.php if the requested resource doesn't exist.
# This allows static files to be served directly while "ZF-friendly URLS"
# are sent to index.php
@chukShirley
chukShirley / InputXml.xml
Last active August 29, 2015 14:12
Toolkit calling RPG
<?xml version="1.0" encoding="ISO-8859-1" ?>
<script>
<pgm name='RDSCF19' lib='CHIP'>
<parm comment=''>
<ds var='result' comment='Multi-occur container' array='on'>
<ds dim='100'>
<data var='adr' type='7s0'>0</data><data var='nam' type='30A' /><data var='drl' type='20A' /></ds>
</ds>
</parm>
</pgm>
<div class="ngCellText" ng-class="col.colIndex()" style="padding-top:5px; padding-left:5px;">
<span ng-cell-text>
{{console.log(row)}}
{{row.getProperty(col.id)}}
<button type="button" class="btn btn-sm btn-default" title="Edit peddler">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="btn btn-sm btn-default" title="Pricing forumulas" ng-click="viewPricingFormulas()">
<span class="glyphicon glyphicon-usd"></span>
@chukShirley
chukShirley / index.html
Last active August 29, 2015 14:08
Append params to form before submit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<form name="real" id="real" method="POST" action="submit.php">
<input type="submit" value="submit real form">
</form>
@chukShirley
chukShirley / index.html
Last active August 29, 2015 14:07
Submit HTML Bootstrap form via AJAX
<div class="row">
<div class="col-xs-12">
<form class="form-horizontal" role="form" id="myForm">
<div class="alert alert-danger hidden" id="formError"></div>
<div class="form-group" id="fieldContainer">
<label for="field" class="col-sm-2 control-label">My Field</label>
<div class="col-sm-3">
<input class="form-control" id="myField" name="myField" type="text" />
@chukShirley
chukShirley / delete.html
Last active August 29, 2015 14:07
AJAX delete supplier
<html>
<body>
<!-- Can be any kind of input as long as id is "supplierId" -->
<input type="hidden" id="supplierId">
<button class="btn btn-default" id="supplier_deleteButton">Delete Supplier</button>
</body>
</html>
@chukShirley
chukShirley / gist:f67f1b56f78036ee08cf
Created October 8, 2014 13:11
Using PHP Toolkit for IBM i to call CL program
// Instantiate toolkit object
try{
$ToolkitServiceObj = ToolkitService::getInstance($db, $namingMode);
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
exit();
}
$ToolkitServiceObj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user",
'service_manager' => array (
'invokables' => array (
'AuthorizationIbmi' => 'authorization.php',
),
'factories' => array(
'dbadapter' => function($sm) {
// DB adapter config
},
'tkconn' => function ($sm) {
$dbAdapter = $sm->get('dbadapter');