upgrade deposit
parent
92ca57e425
commit
3f12da970a
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Banner;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Customer;
|
||||
use App\Models\CustomerLevel;
|
||||
use Illuminate\Http\Request;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CustomerLevel;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Customer;
|
||||
use App\Models\DepositHistory;
|
||||
use App\Models\Sale;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Info;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Location;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CustomerLevel;
|
||||
use App\Models\LocationProfile;
|
||||
use Illuminate\Http\Request;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Notification;
|
||||
|
||||
class NotificationController extends Controller
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CustomerLevel;
|
||||
use App\Models\PoinReward;
|
||||
use Illuminate\Http\Request;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ProfileUpdateRequest;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Http\RedirectResponse;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Permission;
|
||||
use App\Models\Role;
|
||||
use App\Models\RolePermission;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Sale;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Customer;
|
||||
use App\Models\CustomerLevel;
|
||||
use Illuminate\Http\Request;
|
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\CustomerLevel;
|
||||
use App\Models\Location;
|
||||
use App\Models\LocationProfile;
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Customer;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\DepositLocation;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DepositLocationController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return inertia('DepositLocation/Index', [
|
||||
'locations' => DepositLocation::orderBy('updated_at', 'desc')->paginate(20),
|
||||
]);
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
@ -1,26 +1,35 @@
|
||||
import React from "react";
|
||||
import React from 'react'
|
||||
|
||||
export default function Checkbox({ value, name, onChange, label = '', error, disabled = false }) {
|
||||
export default function Checkbox({
|
||||
value,
|
||||
name,
|
||||
onChange,
|
||||
label = '',
|
||||
error,
|
||||
disabled = false,
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<div className="flex items-center mb-1">
|
||||
<input
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={value}
|
||||
onChange={onChange}
|
||||
name={name}
|
||||
disabled={disabled}
|
||||
className="w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"/>
|
||||
className="w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
||||
/>
|
||||
{label !== '' && (
|
||||
<label className="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
|
||||
</div>
|
||||
{error && (
|
||||
<p className="mb-2 text-sm text-red-600 dark:text-red-500">{error}</p>
|
||||
<p className="mb-2 text-sm text-red-600 dark:text-red-500">
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,75 @@
|
||||
import { usePage, router, Link } from '@inertiajs/react'
|
||||
|
||||
export default function HeaderTrx({ enable = 'deposit' }) {
|
||||
const {
|
||||
props: {
|
||||
auth: { user },
|
||||
},
|
||||
} = usePage()
|
||||
return (
|
||||
<>
|
||||
<div className="w-full pt-10 px-5">
|
||||
<div className="text-base">{user.fullname}</div>
|
||||
</div>
|
||||
<div className="flex flex-row justify-between items-center px-5">
|
||||
<div>
|
||||
<div className="font-bold text-3xl">
|
||||
Rp {user.display_deposit}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
className="px-3 py-2 border rounded-full bg-blue-700 text-white hover:bg-transparent hover:text-black"
|
||||
onClick={() =>
|
||||
router.get(route('transactions.deposit.topup'))
|
||||
}
|
||||
>
|
||||
Top Up
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="px-5 pb-5 border-b">
|
||||
<div className="flex flex-row items-center text-gray-600 text-sm">
|
||||
<div>{user.display_poin} poin</div>
|
||||
<div className="pl-1 text-xs">
|
||||
( kadaluarsa pada 20 juni 2023 )
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<div className="flex flex-row gap-2 px-5 py-5">
|
||||
<Link
|
||||
href={route('transactions.deposit.index')}
|
||||
className={`px-3 py-1 rounded-full border ${
|
||||
enable === 'deposit'
|
||||
? 'bg-blue-700 text-white'
|
||||
: 'bg-blue-100'
|
||||
}`}
|
||||
>
|
||||
Deposit
|
||||
</Link>
|
||||
<Link
|
||||
href={route('transactions.sale.index')}
|
||||
className={`px-3 py-1 rounded-full border ${
|
||||
enable === 'trx'
|
||||
? 'bg-blue-700 text-white'
|
||||
: 'bg-blue-100'
|
||||
}`}
|
||||
>
|
||||
Pembelian
|
||||
</Link>
|
||||
<Link
|
||||
href={route('transactions.poin.index')}
|
||||
className={`px-3 py-1 rounded-full border ${
|
||||
enable === 'poin'
|
||||
? 'bg-blue-700 text-white'
|
||||
: 'bg-blue-100'
|
||||
}`}
|
||||
>
|
||||
Poin
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Head, router } from '@inertiajs/react'
|
||||
import CustomerLayout from '@/Layouts/CustomerLayout'
|
||||
import { HiChevronLeft } from 'react-icons/hi2'
|
||||
import { BsWhatsapp } from 'react-icons/bs'
|
||||
import { GrMap } from 'react-icons/gr'
|
||||
|
||||
export default function Index({ locations: { data, next_page_url } }) {
|
||||
const [locations, setLocations] = useState(data)
|
||||
|
||||
const handleNextPage = () => {
|
||||
router.get(
|
||||
next_page_url,
|
||||
{},
|
||||
{
|
||||
replace: true,
|
||||
preserveState: true,
|
||||
only: ['locations'],
|
||||
onSuccess: (res) => {
|
||||
setLocations(locations.concat(res.props.locations.data))
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
return (
|
||||
<CustomerLayout>
|
||||
<Head title="Lokasi Setor Tunai" />
|
||||
<div className="flex flex-col min-h-[calc(90dvh)]">
|
||||
<div
|
||||
className="w-full px-5 py-5 flex flex-row items-center"
|
||||
onClick={() => {
|
||||
router.get(route('transactions.deposit.topup'))
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<HiChevronLeft className="font-bold h-5 w-5" />
|
||||
</div>
|
||||
<div className="pl-4 text-xl font-bold">
|
||||
Lokasi Setor Tunai
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full px-2 flex flex-col gap-1">
|
||||
{locations.map((location) => (
|
||||
<div
|
||||
key={location.id}
|
||||
className="border rounded-lg px-2 py-2 flex flex-row w-full gap-2"
|
||||
>
|
||||
<img
|
||||
src={location.image_url}
|
||||
className="object-fill h-36 w-32"
|
||||
/>
|
||||
<div className="flex flex-col w-full">
|
||||
<div className="font-bold">{location.name}</div>
|
||||
<div>
|
||||
<a
|
||||
target="_blank"
|
||||
href={`https://wa.me/+62${location.phone}`}
|
||||
>
|
||||
<span>+62{location.phone}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
Alamat : <span>{location.address}</span>
|
||||
</div>
|
||||
<div>
|
||||
Jam Buka :{' '}
|
||||
<span className="font-bold">
|
||||
{location.operational_hour}
|
||||
</span>
|
||||
</div>
|
||||
<div className="pt-2 flex flex-row gap-2 items-center">
|
||||
<a
|
||||
target="_blank"
|
||||
href={`https://wa.me/+62${location.phone}`}
|
||||
className="flex flex-row gap-2 border px-2 py-1 rounded items-center text-green-500 hover:bg-green-400 hover:text-white"
|
||||
>
|
||||
<BsWhatsapp className="w-5 h-5" />
|
||||
<span>Whatsapp</span>
|
||||
</a>
|
||||
<a
|
||||
target="_blank"
|
||||
href={location.gmap_url}
|
||||
className="flex flex-row gap-2 border px-2 py-1 rounded items-center text-gray-500 hover:bg-gray-400 hover:text-white"
|
||||
>
|
||||
<GrMap className="w-5 h-5" />
|
||||
<span>Lokasi</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{next_page_url !== null && (
|
||||
<div
|
||||
onClick={handleNextPage}
|
||||
className="w-full text-center px-2 py-1 border mt-5 hover:bg-blue-600 hover:text-white"
|
||||
>
|
||||
Load more
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</CustomerLayout>
|
||||
)
|
||||
}
|
@ -1 +1,5 @@
|
||||
export const DEFAULT_EXPIRED_UNIT = 'Hari'
|
||||
|
||||
export const STATUS_APPROVE = 0
|
||||
|
||||
export const STATUS_REJECT = 5
|
||||
|
Loading…
Reference in New Issue