Commit 04d7f70a by hannan

changes

parent fb3e31f7
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFilenameColumnInNotesAttachement extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('notes_attachement', function (Blueprint $table) {
$table->string('filename', 50)->after('fk_timesheet_master')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('notes_attachement', function (Blueprint $table) {
$table->dropColumn('filename');
});
}
}
...@@ -510,7 +510,7 @@ ...@@ -510,7 +510,7 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td style="width: 13.5%;">Date</td> <td style="width: 14%;">Date</td>
<td>Description</td> <td>Description</td>
</tr> </tr>
@if($notes) @if($notes)
...@@ -527,12 +527,13 @@ ...@@ -527,12 +527,13 @@
<table id="printtable5" class="ui celled structured table unstackable"> <table id="printtable5" class="ui celled structured table unstackable">
<thead> <thead>
<tr> <tr>
<th colspan="2" class="center aligned">Attachment</th> <th class="center aligned">Title</th>
<th class="center aligned">Attachment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td style="width: 4%;"></td> <td style="width: 14%;">{{data_get($check,'attachement.filename')}}</td>
<td> <td>
<a href="{{ asset(data_get($check,'attachement.path'))}}" target="_blank"> <a href="{{ asset(data_get($check,'attachement.path'))}}" target="_blank">
......
...@@ -9,13 +9,16 @@ ...@@ -9,13 +9,16 @@
<div class="content"> <div class="content">
<form class="ui form" action="/action/upload" method="POST" enctype="multipart/form-data"> <form class="ui form" action="/action/upload" method="POST" enctype="multipart/form-data">
{{csrf_field()}} {{csrf_field()}}
<input type="hidden" name="id" value="{{$fk_tm_id}}"> <input type="hidden" name="id" value="{{$fk_tm_id}}">
<div class="field">
<label for="title">File Name</label>
<input type="text" name="filename">
</div>
<div class="field"> <div class="field">
<label>Title</label> <label>Upload file</label>
<input type="file" name="attachment" id="uploadfile" style=""> <input type="file" name="attachment" id="uploadfile" style="" accept=".xls, .xlsx, .pdf">
</div> </div>
<button class="ui blue button" type="submit">Upload</button> <button class="ui blue button" type="submit">Upload</button>
</form> </form>
......
...@@ -1163,12 +1163,14 @@ class FormController extends Controller ...@@ -1163,12 +1163,14 @@ class FormController extends Controller
$upd = NotesAttachement::where('fk_timesheet_master',$request->id)->first(); $upd = NotesAttachement::where('fk_timesheet_master',$request->id)->first();
// $upd->fk_timesheet_master = $request->id; // $upd->fk_timesheet_master = $request->id;
$upd->path = $shortpath; $upd->path = $shortpath;
$upd->filename = $request->filename;
$upd->save(); $upd->save();
}else{ }else{
$upd = new NotesAttachement; $upd = new NotesAttachement;
$upd->fk_timesheet_master = $request->id; $upd->fk_timesheet_master = $request->id;
$upd->filename = $request->filename;
$upd->path = $shortpath; $upd->path = $shortpath;
$upd->save(); $upd->save();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment