PHP File Manager
Editing File: Tools.php
<?php /* * Copyright (C) Wayne Purton-Smith - All Rights Reserved * Unauthorized copying of this file or removing this paragraph, via any medium is strictly prohibited * Proprietary and confidential * Written by Wayne Purton-Smith <waynepurtonsmith@hotmail.co.uk> February 2014 */ class Tools extends CI_Controller { public function signpad() { if($this->input->post('sign_order')) { exit_with_json(array('success' => $this->orders->signOrder($this->input->post('order_id'), $this->input->post('signature_data'), $this->input->post('signed_date')))); } $orders_today = $this->orders->get(NULL, NULL, array ( 'delivery_date_from' => strtotime('00:00:00'), 'delivery_date_to' => strtotime('23:59:59') )); $data['orders'] = $orders_today; $this->load->view('tools/signpad', $data); } public function manifest() { $manifest_data = array ( 'CACHE MANIFEST', '#', // Versioning goes here '# CSS', '/assets/css/signpad.css', '/assets/css/bootstrap-3.css', '# JS', '/assets/js/jquery.js', '/assets/js/bootstrap-3.js', '/assets/js/signpad.js', '# IMAGES', '/assets/images/logo.png', '/assets/images/signpad/loader.gif', '/assets/images/favicon.ico', '/assets/images/apple-touch-icon.png', '# FONTS', '/assets/fonts/glyphicons-halflings-regular.woff', '/assets/fonts/glyphicons-halflings-regular.ttf', '/assets/fonts/glyphicons-halflings-regular.svg', '# OFFLINE PAGE', 'FALLBACK:', '/ /assets/signpad/offline.html' ); $hash_data = ''; // Also need to check for template changes $check_files = array_merge($manifest_data, array('application/views/tools/signpad.php')); $latest_modified_time = 0; foreach($check_files as $i => $line_info) { $file_name = ltrim($line_info, '/'); if(file_exists($file_name)) { $last_modified = filemtime($file_name); $hash_data .= $last_modified; if($last_modified > $latest_modified_time) { $latest_modified_time = $last_modified; } } } $checksum = md5(serialize($manifest_data) . ':' . $hash_data . ':' . date('d-m-Y')); $manifest_data[1] = '# Version ' . $checksum; $manifest_data = implode("\n", $manifest_data); header("Last-Modified: " . gmdate("D, d M Y H:i:s", $latest_modified_time) . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Content-Type: text/cache-manifest", true); exit($manifest_data); } }
Cancel