-
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 #2 from globaldyne/v2.8
V2.8
- Loading branch information
Showing
51 changed files
with
1,664 additions
and
891 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.js linguist-detectable=false |
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ inc/config.php | |
*.swp | ||
t.php | ||
tests/ | ||
searchTGSC.php |
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,18 +1,21 @@ | ||
LINUX | ||
------------ | ||
|
||
****Assuming you already have a working php/mysql system configured. | ||
|
||
|
||
Copy/clone the repo under your web server's home dir (eg. /var/www/) | ||
*Highly recomended to create a vhost | ||
|
||
Create a new db eg. pvault and import the schema located under db/ folder | ||
|
||
Edit inc/config.php and update it with your db details | ||
*Higly recomended to create a new user with permissions only to the pvault db. | ||
|
||
|
||
To Enable label printing support, additional software is required: | ||
|
||
https://github.com/pklaus/brother_ql | ||
LINUX | ||
------------ | ||
|
||
****Assuming you already have a working php/mysql system configured. | ||
|
||
|
||
Download or clone the repo under your web server's home dir (eg. /var/www/) | ||
*Highly recomended to create a vhost | ||
|
||
Create a new db eg. pvault and a user with admin rights to it | ||
|
||
Open your web browser to you server's url and follow the instruction on the installation wizard. | ||
|
||
For more info please refer to: | ||
|
||
https://www.jbparfum.com/knowledge-base/ | ||
|
||
|
||
To Enable label printing support, additional software is required: | ||
|
||
https://github.com/pklaus/brother_ql |
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 @@ | ||
2.7 | ||
2.8 |
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 @@ | ||
2.7 | ||
2.8 |
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 @@ | ||
ALTER TABLE `formulasMetaData` ADD `isProtected` INT NOT NULL DEFAULT '0' AFTER `image`; | ||
ALTER TABLE `settings` ADD `multi_dim_perc` INT NOT NULL DEFAULT '0' AFTER `pubchem_view`; | ||
ALTER TABLE `settings` ADD `mUnit` VARCHAR(10) NOT NULL DEFAULT 'ml' AFTER `multi_dim_perc`; | ||
ALTER TABLE `ingCategory` ADD `image` LONGTEXT NULL AFTER `notes`; | ||
ALTER TABLE `ingredients` ADD `molecularWeight` VARCHAR(255) NULL AFTER `isPrivate`; | ||
ALTER TABLE `formulas` ADD `notes` VARCHAR(255) NULL AFTER `quantity`; | ||
ALTER TABLE `formulasMetaData` ADD `defView` INT NOT NULL DEFAULT '1' COMMENT '1 = Ingredient properties, 2 = Notes' AFTER `isProtected`; | ||
ALTER TABLE `ingredients` CHANGE `name` `name` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; |
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,16 @@ | ||
<?php | ||
if (!defined('pvault_panel')){ die('Not Found');} | ||
|
||
function arrFilter($arr){ | ||
$result = array(); | ||
|
||
foreach($arr as $value){ | ||
$name = $value['name']; | ||
$result[$name]['name'] = $name; | ||
$result[$name]['image'] = $value['image']; | ||
} | ||
|
||
return array_values($result); | ||
} | ||
|
||
?> |
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,13 +1,57 @@ | ||
<?php | ||
if (!defined('pvault_panel')){ die('Not Found');} | ||
|
||
function calcPerc($formula, $profile, $percent, $conn){ | ||
$formula_q = mysqli_query($conn, "SELECT ingredient FROM formulas WHERE name = '$formula'"); | ||
while ($formula = mysqli_fetch_array($formula_q)) { | ||
$ing_q = mysqli_fetch_array(mysqli_query($conn, "SELECT profile FROM ingredients WHERE name = '".$formula['ingredient']."'")); | ||
$prf[] = $ing_q['profile']; | ||
} | ||
$number = array_count_values($prf); | ||
return ($number[$profile] / $percent) * 100; | ||
} | ||
<?php | ||
if (!defined('pvault_panel')){ die('Not Found');} | ||
|
||
function calcPerc($formula, $profile, $percent, $conn){ | ||
$formula_q = mysqli_query($conn, "SELECT ingredient FROM formulas WHERE name = '$formula'"); | ||
while ($formula = mysqli_fetch_array($formula_q)) { | ||
$ing_q = mysqli_fetch_array(mysqli_query($conn, "SELECT profile FROM ingredients WHERE name = '".$formula['ingredient']."'")); | ||
$prf[] = $ing_q['profile']; | ||
} | ||
if($prf){ | ||
$number = array_count_values($prf); | ||
return ($number[$profile] / $percent) * 100; | ||
} | ||
return; | ||
} | ||
|
||
function multi_dim_search($array, $key, $value){ | ||
$results = array(); | ||
|
||
if (is_array($array)) { | ||
if (isset($array[$key]) && $array[$key] == $value) { | ||
$results[] = $array; | ||
} | ||
|
||
foreach ($array as $subarray) { | ||
$results = array_merge($results, multi_dim_search($subarray, $key, $value)); | ||
} | ||
|
||
} | ||
|
||
return $results; | ||
} | ||
|
||
function multi_dim_perc($conn, $form) { | ||
foreach ($form as $formula){ | ||
|
||
$allIngQuery = mysqli_query($conn, "SELECT name,percentage FROM allergens WHERE ing = '".$formula['ingredient']."'"); | ||
|
||
while($allgIng_res = mysqli_fetch_array($allIngQuery)){ | ||
$allgIng[] = $allgIng_res; | ||
} | ||
|
||
foreach ($allgIng as $aa){ | ||
$arrayLength = count($aa); | ||
$i = 0; | ||
while ($i < $arrayLength){ | ||
|
||
$c = multi_dim_search($aa, 'name', $formula['ingredient'])[$i]; | ||
$conc[$formula['ingredient']] += number_format($formula['quantity'] / 100 * $c['percentage'], 3); | ||
|
||
$i++; | ||
} | ||
} | ||
} | ||
return array_unique(array_merge(array_filter($conc))); | ||
} | ||
?> |
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.