Skip to content

Commit d1ffbed

Browse files
committed
Fixed calculating ratio on scale.php
1 parent 12346b7 commit d1ffbed

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

php/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
echo "<div id=\"create\" style=\"padding-top:6px;\">";
302302
echo "<form method=\"post\" action=\"".$url_this_page."\" enctype=\"multipart/form-data\">";
303303
echo "<p style=\"text-align:left;\">";
304-
echo "<input style=\"background-color:yellow;\" type=\"submit\" name=\"create_folder\" value=\"CREATE NEW FOLDER IN THIS WORKSPACE\"><br />named:&nbsp;";
304+
echo "<input class=\"bouton\" type=\"submit\" name=\"create_folder\" value=\"CREATE NEW FOLDER IN THIS WORKSPACE\"><br />named:&nbsp;";
305305
echo "<input type=\"text\" name=\"foldername\" size=\"20\" style=\"background-color:CornSilk;\" value=\"\">";
306306
echo "</p>";
307307
echo "</form>";

php/scale.php

100644100755
+7-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@
195195

196196
if(!isset($_POST['ratio_'.$i]) OR $_POST['ratio_'.$i] == '') $ratio[$i] = 0;
197197
else $ratio[$i] = trim($_POST['ratio_'.$i]);
198-
if($ratio[$i] == '') $ratio[$i] = 0;
198+
if($ratio[$i] == '') {
199+
if($p[$i] <> 0 AND $q[$i] <> 0)
200+
$ratio[$i] = $p[$i] / $q[$i];
201+
else $ratio[$i] = 0;
202+
}
199203

200204
if(!isset($_POST['series_'.$i])) $series[$i] = '';
201205
else $series[$i] = trim($_POST['series_'.$i]);
@@ -1218,7 +1222,8 @@
12181222
if(isset($_POST['new_convention'])) $convention = $new_convention = $_POST['new_convention'];
12191223
else if(isset($_POST['convention'])) $convention = $_POST['convention'];
12201224
$need_adjust = FALSE; $numnotes = 0;
1221-
for($j = $j_col = 0; $j < $numgrades_fullscale; $j++) {
1225+
// echo "numgrades_fullscale = ".$numgrades_fullscale."<br />";
1226+
for($j = $j_col = 0; $j <= $numgrades_fullscale; $j++) {
12221227
if($j_col >= 12) {
12231228
$j_col = 0;
12241229
echo "</tr><tr>";

0 commit comments

Comments
 (0)