Current Path : /home/bitrix/code/career/ |
Current File : /home/bitrix/code/career/phpnewden.txt |
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ // ]; /** * Define the application's command schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { // $schedule->command('inspire') // ->hourly(); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } } <?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\Occupations; use App\Database\OccupationsToTypes; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use duzun\hQuery; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PHPUnit\Framework\Warning; class oktest extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'oktest'; /** * The console command description. * * @var string */ protected $description = 'Command for console testing'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $query = hQuery::fromFile('https://resources.workable.com/job-descriptions/'); try { // GTools::okp($query); $list = $query->find('.section-list'); // GTools::okp($list); $allDescriptions = []; $index = 0; if (is_array($list) || is_object($list)) { foreach ($list->find('ul li a') as $item) { GTools::okp($item); if ($index > 1) { break; } $html = $item->html(); $href = $item->attr('href'); $allDescriptions[$index]['title'] = $html; $allDescriptions[$index]['href'] = $href; if (strlen($href) > 0) { $jobQuery = hQuery::fromFile($href); $intro = $jobQuery->find('.intro')->html(); $intro = strip_tags($intro); $allDescriptions[$index]['intro'] = $intro; $fullDescription = $jobQuery->find('.article-container.tmpl'); // $allDescriptions[$index]['full'] = $fullDescription->html(); $catIndex = 0; $subcat = false; foreach ($fullDescription->children() as $key => $child) { $tag = $child->nodeName; if ($tag == 'h2') { if ($subcat) { $allDescriptions[$index]['subcat'][] = $subcat; } $subcat = [ 'title' => $child->html(), 'text' => '', 'list' => [], ]; } elseif ($tag == 'p') { $subcat['text'] .= $child->html(); } elseif ($tag == 'ul') { foreach ($child->find('li') as $li) { $subcat['list'][] = $li->html(); } } } // GTools::okp($allDescriptions[$index]); } ++$index; } } else { dump(get_class($list)); } // GTools::okp($allDescriptions); // GTools::okp($list); } catch (\Exception $e) { dump($e->getFile() . ': ' . $e->getLine()); dump($e->getMessage()); // GTools::okp($e->getMessage()); // GTools::okp($e->getTrace()); } return 0; } } <?php namespace App\Console\Commands; use App\Database\Dataatwork\Jobs; use App\Database\Dataatwork\JobsToSkills; use App\Database\Dataatwork\Skills; use Illuminate\Console\Command; use App\GTools; use Illuminate\Database\Schema\Blueprint; use Illuminate\Queue\Jobs\Job; use Illuminate\Support\Facades\Schema; class addJobs extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'addJobs'; /** * The console command description. * * @var string */ protected $description = 'Command for console adding jobs and skills'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } private function addJobs() { $maxLimit = 500; $offset = 0; while (true) { $jobsEncoded = file_get_contents("http://api.dataatwork.org/v1/jobs?offset=$offset&limit=$maxLimit"); $jobs = json_decode($jobsEncoded); $count = 0; foreach ($jobs as $item) { if (isset($item->uuid)) { ++$count; $currentJob = Jobs::getById($item->uuid); if (empty($currentJob)) { Jobs::add([ 'id' => $item->uuid, 'name' => $item->title, 'description' => $item->title, ]); } else { echo "Job " . $item->uuid . " already exist\n"; } } } $offset += $maxLimit; echo "Added $count jobs from $offset\n"; if ($count < $maxLimit) { break; } } } private function addSkills() { $maxLimit = 500; $offset = 0; while (true) { $skillsEncoded = file_get_contents("http://api.dataatwork.org/v1/skills?offset=$offset&limit=$maxLimit"); $skills = json_decode($skillsEncoded); $count = 0; foreach ($skills as $item) { if (isset($item->uuid)) { ++$count; $currentSkill = Skills::getById($item->uuid); if (empty($currentSkill)) { Skills::add([ 'id' => $item->uuid, 'name' => $item->name, 'description' => $item->description, 'onet_id' => $item->onet_element_id, 'type' => isset($item->type) ? $item->type : 'unknown', ]); } else { echo "Skill " . $item->uuid . " already exist\n"; } } } echo "Added $count skills from $offset\n"; $offset += $maxLimit; if ($count < $maxLimit) { break; } } } private function mappingSkills() { $allJobs = Jobs::getAll(); $count = 0; foreach ($allJobs as $job) { // GTools::okp($job); // GTools::okp($job->id); // break; $jobId = $job->id; try { $relatedSkillsEncoded = file_get_contents("http://api.dataatwork.org/v1/jobs/$jobId/related_skills"); $relatedSkills = json_decode($relatedSkillsEncoded); if (isset($relatedSkills->skills)) { $skillCount = 0; foreach ($relatedSkills->skills as $skill) { if (!JobsToSkills::exists($jobId, $skill->skill_uuid)) { JobsToSkills::add([ 'job_id' => $jobId, 'skill_id' => $skill->skill_uuid, 'level' => $skill->level, 'importance' => $skill->importance, ]); ++$skillCount; } else { echo "$count. Skills relevant to job $jobId already exist\n"; break; } } ++$count; echo "$count. Added $skillCount skills relevant to job $jobId\n"; } else { echo $relatedSkills->error->message . "\n"; } } catch (\Exception $e) { echo $e->getMessage() . "\n"; Jobs::delete($jobId); echo "Job $jobId deleted \n"; } } } /** * Execute the console command. * * @return mixed */ public function handle() { $this->mappingSkills(); // GTools::okp(Jobs::getAll()); return; // GTools::okp(json_decode($jobs)); return 0; } } <?php namespace App\Exceptions; use Exception; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler { /** * A list of the exception types that are not reported. * * @var array */ protected $dontReport = [ // ]; /** * A list of the inputs that are never flashed for validation exceptions. * * @var array */ protected $dontFlash = [ 'password', 'password_confirmation', ]; /** * Report or log an exception. * * @param \Exception $exception * @return void */ public function report(Exception $exception) { parent::report($exception); } /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $exception * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) { return parent::render($request, $exception); } } <?php namespace App\Http\Controllers\Auth; use App\BrokerSmith; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Zefy\SimpleSSO\SSOBroker; class LoginController extends Controller { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesUsers; /** * Where to redirect users after login. * * @var string */ protected $redirectTo = '/'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest')->except('logout'); } public function login(Request $request) { $broker = new BrokerSmith(); $res = $broker->tryLogin($request->get('email'), $request->get('password')); if ($res) { Auth::loginUsingId($res); } return $this->sendFailedLoginResponse($request); } public function showLoginForm() { if (!Auth::check()) { $broker = new BrokerSmith(); $broker->logout(); foreach ($_COOKIE as $code => $value) { setcookie($code, ''); } } return view('auth.login'); } } <?php namespace App\Http\Controllers\Auth; use App\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; use App\BrokerSmith; use Illuminate\Http\Request; use Illuminate\Auth\Events\Registered; class RegisterController extends Controller { /* |-------------------------------------------------------------------------- | Register Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their | validation and creation. By default this controller uses a trait to | provide this functionality without requiring any additional code. | */ use RegistersUsers; /** * Where to redirect users after registration. * * @var string */ protected $redirectTo = '/'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Get a validator for an incoming registration request. * * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:6', 'confirmed'], ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function create(array $data) { // dump($data); die(); $user = User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), // 'company' > $data['company'], ]); if (array_key_exists('company', $data)) { $user->company = $data['company']; $user->save(); // $user->update(['company' => $data['company']]); } $broker = new BrokerSmith; $broker->tryLogin($data['email'], $data['password']); return $user; } } <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\VerifiesEmails; class VerificationController extends Controller { /* |-------------------------------------------------------------------------- | Email Verification Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling email verification for any | user that recently registered with the application. Emails may also | be re-sent if the user didn't receive the original email message. | */ use VerifiesEmails; /** * Where to redirect users after verification. * * @var string */ protected $redirectTo = '/'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); $this->middleware('signed')->only('verify'); $this->middleware('throttle:6,1')->only('verify', 'resend'); } } <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; class ResetPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset requests | and uses a simple trait to include this behavior. You're free to | explore this trait and override any methods you wish to tweak. | */ use ResetsPasswords; /** * Where to redirect users after resetting their password. * * @var string */ protected $redirectTo = '/'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } } <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; class ForgotPasswordController extends Controller { /* |-------------------------------------------------------------------------- | Password Reset Controller |-------------------------------------------------------------------------- | | This controller is responsible for handling password reset emails and | includes a trait which assists in sending these notifications from | your application to your users. Feel free to explore this trait. | */ use SendsPasswordResetEmails; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } } <?php namespace App\Http\Controllers; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\JdSkills; use App\Database\JobDescription; use App\Database\Occupations; use App\Database\OccupationsToTypes; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use duzun\hQuery; use function GuzzleHttp\Psr7\str; use Illuminate\Queue\Jobs\Job; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PHPUnit\Framework\Warning; class OktestController extends Controller { // private $jobs; /** * @param String $type * @param array $typeCategories */ public function setRelevantOccupations(String $type, array $typeCategories) { $query = DB::table(Occupations::getTable()); $founded = []; foreach ($typeCategories as $cat) { // $allCats = []; // if (strpos($cat, ' & ') !== false) { // $allCats = explode(' & ' , $cat); // GTools::okp($cat); // GTools::okp($allCats); // } elseif (strpos($cat, '/') !== false) { // $allCats = explode('/' , $cat); // GTools::okp($cat); // GTools::okp($allCats); // } else { // $allCats = [$cat]; // } // foreach ($allCats as $shortCat) { // GTools::okp($shortCat); // $query // ->orWhere('name', 'like', '%' . $shortCat . '%') // ->orWhere('description', 'like', '%' . $shortCat . '%') // ; // } $foundCategories = json_decode(file_get_contents( 'https://ec.europa.eu/esco/api/search?text=' . urlencode($cat) . '&type=occupation&language=en&limit=3' ), true); // GTools::okp($cat); $results = $foundCategories['_embedded']['results']; foreach ($results as $item) { $id = substr($item['uri'], strrpos($item['uri'], '/') + 1); $founded[] = [ 'id' => $id, 'name' => $item['title'], 'className' => $item['className'], ]; // break; } // GTools::okp($founded); // return; // break; } // GTools::okp($founded); // return; // $occupations = $query->get()->toArray(); foreach ($founded as $job) { if (!OccupationsToTypes::exists($job['id'], $type)) { OccupationsToTypes::add([ 'occupation' => $job['id'], 'mbtype' => $type, 'compatibility' => 100 ]); GTools::okp("Added " . $job['name'] . " to $type"); } else { GTools::okp($job['name'] . " already added to $type"); } } // $occupations = Occupations::getAll(); // foreach ($occupations as &$job) { // $job['rate'] = 0; // foreach ($typeCategories as $cat) { // i // } // } } public function getRelevantOccupations() { $query = DB::table(OccupationsToTypes::getTable()) ->leftJoin(Occupations::getTable(), Occupations::getTable() . '.id', OccupationsToTypes::getTable() . '.occupation') ->orderBy('mbtype') // ->orderBy('compatibility') ->inRandomOrder() ->get()->all(); // GTools::okp($query); $result = []; foreach ($query as $item) { $result[$item->mbtype][$item->id] = $item->name; } return $result; } public function parseJd() { $query = hQuery::fromFile('https://resources.workable.com/job-descriptions/'); // try { // GTools::okp($query); $list = $query->find('.section-list'); $allDescriptions = []; $start = 0; $index = 0; foreach ($list->find('ul li a') as $item) { if (++$index <= $start) { continue; } if ($index - $start > 1000) { break; } $html = $item->html(); $href = $item->attr('href'); $allDescriptions[$index]['title'] = $html; $allDescriptions[$index]['href'] = $href; if (strlen($href) > 0) { $jobQuery = hQuery::fromFile($href); $intro = $jobQuery->find('.intro')->html(); $intro = strip_tags($intro); $allDescriptions[$index]['intro'] = $intro; $fullDescription = $jobQuery->find('.article-container.tmpl'); // $allDescriptions[$index]['full'] = $fullDescription->html(); $catIndex = 0; $subcat = [ 'title' => 'The First subcategory', 'text' => '', 'list' => [], ]; foreach ($fullDescription->children() as $key => $child) { $tag = $child->nodeName; // GTools::okp($tag); // GTools::okp($child->html()); if ($tag == 'h2') { if ($subcat) { $allDescriptions[$index]['subcat'][] = $subcat; } $subcat = [ 'title' => $child->html(), 'text' => '', 'list' => [], ]; } elseif ($tag == 'p') { $subcat['text'] .= $child->html(); } elseif ($tag == 'ul') { // GTools::okp($subcat['title']); foreach ($child->find('li') as $li) { $subcat['list'][] = strip_tags($li->html()); } } } $allDescriptions[$index]['subcat'][] = $subcat; $id = $index; $jdFields = [ 'id' => $id, 'title' => $title = preg_replace('([ ]{2,}|[\t]+)', '', str_replace("\n", '', $html)), 'intro' => $intro, 'subcats' => json_encode($allDescriptions[$index]['subcat']), ]; // foreach ($allDescriptions[$index]['subcat'] as $subcat) { // $jdFields['text'] = "<h2>" . $subcat['title'] . "</h2>\n"; // if (!array_key_exists('text', $subcat) || mb_strlen($subcat['text']) > 3) { // $jdFields['text'] .= '<p>' . $subcat['text'] . '</p>' . "\n"; // } // if (!empty($subcat['list'])) { // $jdFields['text'] .= "<ul><li>" . implode("</li>\n<li>", $subcat['list']) . "</li></ul>\n"; // } // if (strpos(strtoupper($subcat['title']), 'REQUIREMENTS') !== false) { // foreach ($subcat['list'] as $item) { // $jds = [ // 'id' => $id, // 'skill' => $item // ]; // JdSkills::add($jds); // } // } // } JobDescription::add($jdFields); GTools::okp("Add jd #$id"); } } // GTools::okp(JobDescription::getAll()); // GTools::okp(JdSkills::getAll()); // GTools::okp($allDescriptions); // GTools::okp($list); // } catch (\Exception $e) { // GTools::okp($e->getMessage()); // } } public function makeSkillEscoMathcing() { $jobs = []; foreach (JobDescription::getAll() as $jd) { $jobs[$jd->id] = preg_replace('([ ]{2,}|[\t]+)', '', str_replace("\n", '', $jd->title)); } // GTools::okp($jobs); $escoSkills = []; $counter = 0; // echo '<style>td {border: 2px solid gray;}</style>'; // echo '<table cellpadding="5px">'; // echo '<tr><th>Job Description</th><th>Skill from JD</th><th>Esco Skills</th></tr>'; file_put_contents(base_path('/jd_skills.csv'), 'JD;Skill from JD;Esco Skills' . "\n"); foreach (JdSkills::getAll() as $skill) { $skillTitle = urlencode($skill->skill); if (strpos(strtolower($skillTitle), 'experience') !== false) { continue; } if (strpos(strtolower($skillTitle), 'degree') !== false) { continue; } if (strpos(strtolower($skillTitle), 'certification') !== false) { continue; } // echo '<tr>'; // echo '<td>' . $jobs[$skill->id] . '</td>'; // echo '<td>' . $skill->skill . '</td>'; file_put_contents(base_path('/jd_skills.csv'), $jobs[$skill->id] . ';' . $skill->skill . ';', FILE_APPEND); $searchResult = json_decode(file_get_contents("https://ec.europa.eu/esco/api/search?text=$skillTitle&language=en&type=skill", true)); // GTools::okp($searchResult); foreach ($searchResult->_embedded->results as $escoSkill) { $title = $escoSkill->title; // if (strpos(strtoupper($skillTitle), strtoupper($title)) !== false ) { // $title = '<span style="color: green;">' . $title . '</span>'; // } elseif (strpos(strtoupper($title), strtoupper($skillTitle)) !== false ) { // $title = '<span style="color: green;">' . $title . '</span>'; // } $escoSkills[$skillTitle][] = $title; } file_put_contents(base_path('/jd_skills.csv'), '" - ' . implode("\n - ", $escoSkills[$skillTitle]) . '"' . "\n", FILE_APPEND); // echo '<td><ul><li>' . implode('</li><li>', $escoSkills[$skillTitle]) . '</li></ul>'; // echo '</tr>'; if (++$counter > 100) break; } } public function makeJobOccupationMatching() { $jobs = []; $counter = 0; // file_put_contents(base_path('/jd_occupations.csv'), 'JD;First matched occupation;All matched Occupations' . "\n"); foreach (JobDescription::getAll() as $jd) { $title = preg_replace('([ ]{2,}|[\t]+)', '', str_replace("\n", '', $jd->title)); // JobDescription::update($jd->id, ['title' => $title]); $encodedTitle = urlencode($title); $searchResult = json_decode(file_get_contents("https://ec.europa.eu/esco/api/search?text=$encodedTitle&language=en&type=occupation", true)); // file_put_contents(base_path('/jd_occupations.csv'), '"' . "$title\";", FILE_APPEND); // GTools::okp($searchResult); $first = true; foreach ($searchResult->_embedded->results as $occupation) { // GTools::okp(str_replace('http://data.europa.eu/esco/occupation/', '', $occupation->uri)); // GTools::okp($occupation); die(); if ($first) { $first = false; JobDescription::update($jd->id, ['occupation_id' => str_replace('http://data.europa.eu/esco/occupation/', '', $occupation->uri)]); break; // file_put_contents(base_path('/jd_occupations.csv'), '"' . $occupation->title . "\";\"", FILE_APPEND); } // file_put_contents(base_path('/jd_occupations.csv'), '' . $occupation->title . ", ", FILE_APPEND); } // if (empty($searchResult->_embedded->results)) { // file_put_contents(base_path('/jd_occupations.csv'), ";\n", FILE_APPEND); // } else { // file_put_contents(base_path('/jd_occupations.csv'), "\"\n", FILE_APPEND); // } // if (++$counter >= 100) { // break; // } } } public function show() { $file = new \SplFileObject(base_path('resources/csv/jd-occ.csv')); $newMatching = []; while (!$file->eof()) { array_push($newMatching, $file->fgetcsv()); } GTools::okp($newMatching); foreach ($newMatching as $new) { if (array_key_exists(1, $new) && array_key_exists(0, $new)) { JobDescription::update($new[0], ['occupation_id' => $new[1]]); } } // $descriptions = DB::table(JobDescription::getTable())->whereNotNull('occupation_id'); // $descriptions = $descriptions->get(); // echo '<table border="1px" style="font-size: 22px;">'; // echo '<tr>'; // echo "<td>JD ID</td>"; // echo "<td>JD Title</td>"; // echo "<td>Occupation title</td>"; // echo "<td>Occupation ID</td>"; // echo '</tr>'; // $count = [ // 'green' => 0, // 'red' => 0, // 'orange' => 0, // ]; // foreach ($descriptions as &$jd) { // $jd->occupation = Occupations::getById($jd->occupation_id); // $newOccupation = false; // if (isset($newMatching[$jd->id])) { // $newOccupation = Occupations::getById($newMatching[$jd->id]); // } // $color = ''; // if (isset($newMatching[$jd->id])) { // $color = ' style="color: orange"'; // ++$count['orange']; // } elseif (strpos(strtoupper($jd->title), strtoupper($jd->occupation->name)) === false) { // $color = ' style="color: red"'; // ++$count['red']; // } else { // ++$count['green']; // } // $subcats = json_decode($jd->subcats); //// GTools::okp($subcats); // if (strpos($subcats[1]->text, '<img') !== false) { // $subcats[1] = $subcats[2]; // } // // echo "<tr$color>"; // echo "<td><a target='_blank' href='/jd/" . $jd->id . "'>" . $jd->id . "</a></td>"; // echo "<td>" . $jd->title . ($color ? '<br>' . $subcats[1]->text : '') . "</td>"; // echo "<td>" . $jd->occupation->name . (isset($newMatching[$jd->id]) && $newOccupation ? ' -> ' . $newOccupation->name : '') . ($color ? '<br>' . $jd->occupation->description : '') . "</td>"; // echo "<td><a target='_blank' href='http://data.europa.eu/esco/occupation/" . $jd->occupation->id . "'>" . $jd->occupation->id . "</a></td>"; // echo '</tr>'; // } // echo '</table>'; // GTools::okp($count); // $this->parseJd(); // $this->makeJobOccupationMatching(); // $skill = urlencode('Problem-solving skills'); // $searchResult = file_get_contents("https://ec.europa.eu/esco/api/search?text=$skill&language=en&type=skill"); // GTools::okp(json_decode($searchResult, true)); // GTools::okp(); // echo '</table>'; // GTools::okp($escoSkills); // Universities::add([ // 'id' => 'arden', // 'name' => 'Arden University', // 'logo' => '/static/img/university/arden.png' // ]); // // Universities::add([ // 'id' => 'lsbf', // 'name' => 'London School of Business & Finance', // 'logo' => '/static/img/university/lsbf.png' // ]); // die(); // $geoIp = geoip(); // if ($geoIp instanceof \Torann\GeoIP\GeoIP) { // GTools::okp($geoIp->getLocation()->toArray()); // } // GTools::okp(JobsToSkills::getAll()); // Universities::add([ // 'id' => 'brunel', // 'name' => 'Brunel University London', // 'logo' => '/static/img/university/brunel.png' // // ]); // Universities::add([ // 'id' => 'ulaw', // 'name' => 'The University of Law', // 'logo' => '/static/img/university/ulaw.png' // ]); // die(); // GTools::okp(JobsToSkills::getAll()); // die(); // Schema::dropIfExists('skills_to_courses'); // Schema::create('skills_to_courses', function (Blueprint $table) { // $table->string('skill_id'); // $table->string('course_id'); // }); // $file = new \SplFileObject(base_path('resources/csv/courses_2.csv')); // $coursesData = []; // while (!$file->eof()) { // array_push($coursesData, $file->fgetcsv()); // } // $count = 0; // foreach ($coursesData as $course) { // if (++$count == 1) // continue; // // $courseInfo = DB::table(Courses::getTable())->where('name', '=', $course['1'])->first(['id', 'name']); // $skillName = $course[0]; // $skillInfo = DB::table(Skills::getTable())->where('name', '=', $skillName)->first(['id', 'name']); // // if (!empty($skillInfo)) { // $universityInfo = DB::table(Universities::getTable())->where('name', '=', $course['2'])->first(['id', 'name']); // if (!empty($universityInfo)) { // if (empty($courseInfo)) { // Courses::add([ // 'id' => $count, // 'name' => $course['1'], // 'university' => $universityInfo->id, // 'price' => $course['3'], // 'link' => $course['4'] // ]); // $courseId = $count; // } else { // $courseId = $courseInfo->id; // } // // if (!SkillsToCourses::exists($courseId, $skillInfo->id)) { // SkillsToCourses::add([ // 'skill_id' => $skillInfo->id, // 'course_id' => $courseId // ]); // GTools::okp("Added {$skillInfo->id} to $courseId"); // } else { // GTools::okp($count . ". {$skillInfo->id} to $courseId already exists!"); // } // } else { // GTools::okp('Error with university'); // GTools::okp($course); // GTools::okp($universityInfo); // } // } else { //// GTools::okp('Error with course'); //// GTools::okp($course); //// GTools::okp($skillInfo); // echo $count . ". " . $skillName . " is not exist!<br/>"; // } //// GTools::okp($course); //// GTools::okp($skillInfo); // } // $file = new \SplFileObject(base_path('resources/csv/mbti_career_2.csv')); // $typeData = []; // while (!$file->eof()) { // array_push($typeData, $file->fgetcsv()); // } // unset($typeData[0]); // GTools::okp($typeData); // foreach ($typeData as $typeInfo) { // $cats = explode("\n", $typeInfo[1]); // GTools::okp($cats); // GTools::okp($typeInfo[0]); // $this->setRelevantOccupations($typeInfo[0], $cats); // } // $medium = 0; // foreach ($relevant = $this->getRelevantOccupations() as $item) { // $medium += count($item); // GTools::okp(count($item)); // GTools::okp($item); // }; // GTools::okp('Medium ' . $medium / count($relevant)); // Session::put('mbti_type', '123'); // Session::save(); // echo `whoami` . "<br/>"; // GTools::okp(Session::all()); die(); $file = new \SplFileObject(base_path('resources/csv/courses.csv')); $coursesData = []; while (!$file->eof()) { array_push($coursesData, $file->fgetcsv()); } $count = 0; foreach ($coursesData as $course) { if (++$count == 1) continue; $courseInfo = DB::table(Courses::getTable())->where('name', '=', $course['1'])->first(['id', 'name']); $skillName = $course[0]; $skillInfo = DB::table(Skills::getTable())->where('name', '=', $skillName)->first(['id', 'name']); if (!empty($skillInfo)) { $universityInfo = DB::table(Universities::getTable())->where('name', '=', $course['2'])->first(['id', 'name']); if (!empty($universityInfo)) { if (empty($courseInfo)) { Courses::add([ 'id' => $count, 'name' => $course['1'], 'university' => $universityInfo->id, 'price' => $course['3'], 'link' => $course['4'] ]); $courseId = $count; } else { $courseId = $courseInfo->id; } SkillsToCourses::add([ 'skill_id' => $skillInfo->id, 'course_id' => $courseId ]); } else { GTools::okp('Error with university'); GTools::okp($course); GTools::okp($universityInfo); } } else { GTools::okp('Error with course'); GTools::okp($course); GTools::okp($skillInfo); } // GTools::okp($course); // GTools::okp($skillInfo); } // GTools::okp($courses); // Courses::add([ // 'id' => 1, // 'name' => 'Global MBA', // 'university' => 'Arden', // 'price' => '£9,000', // 'link' => 'https://www.edology.com/online-courses/masters/global-mba/' // ]); // SkillsToCourses::add([ // 'skill_id' => '3220a66f-d129-463b-848e-891b4f1c79e3', // 'course_id' => '1', // ]); // GTools::okp('Courses: ' . Courses::count()); // GTools::okp(Courses::getAll()); // GTools::okp('SkillsToCourses: ' . SkillsToCourses::count()); // GTools::okp(SkillsToCourses::getAll()); // $file = new \SplFileObject(base_path('resources/csv/occupations_en.csv')); // $data = []; // while (!$file->eof()) { // array_push($data, $file->fgetcsv()); // } //// GTools::okp($data); // $res = ''; // $count = 0; // $occupations = []; // foreach ($data as $index => $row) { // if (++$count == 1) // continue; // if ($count > 15) break; // $id = substr($row[1], strrpos($row[1], '/') + 1); // $currentOccupation = Occupations::getById($id); // if (!empty($currentOccupation)) { // GTools::okp('Occupation ' . $id . ' already exists!'); // } else { // $occupationDetails = json_decode(file_get_contents("http://ec.europa.eu/esco/api/resource/occupation?uri=http://data.europa.eu/esco/occupation/$id" . '&language=en'), true); // $description = $occupationDetails['description']['en']['literal']; // $skills = $occupationDetails['_links']['hasEssentialSkill']; // foreach ($skills as $skillInfo) { // $skillId = substr($skillInfo['uri'], strrpos($skillInfo['uri'], '/') + 1); // $currentSkill = Skills::getById($skillId); // if (!empty($currentSkill)) { // GTools::okp('Sklll ' . $skillId . ' already exists!'); // } else { // $skillDetails = json_decode(file_get_contents($skillInfo['href']), true); // $skillDescription = $skillDetails['description']['en']['literal']; // $skillFields = [ // 'id' => $skillId, // 'name' => $skillInfo['title'], // 'description' => $skillDescription, // 'type' => !empty($skillDetails['hasSkillType']) ? $skillDetails['hasSkillType'][0]['title'] : '', // ]; // Skills::add($skillFields); // } // if (!OccupationsToSkills::exists($id, $skillId)) { // OccupationsToSkills::add([ // 'occupation_id' => $id, // 'skill_id' => $skillId // ]); // } // } // $occupations = [ // 'id' => $id, // 'name' => $row[3], // 'description' => $description, // ]; //// GTools::okp($skills); // Occupations::add($occupations); // } //// GTools::okp($occupations); // } GTools::okp("Occupations:" . Jobs::count()); GTools::okp("Skills:" . Skills::count()); GTools::okp("OccupationsToSkills:" . OccupationsToSkills::count()); return view('oktest', ['res' => '']); } } <?php namespace App\Http\Controllers; use App\Database\Occupations; use App\GTools; use App\Http\Controllers\Controller; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class IndexController extends Controller { public function show(Request $request) { $numbers = [ 'skills' => Skills::count(), 'occupations' => Occupations::count(), 'occupationsToSkills' => OccupationsToSkills::count(), ]; $requestInput = $request->input(); if (array_key_exists('selectedSkills', $requestInput)) { $selectedSkills = $requestInput['selectedSkills']; $skillList = DB::table(Skills::getTable()) ->whereIn('id', $selectedSkills) ->orderBy('name') ->get()->all(); } elseif (Auth::check()) { $skillSet = DB::table('users')->where('id', '=', Auth::id())->first(['skill_set'])->skill_set; $skillSet = json_decode($skillSet); if (!empty($skillSet)) { $skillList = DB::table(Skills::getTable()) ->whereIn('id', $skillSet) ->orderBy('name') ->get()->all(); } else { $skillList = []; } } else { $skillList = []; } return view('index', ['res' => '', 'numbers' => $numbers, 'selected' => $skillList]); } } <?php namespace App\Http\Controllers\Ajax; use App\Database\Courses; use App\Database\SkillsToCourses; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Occupations; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RelevantOccupations extends Controller { function distance($skillSetFirst, $skillSetSecond) { $common = count(array_intersect($skillSetFirst, $skillSetSecond)); $firstUniq = count($skillSetFirst) - $common; $secondUniq = count($skillSetSecond) - $common; $distance = $common / ($firstUniq + $common + $secondUniq); return round($distance * 100, 1); } public static function compareByDistanceDesc($first, $second){ return ($first['distance'] < $second['distance']); } public function show(Request $request) { $occupations = []; $requestInput = $request->input(); if (array_key_exists('selected', $requestInput)) { $selected = $requestInput['selected']; if (Auth::check()) { DB::table('users')->where('id', '=', Auth::id())->update(['skill_set' => json_encode($selected)]); } if (array_key_exists('save_only', $requestInput)) { return ''; } // GTools::okp($selected); $probableOccupations = DB::table(OccupationsToSkills::getTable()) ->whereIn('skill_id', $selected) ->orderBy('occupation_id', 'asc') ->get()->all(); $usefulOccupations = []; foreach ($probableOccupations as $item) { $usefulOccupations[$item->occupation_id] = $item->occupation_id; } $occupationsToSkills = DB::table(Occupations::getTable()) ->leftJoin(OccupationsToSkills::getTable(), Occupations::getTable() . '.id', '=', OccupationsToSkills::getTable() . '.occupation_id') ->select([Occupations::getTable() . '.*', OccupationsToSkills::getTable() . '.skill_id']) ->orderBy('id', 'asc') ->whereIn('occupation_id', $usefulOccupations) ->get()->all(); $occupations = []; foreach ($occupationsToSkills as $item) { $title = $item->name; $title = strtoupper(substr($title, 0, 1)) . substr($title, 1); $occupations[$item->id]['id'] = $item->id; $occupations[$item->id]['name'] = $title; $occupations[$item->id]['description'] = $item->description; if (strlen($occupations[$item->id]['description']) > 190) { $occupations[$item->id]['short_description'] = substr($item->description, 0, 187) . '...'; } $occupations[$item->id]['skills'][] = $item->skill_id; $occupations[$item->id]['recommendationLink'] = '/recommendations?' . http_build_query([ 'occupation' => $item->id, 'selected' => $selected ]); } foreach ($occupations as &$item) { $item['distance'] = $this->distance($item['skills'], $selected); } uasort($occupations, 'App\Http\Controllers\Ajax\RelevantOccupations::compareByDistanceDesc'); $occupations = array_slice($occupations, 0, 3); foreach ($occupations as &$item) { // GTools::okp($item['distance']); if ($item['distance'] < 50) { $item['color'] = 'red'; } elseif ($item['distance'] < 80) { $item['color'] = 'yellow'; } else { $item['color'] = 'green'; } $skillsData = DB::table(Skills::getTable()) ->whereIn('id', $item['skills']) ->get(['id', 'name', 'description'])->all(); $allSkills = []; foreach ($skillsData as $skill) { $skill->fullname = $skill->name; if (strlen($skill->name) > 20) { $skill->name = substr($skill->name, 0, 17) . '...'; } $allSkills[$skill->id] = $skill; } // GTools::okp($skillsData); $missedSkills = []; foreach ($item['skills'] as $skill) { if (in_array($skill, $selected)) { $item['sameSkills'][$skill] = $allSkills[$skill]; } else { $item['missingSkills'][$skill] = $allSkills[$skill]; $missedSkills[] = $skill; } } $visibleSkillCount = 6; if (!isset($item['missingSkills'])) { $item['missingSkills'] = []; } if (count($item['missingSkills']) < $visibleSkillCount) { if (!empty($item['sameSkills'])) { $item['sameSkills'] = array_slice($item['sameSkills'], 0, $visibleSkillCount - count($item['missingSkills'])); } } else { $item['missingSkills'] = array_slice($item['missingSkills'], 0, $visibleSkillCount); $item['sameSkills'] = []; } $skillsToCourses = DB::table(SkillsToCourses::getTable()) ->whereIn('skill_id', $missedSkills) ->whereNotIn('skill_id', $selected) ->get()->all(); // GTools::okp($skillsToCourses); $item['hasRecommendations'] = !empty($skillsToCourses); } // GTools::okp($occupations); } else { return ''; } $res = []; return view('occupations', ['occupations' => $occupations]); } } <?php namespace App\Http\Controllers\Ajax; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RelevantSkills extends Controller { public function show(Request $request) { $topCount = 5; $requestInput = $request->input(); $input = htmlspecialchars($requestInput['input']); $baseQuery = DB::table(Skills::getTable())->orderBy('name'); if (array_key_exists('selectedSkills', $requestInput)) { $selectedSkills = $requestInput['selectedSkills']; $baseQuery->whereNotIn('id', $selectedSkills); } $firstQuery = clone $baseQuery; $skillList = $firstQuery->where('name', 'like', $input . '%')->limit($topCount)->get()->all(); if (count($skillList) < $topCount) { $secondQuery = clone $baseQuery; if (!empty($skillList)) { $alreadySelected = []; foreach ($skillList as $skill) { $alreadySelected[] = $skill->id; } $secondQuery->whereNotIn('id', $alreadySelected); } $secondQuery ->where('name', 'like', '%' . $input . '%') ->limit($topCount - count($skillList)); $secondList = $secondQuery->get()->all(); foreach ($secondList as $skill) { $skillList[] = $skill; } } if (count($skillList) < $topCount) { $thirdQuery = clone $baseQuery; if (!empty($skillList)) { $alreadySelected = []; foreach ($skillList as $skill) { $alreadySelected[] = $skill->id; } $thirdQuery->whereNotIn('id', $alreadySelected); } $thirdList = $thirdQuery ->where('description', 'like', '%' . $input . '%') ->orderBy('name') ->limit($topCount - count($skillList)) ->get()->all(); foreach ($thirdList as $skill) { $skillList[] = $skill; } } return view('skills', ['res' => $skillList]); } } <?php namespace App\Http\Controllers\Ajax; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Skills; use App\User; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PHPUnit\Framework\Warning; class ProceedTest extends Controller { public function show(Request $request) { $firstQuestionNumber = 1; $lastQuestionNumber = 94; $requestInput = $request->post(); // GTools::okp($requestInput); $testResults = $requestInput['answer']; for ($qnumber = $firstQuestionNumber; $qnumber <= $lastQuestionNumber; ++$qnumber) { if (!isset($testResults[$qnumber])) { $unfilledQuestions[] = $qnumber; } } if (!empty($unfilledQuestions)) { $res = json_encode([ 'success' => 'false', 'error' => 'Questions #' . implode(', ', $unfilledQuestions) . ' aren\'t answered yet', 'first' => current($unfilledQuestions) ]); } else { $isMale = isset($requestInput['sex']) && $requestInput['sex'] == 'm'; $file = new \SplFileObject(base_path('resources/csv/poll_method.csv')); $data = []; while (!$file->eof()) { array_push($data, $file->fgetcsv()); } $method = []; foreach ($data as $row) { if (isset($row[2]) && strlen($row[2]) > 0) { $type = $row[2]; $value = $row[3]; if (!$isMale && $row[4] > 0) { $value = $row[4]; } $method[$row[0]][$row[1]] = [ 'type' => $type, 'value' => $value ]; } } $results = []; foreach ($testResults as $index => $value) { $type = $method[$index][$value]['type']; if (!isset($results[$type])) { $results[$type] = 0; } $results[$type] += $method[$index][$value]['value']; } $personalityType = ''; foreach ([['E', 'I'], ['S', 'N'], ['T', 'F'], ['J', 'P']] as $pairTypes) { if ($results[$pairTypes[0]] >= $results[$pairTypes[1]]) { $personalityType .= $pairTypes[0]; } else { $personalityType .= $pairTypes[1]; } } if (Auth::check()) { DB::table('users')->where('id', '=', Auth::id())->update(['mbti' => $personalityType]); } // $res = 'Your personality type is ' . $personalityType . "<br/>"; // $res .= '<pre>' . print_r($results, true) . '</pre>'; $res = json_encode(['mbti' => $personalityType, 'success' => true]); } return view('oktest', ['res' => $res]); $input = htmlspecialchars($requestInput['input']); if (array_key_exists('selectedSkills', $requestInput)) { $selectedSkills = $requestInput['selectedSkills']; $skillList = DB::table(Skills::getTable()) ->where(function ($query) use ($input) { $query->where('description', 'like', '%' . $input . '%'); $query->orWhere('name', 'like', '%' . $input . '%'); }) ->whereNotIn('id', $selectedSkills) ->orderBy('name') ->limit('5')->get()->all(); } else { $skillList = DB::table(Skills::getTable()) ->orWhere('description', 'like', '%' . $input . '%') ->orWhere('name', 'like', '%' . $input . '%') ->orderBy('name') ->limit('5')->get()->all(); } return view('skills', ['res' => $skillList]); } } <?php namespace App\Http\Controllers\Ajax; use App\Database\Occupations; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RelevantNews extends Controller { public function show(Request $request) { $topCount = 7; $requestInput = $request->input(); $page = $requestInput['page']; $occupation = $requestInput['occupation']; $title = Occupations::getById($occupation)->name; if (!$title) { $result = []; } else { $news = json_decode(file_get_contents('https://newsapi.org/v2/everything?language=en&q=' . urlencode($title) . '&apiKey=ad45714c41a445b0844ad9697ec18ffd&pageSize=7&page=' . $page)); // GTools::okp($news); if (empty($news->articles)) { $result = []; } else { $result = $news->articles; } } return view('relevant_news', ['result' => $result]); } } <?php namespace App\Http\Controllers\Ajax; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Skills; use App\User; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PHPUnit\Framework\Warning; class ProceedRavenTest extends Controller { public function show(Request $request) { $rightAnswers = [ 0, 4, 5, 1, 2, 6, 3, 6, 2, 1, 3, 4, 5, 2, 6, 1, 2, 1, 3, 5, 6, 4, 3, 4, 5, 8, 2, 3, 8, 7, 4, 5, 1, 7, 6, 1, 2, 3, 4, 3, 7, 8, 6, 5, 4, 1, 2, 5 ,6, 7, 6, 8, 2, 1, 5, 1, 6, 3, 2, 4, 5, ]; $requestInput = $request->post(); // $age = $requestInput['age']; $answers = $requestInput['answers']; $correctAnswers = 0; for ($index = 1; $index <= 60; ++$index) { if ($answers[$index] == $rightAnswers[$index]) { ++$correctAnswers; } } $iqPercent = round($correctAnswers * 100 / 60, 2); $res = json_encode(['raven' => $iqPercent, 'success' => true]); DB::table('users')->where('id', '=', Auth::id())->update(['raven' => $iqPercent]); return view('oktest', ['res' => $res]); } } <?php namespace App\Http\Controllers\Ajax; use App\Database\JobDescription; use App\Database\Occupations; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RelevantJobDescriptions extends Controller { public function show(Request $request) { $descriptions = DB::table(JobDescription::getTable())->whereNotNull('occupation_id')->whereRaw('LENGTH(occupation_id) > 5'); $search = $request->get('search'); if (mb_strlen($search) > 0) { $search = htmlspecialchars($search); $descriptions->where(function ($query) use ($search) { $query->where('title', 'like', '%' . $search . '%'); $query->orWhere('intro', 'like', '%' . $search . '%'); }); } $descriptions = $descriptions->get(); foreach ($descriptions as &$jd) { $jd->occupation = Occupations::getById($jd->occupation_id); } // GTools::okp($descriptions); return view('job_descriptions', ['res' => $descriptions]); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Occupations; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RecommendationsController extends Controller { public function show(Request $request) { $requestInput = $request->input(); if (array_key_exists('selected', $requestInput)) { $selectedSkills = $requestInput['selected']; $skillList = DB::table(Skills::getTable()) ->whereIn('id', $selectedSkills) ->orderBy('name') ->get()->all(); } else { $selectedSkills = []; $skillList = []; } $occupationId = htmlspecialchars($requestInput['occupation']); $occupationsToSkills = DB::table(OccupationsToSkills::getTable()) ->where('occupation_id', '=', $occupationId) ->whereNotIn('skill_id', $selectedSkills) ->get()->all(); $missedSkills = []; foreach ($occupationsToSkills as $item) { $missedSkills[] = $item->skill_id; } // GTools::okp($skillList); // GTools::okp($missedSkills); // GTools::okp($occupationId); if (!empty($missedSkills)) { $missedSkillList = DB::table(Skills::getTable()) ->whereIn('id', $missedSkills) ->orderBy('name') ->get()->all(); // GTools::okp($missedSkillList); $missedSkillsIds = []; $missedSkillsInfo = []; foreach ($missedSkillList as $skill) { $missedSkillsIds[] = $skill->id; $missedSkillsInfo[$skill->id] = $skill; } $skillsToCourses = DB::table(SkillsToCourses::getTable()) ->whereIn('skill_id', $missedSkillsIds) ->get()->all(); if (!empty($skillsToCourses)) { $selectedCourses = []; foreach ($skillsToCourses as $info) { $selectedCourses[] = $info->course_id; } // GTools::okp($selectedCourses); $recommendedCourses = DB::table(Courses::getTable()) ->leftJoin(Universities::getTable(), Universities::getTable() . '.id', '=', Courses::getTable() . '.university') ->whereIn(Courses::getTable() . '.id', $selectedCourses) ->get([ Courses::getTable() . '.*', Universities::getTable() . '.name as university_name', Universities::getTable() . '.logo as university_logo' ])->all(); // GTools::okp($recommendedCourses); // GTools::okp(Courses::getAll()); foreach ($recommendedCourses as &$course) { $obtainedSkills = DB::table(SkillsToCourses::getTable()) ->where('course_id', '=', $course->id) ->whereIn('skill_id', $missedSkillsIds) ->get()->all(); // GTools::okp($obtainedSkills); $course->obtainedSkills = []; foreach ($obtainedSkills as $skill) { $course->obtainedSkills[$skill->skill_id] = $missedSkillsInfo[$skill->skill_id]; } } } else { $recommendedCourses = []; } } else { $missedSkillList = []; $recommendedCourses = []; } $back = '/?' . http_build_query([ 'selectedSkills' => $selectedSkills ]); return view('recommendations', [ 'back' => $back, 'selected' => $skillList, 'missedSkills' => $missedSkillList, 'recommended' => $recommendedCourses] ); } public function static() { return view('recommendations_static', []); } } <?php namespace App\Http\Controllers; use App\Database\Dataatwork\Jobs; use App\Database\Dataatwork\JobsToSkills; use App\Database\Dataatwork\Skills; use App\GTools; use App\Http\Controllers\Controller; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class IndexControllerNew extends Controller { public function show(Request $request) { $numbers = [ 'skills' => Skills::count(), 'occupations' => Jobs::count(), 'occupationsToSkills' => JobsToSkills::count(), ]; $requestInput = $request->input(); if (array_key_exists('selectedSkills', $requestInput)) { $selectedSkills = $requestInput['selectedSkills']; $skillList = DB::table(Skills::getTable()) ->whereIn('id', $selectedSkills) ->orderBy('name') ->get()->all(); } else { $skillList = []; } return view('index', ['res' => '', 'numbers' => $numbers, 'selected' => $skillList]); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class TestController extends Controller { public static function refineString($string) { $result = substr($string, 1); if (($realEnd = strpos($result, ';')) !== false) { $result = substr($result, 0, $realEnd); } return $result; } public function show() { $text = '1. Обычно Вы: а) общительны; б) довольно сдержанны и спокойны. 2. Если бы Вы были преподавателем, какой курс Вы бы предпочли: а) построенный на изложении фактов; б) включающий в себя изложение теорий. 3. Вы чаще позволяете: а) своему сердцу управлять разумом; б) своему разуму управлять сердцем. 4. Когда Вы отправляетесь куда-то на весь день, Вы: а) планируете, что и когда будете делать; б) уходите без определенного плана. 5. Находясь в компании, Вы обычно: а) присоединяетесь к общему разговору; б) беседуете время от времени с кем-то одним. 6. Вам легче поладить с людьми: а) имеющими богатое воображение; б) реалистичными. 7. Более высокой похвалой Вы считаете слова: а) душевный человек; б) последовательно рассуждающий человек. 8. Вы предпочитаете: а) заранее договариваться о встречах, вечеринках и т.п.; б) иметь возможность в последний момент решать, как развлечься. 9. В большой компании чаще: а) Вы представляете людей друг другу; б) Вас знакомят с другими. 10. Вас скорее можно назвать: а) человеком практичным; б) выдумщиком. 11. Обычно Вы: а) цените чувства больше, чем логику; б) цените логику больше, чем чувства. 12. Вы чаще добиваетесь успеха: а) действуя в непредсказуемой ситуации, когда нужно быстро принимать решения; б) следуя тщательно разработанному плану. 13. Вы предпочитаете: а) иметь несколько близких, верных друзей; б) иметь дружеские связи с самыми разными людьми. 14. Вам больше нравятся люди, которые: а) следуют общепринятым нормам и не привлекают к себе внимания; б) настолько оригинальны, что им все равно, обращают на них внимание или нет. 15. На Ваш взгляд самый большой недостаток – быть: а) бесчувственным; б) неблагоразумным. 16. Следование какому-либо расписанию: а) привлекает Вас; б) сковывает Вас. 17. Среди своих друзей Вы: а) позже других узнаете о событиях в их жизни; б) обычно знаете массу новостей о них. 18. Вы бы предпочли иметь среди своих друзей человека, который: а) всегда полон новых идей; б) трезво и реалистично смотрит на мир. 19. Вы предпочли бы работать под началом человека, который: а) всегда добр; б) всегда справедлив. 20. Мысль о том, чтобы составить список дел на выходные: а) Вас привлекает; б) оставляет Вас равнодушным; в) угнетает Вас. 21. Вы обычно: а) можете легко разговаривать практически с любым человеком в течение любого времени; б) можете найти тему для разговора только с немногими людьми и только в определенных ситуациях. 22. Когда Вы читаете для своего удовольствия, Вам нравится: а) необычная, оригинальная манера изложения; б) когда писатели четко выражают свои мысли. 23. Вы считаете, что более серьезный недостаток: а) быть слишком сердечным; б) быть недостаточно сердечным. 24. В своей повседневной работе: а) Вам больше нравятся критические ситуации, когда Вам приходится работать в условиях дефицита времени; б) ненавидите работать в жестких временных рамках; в) обычно планируете свою работу так, чтобы Вам хватило времени. 25. Люди могут определить область Ваших интересов: а) при первом знакомстве с Вами; б) лишь тогда, когда узнают Вас поближе. 26. Выполняя ту же работу, что и многие другие люди, Вы предпочитаете: а) делать это традиционным способом; б) изобретать свой собственный способ. 27. Вас больше волнуют: а) чувства людей; б) их права. 28. Когда Вам нужно выполнить определенную работу, Вы обычно: а) тщательно организовываете все перед началом работы; б) предпочитаете выяснять все необходимое в процессе работы. 29. Обычно Вы: а) свободно выражаете свои чувства; б) держите свои чувства при себе. 30. Вы предпочитаете: а) быть оригинальным; б) следовать общепринятым нормам. 31. Какое слово из пары (А или Б) Вам больше нравится: а) кроткий; б) настойчивый. 32. Когда Вам необходимо что-то сделать в определенное время, Вы считаете, что: а) лучше планировать все заранее; б) несколько неприятно быть связанным этими планами. 33. Можно сказать, что Вы: а) более восторженны по сравнению с другими людьми; б) менее восторженны, чем большинство людей. 34. Более высокой похвалой человеку будет признание: а) его способности к предвидению; б) его здравого смысла. 35. Какое слово из пары (А или Б) Вам больше нравится: а) мысли; б) чувства. 36. Обычно: а) Вы предпочитаете все делать в последнюю минуту; б) для Вас откладывать все до последней минуты – это слишком большая нервотрепка. 37. На вечеринках Вам: а) иногда становится скучно; б) всегда весело. 38. Вы считаете, что более важно: а) видеть различные возможности в какой-либо ситуации; б) воспринимать факты такими, какие они есть. 39. Какое слово из пары (А или Б) Вам больше нравится: а) убедительный; б) трогательный. 40. Считаете ли Вы, что наличие стабильного повседневного распорядка: а) очень удобно для выполнения многих дел; б) тягостно, даже когда это необходимо. 41. Когда что-то входит в моду, Вы обычно: а) одним из первых испробуете это; б) мало этим интересуетесь. 42. Вы скорее: а) придерживаетесь общепринятых методов в работе; б) ищете, что еще неверно, и беретесь за неразрешенные проблемы. 43. Какое слово из пары (А или Б) Вам больше нравится: а) анализировать; б) сопереживать. 44. Когда Вы думаете о том, что надо сделать какое-то не очень важное дело или купить какую-то мелкую вещь, Вы: а) часто забываете об этом и вспоминаете слишком поздно; б) записываете это на бумаге, чтобы не забыть; в) всегда выполняете это без дополнительных напоминаний. 45. Узнать, что Вы за человек: а) довольно легко; б) довольно трудно. 46. Какое слово из пары (А или Б) Вам больше нравится: а) факты; б) идеи. 47. Какое слово из пары (А или Б) Вам больше нравится: а) справедливость; б) сочувствие. 48. Вам труднее приспособиться: а) к однообразию; б) к постоянным переменам. 49. Оказавшись в затруднительной ситуации, Вы обычно: а) переводите разговор на другое; б) обращаете все в шутку; в) спустя несколько дней думаете, что Вам следовало сказать. 50. Какое слово из пары (А или Б) Вам больше нравится: а) утверждение; б) идея. 51. Какое слово из пары (А или Б) Вам больше нравится: а) сочувствие; б) расчетливость. 52. Когда Вы начинаете какое-то большое дело, которое займет у Вас неделю, Вы: а) составляете сначала список того, что нужно сделать и в каком порядке; б) сразу беретесь за работу. 53. Вы считаете, что Вашим близким известны Ваши мысли: а) достаточно хорошо; б) лишь тогда, когда Вы намеренно сообщаете о них. 54. Какое слово из пары (А или Б) Вам больше нравится: а) теория; б) факт. 55. Какое слово из пары (А или Б) Вам больше нравится: а) выгода; б) благодеяние. 56. Выполняя какую-либо работу, Вы обычно: а) планируете работу таким образом, чтобы закончить с запасом времени; б) в последний момент работаете с наивысшей производительностью. 57. Будучи на вечеринке, Вы предпочитаете: а) активно участвовать в развитии событий; б) предоставляете другим развлекаться, как им хочется. 58. Какое слово из пары (А или Б) Вам больше нравится: а) буквальный; б) фигуральный. 59. Какое слово из пары (А или Б) Вам больше нравится: а) решительный; б) преданный. 60. Если в выходной утром Вас спросят, что Вы собираетесь сделать в течение дня, Вы: а) сможете довольно точно ответить; б) перечислите вдвое больше дел, чем сможете сделать; в) предпочтете не загадывать заранее. 61. Какое слово из пары (А или Б) Вам больше нравится: а) энергичный; б) спокойный. 62. Какое слово из пары (А или Б) Вам больше нравится: а) образный; б) прозаичный. 63. Какое слово из пары (А или Б) Вам больше нравится: а) неуступчивый; б) добросердечный. 64. Однообразие повседневных дел кажется Вам: а) спокойным; б) утомительным. 65. Какое слово из пары (А или Б) Вам больше нравится: а) сдержанный; б) разговорчивый. 66. Какое слово из пары (А или Б) Вам больше нравится: а) производить; б) создавать. 67. Какое слово из пары (А или Б) Вам больше нравится: а) миротворец; б) судья. 68. Какое слово из пары (А или Б) Вам больше нравится: а) запланированный; б) внеплановый. 69. Какое слово из пары (А или Б) Вам больше нравится: а) спокойный; б) оживленный. 70. Какое слово из пары (А или Б) Вам больше нравится: а) благоразумный; б) очаровательный. 71. Какое слово из пары (А или Б) Вам больше нравится: а) мягкий; б) твердый. 72. Какое слово из пары (А или Б) Вам больше нравится: а) методичный; б) спонтанный. 73. Какое слово из пары (А или Б) Вам больше нравится: а) говорить; б) писать. 74. Какое слово из пары (А или Б) Вам больше нравится: а) производство; б) планирование. 75. Какое слово из пары (А или Б) Вам больше нравится: а) прощать; б) дозволять. 76. Какое слово из пары (А или Б) Вам больше нравится: а) систематический; б) случайный. 77. Какое слово из пары (А или Б) Вам больше нравится: а) общительный; б) замкнутый. 78. Какое слово из пары (А или Б) Вам больше нравится: а) конкретный; б) абстрактный. 79. Какое слово из пары (А или Б) Вам больше нравится: а) кто; б) что. 80. Какое слово из пары (А или Б) Вам больше нравится: а) импульс; б) решение. 81. Какое слово из пары (А или Б) Вам больше нравится: а) вечеринка; б) театр. 82. Какое слово из пары (А или Б) Вам больше нравится: а) сооружать; б) изобретать. 83. Какое слово из пары (А или Б) Вам больше нравится: а) некритичный; б) критичный. 84. Какое слово из пары (А или Б) Вам больше нравится: а) пунктуальный; б) свободный. 85. Какое слово из пары (А или Б) Вам больше нравится: а) основание; б) вершина. 86. Какое слово из пары (А или Б) Вам больше нравится: а) осторожный; б) доверчивый. 87. Какое слово из пары (А или Б) Вам больше нравится: а) переменчивый; б) неизменный. 88. Какое слово из пары (А или Б) Вам больше нравится: а) теория; б) практика. 89. Какое слово из пары (А или Б) Вам больше нравится: а) соглашаться; б) дискутировать. 90. Какое слово из пары (А или Б) Вам больше нравится: а) дисциплинированный; б) беспечный. 91. Какое слово из пары (А или Б) Вам больше нравится: а) знак; б) символ. 92. Какое слово из пары (А или Б) Вам больше нравится: а) стремительный; б) тщательный. 93. Какое слово из пары (А или Б) Вам больше нравится: а) принимать; б) изменять. 94. Какое слово из пары (А или Б) Вам больше нравится: а) известный; б) неизвестный.'; $arr = explode("\n", $text); $oddString = false; $result = []; $questionId = 0; foreach ($arr as $string) { if ($oddString) { $stringAnswers = explode(')', $string); $result[$questionId]['answers']['1'] = self::refineString($stringAnswers[1]); $result[$questionId]['answers']['2'] = self::refineString($stringAnswers[2]); isset($stringAnswers[3]) ? $result[$questionId]['answers']['3'] = self::refineString($stringAnswers[3]) : ''; } else { ++$questionId; $result[$questionId]['question'] = $string; } $oddString = !$oddString; } return view('test', ['testQuestions' => $result]); } public function info() { return view('test_info', []); } } <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function index() { // $testLink = '/tests/mbti'; // if (Auth::check()) { // $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; // if (strlen($mbtiType) > 0) { // $testLink .= '/result'; // } // } $company = DB::table('users')->where('id', '=', Auth::id())->first(['company'])->company; if ($company) { return redirect('/profile'); } return view('home', []); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\Occupations; use App\Database\OccupationsToTypes; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class TestResultController extends Controller { private $typeInfo = [ 'INFP' => [ 'name' => 'The Healer', 'description' => 'INFPs are imaginative idealists, guided by their own core values and beliefs. To a Healer, possibilities are paramount; the reality of the moment is only of passing concern. They see potential for a better future, and pursue truth and meaning with their own flair.', ], 'INTJ' => [ 'name' => 'The Mastermind', 'description' => 'INTJs are analytical problem-solvers, eager to improve systems and processes with their innovative ideas. They have a talent for seeing possibilities for improvement, whether at work, at home, or in themselves.', ], 'INFJ' => [ 'name' => 'The Counselor', 'description' => 'INFJs are creative nurturers with a strong sense of personal integrity and a drive to help others realize their potential. Creative and dedicated, they have a talent for helping others with original solutions to their personal challenges.', ], 'INTP' => [ 'name' => 'The Architect', 'description' => 'INTPs are philosophical innovators, fascinated by logical analysis, systems, and design. They are preoccupied with theory, and search for the universal law behind everything they see. They want to understand the unifying themes of life, in all their complexity.', ], 'ENFP' => [ 'name' => 'The Champion', 'description' => 'ENFPs are people-centered creators with a focus on possibilities and a contagious enthusiasm for new ideas, people and activities. Energetic, warm, and passionate, ENFPs love to help other people explore their creative potential.', ], 'ENTJ' => [ 'name' => 'The Commander', 'description' => 'ENTJs are strategic leaders, motivated to organize change. They are quick to see inefficiency and conceptualize new solutions, and enjoy developing long-range plans to accomplish their vision. They excel at logical reasoning and are usually articulate and quick-witted.', ], 'ENTP' => [ 'name' => 'The Visionary', 'description' => 'ENTPs are inspired innovators, motivated to find new solutions to intellectually challenging problems. They are curious and clever, and seek to comprehend the people, systems, and principles that surround them.', ], 'ENFJ' => [ 'name' => 'The Teacher', 'description' => 'ENFJs are idealist organizers, driven to implement their vision of what is best for humanity. They often act as catalysts for human growth because of their ability to see potential in other people and their charisma in persuading others to their ideas.', ], 'ISFJ' => [ 'name' => 'The Protector', 'description' => 'ISFJs are industrious caretakers, loyal to traditions and organizations. They are practical, compassionate, and caring, and are motivated to provide for others and protect them from the perils of life.', ], 'ISFP' => [ 'name' => 'The Composer', 'description' => 'ISFPs are gentle caretakers who live in the present moment and enjoy their surroundings with cheerful, low-key enthusiasm. They are flexible and spontaneous, and like to go with the flow to enjoy what life has to offer.', ], 'ISTJ' => [ 'name' => 'The Inspector', 'description' => 'ISTJs are responsible organizers, driven to create and enforce order within systems and institutions. They are neat and orderly, inside and out, and tend to have a procedure for everything they do.', ], 'ISTP' => [ 'name' => 'The Craftsperson', 'description' => 'ISTPs are observant artisans with an understanding of mechanics and an interest in troubleshooting. They approach their environments with a flexible logic, looking for practical solutions to the problems at hand.', ], 'ESFJ' => [ 'name' => 'The Provider', 'description' => 'ESFJs are conscientious helpers, sensitive to the needs of others and energetically dedicated to their responsibilities. They are highly attuned to their emotional environment and attentive to both the feelings of others and the perception others have of them.', ], 'ESFP' => [ 'name' => 'The Performer', 'description' => 'ESFPs are vivacious entertainers who charm and engage those around them. They are spontaneous, energetic, and fun-loving, and take pleasure in the things around them: food, clothes, nature, animals, and especially people.', ], 'ESTJ' => [ 'name' => 'The Supervisor', 'description' => 'ESTJs are hardworking traditionalists, eager to take charge in organizing projects and people. Orderly, rule-abiding, and conscientious, ESTJs like to get things done, and tend to go about projects in a systematic, methodical way.', ], 'ESTP' => [ 'name' => 'The Dynamo', 'description' => 'ESTPs are energetic thrillseekers who are at their best when putting out fires, whether literal or metaphorical. They bring a sense of dynamic energy to their interactions with others and the world around them.', ], ]; public static function refineString($string) { $result = substr($string, 1); if (($realEnd = strpos($result, ';')) !== false) { $result = substr($result, 0, $realEnd); } return $result; } public static function distance($skillSetFirst, $skillSetSecond) { $common = count(array_intersect($skillSetFirst, $skillSetSecond)); $firstUniq = count($skillSetFirst) - $common; $secondUniq = count($skillSetSecond) - $common; $distance = $common / ($firstUniq + $common + $secondUniq); return round($distance * 100, 1); } public function show() { $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; if (strlen($mbtiType) != 4) { return redirect('/tests/mbti'); } $skillSet = DB::table('users')->where('id', '=', Auth::id())->first(['skill_set'])->skill_set; $skillSet = json_decode($skillSet); $selected = $skillSet; $typeOccupations = DB::table(OccupationsToTypes::getTable())->where('mbtype', $mbtiType)->get()->all(); $occupationIds = []; foreach ($typeOccupations as $item) { $occupationIds[] = $item->occupation; } $occupationsToSkills = DB::table(Occupations::getTable()) ->leftJoin(OccupationsToSkills::getTable(), Occupations::getTable() . '.id', '=', OccupationsToSkills::getTable() . '.occupation_id') ->select([Occupations::getTable() . '.*', OccupationsToSkills::getTable() . '.skill_id']) ->orderBy('id', 'asc') ->whereIn('occupation_id', $occupationIds) ->get()->all(); $occupations = []; foreach ($occupationsToSkills as $item) { $title = $item->name; $title = strtoupper(substr($title, 0, 1)) . substr($title, 1); $occupations[$item->id]['id'] = $item->id; $occupations[$item->id]['name'] = $title; $occupations[$item->id]['description'] = $item->description; if (strlen($occupations[$item->id]['description']) > 190) { $occupations[$item->id]['short_description'] = substr($item->description, 0, 187) . '...'; } $occupations[$item->id]['skills'][] = $item->skill_id; $occupations[$item->id]['recommendationLink'] = '/recommendations?' . http_build_query([ 'occupation' => $item->id, 'selected' => $skillSet ]); } foreach ($occupations as &$item) { if (!empty($skillSet)) { $item['distance'] = $this->distance($item['skills'], $skillSet); } else { $item['distance'] = 0; } } uasort($occupations, 'App\Http\Controllers\Ajax\RelevantOccupations::compareByDistanceDesc'); $occupations = array_slice($occupations, 0, 4); // $skills = []; foreach ($occupations as &$item) { // GTools::okp($item['distance']); if ($item['distance'] < 50) { $item['color'] = 'red'; } elseif ($item['distance'] < 80) { $item['color'] = 'yellow'; } else { $item['color'] = 'green'; } $skillsData = DB::table(Skills::getTable()) ->whereIn('id', $item['skills']) ->get(['id', 'name', 'description'])->all(); $allSkills = []; foreach ($skillsData as $skill) { $skill->fullname = $skill->name; // if (strlen($skill->name) > 20) { // $skill->name = substr($skill->name, 0, 17) . '...'; // } $allSkills[$skill->id] = $skill->name; } $item['printSkills'] = implode(', ', $allSkills); // GTools::okp($skillsData); // $missedSkills = []; // foreach ($item['skills'] as $skill) { // if (in_array($skill, $selected)) { // $item['sameSkills'][$skill] = $allSkills[$skill]; // } else { // $item['missingSkills'][$skill] = $allSkills[$skill]; // $missedSkills[] = $skill; // } // } // $visibleSkillCount = 100; // if (!isset($item['missingSkills'])) { // $item['missingSkills'] = []; // } // if (count($item['missingSkills']) < $visibleSkillCount) { // if (!empty($item['sameSkills'])) { // $item['sameSkills'] = array_slice($item['sameSkills'], 0, $visibleSkillCount - count($item['missingSkills'])); // } // } else { // $item['missingSkills'] = array_slice($item['missingSkills'], 0, $visibleSkillCount); // $item['sameSkills'] = []; // } // $skillsToCourses = DB::table(SkillsToCourses::getTable()) // ->whereIn('skill_id', $missedSkills) // ->whereNotIn('skill_id', $selected) // ->get()->all(); // GTools::okp($skillsToCourses); // $item['hasRecommendations'] = !empty($skillsToCourses); } // GTools::okp($occupations); // GTools::okp($skillSet); return view('test_result', [ 'testQuestions' => [], 'mbtiType' => $mbtiType, 'occupations' => $occupations, 'name' => $this->typeInfo[$mbtiType]['name'], 'description' => $this->typeInfo[$mbtiType]['description'], ]); } } <?php namespace App\Http\Controllers; use App\Database\Occupations; use App\GTools; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class NewsController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function show($occupation_id) { // $testLink = '/tests/mbti'; // if (Auth::check()) { // $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; // if (strlen($mbtiType) > 0) { // $testLink .= '/result'; // } // } $title = Occupations::getById($occupation_id)->name; // GTools::okp($title); if (!$title) { $result = []; } else { $news = json_decode(file_get_contents('https://newsapi.org/v2/everything?language=en&q=' . urlencode($title) . '&apiKey=ad45714c41a445b0844ad9697ec18ffd&pageSize=7')); // GTools::okp($news); if (empty($news->articles)) { $result = []; } else { $result = $news->articles; } } $booksLink = 'https://www.amazon.com/s?k=' . $title . '&i=stripbooks-intl-ship&ref=nb_sb_noss'; return view('news', ['result' => $result, 'occupation' => $occupation_id, 'booksLink' => $booksLink]); } } <?php namespace App\Http\Controllers; use App\Database\Occupations; use App\GTools; use duzun\hQuery; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class VacancyController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function show($occupation_id) { // $testLink = '/tests/mbti'; // if (Auth::check()) { // $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; // if (strlen($mbtiType) > 0) { // $testLink .= '/result'; // } // } $title = Occupations::getById($occupation_id)->name; $title = strtoupper(substr($title, 0, 1)) . substr($title, 1); $location = geoip()->getLocation()->toArray()['city']; $query = 'https://indeed.com/jobs?q=' . urlencode($title) . '&l=' . urlencode($location) . ''; // GTools::okp($query); $vacancies = file_get_contents($query); $doc = hQuery::fromHTML($vacancies); $cards = $doc->find('.jobsearch-SerpJobCard'); $founded = []; if ($cards) { foreach ($cards as $item) { $vacancy['title'] = $item->find('.title a')->text(); $vacancy['title'] = strtoupper(substr($vacancy['title'], 0, 1)) . substr($vacancy['title'], 1); $vacancy['company'] = $item->find('.company')->text(); $vacancy['location'] = $item->find('.location')->text(); if (!$vacancy['location'] || strpos($vacancy['location'], $location) === false) { continue; } $vacancy['description'] = $item->find('.summary ul')->text(); $vacancy['link'] = 'https://www.indeed.com' . $item->find('.title a')->attr('href'); if ($item->find('.salaryText')) { $vacancy['salary'] = $item->find('.salaryText')->html(); } else { $vacancy['salary'] = ''; } $founded[] = $vacancy; } } if (!empty($founded)) { $founded = array_chunk($founded, 7)[0]; } // GTools::okp($founded); // GTools::okp($title); // if (!$title) { // $result = []; // } else { // $news = json_decode(file_get_contents('https://newsapi.org/v2/everything?language=en&q=' . urlencode($title) . '&apiKey=ad45714c41a445b0844ad9697ec18ffd&pageSize=7')); // GTools::okp($news); // $news = []; // if (empty($news->articles)) { $result = []; // } else { // $result = $news->articles; // } // } return view('vacancy', [ 'vacancies' => $founded, 'occupation' => $occupation_id, 'title' => $title, 'link' => $query, 'city' => $location ]); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\JdSkills; use App\Database\JobDescription; use App\Database\Occupations; use App\Database\OccupationsToTypes; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use duzun\hQuery; use function GuzzleHttp\Psr7\str; use Illuminate\Queue\Jobs\Job; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; use PHPUnit\Framework\Warning; class CompanyProfileController extends Controller { // private $jobs; /** * @param String $type * @param array $typeCategories */ public function show() { $descriptions = DB::table(JobDescription::getTable())->whereNotNull('occupation_id')->whereRaw('LENGTH(occupation_id) > 5')->get(); foreach ($descriptions as &$jd) { $jd->occupation = Occupations::getById($jd->occupation_id); } // GTools::okp($descriptions); // die(); return view('company_profile', ['res' => $descriptions]); } } <?php namespace App\Http\Controllers; use App\Database\JobDescription; use App\Database\Occupations; use App\Database\OccupationsToSkills; use App\Database\Skills; use App\GTools; use App\Http\Controllers\Ajax\RelevantOccupations; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class JobDescriptionController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function show($jd_id) { // $testLink = '/tests/mbti'; // if (Auth::check()) { // $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; // if (strlen($mbtiType) > 0) { // $testLink .= '/result'; // } // } $jd = JobDescription::getById($jd_id); $jd->intro = str_replace(' Post now on job boards.', '', $jd->intro); // GTools::okp($jd); if ($jd->occupation_id) { $occId = $jd->occupation_id; $occupation = Occupations::getById($occId); $relevantSkills = DB::table(OccupationsToSkills::getTable())->where('occupation_id', '=', $occId)->get(); $skillSet = []; foreach ($relevantSkills as $skill) { $skillSet[] = $skill->skill_id; } $jd->occupation = $occupation; // GTools::okp($occupation); // GTools::okp($skillSet); $skillsInfo = DB::table(Skills::getTable())->whereIn('id', $skillSet)->get(); // GTools::okp($skillsInfo); $jd->skillsInfo = $skillsInfo; $allStudents = DB::table('users') ->where('company', '<>', 1) ->whereNotNull('skill_set') ->get()->toArray(); foreach ($allStudents as $user) { $userSkills = json_decode($user->skill_set, true); $user->distance = GTools::distance($skillSet, $userSkills); } uasort($allStudents, 'App\GTools::compareByDistanceObjectDesc'); $jd->students = array_slice($allStudents, 0, 5); // GTools::okp($allStudents); } if (!empty($jd->subcats)) { $jd->subcats = json_decode($jd->subcats); // GTools::okp($jd->subcats); } // GTools::okp($jd); return view('jd', ['jd' => $jd]); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RavenTestController extends Controller { public static function refineString($string) { $result = substr($string, 1); if (($realEnd = strpos($result, ';')) !== false) { $result = substr($result, 0, $realEnd); } return $result; } public function show() { $answerNumber = []; for ($index = 1; $index <= 24; ++$index) { $answerNumber[$index] = 6; } for ($index = 25; $index <= 60; ++$index) { $answerNumber[$index] = 8; } return view('raven_test', ['answerNumber' => $answerNumber]); } public function info() { return view('raven_test_info', []); } } <?php namespace App\Http\Controllers; use App\Database\Courses; use App\Database\Dataatwork\JobsToSkills; use App\Database\Occupations; use App\Database\OccupationsToTypes; use App\Database\SkillsToCourses; use App\Database\Universities; use App\GTools; use App\Http\Controllers\Controller; use App\Database\Jobs; use App\Database\OccupationsToSkills; use App\Database\Skills; use Carbon\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use PHPUnit\Framework\Warning; class RavenTestResultController extends Controller { public static function refineString($string) { $result = substr($string, 1); if (($realEnd = strpos($result, ';')) !== false) { $result = substr($result, 0, $realEnd); } return $result; } public static function distance($skillSetFirst, $skillSetSecond) { $common = count(array_intersect($skillSetFirst, $skillSetSecond)); $firstUniq = count($skillSetFirst) - $common; $secondUniq = count($skillSetSecond) - $common; $distance = $common / ($firstUniq + $common + $secondUniq); return round($distance * 100, 1); } public function show() { $iqPercent = DB::table('users')->where('id', '=', Auth::id())->first(['raven'])->raven; if ($iqPercent == 0) { return redirect('/tests/raven'); } $iqPercent = round($iqPercent, 0); if ($iqPercent >= 95) { $description = 'Extremely high intelligence'; $step = 1; } elseif ($iqPercent >= 75) { $description = 'Uncommon intelligence'; $step = 2; } elseif ($iqPercent >= 25) { $description = 'Average intelligence'; $step = 3; } elseif ($iqPercent >= 5) { $description = 'Below average intelligence'; $step = 4; } else { $description = 'Defective intellectual ability'; $step = 5; } $iqFirst = $iqSecond = $iqThird = ''; if ($iqPercent == 100) { $iqThird = $iqSecond = 0; $iqFirst = 1; } elseif ($iqPercent >= 10) { $iqFirst = intval($iqPercent / 10); $iqSecond = $iqPercent % 10; } else { $iqFirst = $iqPercent; } return view('raven_test_result', [ 'iqPercent' => $iqPercent, 'description' => $description, 'step' => $step, 'iqFirst' => $iqFirst, 'iqSecond' => $iqSecond, 'iqThird' => $iqThird, ]); } public function static($iqPercent) { // $iqPercent = DB::table('users')->where('id', '=', Auth::id())->first(['raven'])->raven; if ($iqPercent <= 0 || $iqPercent > 100) { return redirect('/tests/raven'); } $iqPercent = round($iqPercent, 0); if ($iqPercent >= 95) { $description = 'Extremely high intelligence'; $step = 1; } elseif ($iqPercent >= 75) { $description = 'Uncommon intelligence'; $step = 2; } elseif ($iqPercent >= 25) { $description = 'Average intelligence'; $step = 3; } elseif ($iqPercent >= 5) { $description = 'Below average intelligence'; $step = 4; } else { $description = 'Defective intellectual ability'; $step = 5; } $iqFirst = $iqSecond = $iqThird = ''; if ($iqPercent == 100) { $iqThird = $iqSecond = 0; $iqFirst = 1; } elseif ($iqPercent >= 10) { $iqFirst = intval($iqPercent / 10); $iqSecond = $iqPercent % 10; } else { $iqFirst = $iqPercent; } return view('raven_test_result', [ 'iqPercent' => $iqPercent, 'description' => $description, 'step' => $step, 'iqFirst' => $iqFirst, 'iqSecond' => $iqSecond, 'iqThird' => $iqThird, ]); } } <?php namespace App\Http\Controllers; use App\Database\Occupations; use App\GTools; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; class TestListController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Contracts\Support\Renderable */ public function show() { // $testLink = '/tests/mbti'; // if (Auth::check()) { // $mbtiType = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; // if (strlen($mbtiType) > 0) { // $testLink .= '/result'; // } // } // $title = Occupations::getById($occupation_id)->name; $raven = DB::table('users')->where('id', '=', Auth::id())->first(['raven'])->raven; $mbti = DB::table('users')->where('id', '=', Auth::id())->first(['mbti'])->mbti; $tests = [ [ 'title' => 'Myers-Briggs<br>Personality<br>Test', 'url' => strlen($mbti) == 4 ? '/tests/mbti/result' : '/tests/mbti', 'type' => 'Personality test', 'time' => '7 min', ], [ 'title' => 'Raven\'s<br>Progressive<br>Matrices', 'url' => $raven > 0 ? '/tests/raven/result' : '/tests/raven', 'type' => 'IQ test', 'time' => '20 min', ] ]; return view('test_list', [ 'tests' => $tests ]); } } <?php namespace App\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * These middleware are run during every request to your application. * * @var array */ protected $middleware = [ \App\Http\Middleware\TrustProxies::class, \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, ]; /** * The application's route middleware groups. * * @var array */ protected $middlewareGroups = [ 'web' => [ \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' => [ 'bindings', \Illuminate\Session\Middleware\StartSession::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, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; /** * The priority-sorted list of middleware. * * This forces non-global middleware to always be in the given order. * * @var array */ protected $middlewarePriority = [ \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\Authenticate::class, \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Auth\Middleware\Authorize::class, ]; } <?php namespace App\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request * @return string */ protected function redirectTo($request) { if (! $request->expectsJson()) { return route('login'); } } } <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; class CheckForMaintenanceMode extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. * * @var array */ protected $except = [ // ]; } <?php namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ // ]; } <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect('/home'); } return $next($request); } } <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. * * @var array */ protected $except = [ 'password', 'password_confirmation', ]; } <?php namespace App\Http\Middleware; use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * * @var array|string */ protected $proxies; /** * The headers that should be used to detect proxies. * * @var int */ protected $headers = Request::HEADER_X_FORWARDED_ALL; } <?php namespace App\Http\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; class VerifyCsrfToken extends Middleware { /** * Indicates whether the XSRF-TOKEN cookie should be set on the response. * * @var bool */ protected $addHttpCookie = true; /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ '/ajax/*', '/*', '/' ]; } <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application services. * * @return void */ public function boot() { // } } <?php namespace App\Providers; use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ // 'App\Model' => 'App\Policies\ModelPolicy', ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } } <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Broadcast; class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Broadcast::routes(); require base_path('routes/channels.php'); } } <?php namespace App\Providers; use Illuminate\Support\Facades\Event; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for the application. * * @var array */ protected $listen = [ Registered::class => [ SendEmailVerificationNotification::class, ], ]; /** * Register any events for your application. * * @return void */ public function boot() { parent::boot(); // } } <?php namespace App\Providers; use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to your controller routes. * * In addition, it is set as the URL generator's root namespace. * * @var string */ protected $namespace = 'App\Http\Controllers'; /** * Define your route model bindings, pattern filters, etc. * * @return void */ public function boot() { // parent::boot(); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); // } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); } } <?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Courses extends Basic { public static function getTable() { return 'courses'; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; abstract class Basic { abstract public static function getTable(); public static function add($fields) { $query = DB::table(static::getTable())->insert($fields); return $query; } public static function update($id, $fields) { $query = DB::table(static::getTable())->where('id', '=', $id)->update($fields); return $query; } public static function delete($id) { $query = DB::table(static::getTable())->where('id', '=', $id)->delete(); return $query; } public static function getAll() { $query = DB::table(static::getTable())->get()->toArray(); return $query; } public static function count() { $query = DB::table(static::getTable())->count(); return $query; } public static function getById($id, $columnId = 'id') { $query = DB::table(static::getTable())->where($columnId, '=', $id)->first(); return $query; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class SkillsToCourses extends Basic { public static function getTable() { return 'skills_to_courses'; } public static function exists($courseId, $skillId) { $query = DB::table(self::getTable()) ->where('course_id', '=', $courseId) ->where('skill_id', '=', $skillId) ->exists(); return $query; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Occupations extends Basic { public static function getTable() { return 'occupations'; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class OccupationsToSkills extends Basic { public static function getTable() { return 'occupations_to_skills'; } public static function exists($occupationId, $skillId) { $query = DB::table(self::getTable()) ->where('occupation_id', '=', $occupationId) ->where('skill_id', '=', $skillId) ->get()->toArray(); return !empty($query); } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Skills extends Basic { public static function getTable() { return 'skills'; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Universities extends Basic { public static function getTable() { return 'universities'; } } <?php namespace App\Database\Dataatwork; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Jobs extends \App\Database\Basic { public static function getTable() { return 'dataatwork_jobs'; } } <?php namespace App\Database\Dataatwork; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class Skills extends \App\Database\Basic { public static function getTable() { return 'dataatwork_skills'; } } <?php namespace App\Database\Dataatwork; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class JobsToSkills extends \App\Database\Basic { public static function getTable() { return 'dataatwork_jobs_to_skills'; } public static function exists($jobId, $skillId) { $query = DB::table(self::getTable()) ->where('job_id', '=', $jobId) ->where('skill_id', '=', $skillId) ->get()->toArray(); return !empty($query); } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class OccupationsToTypes extends Basic { public static function getTable() { return 'occupations_to_mbtypes'; } public static function exists($occupationId, $type) { $query = DB::table(self::getTable()) ->where('occupation', '=', $occupationId) ->where('mbtype', '=', $type) ->exists(); return $query; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class JobDescription extends Basic { public static function getTable() { return 'job_descriptions'; } } <?php namespace App\Database; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Mail; class JdSkills extends Basic { public static function getTable() { return 'jd_skills'; } } <?php namespace App; use Carbon\Carbon; use Illuminate\Support\Facades\DB; class GTools { public static function okp($data = NULL) { $backtrace = debug_backtrace()[0]; $file = str_replace($_SERVER['DOCUMENT_ROOT'], '', $backtrace['file']); $line = str_replace($_SERVER['DOCUMENT_ROOT'], '', $backtrace['line']); echo $file . ', ' . $line . ': '; if (is_array($data) or is_object($data)) { echo '<pre>'; print_r($data); echo '</pre>'; } else { var_dump($data); echo "<br/>"; } } public static function oklog($data, $file = "oklog", $base = false) { if ($base === false) { $base = realpath(__DIR__ . '/../'); } $file = str_replace('/', '_', $file); $file = str_replace('.', '_', $file); // GTools::okp($base); file_put_contents($base . '/oklogs/' . $file . '.log', date('d.m.Y H:i:s: '), FILE_APPEND); file_put_contents($base . '/oklogs/' . $file . '.log', print_r($data, true) . "\n", FILE_APPEND); } public static function curlGet($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); $data = curl_exec($ch); curl_close($ch); return $data; } public static function getRoot() { if (isset($_SERVER['DOCUMENT_ROOT']) && strlen($_SERVER['DOCUMENT_ROOT']) > 0) { return $_SERVER['DOCUMENT_ROOT']; } else { return realpath(__DIR__ . '/../public'); } } public static function getFileMtime($fileNameFromPublic) { return filemtime(self::getRoot() . $fileNameFromPublic); } public static function distance($skillSetFirst, $skillSetSecond) { $common = count(array_intersect($skillSetFirst, $skillSetSecond)); $firstUniq = count($skillSetFirst) - $common; $secondUniq = count($skillSetSecond) - $common; $distance = $common / ($firstUniq + $common + $secondUniq); return round($distance * 100, 1); } public static function compareByDistanceDesc($first, $second){ return ($first['distance'] < $second['distance']); } public static function compareByDistanceObjectDesc($first, $second){ return ($first->distance < $second->distance); } } <?php namespace App; use Illuminate\Support\Facades\Auth; use Zefy\SimpleSSO\SSOBroker; class BrokerSmith extends SSOBroker { /** * SSO servers URL. * @var string */ protected $ssoServerUrl; /** * Broker name by which it will be identified. * @var string */ protected $brokerName; /** * Super secret broker's key. * @var string */ protected $brokerSecret; /** * Set base class options (sso server url, broker name and secret, etc). * * @return void * * @throws Exception */ protected function setOptions() { $this->ssoServerUrl = env('SSO_SERVER_URL'); $this->brokerName = env('SSO_BROKER_NAME'); $this->brokerSecret = env('SSO_BROKER_SECRET'); if (!$this->ssoServerUrl || !$this->brokerName || !$this->brokerSecret) { throw new Exception('Missing configuration values.'); } } /** * Somehow save random token for client. * * @return void */ protected function saveToken() { if (isset($this->token) && $this->token) { return; } if ($this->token = $this->getCookie($this->getCookieName())) { return; } // If cookie token doesn't exist, we need to create it with unique token... $this->token = base_convert(md5(uniqid(rand(), true)), 16, 36); setcookie($this->getCookieName(), $this->token, time() + 60 * 60 * 24 * 365, '/'); // ... and attach it to broker session in SSO server. $this->attach(); } /** * Delete saved token. * * @return void */ protected function deleteToken() { $this->token = null; setcookie($this->getCookieName(), null, -1, '/'); } /** * Make request to SSO server. * * @param string $method Request method 'post' or 'get'. * @param string $command Request command name. * @param array $parameters Parameters for URL query string if GET request and form parameters if it's POST request. * * @return array */ protected function makeRequest(string $method, string $command, array $parameters = []) { $commandUrl = $this->generateCommandUrl($command); $headers = [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '. $this->getSessionId(), ]; switch ($method) { case 'POST': $body = ['form_params' => $parameters]; break; case 'GET': $body = ['query' => $parameters]; break; default: $body = []; break; } $client = new \GuzzleHttp\Client; $response = $client->request($method, $commandUrl, $body + ['headers' => $headers]); return json_decode($response->getBody(), true); } /** * Redirect client to specified url. * * @param string $url URL to be redirected. * @param array $parameters HTTP query string. * @param int $httpResponseCode HTTP response code for redirection. * * @return void */ protected function redirect(string $url, array $parameters = [], int $httpResponseCode = 307) { $query = ''; // Making URL query string if parameters given. if (!empty($parameters)) { $query = '?'; if (parse_url($url, PHP_URL_QUERY)) { $query = '&'; } $query .= http_build_query($parameters); } header('Location: ' . $url . $query, true, $httpResponseCode); exit; } /** * Getting current url which can be used as return to url. * * @return string */ protected function getCurrentUrl() { $protocol = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; return $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } /** * Cookie name in which we save unique client token. * * @return string */ protected function getCookieName() { // Cookie name based on broker's name because there can be some brokers on same domain // and we need to prevent duplications. return 'sso_token_' . preg_replace('/[_\W]+/', '_', strtolower($this->brokerName)); } /** * Get COOKIE value by it's name. * * @param string $cookieName * * @return string|null */ protected function getCookie(string $cookieName) { if (isset($_COOKIE[$cookieName])) { return $_COOKIE[$cookieName]; } return null; } public function test() { try { $userInfo = $this->getUserInfo(); dump($userInfo); dump($this->getSessionId()); dump($this->getCookieName()); dump($this->getCookie($this->getCookieName())); dump($this->token); } catch (Exception $e) { dump($e->getMessage()); } // print_r($res); } public function testLogin() { dump($this->login('ajaxey@yandex.ru', '123123123')); } public function tryLogin($email, $password) { $res = $this->login($email, $password); $userInfo = $this->getUserInfo(); if ($res) { $this->saveToken(); // $this->attach(); return $userInfo['data']['id']; } else { return false; } } } {!! $res !!} @extends('layouts.index') @section('title', 'Eden. Choose skills and get personal recommendations') @section('content') <div class="skill_search-page"> <a class="skill_search-page-link-back" href="/" style="top: 1em;"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Home</a> <div class="skill_search-search-block"> <div class="skill_search-search-heading"> Write your skills </div> <div class="skill_search-search-form-block"> <form action="" class="skill_search-search-form"> <div class="input-wrapper"> <input type="text" name="text" placeholder="Start type your skills" autocomplete="off"> </div> <button type="submit" class="skill_search-search-form-submit"></button> </form> <div class="skill_search-search-form-dropdown"> <div class="skill_search-search-form-skill-items"> </div> </div> </div> </div> <div class="skill_search-tags-block"> <div class="skill_search-tags-items skill_search-tags-items_small"> @foreach ($selected as $skill) <div class="skill_search-tags-item" data-id="{{$skill->id}}"> <div class="dropdown"> <a class="skill_search-tags-item-link" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {{$skill->name}} </a> <div class="dropdown-menu skill_search-tags-item-descr"> <p> {{$skill->description}} </p> </div> </div> <a href="#" class="skill_search-tags-item-close"></a> </div> @endforeach </div> </div> <div class="skill_search-search-advantages"> <div class="skill_search-search-advantages-item"> <div class="skill_search-search-advantages-item-heading"> Occupations </div> <div class="skill_search-search-advantages-item-number" data-number="{{$numbers['occupations']}}"></div> </div> <div class="skill_search-search-advantages-item"> <div class="skill_search-search-advantages-item-heading"> Skills </div> <div class="skill_search-search-advantages-item-number" data-number="{{$numbers['skills']}}"></div> </div> <div class="skill_search-search-advantages-item"> <div class="skill_search-search-advantages-item-heading"> Occupation-skill </div> <div class="skill_search-search-advantages-item-number" data-number="{{$numbers['occupationsToSkills']}}"></div> </div> </div> <div class="skill_search-prof-block"> <div class="skill_search-prof-items"> </div> </div> </div> @endsection <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>@yield('title')</title> <meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="description" content="Description"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="/static/img/favicon.png"> <meta property="og:image" content=""> <link rel="stylesheet" href="/static/css/main.css?v={{\App\GTools::getFileMtime('/static/css/main.css')}}"> <link rel="stylesheet" href="/static/css/other.css?v={{\App\GTools::getFileMtime('/static/css/other.css')}}"> </head> <body> @yield('content') <script src="/static/libs/jquery/dist/jquery.min.js"></script> <script src="/static/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="/static/js/dotdotdot.js"></script> <script src="/static/js/custom.js?v={{\App\GTools::getFileMtime('/static/js/custom.js')}}"></script> @yield('page_scripts') </body> </html> <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- CSRF Token --> <meta name="csrf-token" content="{{ csrf_token() }}"> <link rel="icon" href="/static/img/favicon.png"> {{-- <title>{{ config('app.name', 'Laravel') }}</title>--}} <!-- Scripts --> <script src="{{ asset('js/app.js') }}" defer></script> <!-- Fonts --> <link rel="dns-prefetch" href="//fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet"> <!-- Styles --> <link href="{{ asset('css/app.css') }}" rel="stylesheet"> </head> <body> <div id="app"> <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm"> <div class="container"> {{--<a class="navbar-brand" href="{{ url('/') }}">--}} {{--{{ config('app.name', 'Laravel') }}--}} {{--</a>--}} <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <!-- Left Side Of Navbar --> <ul class="navbar-nav mr-auto"> </ul> <!-- Right Side Of Navbar --> <ul class="navbar-nav ml-auto"> <!-- Authentication Links --> @guest <li class="nav-item"> <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a> </li> @if (Route::has('register')) <li class="nav-item"> <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a> </li> @endif @else <li class="nav-item dropdown"> <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> {{ Auth::user()->name }} <span class="caret"></span> </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"> {{ __('Logout') }} </a> <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> @csrf </form> </div> </li> @endguest </ul> </div> </div> </nav> <main class="py-4"> @yield('content') </main> </div> </body> </html> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>@yield('title')</title> <meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="description" content="Description"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="icon" href="/static/img/favicon.png"> <meta property="og:image" content=""> <link rel="stylesheet" href="/static/css/main.css?v={{\App\GTools::getFileMtime('/static/css/main.css')}}"> <link rel="stylesheet" href="/static/css/other.css?v={{\App\GTools::getFileMtime('/static/css/other.css')}}"> <link rel="stylesheet" href="/static_upd/libs/fancybox/jquery.fancybox.min.css"> <link rel="stylesheet" href="/static_upd/libs/select2/select2.min.css"> <link rel="stylesheet" href="/static_upd/css/style.css?v={{\App\GTools::getFileMtime('/static_upd/css/style.css')}}"> </head> <body> @yield('content') <script src="/static/libs/jquery/dist/jquery.min.js"></script> <script src="/static/libs/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="/static/js/dotdotdot.js"></script> <script src="/static/js/custom.js?v={{\App\GTools::getFileMtime('/static/js/custom.js')}}"></script> <script src="/static_upd/libs/fancybox/jquery.fancybox.min.js"></script> <script src="/static_upd/libs/select2/select2.min.js"></script> <script src="/static_upd/js/main.js?v={{\App\GTools::getFileMtime('/static_upd/js/main.js')}}"></script> @yield('page_scripts') </body> </html> {!! $json !!}@if (!empty($res)) @foreach ($res as $item) <a href="#" class="skill_search-search-form-skill-item" data-id="{{$item->id}}" data-name="{{$item->name}}" data-description="{{$item->description}}" data-type="{{$item->type}}"> <span>{{ $item->name }}</span> </a> @endforeach @else <span>No skills found</span> @endif@php ($index = 0) @foreach ($occupations as $item) @php (++$index) <div class="skill_search-prof-item-col zoomIn-{{$index}}"> <div class="skill_search-prof-item skill_search-prof-item-{{$item['color']}}"> <div class="skill_search-prof-item-heading"> {{$item['name']}} </div> <div class="skill_search-prof-item-compatibility"> <div class="skill_search-prof-item-compatibility-heading"> Compatibility {{$item['distance']}}% </div> <div class="skill_search-prof-item-compatibility-line"> <div class="skill_search-prof-item-compatibility-line-progress" style="width: {{$item['distance']}}%"></div> </div> </div> <div class="skill_search-prof-item-comp-info"> <div class="skill_search-prof-item-comp-info-item skill_search-prof-item-comp-info-item-red"> <div class="skill_search-prof-item-comp-info-item-line"></div> <div class="skill_search-prof-item-comp-info-item-digit">0–49</div> </div> <div class="skill_search-prof-item-comp-info-item skill_search-prof-item-comp-info-item-yellow"> <div class="skill_search-prof-item-comp-info-item-line"></div> <div class="skill_search-prof-item-comp-info-item-digit">50–79</div> </div> <div class="skill_search-prof-item-comp-info-item skill_search-prof-item-comp-info-item-green"> <div class="skill_search-prof-item-comp-info-item-line"></div> <div class="skill_search-prof-item-comp-info-item-digit">80–100</div> </div> </div> <div class="skill_search-prof-item-tags"> @if (!empty($item['sameSkills'])) @foreach ($item['sameSkills'] as $skillId => $skill) <div class="skill_search-prof-item-tag"> {{$skill->name}} </div> @endforeach @endif @if (!empty($item['missingSkills'])) @foreach ($item['missingSkills'] as $skillId => $skill) <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="{{$skill->id}}" data-name="{{$skill->fullname}}" data-description="{{$skill->description}}"> {{$skill->name}} </div> @endforeach @endif </div> <div class="skill_search-prof-item-descr"> @if (isset($item['short_description'])) <span class="skill_search-prof-item-descr-short">{{$item['short_description']}}</span> <a href="https://ec.europa.eu/esco/portal/occupation?uri=http%3A%2F%2Fdata.europa.eu%2Fesco%2Foccupation%2F{{$item['id']}}&conceptLanguage=en&full=true" class="skill_search-prof-item-descr-show-more" target="_blank"> show more </a> <span class="skill_search-prof-item-descr-full" style="display: none;">{{$item['description']}}</span> @else <span class="skill_search-prof-item-descr-full">{{$item['description']}}</span> @endif </div> <div class="skill_search-prof-item-prebottom-links"> <div class="skill_search-prof-item-recommendations-container"> <a href="https://lms.yacl.site" target="_blank" class="skill_search-prof-item-recommendations-link ">Obtain new skills</a> {{--@if ($item['hasRecommendations'])--}} {{--<a href="{{$item['recommendationLink']}}" target="_blank" class="skill_search-prof-item-recommendations-link ">Obtain new skills</a>--}} {{--@else--}} {{--<a href="#" onclick="return false;" class="skill_search-prof-item-recommendations-link disabled">Obtain new skills</a>--}} {{--@endif--}} </div> {{--<a href="https://news.google.com/search?q={{$item['name']}}&hl=en-GB&gl=GB&ceid=GB:en" target="_blank" class="skill_search-prof-item-bottom-link">Watch the news</a>--}} <a href="/news/{{$item['id']}}" class="skill_search-prof-item-bottom-link">Watch the news</a> </div> <div class="skill_search-prof-item-bottom-links"> <a href="https://www.amazon.com/s?k={{$item['name']}}&i=stripbooks-intl-ship&ref=nb_sb_noss" target="_blank" class="skill_search-prof-item-bottom-link">Improve skills</a> {{--<a href="https://indeed.com/jobs?q={{$item['name']}}" class="skill_search-prof-item-bottom-link" target="_blank">View vacancies</a>--}} <a href="/vacancy/{{$item['id']}}" class="skill_search-prof-item-bottom-link">View vacancies</a> </div> </div> </div> @endforeach @extends('layouts.index') @section('title', 'Eden. Obtain new skills') @section('content') <div class="skill_search-page page-recommendations"> <h1 class="skill_search-page-heading heading-recommendations">Obtain new skills</h1> <a class="skill_search-page-link-back" href="/skills"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Back</a> <div class="skill_search-container"> <div class="skill_search-prof-item-tags recommendations-item-tags"> @foreach($missedSkills as $skill) <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="{{$skill->id}}" data-name="{{$skill->name}}" data-description="{{$skill->description}}"> {{$skill->name}} </div> @endforeach </div> <div class="skill_search-recommendations"> @if (!empty($recommended)) @foreach($recommended as $course) <div class="skill_search-recommendations-item"> <div class="skill_search-recommendations-item-row"> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-logo"> <div class="skill_search-recommendations-item-block-title"> </div> <div class="skill_search-recommendations-item-block-content"> <img src="{{$course->university_logo}}"> </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-university"> <div class="skill_search-recommendations-item-block-title"> University </div> <div class="skill_search-recommendations-item-block-content"> {{$course->university_name}} </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-name"> <div class="skill_search-recommendations-item-block-title"> Course name </div> <div class="skill_search-recommendations-item-block-content"> {{$course->name}} </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-price"> <div class="skill_search-recommendations-item-block-title"> Fees </div> <div class="skill_search-recommendations-item-block-content"> {{$course->price}} </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-link"> <div class="skill_search-recommendations-item-block-title"> </div> <div class="skill_search-recommendations-item-block-content"> <a class="skill_search-recommendations-item-link-button" data-href="{{$course->link}}" target="_blank" href="{{$course->link}}">Link <img src="/static/img/arrow_right.png"/> </a> </div> </div> </div> <div class="skill_search-recommendations-item-row"> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-skills"> <div class="skill_search-recommendations-item-block-title"> Skills: </div> <div class="skill_search-prof-item-tags recommendations-item-tags"> @foreach($course->obtainedSkills as $skill) <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="{{$skill->id}}" data-name="{{$skill->name}}" data-description="{{$skill->description}}"> {{$skill->name}} </div> @endforeach </div> </div> </div> </div> @endforeach @else <h2>No courses found</h2> @endif </div> </div> </div> @endsection @extends('layouts.index') @section('title', 'Eden. Obtain new skills') @section('content') <div class="skill_search-page page-recommendations"> <h1 class="skill_search-page-heading heading-recommendations">Obtain new skills</h1> <a class="skill_search-page-link-back" href="/"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Back</a> <div class="skill_search-container"> <div class="skill_search-prof-item-tags recommendations-item-tags"> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="fbb2ad77-dba7-47eb-9da5-b50cffc598e8" data-name="cope with stage fright" data-description="Deal with conditions that cause stage fright, such as time limits, the audience and stress."> cope with stage f... </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="2747a004-2b3c-4879-92ec-d2665bfee36a" data-name="study roles from scripts" data-description="Study and rehearse roles from scripts; interpret, learn and memorise lines, stunts, and cues as directed."> study roles from ... </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="5d8b0aff-0599-470a-8eef-9e8cb3ad1626" data-name="create an act" data-description="Create an act to perform, using singing, dancing, acting, or all of them together."> create an act </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="add5de06-4fcc-4d9a-9b27-4db9722c9be7" data-name="memorise lines" data-description="Memorise your role in a performance or broadcast, whether it is text, movement, or music."> memorise lines </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="032a4ab8-1034-4541-8037-b2cdcc7fd19a" data-name="select music for performance" data-description="Select pieces of music for a live performance. Consider factors such as ensemble abilities, availability of scores and the need for musical variety."> select music for ... </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="b4d58cb3-86d9-4c74-99ad-390a4386e84a" data-name="work independently as an artist" data-description="Develop one's own ways of doing artistic performances, motivating oneself with little or no supervision, and depending on oneself to get things done."> work independentl... </div> </div> <div class="skill_search-recommendations"> @foreach([1, 2, 3, 4] as $item) <div class="skill_search-recommendations-item"> <div class="skill_search-recommendations-item-row"> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-logo"> <div class="skill_search-recommendations-item-block-title"> </div> <div class="skill_search-recommendations-item-block-content"> <img src="/static/img/university/brunel.png"> </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-university"> <div class="skill_search-recommendations-item-block-title"> University </div> <div class="skill_search-recommendations-item-block-content"> Brunel University London’s Engineering Management MSc test test test new new new my my my my my my my </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-name"> <div class="skill_search-recommendations-item-block-title"> Course name </div> <div class="skill_search-recommendations-item-block-content"> very very very long name concerned with Engineering management, finance management and other interesting skills </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-price"> <div class="skill_search-recommendations-item-block-title"> Fees </div> <div class="skill_search-recommendations-item-block-content"> $7000 </div> </div> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-link"> <div class="skill_search-recommendations-item-block-title"> </div> <div class="skill_search-recommendations-item-block-content"> <a class="skill_search-recommendations-item-link-button" href="#">Link <img src="/static/img/arrow_right.png"/> </a> </div> </div> </div> <div class="skill_search-recommendations-item-row"> <div class="skill_search-recommendations-item-block skill_search-recommendations-item-skills"> <div class="skill_search-recommendations-item-block-title"> Skills: </div> <div class="skill_search-prof-item-tags recommendations-item-tags"> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="fbb2ad77-dba7-47eb-9da5-b50cffc598e8" data-name="cope with stage fright" data-description="Deal with conditions that cause stage fright, such as time limits, the audience and stress."> cope with stage </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="fbb2ad77-dba7-47eb-9da5-b50cffc598e8" data-name="cope with stage fright" data-description="Deal with conditions that cause stage fright, such as time limits, the audience and stress."> cope with stage </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="fbb2ad77-dba7-47eb-9da5-b50cffc598e8" data-name="cope with stage fright" data-description="Deal with conditions that cause stage fright, such as time limits, the audience and stress."> cope with stage </div> <div class="skill_search-prof-item-tag skill_search-prof-item-tag_red" data-id="fbb2ad77-dba7-47eb-9da5-b50cffc598e8" data-name="cope with stage fright" data-description="Deal with conditions that cause stage fright, such as time limits, the audience and stress."> cope with stage </div> </div> </div> </div> </div> @endforeach </div> </div> </div> @endsection <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Laravel</title> <!-- Fonts --> <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet"> <!-- Styles --> <style> html, body { background-color: #fff; color: #636b6f; font-family: 'Nunito', sans-serif; font-weight: 200; height: 100vh; margin: 0; } .full-height { height: 100vh; } .flex-center { align-items: center; display: flex; justify-content: center; } .position-ref { position: relative; } .top-right { position: absolute; right: 10px; top: 18px; } .content { text-align: center; } .title { font-size: 84px; } .links > a { color: #636b6f; padding: 0 25px; font-size: 13px; font-weight: 600; letter-spacing: .1rem; text-decoration: none; text-transform: uppercase; } .m-b-md { margin-bottom: 30px; } </style> </head> <body> <div class="flex-center position-ref full-height"> @if (Route::has('login')) <div class="top-right links"> @auth <a href="{{ url('/home') }}">Home</a> @else <a href="{{ route('login') }}">Login</a> @if (Route::has('register')) <a href="{{ route('register') }}">Register</a> @endif @endauth </div> @endif <div class="content"> <div class="title m-b-md"> Laravel </div> <div class="links"> <a href="https://laravel.com/docs">Docs</a> <a href="https://laracasts.com">Laracasts</a> <a href="https://laravel-news.com">News</a> <a href="https://blog.laravel.com">Blog</a> <a href="https://nova.laravel.com">Nova</a> <a href="https://forge.laravel.com">Forge</a> <a href="https://github.com/laravel/laravel">GitHub</a> </div> </div> </div> </body> </html> @extends('layouts.inner') @section('title', 'Eden') @section('page_scripts') <script src="{{asset('/static/js/test.js') . '?v=' . \App\GTools::getFileMtime('/static/js/test.js') }}"></script> @endsection @section('content') <div class="test"> <div class="c-container"> <div class="test-inner"> <div class="test-header"> <a href="/tests" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back to tests </a> </div> <div class="test-container"> <div class="test-content"> <h2 class="test-title">Myers-Briggs Personality Test</h2> <div class="test-text">Find the best career for you with Myers and Briggs' theory of 16 personality types. Understand your motivations and values, identify your strengths, and match your interests to specific careers that suit you.</div> <div class="test-info"> <div class="test-info-item"> <img src="/static_upd/img/clock-icon.png" alt=""> <span>7 min</span> </div> <div class="test-info-item"> <img src="/static_upd/img/coins-icon.png" alt=""> <span>Free</span> </div> </div> <a href="/tests/mbti/info" class="auth-btn test-about-btn"> About MBTI Step I test </a> </div> <div class="test-steps"> <div class="test-description">From each pair, choose the image which appeals to you most.</div> <form action="" class="js-test-form"> <div class="test-items"> @php ($pair = 0) @php ($triad = 0) @php ($index = 1) @php ($grouper = '') @foreach ($testQuestions as $questionId => $question) {{--<div class="js-test-question" data-number="{{$questionId}}">--}} {{-- {{$index }} - {{count($question['answers'])}}--}} @if ($index == 1 && count($question['answers']) == 2) @php (++$pair) @php ($group = $pair) @php ($grouper = 'pair js-pair-' . $pair) @elseif (count($question['answers']) == 3) @php (++$triad) @php ($group = $triad) @php ($grouper = 'triad js-triad-' . $triad) @endif @foreach ($question['answers'] as $id => $text) {{--<input type="radio" name="answer[{{$questionId}}]" value="{{$id}}"--}} {{--class="js-{{$questionId}}_{{$id}}" style="display: none;">--}} <div class="test-item item-{{$id}} {{$grouper}} js-question-{{$questionId}}" data-group="{{$group}}" data-question="{{$questionId}}" data-answer="{{$id}}"> @foreach (['.jpg', '.jpeg', '.png'] as $ext) @php ($path = 'static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . $ext) @if (file_exists(public_path($path))) <img src="/{{$path}}?v=3"/> @else {{-- {{base_path($path)}}--}} @endif {{--<img src="{{asset('/static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . '.jpeg')}}"/>--}} {{--<img src="{{asset('/static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . '.png')}}"/>--}} @endforeach </div> @endforeach {{--</div>--}} {{-- @if ((++$index) == count($question['answers']))--}} @php ($index = 1) {{-- @elseif(count($question['answers']) == 3)--}} {{-- @php ($index = 1)--}} {{--@endif--}} @endforeach {{--<input type="radio" name="sex" value="m" class="js-sex_m">--}} {{--<label for="sex" style="cursor: pointer;" data-input="sex_m">--}} {{--мужской--}} {{--</label>--}} {{--<br/>--}} {{--<input type="radio" name="sex" value="f" class="js-sex_f">--}} {{--<label for="sex" style="cursor: pointer;" data-input="sex_f">--}} {{--не мужской--}} {{--</label>--}} </div> </form> <div class="test-nav"> <div class="test-pages"><span class="test-pages-start">7</span> of <span class="test-pages-end">94</span></div> <div class="test-links"> <a href="#" class="test-links-back">Back</a> <a href="#" class="test-links-next">Next</a> </div> </div> </div> </div> </div> </div> </div> <div class="test_results"></div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Reset Password') }}</div> <div class="card-body"> @if (session('status')) <div class="alert alert-success" role="alert"> {{ session('status') }} </div> @endif <form method="POST" action="{{ route('password.email') }}"> @csrf <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Send Password Reset Link') }} </button> </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8">444444444444444444444 <div class="card"> <div class="card-header">{{ __('Reset Password') }}</div> <div class="card-body"> <form method="POST" action="{{ route('password.update') }}"> @csrf <input type="hidden" name="token" value="{{ $token }}"> <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-6"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label> <div class="col-md-6"> <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password"> </div> </div> <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Reset Password') }} </button> </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('title', 'Eden. Authorization') @section('content') <div class="auth"> <form class="auth-content" method="POST" action="{{ route('login') }}"> @csrf <h2 class="auth-title">Authorization</h2> <div class="auth-group"> <input id="email" type="email" placeholder="Email" class="@error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror <input id="password" type="password" placeholder="Password" class="@error('password') is-invalid @enderror" name="password" required autocomplete="current-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> <div class="auth-links"> @if (Route::has('password.request')) <a href="{{ route('password.request') }}"> Forgot your password? </a> @endif <a href="/register">Registration</a> </div> <button class="auth-btn" type="submit">Log in</button> </form> </div> <iframe id="" src="https://lms.yacl.site/user/logout" style="display: none;"></iframe> @endsection @extends('layouts.inner') @section('title', 'Eden. Registration') @section('content') <div class="auth"> <form class="auth-content" method="POST" action="{{ route('register') }}"> @csrf <h2 class="auth-title">Registration</h2> <div class="auth-group"> <input id="name" type="text" placeholder="Full Name" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus> @error('name') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror <input id="email" type="email" placeholder="Email" class="@error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email"> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> <div class="auth-group checkbox-group"> <input id="company" type="checkbox" class="form-control" name="company" value="1"> <label for="company">Company account</label> </div> <div class="auth-group"> <input id="password" placeholder="Password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror <input placeholder="Repeat password" id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password"> </div> {{--<div class="auth-confirm">--}} {{--<label class="checkbox-wrap">--}} {{--<span class="checkbox">--}} {{--<input type="checkbox" checked>--}} {{--</span>--}} {{--<span class="checkbox-text">Agree to the <a href="#">Terms</a></span>--}} {{--</label>--}} {{--</div>--}} <div class="auth-links"> <a href="/login">Log in</a> </div> <button type="submit" class="auth-btn"> Register </button> </form> </div> @endsection @extends('layouts.app') @section('content') <div class="container">123123 <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Verify Your Email Address') }}</div> <div class="card-body"> @if (session('resent')) <div class="alert alert-success" role="alert"> {{ __('A fresh verification link has been sent to your email address.') }} </div> @endif {{ __('Before proceeding, please check your email for a verification link.') }} {{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>. </div> </div> </div> </div> </div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Login') }}</div> <div class="card-body"> <form method="POST" action="{{ route('login') }}"> @csrf <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-6"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <div class="col-md-6 offset-md-4"> <div class="form-check"> <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}> <label class="form-check-label" for="remember"> {{ __('Remember Me') }} </label> </div> </div> </div> <div class="form-group row mb-0"> <div class="col-md-8 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Login') }} </button> @if (Route::has('password.request')) <a class="btn btn-link" href="{{ route('password.request') }}"> {{ __('Forgot Your Password?') }} </a> @endif </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Register') }}</div> <div class="card-body"> <form method="POST" action="{{ route('register') }}"> @csrf <div class="form-group row"> <label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label> <div class="col-md-6"> <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus> @error('name') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email"> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-6"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label> <div class="col-md-6"> <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password"> </div> </div> <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Register') }} </button> </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Verify Your Email Address') }}</div> <div class="card-body"> @if (session('resent')) <div class="alert alert-success" role="alert"> {{ __('A fresh verification link has been sent to your email address.') }} </div> @endif {{ __('Before proceeding, please check your email for a verification link.') }} {{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>. </div> </div> </div> </div> </div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Reset Password') }}</div> <div class="card-body"> @if (session('status')) <div class="alert alert-success" role="alert"> {{ session('status') }} </div> @endif <form method="POST" action="{{ route('password.email') }}"> @csrf <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Send Password Reset Link') }} </button> </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">{{ __('Reset Password') }}</div> <div class="card-body"> <form method="POST" action="{{ route('password.update') }}"> @csrf <input type="hidden" name="token" value="{{ $token }}"> <div class="form-group row"> <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> <div class="col-md-6"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus> @error('email') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-6"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label> <div class="col-md-6"> <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password"> </div> </div> <div class="form-group row mb-0"> <div class="col-md-6 offset-md-4"> <button type="submit" class="btn btn-primary"> {{ __('Reset Password') }} </button> </div> </div> </form> </div> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('title', 'Eden. Obtain your own personal career recommendations') @section('content') <div class="showcase"> <a class="logout-button" href="/logout">Log out</a> <div class="c-container"> <div class="showcase-inner"> <div class="showcase-content"> <h2 class="showcase-title">Obtain your own personal career recommendations</h2> <div class="showcase-description">See exactly how to find a career you'll love by matching your personality, talents, interests and skills to real-life jobs. Use our free career test based on Myers & Briggs' personality typing to accurately measure your career aptitude and show you the specific jobs that make the most of your strengths </div> <a data-fancybox href="#projectVideo" class="showcase-link"> <img src="/static/img/play.png" alt="youtube"> <span>Watch the video</span> </a> </div> <div class="showcase-img"></div> <div class="showcase-links"> <a href="/tests">Pass the tests</a> <span>or</span> <span class="showcase-line"></span> <a href="/skills">Select your skills and get most relevant occupations</a> </div> <a href="/tests/mbti/info" class="home-test-link"> Read more about personality test </a> </div> </div> </div> <video controls id="projectVideo" style="display:none; width: 100%; height: 100%;" > <source src="/static/video/project.mp4" type="video/mp4"> Your browser doesn't support HTML5 video tag. </video> @endsection @extends('layouts.inner') @section('title', 'Eden') @section('page_scripts') <script src="{{asset('/static/js/test_old.js') . '?v=' . \App\GTools::getFileMtime('/static/js/test_old.js') }}"></script> @endsection @section('content') <form action="" style="margin: 0 10em;" class="js-test-form"> @foreach ($testQuestions as $questionId => $question) <p> {{$question['question']}} <br/> @foreach ($question['answers'] as $id => $text) <input type="radio" name="answer[{{$questionId}}]" value="{{$id}}" class="js-{{$questionId}}_{{$id}}"> <label for="answer[{{$questionId}}]" style="cursor: pointer;" data-input="{{$questionId}}_{{$id}}"> {{$text}} @foreach (['.jpg', '.jpeg', '.png'] as $ext) @php ($path = 'static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . $ext) @if (file_exists(public_path($path))) <img src="/{{$path}}?v=2"/> @else {{-- {{base_path($path)}}--}} @endif {{--<img src="{{asset('/static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . '.jpeg')}}"/>--}} {{--<img src="{{asset('/static/img/poll/answer_' . sprintf('%02d', $questionId) . '_' . $id . '.png')}}"/>--}} @endforeach </label> <br/> @endforeach </p> @endforeach <p> Ваш пол <br/> <input type="radio" name="sex" value="m" class="js-sex_m"> <label for="sex" style="cursor: pointer;" data-input="sex_m"> мужской </label> <br/> <input type="radio" name="sex" value="f" class="js-sex_f"> <label for="sex" style="cursor: pointer;" data-input="sex_f"> не мужской </label> <br/> </p> <button type="submit">Submit</button> </form> <div class="test_results"></div> @endsection @extends('layouts.inner') @section('title', 'MBTI Test result') {{--@section('page_scripts')--}} {{--<script src="{{asset('/static/js/test.js') . '?v=' . \App\GTools::getFileMtime('/static/js/test.js') }}"></script>--}} {{--@endsection--}} @section('content') <div class="result"> <div class="c-container"> <div class="result-inner"> <div class="result-header"> <a href="/tests" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back to tests </a> </div> <div class="result-container"> <div class="result-info"> <div class="result-title">Your MBTI personality type is {{$mbtiType}}</div> <div class="result-caption">{{$name}}</div> <div class="result-img-group"> <img src="https://d31u95r9ywbjex.cloudfront.net/sites/default/files/{{$mbtiType}}_560.png" alt=""> <div class="result-text">{{$description}} </div> </div> <a href="/tests/mbti" class="result-link test-result-btn"> Try again </a> </div> <div class="result-items"> @foreach ($occupations as $item) <div class="result-item {{$item['color']}}"> <div class="result-head"> <div class="result-prof">{{$item['name']}}</div> {{--<div class="result-prof-descr">Сreative Person</div>--}} </div> <div class="result-compatibility"> <div class="text">Compatibility {{$item['distance']}}%</div> <div class="line"> <div style="width: {{$item['distance']}}%;" class="progress"></div> </div> </div> <div class="result-skills"> {{$item['printSkills']}} </div> <a href="/skills" class="result-link">Choose more skills</a> </div> @endforeach </div> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('page_scripts') <script src="{{asset('/static/js/news.js') . '?v=' . \App\GTools::getFileMtime('/static/js/news.js') }}"></script> @endsection @section('content') <div class="news" data-occupation="{{$occupation}}"> <div class="c-container"> <div class="news-inner"> <div class="news-header"> <a href="/skills" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back </a> {{--<form class="search">--}} {{--<button><img src="/static_upd/img/magnifier.png" alt=""></button>--}} {{--<input type="text" placeholder="News Search">--}} {{--</form>--}} <ul class="news-nav"> <li class="active"> <a href="#">News</a> </li> {{--<li>--}} {{--<a href="#">Articles</a>--}} {{--</li>--}} <li> <a href="{{$booksLink}}" target="_blank">Books</a> </li> {{--<li>--}} {{--<a href="#">Events</a>--}} {{--</li>--}} </ul> </div> {{--<div class="news-sort">--}} {{--<div class="news-select">--}} {{--<select class="select2">--}} {{--<option value="0">Latest</option>--}} {{--<option value="1">Newest</option>--}} {{--</select>--}} {{--</div>--}} {{--</div>--}} @if (!empty($result)) <div class="news-items"> @foreach($result as $item) <div class="news-item"> <a href="{{$item->url}}" class="news-img"> <img src="{{$item->urlToImage}}" alt=""> </a> <div class="news-tag">News</div> <a href="{{$item->url}}" target="_blank" class="news-name">{{$item->title}}</a> <div class="news-date">{{date('d.m.Y, H:i:s', strtotime($item->publishedAt))}}</div> </div> @endforeach <div class="news-item js-show-more-item"> <div class="news-more"> <a href="#"> show <span>more</span> </a> </div> </div> </div> @endif </div> </div> </div> @endsection @if (!empty($result)) @foreach($result as $item) <div class="news-item"> <a href="{{$item->url}}" class="news-img"> <img src="{{$item->urlToImage}}" alt=""> </a> <div class="news-tag">News</div> <a href="{{$item->url}}" target="_blank" class="news-name">{{$item->title}}</a> <div class="news-date">{{date('d.m.Y, H:i:s', strtotime($item->publishedAt))}}</div> </div> @endforeach @endif @extends('layouts.index') @section('title', 'Eden. MBTI Step I info') @section('content') <div class="skill_search-page page-recommendations page-test-info"> <h1 class="skill_search-page-heading heading-recommendations">About the Myers-Briggs Type Indicator Test</h1> <a class="skill_search-page-link-back" href="/tests/mbti"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Back </a> <div class="skill_search-container"> <div class="skill_search-recommendations"> <div class="skill_search-recommendations-item" style="height: auto; padding: 20px 50px; text-align: left;"> <h3 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 20px; margin-bottom: 10px; font-size: 28px; letter-spacing: 0.15px;"> The History of the MBTI® Assessment</h3> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> From early in her life, Katharine Cook Briggs was captivated by Jung’s theory of psychological types. However, she recognized that the theory as Jung explained it was too diffuse and complex for use by regular people. She therefore set out to convey Jung’s ideas in a simple way so that anyone would be able to recognize personality types in action in everyday life. She felt passionately that through understanding personality types, people would be better able to use their own strengths and appreciate the diverse gifts of others.</p> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Katharine's work was picked up by her daughter, Isabel Briggs Myers, who became interested in the theory as a way to help with the war effort during WWII. Isabel clarified the theory her mother had developed and used it as the basis of the Myers Briggs Type Indicator®, a psychological assessment designed to sort people into one of sixteen personality types. She created detailed descriptions of each of the 16 types, and explored applications of her theory in academics, business, and personal development.</p> <h3 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 20px; margin-bottom: 10px; font-size: 28px; letter-spacing: 0.15px;"> The Basics of Myers & Briggs' Personality Theory</h3> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> The Myers-Briggs system describes a person’s personality through four opposing personality functions, variously known as dichotomies, preferences or scales. The first three preferences are based on the writings of Jung; Katherine Cook Briggs added the final preference, Judging versus Perceiving, based on her own observations.</p> <ul style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> <li style="box-sizing: border-box; margin-bottom: 12px;"> <strong style="box-sizing: border-box;">Extraversion vs. Introversion</strong>: How do you gain energy? Extraverts like to be with others and gain energy from people and the environment. Introverts gain energy from alone-time and need periods of quiet reflection throughout the day. </li> <li style="box-sizing: border-box; margin-bottom: 12px;"> <strong style="box-sizing: border-box;">Sensing vs. Intuition</strong>: How do you collect information? Sensors gather facts from their immediate environment and rely on the things they can see, feel and hear. Intuitives look more at the overall context and think about patterns, meaning, and connections. </li> <li style="box-sizing: border-box; margin-bottom: 12px;"> <strong style="box-sizing: border-box;">Thinking vs. Feeling</strong>: How do you make decisions? Thinkers look for the logically correct solution, whereas Feelers make decisions based on their emotions, values, and the needs of others. </li> <li style="box-sizing: border-box; margin-bottom: 12px;"> <strong style="box-sizing: border-box;">Judging vs. Perceiving</strong>: How do you organize your environment? Judgers prefer structure and like things to be clearly regulated, whereas Perceivers like things to be open and flexible and are reluctant to commit themselves. </li> </ul> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> The choice of preference is either/or—in Myers and Briggs' system, you’re either an Introvert or an Extravert, a Judger or a Perceiver.</p> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Once you have decided which style you prefer on each of the four dichotomies, you use these four preferences to create a four letter code which sums up your personality type. For example, someone with a preference for Introversion, Intuition, Feeling and Judging would have the code “INFJ" (an Intuition preference is signified with an N to avoid confusion with Introversion). There are 16 possible combination, or personality types.</p> <h3 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 20px; margin-bottom: 10px; font-size: 28px; letter-spacing: 0.15px;"> Myers and Briggs' 16 Personality Types</h3> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Myers and Briggs outlined sixteen personality types based on the four personality preferences. Each personality type is designated with a four-letter code, with each letter signifying one of the personality preferences.</p> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Isabel Briggs Myers stressed that each personality type was more than the sum of its parts, and her descriptions of each type were intended to explain how all four of the personality preferences came together to interact, synergize, and form a cohesive type. This gives Myers and Briggs' personality type descriptions the advantage of showing us how to conceptualize various <em style="box-sizing: border-box;">combinations</em> of personality traits—for instance, the difference between someone who is extraverted, kind and compassionate, and a similarly extraverted person who is more logical and emotionally detached. Other personality systems typically talk about personality traits in isolation, which is often less helpful when trying to conceptualize a person as a whole.</p> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Briggs Myers' personality types are described in detail in her book <a href="https://www.amazon.com/Gifts-Differing-Understanding-Personality-Type/dp/089106074X" style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none; border-bottom: 1px solid rgb(237, 182, 27); padding-bottom: 2px; font-weight: 600;">Gifts Differing</a>. Further research illuminated differences among the types in career selection, work style, and approaches to relationships. Below is a quick snapshot of each of Briggs & Myers' sixteen personality types.</p> <div class="row" style="box-sizing: border-box; margin-left: -15px; margin-right: -15px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ENTJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Commander</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Strategic leaders, motivated to organize change</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">INTJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Mastermind</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Analytical problem-solvers, eager to improve systems and processes</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ENTP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Visionary</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Inspired innovators, seeking new solutions to challenging problems</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">INTP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Architect</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Philosophical innovators, fascinated by logical analysis</p> </div> </div> <div class="row" style="box-sizing: border-box; margin-left: -15px; margin-right: -15px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ENFJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Teacher</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Idealist organizers, driven to do what is best for humanity</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">INFJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Counselor</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Creative nurturers, driven by a strong sense of personal integrity</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ENFP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Champion</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> People-centered creators, motivated by possibilities and potential</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">INFP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Healer</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Imaginative idealists, guided by their own values and beliefs</p> </div> </div> <div class="row" style="box-sizing: border-box; margin-left: -15px; margin-right: -15px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ESTJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Supervisor</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Hardworking traditionalists, taking charge to get things done</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ISTJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Inspector</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Responsible organizers, driven to create order out of chaos</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ESFJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Provider</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Conscientious helpers, dedicated to their duties to others</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ISFJ</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Protector</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Industrious caretakers, loyal to traditions and institutions</p> </div> </div> <div class="row" style="box-sizing: border-box; margin-left: -15px; margin-right: -15px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ESTP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Dynamo</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Energetic thrillseekers, ready to push boundaries and dive into action</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ISTP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Craftsperson</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Observant troubleshooters, solving practical problems</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ESFP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Entertainer</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Vivacious entertainers, loving life and charming those around them</p> </div> <div class="col-md-3" style="box-sizing: border-box; position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; float: left; width: 220.5px;"> <h4 style="box-sizing: border-box; font-weight: normal; line-height: normal; color: rgb(61, 61, 61); margin-top: 10px; margin-bottom: 10px; font-size: 24px;"> <span style="box-sizing: border-box; background-color: transparent; color: rgb(237, 182, 27); text-decoration-line: none;"><strong style="box-sizing: border-box;">ISFP</strong></span></h4> <p style="box-sizing: border-box; margin: 14px 0px;"> <strong style="box-sizing: border-box;">The Composer</strong></p> <p style="box-sizing: border-box; margin: 14px 0px;"> Gentle caretakers, enjoying the moment with low-key enthusiasm</p> </div> </div> <p style="box-sizing: border-box; margin: 14px 0px; color: rgb(114, 114, 114); font-size: 15px; letter-spacing: 0.15px;"> Myers and Briggs were careful to point out that no one type is any better than another; each has their own equally valuable gifts, strengths, and contributions. It is also important to understand that while certain types tend to gravitate naturally towards particular behavior styles, a person's type cannot absolutely predict their behavior or what they will be good at. For instance, while ENTJs are often considered to have qualities we associate with leadership, an individual ENTJ may not be a particularly good leader if he or she has not developed related skills. Personality type may predispose a person to being a certain way, but the ultimate outcome depends on many more factors.</p> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('page_scripts') <script src="{{asset('/static/js/vacancy.js') . '?v=' . \App\GTools::getFileMtime('/static/js/vacancy.js') }}"></script> @endsection @section('content') <div class="vacancy"> <div class="c-container"> <div class="vacancy-inner"> <div class="vacancy-header"> <a href="/skills" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back </a> </div> <h2 class="vacancy-title">{{$title}} in {{$city}}</h2> <div class="vacancy-items c-items"> @php ($index = 0) @foreach ($vacancies as $item) @php (++$index) <div class="vacancy-item c-item"> <div class="vacancy-name">{{$item['title']}}</div> <div class="vacancy-location"> <img src="/static_upd/img/location-icon.png" alt=""> <span>{{$item['location']}}</span> </div> <div class="vacancy-skills">{{$item['description']}}</div> <div class="vacancy-info"> {{--<div class="vacancy-info-item">--}} {{--<span>Job Type</span>--}} {{--<b>Full Time</b>--}} {{--</div>--}} @if (strlen($item['salary']) > 0) <div class="vacancy-info-item"> <span>Salary</span> <b>{{$item['salary']}}</b> </div> @endif </div> <a href="{{$item['link']}}" target="_blank" class="vacancy-link">Show Now</a> </div> @if (count($vacancies) == 4 && $index == 3) <br/> @endif @endforeach <div class="vacancy-item c-item vacancy-more"> <a href="{{$link}}" target="_blank"> Show<br> <span>more</span> at indeed.com </a> </div> </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('title', 'Company profile') @section('content') <a class="logout-button" href="/logout">Log out</a> <div class="skill_search-page company-profile-page"> {{--<a class="skill_search-page-link-back" href="/" style="top: 1em;">--}} {{--<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"--}} {{--x="0px" y="0px"--}} {{--viewBox="0 0 240.823 240.823"--}} {{--style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;"--}} {{--xml:space="preserve">--}} {{--<g>--}} {{--<path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179--}} {{--l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816--}} {{--C52.942,116.507,52.942,124.327,57.633,129.007z"></path>--}} {{--</g>--}} {{--</svg>--}} {{--Home</a>--}} <div class="c-container"> <h2 class="vacancy-title">Job descriptions</h2> <div class="skill_search-search-form-block"> <form action="" class="skill_search-search-form profile-form"> <div class="input-wrapper"> <input type="text" name="search" placeholder="Search job descriptions" autocomplete="off"> </div> </form> </div> <div class="vacancy-inner"> <div class="tests-items c-items"> @foreach($res as $jd) <a href="/jd/{{$jd->id}}" class="tests-item c-item" style="padding-bottom: 0;"> <div class="tests-content"> <span class="tests-name">{{$jd->title}}</span> <span class="tests-text"><span style="font-style: italic">Esco occupation:</span> @if(is_object($jd->occupation)){{$jd->occupation->name}}@endif </span> </div> </a> @endforeach </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('page_scripts') <script src="{{asset('/static/js/news.js') . '?v=' . \App\GTools::getFileMtime('/static/js/news.js') }}"></script> @endsection @section('content') <div class="skill_search-page page-recommendations page-test-info"> <h1 class="skill_search-page-heading heading-recommendations">{{$jd->title}}</h1> <a class="skill_search-page-link-back" href="/profile"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Back </a> <div class="skill_search-container"> <div class="skill_search-recommendations"> <div class="skill_search-recommendations-item" style="height: auto; padding: 20px 50px; text-align: left;"> <p>{{$jd->intro}}</p> @if($jd->occupation) <h3>Occupation: {{$jd->occupation->name}}</h3> <p>{{$jd->occupation->description}}</p> @foreach ($jd->subcats as $subcat) <p style="font-weight: bold;">{{strip_tags($subcat->title)}}</p> @if ($subcat->text) <p>{{strip_tags($subcat->text)}}</p> @elseif (!empty($subcat->list)) <ul> @foreach($subcat->list as $item) <li>{{$item}}</li> @endforeach </ul> @endif @endforeach <h3>Required ESCO skills</h3> <ul> @foreach($jd->skillsInfo as $item) <li>{{$item->name}}</li> @endforeach </ul> <h3>Top 5 relevant students</h3> <ul> @foreach($jd->students as $user) <li>({{$user->distance}}%) {{$user->name}} ({{$user->email}}@if($user->mbti), {{$user->mbti}}@endif{{''}}@if($user->raven), IQ: {{$user->raven}}%@endif) </li> @endforeach </ul> @endif </div> </div> </div> </div> {{-- @if (!empty($result))--}} {{-- <div class="news-items">--}} {{-- @foreach($result as $item)--}} {{-- <div class="news-item">--}} {{-- <a href="{{$item->url}}" class="news-img">--}} {{-- <img src="{{$item->urlToImage}}" alt="">--}} {{-- </a>--}} {{-- <div class="news-tag">News</div>--}} {{-- <a href="{{$item->url}}" target="_blank" class="news-name">{{$item->title}}</a>--}} {{-- <div class="news-date">{{date('d.m.Y, H:i:s', strtotime($item->publishedAt))}}</div>--}} {{-- </div>--}} {{-- @endforeach--}} {{-- <div class="news-item js-show-more-item">--}} {{-- <div class="news-more">--}} {{-- <a href="#">--}} {{-- show--}} {{-- <span>more</span>--}} {{-- </a>--}} {{-- </div>--}} {{-- </div>--}} {{-- </div>--}} {{-- @endif--}} @endsection @extends('layouts.inner') @section('title', 'Raven\'s Progressive Matrices') @section('page_scripts') <script src="{{asset('/static/js/raven.js') . '?v=' . \App\GTools::getFileMtime('/static/js/raven.js') }}"></script> @endsection @section('content') <div class="test raven-test"> <div class="c-container"> <div class="test-inner"> <div class="test-header"> <a href="/tests" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back to tests </a> </div> <div class="test-container"> <div class="test-content"> <h2 class="test-title">Raven's Progressive Matrices</h2> <div class="test-text"> Raven Matrices is the test of intelligence. It was designed to measure the level of both intellectual development and logical thinking. You can determine the adults' IQ, aged 14 to 65, regardless of nationality, religion and other differences with its help. </div> <div class="test-info"> <div class="test-info-item"> <img src="/static_upd/img/clock-icon.png" alt=""> <span>20 min</span> </div> <div class="test-info-item"> <img src="/static_upd/img/coins-icon.png" alt=""> <span>Free</span> </div> </div> {{--<a href="/tests/raven/info" class="auth-btn test-about-btn">--}} {{--About Raven's matrices--}} {{--</a>--}} </div> <div class="test-steps"> <div class="test-description">The test takes 20 minutes to complete.</div> <form action="" class=""> <div class="test-items"> <div class="raven-start test-links auth-group"> {{--<input type="text" class="js-age" name="age" placeholder="Input your age"/><br/>--}} <a href="#" class="">Start test</a> </div> @for($index = 1; $index <= 60; ++$index) <div class="raven-item raven-item-{{$index}}" style="display: none;"> <img src="/static/img/raven/{{$index}}.png" style="width: 100%;"> <div class="raven-answers"> @for($answer = 1; $answer <= $answerNumber[$index]; ++$answer) <div class="answer-number" data-val="{{$answer}}" data-question="{{$index}}">{{$answer}}</div> @endfor </div> </div> @endfor </div> </form> <div class="test-nav" style="display: none;"> <div class="test-pages"><span class="test-pages-start">1</span> of <span class="test-pages-end">60</span></div> <div class="test-links"> <a href="#" class="test-links-back">Back</a> <a href="#" class="test-links-next">Next</a> </div> </div> </div> </div> </div> </div> </div> <div class="test_results"></div> @endsection @extends('layouts.index') @section('title', 'Eden. MBTI Step I info') @section('content') <div class="skill_search-page page-recommendations page-test-info"> <h1 class="skill_search-page-heading heading-recommendations">About the Raven's Progressive Matrices</h1> <a class="skill_search-page-link-back" href="/tests/mbti"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 240.823 240.823" style="enable-background:new 0 0 240.823 240.823; height: 0.5em; padding-right: 15px;" xml:space="preserve"> <g> <path fill="#788597" d="M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179 l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816 C52.942,116.507,52.942,124.327,57.633,129.007z"></path> </g> </svg> Back </a> <div class="skill_search-container"> <div class="skill_search-recommendations"> <div class="skill_search-recommendations-item" style="height: auto; padding: 20px 50px; text-align: left;"> In progress ... </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('title', 'MBTI Test result') {{--@section('page_scripts')--}} {{--<script src="{{asset('/static/js/test.js') . '?v=' . \App\GTools::getFileMtime('/static/js/test.js') }}"></script>--}} {{--@endsection--}} @section('content') <div class="result raven-result"> <div class="c-container"> <div class="result-inner"> <div class="result-header"> <a href="/tests" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Back to tests </a> </div> <div class="result-container"> <div class="result-info"> <div class="result-title">Your IQ is <span class="iq-first">{{$iqFirst}}</span><span class="iq-second">{{$iqSecond}}</span><span class="iq-third">{{$iqThird}}</span>%.</div> <div class="result-caption">{{$description}}</div> <div class="result-img-group" style="text-align: center;"> <img src="/static/img/raven/step{{$step}}.jpg" alt=""> {{--<div class="result-text">{{$description}}--}} {{--</div>--}} </div> <a href="/tests/raven" class="result-link test-result-btn"> Try again </a> </div> {{--<div class="result-items">--}} {{--@foreach ($occupations as $item)--}} {{--<div class="result-item {{$item['color']}}">--}} {{--<div class="result-head">--}} {{--<div class="result-prof">{{$item['name']}}</div>--}} {{--<div class="result-prof-descr">Сreative Person</div>--}} {{--</div>--}} {{--<div class="result-compatibility">--}} {{--<div class="text">Compatibility {{$item['distance']}}%</div>--}} {{--<div class="line">--}} {{--<div style="width: {{$item['distance']}}%;" class="progress"></div>--}} {{--</div>--}} {{--</div>--}} {{--<div class="result-skills">--}} {{--{{$item['printSkills']}}--}} {{--</div>--}} {{--<a href="/skills" class="result-link">Choose more skills</a>--}} {{--</div>--}} {{--@endforeach--}} {{--</div>--}} </div> </div> </div> </div> @endsection @extends('layouts.inner') @section('title', 'Test list') @section('page_scripts') <script src="{{asset('/static/js/news.js') . '?v=' . \App\GTools::getFileMtime('/static/js/news.js') }}"></script> @endsection @section('content') <div class="news"> <div class="c-container"> <div class="news-inner"> <div class="news-header"> <a href="/" class="back"> <img src="/static_upd/img/left-arrow.png" alt=""> Home </a> </div> {{--<div class="news-sort">--}} {{--<div class="news-select">--}} {{--<select class="select2">--}} {{--<option value="0">Latest</option>--}} {{--<option value="1">Newest</option>--}} {{--</select>--}} {{--</div>--}} {{--</div>--}} <h2 class="vacancy-title">Tests</h2> <div class="news-items test-list"> @foreach($tests as $item) <div class="news-item test-list-item"> <a href="{{$item['url']}}" class="item-name">{!!$item['title']!!}</a> <div class="news-tag">{{$item['type']}}</div> <div class="news-tag"><img src="/static_upd/img/clock-icon.png" alt="">{{$item['time']}}</div> </div> @endforeach </div> </div> </div> </div> @endsection @foreach($res as $jd) <a href="/jd/{{$jd->id}}" class="tests-item c-item" style="padding-bottom: 0;"> <div class="tests-content"> <span class="tests-name">{{$jd->title}}</span> <span class="tests-text"><span style="font-style: italic">Esco occupation:</span> {{$jd->occupation->name}} </span> </div> </a> @endforeach <?php use \Illuminate\Support\Facades\Route; use \Illuminate\Support\Facades\Auth; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/skills', 'IndexController@show')->middleware('auth'); //Route::get('/new', 'IndexControllerNew@show'); Route::get('/oktest', 'OktestController@show')->middleware('auth'); Route::get('/profile', 'CompanyProfileController@show')->middleware('auth'); Route::get('/tests', 'TestListController@show')->middleware('auth'); Route::get('/tests/raven', 'RavenTestController@show')->middleware('auth'); Route::get('/tests/raven/info', 'RavenTestController@info')->middleware('auth'); Route::get('/tests/raven/result', 'RavenTestResultController@show')->middleware('auth'); Route::get('/tests/raven/result/{iq_Percent}', 'RavenTestResultController@static')->middleware('auth'); Route::get('/tests/mbti', 'TestController@show')->middleware('auth'); Route::get('/tests/mbti/info', 'TestController@info')->middleware('auth'); Route::get('/tests/mbti/result', 'TestResultController@show')->middleware('auth'); //Route::get('/test', 'TestController@show'); Route::get('/recommendations', 'RecommendationsController@show')->middleware('auth'); Route::get('/recommendations_static', 'RecommendationsController@static'); Route::get('/', 'HomeController@index')->middleware('auth'); Route::get('/news/{occupation_id}', 'NewsController@show')->middleware('auth'); Route::get('/vacancy/{occupation_id}', 'VacancyController@show')->middleware('auth'); Route::get('/jd/{jd_id}', 'JobDescriptionController@show')->middleware('auth'); Route::get('/ajax/getRelevantSkills', 'Ajax\RelevantSkills@show'); Route::get('/ajax/getRelevantOccupations', 'Ajax\RelevantOccupations@show'); //Route::get('/ajax/proceedTest', 'Ajax\ProceedTest@show'); Route::post('/ajax/proceedTest', 'Ajax\ProceedTest@show'); Route::post('/ajax/proceedRavenTest', 'Ajax\ProceedRavenTest@show'); Route::get('/ajax/getRelevantNews', 'Ajax\RelevantNews@show'); Route::get('/ajax/getRelevantJobDescriptions', 'Ajax\RelevantJobDescriptions@show'); Route::get('/home', function () { return redirect('/', 301); }); Auth::routes(); Route::get('logout', 'Auth\LoginController@logout')->name('logout');