Add candidate and employer templates, application form, and new password functionality

- Created 'dla-kandydata.php' template for candidates with job offers and registration options.
- Developed 'dla-pracodawcy.php' template for employers detailing how Globelus works and registration for new employers.
- Implemented 'advert-apply.php' for job applications, including form validation and file upload for CVs.
- Added 'new-password.php' for users to set a new password with validation for password strength and matching.
This commit is contained in:
2025-05-24 11:51:42 +02:00
parent 4fdd906b81
commit 905c0f0d89
59 changed files with 1987 additions and 791 deletions

View File

@@ -215,6 +215,11 @@ class GlobelusFirms
return $file_name = 'files/img_header/' . $img_header_hash[0] . '/' . $img_header_hash[1] . '/' . $img_header_hash;
}
static public function img_top_url( $user_id ) {
$img_top_hash = \front\factory\GlobelusFirms::img_header_hash( $user_id );
return $file_name = 'files/img_header/' . $img_top_hash[0] . '/' . $img_top_hash[1] . '/' . $img_top_hash;
}
public static function img_bottom_url($user_id)
{
$img_bottom_hash = \front\factory\GlobelusFirms::img_bottom_hash($user_id);
@@ -657,7 +662,7 @@ class GlobelusFirms
]);
}
public static function advert_refresh($advert_id, $user_id)
public static function advert_refresh( $advert_id, $user_id )
{
global $mdb, $globelus_settings;
@@ -943,7 +948,7 @@ class GlobelusFirms
$highlight = $mdb->get('globelus_adverts', 'highlight', ['AND' => ['user_id' => $user_id, 'id' => $advert_id]]);
$main_page = $mdb->get('globelus_adverts', 'main_page', ['AND' => ['user_id' => $user_id, 'id' => $advert_id]]);
if ($globelus_settings['maile-wysylanie'])
if ( $globelus_settings['maile-wysylanie'] )
{
$text = $settings['newsletter_header'];
$text .= \front\factory\Newsletter::get_template('#potwierdzenie-dodania-ogloszenia');
@@ -972,9 +977,9 @@ class GlobelusFirms
'msg' => '<p>Ogłoszenie <b>' . \front\factory\GlobelusAdverts::advert_title($advert_id) . '<\/b> jest już widoczne.</p>'
];
if ($mdb->update('globelus_adverts', ['visible' => 1, 'mail_expired' => 0, 'old' => 0 ], ['AND' => ['user_id' => $user_id, 'id' => $advert_id]]))
if ( $mdb -> update('globelus_adverts', ['visible' => 1, 'mail_expired' => 0 ], ['AND' => ['user_id' => $user_id, 'id' => $advert_id]]))
{
if (\front\factory\GlobelusFirms::adverts_count($user_id) > $globelus_settings['limit-ogloszen'] and \front\factory\GlobelusFirms::get_firm_points($user_id) >= $globelus_settings['pkt-dodanie-ogloszenia-powyzej-limitu'])
if ( \front\factory\GlobelusFirms::adverts_count($user_id) > $globelus_settings['limit-ogloszen'] and \front\factory\GlobelusFirms::get_firm_points($user_id) >= $globelus_settings['pkt-dodanie-ogloszenia-powyzej-limitu'] )
{
$mdb->update('globelus_users', ['points[-]' => $globelus_settings['pkt-dodanie-ogloszenia-powyzej-limitu']], ['id' => $user_id]);
$mdb->insert('globelus_points_history', [
@@ -984,6 +989,11 @@ class GlobelusFirms
]);
}
if ( $mdb -> get( 'globelus_adverts', 'old', [ 'id' => $advert_id ] ) )
{
$mdb->update('globelus_adverts', [ 'old' => 0, 'active_to' => date( 'Y-m-d', strtotime('+' . $globelus_settings['ogloszenie-ilosc-dni-waznosci'] . ' days', time())), 'date_add' => date( 'Y-m-d H:i:s' ) ], [ 'id' => $advert_id ]);
}
return [
'result' => true,
'msg' => '<p>Ogłoszenie <b>' . \front\factory\GlobelusAdverts::advert_title($advert_id) . '<\/b> zostało opublikowane.</p>'
@@ -1044,9 +1054,6 @@ class GlobelusFirms
'contact_person' => $values['contact_person'],
'email' => $values['email'],
'phone' => $values['phone'],
'contact_person2' => $values['contact_person2'],
'email2' => $values['email2'],
'phone2' => $values['phone2'],
'highlight' => 0,
'main_page' => 0,
'active_to' => $globelus_settings['ogloszenie-ilosc-dni-waznosci'] ? date('Y-m-d', strtotime('+' . $globelus_settings['ogloszenie-ilosc-dni-waznosci'] . ' days', time())) : date('Y-m-d', strtotime('+180 days', time())),
@@ -1084,9 +1091,6 @@ class GlobelusFirms
'contact_person' => $values['contact_person'],
'email' => $values['email'],
'phone' => $values['phone'],
'contact_person2' => $values['contact_person2'],
'email2' => $values['email2'],
'phone2' => $values['phone2'],
'salary' => trim(strip_tags($values['salary'])) ? trim(strip_tags($values['salary'])) : null,
'work_type' => $values['work_type'],
'without_language' => $values['without_language'],
@@ -1108,7 +1112,7 @@ class GlobelusFirms
]
]);
if ($mdb->get('globelus_adverts', 'old', ['AND' => ['id' => $values['advert_id'], 'user_id' => $values['user_id']]]))
if ( $mdb ->get('globelus_adverts', 'old', ['AND' => ['id' => $values['advert_id'], 'user_id' => $values['user_id']]]))
{
$mdb->update('globelus_adverts', [
'old' => 0,