Modal in Modal Bootstrap 5 CSS - html

I make modal in the modal, time in the press of the modal button in the modal, do not appear the intended capital, even blank
Has anyone ever done this and the solution?
Transaksi
<h5><i></i> Create Transaction </h5>
<i></i> Transaction
#csrf
<i></i> Member</a>
<button type="button" class="btn btn-sm btn-primary " data-bs-toggle="modal" data-bs-target="#choosePackageModal">
<i class="bi bi-plus"></i> Paket</a>
</button>
</div>
<div class="mb-3">
<label for="transaction_date" class="form-label">Tanggal Transaksi</label>
<input type="date" name="date" value="{{ date('Y-m-d') }}" class="form-control #error('date') is-invalid #enderror" id="date">
#error('date')
<div class="invalid-feedback">
{{ $message }}
</div>
#enderror
</div>
<div class="mb-3">
<label for="deadline" class="form-label">Estimasi Selesai</label>
<input type="date" name="deadline" value="{{ date('Y-m-d', strtotime(date('Y-m-d') . ' + 3 day')) }}" class="form-control #error('deadline') is-invalid #enderror">
#error('deadline')
<span class="invalid-feedback">
{{ $message }}
</span>
#enderror
</div>
<div class="mb-3">
<label for="additional_cost" class="form-label">Biaya Tambahan</label>
<input type="number" name="additional_cost" value="{{ old('additional_cost') }}" class="form-control #error('additional_cost') is-invalid #enderror">
#error('additional_cost')
<span class="invalid-feedback">
{{ $message }}
</span>
#enderror
</div>
<div class="mb-3">
<label for="paid" class="form-label">Pembayaran</label>
<input type="number" name="paid" value="{{ old('paid') }}" class="form-control #error('paid') is-invalid #enderror">
#error('paid')
<span class="invalid-feedback">
{{ $message }}
</span>
#enderror
</div>
<div class="mb-3">
<label for="status" class="form-label">Status Bayar</label>
<select class="form-select form-select mb-3" aria-label=".form-select example" name="status">
<option selected>-- Select status --</option>
<option value="Sudah Dibayar">Bayar Sekarang</option>
<option value="Belum Dibayar">Belum Bayar</option>
</select>
</div>
<button type="submit" class="btn btn-sm btn-primary"><i class="bi bi-plus"></i> Create</button>
</form>
</div>
</div>
</div>
<h5><i></i> Pilih Member </h5>
<i></i> Member
#
Nama Pelanggan
Alamat
Gender
No. Telp
Pilih
#php
$no = 1;
#endphp
#foreach ($members as $member)
{{ $no++; }}
{{ $member->name }}
{{ $member->address }}
{{ $member->gender }}
{{ $member->phone }}
<i></i>
#endforeach
My hope is that when the + Member button is clicked, then the intended capital appears, but when I click, the page becomes blank

Related

How to allow same day booking in t-datepicker

