-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from globaldyne/v6.4
V6.4
- Loading branch information
Showing
20 changed files
with
381 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.3 | ||
6.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.3 | ||
6.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE `users` ADD `pvToken` VARCHAR(255) NOT NULL AFTER `password`; | ||
ALTER TABLE `users` ADD `avatar` VARCHAR(255) NOT NULL AFTER `fullName`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function insertAtCaret(areaId,text) { | ||
var txtarea = document.getElementById(areaId); | ||
var scrollPos = txtarea.scrollTop; | ||
var strPos = 0; | ||
var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false ) ); | ||
if (br == "ie") { txtarea.focus(); | ||
var range = document.selection.createRange(); | ||
range.moveStart ('character', -txtarea.value.length); strPos = range.text.length; | ||
} else if (br == "ff") strPos = txtarea.selectionStart; | ||
var front = (txtarea.value).substring(0,strPos); | ||
var back = (txtarea.value).substring(strPos,txtarea.value.length); | ||
txtarea.value=front+text+back; strPos = strPos + text.length; if (br == "ie") { txtarea.focus(); | ||
var range = document.selection.createRange(); | ||
range.moveStart ('character', -txtarea.value.length); | ||
range.moveStart ('character', strPos); | ||
range.moveEnd ('character', 0); | ||
range.select(); | ||
} else if (br == "ff") { txtarea.selectionStart = strPos; txtarea.selectionEnd = strPos; txtarea.focus(); | ||
} | ||
txtarea.scrollTop = scrollPos; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,11 +163,11 @@ | |
|
||
After installing <strong><?=$product?></strong> for the first time, you asked to set a password. This password cannot be retrieved later on as its stored in the database in encrypted format. | ||
<?php if(file_exists('/config/.DOCKER') == TRUE || file_exists('/config/.CLOUD') == TRUE){ ?> | ||
To set a new password, you need to execute the command bellow: | ||
To set a new password for a user, you need to execute the command bellow followed by the user's email you want its password reset: | ||
<p></p> | ||
<pre>reset_pass.sh</pre> | ||
<pre>reset_pass.sh [email protected]</pre> | ||
<?php }else{ ?> | ||
To set a new password, you need manually access your database and set a new password there or remove the user. This will force the system to ask you to create a new user. | ||
To set a new password, you need manually to access your database and set a new password there for the user you want its password reset. | ||
<?php } ?> | ||
</div> | ||
<div class="modal-footer"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
{"id":"local","name":"Local DB","slug":"local","version":"1.0","fileName":"local","icon":"fas fa-database"} | ||
{ | ||
"id":"local", | ||
"name":"Local DB", | ||
"slug":"local", | ||
"version":"1.0", | ||
"fileName":"local", | ||
"icon":"fas fa-database" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id":"pvOnline", | ||
"name":"PV Online DB", | ||
"slug":"pvOnline", | ||
"version":"1.0", | ||
"fileName":"pvOnline", | ||
"icon":"fas fa-cloud" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
define('__ROOT__', dirname(dirname(__FILE__))); | ||
|
||
require_once(__ROOT__.'/inc/sec.php'); | ||
require_once(__ROOT__.'/inc/config.php'); | ||
require_once(__ROOT__.'/inc/opendb.php'); | ||
require_once(__ROOT__.'/inc/settings.php'); | ||
require_once(__ROOT__.'/func/pvOnline.php'); | ||
|
||
|
||
|
||
$row = $_POST['start']?:0; | ||
$limit = $_POST['length']?:10; | ||
$order_by = $_POST['order_by']?:'name'; | ||
$order = $_POST['order_as']?:'ASC'; | ||
|
||
|
||
$s = trim($_POST['search']['value']); | ||
$data = [ | ||
'do' => 'ingredients', | ||
'start' => $row, | ||
'length' => $limit, | ||
'order_by' => $order_by, | ||
'order_as' => $order, | ||
's' => $s | ||
]; | ||
|
||
$output = json_decode(pvPost($pvOnlineAPI, $data)); | ||
|
||
$rx = array(); | ||
foreach ($output->ingredients as $ingredient){ | ||
$r['id'] = (int)$ingredient->id; | ||
$r['name'] = (string)filter_var ( $ingredient->name, FILTER_SANITIZE_FULL_SPECIAL_CHARS); | ||
$r['cas'] = (string)$ingredient->cas ?: 'N/A'; | ||
$r['odor'] = (string)$ingredient->odor ?: 'N/A'; | ||
$r['profile'] = (string)$ingredient->profile ?: 'N/A'; | ||
$r['physical_state'] = $ingredient->physical_state ?: 1; | ||
$r['category'] = $ingredient->category ?: 0; | ||
$r['type'] = (string)$ingredient->type ?: 'N/A'; | ||
$r['IUPAC'] = (string)filter_var ( $ingredient->INCI, FILTER_SANITIZE_FULL_SPECIAL_CHARS); | ||
$r['strength'] = (string)$ingredient->strength ?: 'N/A'; | ||
$r['purity'] = $ingredient->purity ?: 100; | ||
$r['FEMA'] = (string)$ingredient->FEMA ?: 'N/A'; | ||
$r['tenacity'] = (string)$ingredient->tenacity ?: 'N/A'; | ||
$r['chemical_name'] = (string)$ingredient->chemical_name ?: 'N/A'; | ||
$r['formula'] = (string)$ingredient->formula ?: 'N/A'; | ||
$r['flash_point'] = (string)$ingredient->flash_point ?: 'N/A'; | ||
$r['appearance'] = (string)$ingredient->appearance ?: 'N/A'; | ||
$r['notes'] = (string)$ingredient->notes ?: 'N/A'; | ||
$r['allergen'] = $ingredient->allergen ?: 0; | ||
$r['flavor_use'] = $ingredient->flavor_use ?: 0; | ||
$r['einecs'] = (string)$ingredient->einecs ?: 'N/A' ; | ||
$r['usage']['limit'] = $ingredient->cat4 ?: 100; | ||
$r['usage']['reason'] = (string)$ingredient->risk ?: 'N/A'; | ||
$r['impact_top'] = $ingredient->impact_top ?: 0; | ||
$r['impact_heart'] = $ingredient->impact_heart ?: 0; | ||
$r['impact_base'] = $ingredient->impact_base ?: 0; | ||
|
||
//Only the default supplier will be provided | ||
$r['supplier'][0]['name'] = (string)$ingredient->supplier ?: 'N/A' ; | ||
$r['supplier'][0]['link'] = (string)$ingredient->supplier_link ?: 'N/A' ; | ||
$r['price'] = (double)$ingredient->price ?: 0; | ||
|
||
$r['stock'] = (double)0; //Not available in online | ||
|
||
$r['info']['byPassIFRA'] = (int)0;//Not available in online | ||
|
||
|
||
$rx[]=$r; | ||
} | ||
|
||
$response = array( | ||
"source" => 'PVOnline', | ||
"draw" => (int)$_POST['draw'], | ||
"recordsTotal" => (int)$output->ingredientsTotal, | ||
"recordsFiltered" => (int)$output->ingredientsFiltered, | ||
"data" => $rx | ||
); | ||
|
||
if(empty($rx)){ | ||
$response['data'] = []; | ||
} | ||
|
||
header('Content-Type: application/json; charset=utf-8'); | ||
echo json_encode($response,JSON_UNESCAPED_UNICODE); | ||
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.