diff --git a/getData1.php b/getData1.php
new file mode 100644
index 0000000..05c88d8
--- /dev/null
+++ b/getData1.php
@@ -0,0 +1,60 @@
+";
+ echo '
' . $row["week"] . ' | ';
+ echo "";
+ echo "";
+ echo '[' . $row["date"] . '] ' . $row["day_name"] . ' | ';
+ echo "
";
+ echo '';
+ echo 'Упражнение | ';
+ echo 'Группа мышц | ';
+ echo 'Время/подходы | ';
+ echo 'Вес | ';
+ $last_day = $row["day_name"];
+ $day_count = 1;
+ }
+ if ($row["day_name"] != $last_day) {
+ $last_day = $row["day_name"];
+ echo "
";
+ echo '[' . $row["date"] . '] ' . $row["day_name"] . ' | ';
+ echo "
";
+ }
+ $tr = '';
+ if ($row_count / 2 != 0) {
+ $tr = '';
+ } else {
+ $tr = '
';
+ }
+ echo $tr;
+ echo ''. $row["exercise"] .' | ';
+ echo '' . $row["muscle_group_name"] . ' | ';
+ $sets = explode(";", $row["sets_and_reps_count"]);
+ $rep = $sets[0];
+ $set = $sets[1];
+ echo '' . $rep . ' | ';
+ echo '' . $set . ' | ';
+ echo '
';
+ }
+ //echo "Итого: | " . mysqli_num_rows($result) . " |
";
+ mysqli_free_result($result);
+ } else{
+ echo "Ошибка: " . mysqli_error($conn);
+ }
+ mysqli_close($conn);
+
+?>
\ No newline at end of file
diff --git a/getData2.php b/getData2.php
new file mode 100644
index 0000000..676f667
--- /dev/null
+++ b/getData2.php
@@ -0,0 +1,60 @@
+";
+ echo '' . $row["week"] . ' | ';
+ echo "";
+ echo "";
+ echo '[' . $row["date"] . '] ' . $row["day_name"] . ' | ';
+ echo "
";
+ echo '';
+ echo 'Упражнение | ';
+ echo 'Группа мышц | ';
+ echo 'Время/подходы | ';
+ echo 'Вес | ';
+ $last_day = $row["day_name"];
+ $day_count = 1;
+ }
+ if ($row["day_name"] != $last_day) {
+ $last_day = $row["day_name"];
+ echo "
";
+ echo '[' . $row["date"] . '] ' . $row["day_name"] . ' | ';
+ echo "
";
+ }
+ $tr = '';
+ if ($row_count / 2 != 0) {
+ $tr = '';
+ } else {
+ $tr = '
';
+ }
+ echo $tr;
+ echo ''. $row["exercise"] .' | ';
+ echo '' . $row["muscle_group_name"] . ' | ';
+ $sets = explode(";", $row["sets_and_reps_count"]);
+ $rep = $sets[0];
+ $set = $sets[1];
+ echo '' . $rep . ' | ';
+ echo '' . $set . ' | ';
+ echo '
';
+ }
+ //echo "Итого: | " . mysqli_num_rows($result) . " |
";
+ mysqli_free_result($result);
+ } else{
+ echo "Ошибка: " . mysqli_error($conn);
+ }
+ mysqli_close($conn);
+
+?>
\ No newline at end of file
diff --git a/src/scripts/workout.js b/src/scripts/workout.js
new file mode 100644
index 0000000..bd9f74c
--- /dev/null
+++ b/src/scripts/workout.js
@@ -0,0 +1,113 @@
+$(document).ready(function() {
+ $('#nick-btn').click(function(){
+ if (($('#nickname-input').val() == '')) {
+ alert("Не указан ник!");
+ } else {
+ var username = $('#nickname-input').val().trim();
+ $.ajax({
+ url:"getData1.php",
+ type: 'POST',
+ data: {user: username},
+ success: function(msg){
+ if (!(msg == '')) {
+ $('#wt1').empty();
+ $('#wt1').css("display","block");
+ $('#wt1').append(msg);
+ } else {
+ console.log(msg);
+ alert('Пользователь не найден!');
+ return;
+ }
+ }
+ });
+ $.ajax({
+ url:"getData2.php",
+ type: 'POST',
+ data: {user: username},
+ success: function(msg2){
+ if (!(msg2 == '')) {
+ $('#wt2').empty();
+ $('#wt2').css("display","block");
+ $('#wt2').append(msg2);
+ } else {
+ console.log(msg2);
+ alert('Пользователь не найден!');
+ return;
+ }
+ }
+ });
+ }
+ window.setTimeout(function(){TodayIsTheDay();}, 2000);
+ });
+});
+
+function TodayIsTheDay(){
+ var now = new Date();
+ var sNow = now.toString();
+ let nowDate = parseDate(sNow);
+ let headers = document.getElementsByClassName('day-name');
+ for (let i = 0; i < headers.length; i++){
+ let sDate = getDate(headers[i].textContent);
+ if (sDate === nowDate) {
+ headers[i].setAttribute('style', 'text-shadow: 0 0 10px #609A21,0 0 10px #609A21,0 0 30px #609A21,0 0 10px #609A21; ');
+ }
+ }
+}
+
+function getDate(sText){
+ var textC = Array.from(sText);
+ var sDate = "";
+ var record = false;
+ for (var i = 0; i < textC.length; i++){
+ if (textC[i] === '['){
+ record = true;
+ } else if (textC[i] === ']') {
+ record = false;
+ }
+ if (record){
+ sDate = sDate + textC[i];
+ }
+ }
+ sDate = sDate.replace('[', '');
+ sDate = sDate.replace(']', '');
+ return sDate;
+}
+
+function parseDate(sDate){
+ var dateArr = sDate.split(' ');
+ var day = dateArr[2];
+ var sMonth = dateArr[1];
+ var month = '';
+ if (sMonth == 'Jan') {
+ month = '01';
+ } else if (sMonth == 'Jan') {
+ month = '01';
+ } else if (sMonth == 'Feb') {
+ month = '02';
+ } else if (sMonth == 'Mar') {
+ month = '03';
+ } else if (sMonth == 'Apr') {
+ month = '04';
+ } else if (sMonth == 'May') {
+ month = '05';
+ } else if (sMonth == 'Jun') {
+ month = '06';
+ } else if (sMonth == 'Jul') {
+ month = '07';
+ } else if (sMonth == 'Aug') {
+ month = '08';
+ } else if (sMonth == 'Sep') {
+ month = '09';
+ } else if (sMonth == 'Oct') {
+ month = '10';
+ } else if (sMonth == 'Nov') {
+ month = '11';
+ } else if (sMonth == 'Dec') {
+ month = '12';
+ } else {
+ month = '01';
+ }
+ var year = dateArr[3];
+ var date = day + '.' + month + '.' + year;
+ return date;
+}
\ No newline at end of file
diff --git a/src/styles/style.css b/src/styles/style.css
index 27e0c4a..29300d8 100644
--- a/src/styles/style.css
+++ b/src/styles/style.css
@@ -411,4 +411,37 @@ h2 {
text-align: center;
grid-area: signin-form;
padding-bottom: 20px;
+}
+
+.nickname-form {
+ text-align:center;
+}
+
+.nickname-input {
+ text-align: center;
+ width: 30%;
+ margin-left: 2em;
+ margin-bottom: 5px;
+ font-family: segoe print;
+ font-size: 16px;
+}
+
+.nickname-button {
+ margin-left: 2em;
+ background-color: #609A21;
+ border: none;
+ border-radius: 5px;
+ width: 30%;
+ color: #E0E0E0;
+ font-family: segoe print;
+ font-size: 16px;
+ margin-top: 5px;
+}
+
+#wt1 {
+ display: none;
+}
+
+#wt2 {
+ display: none;
}
\ No newline at end of file
diff --git a/src/styles/styleMobile.css b/src/styles/styleMobile.css
index be66e26..84159b3 100644
--- a/src/styles/styleMobile.css
+++ b/src/styles/styleMobile.css
@@ -393,4 +393,36 @@ h2 {
text-align: center;
grid-area: signin-form;
padding-bottom: 20px;
+}
+.nickname-form {
+ text-align:center;
+}
+
+.nickname-input {
+ text-align: center;
+ width: 40%;
+ margin-left: 2em;
+ margin-bottom: 5px;
+ font-family: segoe print;
+ font-size: 14px;
+}
+
+.nickname-button {
+ margin-left: 2em;
+ background-color: #609A21;
+ border: none;
+ border-radius: 5px;
+ width: 40%;
+ color: #E0E0E0;
+ font-family: segoe print;
+ font-size: 14px;
+ margin-top: 5px;
+}
+
+#wt1 {
+ display: none;
+}
+
+#wt2 {
+ display: none;
}
\ No newline at end of file
diff --git a/workout.html b/workout.html
index 8d8d7c2..cbf5b68 100644
--- a/workout.html
+++ b/workout.html
@@ -4,10 +4,11 @@
Dhaverd
-
-
+
+
-
+
+