From 54a3e3d5e71fae28f2bd63f0e32beb49149a41c8 Mon Sep 17 00:00:00 2001
From: ukityeamyai <yamyai.8084@gmail.com>
Date: Sun, 9 Apr 2023 11:20:21 +0700
Subject: [PATCH] add history payment

---
 app/Http/Controllers/AdminController.php      |  5 ++-
 app/Models/Receipt.php                        |  9 +++-
 .../Transection/v_approve_tranfer.blade.php   | 43 ++++++-------------
 resources/views/Login/v_Login.blade.php       |  3 +-
 4 files changed, 26 insertions(+), 34 deletions(-)

diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php
index 5f74cb3c..f5cdda01 100644
--- a/app/Http/Controllers/AdminController.php
+++ b/app/Http/Controllers/AdminController.php
@@ -5,6 +5,7 @@
 use App\Http\Controllers\Controller;
 use Illuminate\Http\Request;
 use App\Models\Member;
+use App\Models\Receipt;
 use Illuminate\Support\Facades\DB;
 
 
@@ -24,7 +25,9 @@ public function Admin_home(){
 
      */
     public function Approve_tranfer(){
-        return view('Admin/Transection/v_approve_tranfer');
+        $raw = new Receipt();
+        $data['user_receipt'] = $raw->get_recipt();
+        return view('Admin/Transection/v_approve_tranfer', $data);
     }
 
     /*
diff --git a/app/Models/Receipt.php b/app/Models/Receipt.php
index 9f4c6042..a497f65e 100644
--- a/app/Models/Receipt.php
+++ b/app/Models/Receipt.php
@@ -3,6 +3,7 @@
 namespace App\Models;
 
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
 
 /**
  * @property integer $id
@@ -16,7 +17,7 @@ class Receipt extends Model
 {
     /**
      * The table associated with the model.
-     * 
+     *
      * @var string
      */
     protected $table = 'Receipt';
@@ -25,4 +26,10 @@ class Receipt extends Model
      * @var array
      */
     protected $fillable = ['rec_name', 'rec_amount', 'rec_date_and_time', 'rec_img', 'mem_id'];
+
+    public function get_recipt()
+    {
+        $data = DB::table('Receipt')->select()->get();
+        return $data;
+    }
 }
diff --git a/resources/views/Admin/Transection/v_approve_tranfer.blade.php b/resources/views/Admin/Transection/v_approve_tranfer.blade.php
index 0df51393..afc7f807 100644
--- a/resources/views/Admin/Transection/v_approve_tranfer.blade.php
+++ b/resources/views/Admin/Transection/v_approve_tranfer.blade.php
@@ -32,7 +32,7 @@
            left: 405px;
             width: 1040px;
             height: auto;
-            margin: 0 auto;           
+            margin: 0 auto;
             background: #ffffff;
 
         }
@@ -80,9 +80,9 @@
         <h1 class="m-5">หลักฐานการแจ้งฝากเงิน</h1>
 
     <div class="container">
-    
+
         <div class="container">
-            
+
         <div class="row">
           <div class="col mt-5">
             <div class="row m-3 d-flex justify-content-end">
@@ -102,31 +102,14 @@
                 </tr>
               </thead>
               <tbody>
+                @foreach ($user_receipt as $user)
                 <tr>
-                  <td>01/01/2566</td>
-                  <td>19:00 น.</td>
-                  <td>นาย สมศักดิ์ ใจดี</td>
-                  <td></td>
-                  <td>500 บาท</td>
-                  <td>สำเร็จ</td>
-
-                </tr>
-                <tr>
-                    <td>01/01/2566</td>
-                    <td>19:00 น.</td>
-                    <td>นาย สมศักดิ์ ใจดี</td>
-                    <td></td>
-                    <td>500 บาท</td>
-                    <td>สำเร็จ</td>
-                </tr>
-                <tr>
-                    <td>01/01/2566</td>
-                    <td>19:00 น.</td>
-                    <td>นาย สมศักดิ์ ใจดี</td>
-                    <td></td>
-                    <td>500 บาท</td>
-                    <td>สำเร็จ</td>
+                  <td>{{$user->rec_name}}</td>
+                  <td>{{$user->rec_img}}</td>
+                  <td>{{$user->rec_amount}}</td>
+                  <td>{{$user->rec_status}}</td>
                 </tr>
+                @endforeach
               </tbody>
             </table>
             <div class="d-grid gap-2 d-md-flex justify-content-md-end m-3">
@@ -141,10 +124,10 @@
           </div>
         </div>
     </div>
-    
-    
-    
-    
+
+
+
+
 </body>
 
 </html>
diff --git a/resources/views/Login/v_Login.blade.php b/resources/views/Login/v_Login.blade.php
index 118a3f4c..da6994c4 100644
--- a/resources/views/Login/v_Login.blade.php
+++ b/resources/views/Login/v_Login.blade.php
@@ -2,7 +2,7 @@
 <html>
 
 <head>
-    <title>CSA</title>
+    <title>ฌาปนกิจสงเคราะห์ สภาทนายความ</title>
     <link rel="stylesheet" href="css\login.css">
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -12,7 +12,6 @@
     </script>
     <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
         integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
-    <title>CSA</title>
     <link rel="stylesheet" href="css/Login/login.css">
 </head>
 
-- 
GitLab