diff --git a/README.md b/README.md index 964d36a..a131c32 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Welcome to software license manager 👋 -![Version](https://img.shields.io/badge/version-5.5.0-blue.svg?cacheSeconds=2592000) +![Version](https://img.shields.io/badge/version-5.5.2-blue.svg?cacheSeconds=2592000) [![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/michelve/software-license-manager/blob/master/LICENSE.md) @@ -89,7 +89,7 @@ Changelog: [View changelog](https://github.com/michelve/software-license-manager - + ## 📝 License diff --git a/_config.yml b/_config.yml index 2f7efbe..c419263 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-minimal \ No newline at end of file +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/admin/slm-add-licenses.php b/admin/slm-add-licenses.php index 5c1b17f..96e9e8d 100755 --- a/admin/slm-add-licenses.php +++ b/admin/slm-add-licenses.php @@ -1,12 +1,10 @@ prepare("SELECT * FROM $lk_table WHERE id = %s", $id); $record = $wpdb->get_row($sql_prep, OBJECT); @@ -66,6 +66,8 @@ function slm_add_licenses_menu() $lic_type = $record->lic_type; $expiry_date = $record->date_expiry; $lic_item_ref = $record->item_reference; + $slm_billing_length = $record->slm_billing_length; + $slm_billing_interval = $record->slm_billing_interval; } if (isset($_POST['save_record'])) { @@ -78,7 +80,6 @@ function slm_add_licenses_menu() do_action('slm_add_edit_interface_save_submission'); //TODO - do some validation - $expiry_date = ''; $license_key = $_POST['license_key']; $max_domains = $_POST['max_allowed_domains']; $max_devices = $_POST['max_allowed_devices']; @@ -99,9 +100,19 @@ function slm_add_licenses_menu() $current_ver = $_POST['current_ver']; $subscr_id = $_POST['subscr_id']; $lic_type = $_POST['lic_type']; - $lic_item_ref = trim($_POST['item_reference']); + if("" == trim($_POST['item_reference'])){ + $lic_item_ref = 'default'; + } + else { + $lic_item_ref = trim($_POST['item_reference']); + } + + + $slm_billing_length = trim($_POST['slm_billing_length']); + $slm_billing_interval= trim($_POST['slm_billing_interval']); + $expiry_date = ''; if ($_POST['lic_type'] == 'lifetime'){ $expiry_date = '0000-00-00'; } @@ -120,32 +131,32 @@ function slm_add_licenses_menu() } //Save the entry to the database - $fields = array(); - $fields['license_key'] = $license_key; - $fields['max_allowed_domains'] = $max_domains; - $fields['max_allowed_devices'] = $max_devices; - $fields['lic_status'] = $license_status; - $fields['first_name'] = $first_name; - $fields['last_name'] = $last_name; - $fields['email'] = $email; - $fields['company_name'] = $company_name; - $fields['txn_id'] = $txn_id; - $fields['manual_reset_count'] = $reset_count; - $fields['purchase_id_'] = $purchase_id_; - $fields['date_created'] = $created_date; - $fields['date_renewed'] = $renewed_date; - $fields['date_activated'] = $date_activated; - $fields['date_expiry'] = $expiry_date; - $fields['product_ref'] = $product_ref; - $fields['until'] = $until; - $fields['current_ver'] = $current_ver; - $fields['subscr_id'] = $subscr_id; - $fields['lic_type'] = $lic_type; - $fields['item_reference'] = $lic_item_ref; - - - $id = isset($_POST['edit_record']) ? $_POST['edit_record'] : ''; - $lk_table = SLM_TBL_LICENSE_KEYS; + $fields = array(); + $fields['license_key'] = $license_key; + $fields['max_allowed_domains'] = $max_domains; + $fields['max_allowed_devices'] = $max_devices; + $fields['lic_status'] = $license_status; + $fields['first_name'] = $first_name; + $fields['last_name'] = $last_name; + $fields['email'] = $email; + $fields['company_name'] = $company_name; + $fields['txn_id'] = $txn_id; + $fields['manual_reset_count'] = $reset_count; + $fields['purchase_id_'] = $purchase_id_; + $fields['date_created'] = $created_date; + $fields['date_renewed'] = $renewed_date; + $fields['date_activated'] = $date_activated; + $fields['date_expiry'] = $expiry_date; + $fields['product_ref'] = $product_ref; + $fields['until'] = $until; + $fields['current_ver'] = $current_ver; + $fields['subscr_id'] = $subscr_id; + $fields['lic_type'] = $lic_type; + $fields['item_reference'] = $lic_item_ref; + $fields['slm_billing_length'] = $slm_billing_length; + $fields['slm_billing_interval'] = $slm_billing_interval; + $id = isset($_POST['edit_record']) ? $_POST['edit_record'] : ''; + $lk_table = SLM_TBL_LICENSE_KEYS; if (empty($id)) { //Insert into database @@ -164,39 +175,24 @@ function slm_add_licenses_menu() } } - if (empty($errors)) { - $message = "Record successfully saved!"; - echo '
'; - echo $message; - echo '
registered_domain; ?> | -id ?>>X | -
registered_devices; ?> | -id ?>>X | -