Apply fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
857d3004eb
commit
88f3df2180
@@ -1,19 +1,22 @@
|
||||
<?php
|
||||
|
||||
function loging($context, $message, $level = 'error', $array = []) {
|
||||
|
||||
\Log::$level($message . ":-:-:-" . $context, $array);
|
||||
function loging($context, $message, $level = 'error', $array = [])
|
||||
{
|
||||
\Log::$level($message.':-:-:-'.$context, $array);
|
||||
}
|
||||
|
||||
function checkArray($key, $array) {
|
||||
$value = "";
|
||||
function checkArray($key, $array)
|
||||
{
|
||||
$value = '';
|
||||
if (array_key_exists($key, $array)) {
|
||||
$value = $array[$key];
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function mime($type) {
|
||||
function mime($type)
|
||||
{
|
||||
if ($type == 'jpg' ||
|
||||
$type == 'png' ||
|
||||
$type == 'PNG' ||
|
||||
@@ -26,36 +29,43 @@ function mime($type) {
|
||||
$type == 'image/jpg' ||
|
||||
$type == 'image/gif' ||
|
||||
// $type == "application/octet-stream" ||
|
||||
$type == "image/png" ||
|
||||
$type == 'image/png' ||
|
||||
starts_with($type, 'image')) {
|
||||
return "image";
|
||||
return 'image';
|
||||
}
|
||||
}
|
||||
|
||||
function removeUnderscore($string) {
|
||||
function removeUnderscore($string)
|
||||
{
|
||||
if (str_contains($string, '_') === true) {
|
||||
$string = str_replace('_', ' ', $string);
|
||||
}
|
||||
|
||||
return ucfirst($string);
|
||||
}
|
||||
|
||||
function isItil() {
|
||||
function isItil()
|
||||
{
|
||||
$check = false;
|
||||
if (\Schema::hasTable('sd_releases') && \Schema::hasTable('sd_changes') && \Schema::hasTable('sd_problem')) {
|
||||
$check = true;
|
||||
}
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
function isAsset() {
|
||||
function isAsset()
|
||||
{
|
||||
$check = false;
|
||||
if (\Schema::hasTable('sd_assets')) {
|
||||
$check = true;
|
||||
}
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
function itilEnabled() {
|
||||
function itilEnabled()
|
||||
{
|
||||
$check = false;
|
||||
if (\Schema::hasTable('common_settings')) {
|
||||
$settings = \DB::table('common_settings')->where('option_name', 'itil')->first();
|
||||
@@ -63,10 +73,12 @@ function itilEnabled() {
|
||||
$check = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
function isBill() {
|
||||
function isBill()
|
||||
{
|
||||
$check = false;
|
||||
if (\Schema::hasTable('common_settings')) {
|
||||
$settings = \DB::table('common_settings')->where('option_name', 'bill')->first();
|
||||
@@ -74,20 +86,23 @@ function isBill() {
|
||||
$check = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
function deletePopUp($id, $url, $title = "Delete", $class = "btn btn-sm btn-danger", $btn_name = "Delete", $button_check = true) {
|
||||
$button = "";
|
||||
function deletePopUp($id, $url, $title = 'Delete', $class = 'btn btn-sm btn-danger', $btn_name = 'Delete', $button_check = true)
|
||||
{
|
||||
$button = '';
|
||||
if ($button_check == true) {
|
||||
$button = '<a href="#delete" class="' . $class . '" data-toggle="modal" data-target="#delete' . $id . '">' . $btn_name . '</a>';
|
||||
$button = '<a href="#delete" class="'.$class.'" data-toggle="modal" data-target="#delete'.$id.'">'.$btn_name.'</a>';
|
||||
}
|
||||
return $button . '<div class="modal fade" id="delete' . $id . '">
|
||||
|
||||
return $button.'<div class="modal fade" id="delete'.$id.'">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">' . $title . '</h4>
|
||||
<h4 class="modal-title">'.$title.'</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
@@ -98,23 +113,26 @@ function deletePopUp($id, $url, $title = "Delete", $class = "btn btn-sm btn-dang
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="close" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
|
||||
<a href="' . $url . '" class="btn btn-danger">Delete</a>
|
||||
<a href="'.$url.'" class="btn btn-danger">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
function isInstall() {
|
||||
function isInstall()
|
||||
{
|
||||
$check = false;
|
||||
$env = base_path('.env');
|
||||
if (\File::exists($env) && env('DB_INSTALL') == 1) {
|
||||
$check = true;
|
||||
}
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
function faveotime($date, $hour = 0, $min = 0, $sec = 0) {
|
||||
function faveotime($date, $hour = 0, $min = 0, $sec = 0)
|
||||
{
|
||||
if (is_bool($hour) && $hour == true) {
|
||||
$hour = $date->hour;
|
||||
}
|
||||
@@ -125,5 +143,6 @@ function faveotime($date, $hour = 0, $min = 0, $sec = 0) {
|
||||
$sec = $date->second;
|
||||
}
|
||||
$date1 = \Carbon\Carbon::create($date->year, $date->month, $date->day, $hour, $min, $sec);
|
||||
|
||||
return $date1->hour($hour)->minute($min)->second($sec);
|
||||
}
|
||||
|
Reference in New Issue
Block a user