Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkode committed Jun 29, 2017
1 parent 2cf8357 commit 7837b11
Show file tree
Hide file tree
Showing 7,519 changed files with 160,303 additions and 2,618 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Empty file modified .htaccess
100755 → 100644
Empty file.
Empty file modified CONTRIBUTING.md
100755 → 100644
Empty file.
Binary file added Excel/bank_branches.xls
Binary file not shown.
Binary file added Excel/banks.xls
Binary file not shown.
Empty file modified README.md
100755 → 100644
Empty file.
Empty file modified app/commands/.gitkeep
100755 → 100644
Empty file.
Empty file modified app/config/app.php
100755 → 100644
Empty file.
Empty file modified app/config/auth.php
100755 → 100644
Empty file.
Empty file modified app/config/cache.php
100755 → 100644
Empty file.
Empty file modified app/config/compile.php
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions app/config/database.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'xara',
'database' => 'xara1',
'username' => 'root',
'password' => 'mwaste7',
'password' => '',
'port' => '3306',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
Expand Down
Empty file modified app/config/local/app.php
100755 → 100644
Empty file.
Empty file modified app/config/local/database.php
100755 → 100644
Empty file.
Empty file modified app/config/mail.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/.gitkeep
100755 → 100644
Empty file.
Empty file modified app/config/packages/cornford/backup/config.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/cornford/backup/dev/config.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/cache.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/config.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/csv.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/export.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/filters.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/import.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/maatwebsite/excel/views.php
100755 → 100644
Empty file.
Empty file modified app/config/packages/way/generators/config.php
100755 → 100644
Empty file.
Empty file modified app/config/queue.php
100755 → 100644
Empty file.
Empty file modified app/config/remote.php
100755 → 100644
Empty file.
Empty file modified app/config/services.php
100755 → 100644
Empty file.
Empty file modified app/config/session.php
100755 → 100644
Empty file.
Empty file modified app/config/testing/cache.php
100755 → 100644
Empty file.
Empty file modified app/config/testing/session.php
100755 → 100644
Empty file.
Empty file modified app/config/view.php
100755 → 100644
Empty file.
Empty file modified app/config/workbench.php
100755 → 100644
Empty file.
Empty file modified app/controllers/.gitkeep
100755 → 100644
Empty file.
Empty file modified app/controllers/AccountController.php
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions app/controllers/AccountsController.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function store()
$account->name = Input::get('name');
$account->code = Input::get('code');
$account->balance = Input::get('balance');
$account->organization_id = Confide::user()->organization_id;
if(Input::get('active')){
$account->active = TRUE;
}
Expand Down Expand Up @@ -142,6 +143,8 @@ public function update($id)
$account->name = Input::get('name');
$account->code = Input::get('code');
$account->balance = Input::get('balance');

$account->organization_id = Confide::user()->organization_id;
if(Input::get('active')){
$account->active = TRUE;
}
Expand All @@ -160,6 +163,8 @@ public function update($id)
$account->code = Input::get('code');
$account->balance = Input::get('balance');
$account->active = Input::get('active');

$account->organization_id = Confide::user()->organization_id;
$account->update();

}
Expand Down
209 changes: 209 additions & 0 deletions app/controllers/AdvanceController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?php

