/home/mip/public_html/img/credit/datatables/Modules.tar
EmployerServiceProvider.php 0000664 00000003342 15123555220 0012111 0 ustar 00 <?php
namespace QxCMS\Modules;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
class EmployerServiceProvider extends ServiceProvider
{
protected $namespace = 'QxCMS\Modules';
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot(Router $router)
{
$modules = config('modules.modules');
array_filter($modules, function($module) use ($router) {
if($module=='Employer')
{
$this->registerModuleRoute($router, $module);
$this->registerModuleView($module);
}
});
/*\DB::listen(function($sql) {
var_dump($sql);
});*/
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->setEmployerInterface();
$this->mergeConfigFrom(
__DIR__.'/tables.php', 'tables'
);
}
public function registerModuleView($module)
{
return $this->loadViewsFrom(__DIR__."/$module/Views", $module);
}
public function registerModuleRoute($router, $module)
{
$router->group([
'namespace' => $this->namespace.'\\'.$module.'\\'.'Controllers',
'middleware' => 'web',
'prefix' => strtolower($module)
], function ($router) use ($module) {
require __DIR__."/$module/routes.php";
});
}
public function setEmployerInterface()
{
/*$this->app->bind(
\QxCMS\Modules\Client\Repositories\Settings\Roles\RoleRepositoryInterface::class,
\QxCMS\Modules\Client\Repositories\Settings\Roles\RoleRepository::class
);*/
}
}
helpers.php 0000644 00000010500 15123555220 0006713 0 ustar 00 <?php
use Hashids\Hashids;
use Illuminate\Support\Str;
function str_random($data) {
return Str::random($data);
}
function get_website_assets($file_path = "")
{
$path = config('website.path');
return url($path.'/'.$file_path);
}
function get_template($file_path = "")
{
$path = config('template.path');
$name = config('template.name');
return url($path.'/'.$name.'/'.$file_path);
}
function hashid($id = 0)
{
$hashids = new Hashids();
$id = $hashids->encode($id);
return $id;
}
function decode($hashid = "")
{
if($hashid <> "")
{
$hashids = new Hashids();
$ids = $hashids->decode($hashid);
if(isset($ids[0])) return $ids[0];
}
return;
}
function yearArray($start_year = 2010)
{
$years = array();
$end_year = (int) Carbon\Carbon::now()->format('Y');
while($end_year >= $start_year) {
$years[$end_year] = $end_year;
$end_year--;
}
return $years;
}
function getYear($personal_id)
{
return substr($personal_id, 0,4);
}
function lists($datas = array())
{
$rows = array();
if(!empty($datas)) {
foreach ($datas as $data_key => $data) {
$rows[$data] = $data;
}
}
return $rows;
}
function format_date($sqldate = '0000-00-00', $format = null, $datetype = 'single', $guard = 'client') {
if(empty($format) || $format == null) $dateformats = auth($guard)->user()->client->date_picker_display;
else $dateformats = array('php' => $format);
if($datetype == 'single' || $datetype == null) {
if($sqldate <> '0000-00-00' && !empty($sqldate)) return Carbon\Carbon::parse($sqldate)->format($dateformats['php']);
} else if($datetype=='range'){
$date = explode('-', preg_replace('/\s+/', '', $sqldate));
if(isset($date[0]) && isset($date[1])) {
$from = Carbon\Carbon::parse($date[0])->format($dateformats['php']);
$to = Carbon\Carbon::parse($date[1])->format($dateformats['php']);
if($from == $to) return $from;
return $from. ' to '. $to;
}
}
return '';
}
function get_applicant_attachment($personal_id = 0, $file = "", $guard = 'client')
{
$client = auth($guard)->user()->client;
if(!empty($file) && $personal_id != 0) {
if($client->storage_type == "public") {
return url(\Storage::disk($client->storage_type)->url($client->root_dir.'/attachments/'.getYear($personal_id).'/'.$personal_id.'/'.$file));
}
if($client->storage_type == "s3") {
return \Storage::disk($client->storage_type)->url($client->root_dir.'/attachments/'.getYear($personal_id).'/'.$personal_id.'/'.$file);
}
}
}
function get_extension($file = "")
{
if($file != "") {
$chunks = explode('.', $file);
return strtolower(end($chunks));
}
return '';
}
function getDateFormatConfig($method = 'get')
{
/*
Form Accessor and Mutator
use for adding or updating dates
*/
if(in_array(strtolower($method), array('form','set'))) {
$dateformats = config('account.dateformat.'.config('account.dateformat.default'));
}
/*
Laravel built-in Accessor
use for displaying dates
*/
if(in_array(strtolower($method), array('get'))){
$dateformats = config('account.displaydateformat.'.config('account.displaydateformat.default'));
}
return $dateformats;
}
function get_link($file_path = '')
{
if(auth()->check()) {
$client = auth()->user()->client;
if(!empty($file_path)) {
$storage_type = $client->storage_type;
$url = Storage::disk($storage_type)->url($client->root_dir.'/'.$file_path);
if($storage_type == "public") {
return url($url);
}
if($storage_type == "s3") {
return $url;
}
}
}
}
function get_photo_link($filename = '', $thumbs = false)
{
if(!empty($filename)){
$url = '/photos/'.env('CLIENT_ROOT_DIR').'/shares/'.(($thumbs) ? 'thumbs/':'').$filename;
if(file_exists($url)){
return $url;
}
return $url = '/photos/'.env('CLIENT_ROOT_DIR').'/shares/'.$filename;
}
return '';
}
function remove_script_tags($text)
{
$text = preg_replace("/(\<script)(.*?)(script>)/si", "", "$text");
return $text;
} tables.php 0000664 00000011715 15123555220 0006536 0 ustar 00 <?php
return [
'nationalities' => [
"Afghan",
"Albanian",
"Algerian",
"Andorran",
"Angolan",
"Argentine",
"Armenian",
"Australian",
"Austrian",
"Azerbaijani",
"Bahamian",
"Bahraini",
"Bangladeshi",
"Barbadian",
"Belarusian",
"Belgian",
"Belizean",
"Beninese",
"Bhutanese",
"Bolivian",
"Bosnian",
"Batswana",
"Brazilian",
"Bruneian",
"Bulgarian",
"Burkinabe",
"Burmese",
"Burundian",
"Cambodian",
"Cameroonian",
"Canadian",
"Cape Verdean",
"Chadian",
"Chilean",
"Chinese",
"Colombian",
"Comoran",
"Congolese",
"Costa Rican",
"Croatian",
"Cuban",
"Cypriot",
"Czech",
"Dane",
"Djiboutian",
"Dominican",
"Dominican",
"East Timorese",
"Ecuadorian",
"Egyptian",
"Salvadorean",
"English",
"Eritrean",
"Estonian",
"Ethiopian",
"Fijian",
"Finn",
"French",
"Gabonese",
"Gambian",
"Georgian",
"German",
"Ghanaian",
"Greek",
"Grenadian",
"Guatemalan",
"Guinean",
"Guyanese",
"Haitian",
"Honduran",
"Hungarian",
"Icelander",
"Indian",
"Indonesian",
"Iranian",
"Iraqi",
"Irish",
"Israeli",
"Italian",
"Ivorian",
"Jamaican",
"Japanese",
"Jordanian",
"Kazakh",
"Kenyan",
"Korean",
"Kuwaiti",
"Laotian",
"Latvian",
"Lebanese",
"Liberian",
"Libyan",
"Liechtensteiner",
"Lithuanian",
"Luxembourger",
"Macedonian",
"Malagasy",
"Malawian",
"Malaysian",
"Maldivian",
"Malian",
"Maltese",
"Mauritanian",
"Mauritian",
"Mexican",
"Moldovan",
"Monacan",
"Mongolian",
"Montenegrin",
"Moroccan",
"Mozambican",
"Namibian",
"Nepalese",
"Dutch",
"New Zealander",
"Nicaraguan",
"Nigerien",
"Nigerian",
"Norwegian",
"Omani",
"Pakistani",
"Panamanian",
"Papua New Guinean",
"Paraguayan",
"Peruvian",
"Filipino",
"Pole",
"Portuguese",
"Qatari",
"Romanian",
"Russian",
"Rwandan",
"Saudi",
"Scot",
"Senegalese",
"Serb",
"Seychellois",
"Sierra Leonian",
"Singaporean",
"Slovak",
"Slovene",
"Solomon Islander",
"Somali",
"South African",
"Spaniard",
"Sri Lankan",
"Sudanese",
"Surinamese",
"Swazi",
"Swede",
"Swiss",
"Syrian",
"Taiwanese",
"Tajik or Tadjik",
"Tanzanian",
"Thai",
"Togolese",
"Trinidadian",
"Tunisian",
"Turk",
"Tuvaluan",
"Ugandan",
"Ukrainian",
"Emirati",
"British",
"American",
"Uruguayan",
"Uzbek",
"Vanuatuan",
"Venezuelan",
"Vietnamese",
"Welsh",
"Western Samoan",
"Yemeni",
"Yugoslav",
"Zairean",
"Zambian",
"Zimbabwean"
],
'religions' => [
'Buddhism',
'Christianity - Catholic',
'Christianity - Others',
'Hinduism',
'Islam',
'Judaism',
],
'civil_statuses' => [
'Single' => 'Single',
'Married' => 'Married',
'Widower' => 'Widower',
'Separated' => 'Separated'
],
'units' => [
'weights' => [
'kg' => 'kg',
'lbs' => 'lbs',
],
'heights' => [
'in' => 'in',
'cm' => 'cm',
'ft' => 'ft'
]
]
];
?>