#!/bin/bash
###################################################################### 
#Copyright (C) 2020  Kris Occhipinti
#https://filmsbykris.com

#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.
###################################################################### 

people=$(wget -qO- "https://filmsbykris.com/scripts/2020/employee.lst")
url="https://filmsbykris.com/scripts/2020/temp_log/submit.php"

while [ "$exit" != "Exit" ]
do
  employee="$(echo "$people"|fzf --prompt "Employee: "|cut -d\| -f1)"

  temp="$(for i in $(seq 90 0.1 110);do echo "$i";done|fzf --prompt "Temperature: ")"

  cough="$(echo -e "Yes\nNo"|fzf --prompt "Cough: ")"
  throat="$(echo -e "Yes\nNo"|fzf --prompt "Sore Throat: ")"
  nose="$(echo -e "Yes\nNo"|fzf --prompt "Runny Noise: ")"

  wget -qO- "$url?employee=$employee&temp=$temp&cough=$cough&throat=$throat&nose=$nose"
  sleep 2
  echo "================================================="

  exit="$(echo -e "Enter another employee\nExit"|fzf)"
done

echo "Goodbye"