Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/kjvdictionary_store/modules/store/view/ |
Upload File : |
<?php
class StoreAdmin_View extends View {
public function store_product_list() {
$html = <<<BLOCK
<h2 class="templateheader">{{page_title}}</h2>
<p>Select a product from the list below, or create a <a href="/admin/product/0/edit#general">new</a> one.</p>
<table class="display data-class" ajax="/admin/product/*/list">
<thead>
<tr>{{#each header}}
<th>{{caption}}</th>
{{/each}}</tr>
</thead>
</table>
BLOCK;
$this('store_product_list')->html($html)->Title('Products');
}
public function store_product() {
// hook_execute('component.add', FALSE, 'jstree');
$this('store_product')->html("<h2 class=\"templateheader\">{{page_title}}</h2>{{tabs 'product.tab' tabauth}}");
}
public function store_settings() {
$this('store_settings')->html("<h2 class=\"templateheader\">{{page_title}}</h2>{{tabs 'store.tab' tabauth}}")->Title('Store Settings');
}
public function store_product_tab_general() {
$button = hook_execute_late('html.button', '', 'update', 'fas fa-angle-double-right', 'cc-blue');
$html = <<<BLOCK
<form class="frm json" method="post">
<input type="hidden" name="tab" value="general">
<input type="hidden" name="auth" value="{{auth}}">
<div class="control-group sp-manu required">
<label for="sp_manu">Manufacturer</label>
<div class="controls">
<select id="sp_manu" name="sp_manu" style="width:600px">
{{#each list_manu}}<option value="{{key}}"{{#ifeq key @root/sp_manu}} selected{{/ifeq}}>{{value}}</option>{{/each}}
</select>
</div>
<div class="status-message" for="sp_manu"></div>
</div>
<div class="control-group sp-product required">
<label for="sp_product">Product Name</label>
<div class="controls"><input class="required" style="width:600px" id="sp_product" name="sp_product" size="30" type="text" value="{{sp_product}}"></div>
<div class="status-message" for="sp_product"></div>
</div>
<div class="control-group sp-desc">
<label for="sp_desc">Description</label>
<div class="controls"><textarea id="sp_desc" style="width:600px" name="sp_desc" class="admin-textarea" wrap="physical">{{sp_desc}}</textarea></div>
</div>
<div class="control-group sp-category required" title="this can be changed up until first order/sale. Variations, if used, are based on this field">
<label for="sp_category">Product Group</label>
<div class="controls">
<select id="sp_category" name="sp_category" style="width:559px">
{{#each list_group}}<option value="{{key}}"{{#ifeq key @root/sp_category}} selected{{/ifeq}}>{{value}}</option>{{/each}}
</select> {{#if sp_category}}<a href="{{_category}}" target="_blank" class="btn"><i class="fas fa-link"></i></a>{{/if}}
</div>
<div class="status-message" for="sp_category"></div>
</div>
<div class="control-group sp-sku required">
<label for="sp_sku">SKU (Required)</label>
<div class="controls half"><input id="sp_sku" name="sp_sku" size="30" type="text" value="{{sp_sku}}"></div>
<div class="status-message" for="sp_sku"></div>
</div>
<div class="control-group sp-model">
<label for="sp_model">Model (Optional)</label>
<div class="controls half"><input id="sp_model" name="sp_model" size="30" type="text" value="{{sp_model}}"></div>
<div class="status-message" for="sp_model"></div>
</div>
<div class="control-group sp-price required">
<label for="sp_price">Price</label>
<div class="controls" style="width:220px"><input class="required tiny" id="sp_price" name="sp_price" size="30" type="text" value="{{sp_price}}"></div>
<div class="status-message" for="sp_price"></div>
</div>
<div class="control-group cf-checkbox">
<label> </label>
<div class="controls">
<div class="control-checkbox" style="width:220px;display:block;margin-bottom:5px">
<input type="checkbox" id="sp_active" name="sp_active" value="1"{{#if sp_active}} checked{{/if}}>
<label for="sp_active">Active Product?</label>
</div>
</div>
</div>
<div class="form-actions right"><a href="/admin/product">Back</a> | {{#if uri}}<a href="{{uri}}">Product Link</a> |{{/if}} <a class="submit action-serialize" href="#">$button</a></div>
</form>
BLOCK;
$this('store_product_tab_general')->html($html);
}
public function store_product_tab_stock() {
$button = hook_execute_late('html.button', '', 'update', 'fas fa-angle-double-right', 'cc-blue');
$html = <<<BLOCK
<form class="frm json" method="post">
<input type="hidden" name="tab" value="stock">
<input type="hidden" name="auth" value="{{auth}}">
<div class="control-group cf-checkbox">
<label> </label>
<div class="controls">
<div class="control-checkbox" style="width:220px">
<input type="checkbox" id="sp_usestock" name="sp_usestock" value="1"{{#if sp_usestock}} checked{{/if}}>
<label for="sp_usestock">Physical Stock?</label>
</div>
</div>
</div>
<div class="control-group sp-upc">
<label for="sp_upc">UPC</label>
<div class="controls" style="width:220px"><input id="sp_upc" name="sp_upc" size="30" type="text" value="{{sp_upc}}"></div>
<div class="status-message" for="sp_upc"></div>
</div>
<div class="control-group sp-weight">
<label for="sp_weight">Item Weight (g)</label>
<div class="controls" style="width:220px"><input id="sp_weight" name="sp_weight" size="30" type="text" value="{{sp_weight}}"></div>
<div class="status-message" for="sp_weight"></div>
</div>
<div class="control-group sp-stock">
<label for="sp_stock">Stock Level</label>
<div class="controls" style="width:220px">
<input type="text" id="sp_stock" name="sp_stock" size="30" value="{{sp_stock}}" style="display:block;margin-bottom:10px">
</div>
<div class="status-message" for="sp_stock"></div>
</div>
<div class="control-group sp-lithium">
<label for="sp_lithium">Lithium Battery?</label>
<div class="controls" style="width:450px">
<select id="sp_lithium" name="sp_lithium">
<option value="0"{{#ifeq 0 sp_lithium}} selected{{/ifeq}}>Item does not contain Lithium Ion Batteries</option>
<option value="3481"{{#ifeq 3481 sp_lithium}} selected{{/ifeq}}>Item contains rechargable Lithium Ion Batteries (UN 3481)</option>
<option value="3480"{{#ifeq 3480 sp_lithium}} selected{{/ifeq}}>Item is solely a rechargable Lithium Ion Battery (UN 3480)</option>
</select>
</div>
<div class="status-message" for="sp_lithium"></div>
</div>
<div class="control-group cf-checkbox">
<label> </label>
<div class="controls">
<div class="control-checkbox" style="width:220px;display:block;margin-bottom:5px">
<input type="checkbox" id="sp_media" name="sp_media" value="1"{{#if sp_media}} checked{{/if}}>
<label for="sp_media">Classified as "Media"?</label>
</div>
</div>
</div>
<div class="form-actions right"><a class="submit action-serialize" href="#">$button</a></div>
</form>
BLOCK;
$this('store_product_tab_stock')->html($html);
}
public function store_product_tab_feature() {
$button = hook_execute_late('html.button', '', 'update', 'fas fa-angle-double-right', 'cc-blue');
$html = <<<BLOCK
<form class="frm json" method="post">
<input type="hidden" name="tab" value="feature">
<input type="hidden" name="auth" value="{{auth}}">
<p>By default, all products are listed under a category heading on a Landing Page. This can be changed to Featured Products only.</p>
<div class="control-group cf-checkbox">
<label> </label>
<div class="controls">
<div class="control-checkbox" style="width:220px;display:block;margin-bottom:5px">
<input type="checkbox" id="sp_feature" name="sp_feature" value="1"{{#if sp_feature}} checked{{/if}}>
<label for="sp_feature">Featured Product?</label>
</div>
</div>
</div>
<div class="control-group sp-product required">
<label for="sp_featuretext">Product Name (Featured)</label>
<div class="controls"><input class="required" id="sp_featuretext" name="sp_featuretext" size="30" type="text" value="{{sp_featuretext}}"></div>
<div class="status-message" for="sp_featuretext"></div>
</div>
<div class="form-actions right" style="padding-bottom:100px"><a class="submit action-serialize" href="#">$button</a></div>
</form>
BLOCK;
$this('store_product_tab_feature')->html($html);
}
public function store_productgroup() {
$button = hook_execute_late('html.button', '', 'update', 'fas fa-angle-double-right', 'cc-blue');
$html = <<<BLOCK
<h2 class="templateheader">{{page_title}}</h2>
<form class="frm json" method="post">
<input type="hidden" name="auth" value="{{auth}}">
<div class="control-group sc-caption required">
<label for="sc_caption">Product Group Name</label>
<div class="controls"><input class="required" id="sc_caption" name="sc_caption" size="30" type="text" value="{{sc_caption}}"></div>
<div class="status-message" for="sc_caption"></div>
</div>
<div class="control-group sp-manu required">
<label for="sc_parent">Parent Product Group</label>
<div class="controls">
<select id="sc_parent" name="sc_parent">
<option value="0"{{#ifeq 0 @root/sc_parent}} selected{{/ifeq}}>(none)</option>
{{#each list_parent}}<option value="{{key}}"{{#ifeq key @root/sc_parent}} selected{{/ifeq}}>{{value}}</option>{{/each}}
</select>
</div>
<div class="status-message" for="sc_parent"></div>
</div>
<!-- [PG1] -->
<div class="form-actions right"><a href="/admin/store">Back</a> // <!-- [PG2] --><a class="submit action-serialize" href="#">$button</a></div>
</form>
<div style="margin-top: 30px">
<h2>Active Products</h2>
<p>These are items that will be displayed when listing this product category.</p>
<table class="display data-class" ajax="/admin/store-action/active-products?auth={{auth}}">
<thead>
<tr>
<th>SKU</th><th>Description</th>
</tr>
</thead>
</table>
</div>
<!-- [PG3] -->
BLOCK;
$html = hook_execute('template.store.productgroup.PG1', $html);
$html = hook_execute('template.store.productgroup.PG2', $html);
$html = hook_execute('template.store.productgroup.PG3', $html);
$this('store_productgroup')->html($html)->Title('Edit Product Group');
}
public function store_openorder() {
hook_execute('component.add', FALSE, 'datatables');
// incoming orders
// new orders, orders in transit. completed orders, refundings
$html = <<<BLOCK
<table class="display data-class report-fulfillment" style="width:100%" ajax="/admin/fulfillment/list/{{tag}}">
<thead>
<tr>{{#each header}}
<th>{{caption}}</th>
{{/each}}</tr>
</thead>
</table>
BLOCK;
$this('store_openorder')->html($html)->Title('Order Fulfillment');
}
// <div class="">{{state}} {{zip}}</div>
// <div class="">{{country_name}}</div>
public function store_single() {
// expected UPC, item location?
$html = <<<BLOCK
<div style="padding:20px">
<div style="margin-bottom:20px">
<div class="actions" style="float:right;width:270px;margin-left:20px;">
<div class="textentry"><span class="caption">Order Number:</span><span class="value" title="Order #{{order_id}}">{{ordernum}}</span></div>
<div class="textentry"><span class="caption">Order Date:</span><span class="value">{{orderdate}}</span></div>
{{#if paymeth}}<div class="textentry"><span class="caption">Payment Method:</span><span class="value"><!-- [COL3] --></span></div>{{/if}}
{{#if est_ship}}<div class="textentry"><span class="caption">Est. Ship:</span><span class="value">{{est_ship}}</span></div>{{/if}}
{{#if est_delivery}}<div class="textentry"><span class="caption">Est. Delivery:</span><span class="value">{{est_delivery}}</span></div>{{/if}}
<div> </div>
<!-- [COL1] -->
</div>
<h3>Customer</h3>
{{#if physical}}
{{#with delivery}}
<div class="store-address-container fulfill"><div class="address-item border" data-guid="{{guid}}">
<div class="top">
<div class="bold">{{name}}</div>
<div class="">{{del_a}}</div>
<div class="">{{addr2}}</div>
<div class="">{{town}}, {{state}} {{zip}}</div>
<div class="">{{country_name}}</div>
<!-- phone -->
<br />
<div class="">Email: <a href="mailto:{{email}}">{{email}}</a></div>
</div>
</div></div>
{{/with}}
{{else}}
{{#with delivery}}
<div class="store-address-container fulfill"><div class="address-item border">
<div class="top">
<div class="bold">{{name}}</div>
<div class="">Email: <a href="mailto:{{email}}">{{email}}</a></div>
</div>
</div></div>
{{/with}}
{{/if}}
{{#ifeq status "cancelreq"}}
<div class="ship-warn">Customer has requested Order Cancellation.</div>
{{else}}{{#ifeq status "canceled"}}
<div class="ship-warn">This order has been cancelled.</div>
{{else}}
{{#if flag_test}}
<div class="ship-warn">This is a TEST ORDER. Do not ship.</div>
{{else}}
{{#if flag_changed}}
<div class="ship-warn" title="reprint the Packing Slip if it is not too late">Order has changed since Packing Slip printed</div>
{{/if}}
{{/if}}
{{/ifeq}}
{{/ifeq}}
</div>
<div style="margin-bottom: 20px">
<h3>Ordered Items</h3>
<table class="item-detail border" cellspacing="0" cellpadding="0">
<tr><td colspan="2"></td><td class="amountcol right">Quantity</td><td class="right">Price</td></tr>
{{#each cart}}
<tr>
<td class="width1"><img src="{{thumb}}"></td>
<td>
<div>{{desc}}</div>
<!-- [COL2] -->
</td>
<td class="amountcol right{{#compare quantity ">" 1}} hilite{{/compare}}">{{quantity}}</td>
<td class="right">{{total}}</td>
</tr>
{{/each}}
{{#each extras}}
<tr><td></td><td colspan="2" class="amountcol right">{{desc}}</td><td class="right">{{display}}</td></tr>
{{/each}}
{{#if showtax}}
{{#if taxable}}
{{#if freightamt}}
<tr><td></td><td colspan="2" class="amountcol right">Freight ({{carrier/caption}})</td><td class="right">{{freightcharge}}</td></tr>
{{/if}}
<tr><td></td><td colspan="2" class="amountcol right">Tax</td><td class="right">{{tax}}</td></tr>
{{else}}
<tr><td></td><td colspan="2" class="amountcol right">Tax</td><td class="right">{{tax}}</td></tr>
{{#if freightamt}}
<tr><td></td><td colspan="2" class="amountcol right">Freight ({{carrier/caption}})</td><td class="right">{{freightcharge}}</td></tr>
{{/if}}
{{/if}}
{{else}}
<tr><td></td><td colspan="2" class="amountcol right">Freight ({{carrier/caption}})</td><td class="right">{{freightcharge}}</td></tr>
{{/if}}
<tr><td></td><td colspan="2" class="amountcol right">Total</td><td class="right bold">{{total}}</td></tr>
</table>
</div>
{{#if tracking}}
<div style="margin-bottom: 20px">
<h3>Tracking</h3>
<table class="table-tracking" cellpadding="0" cellspacing="0">
<tr class="head"><td>Carrier</td><td>Tracking Number</td><td>Status</td></tr>
{{#each tracking}}
<tr class="detail">
<td>{{carrier}}</td>
<td><a href="/account/order/{{../ordernum}}/track/{{number}}" target="track">{{number}}</a> </td>
<td>{{status}}</td>
</tr>
{{/each}}
</table>
</div>
{{/if}}
<div><a href="/admin/fulfillment">Back to Orders</a> // Debug: <a class="json-request" href="/admin/fulfillment/{{ordernum}}/email-buyer">Resend Buyer email</a>
// <a class="json-request" href="/admin/fulfillment/{{ordernum}}/email-seller">Resend Seller email</a>
// <a href="/account/order/{{ordernum}}">Order Details (client)</a>
// <a href="/account/order/{{ordernum}}/edit">Edit Order (client)</a>
// <a href="/~/store/packingslip/{{ordernum}}/html">Packing Slip (html)</a>
</div>
</div>
BLOCK;
$html = hook_execute('template.store.fulfill.COL1', $html); // finalize order (paypal/stripe), packing slip, sort into boxes, tracking numbers for each box
$html = hook_execute('template.store.fulfill.COL2', $html); // expected UPC, item location?, serial number entry
$html = hook_execute('template.store.fulfill.COL3', $html); // payment method
$this('store_single')->html($html);
}
public function store_tracking() {
$html = <<<'BLOCK'
<form class="frm json" method="post" action="/admin/fulfillment/{{ordernum}}/tracking">
<input type="hidden" name="auth" value="{{auth}}">
<div class="control-group tracking">
<label for="tracking">Tracking Numbers</label>
<div class="controls"><textarea id="tracking" name="tracking" class="admin-textarea" wrap="physical">{{tracking}}</textarea></div>
<div class="status-message" for="tracking">Enter tracking numbers, one per line</div>
</div>
<div class="control-group cf-checkbox">
<div class="controls">
<div class="control-checkbox">
<input type="checkbox" id="c_email" name="c_email" value="1" checked>
<label for="c_email">Send Tracking number to client</label>
</div>
</div>
</div>
</form>
BLOCK;
$this('store_tracking')->html($html);
}
// this is us doing the actual cancellation of an order
public function store_cancel() {
$html = <<<'BLOCK'
<form class="frm json" method="post" action="/admin/fulfillment/{{ordernum}}/cancel">
<input type="hidden" name="auth" value="{{auth}}">
<div class="control-group tracking">
<label for="tracking">Cancellation Reason</label>
<div class="controls input-frame">
{{#with reason}}
{{#each options}}
<div><label><input type="radio" name="reason" value="{{key}}" {{#ifeq key ../value}} checked{{/ifeq}}> {{value}}</label></div>
{{/each}}
{{/with}}
</div>
</div>
<div class="control-group tracking">
<label for="tracking">Refund Type</label>
<div class="controls input-frame">
{{#with refund}}
{{#each options}}
<div><label><input type="radio" name="refund" value="{{key}}" {{#ifeq key ../value}} checked{{/ifeq}}> {{value}}</label></div>
{{/each}}
{{/with}}
</div>
</div>
</form>
BLOCK;
$this('store_cancel')->html($html);
}
public function store_store() {
// product Groups
// variations
$html = <<<'BLOCK'
<h2 class="templateheader">{{page_title}}</h2>
{{tabs 'store.tab' tabauth}}
BLOCK;
$this('store_store')->html($html)->Title('Store Maintenance');
}
public function store_manufacturer() {
$macro = hook_execute('component.add', '', 'formedit');
$button = hook_execute_late('html.button', '', 'Update', 'fas fa-save', 'cc-blue');
$html = <<<BLOCK
<div class="indented">
<h3>Edit Manufacturer</h3>
<form class="frm json" method="post" action="/admin/store/manufacturer">
<input type="hidden" name="auth" value="{{auth}}">
$macro
<div class="option-right">
<a class="submit" href="#">$button</a> | <a href="/admin/store">Back</a>
</div>
<!-- products from this manufacturer -->
</form>
</div>
BLOCK;
$this('store_manufacturer')->html($html)->Title('Edit Manufacturer');
}
public function store_pslip() {
$html = <<<BLOCK
<p>View the Packing Slip, or print it?</p>
BLOCK;
$this('store_pslip')->html($html);
}
public function store_fulfillment() {
$html = <<<'BLOCK'
<h2 class="templateheader">{{page_title}}</h2>
{{tabs 'fulfillment.tab' tabauth}}
BLOCK;
$this('store_fulfillment')->html($html)->Title('Order Fulfillment');
}
public function store_categories() {
$html = <<<'BLOCK'
<p>Select a Product Group from the list below, or create a <a href="/admin/store/product-group?auth={{pgauth}}">new</a> one.</p>
<div class="table-frame">
<table class="display data-class" cellpadding="0" cellspacing="0" ajax="/admin/store-action/product-group">
<thead>
<tr>{{#each header}}
<th class="col-{{id}}">{{caption}}</th>
{{/each}}</tr>
</thead>
</table>
</div>
BLOCK;
$this('store_categories')->html($html);
}
public function store_manufacturers() {
$html = <<<'BLOCK'
<div>Select a Manufacturer from the list below, or create a <a href="/admin/store/manufacturer?auth={{mauth}}">new</a> entry</div>
<div class="table-frame">
<table class="table-manufacturer data-class" cellpadding="0" cellspacing="0" for="mtable" ajax="/admin/store-action/manufacturer">
<thead>
<tr class="head"><th>Manufacturer</th></tr>
</thead>
</table>
</div>
BLOCK;
$this('store_manufacturers')->html($html);
}
}