new init

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
php:
preset: laravel
disabled:
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
</p>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Cubet Techno Labs](https://cubettech.com)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[Many](https://www.many.co.uk)**
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
- **[DevSquad](https://devsquad.com)**
- **[OP.GG](https://op.gg)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
<?php
namespace App\Actions\Fortify;
use App\Models\Team;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\CreatesNewUsers;
use Laravel\Jetstream\Jetstream;
class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules;
/**
* Create a newly registered user.
*
* @param array $input
* @return \App\Models\User
*/
public function create(array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();
return DB::transaction(function () use ($input) {
return tap(User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
]), function (User $user) {
$this->createTeam($user);
});
});
}
/**
* Create a personal team for the user.
*
* @param \App\Models\User $user
* @return void
*/
protected function createTeam(User $user)
{
$user->ownedTeams()->save(Team::forceCreate([
'user_id' => $user->id,
'name' => explode(' ', $user->name, 2)[0]."'s Team",
'personal_team' => true,
]));
}
}
<?php
namespace App\Actions\Fortify;
use Laravel\Fortify\Rules\Password;
trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules()
{
return ['required', 'string', new Password, 'confirmed'];
}
}
<?php
namespace App\Actions\Fortify;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\ResetsUserPasswords;
class ResetUserPassword implements ResetsUserPasswords
{
use PasswordValidationRules;
/**
* Validate and reset the user's forgotten password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function reset($user, array $input)
{
Validator::make($input, [
'password' => $this->passwordRules(),
])->validate();
$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}
<?php
namespace App\Actions\Fortify;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
class UpdateUserPassword implements UpdatesUserPasswords
{
use PasswordValidationRules;
/**
* Validate and update the user's password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
{
Validator::make($input, [
'current_password' => ['required', 'string'],
'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) {
$validator->errors()->add('current_password', __('The provided password does not match your current password.'));
}
})->validateWithBag('updatePassword');
$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}
<?php
namespace App\Actions\Fortify;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
class UpdateUserProfileInformation implements UpdatesUserProfileInformation
{
/**
* Validate and update the given user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
])->validateWithBag('updateProfileInformation');
if (isset($input['photo'])) {
$user->updateProfilePhoto($input['photo']);
}
if ($input['email'] !== $user->email &&
$user instanceof MustVerifyEmail) {
$this->updateVerifiedUser($user, $input);
} else {
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
])->save();
}
}
/**
* Update the given verified user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
protected function updateVerifiedUser($user, array $input)
{
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
'email_verified_at' => null,
])->save();
$user->sendEmailVerificationNotification();
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Validator;
use Laravel\Jetstream\Contracts\AddsTeamMembers;
use Laravel\Jetstream\Events\AddingTeamMember;
use Laravel\Jetstream\Events\TeamMemberAdded;
use Laravel\Jetstream\Jetstream;
use Laravel\Jetstream\Rules\Role;
class AddTeamMember implements AddsTeamMembers
{
/**
* Add a new team member to the given team.
*
* @param mixed $user
* @param mixed $team
* @param string $email
* @param string|null $role
* @return void
*/
public function add($user, $team, string $email, string $role = null)
{
Gate::forUser($user)->authorize('addTeamMember', $team);
$this->validate($team, $email, $role);
$newTeamMember = Jetstream::findUserByEmailOrFail($email);
AddingTeamMember::dispatch($team, $newTeamMember);
$team->users()->attach(
$newTeamMember, ['role' => $role]
);
TeamMemberAdded::dispatch($team, $newTeamMember);
}
/**
* Validate the add member operation.
*
* @param mixed $team
* @param string $email
* @param string|null $role
* @return void
*/
protected function validate($team, string $email, ?string $role)
{
Validator::make([
'email' => $email,
'role' => $role,
], $this->rules(), [
'email.exists' => __('We were unable to find a registered user with this email address.'),
])->after(
$this->ensureUserIsNotAlreadyOnTeam($team, $email)
)->validateWithBag('addTeamMember');
}
/**
* Get the validation rules for adding a team member.
*
* @return array
*/
protected function rules()
{
return array_filter([
'email' => ['required', 'email', 'exists:users'],
'role' => Jetstream::hasRoles()
? ['required', 'string', new Role]
: null,
]);
}
/**
* Ensure that the user is not already on the team.
*
* @param mixed $team
* @param string $email
* @return \Closure
*/
protected function ensureUserIsNotAlreadyOnTeam($team, string $email)
{
return function ($validator) use ($team, $email) {
$validator->errors()->addIf(
$team->hasUserWithEmail($email),
'email',
__('This user already belongs to the team.')
);
};
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Validator;
use Laravel\Jetstream\Contracts\CreatesTeams;
use Laravel\Jetstream\Events\AddingTeam;
use Laravel\Jetstream\Jetstream;
class CreateTeam implements CreatesTeams
{
/**
* Validate and create a new team for the given user.
*
* @param mixed $user
* @param array $input
* @return mixed
*/
public function create($user, array $input)
{
Gate::forUser($user)->authorize('create', Jetstream::newTeamModel());
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
])->validateWithBag('createTeam');
AddingTeam::dispatch($user);
$user->switchTeam($team = $user->ownedTeams()->create([
'name' => $input['name'],
'personal_team' => false,
]));
return $team;
}
}
<?php
namespace App\Actions\Jetstream;
use Laravel\Jetstream\Contracts\DeletesTeams;
class DeleteTeam implements DeletesTeams
{
/**
* Delete the given team.
*
* @param mixed $team
* @return void
*/
public function delete($team)
{
$team->purge();
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Support\Facades\DB;
use Laravel\Jetstream\Contracts\DeletesTeams;
use Laravel\Jetstream\Contracts\DeletesUsers;
class DeleteUser implements DeletesUsers
{
/**
* The team deleter implementation.
*
* @var \Laravel\Jetstream\Contracts\DeletesTeams
*/
protected $deletesTeams;
/**
* Create a new action instance.
*
* @param \Laravel\Jetstream\Contracts\DeletesTeams $deletesTeams
* @return void
*/
public function __construct(DeletesTeams $deletesTeams)
{
$this->deletesTeams = $deletesTeams;
}
/**
* Delete the given user.
*
* @param mixed $user
* @return void
*/
public function delete($user)
{
DB::transaction(function () use ($user) {
$this->deleteTeams($user);
$user->deleteProfilePhoto();
$user->tokens->each->delete();
$user->delete();
});
}
/**
* Delete the teams and team associations attached to the user.
*
* @param mixed $user
* @return void
*/
protected function deleteTeams($user)
{
$user->teams()->detach();
$user->ownedTeams->each(function ($team) {
$this->deletesTeams->delete($team);
});
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Jetstream\Contracts\InvitesTeamMembers;
use Laravel\Jetstream\Events\InvitingTeamMember;
use Laravel\Jetstream\Jetstream;
use Laravel\Jetstream\Mail\TeamInvitation;
use Laravel\Jetstream\Rules\Role;
class InviteTeamMember implements InvitesTeamMembers
{
/**
* Invite a new team member to the given team.
*
* @param mixed $user
* @param mixed $team
* @param string $email
* @param string|null $role
* @return void
*/
public function invite($user, $team, string $email, string $role = null)
{
Gate::forUser($user)->authorize('addTeamMember', $team);
$this->validate($team, $email, $role);
InvitingTeamMember::dispatch($team, $email, $role);
$invitation = $team->teamInvitations()->create([
'email' => $email,
'role' => $role,
]);
Mail::to($email)->send(new TeamInvitation($invitation));
}
/**
* Validate the invite member operation.
*
* @param mixed $team
* @param string $email
* @param string|null $role
* @return void
*/
protected function validate($team, string $email, ?string $role)
{
Validator::make([
'email' => $email,
'role' => $role,
], $this->rules($team), [
'email.unique' => __('This user has already been invited to the team.'),
])->after(
$this->ensureUserIsNotAlreadyOnTeam($team, $email)
)->validateWithBag('addTeamMember');
}
/**
* Get the validation rules for inviting a team member.
*
* @param mixed $team
* @return array
*/
protected function rules($team)
{
return array_filter([
'email' => ['required', 'email', Rule::unique('team_invitations')->where(function ($query) use ($team) {
$query->where('team_id', $team->id);
})],
'role' => Jetstream::hasRoles()
? ['required', 'string', new Role]
: null,
]);
}
/**
* Ensure that the user is not already on the team.
*
* @param mixed $team
* @param string $email
* @return \Closure
*/
protected function ensureUserIsNotAlreadyOnTeam($team, string $email)
{
return function ($validator) use ($team, $email) {
$validator->errors()->addIf(
$team->hasUserWithEmail($email),
'email',
__('This user already belongs to the team.')
);
};
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\ValidationException;
use Laravel\Jetstream\Contracts\RemovesTeamMembers;
use Laravel\Jetstream\Events\TeamMemberRemoved;
class RemoveTeamMember implements RemovesTeamMembers
{
/**
* Remove the team member from the given team.
*
* @param mixed $user
* @param mixed $team
* @param mixed $teamMember
* @return void
*/
public function remove($user, $team, $teamMember)
{
$this->authorize($user, $team, $teamMember);
$this->ensureUserDoesNotOwnTeam($teamMember, $team);
$team->removeUser($teamMember);
TeamMemberRemoved::dispatch($team, $teamMember);
}
/**
* Authorize that the user can remove the team member.
*
* @param mixed $user
* @param mixed $team
* @param mixed $teamMember
* @return void
*/
protected function authorize($user, $team, $teamMember)
{
if (! Gate::forUser($user)->check('removeTeamMember', $team) &&
$user->id !== $teamMember->id) {
throw new AuthorizationException;
}
}
/**
* Ensure that the currently authenticated user does not own the team.
*
* @param mixed $teamMember
* @param mixed $team
* @return void
*/
protected function ensureUserDoesNotOwnTeam($teamMember, $team)
{
if ($teamMember->id === $team->owner->id) {
throw ValidationException::withMessages([
'team' => [__('You may not leave a team that you created.')],
])->errorBag('removeTeamMember');
}
}
}
<?php
namespace App\Actions\Jetstream;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Validator;
use Laravel\Jetstream\Contracts\UpdatesTeamNames;
class UpdateTeamName implements UpdatesTeamNames
{
/**
* Validate and update the given team's name.
*
* @param mixed $user
* @param mixed $team
* @param array $input
* @return void
*/
public function update($user, $team, array $input)
{
Gate::forUser($user)->authorize('update', $team);
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
])->validateWithBag('updateTeamName');
$team->forceFill([
'name' => $input['name'],
])->save();
}
}
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
//
}
}
<?php
namespace App\Exports;
use App\Models\DaftarProposalBelmawa;
use Illuminate\Support\Facades\DB;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class DaftarProposalBelmawaExport implements FromView,ShouldAutoSize
{
/**
* @return \Illuminate\Support\Collection
*/
public function __construct($jenis,$status,$tahun)
{
$this->jenis= $jenis;
$this->status = $status;
$this->tahun= $tahun;
}
public function view(): View
{
$statement = " STATUS_HAPUS = '0' ";
if($this->jenis != "0")
{
$statement .= " AND jenis_id = '".$this->jenis."'";
}
if($this->status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $this->status - 1;
$statement .= " AND STATUS = '".$status."'";
}
if($this->tahun != "0")
{
$statement .= " AND PERIODE = '".$this->tahun."'";
}
$data = DaftarProposalBelmawa::with('rKelompokDetil')->whereRaw($statement)->get();
$result = [];
$no = 0;
foreach ($data as $key => $value) {
$dospem = "(".str_replace("###",") ",$value->identitas_dospem);
$url = "https://statik.unesa.ac.id/simpkm/proposal/".$value->periode."/".$value->upload_dokumen;
$urut = 1;
foreach ($value->rKelompokDetil as $keys => $detil) {
if($detil->status_ketua == '1')
{
$keanggotaan = "Ketua";
}
else
{
$keanggotaan = "Anggota ".$urut;
$urut++;
}
$result[$no]['rowspan'] = count($value->rKelompokDetil);
$result[$no]['kode'] = $value->kode_kelompok;
$result[$no]['jenis'] = $value->jenis_pkm;
$result[$no]['fak'] = $detil->fakultas;
$result[$no]['nama'] = $detil->nama;
$result[$no]['nim'] = $detil->nim;
$result[$no]['keanggotaan'] = $keanggotaan;
$result[$no]['judul'] = $value->judul;
$result[$no]['dospem'] = $dospem;
$result[$no]['link'] = $url;
$result[$no]['status'] = $value->status_desc;
$no++;
}
}
$datas['list_proposal'] = $result;
$datas['jenis_monev'] = 'Seleksi Belmawa';
return view('backend.operator.daftar_proposal.excel', $datas);
}
}
<?php
namespace App\Exports;
use App\Models\DaftarProposal;
use Illuminate\Support\Facades\DB;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class DaftarProposalExport implements FromView,ShouldAutoSize
{
/**
* @return \Illuminate\Support\Collection
*/
public function __construct($jenis,$status,$tahun)
{
$this->jenis= $jenis;
$this->status = $status;
$this->tahun= $tahun;
}
public function view(): View
{
ini_set('memory_limit', '-1');
$statement = " STATUS_HAPUS = '0' ";
if($this->jenis != "0")
{
$statement .= " AND jenis_id = '".$this->jenis."'";
}
if($this->status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $this->status - 1;
$statement .= " AND STATUS_FINAL = '".$status."'";
}
if($this->tahun != "0")
{
$statement .= " AND PERIODE = '".$this->tahun."'";
}
$data = DaftarProposal::with('rKelompokDetil')
->select("*")
->selectRaw(" round((ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) + ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2 )) / 2, 2) as rata ")->whereRaw($statement)->get();
$result = [];
$x =0;
$dospem = '';
foreach ($data as $key => $value) {
// $dospem = "(".str_replace("###",") ",$value->identitas_dospem);
$data_dospem = explode('###', $value->identitas_dospem);
$data_ketua = explode('###', $value->identitas_ketua);
$dospem = "(".$data_dospem[0].") ".$data_dospem[1];
$url = "https://statik.unesa.ac.id/simpkm/proposal/".$value->periode."/".$value->upload_dokumen;
if($value->status_final == '1')
$status_final = "Lolos";
elseif($value->status_final == '2')
$status_final = "Tidak Lolos";
else
$status_final = "Menunggu Persetujuan";
$urut = 1;
$det = array();
$no = 0;
foreach ($value->rKelompokDetil as $keys => $detil) {
if($detil->status_ketua == '1')
{
$keanggotaan = "Ketua";
}
else
{
$keanggotaan = "Anggota ".$urut;
$urut++;
}
$det[$no]['fak'] = $detil->fakultas;
$det[$no]['nama'] = $detil->nama;
$det[$no]['nim']= $detil->nim;
$det[$no]['keanggotaan'] = $keanggotaan;
$no++;
}
$result[$x]['rowspan'] = count($value->rKelompokDetil);
$result[$x]['kode'] = $value->kode;
$result[$x]['jenis'] = $value->jenis_pkm;
$result[$x]['detil'] = $det;
$result[$x]['judul'] = $value->judul;
$result[$x]['dospem'] = $dospem;
$result[$x]['link'] = $url;
$result[$x]['status'] = $status_final;
$result[$x]['rata'] = $value->rata;
$result[$x]['email_dospem'] = end($data_dospem);
$result[$x]['email_ketua'] = end($data_ketua);
$x++;
}
$datas['list_proposal'] = $result;
$datas['jenis_monev'] = 'Seleksi Internal';
return view('backend.operator.daftar_proposal.excel', $datas);
}
}
<?php
namespace App\Exports;
use App\Models\DaftarProposalBelmawa;
use Illuminate\Support\Facades\DB;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class DaftarProposalMonevExport implements FromView,ShouldAutoSize
{
/**
* @return \Illuminate\Support\Collection
*/
public function __construct($jenis,$status,$tahun)
{
$this->jenis= $jenis;
$this->status = $status;
$this->tahun= $tahun;
}
public function view(): View
{
$statement = " STATUS_HAPUS = '0' ";
if($this->jenis != "0")
{
$statement .= " AND jenis_id = '".$this->jenis."'";
}
if($this->status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $this->status - 1;
$statement .= " AND STATUS_FINAL = '".$status."'";
}
if($this->tahun != "0")
{
$statement .= " AND PERIODE = '".$this->tahun."'";
}
$data = DaftarProposalBelmawa::with('rKelompokDetil')->whereRaw($statement)->get();
$result = [];
$no = 0;
foreach ($data as $key => $value) {
$dospem = "(".str_replace("###",") ",$value->identitas_dospem);
$url = "https://statik.unesa.ac.id/simpkm/proposal/".$value->periode."/".$value->upload_dokumen;
$urut = 1;
foreach ($value->rKelompokDetil as $keys => $detil) {
if($detil->status_ketua == '1')
{
$keanggotaan = "Ketua";
}
else
{
$keanggotaan = "Anggota ".$urut;
$urut++;
}
$result[$no]['rowspan'] = count($value->rKelompokDetil);
$result[$no]['kode'] = $value->kode_kelompok;
$result[$no]['jenis'] = $value->jenis_pkm;
$result[$no]['fak'] = $detil->fakultas;
$result[$no]['nama'] = $detil->nama;
$result[$no]['nim'] = $detil->nim;
$result[$no]['keanggotaan'] = $keanggotaan;
$result[$no]['judul'] = $value->judul;
$result[$no]['dospem'] = $dospem;
$result[$no]['link'] = $url;
$result[$no]['status'] = $value->status_desc;
$no++;
}
}
$datas['list_proposal'] = $result;
$datas['jenis_monev'] = 'Seleksi Belmawa';
return view('backend.operator.daftar_proposal.excel', $datas);
}
}
<?php
namespace App\Exports;
use App\Models\DaftarProposal;
use Illuminate\Support\Facades\DB;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class ProposalExport implements FromView,ShouldAutoSize
{
/**
* @return \Illuminate\Support\Collection
*/
public function __construct($jenis,$status,$tahun)
{
$this->jenis= $jenis;
$this->status = $status;
$this->tahun= $tahun;
}
public function view(): View
{
$statement = " STATUS_HAPUS = '0' ";
if($this->jenis != "0")
{
$statement .= " AND jenis_id = '".$this->jenis."'";
}
if($this->status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $this->status - 1;
$statement .= " AND STATUS = '".$status."'";
}
if($this->tahun != "0")
{
$statement .= " AND PERIODE = '".$this->tahun."'";
}
$data = DaftarProposal::with('rKelompokDetil')->whereRaw($statement)->get();
$result = [];
$no = 0;
foreach ($data as $key => $value) {
$dospem = "(".str_replace("###",") ",$value->identitas_dospem);
$url = "https://statik.unesa.ac.id/simpkm/proposal/".$value->periode."/".$value->upload_dokumen;
$urut = 1;
foreach ($value->rKelompokDetil as $keys => $detil) {
if($detil->status_ketua == '1')
{
$keanggotaan = "Ketua";
}
else
{
$keanggotaan = "Anggota ".$urut;
$urut++;
}
$result[$no]['rowspan'] = count($value->rKelompokDetil);
$result[$no]['kode'] = $value->kode;
$result[$no]['jenis'] = $value->jenis_pkm;
$result[$no]['fak'] = $detil->fakultas;
$result[$no]['nama'] = $detil->nama;
$result[$no]['nim'] = $detil->nim;
$result[$no]['keanggotaan'] = $keanggotaan;
$result[$no]['judul'] = $value->judul;
$result[$no]['dospem'] = $dospem;
$result[$no]['link'] = $url;
$no++;
}
}
$datas['list_proposal'] = $result;
return view('backend.operator.proposal.excel', $datas);
}
}
<?php
if (!function_exists('tglbulanindo')) {
function tglbulanindo($waktu, $tipe = '')
{
$detik = substr($waktu, 17, 2);
$menit = substr($waktu, 14, 2);
$jam = substr($waktu, 11, 2);
$tgl = substr($waktu, 8, 2);
$bln = substr($waktu, 5, 2);
$thn = substr($waktu, 0, 4);
$bulan = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'];
$idxhari = date('N', strtotime($waktu));
switch ($tipe) {
case 1:
$full = $tgl.' '.$bulan[(int) $bln - 1].' '.$thn;
break;
case 2:
$full = $tgl.'/'.$bln.'/'.$thn;
break;
case 3:
$full = $tgl.'/'.$bln.'/'.$thn.' '.$jam.':'.$menit.':'.$detik;
break;
case 4:
$full = $tgl.' '.$bulan[(int) $bln - 1].' '.$thn.' '.$jam.':'.$menit;
break;
default:
$full = "$tgl ".$bulan[(int) $bln - 1]." $thn";
}
return $full;
}
}
<?php
namespace App\Helpers;
class InseoHelper
{
public static function tglbulanindo($waktu, $tipe = '')
{
$detik = substr($waktu, 17, 2);
$menit = substr($waktu, 14, 2);
$jam = substr($waktu, 11, 2);
$tgl = substr($waktu, 8, 2);
$bln = substr($waktu, 5, 2);
$thn = substr($waktu, 0, 4);
$bulan = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'];
$idxhari = date('N', strtotime($waktu));
switch ($tipe) {
case 1:
$full = $tgl.' '.$bulan[(int) $bln - 1].' '.$thn;
break;
case 2:
$full = $tgl.'/'.$bln.'/'.$thn;
break;
case 3:
$full = $tgl.'/'.$bln.'/'.$thn.' '.$jam.':'.$menit.':'.$detik;
break;
default:
$full = "$tgl ".$bulan[(int) $bln - 1]." $thn";
}
return $full;
}
public static function singkatan_fakultas()
{
$fak = [
'teknik' => 'FT',
'fakultas teknik' => 'FT',
'ft' => 'FT',
'fak. teknik' => 'FT',
'ilmu sosial & hukum' => 'FISH',
'fakultas ilmu sosial & hukum' => 'FISH',
'fish' => 'FISH',
'fak. ilmu sosial & hukum' => 'FISH',
'ilmu sosial dan hukum' => 'FISH',
'ilmu pendidikan' => 'FIP',
'fakultas ilmu pendidikan' => 'FIP',
'fip' => 'FIP',
'fak. ilmu pendidikan' => 'FIP',
'bahasa dan seni' => 'FBS',
'fakultas bahasa dan seni' => 'FBS',
'fbs' => 'FBS',
'fak. bahasa dan seni' => 'FBS',
'matematika dan ilmu pengetahuan alam' => 'FMIPA',
'fakultas matematika dan ilmu pengetahuan alam' => 'FMIPA',
'fmipa' => 'FMIPA',
'fak. matematika dan ilmu pengetahuan alam' => 'FMIPA',
'ilmu keolahragaan' => 'FIO',
'fakultas ilmu keolahragaan' => 'FIO',
'fio' => 'FIO',
'fak. ilmu keolahragaan' => 'FIO',
'ilmu olahraga' => 'FIO',
'fakultas ilmu olahraga' => 'FIO',
'fiK' => 'FIO',
'fak. ilmu olahraga' => 'FIO',
'ilmu keolahragaan dan kesehatan' => 'FIKK',
'ekonomi' => 'FEB',
'fakultas ekonomi' => 'FEB',
'fe' => 'FEB',
'fak. ekonomi' => 'FEB',
'ekonomika dan bisnis' => 'FEB',
'vok' => 'VOKASI',
'vokasi' => 'VOKASI',
'fakultas vokasi' => 'VOKASI',
'fak. vokasi' => 'VOKASI',
'kedokteran' => 'FK',
];
return $fak;
}
public static function random_password() {
$alphabet = '1234567890';
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return implode($pass); //turn the array into a string
}
}
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Http\Request;
class DosenController extends Controller
{
public function getDosen(Request $request)
{
$keyword = $request->q;
$getDosen = GetDataApiController::getDosen();
$total_count = 0;
$incomplete_results = true;
$items = [];
if (empty($getDosen)) {
$items = array();
} else {
$no = 0;
foreach ($getDosen['data'] as $key => $item) {
if(str_contains(strtolower($item['nm_sdm']), strtolower($keyword))){
$itemData = [
'id' => encrypt($item['id_sdm'].'_'.$item['nm_sdm'].'_'.$item['nidn']),
'full_name' => $item['nm_sdm'],
'description' => $item['prodi'],
'nidn' => $item['nidn'],
];
$items[] = $itemData;
$total_count = $total_count + 1;
}
}
}
$data = [
'total_count' => $total_count,
'incomplete_results' => false,
'items' => $items,
];
//dd($data);
return response($data, 200);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/
use ConfirmsPasswords;
/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\Models\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\Models\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}
<?php
namespace App\Http\Controllers\Authentication;
use App\Http\Controllers\Controller;
use App\Repositories\Auth\BiodataRepository;
use App\Repositories\Auth\EmailRepository;
use App\Repositories\Auth\IsdmRepository;
use App\Repositories\Auth\RoleRepository;
use App\Repositories\Auth\SsoRepository;
use App\Repositories\Auth\UserRepository;
use App\Repositories\UserdetailRepository;
use Auth;
use Illuminate\Support\Str;
class LoginController extends Controller
{
private $ssoRepo;
private $userRepo;
private $roleRepo;
private $biodataRepo;
private $emailRepo;
private $isdmRepo;
private $userDetailRepo;
public function __construct(
SsoRepository $ssoRepo,
UserRepository $userRepo,
RoleRepository $roleRepo,
BiodataRepository $biodataRepo,
EmailRepository $emailRepo,
IsdmRepository $isdmRepo,
UserdetailRepository $userDetailRepo
) {
$this->middleware('guest');
$this->ssoRepo = $ssoRepo;
$this->userRepo = $userRepo;
$this->roleRepo = $roleRepo;
$this->biodataRepo = $biodataRepo;
$this->emailRepo = $emailRepo;
$this->isdmRepo = $isdmRepo;
$this->userDetailRepo = $userDetailRepo;
}
public function sso($email, $session_id)
{
$auth = $this->ssoRepo->sso($session_id);
if (!is_array($auth)) {
return redirect('https://sso.unesa.ac.id/user');
}
$user = $this->userRepo->find(null, null, $auth[0]->email);
if ($user) {
return $this->getlogin($user->id);
} else {
return $this->getadduser($auth);
}
}
private function getlogin($id)
{
Auth::loginUsingId($id);
return redirect()->intended('dashboard');
}
private function getAdduser($auth)
{
$id = (string) Str::uuid();
$biodata = $this->biodataRepo->biodata($auth);
$user = $this->userRepo->storeSso($id, $biodata);
$roles = $this->roleRepo->roles($biodata['role']);
$this->userDetailRepo->storeSso($user->id, $biodata);
$this->roleRepo->store($user, $roles);
Auth::loginUsingId($id);
return redirect()->intended('dashboard');
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
<?php
namespace App\Http\Controllers;
use App\Models\Pengumuman;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$title = 'Dashboard PKM';
// $pengumuman = $pengumuman = Pengumuman::query()->first();
$data = [
'title' => $title,
'pengumuman' => null,
];
return view('backend.index', $data);
}
}
<?php
namespace App\Http\Controllers\Dosen;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Crypt;
use Alert;
use Auth;
use App\Models\Auth\Biodata;
class BiodataController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$title = 'Biodata Dosen';
$biodata = Biodata::query()->find(Auth::user()->id);
$data = [
'biodata' => $biodata,
'title' => $title,
];
return view('backend.dosen.biodata.index', $data);
}
public function update($nidn)
{
$nidn = Crypt::decrypt($nidn);
$biodata = $this->biodataRepo->find(null, null, null, $nidn);
$isdm = $this->isdmRepo->nidn($nidn);
$data = [
'biodata' => $biodata,
'isdm' => $isdm,
];
return view('dosen.syncIsdm.index', $data);
}
public function sync(Request $request)
{
$nidn = Crypt::decrypt($request->input('nidn'));
$biodata = $this->biodataRepo->find(null, null, null, $nidn);
$isdm = $this->isdmRepo->nidn($nidn);
$this->biodataRepo->sync($isdm, $biodata);
Alert::success('Biodata disesuaikan dengan ISDM');
return redirect()->route('dosen.biodatasync.index', ['nidn' => Crypt::encrypt($nidn)]);
}
}
<?php
namespace App\Http\Controllers\Dosen;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\GetDataApiController;
use App\Models\Kelompok;
use App\Models\KelompokDetail;
use App\Models\Periode;
use Session;
use Alert;
class KelompokController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
//
$title = 'Daftar Kelompok';
$bio = auth()->user()->rBiodata;
$getDosen = GetDataApiController::getDosen();
// $periode = Periode::where('status', 1)->first();
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$kelompok = Kelompok::with(['rAnggota'])
->where('nidn_dosen', $bio->noidentitas)
->where('kirim', '1')
->whereYear('created_at', $year)
->orderBy('kode')
->get();
$cekKel = $kelompok->where('created_user', auth()->user()->id)->count();
$data = [
'kelompok' => $kelompok,
'title' => $title,
'cekKel' => $cekKel,
'dosen' => $getDosen['data'],
'periode' => $periode,
'year' => $year,
];
return view('backend.dosen.kelompok.index', $data);
}
public function tolak(Request $request)
{
$kel = $request->except('_token');
$kelompok = Kelompok::query()->find(decrypt($kel['id']));
$kelompok->status = 2;
$kelompok->save();
Alert::success('Berhasil disimpan');
return redirect()->route('dosen.kelompok.index');
}
public function terima(Request $request)
{
$kel = $request->except('_token');
$kelompok = Kelompok::query()->find(decrypt($kel['id']));
$kelompok->status = 1;
$kelompok->save();
Alert::success('Berhasil disimpan');
return redirect()->route('dosen.kelompok.index');
}
public function lihat(Request $request)
{
$kelompok_detil = KelompokDetail::where('kelompok_id', $request->kelompok_id)->get();
$data = '';
$no = 1;
$anggota= 0;
foreach ($kelompok_detil as $key => $value) {
if($value->status_ketua == 1)
$keterangan = "Ketua";
else
{
$anggota++;
$keterangan = "Anggota ".$anggota?:1;
}
$data .= "
<tr>
<td>".$no."</td>
<td>".$value->nama."</td>
<td>".$value->nim."</td>
<td>".$value->fakultas."</td>
<td>".$value->prodi."</td>
<td>".$keterangan."</td>
</tr>
";
$no++;
}
$response['html'] = $data;
echo json_encode($response);
}
}
<?php
namespace App\Http\Controllers\Dosen;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Periode;
use App\Models\MonevInternal;
use App\Models\JadwalKegiatan;
use Session;
use Alert;
use Auth;
class MonevController extends Controller
{
public function monev($id, Request $request)
{
$bio = auth()->user()->rBiodata;
$nidn = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$jadwal = JadwalKegiatan::where('periode_id', $periode->where('status', 1)->first()->periode_id)
->where('nama','Monev Internal '.$id)->first();
$title = 'Monev Internal '.$id;
$proposal = MonevInternal::with(['rProposal', 'rJenisMonev'])
->whereHas('rProposal', function ($query) use($nidn){
$query->whereHas('rKelompok', function ($query) use($nidn){
$query->where('nidn_dosen', $nidn);
});
})
->whereHas('rJenisMonev', function ($query) use($id){
$query->where('nama', 'Monev Internal '.$id);
})
->whereYear('created_at', $year)
->orderBy('created_at')
->get();
// dd($proposal);
$data = [
'proposal' => $proposal,
'title' => $title,
'jadwal' => $jadwal,
'periode' => $periode,
'idmonev' => $id,
'year' => $year,
];
return view('backend.dosen.monev.indexmonev'.$id, $data);
}
}
<?php
namespace App\Http\Controllers\Dosen;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;
use Session;
use Alert;
use Auth;
class ProposalController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
//
$title = 'Daftar Proposal';
$bio = auth()->user()->rBiodata;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis', 'rDaftarPro'])
->whereHas('rKelompok', function ($query) use($bio){
$query->where('nidn_dosen', $bio->noidentitas);
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.dosen.proposal.index', $data);
}
public function setuju(Request $request)
{
$proId = $request->except('_token');
$proposal = Proposal::query()->find(decrypt($proId['id']));
$proposal->status = 1;
$proposal->date_approval = now();
$proposal->save();
Alert::success('Berhasil disimpan');
return redirect()->route('dosen.proposal.index');
}
public function lihat(Request $request)
{
$item = Proposal::where('proposal_id', $request->proposal_id)->first();
$data = '';
$no = 1;
if($item->upload_dokumen){
$dokumen = ' <a href="https://statik.unesa.ac.id/simpkm/proposal/'. $item->rPeriode->nama .'/'. $item->upload_dokumen.'" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a>
<iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/'. $item->rPeriode->nama .'/'.$item->upload_dokumen .'" frameborder="0"></iframe>';
}else{
$dokumen = '<div class="alert alert-danger alert-dismissible fade show mb-0" role="alert">
<strong>Informasi!</strong><br/> File tidak ditemukan.
</div>';
}
if(is_null($item->status) OR $item->status == '0'){
$status = '<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>';
}else{
$status = '<span class="badge bg-success">Sudah Disetujui Dosen</span>';
}
$data .= "
<tr>
<td>Judul Proposal</td>
<td>".$item->judul."</td>
</tr>
<tr>
<td>Jenis PKM</td>
<td>".$item->rJenis->nama."</td>
</tr>
<tr>
<td>Status</td>
<td>".$status."</td>
</tr>
<tr>
<td>Proposal</td>
<td>".$dokumen."</td>
</tr>
";
$response['html'] = $data;
echo json_encode($response);
}
public function approve($id)
{
$proposal = Proposal::query()->find(decrypt($id));
return response()->json([
'data' => $proposal
]);
}
public function tolak(Request $request)
{
$proId = $request->except('_token');
$proposal = Proposal::query()->find($proId['proposal_id']);
$proposal->status = 2;
$proposal->alasan_revisi = $proId['alasan_revisi'];
$proposal->save();
Alert::success('Berhasil ditolak');
return redirect()->route('dosen.proposal.index');
}
}
<?php
namespace App\Http\Controllers\Dosen;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;
use Session;
use Alert;
use App\Models\DaftarProposal;
use Auth;
use DB;
class SeleksiController extends Controller
{
public function seleksiInternal(Request $request)
{
//
$title = 'Seleksi Internal Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis', 'rDaftarPro'])
->whereHas('rKelompok', function ($query) use($bio){
$query->where('nidn_dosen', $bio->noidentitas);
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.dosen.seleksi.index_internal', $data);
}
public function seleksiBelmawa(Request $request)
{
//
$title = 'Seleksi Belmawa Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis'])
->whereHas('rKelompok', function ($query) use($bio){
$query->where('nidn_dosen', $bio->noidentitas);
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.dosen.seleksi.index_belmawa', $data);
}
public function lihatInternal(Request $request)
{
$item = DaftarProposal::where('proposal_id', $request->proposal_id)->first();
$nilai_1= DB::select("select ambil_jumlah_penilaian_seleksi('".$item->reviewer_proposal_id_1."', '".$item->jenis_id."')")[0]->ambil_jumlah_penilaian_seleksi;
$nilai_2= DB::select("select ambil_jumlah_penilaian_seleksi('".$item->reviewer_proposal_id_2."', '".$item->jenis_id."')")[0]->ambil_jumlah_penilaian_seleksi;
$rata = number_format((float) (($nilai_1 + $nilai_2) / 2), 0, '.', '');
$data = '';;
if($item->upload_dokumen){
$dokumen = ' <a href="https://statik.unesa.ac.id/simpkm/proposal/'. $item->periode .'/'. $item->upload_dokumen.'" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a>
<iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/'. $item->periode .'/'.$item->upload_dokumen .'" frameborder="0"></iframe>';
}else{
$dokumen = '<div class="alert alert-danger alert-dismissible fade show mb-0" role="alert">
<strong>Informasi!</strong><br/> File tidak ditemukan.
</div>';
}
if(is_null($item->status)){
$status = '<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>';
}else{
$status = '<span class="badge bg-success">Sudah Disetujui Dosen</span>';
}
$data .= "
<tr>
<td>Judul Proposal</td>
<td>".$item->judul."</td>
</tr>
<tr>
<td>Jenis PKM</td>
<td>".$item->jenis_pkm."</td>
</tr>
<tr>
<td>Status</td>
<td>".$status."</td>
</tr>
<tr>
<td>Proposal</td>
<td>".$dokumen."</td>
</tr>
<tr>
<td>Komentar</td>
<td>
<h4 class='card-title mb-4'>Nilai Total </h4>
<p class='text-muted mb-3 pb-4'>". $rata ."</p>
<h4 class='card-title mb-4'>Reviewer 1 </h4>
<p class='text-muted mb-3 pb-4'>".$item->reviewer_komentar_1."</p>
<h4 class='card-title mb-4'>Reviewer 2 </h4>
<p class='text-muted mb-3 pb-4'>".$item->reviewer_komentar_2."</p>
</td>
</tr>
";
$response['html'] = $data;
echo json_encode($response);
}
}
<?php
namespace App\Http\Controllers;
use Exception;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
class GetDataApiController extends Controller
{
const URL = 'https://siakadu.unesa.ac.id/api/apiunggun';
const URLS = 'https://siakadu.unesa.ac.id/api/dashboard';
//
public static function getDosen()
{
$client = new Client();
$apiRequest = $client->request('POST', GetDataApiController::URLS, [
'form_params' =>
[
'kondisi' => 'dosen_aktif',
]
]);
return json_decode($apiRequest->getBody()->getContents(), true);
}
public static function getAccount($nim)
{
$client = new Client();
$apiRequest = $client->request('POST', GetDataApiController::URL, [
'form_params' =>
[
'username' => $nim,
'kondisi' => 'cekhakakses'
]
]);
$gcon = utf8_encode($apiRequest->getBody()->getContents());
$data = unserialize($gcon);
return $data;
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home');
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use App\Models\Kelompok;
use App\Models\KelompokDetail;
use Session;
use Alert;
use App\Helpers\InseoHelper;
class AnggotaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
$title = 'Tambah Kelompok Mahasiswa';
$kode = null;
// $getMhs = GetDataApiController::getAccount(19021264056);
// dd($getMhs);
$data = [
'title' => $title,
'kode' => $kode
];
return view('backend.mahasiswa.kelompok.personil.create', $data);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$kelompok = $request->except('_token');
$kelompok['fakultas'] = InseoHelper::singkatan_fakultas()[strtolower($kelompok['fakultas'])];
$cek = KelompokDetail::where('kelompok_id', $kelompok['kelompok_id'])->where('nim', $kelompok['nim'])->count();
if ($cek > 0) {
Alert::warning('Mahasiswa sudah terdaftar', '-')->persistent('Ok');
return redirect()->route('mahasiswa.kelompok.createnew', ['id' => encrypt($kelompok['kelompok_id'])]);
}
if ($cek > 5) {
Alert::warning('Anggota kelompok sudah maksimal', '-');
return redirect()->route('mahasiswa.kelompok.createnew', ['id' => encrypt($kelompok['kelompok_id'])]);
}
KelompokDetail::create($kelompok);
Alert::success('Berhasil disimpan');
return redirect()->route('mahasiswa.kelompok.createnew', ['id' => encrypt($kelompok['kelompok_id'])]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Crypt;
use Alert;
use Auth;
use App\Models\Auth\Biodata;
class BiodataController extends Controller
{
public function index()
{
$title = 'Biodata Mahasiswa';
$biodata = Biodata::query()->find(Auth::user()->id);
$data = [
'biodata' => $biodata,
'title' => $title,
];
return view('backend.mahasiswa.biodata.index', $data);
}
public function update($nidn)
{
$nidn = Crypt::decrypt($nidn);
$biodata = $this->biodataRepo->find(null, null, null, $nidn);
$isdm = $this->isdmRepo->nidn($nidn);
$data = [
'biodata' => $biodata,
'isdm' => $isdm,
];
return view('mahasiswa.syncIsdm.index', $data);
}
public function sync(Request $request)
{
$nidn = Crypt::decrypt($request->input('nidn'));
$biodata = $this->biodataRepo->find(null, null, null, $nidn);
$isdm = $this->isdmRepo->nidn($nidn);
$this->biodataRepo->sync($isdm, $biodata);
Alert::success('Biodata disesuaikan dengan ISDM');
return redirect()->route('mahasiswa.biodatasync.index', ['nidn' => Crypt::encrypt($nidn)]);
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\GetDataApiController;
use App\Models\Kelompok;
use App\Models\KelompokDetail;
use App\Models\Periode;
use Session;
use Alert;
class KelompokController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
//
$title = 'Kelompok Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$getDosen = GetDataApiController::getDosen();
$periode = Periode::query()->get();
$periode_aktif = Periode::where('status', 1)->first();
$year = !is_null($request->year) ? $request->year : now()->year;
$kelompok = Kelompok::with(['rAnggota'])
->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
})
->whereYear('created_at', $year)
->orderBy('kode')
->get();
$cekKel = $kelompok->where('created_user', auth()->user()->id)->where('periode_id', $periode_aktif->periode_id)->whereIn('status', [0,1])->count();
// $getMhs = GetDataApiController::getAccount(20030244001);
// dd($getMhs);
$data = [
'kelompok' => $kelompok,
'title' => $title,
'cekKel' => $cekKel,
'dosen' => $getDosen['data'],
'periode' => $periode,
'year' => $year,
];
return view('backend.mahasiswa.kelompok.index', $data);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
$title = 'Kelompok Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$getDosen = GetDataApiController::getDosen();
$periode = Periode::query()->where('status', 1)->first();
$data = [
'title' => $title,
'dosen' => $getDosen['data'],
'periode' => $periode,
];
return view('backend.mahasiswa.kelompok.create', $data);
}
public function newkelompok($id)
{
//
$kelompok_id = decrypt($id);
Session::put('ss_kelompokid', $kelompok_id);
$title = 'Tambah Kelompok Mahasiswa';
$kelompok = Kelompok::with('rAnggota')->where('kelompok_id', $kelompok_id)->first();
$periode = Periode::where('status', 1)->first();
$getDosen = GetDataApiController::getDosen();
$data = [
'kelompok' => $kelompok,
'title' => $title,
'dosen' => $getDosen['data'],
];
return view('backend.mahasiswa.kelompok.createkel', $data);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$kelompok = $request->except('_token');
$dosen = explode('_', decrypt($kelompok['dosen']));
$dosen_idsdm = $dosen[0];
$dosen_nama = $dosen[1];
$dosen_nidn = $dosen[2];
$bio = auth()->user()->rBiodata;
$kel = Kelompok::create([
'periode_id' => $kelompok['periode'],
'id_sdm' => $dosen_idsdm,
'nama_dosen' => $dosen_nama,
'nidn_dosen' => $dosen_nidn,
'created_user' => Auth::user()->id
]);
KelompokDetail::create([
'kelompok_id' => $kel->kelompok_id,
'id_reg_pd' => $bio->user_id,
'nim' => $bio->noidentitas,
'nama' => $bio->name,
'fakultas' => $bio->fakultas,
'prodi' => $bio->prodi,
'status_ketua' => '1',
'created_user' => Auth::user()->id
]);
return redirect()->intended(route('mahasiswa.kelompok.createnew', ['id' => encrypt($kel->kelompok_id)]))->with('success', 'Berhasil membuat Kelompok!');
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
public function kirim(Request $request)
{
//
$kel = $request->except('_token');
$kelompok = Kelompok::query()->find($kel['kelompok_id']);
$kelompok->kirim = 1;
$kelompok->save();
Alert::success('Berhasil disimpan');
return redirect()->route('mahasiswa.kelompok.index');
}
public function hapus(Request $request)
{
$kel = $request->except('_token');
$kelompok = Kelompok::query()->find(decrypt($kel['id']));
$kelompok->rAnggota()->delete();
$kelompok->delete();
Alert::success('Berhasil dihapus');
return redirect()->route('mahasiswa.kelompok.index');
}
// public function cetak_kelompok(Request $request)
// {
// $fakultas = $request->fakultas;
// $prodi = $request->prodi;
// $lulusan = $request->lulusan;
// $group = $request->group;
// if(isset($this->rUserDetil->fakultas_id))
// {
// $fakultas = $this->rUserDetil->fakultas_id;
// }
// if(isset($this->rUserDetil->prodi_id))
// {
// $prodi = $this->rUserDetil->prodi_id;
// }
// return Excel::download(new UsersExport($fakultas, $prodi, $lulusan, $group), 'users_export.xlsx');
// }
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\ProposalLuaran;
use Session;
use Alert;
use Auth;
class LuaranController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$luaran = $request->except('_token');
$proposal = Proposal::with(['rPeriode'])->find($luaran['proposal_id']);
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'_'.$luaran['jenis_luaran'].'.'.$luaran['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/luaran/'.$luaran['jenis_luaran'].'/'.$file_nama, file_get_contents($luaran['file']->getRealPath()));
ProposalLuaran::create([
'proposal_id' => $luaran['proposal_id'],
'judul' => $luaran['judul'],
'jenis_luaran' => $luaran['jenis_luaran'],
'keterangan_luaran' => $luaran['keterangan_luaran'],
'file_luaran' => $file_nama,
'created_user' => Auth::user()->id
]);
return redirect()->route('mahasiswa.luaran.show', encrypt($luaran['proposal_id']))->with('success', 'Proposal Berhasil ditambahkan');
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
$title = 'Proposal Luaran Mahasiswa';
$proposal = Proposal::with(['rluaran', 'rPeriode'])->find(decrypt($id));
$data = [
'proposal' => $proposal,
'title' => $title
];
return view('backend.mahasiswa.luaran.index', $data);
}
public function hapus(Request $request)
{
$pro = $request->except('_token');
$proposal = Proposal::query()->find(decrypt($pro['id']));
Storage::disk('static')->delete('simpkm/luaran/'.$proposal->jenis_luaran.'/'.$proposal->file_luaran);
$proposal->delete();
Alert::success('Berhasil dihapus');
return redirect()->route('mahasiswa.luaran.index');
}
public function dosen($id)
{
//
$title = 'Proposal Luaran Mahasiswa';
$proposal = Proposal::with(['rluaran', 'rPeriode'])->find(decrypt($id));
$data = [
'proposal' => $proposal,
'title' => $title
];
return view('backend.dosen.luaran.index', $data);
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\MonevInternal;
use App\Models\JadwalKegiatan;
use Session;
use Alert;
use Auth;
class MonevController extends Controller
{
public function monev($id, Request $request)
{
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$jadwal = JadwalKegiatan::where('periode_id', $periode->where('status', 1)->first()->periode_id)
->where('nama','Monev Internal '.$id)->first();
$title = 'Monev Internal '.$id;
$proposal = MonevInternal::with(['rProposal', 'rJenisMonev'])
->whereHas('rProposal', function ($query) use($nim){
$query->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
});
});
})
->whereHas('rJenisMonev', function ($query) use($id){
$query->where('nama', 'Monev Internal '.$id);
})
->whereYear('created_at', $year)
->orderBy('created_at')
->get();
// dd($proposal);
$data = [
'proposal' => $proposal,
'title' => $title,
'jadwal' => $jadwal,
'periode' => $periode,
'idmonev' => $id,
'year' => $year,
];
return view('backend.mahasiswa.monev.indexmonev'.$id, $data);
}
public function revisiMonevEd($id)
{
//
$id = explode('__', decrypt($id));
$proposal = Proposal::with(['rJenis'])->find($id[0]);
if($id[1] == 'logbook'){ $title = 'Upload Logbook'; }
elseif($id[1] == 'kemajuan'){ $title = 'Upload Laporan Kemajuan';}
elseif($id[1] == 'akhir'){ $title = 'Upload Laporan Akhir'; }
else{$title = 'Upload Revisi Proposal Monev I';}
$data = [
'proposal' => $proposal,
'title' => $title,
'type' => $id[1],
'monev' => $id[2],
];
return view('backend.mahasiswa.monev.upload_monev', $data);
}
public function revisiMonev($id)
{
//
$id = explode('__', decrypt($id));
$proposal = MonevInternal::with(['rProposal'])->find($id[0]);
if($id[1] == 'logbook'){ $title = 'Upload Logbook'; }
elseif($id[1] == 'kemajuan'){ $title = 'Upload Laporan Kemajuan';}
elseif($id[1] == 'akhir'){ $title = 'Upload Laporan Akhir'; }
else{$title = 'Upload Revisi Proposal Monev I';}
$data = [
'proposal' => $proposal,
'title' => $title,
'type' => $id[1],
'monev' => $id[2],
];
return view('backend.mahasiswa.monev.upload_monev', $data);
}
public function uploadMonev(Request $request)
{
//
$pro = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$proposal = MonevInternal::with(['rProposal'])->find($pro['monev_id']);
$file_nama = $proposal->rProposal->rPeriode->nama.'_'.$proposal->rProposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/monev/'.$pro['monev'].'/'.$pro['type'].'/'.$file_nama, file_get_contents($pro['file']->getRealPath()));
if($pro['type'] == 'logbook'){
$proposal->logbook_file = $file_nama;
$proposal->logbook_date = now();
}elseif($pro['type'] == 'kemajuan'){
$proposal->kemajuan_file = $file_nama;
$proposal->kemajuan_date = now();
}elseif($pro['type'] == 'akhir'){
$proposal->akhir_file = $file_nama;
$proposal->akhir_date = now();
}elseif($pro['type'] == 'proposal'){
$proposal->upload_dokumen = $file_nama;
$proposal->date_upload = now();
}
$proposal->save();
return redirect()->route('mahasiswa.monev-index', $pro['monev'])->with('success', 'Proposal Berhasil revisi');
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use App\Models\JadwalKegiatan;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;
use Carbon\Carbon;
use Session;
use Alert;
use Auth;
class ProposalController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
//
$title = 'Proposal Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis'])
->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
});
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.mahasiswa.proposal.index', $data);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
$title = 'Upload Proposal Mahasiswa';
$periode = Periode::where('status', 1)->first();
$getDosen = GetDataApiController::getDosen();
$jenis = Jenis::pluck('nama','jenis_id');
$bio = auth()->user()->rBiodata;
$proposal = null;
$kelompok = Kelompok::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id)
->where('status', '1')
->first();
$cekproposal = Proposal::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id)
->first();
$jadwal = JadwalKegiatan::where('periode_id', $periode->where('status', 1)->first()->periode_id)
->where('nama','Upload Proposal Seleksi Internal')->first();
if(($jadwal->tanggal_mulai <= Carbon::now()) && ($jadwal->tanggal_selesai <= Carbon::now())){
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Batas Pengajuan telah berakhir!');
}
if($cekproposal) {
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Sudah ada Proposal yang di ajukan!');
}
if(is_null($kelompok)){
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Belum ada kelompok!');
}
$data = [
'title' => $title,
'dosen' => $getDosen['data'],
'periode' => $periode,
'jenis' => $jenis,
'kelompok' => $kelompok,
'proposal' => $proposal,
'jadwal' => $jadwal
];
return view('backend.mahasiswa.proposal.create', $data);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$proposal = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$periode = Periode::where('status', 1)->first();
$uuid = Str::uuid();
$file_nama = $periode->nama.'_'.$uuid.'.'.$proposal['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/proposal/'.$periode->nama.'/'.$file_nama, file_get_contents($proposal['file']->getRealPath()));
$kel = Proposal::create([
'proposal_id' => $uuid,
'kelompok_id' => $proposal['kode_kelompok'],
'jenis_id' => $proposal['jenis'],
'periode_id' => $proposal['periode_id'],
'judul' => $proposal['judul'],
'status' => '0',
'upload_dokumen' => $file_nama,
'date_upload' => now(),
'created_user' => Auth::user()->id
]);
return redirect()->route('mahasiswa.proposal.index')->with('success', 'Proposal Berhasil ditambahkan');
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
$title = 'Edit Upload Proposal Mahasiswa';
$periode = Periode::where('status', 1)->first();
$getDosen = GetDataApiController::getDosen();
$jenis = Jenis::pluck('nama','jenis_id');
$proposal = Proposal::with(['rKelompok', 'rJenis'])->find(decrypt($id));
$data = [
'title' => $title,
'dosen' => $getDosen['data'],
'periode' => $periode,
'jenis' => $jenis,
'proposal' => $proposal
];
return view('backend.mahasiswa.proposal.create', $data);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
$proposal = $request->except('_token');
// dd($proposal);
$this->validate($request,
[
'file' => 'mimes:pdf|max:5000'
], [
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$pro = Proposal::with(['rPeriode'])->find($id);
if(!isset($proposal['file'])){
$file_nama = $pro->upload_dokumen;
} else {
// Storage::disk('static')->delete('simpkm/proposal/'.$pro->rPeriode->nama.'/'.$pro->upload_dokumen);
$file_nama = $pro->rPeriode->nama.'_'.$pro->proposal_id.'.'.$proposal['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/proposal/'.$pro->rPeriode->nama.'/'.$file_nama, file_get_contents($proposal['file']->getRealPath()));
}
$pro->jenis_id = $proposal['jenis'];
$pro->judul = $proposal['judul'];
$pro->upload_dokumen = $file_nama;
$pro->date_upload = now();
$pro->updated_at = now();
$pro->updated_user = Auth::user()->id;
$pro->save();
return redirect()->route('mahasiswa.proposal.index')->with('success', 'Proposal Berhasil di revisi');
}
public function hapus(Request $request)
{
$pro = $request->except('_token');
$proposal = Proposal::query()->find(decrypt($pro['id']));
Storage::disk('static')->delete('simpkm/proposal/'.$proposal->rPeriode->nama.'/'.$proposal->upload_dokumen);
$proposal->delete();
Alert::success('Berhasil dihapus');
return redirect()->route('mahasiswa.proposal.index');
}
}
<?php
namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;
use Session;
use Alert;
use App\Models\DaftarProposal;
use App\Models\SeleksiBelmawa;
use Auth;
use DB;
class SeleksiController extends Controller
{
public function seleksiInternal(Request $request)
{
//
$title = 'Seleksi Internal Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis', 'rNilai', 'rDaftarPro'])
->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
});
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
// dd($proposal);
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.mahasiswa.seleksi.index_internal', $data);
}
public function internalRevisi()
{
//
$title = 'Tambah Proposal Mahasiswa';
$periode = Periode::where('status', 1)->first();
$getDosen = GetDataApiController::getDosen();
$jenis = Jenis::pluck('nama','jenis_id');
$bio = auth()->user()->rBiodata;
$kelompok = Kelompok::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id)
->where('status', '1')
->first();
if(is_null($kelompok)){
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Belum ada kelompok!');
}
$data = [
'title' => $title,
'dosen' => $getDosen['data'],
'periode' => $periode,
'jenis' => $jenis,
'kelompok' => $kelompok
];
return view('backend.mahasiswa.seleksi.internal_revisi', $data);
}
public function seleksiBelmawa(Request $request)
{
//
$title = 'Seleksi Belmawa Mahasiswa';
$bio = auth()->user()->rBiodata;
$nim = $bio->noidentitas;
$periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis', 'rNilai', 'rReviewProposal', 'rBelmawa'])
->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
});
})
->whereYear('created_at', $year)
->orderBy('kelompok_id')
->get();
$data = [
'proposal' => $proposal,
'title' => $title,
'periode' => $periode,
'year' => $year,
];
return view('backend.mahasiswa.seleksi.index_belmawa', $data);
}
public function editBelmawa($id)
{
//
$title = 'Edit Proposal Belmawa';
$proposal = Proposal::with(['rJenis', 'rNilai'])->find($id);
$data = [
'proposal' => $proposal,
'title' => $title,
];
return view('backend.mahasiswa.seleksi.revisi_belmawa', $data);
}
public function uploadBelmawa(Request $request)
{
//
$pro = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$proposal = Proposal::with(['rPeriode'])->find($pro['proposal_id']);
$belmawa = SeleksiBelmawa::where('proposal_id', $pro['proposal_id'])->first();
$file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/proposal/revisi/'.$proposal->rPeriode->nama.'/'.$file_nama, file_get_contents($pro['file']->getRealPath()));
$belmawa->upload_dokumen = $file_nama ;
$belmawa->date_upload = now();
$belmawa->save();
return redirect()->route('mahasiswa.seleksi-belmawa')->with('success', 'Proposal Berhasil revisi');
}
public function lihatInternal(Request $request)
{
$item = DaftarProposal::where('proposal_id', $request->proposal_id)->first();
$nilai_1= DB::select("select ambil_jumlah_penilaian_seleksi('".$item->reviewer_proposal_id_1."', '".$item->jenis_id."')")[0]->ambil_jumlah_penilaian_seleksi;
$nilai_2= DB::select("select ambil_jumlah_penilaian_seleksi('".$item->reviewer_proposal_id_2."', '".$item->jenis_id."')")[0]->ambil_jumlah_penilaian_seleksi;
$rata = number_format((float) (($nilai_1 + $nilai_2) / 2), 0, '.', '');
$data = '';
$no = 1;
if($item->upload_dokumen){
$dokumen = ' <a href="https://statik.unesa.ac.id/simpkm/proposal/'. $item->periode .'/'. $item->upload_dokumen.'" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a>
<iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/'. $item->periode .'/'.$item->upload_dokumen .'" frameborder="0"></iframe>';
}else{
$dokumen = '<div class="alert alert-danger alert-dismissible fade show mb-0" role="alert">
<strong>Informasi!</strong><br/> File tidak ditemukan.
</div>';
}
if(is_null($item->status)){
$status = '<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>';
}else{
$status = '<span class="badge bg-success">Sudah Disetujui Dosen</span>';
}
$data .= "
<tr>
<td>Judul Proposal</td>
<td>".$item->judul."</td>
</tr>
<tr>
<td>Jenis PKM</td>
<td>".$item->jenis_pkm."</td>
</tr>
<tr>
<td>Status</td>
<td>".$status."</td>
</tr>
<tr>
<td>Proposal</td>
<td>".$dokumen."</td>
</tr>
<tr>
<td>Komentar</td>
<td>
<h4 class='card-title mb-4'>Nilai Total </h4>
<p class='text-muted mb-3 pb-4'>". $rata ."</p>
<h4 class='card-title mb-4'>Reviewer 1 </h4>
<p class='text-muted mb-3 pb-4'>".$item->reviewer_komentar_1."</p>
<h4 class='card-title mb-4'>Reviewer 2 </h4>
<p class='text-muted mb-3 pb-4'>".$item->reviewer_komentar_2."</p>
</td>
</tr>
";
$response['html'] = $data;
echo json_encode($response);
}
}
<?php
namespace App\Http\Controllers\Operator;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\User;
use App\Models\Auth\Biodata;
use DB;
class CheckController extends Controller
{
public function email(Request $request)
{
$email = strtolower($request->input('value'));
$temp = strtolower($request->input('temp'));
if($email == $temp)
{
echo '0';
exit;
}
$cek = User::select('id')->Where(DB::raw('lower(email)'), $email)->count();
if($cek > 0)
echo '1';
else
echo '0';
}
public function nidn(Request $request)
{
$nidn = $request->input('value');
$temp = $request->input('temp');
if($nidn == $temp)
{
echo '0';
exit;
}
$cek = Biodata::join('users', 'users.id', '=', 'biodata.id')
->select('id')
->Where('noidentitas', $nidn)
->count();
if($cek > 0)
echo '2';
else
echo '0';
}
// public function kecamatan($kota)
// {
// $modelKecamatan = new Kecamatan;
// $kecamatan = new KecamatanRepository($modelKecamatan);
// return $kecamatan->kecamatan($kota);
// }
// public function smu($kecamatan)
// {
// $modelSmu = new KodeSmu;
// $smu = new SmuRepository($modelSmu);
// return $smu->smu($kecamatan);
// }
// public function kelompokJalur($jalur){
// $modelProdiJalur = new Kelompok;
// $modelPendaftar = new Pendaftar;
// $prodiJalur = new KelompokRepository($modelProdiJalur, $modelPendaftar);
// return $prodiJalur->kelompok('ajax', $jalur);
// //dd($prodiJalur->prodiJalurx($kelompok, $jalur));
// }
// public function prodiJalur($kelompok, $jalur){
// $modelProdiJalur = new ProdiJalur;
// $prodiJalur = new ProdiJalurRepository($modelProdiJalur);
// return $prodiJalur->prodiJalurx($kelompok, $jalur);
// //dd($prodiJalur->prodiJalurx($kelompok, $jalur));
// }
// public function spi($prodi)
// {
// $modelSpi = new Spi;
// $spi = new SpiRepository($modelSpi);
// return $spi->spi($prodi);
// }
public function prodi(Request $request)
{
$value = $request->get('value');
if($value != '')
{
$data = DB::table('prodi')->where('fakultas_id', $value)->select('id', 'nama')->get();
$output = '<option value="">- Pilih Data -</option>';
foreach($data as $row)
{
$output .= '<option value="'.$row->id.'">'.$row->nama.'</option>';
}
}
else
{
$output = '';
}
echo $output;
}
// public function prodiunesa($fakultas)
// {
// $modelProdiunesa = new ProdiUnesas;
// $prodiunesa = new ProdiUnesaRepository($modelProdiunesa);
// return $prodiunesa->prodiunesa($fakultas);
// }
}
<?php
namespace App\Http\Controllers\Operator;
use App\Http\Controllers\Controller;
use DB;
use URL;
use Auth;
use Uuid;
use Alert;
use Crypt;
use Carbon\Carbon;
use Illuminate\Http\Request;
use App\Models\JadwalKegiatan;
class JadwalKegiatanController extends Controller
{
public function index()
{
$data_periode = DB::table('periode')->select('periode_id', 'nama', 'keterangan')->where('status', '1')->first();
session(['periode_id' => $data_periode->periode_id]);
$periode_id = session('periode_id');
$data['jadwal_kegiatan'] = JadwalKegiatan::where('status_hapus', '0')->where('periode_id', $periode_id)->orderBy('urut')->get();
return view('backend.operator.jadwal_kegiatan.index', compact('data'))->withTitle('Jadwal Kegiatan');
}
/* AJAX request */
public function getData(Request $request){
}
public function create()
{
}
public function store(Request $request)
{
foreach ($request->tanggal as $key => $value) {
if(!empty($value))
{
$tanggal = explode(" - ", $value);
$tanggal_mulai = $tanggal[0];
$tanggal_selesai = $tanggal[1];
JadwalKegiatan::where('jadwal_kegiatan_id', $key)->update(['tanggal_mulai'=>Carbon::createFromFormat('d-m-Y H:i', $tanggal_mulai)->format('Y-m-d H:i'), 'tanggal_selesai'=>Carbon::createFromFormat('d-m-Y H:i', $tanggal_selesai)->format('Y-m-d H:i')]);
}
}
Alert::success('Data berhasil disimpan')->persistent('Ok');
$successmessage = "Proses Setting Jadwal Berhasil.";
return redirect()->route('operator.jadwal-kegiatan.index')->with('successMessage', $successmessage);
}
public function edit($id)
{
}
public function update(Request $request, $id)
{
}
public function destroy($id)
{
}
}
<?php
namespace App\Http\Controllers\Operator;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use URL;
use Auth;
use Uuid;
use Alert;
use Crypt;
use App\Models\Jenis;
class JenisController extends Controller
{
public function index()
{
return view('backend.operator.jenis.index')->withTitle('Jenis PKM');
}
/* AJAX request */
public function getData(Request $request){
## Read value
$draw = $request->get('draw');
$start = $request->get("start");
$rowperpage = $request->get("length"); // Rows display per page
$columnIndex_arr = $request->get('order');
$columnName_arr = $request->get('columns');
$order_arr = $request->get('order');
$search_arr = $request->get('search');
$columnIndex = $columnIndex_arr[0]['column']; // Column index
$columnName = $columnName_arr[$columnIndex]['data']; // Column name
$columnSortOrder = $order_arr[0]['dir']; // asc or desc
$searchValue = strtoupper($search_arr['value']); // Search value
// Total records
$statementGlobal = " STATUS_HAPUS = '0' ";
$totalRecords = Jenis::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND (UPPER(NAMA) LIKE '%".$searchValue."%') ";
$totalRecordswithFilter = Jenis::select('count(1) as allcount')
->whereRaw($statementGlobal.$statement)->count();
// Fetch records
$records = Jenis::orderBy($columnName,$columnSortOrder)
->whereRaw($statementGlobal.$statement)
->select('jenis.*')
->skip($start)
->take($rowperpage)
->get();
$data_arr = array();
foreach($records as $record){
$jenis_id = $record->jenis_id;
$nama = $record->nama;
$keterangan = $record->keterangan;
// $edit = route('admin/users/create',$id);
$edit = URL::to('operator/jenis/'.Crypt::encrypt($jenis_id).'/edit');
$delete = "confirmDelete('".Crypt::encrypt($jenis_id)."')";
$data_arr[] = array(
"jenis_id" => $jenis_id,
"nama" => $nama,
"keterangan" => $keterangan,
"aksi" => '<td class="table-action">
<a href="'.$edit.'" class="btn btn-icon-sm btn-primary"><i class="fas fa-edit"></i></a>
<a href="#!" class="btn btn-icon-sm btn-danger" onclick="'.$delete.'"><i class="fas fa-trash"></i></a>
</td>'
);
}
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordswithFilter,
"aaData" => $data_arr
);
echo json_encode($response);
exit;
}
public function create()
{
return view('backend.operator.jenis.create')->withTitle('Tambah Jenis PKM');
}
public function store(Request $request)
{
$uuid = Uuid::generate();
$data['jenis_id'] = $uuid;
$data['nama'] = $request->input('nama');
$data['keterangan'] = $request->input('keterangan');
// BACKUP NVN
// $data['created_user'] = Auth::user()->name;
if(Jenis::create($data))
{
Alert::success('Data berhasil disimpan')->persistent('Ok');
$successmessage = "Proses Tambah Kuesioner Berhasil.";
}
else
{
Alert::success('Data gagal disimpan')->persistent('Ok');
$successmessage = "Proses Tambah Kuesioner Gagal.";
}
return redirect()->route('operator.jenis.index')->with('successMessage', $successmessage);
}
public function edit($id)
{
$jenis = Jenis::where('jenis_id', '=', Crypt::decrypt($id))->get();
$data = [
'jenis' => $jenis
];
return view('backend.operator.jenis.edit', compact('data'))->withTitle('Ubah Jenis PKM');
}
public function update(Request $request, $id)
{
$data['nama'] = $request->input('nama');
$data['keterangan'] = $request->input('keterangan');
$jenis = Jenis::findOrFail($id);
$jenis->update($data);
Alert::success('Data berhasil disimpan.')->persistent('Ok');
return redirect()->route('operator.jenis.index');
}
public function destroy($id)
{
try {
$delete = Jenis::where('jenis_id', Crypt::decrypt($id))->update(['status_hapus'=>'1']);
if ($delete == 1) {
$status = 'success';
$message = "Jenis PKM berhasil dihapus.";
}
else{
$status = 'error';
$message = "Jenis PKM tidak ada.";
}
return response()->json([
'status' => $status,
'message' => $message,
]);
} catch (\Exception $id) {
return response()->json([
'status' => 'error',
'message' => "Data gagal dihapus.",
]);
}
}
}
<?php
namespace App\Http\Controllers\Operator;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use URL;
use Auth;
use Uuid;
use Alert;
use Crypt;
use App\Models\Jenis;
use App\Models\JenisPenilaianMonev;
class JenisPenilaianMonevController extends Controller
{
public function index()
{
return view('backend.operator.jenis_penilaian_monev.index')->withTitle('Jenis PKM');
}
/* AJAX request */
public function getData(Request $request){
## Read value
$draw = $request->get('draw');
$start = $request->get("start");
$rowperpage = $request->get("length"); // Rows display per page
$columnIndex_arr = $request->get('order');
$columnName_arr = $request->get('columns');
$order_arr = $request->get('order');
$search_arr = $request->get('search');
$columnIndex = $columnIndex_arr[0]['column']; // Column index
$columnName = $columnName_arr[$columnIndex]['data']; // Column name
$columnSortOrder = $order_arr[0]['dir']; // asc or desc
$searchValue = strtoupper($search_arr['value']); // Search value
// Total records
$statementGlobal = " STATUS_HAPUS = '0' ";
$totalRecords = Jenis::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND (UPPER(NAMA) LIKE '%".$searchValue."%') ";
$totalRecordswithFilter = Jenis::select('count(1) as allcount')
->whereRaw($statementGlobal.$statement)->count();
// Fetch records
$records = Jenis::orderBy($columnName,$columnSortOrder)
->whereRaw($statementGlobal.$statement)
->select('jenis.*')
->selectRaw('ambil_jumlah_jenis_penilaian(jenis.jenis_id) jumlah_komponen')
->skip($start)
->take($rowperpage)
->get();
$data_arr = array();
foreach($records as $record){
$jenis_id = $record->jenis_id;
$nama = $record->nama;
$keterangan = $record->keterangan;
$jumlah_komponen = $record->jumlah_komponen;
$edit = URL::to('operator/jenis-penilaian-monev/'.Crypt::encrypt($jenis_id).'/edit');
$data_arr[] = array(
"jenis_id" => $jenis_id,
"nama" => $nama,
"keterangan" => $keterangan,
"jumlah_komponen" => $jumlah_komponen,
"aksi" => '<td class="table-action">
<a href="'.$edit.'" class="btn btn-icon-sm btn-primary"><i class="fas fa-clipboard-list"></i></a>
</td>'
);
}
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordswithFilter,
"aaData" => $data_arr
);
echo json_encode($response);
exit;
}
public function create()
{
}
public function store(Request $request)
{
}
public function edit($id)
{
$jenis = Jenis::where('jenis_id', '=', Crypt::decrypt($id))->get();
$jenis_penilaian_monev = JenisPenilaianMonev::where('jenis_id', '=', Crypt::decrypt($id))->get();
$data = [
'jenis' => $jenis,
'jenis_penilaian_monev' => $jenis_penilaian_monev
];
return view('backend.operator.jenis_penilaian_monev.edit', compact('data'))->withTitle('Ubah Jenis PKM');
}
public function update(Request $request, $id)
{
$delete = JenisPenilaianMonev::where('jenis_id', $id)->delete($id);
for($i=0; $i<count($request->nama); $i++)
{
$uuid = Uuid::generate();
$data['jenis_penilaian_monev_id'] = $uuid;
$data['jenis_id'] = $id;
$data['nama'] = $request->nama[$i];
$data['bobot'] = $request->bobot[$i];
JenisPenilaianMonev::create($data);
}
Alert::success('Data berhasil disimpan.')->persistent('Ok');
return redirect()->route('operator.jenis-penilaian-monev.index');
}
}
<?php
namespace App\Http\Controllers\Operator;
use DB;
use URL;
use Auth;
use Uuid;
use Alert;
use Crypt;
use App\Models\Jenis;
use App\Models\Periode;
use App\Models\Kelompok;
use Illuminate\Http\Request;
use App\Models\KelompokDetail;
use App\Http\Controllers\Controller;
class KelompokController extends Controller
{
public function index()
{
$periode = Periode::query()->get();
return view('backend.operator.kelompok.index', compact('periode'))->withTitle('Daftar Kelompok');
}
/* AJAX request */
public function getData(Request $request){
// parameter
$status = $request->get('status');
$tahun= $request->get('tahun');
if($tahun == '0')
$tahun = date('Y');
## Read value
$draw = $request->get('draw');
$start = $request->get("start");
$rowperpage = $request->get("length"); // Rows display per page
$columnIndex_arr = $request->get('order');
$columnName_arr = $request->get('columns');
$order_arr = $request->get('order');
$search_arr = $request->get('search');
$columnIndex = $columnIndex_arr[0]['column']; // Column index
$columnName = $columnName_arr[$columnIndex]['data']; // Column name
$columnSortOrder = $order_arr[0]['dir']; // asc or desc
$searchValue = strtoupper($search_arr['value']); // Search value
// Total records
$statementGlobal = " KELOMPOK.STATUS_HAPUS = '0' ";
if($status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $status - 1;
$statementGlobal .= " AND STATUS = '".$status."'";
}
if($tahun != "0")
{
$statementGlobal .= " AND TO_CHAR(KELOMPOK.CREATED_AT, 'YYYY') = '".$tahun."'";
}
$totalRecords = Kelompok::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND B.STATUS_KETUA = '1' AND (UPPER(NAMA_DOSEN) LIKE '%".$searchValue."%' OR (UPPER(NAMA) LIKE '%".$searchValue."%') OR (UPPER(NIM) LIKE '%".$searchValue."%')) ";
$totalRecordswithFilter = Kelompok::select('count(1) as allcount')
->join('kelompok_detil as b', 'kelompok.kelompok_id', '=', 'b.kelompok_id')
->whereRaw($statementGlobal.$statement)->count();
// Fetch records
$records = Kelompok::orderBy($columnName,$columnSortOrder)
->join('kelompok_detil as b', 'kelompok.kelompok_id', '=', 'b.kelompok_id')
->whereRaw($statementGlobal.$statement)
->selectRaw('kelompok.kelompok_id, kode, nama_dosen, nidn_dosen, status, ambil_ketua_kelompok(kelompok.kelompok_id) ketua')
->skip($start)
->take($rowperpage)
->get();
$data_arr = array();
foreach($records as $record){
$kelompok_id = $record->kelompok_id;
$kode = $record->kode;
$ketua = $record->ketua;
$ketua = explode('###', $record->ketua);
$nama_ketua = $ketua[0];
$nim_ketua = $ketua[1];
$nama_dosen = $record->nama_dosen;
$nidn_dosen = $record->nidn_dosen;
$status = $record->status;
if($status == '1')
{
$keterangan = '<span class="badge bg-success">Disetujui</span>';
$aksi = '';
}
elseif($status == '2')
{
$keterangan = '<span class="badge bg-danger">Ditolak</span>';
$aksi = '<a class="btn btn-warning btn-sm waves-effect waves-light aksi" role="button" data-ket="Kelompok yang di dibatalkan status tolak akan menunggu di verifikasi kembali oleh dosen pembimbing." data-id="'.Crypt::encrypt($kelompok_id.'#0').'"><i class="fas fa-undo"></i></a>';
}
else
{
$keterangan = '<span class="badge bg-warning">Menunngu Persetujuan</span>';
$aksi = '<a class="btn btn-success btn-sm waves-effect waves-light aksi" role="button" data-ket="Kelompok yang di setujui akan di teruskan untuk upload proposal" data-id="'.Crypt::encrypt($kelompok_id.'#1').'"><i class="fas fa-check"></i></a> <a class="btn btn-danger btn-sm waves-effect waves-light aksi" role="button" data-ket="Kelompok yang tidak di setujui tidak bisa untuk upload proposal" data-id="'.Crypt::encrypt($kelompok_id.'#2').'"><i class="fas fa-times"></i></a>';
}
$aksi .= ' <a class="btn btn-primary btn-sm waves-effect waves-light viewdetails" role="button" data-id="'.Crypt::encrypt($kelompok_id).'"><i class="fas fa-eye"></i></a>';
$data_arr[] = array(
"kelompok_id" => $kelompok_id,
"kode" => $kode,
"nama_ketua" => $nama_ketua,
"nim_ketua" => $nim_ketua,
"nama_dosen" => $nama_dosen,
"nidn_dosen" => $nidn_dosen,
"keterangan" => $keterangan,
"aksi" => $aksi
);
}
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordswithFilter,
"aaData" => $data_arr
);
echo json_encode($response);
exit;
}
public function getDetil(Request $request)
{
$reqKelompokId = Crypt::decrypt($request->kelompok_id);
$kelompok_detil = KelompokDetail::where('kelompok_id', $reqKelompokId)->get();
$data = '';
$no = 1;
$anggota= 0;
foreach ($kelompok_detil as $key => $value) {
if($value->status_ketua == 1)
$keterangan = "Ketua";
else
{
$anggota++;
$keterangan = "Anggota ".$anggota?:1;
}
$data .= "
<tr>
<td>".$no."</td>
<td>".$value->nama."</td>
<td>".$value->nim."</td>
<td>".$value->fakultas."</td>
<td>".$value->prodi."</td>
<td>".$keterangan."</td>
</tr>
";
$no++;
}
$response['html'] = $data;
echo json_encode($response);
}
public function create()
{
}
public function store(Request $request)
{
}
public function edit($id)
{
}
public function update(Request $request, $id)
{
}
public function destroy($id)
{
}
public function prosesKelompok(Request $request)
{
$kel = $request->except('_token');
$arrKel = explode('#', decrypt($kel['kelompokId']));
$reqKelompokId = $arrKel['0'];
$reqStatus = $arrKel['1'];
$kelompok = Kelompok::query()->find($reqKelompokId);
$kelompok->status = $reqStatus;
$kelompok->save();
return response()->json([
'status' => 'success',
'message' => 'Data Berhasil diubah.',
]);
}
}
<?php
namespace App\Http\Controllers\Operator;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use App\Models\Pengumuman;
use Session;
use Alert;
use Auth;
class PengumumanController extends Controller
{
public function index()
{
//
$title = 'Pengumuman';
$pengumuman = Pengumuman::query()->first();
$data = [
'pengumuman' => $pengumuman,
'title' => $title,
];
return view('backend.operator.pengumuman.index', $data);
}
public function create()
{
//
}
public function store(Request $request)
{
//
}
public function show($id)
{
//
}
public function edit($id)
{
//
}
public function update(Request $request, $id)
{
//
$pengumuman = $request->except('_token');
$this->validate($request,
[
'file' => 'mimes:pdf|max:5000'
], [
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$pro = Pengumuman::find($id);
if(!isset($pengumuman['file'])){
$file_nama = $pro->file;
} else {
// Storage::disk('static')->delete('simpkm/pengumuman/'.$pro->rPeriode->nama.'/'.$pro->upload_dokumen);
$file_nama = $pro->id.'.'.$pengumuman['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/pengumuman/'.$file_nama, file_get_contents($pengumuman['file']->getRealPath()));
}
$pro->pengumuman = $pengumuman['pengumuman'];
$pro->file = $file_nama;
$pro->save();
return redirect()->route('operator.pengumuman.index')->with('success', 'Pengumuman berhasil di Edit');
}
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers\Operator;
use DB;
use URL;
use Auth;
use Uuid;
use Alert;
use Crypt;
use Carbon\Carbon;
use App\Models\Jenis;
use App\Models\Periode;
use App\Models\Proposal;
use Illuminate\Http\Request;
use App\Models\DaftarProposal;
use App\Exports\ProposalExport;
use App\Http\Controllers\Controller;
use Maatwebsite\Excel\Facades\Excel;
class ProposalController extends Controller
{
public function index()
{
$periode = Periode::query()->get();
$jenis = Jenis::query()->where('status_hapus', '0')->get();
return view('backend.operator.proposal.index', compact('periode', 'jenis'))->withTitle('Daftar Proposal');
}
/* AJAX request */
public function getData(Request $request){
// parameter
$jenis= $request->get('jenis');
$status = $request->get('status');
$tahun= $request->get('tahun');
if($tahun == '0')
$tahun = date('Y');
## Read value
$year = !is_null($request->year) ? $request->year : now()->year;
$draw = $request->get('draw');
$start = $request->get("start");
$rowperpage = $request->get("length"); // Rows display per page
$columnIndex_arr = $request->get('order');
$columnName_arr = $request->get('columns');
$order_arr = $request->get('order');
$search_arr = $request->get('search');
$columnIndex = $columnIndex_arr[0]['column']; // Column index
$columnName = $columnName_arr[$columnIndex]['data']; // Column name
$columnSortOrder = $order_arr[0]['dir']; // asc or desc
$searchValue = strtoupper($search_arr['value']); // Search value
// Total records
$statementGlobal = " STATUS_HAPUS = '0' ";
if($jenis != "0")
{
$statementGlobal .= " AND JENIS_ID = '".$jenis."'";
}
if($status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $status - 1;
$statementGlobal .= " AND STATUS = '".$status."'";
}
if($tahun != "0")
{
$statementGlobal .= " AND PERIODE = '".$tahun."'";
}
$totalRecords = DaftarProposal::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND (UPPER(JUDUL) LIKE '%".$searchValue."%' OR UPPER(IDENTITAS_KETUA) LIKE '%".$searchValue."%' OR UPPER(IDENTITAS_DOSPEM) LIKE '%".$searchValue."%') ";
$totalRecordswithFilter = DaftarProposal::select('count(1) as allcount')
->whereRaw($statementGlobal.$statement)->count();
// Fetch records
$records = DaftarProposal::orderBy($columnName,$columnSortOrder)
->whereRaw($statementGlobal.$statement)
->selectRaw('*')
->skip($start)
->take($rowperpage)
->get();
$data_arr = array();
foreach($records as $record){
$proposal_id = $record->proposal_id;
$kode = $record->kode;
$identitas_ketua = str_replace('###', '<br>', $record->identitas_ketua);
$identitas_dospem = str_replace('###', '<br>', $record->identitas_dospem);
$jenis_pkm = $record->jenis_pkm;
$judul = $record->judul;
$status = $record->status;
$upload_dokumen = $record->upload_dokumen;
$date_upload = Carbon::parse($record->date_upload)->format('d-m-Y H:i')?:'';
$date_approval = Carbon::parse($record->date_approval)->format('d-m-Y H:i')?:'';
if($upload_dokumen == null || $upload_dokumen == '')
{
$keterangan = '<span class="badge bg-danger">Belum Upload Proposal</span>';
}
else
{
$url = "https://statik.unesa.ac.id/simpkm/proposal/".$record->periode."/".$record->upload_dokumen;
if($status == '1')
{
$keterangan = '<span class="badge bg-success">Disetujui Dosen</span>';
$aksi = '<a class="btn btn-warning btn-sm waves-effect waves-light aksi" role="button" data-ket="Proposal Kelompok yang dibatalkan status diterima akan otomatis menjadi status ditolak agar dapat menunggah ulang Proposal." data-id="'.Crypt::encrypt($proposal_id.'#2').'"><i class="fas fa-undo"></i></a>';
}
elseif($status == '2')
{
$keterangan = '<span class="badge bg-danger">Ditolak Dosen</span>';
$aksi = '';
}
else
{
$keterangan = '<span class="badge bg-warning">Menunggu Persetujuan Dosen</span>';
$aksi = '<a class="btn btn-success btn-sm waves-effect waves-light aksi" role="button" data-ket="Proposal Kelompok disetujui" data-id="'.Crypt::encrypt($proposal_id.'#1').'"><i class="fas fa-check"></i></a> <a class="btn btn-danger btn-sm waves-effect waves-light aksi" role="button" data-ket="Proposal Kelompok ditolak" data-id="'.Crypt::encrypt($proposal_id.'#2').'"><i class="fas fa-times"></i></a>';
}
}
$aksi .= ' <a href="'.$url.'" target="_blank" class="btn btn-primary btn-sm waves-effect waves-light" role="button"><i class="fas fa-search"></i></a>';
$keterangan .= "<br><span class='badge bg-info'>Upload Proposal Pada : ".$date_upload." WIB</span>";
$keterangan .= "<br><span class='badge bg-info'>Disetujui Dosen Pada : ".$date_approval." WIB</span>";
$data_arr[] = array(
"proposal_id" => $proposal_id,
"kode" => $kode,
"identitas_ketua" => $identitas_ketua,
"identitas_dospem" => $identitas_dospem,
"jenis_pkm" => $jenis_pkm,
"judul" => $judul,
"keterangan" => $keterangan,
"aksi" => $aksi
);
}
$response = array(
"draw" => intval($draw),
"iTotalRecords" => $totalRecords,
"iTotalDisplayRecords" => $totalRecordswithFilter,
"aaData" => $data_arr
);
echo json_encode($response);
exit;
}
public function getDetil(Request $request)
{
$reqKelompokId = Crypt::decrypt($request->kelompok_id);
$kelompok_detil = KelompokDetail::where('kelompok_id', $reqKelompokId)->get();
$data = '';
$no = 1;
foreach ($kelompok_detil as $key => $value) {
if($value->status_ketua == 1)
$keterangan = "Ketua";
else
$keterangan = "Anggota ".$no-1;
$data .= "
<tr>
<td>".$no."</td>
<td>".$value->nama."</td>
<td>".$value->nim."</td>
<td>".$value->fakultas."</td>
<td>".$value->prodi."</td>
<td>".$keterangan."</td>
</tr>
";
$no++;
}
$response['html'] = $data;
echo json_encode($response);
}
public function create()
{
}
public function store(Request $request)
{
}
public function edit($id)
{
}
public function update(Request $request, $id)
{
}
public function destroy($id)
{
}
public function cetak_proposal(Request $request)
{
ini_set('max_execution_time', 0);
$jenis = $request->jenis;
$status = $request->status;
$tahun= $request->tahun;
return Excel::download(new ProposalExport($jenis, $status, $tahun), 'proposal_export.xlsx');
}
public function prosesProposal(Request $request)
{
$kel = $request->except('_token');
$arrKel = explode('#', decrypt($kel['proposalId']));
$reqProposalId = $arrKel['0'];
$reqStatus = $arrKel['1'];
$proposal = Proposal::query()->find($reqProposalId);
$proposal->status = $reqStatus;
$proposal->date_approval = now();
$proposal->save();
return response()->json([
'status' => 'success',
'message' => 'Data Berhasil diubah.',
]);
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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