Hi everyone!
I'm trying to allow same day booking for my calendar using the
t-datepicker. I'm trying to use different methods from the
documentation to allow same day booking. For example to allow users to
book from 6th of june till 6th of June. However it's not allowing that
and always adds an extra day when booking. The code is below.
<div class="modal fade" id="myModal">
<div class=row>
<div class="col-sm-10 offset-sm-1">
<div class="modal-dialog modal-lg">
<form action="" method="POST">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Quick Booking</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
{{ csrf_field() }}
#isset($error_msg)
#foreach ($error_msg as $error)
<li class="text-danger">{{ $error }}</li>
#endforeach
#endisset
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Place ID') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="place_id" required>
</div>
</div>
<div class="form-group row">
<label for="placeid" class="col-md-4 col-form-label text-md-right">{{ __('Arrival day') }}: </label>
<div class="col-md-6">
<div class="container11">
<div class="t-datepicker">
<span id="tdatepik" class="t-check-in"></span>
<span id="searchdate_numberofdays" class="t-check-out"></span>
#isset($maparray['err_msg'])
<span id="errormsg_txt" style="color:red;"> {{ __('You can book maximum') }} {{ $maparray["set_admin"]->max_no_days }} {{ __('days') }}.</span><br>
#endisset
<span id="errormsg_txt" style="color:red;display:none;"> {{ __('Arrival day is not selected') }}. </span><br>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="fullname" class="col-md-4 col-form-label text-md-right">{{ __('Full Name') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_fullname" required>
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('Email address') }}: </label>
<div class="col-md-6">
<input type="email" class="form-control" name="user_email" required>
</div>
</div>
<div class="form-group row">
<label for="phone" class="col-md-4 col-form-label text-md-right">{{ __('Phone') }}: </label>
<div class="col-md-6">
<input type="tel" class="form-control" name="user_phone" required>
</div>
</div>
<div class="form-group row">
<label for="geust" class="col-md-4 col-form-label text-md-right">{{ __('Number of adults') }}[1-4]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofguest" name="numberofguest" onchange="addFieldsadmin(this.value);">
<option value="0" active>1</option>
<option value="1">2</option>
<option value="2">3</option>
<option value="3">4</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="babies" class="col-md-4 col-form-label text-md-right">{{ __('Number of babies') }}[1-4]: </label>
<div class="col-md-6">
<select class="form-control booking_inp_textbox_style" id="numberofbabies" name="numberofbabies" onchange="addFieldsadmin2(this.value);">
<option value="0" active>0</option>
<option id="hidden_op_style1" value="1">1</option>
<option id="hidden_op_style2" value="2">2</option>
<option id="hidden_op_style3" value="3">3</option>
<option id="hidden_op_style4" value="4">4</option>
</select>
</div>
</div>
<div class="containerinput">
{{-- dynamic input surname using javascript --}}
</div>
<div class="containerinput2">
{{-- dynamic input surname using javascript --}}
</div>
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Promo Code') }}: </label>
<div class="col-md-6">
<input type="text" class="form-control" name="user_promo">
</div>
</div>
<div class="form-group row">
<label for="book" class="col-md-4 col-form-label text-md-right">{{ __('Booked By') }}: </label>
<div class="col-md-6">
<label>{{ Auth::user()->name }}</label>
</div>
</div>
#if (Auth::user()->role == 'admin')
<div class="form-group row">
<label for="Ammount" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance">
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
<input type="radio" name="user_payment_type" value="Admin" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Admin (Free)') }}</label><br>
</div>
</div>
#else
<div class="form-group row">
<label for="promo" class="col-md-4 col-form-label text-md-right">{{ __('Payment Type') }}: </label>
<div class="col-md-6">
<input type="radio" name="user_payment_type" value="Entrance" checked>
<label for="Entrance" class="booking_payment_type_style">{{ __('Entrance (Cash)') }}</label>
</div>
</div>
#endif
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success">{{ __('Save') }}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
var today = new Date();
tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 60);
var date = tomorrow.getFullYear()+'-'+(tomorrow.getMonth()+1)+'-'+tomorrow.getDate();
$(document).ready(function(){
// Call global the function
$('.t-datepicker').tDatePicker({
// options here
titleDateRange :'{{ __('day') }}',
titleDateRanges:'{{ __('days') }}',
titleToday :'{{ __('Today') }}',
limitDateRanges :'{{ $set_admin->max_no_days+300 }}',
titleCheckIn :'{{ __('Check In') }}',
titleCheckOut :'{{ __('Check Out') }}',
numCalendar : 1,
//endDate: date,
nextDayHighlighted :false,
toDayHighlighted :true,
toDayShowTitle :true,
autoClose: true,
dateRangesHover: false,
});
});
// $('.t-datepicker').tDatePicker('setEndDate','2020-07-28');
</script>
<script type="text/javascript">
#isset($error_msg)
#if (count($error_msg) > 0)
$('#myModal').modal('show');
#endif
#endisset
</script>

Image is not saving on my public path - laravel

im trying to save a profile image on a register blade, the images are going to database with the name but couldn't be save on my public/imgs repository, so i can't even show on a view. Can someone help me to resolve this problem? the name of the image on my database is "foto".
public function store
public function store(StoreUpdatePost $request)
{
$data = $request->all();
if($request->foto('foto')->isValid()){
$file = $request->foto->storeAs('public/users',$nameFile);
$file = str_replace('public/','app/',$file);
$data['foto'] = $file;
}
User::create($data);
//foto upload
if($request->hasFile('foto') && $request->file('foto')->isValid()){
$requestFoto = $request->foto;
$extension = $requestFoto->extension();
$fotoName = md5($requestFoto->getClientOriginalName() . strtotime("now")) . "." . $extension;
$request->foto->move(public_path('imgs\users'), $fotoName);
$data->foto = $fotoName;
$data->save();
}
}
VIEW REGISTER BLADE
#extends('layouts.app')
#section('content')
<div class="container"><!---->
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card" >
<br>
<div class="textocs">
<h4>CADASTRE-SE</h4>
</div>
<br><br>
<div class="card-body">
<form method="POST" enctype=”multipart/form-data” action="{{ route('register') }}">
#csrf
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Nome') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control #error('name') is-invalid #enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
#error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<br>
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-mail:') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control #error('email') is-invalid #enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<br>
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Senha:') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control #error('password') is-invalid #enderror" name="password" required autocomplete="new-password">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<br>
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Redigite a senha:') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
</div>
<br>
</div><br>
<div class="form-group row">
<label for="cidade" class="col-md-4 col-form-label text-md-right">{{ __('Cidade') }}</label>
<div class="col-md-6">
<input id="cidade" type="text" class="form-control #error('cidade') is-invalid #enderror" name="cidade" value="{{ old('cidade') }}" required autocomplete="cidade" autofocus>
#error('cidade')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<br>
</div>
</div>
<div class="form-group row">
<label for="numero" class="col-md-4 col-form-label text-md-right">{{ __('Número') }}</label>
<div class="col-md-6">
<input id="numero" type="number" class="form-control #error('numero') is-invalid #enderror" name="numero" value="{{ old('numero') }}" required autocomplete="numero" autofocus>
#error('numero')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<br>
</div>
</div>
<div class="form-group row">
<label for="foto" class="col-md-4 col-form-label text-md-right">{{ __('Foto') }}</label>
<div class="col-md-6">
<label for="foto">Foto:</label>
<input type="file" class="form-control-file" name="foto" >
<br>
</div>
</div>
<br><br>
<button type="submit" class="btn btn-primary">
{{ __('Cadastrar') }}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection
MIGRATION TO ADD FIELDS ON USERS TABLE
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCamposTableUsers extends Migration
{
/**
* Run the migrations.
*
* #return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('cidade');
$table->string('numero');
$table->string('foto')->nullable();
});
}
/**
* Reverse the migrations.
*
* #return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
Schema::dropIfExists('users');
});
}
}

How to loop foreach in blade while using jquery in Laravel

I'm using Laravel 5.4 and I have never tried jquery so I have no idea what I'm doing, unfortunately.
This is my blade:
<h3>Comments:</h3>
<ul class="list-unstyled activity-list">
#foreach ($threads->comments()->where('parent', 0)->orderBy('created_at', 'desc')->get() as $comment)
<li>
<img src="{{ $comment->user->getAvatar() }}" alt="Avatar" class="img-circle pull-left avatar">
<p><a href="{{ route('profile.view', $comment->user->id) }}">
{{ $comment->user->user_name }}</a>:
<br>
{{ $comment->content }}
<span class="timestamp">{{ $comment->created_at->diffForHumans() }}</span>
</p>
#if ($threads->lock == 0)
<a id="btn-comment" style="padding-left:3.5em">reply</a>
<br>
<form action="{{ route('threads.comments.add') }}" id="comment" method="POST" style="padding-left:3.5em; display:none;">
{{ csrf_field() }}
<input type="hidden" name="thread_id" value="{{ $threads->id }}">
<input type="hidden" name="parent" value="{{ $comment->id }}">
<input type="text" name="content" class="form-control" placeholder="Add reply...">
<input type="submit" class="btn btn-primary btn-xs" value="Add Reply">
</form>
<br>
#endif
#foreach ($comment->childs as $child)
<div style="padding-left:3.5em;">
<img src="{{ $child->user->getAvatar() }}" alt="Avatar" class="img-circle pull-left avatar">
<p><a href="{{ route('profile.view', $child->user->id) }}">
<span style="padding-left:1em;">{{ $child->user->user_name }}</a>: </span>
<br>
<span style="padding-left:1em;">{{ $child->content }}</span>
<span class="timestamp" style="padding-left:4.3em;">{{ $child->created_at->diffForHumans() }}</span>
</p>
</div>
#endforeach
</li>
#endforeach
</ul>
Here's my custom script:
<script>
$(document).ready(function(){
$('#btn-comment').click(function(){
$('#comment').toggle('slide');
});
});
</script>
These lines specifically are the ones that I'm trying to run using the script above:
#if ($threads->lock == 0)
<a id="btn-comment" style="padding-left:3.5em">reply</a>
<br>
<form action="{{ route('threads.comments.add') }}" id="comment" method="POST" style="padding-left:3.5em; display:none;">
{{ csrf_field() }}
<input type="hidden" name="thread_id" value="{{ $threads->id }}">
<input type="hidden" name="parent" value="{{ $comment->id }}">
<input type="text" name="content" class="form-control" placeholder="Add reply...">
<input type="submit" class="btn btn-primary btn-xs" value="Add Reply">
</form>
<br>
#endif
Ask me if you need further detail

How can I do this Input as a Dropdown button

How can I do this Input as a Dropdown button in bootstrap
<div class="form-group">
<label class="col-md-4 control-label" for="user_type">Tipi userit</label>
<div class="col-md-8">
<input id="user_type" name="user_type" type="text" placeholder="Tipi i Userit Admin/Editor/User" class="form-control input-md" value="{{ old('user_type') }}" required>
#if ($errors->has('user_type'))
<span class="help-block">
<strong>{{ $errors->first('user_type') }}</strong>
</span>
#endif
</div>
</div>

Html form not submitting data

This html form is not submitting data and i don't know why.I have tried to find the error and i do not seem to get around it,any help will be gladly appreciated
{% extends 'registration/base.html' %}
{% load widget_tweaks %}
{% block title %}Create account{% endblock %}
{% block body %}
<div class="container" style="padding-top:20px">
<div class="row">
<div class="col-md-4 card jumbotron ">
<h2><span class="badge badge-light">Create Account</span></h2><br>
<form action="{% url 'tzuzz:create_account' %}" method="post">
{% csrf_token %}
<div class="form-group">
<label>Email </label>
<input class="form-control is-valid" type="text" name="email" placeholder="Email">
<label>Names</label>
<input class="form-control is-valid" type="text" name="names" placeholder="Enter first and last name">
<label>Sex</label>
<select class="form-control" name="sex">
<option>Male</option>
<option>Female</option>
</select>
<label>Date of birth</label>
<input class="form-control is-valid" name="date" type="date">
<label>Password</label>
<input class="form-control is-valid" type="password" name="password" placeholder="Password">
</div>
<button class="btn btn-secondary">Login</button>
</form>
<br><br>
{% if error %}
<p class="alert alert-danger alert-dismissible fade show" role="alert">
{{error}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</p>
{% endif %}
</div>
</div>
{% endblock %}
Here is the answer i forgot to include type submit in my button
<button class="btn btn-secondary" type="submit">Login</button>