###前提・実現したいこと
就労移行施設のタイムカードで利用者が事業所へ出勤や退勤した後に打刻後にこちらに月別ごとに打刻結果が表示されるようなシステムを作ってます。
###発生している問題・エラーメッセージ
現在、困っていることは打刻結果が1つ出ることに余分に2つ出てしまうこと このままだと月別事に表示されないので、打刻するとすべて出てしまい、 他の利用者の方のぶんまではいってしまうが 書き方がよくわからないことです。
###該当のソースコード
<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $dsn = 'mysql:dbname=mfdb;host=localhost'; $user = 'root'; $password = ''; $db = new PDO($dsn, $user, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); //日本語の曜日配列 $weekjp = array( '日', //0 '月', //1 '火', //2 '水', //3 '木', //4 '金', //5 '土' //6 ); try { $sql = "SELECT * FROM users JOIN work"; $stmt = $db->prepare($sql); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); echo "<div class='Record'> <br> <table> <thead> <tr> <th class='writing1' rowspan='3'>日付</th> <th class='writing2' rowspan='3' width='5px'>曜日</th> <th colspan='8'>サービス提供実績</th> <th class='inkan' rowspan='3'>利用者<br>確認印</th> <th rowspan='3' colspan='2'>備考</th> </tr> <tr> <th class='service' rowspan='2'>サービス<br>提供状況</th> <th rowspan='2'>開始時間</th> <th class='service' rowspan='2'>終了時間</th> <th colspan='2' class='ct1'>送迎加算</th> <th>訪問支援特別加算</th> <th class='east' rowspan='2'>食事提供<br>加算</th> <th class='service' rowspan='2'>移行準備<br>支援体制<br>加算</th> </tr> <tr> <th>往</th> <th>復</th> <th>時間数</th> <tr> </tr> </thead>"; foreach ($rows as $row) { echo "<tbody> <tr> <td> ".$row['workday']."</td> <td> ".$row['workweek']."</td> <td></td> <td> ".$row['worktime1']."</td> <td> ".$row['worktime2']."</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td colspan='2'>".$row['workadnotes']."</td> </tr> </tbody>";?> <?php } echo "<tr> </tr> <th colspan='5' rowspan='2'>合計</th> <th colspan='2' rowspan='2' ><input type='number' name='counter1' id='counter1'>回</th> <th rowspan='2'><input type='number' name='counter2' id='counter2'>回</th> <th rowspan='2'><input type='number' name='counter3' id='counter3'>回</th> <th rowspan='2'>施設外<br>支援</th> <th>当月</th> <th class='haiti'><input type='number' name='counter4' id='counter4'>日</th> <th rowspan='2' colspan='2' width='40px'>/</th> </tr> <tr> <th>累計</th> <th class='haiti'> <input type='number' name='counter5' id='counter5'>日/180日</th>"; echo "</tr> <tr> </table> </div>"; $db = null; } catch (Exception $e) { echo $e->getMessage(); } ?>
###試したこと
課題に対してアプローチしたことを記載してください
###補足情報(言語/FW/ツール等のバージョンなど)
PHP、mysql
回答1件
あなたの回答
tips
プレビュー