class AdvanceController extends \BaseController {

/**
* Display a listing of branches
*
* @return Response
*/
public function index()
{

$accounts = Account::where('organization_id',Confide::user()->organization_id)->where('active',true)->get();

return View::make('advances.index', compact('accounts'));
}

public function createaccount()
{
$postaccount = Input::all();
$data = array('name' => $postaccount['name'],
'code' => $postaccount['code'],
'category' => $postaccount['category'],
'active' => 1,
'organization_id' => Confide::user()->organization_id,
'created_at' => DB::raw('NOW()'),
'updated_at' => DB::raw('NOW()'));
$check = DB::table('accounts')->insertGetId( $data );

if($check > 0){

Audit::logaudit('Accounts', 'create', 'created: '.$postaccount['name']);
return $check;
}else{
return 1;
}

}

public function preview_advance()
{

$employees = DB::table('employee')
->join('employee_deductions', 'employee.id', '=', 'employee_deductions.employee_id')
->where('in_employment','=','Y')
->where('organization_id','=',Confide::user()->organization_id)
->where('deduction_id',1)
->get();

//print_r($accounts);

Audit::logaudit('advance salary', 'preview', 'previewed advance salaries');


return View::make('advances.preview', compact('employees'));
}

public function valid()
{
$period = Input::get('period');

//print_r($accounts);

return View::make('advances.valid', compact('period'));
}

/**
* Show the form for creating a new branch
*
* @return Response
*/
public function create()
{
$employees = DB::table('employee')
->join('employee_deductions', 'employee.id', '=', 'employee_deductions.employee_id')
->where('in_employment','=','Y')
->where('organization_id','=',Confide::user()->organization_id)
->where('deduction_id',1)
->where('instalments','>',0)
->get();
$period = Input::get('period');
$account = Input::get('account');

//print_r($accounts);

Audit::logaudit('Advance Salaries', 'preview', 'previewed advance salaries');

return View::make('advances.preview', compact('employees','period','account'));
}

public function del_exist()
{
$postedit = Input::all();
$part1 = $postedit['period1'];
$part2 = $postedit['period2'];
$part3 = $postedit['period3'];

$period = $part1.$part2.$part3;

$data = DB::table('transact_advances')->where('financial_month_year', '=', $period)->where('organization_id','=',Confide::user()->organization_id)->delete();

if($data > 0){
return 0;
}else{
return 1;
}


exit();
}

/**
* Store a newly created branch in storage.
*
* @return Response
*/
public function store()
{
$employees = DB::table('employee')
->join('employee_deductions', 'employee.id', '=', 'employee_deductions.employee_id')
->where('in_employment','=','Y')
->where('organization_id','=',Confide::user()->organization_id)
->where('deduction_id',1)
->where('instalments','>',0)
->get();
foreach ($employees as $employee) {
$advance = new Advance;

$advance->employee_id = $employee->personal_file_number;
$advance->amount = $employee->deduction_amount;
$advance->financial_month_year = Input::get('period');
$advance->account_id = Input::get('account');
$advance->organization_id = Confide::user()->organization_id;
$advance->save();
}

$period = Input::get('period');
Audit::logaudit('Advance Salaries', 'process', 'processed advance salaries for '.$period);

return Redirect::route('advance.index')->withFlashMessage('Advance Salaries successfully processed!');


}



/**
* Display the specified branch.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$advance = Advance::findOrFail($id);

return View::make('advances.show', compact('advance'));
}

/**
* Show the form for editing the specified branch.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$deduction = Deduction::find($id);

return View::make('deductions.edit', compact('deduction'));
}

/**
* Update the specified branch in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$deduction = Deduction::findOrFail($id);

$validator = Validator::make($data = Input::all(), Deduction::$rules, Deduction::$messages);

if ($validator->fails())
{
return Redirect::back()->withErrors($validator)->withInput();
}

$deduction->deduction_name = Input::get('name');
$deduction->update();

return Redirect::route('deductions.index');
}

/**
* Remove the specified branch from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Deduction::destroy($id);

return Redirect::route('deductions.index');
}

}
Empty file modified app/controllers/AllowancesController.php
100755 → 100644
Empty file.
132 changes: 132 additions & 0 deletions app/controllers/AppraisalCategoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?php

class AppraisalCategoryController extends \BaseController {

/**
* Display a listing of branches
*
* @return Response
*/
public function index()
{
$categories = Appraisalcategory::whereNull('organization_id')->orWhere('organization_id',Confide::user()->organization_id)->get();


Audit::logaudit('Appraisalcategories', 'view', 'viewed appraisal categories');


return View::make('appraisalcategories.index', compact('categories'));
}

/**
* Show the form for creating a new branch
*
* @return Response
*/
public function create()
{
return View::make('appraisalcategories.create');
}

/**
* Store a newly created branch in storage.
*
* @return Response
*/
public function store()
{
$validator = Validator::make($data = Input::all(), Appraisalcategory::$rules, Appraisalcategory::$messsages);

if ($validator->fails())
{
return Redirect::back()->withErrors($validator)->withInput();
}

$category = new Appraisalcategory;

$category->name = Input::get('name');

$category->organization_id = Confide::user()->organization_id;

$category->save();

Audit::logaudit('Appraisalcategories', 'create', 'created: '.$category->name);


return Redirect::route('appraisalcategories.index')->withFlashMessage('Appraisal category successfully created!');
}

/**
* Display the specified branch.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$category = Appraisalcategory::findOrFail($id);

return View::make('appraisalcategories.show', compact('category'));
}

/**
* Show the form for editing the specified branch.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$category = Appraisalcategory::find($id);

return View::make('appraisalcategories.edit', compact('category'));
}

/**
* Update the specified branch in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$category = Appraisalcategory::findOrFail($id);

$validator = Validator::make($data = Input::all(), Appraisalcategory::$rules, Appraisalcategory::$messsages);

if ($validator->fails())
{
return Redirect::back()->withErrors($validator)->withInput();
}

$category->name = Input::get('name');
$category->update();

Audit::logaudit('Appraisalcategories', 'update', 'updated: '.$category->name);

return Redirect::route('appraisalcategories.index')->withFlashMessage('Appraisal category successfully updated!');
}

/**
* Remove the specified branch from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$category = Appraisalcategory::findOrFail($id);

$app = DB::table('Appraisalquestions')->where('Appraisalcategory_id',$id)->count();
if($app>0){
return Redirect::route('appraisalcategories.index')->withDeleteMessage('Cannot delete this appraisal category because its assigned to appraisal question(s)!');
}else{
Appraisalcategory::destroy($id);

Audit::logaudit('Appraisalcategories', 'delete', 'deleted: '.$category->name);

return Redirect::route('appraisalcategories.index')->withDeleteMessage('Appraisal category successfully deleted!');
}
}

}
Loading

0 comments on commit 7837b11

Please sign in to comment.