/home/mip/mip/public/vendor/laravel-filemanager/files/folder-1/821668/Modules.zip
PK �8]-�fF� � EmployerServiceProvider.phpnu �Iw�� <?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
);*/
}
}
PK �8]q�@ @ helpers.phpnu �[��� <?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;
} PK �8]u{� �
tables.phpnu �Iw�� <?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'
]
]
];
?>PK �8]�/#�� � Likod/Models/Clients/User.phpnu �Iw�� <?php
namespace QxCMS\Modules\Likod\Models\Clients;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Carbon\Carbon;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
protected $connection = 'qxcms';
protected $table = "client_users";
protected $guarded = ['password_confirmation'];
protected $appends = ['hashid'];
public $module_id = 3;
/*
* Model Accessors
*/
public function getHashidAttribute()
{
return hashid($this->id);
}
public function setValidityDateAttribute($value)
{
if($value <> '') {
$dateformats = getDateFormatConfig('set');
return $this->attributes['validity_date'] = Carbon::createFromFormat($dateformats['php'], $value)->format('Y-m-d');
}
return $this->attributes['validity_date'] = '0000-00-00';
}
public function getValidityDateAttribute($value)
{
if($value <> '0000-00-00') {
$dateformats = getDateFormatConfig('get');
return Carbon::createFromFormat('Y-m-d', $value)->format($dateformats['php']);
}
return;
}
public function formValidityDateAttribute($value)
{
if($value <> '0000-00-00') {
$dateformats = getDateFormatConfig('form');
return Carbon::createFromFormat('Y-m-d', $value)->format($dateformats['php']);
}
return;
}
/*
* Model Mutators
*/
public function client()
{
return $this->belongsTo('QxCMS\Modules\Likod\Models\Clients\Client', 'client_id');
}
public function role()
{
return $this->belongsTo('QxCMS\Modules\Client\Models\Settings\Roles\Role', 'role_id');
}
public function permissions()
{
return $this->hasMany('QxCMS\Modules\Client\Models\Settings\Roles\Permission', 'role_id', 'role_id');
}
public function post()
{
return $this->hasMany('QxCMS\Modules\Client\Models\Posts\Posts', 'author_id');
}
public function userLogs()
{
return $this->hasMany('QxCMS\Modules\Client\Models\Settings\UserLogs\UserLogs', 'user_id');
}
public function scopeFilterUsersByRole($query, $roleIds = array())
{
if(!empty($roleIds))
{
if(is_array($roleIds)) return $query->whereNotIn('role_id', $roleIds);
return $query->where('role_id', $roleIds);
}
return $query;
}
public function scopeIsNotSubUser($query)
{
return $query->where('is_sub_user', 'No');
}
public function scopeIsSubUser($query)
{
return $query->where('is_sub_user', 'Yes');
}
public function page()
{
return $this->hasMany('QxCMS\Modules\Client\Models\Pages\Pages', 'author_id');
}
public function scopeSearchByName($query, $criteria = null)
{
if(!empty($criteria))
{
return $query->where('name', 'LIKE', '%'.$criteria.'%');
}
}
public function scopeFieldOfficer($query)
{
return $query->where('access_type', config('role.field_officer'));
}
public function scopeEditor($query)
{
return $query->where('access_type', config('role.editor'));
}
public function scopeSearchUserType($query, $user_type = '')
{
if(!empty($user_type))
{
if(strtolower($user_type) == 'field_officer') return $query->fieldOfficer();
if(strtolower($user_type) == 'editor') return $query->editor();
}
return $query;
}
public function scopeClientUser($query, $client_id = '')
{
if(auth()->check()){
$client_id = auth()->user()->client->id;
}
return $query->where('client_id', $client_id);
}
}PK �8]56�g� � Likod/Models/Clients/Client.phpnu �Iw�� <?php
namespace QxCMS\Modules\Likod\Models\Clients;
use Illuminate\Database\Eloquent\Model;
class Client extends Model
{
protected $connection = 'qxcms';
protected $table = "clients";
public $module_id = 5;
protected $fillable = [
'client_name',
'client_address',
'telephone_no',
'email',
'client_address',
'database_name',
'database_host',
'database_username',
'database_password',
'api_key',
'api_secret',
'status',
'number_of_users',
'disk_size',
'date_picker_format',
'display_date_format',
'name_format',
'monthly_mail_quota',
'root_dir',
'mail_driver',
'mail_sender_address',
'mail_sender_name',
'mail_host',
'mail_username',
'mail_password',
'mail_port',
'storage_type',
's3_key',
's3_secret',
's3_region',
's3_bucket_name',
'cpanel_email',
'cpanel_host',
'cpanel_ip',
'cpanel_port',
'cpanel_account',
'cpanel_password',
'cpanel_domain',
'cpanel_user_default_password',
'cpanel_qouta',
'cpanel_forwarder'
];
protected $appends = ['hashid', 'date_picker', 'date_picker_display'];
/*
* Model Accessors
*/
public function getHashidAttribute()
{
return hashid($this->id);
}
public function getDatePickerAttribute()
{
return config('account.dateformat.'.$this->date_picker_format);
}
public function getDatePickerDisplayAttribute()
{
return config('account.displaydateformat.'.$this->display_date_format);
}
/*
* Model Mutators
*/
/*
* Model Relationship
*/
public function users()
{
return $this->hasMany('QxCMS\Modules\Likod\Models\Clients\User', 'client_id');
}
}PK �8]�)�� * Likod/Models/Settings/Roles/Permission.phpnu �Iw�� <?php
namespace QxCMS\Modules\Likod\Models\Settings\Roles;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
protected $connection = 'qxcms';
protected $table = 'role_permissions';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'role_id',
'menu_id',
'can_access',
'can_create',
'can_update',
'can_delete',
'can_export',
'can_import',
'can_export'
];
}PK �8]���� $ Likod/Models/Settings/Roles/Role.phpnu �Iw�� <?php
namespace QxCMS\Modules\Likod\Models\Settings\Roles;
use Illuminate\Database\Eloquent\Model;
class Role extends Model
{
protected $connection = 'qxcms';
protected $table = 'roles';
public $module_id = 2;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'display_name', 'description',
];
protected $appends = ['hashid'];
/*
* Model Accessors
*/
public function getHashidAttribute()
{
return hashid($this->id);
}
public function permissions()
{
return $this->hasMany('QxCMS\Modules\Likod\Models\Settings\Roles\Permission');
}
public function users()
{
return $this->hasMany('QxCMS\Modules\Likod\User');
}
/*
* Model Custom Functions
*/
public function role_access($role_id = 1)
{
if ($role_id == 1) {
return $this->all();
} else {
return $this->where('id', '<>', 1)->get();
}
}
}PK �8]�:�( ( ! Likod/Models/Developer/Module.phpnu �Iw�� <?php
namespace QxCMS\Modules\Likod\Models\Developer;
use Illuminate\Database\Eloquent\Model;
use DB;
use File;
class Module extends Model
{
protected $connection = 'qxcms';
protected $table = "modules";
protected $fillable = [
'title',
'link_type',
'page_id',
'menu_group_id',
'module_name',
'module_description',
'is_parent',
'has_parent',
'parent_id',
'url',
'uri',
'icon',
'target',
'show_menu',
'has_read',
'has_create',
'has_update',
'has_delete',
'has_export',
'has_import',
'has_print'
];
protected $appends = ['hashid'];
/*
* Model Accessors
*/
public function getHashidAttribute()
{
return hashid($this->id);
}
/*
* Model Mutators
*/
public function setParentIdAttribute($value)
{
if(empty($value)) $this->attributes['parent_id'] = 0;
else $this->attributes['parent_id'] = $value;
}
}PK �8]ج�Ͻ � '