from db03 import DBAccess

#表示機能画面作成
def makepage_show():

  #埋め込み：ページ切替
  previous_page = ''
  next_page     = ''

  #埋め込み：記録テーブル
  record_list_content = ''
  for res in DBAccess.get_all_record():
    record_list_content += '''
      <tr>
        <td>{0}<br>{1}</td>
        <td>{2}</td>
        <td><input type="range" min="1" max="6" value="{3}" disabled></td>
        <td>{4}</td>
      </tr>
    '''
    record_list_content = record_list_content.format(res[0] ,res[1], res[2], res[3], res[4])
  
  #HTMLファイルを開く
  with open('sub_show.html', mode='r', encoding='utf-8') as f:
    file = f.read()

  #<body>内容を出力
  html_Text = file.format( 
    embed_previous_page = previous_page ,
    embed_next_page = next_page ,
    embed_record_list = record_list_content
  )

  return html_Text