memperbaiki tampilan dan menghubungkan dengan database

parent 04ebd427
...@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; ...@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class CreateDatapegawaiTable extends Migration class CreatepegawaiTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,7 +13,7 @@ class CreateDatapegawaiTable extends Migration ...@@ -13,7 +13,7 @@ class CreateDatapegawaiTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('datapegawai', function (Blueprint $table) { Schema::create('pegawai', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('name'); $table->string('name');
$table->string('alamat'); $table->string('alamat');
...@@ -30,6 +30,6 @@ class CreateDatapegawaiTable extends Migration ...@@ -30,6 +30,6 @@ class CreateDatapegawaiTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::drop('datapegawai'); Schema::drop('pegawai');
} }
} }
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
</div> </div>
</div> </div>
<div class="form-group {!! $errors->has('harga') ? 'has-error' : '' !!}"> <div class="form-group{{ $errors->has('harga') ? ' has-error' : '' }}">
{!! Form::label('harga', 'Harga', ['class'=>'col-md-2 control-label']) !!} {!! Form::label('harga', 'Harga', ['class'=>'col-md-2 control-label']) !!}
<div class="col-md-4"> <div class="col-md-4">
{!! Form::select('harga', [''=>'']+App\Author::pluck('name','id')->all(), null, [ {!! Form::number('harga', null, ['class'=>'form-control', 'min'=>1]) !!}
'class'=>'js-selectize',
'placeholder' => 'harga']) !!}
{!! $errors->first('harga', '<p class="help-block">:message</p>') !!} {!! $errors->first('harga', '<p class="help-block">:message</p>') !!}
@if (isset($book))
<p class="help-block">{{ $book->borrowed }} harga telah masuk</p>
@endif
</div> </div>
</div> </div>
......
...@@ -54,6 +54,7 @@ CREATE TABLE IF NOT EXISTS `books` ( ...@@ -54,6 +54,7 @@ CREATE TABLE IF NOT EXISTS `books` (
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`author_id` int(10) unsigned NOT NULL, `author_id` int(10) unsigned NOT NULL,
`amount` int(10) unsigned NOT NULL, `amount` int(10) unsigned NOT NULL,
`harga` varchar(20) unsigned NOT NULL,
`cover` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cover` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL `updated_at` timestamp NULL DEFAULT NULL
......
...@@ -11,7 +11,7 @@ return array( ...@@ -11,7 +11,7 @@ return array(
'CreateAuthorsTable' => $baseDir . '/database/migrations/2016_12_12_114448_create_authors_table.php', 'CreateAuthorsTable' => $baseDir . '/database/migrations/2016_12_12_114448_create_authors_table.php',
'CreateBooksTable' => $baseDir . '/database/migrations/2016_12_12_120408_create_books_table.php', 'CreateBooksTable' => $baseDir . '/database/migrations/2016_12_12_120408_create_books_table.php',
'CreateBorrowLogsTable' => $baseDir . '/database/migrations/2016_12_30_094623_create_borrow_logs_table.php', 'CreateBorrowLogsTable' => $baseDir . '/database/migrations/2016_12_30_094623_create_borrow_logs_table.php',
'CreateDatapegawaiTable' => $baseDir . '/database/migrations/2017_05_08_085711_create_datapegawai_table.php', 'CreateDatapegawaiTable' => $baseDir . '/database/migrations/2017_05_08_085711_create_pegawai_table.php',
'CreatePasswordResetsTable' => $baseDir . '/database/migrations/2014_10_12_100000_create_password_resets_table.php', 'CreatePasswordResetsTable' => $baseDir . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
'CreatePostsTable' => $baseDir . '/database/migrations/2016_12_11_110857_create_posts_table.php', 'CreatePostsTable' => $baseDir . '/database/migrations/2016_12_11_110857_create_posts_table.php',
'CreateUsersTable' => $baseDir . '/database/migrations/2014_10_12_000000_create_users_table.php', 'CreateUsersTable' => $baseDir . '/database/migrations/2014_10_12_000000_create_users_table.php',
......
...@@ -355,7 +355,7 @@ class ComposerStaticInit6daa598fae9ed14b9ff672201755e79c ...@@ -355,7 +355,7 @@ class ComposerStaticInit6daa598fae9ed14b9ff672201755e79c
'CreateAuthorsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_12_114448_create_authors_table.php', 'CreateAuthorsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_12_114448_create_authors_table.php',
'CreateBooksTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_12_120408_create_books_table.php', 'CreateBooksTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_12_120408_create_books_table.php',
'CreateBorrowLogsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_30_094623_create_borrow_logs_table.php', 'CreateBorrowLogsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_30_094623_create_borrow_logs_table.php',
'CreateDatapegawaiTable' => __DIR__ . '/../..' . '/database/migrations/2017_05_08_085711_create_datapegawai_table.php', 'CreateDatapegawaiTable' => __DIR__ . '/../..',
'CreatePasswordResetsTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_100000_create_password_resets_table.php', 'CreatePasswordResetsTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
'CreatePostsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_11_110857_create_posts_table.php', 'CreatePostsTable' => __DIR__ . '/../..' . '/database/migrations/2016_12_11_110857_create_posts_table.php',
'CreateUsersTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_000000_create_users_table.php', 'CreateUsersTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_000000_create_users_table.php',
......
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