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 @@
</thead>
<tbody>
<tr>
<td style="width: 13.5%;">Date</td>
<td style="width: 14%;">Date</td>
<td>Description</td>
</tr>
@if($notes)
......@@ -527,12 +527,13 @@
<table id="printtable5" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" class="center aligned">Attachment</th>
<th class="center aligned">Title</th>
<th class="center aligned">Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td style="width: 14%;">{{data_get($check,'attachement.filename')}}</td>
<td>
<a href="{{ asset(data_get($check,'attachement.path'))}}" target="_blank">
......
......@@ -9,13 +9,16 @@
<div class="content">
<form class="ui form" action="/action/upload" method="POST" enctype="multipart/form-data">
{{csrf_field()}}
<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">
<label>Title</label>
<input type="file" name="attachment" id="uploadfile" style="">
<label>Upload file</label>
<input type="file" name="attachment" id="uploadfile" style="" accept=".xls, .xlsx, .pdf">
</div>
<button class="ui blue button" type="submit">Upload</button>
</form>
......
......@@ -1163,12 +1163,14 @@ class FormController extends Controller
$upd = NotesAttachement::where('fk_timesheet_master',$request->id)->first();
// $upd->fk_timesheet_master = $request->id;
$upd->path = $shortpath;
$upd->filename = $request->filename;
$upd->save();
}else{
$upd = new NotesAttachement;
$upd->fk_timesheet_master = $request->id;
$upd->filename = $request->filename;
$upd->path = $shortpath;
$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