@extends('admin.head')
@section('middle')
<script src="https://cdn.ckeditor.com/4.12.1/standard/ckeditor.js"></script>
<section class="content">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Add New Product</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" action="{{ url('insert_product') }}" method="post" enctype="multipart/form-data">
<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
<div class="box-body">
<div class="form-group">
<label for="exampleInputEmail1">Name</label>
<input type="text" name="name" class="form-control" placeholder="Enter Product Name Here" required="" >
</div>
<div class="form-group">
<label for="exampleInputEmail1">Category</label>
<select class="form-control" name="category_id" required="required">
<option value="">select Category</option>
@foreach($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Images</label>
<input class="form-control" required="required" type="file" id="images" name="image[]" multiple />
</div>
<div class="form-group">
<label for="exampleInputPassword1" >Description</label>
<textarea style="height: 550px" class="form-control" name="editor1"></textarea>
</div>
<div style="margin-left: 50%;"><h3>Rates</h3></div>
<div class="sessions col-md-12" >
<table class="table table-bordered">
<thead style="background-color: #4ab752;">
<tr class="tr_clone">
<th style="width: 15%;">Quantity</th>
<th style="width: 13%;">Unit</th>
<th style="width: 13%;">(£)Amount</th>
<!-- <th style="width: 7%;">Add Participant</th>-->
<!-- <th style="width: 7%;">Participant Detail</th>-->
<th style="width: 7%;">Action</th>
</tr>
</thead>
<tbody id="session_body">
<tr>
<td><input type="number" name="quantity[]" placeholder="Enter Quantity Here" class="form-control" required="" step="any"></td>
<td><input type="text" name="unit[]" placeholder="Enter Unit Here" class="form-control" required=""></td>
<td><input type="text" name="amount[]" placeholder="Enter Amount Here" class="form-control" required=""></td>
<td><button class="btn btn-info btn-circle puradd1" type="button"><i class="fa fa-plus-square"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('body').on('click','.puradd1',function(){
var row = $(this).closest("tr");
var newRow = $('<tr>' +
'<td><input type="number" name="quantity[]" placeholder="Enter Quantity Here" class="form-control" required="" step="any"></td>'+
'<td><input type="text" name="unit[]" placeholder="Enter Unit Here" class="form-control" required=""></td>'+
'<td><input type="text" name="amount[]" placeholder="Enter Amount Here" class="form-control" required=""></td>'+
'<td> ' +
'<button class="btn btn-info btn-circle puradd1" type="button"><i class="fa fa-plus-square"></i></button>' +
' <button class="btn btn-warning btn-circle removepur1" type="button"><i class="fa fa-times"></i></button>' +
'</td>' +
'</tr>');
row.after(newRow);
});
$('body').on('click','.removepur1',function(){
$(this).closest('tr').remove();
$('.puradd1').show();
});
});
</script>
<script type="text/javascript">
CKEDITOR.replace('editor1', {
filebrowserUploadUrl: "{{route('ckeditor.upload', ['_token' => csrf_token() ])}}",
filebrowserUploadMethod: 'form'
});
</script>
@endsection
</body>
</html>
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]