Skip to content
Snippets Groups Projects
Commit d90514b5 authored by Yoga Adrian's avatar Yoga Adrian
Browse files

informal

parent 408b9986
Branches
No related merge requests found
Showing
with 1995 additions and 30 deletions
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Informal;
use Session;
class PendinFormalController extends Controller
{
//
public function getAll() {
$pend = informal::all()->sortby('nip');
$nip = null;
return view('pages.informalPegawai',compact('pend','nip'));
}
public function getPendidikan($nip) {
$pend = informal::where('nip',$nip)->get();
return view('pages.informalPegawai',compact('pend','nip'));;
}
public function edit($id) {
$pend = informal::find($id);
return view('pages.editInformal', compact('pend'));
}
public function store(Request $request) {
$informal = new informal;
$informal->nip = $request->input('nip');
$informal->nama_institusi = $request->input('nama_institusi');
$informal->keahlian = $request->input('keahlian');
$informal->no_ijazah = $request->input('no_ijazah');
$informal->tahun = $request->input('tahun');
$informal->durasi = $request->input('durasi');
$informal->save();
Session::flash('message', 'Pendidikan informal berhasil ditambahkan');
return \Redirect::to('pendidikan-informal');
}
public function update(Request $request, $id) {
$informal = informal::find($id);
$informal->nip = $request->input('nip');
$informal->nama_institusi = $request->input('nama_institusi');
$informal->keahlian = $request->input('keahlian');
$informal->no_ijazah = $request->input('no_ijazah');
$informal->tahun = $request->input('tahun');
$informal->durasi = $request->input('durasi');
$informal->save();
Session::flash('message', 'Pendidikan informal berhasil diperbaharui');
return \Redirect::to('pendidikan-informal');
}
public function delete($id) {
$informal = informal::find($id);
$informal->delete();
Session::flash('message', 'Pendidikan informal berhasil dihapus');
return \Redirect::to('pendidikan-informal');
}
public function search(Request $request) {
$res = $request->input('query');
return \Redirect::to('pendidikan-informal/all/'.$res);
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\non_formal;
use View;
class nonformalcontroller extends Controller
{
//
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// get all the nerds
$nonformals = non_formal::all();
// load the view and pass the nerds
return View::make('non_formal.index')
->with('nonformals', $nonformals);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return View::make('non_formal.create');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}
}
......@@ -19,18 +19,36 @@ Route::get('pendidikan-formal/new', function() {
return view('pages.formPendidikan');
});
Route::delete('pendidikan-formal/delete/{id}', 'PendFormalController@delete');
Route::get('pendidikan-formal/delete/{id}', 'PendFormalController@delete');
Route::post('pendidikan-formal/{id}/update', 'PendFormalController@update');
Route::get('pendidikan-formal/{id}/edit','PendFormalController@edit');
Route::get('pendidikan-formal/{id}/delete','PendFormalController@getPendidikan');
Route::get('pendidikan-formal/all/{nip}','PendFormalController@getPendidikan');
Route::post('pendidikan-formal/add', 'PendFormalController@store');
Route::get('pendidikan-formal', 'PendFormalController@getAll');
Route::get('pendidikan-formal/search', 'PendFormalController@search');
\ No newline at end of file
Route::get('pendidikan-formal/search', 'PendFormalController@search');
//Router for pendidikan informal
Route::get('pendidikan-informal/new', function() {
return view('pages.formInformal');
});
Route::get('pendidikan-informal/delete/{id}', 'PendinFormalController@delete');
Route::post('pendidikan-informal/{id}/update', 'PendinFormalController@update');
Route::get('pendidikan-informal/{id}/edit','PendinFormalController@edit');
Route::get('pendidikan-informal/all/{nip}','PendinFormalController@getPendidikan');
Route::post('pendidikan-informal/add', 'PendinFormalController@store');
Route::get('pendidikan-informal', 'PendinFormalController@getAll');
Route::get('pendidikan-informal/search', 'PendinFormalController@search');
\ No newline at end of file
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class informal extends Model
{
protected $table = 'informals';
protected $primaryKey = 'id';
public $timestamps = false; //tidak ada create_at dan update_at
protected $connection = 'mysql';
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class non_formal extends Model
{
//
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "c284a9c122da36c99a8b6597bdce7aa6",
"hash": "f9970cd39457a3bb5fbaf7d5bade1e53",
"content-hash": "8b1485987e7c5949da82435d403e52e8",
"packages": [
{
......@@ -308,16 +308,16 @@
},
{
"name": "laravel/framework",
"version": "v5.2.28",
"version": "v5.2.29",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "69acb1f8ec254511e10138890364865ff2645ddd"
"reference": "e3d644eb131f18c5f3d28ff7bc678bc797091f20"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/69acb1f8ec254511e10138890364865ff2645ddd",
"reference": "69acb1f8ec254511e10138890364865ff2645ddd",
"url": "https://api.github.com/repos/laravel/framework/zipball/e3d644eb131f18c5f3d28ff7bc678bc797091f20",
"reference": "e3d644eb131f18c5f3d28ff7bc678bc797091f20",
"shasum": ""
},
"require": {
......@@ -432,7 +432,7 @@
"framework",
"laravel"
],
"time": "2016-04-01 18:26:27"
"time": "2016-04-03 01:43:55"
},
{
"name": "league/flysystem",
......@@ -519,16 +519,16 @@
},
{
"name": "monolog/monolog",
"version": "1.18.1",
"version": "1.18.2",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "a5f2734e8c16f3aa21b3da09715d10e15b4d2d45"
"reference": "064b38c16790249488e7a8b987acf1c9d7383c09"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/a5f2734e8c16f3aa21b3da09715d10e15b4d2d45",
"reference": "a5f2734e8c16f3aa21b3da09715d10e15b4d2d45",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09",
"reference": "064b38c16790249488e7a8b987acf1c9d7383c09",
"shasum": ""
},
"require": {
......@@ -543,13 +543,13 @@
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"raven/raven": "^0.13",
"ruflin/elastica": ">=0.90 <3.0",
"swiftmailer/swiftmailer": "~5.3",
"videlalvaro/php-amqplib": "~2.4"
"swiftmailer/swiftmailer": "~5.3"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
......@@ -558,11 +558,11 @@
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"raven/raven": "Allow sending log messages to a Sentry server",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
},
"type": "library",
"extra": {
......@@ -593,7 +593,7 @@
"logging",
"psr-3"
],
"time": "2016-03-13 16:08:35"
"time": "2016-04-02 13:12:58"
},
{
"name": "mtdowling/cron-expression",
......
......@@ -26,7 +26,7 @@ return [
|
*/
'debug' => env('APP_DEBUG', false),
'debug' => env('APP_DEBUG', true),
/*
|--------------------------------------------------------------------------
......
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class NonFormal extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 04, 2016 at 08:35 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `pendidikan`
--
-- --------------------------------------------------------
--
-- Table structure for table `informals`
--
CREATE TABLE `informals` (
`id` int(11) NOT NULL DEFAULT '0',
`nip` varchar(20) NOT NULL,
`nama_institusi` varchar(140) NOT NULL,
`keahlian` varchar(140) NOT NULL,
`no_ijazah` varchar(30) NOT NULL,
`tahun` year(4) NOT NULL,
`durasi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `informals`
--
INSERT INTO `informals` (`id`, `nip`, `nama_institusi`, `keahlian`, `no_ijazah`, `tahun`, `durasi`) VALUES
(1, '12345678', 'ITB', 'Teknik Informatika', 'ab12345', 2001, 0),
(2, '12345678', 'ITB', 'Teknik Elektro', 'bc23455', 2007, 0);
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`migration`, `batch`) VALUES
('2014_10_12_000000_create_users_table', 1),
('2014_10_12_100000_create_password_resets_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `pendidikan_formal`
--
CREATE TABLE `pendidikan_formal` (
`id` int(11) NOT NULL,
`nip` int(11) NOT NULL,
`nama_institusi` varchar(140) NOT NULL,
`tingkatan` varchar(20) NOT NULL,
`gelar` varchar(10) NOT NULL,
`jurusan` varchar(140) NOT NULL,
`no_ijazah` varchar(30) NOT NULL,
`tahun` year(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pendidikan_formal`
--
INSERT INTO `pendidikan_formal` (`id`, `nip`, `nama_institusi`, `tingkatan`, `gelar`, `jurusan`, `no_ijazah`, `tahun`) VALUES
(1, 12345678, 'ITB', 'S1', 'ST', 'Teknik Informatika', 'ab12345', 2001),
(2, 12345678, 'ITB', 'S2', 'M.T.', 'Teknik Elektro', 'bc23455', 2007);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`),
ADD KEY `password_resets_token_index` (`token`);
--
-- Indexes for table `pendidikan_formal`
--
ALTER TABLE `pendidikan_formal`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `pendidikan_formal`
--
ALTER TABLE `pendidikan_formal`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
......@@ -66,12 +66,12 @@
</li>
<li>
<a href="#">
<a href="{{URL::to('pendidikan-informal')}}">
<span>Pendidikan Informal</span>
</a>
</li>
<li>
<a href="#">
<a href="{{URL::to('institusi')}}">
<span>Institusi</span>
</a>
</li>
......
This diff is collapsed.
This diff is collapsed.
@extends('app_template')
@section('title')
Edit | Form Pendidikan Pegawai
@stop
@section('page_title')
<h2>Edit Pendidikan Pegawai </h2>
<h3>>NIP : {{$pend->nip}}</h3>
@stop
@section('content')
<div class="panel panel-default">
<div class="panel-heading font-bold">Tambahkan Pendidikan Pegawai</div>
<div class="panel-body">
<form class="bs-example form-horizontal" method = "POST" action = "{{URL::to('/')}}/pendidikan-informal/{{$pend->id}}/update">
<div class="form-group">
<label class="col-lg-2 control-label">NIP</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="NIP" name="nip" value="{{$pend->nip}}" readonly></input>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Institusi</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Nama Institusi" name="nama_institusi" required value="{{$pend->nama_institusi}}"></input>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Keahlian</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Keahlian" name= "keahlian" required value ="{{$pend->keahlian}}"></input>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Nomor Ijazah</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Nomor Ijazah" name= "no_ijazah" required value="{{$pend->no_ijazah}}"></input>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Tahun Lulus</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Tahun Lulus" name= "tahun" required value="{{$pend->tahun}}"></input>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Durasi Sertifikat</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Durasi Sertifikat dalam tahun" name= "durasi" required value="{{$pend->durasi}}"></input>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-8">
<button type="submit" class="btn btn-sm btn-info">Update</button>
</div>
</div>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>
</div>
</div>
@stop
\ No newline at end of file
@extends('app_template')
@section('title')
Form Pendidikan Pegawai
@stop
@section('page_title')
<h2>Daftarkan Pendidikan Informal</h2>
@stop
@section('content')
<div class="panel panel-default">
<div class="panel-heading font-bold">Tambahkan Pendidikan Pegawai</div>
<div class="panel-body">
<form class="bs-example form-horizontal" method = "POST" action = "{{URL::to('pendidikan-informal/add')}}">
<div class="form-group">
<label class="col-lg-2 control-label">NIP</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="NIP" name="nip" required>
<span class="help-block m-b-none">Isikan NIP Pegawai</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Institusi</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Nama Institusi" name="nama_institusi" required>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Keahlian</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Keahlian" name= "keahlian" required>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Nomor Ijazah</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Nomor Ijazah" name= "no_ijazah" required>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Tahun Lulus</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Tahun Lulus" name= "tahun" required>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Durasi Sertifikat</label>
<div class="col-lg-8">
<input type="text" class="form-control" placeholder="Durasi Sertifikat dalam tahun" name= "durasi" required>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-8">
<button type="submit" class="btn btn-sm btn-info">Kirim</button>
</div>
</div>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>
</div>
</div>
@stop
\ No newline at end of file
......@@ -31,14 +31,12 @@
<label class="col-sm-2 control-label">Tingkatan</label>
<div class="col-sm-4">
<select name="tingkatan" class="form-control m-b">
<option>S3</option>
<option>S2</option>
<option>S1</option>
<option>D4</option>
<option>D3</option>
<option>D2</option>
<option>D1</option>
<option>SMA</option>
<option>Strata 3</option>
<option>Strata 2</option>
<option>Strata 1</option>
<option>SMA/Sederajat</option>
<option>SMP/Sederajat</option>
<option>SD/Sederajat</option>
</select>
</div>
</div>
......
@extends('app_template')
@section('title')
Pendidikan Pegawai
@stop
@section('page_title')
<h2>Pendidikan Informal Pegawai</h2>
@stop
@section('head_content')
@if (Session::has('message'))
<div class="alert alert-info fade in">{{ Session::get('message') }}
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
</div>
@endif
<div class="row">
<div class="col-md-3">
<button class="btn m-b-sm m-r-sm btn-success" onclick="location.href = '{{URL::to('/')}}/pendidikan-informal/new';"><i class="m-r-xs fa fa-plus"></i>Tambahkan Pendidikan</button>
</div>
<div class="col-md-6">
<form action = "{{URL::to('/')}}/pendidikan-informal/search" method="GET">
<div class="input-group">
<input type="text" class="form-control" placeholder="Cari berdasarkan NIP" name="query" required>
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Go!</button>
</span>
</div>
</form>
</div>
</div>
@stop
@section('content')
<div class="panel panel-default">
<div class="panel-heading font-semibold">
<!-- Tampilkan Pesan -->
Tabel Pendidikan Informal
@if($nip == null)
Semua Pegawai
@else
Pegawai NIP : {{$nip}}
@endif
</div>
<div>
<table class="table" ui-jq="footable" ui-options='{
"paging": {
"enabled": true
}}'>
<thead>
<tr>
<th data-breakpoints="xs">No</th>
<th>NIP</th>
<th data-breakpoints="xs md">Nama Institusi</th>
<th>Tingkatan</th>
<th data-breakpoints="xs sm md">No Ijazah</th>
<th data-breakpoints="xs sm md">Tahun</th>
<th data-breakpoints="xs sm md">Durasi</th>
<th data-breakpoints="xs sm">Aksi</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
@foreach($pend as $pendidikan_informal)
<tr data-expanded="true">
<td>{{$i}}</td>
<td>{{$pendidikan_informal -> nip}}</td>
<td>{{$pendidikan_informal -> nama_institusi}}</td>
<td>{{$pendidikan_informal -> keahlian}}</td>
<td>{{$pendidikan_informal -> no_ijazah}}</td>
<td>{{$pendidikan_informal -> tahun}}</td>
<td>{{$pendidikan_informal -> durasi}}</td>
<td>
<div class="btn-group dropdown">
<button class="btn m-b-sm m-r-sm btn-warning btn-sm" data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="{{URL::to('/')}}/pendidikan-informal/{{$pendidikan_informal->id}}/edit">Edit</a></li>
<li class="divider"></li>
<li><a href="{{URL::to('/')}}/pendidikan-informal/delete/{{$pendidikan_informal->id}}">Hapus</a></li>
</ul>
</div>
</td>
</tr>
<?php $i++ ;?>
@endforeach
</tbody>
</table>
</div>
@stop
\ No newline at end of file
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