first commit
This commit is contained in:
76
autoload/front/controls/class.Articles.php
Normal file
76
autoload/front/controls/class.Articles.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class Articles
|
||||
{
|
||||
public static function pixieset_save_favorite_images( $hash )
|
||||
{
|
||||
return \front\factory\Articles::pixieset_save_favorite_images( $hash );
|
||||
}
|
||||
|
||||
public static function pixieset_image_favorite( $image_id, $hash )
|
||||
{
|
||||
return \front\factory\Articles::pixieset_image_favorite( $image_id, $hash );
|
||||
}
|
||||
|
||||
public static function images_download( $hash )
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$results = $mdb -> query( 'SELECT * FROM ('
|
||||
. 'SELECT id, MD5( CONCAT( id, date_add ) ) AS hash FROM pp_articles ) AS q1'
|
||||
. ' WHERE hash = \'' . $hash . '\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
|
||||
if ( is_array( $results ) and count( $results ) ) foreach ( $results as $row )
|
||||
{
|
||||
$zip = new \ZipArchive;
|
||||
$tmp_file = 'temp/' . $hash . '.zip';
|
||||
|
||||
if ( file_exists( $tmp_file ) )
|
||||
return $tmp_file;
|
||||
|
||||
if ( $zip -> open( $tmp_file, \ZipArchive::CREATE ) )
|
||||
{
|
||||
$results2 = $mdb -> select( 'pp_articles_images', 'src', [ 'article_id' => $row['id'] ] );
|
||||
if ( is_array( $results2 ) and count( $results2 ) ) foreach ( $results2 as $row2 )
|
||||
{
|
||||
$file = substr( $row2, 1, strlen( $row2 ) );
|
||||
$zip -> addFile( $file, basename( $file ) );
|
||||
}
|
||||
|
||||
$zip -> close();
|
||||
|
||||
return $tmp_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function image()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$results = $mdb -> query( 'SELECT * FROM ('
|
||||
. 'SELECT id, src, MD5( CONCAT( id, src ) ) AS hash FROM pp_articles_images ) AS q1'
|
||||
. ' WHERE hash = \'' . \S::get( 'hash' ) . '\'' ) -> fetchAll( \PDO::FETCH_ASSOC );
|
||||
if ( is_array( $results ) and count( $results ) )
|
||||
{
|
||||
$file = substr( $results[0]['src'], 1, strlen( $results[0]['src'] ) );
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="' . basename( $file ) . '"');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize( $file ) );
|
||||
flush();
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function article_unlock( $password, $article_id )
|
||||
{
|
||||
if ( $password == \front\factory\Articles::article_password( $article_id ) )
|
||||
\S::set_session( 'article-' . $article_id . '-' . $password, true );
|
||||
}
|
||||
}
|
||||
39
autoload/front/controls/class.AuditSEO.php
Normal file
39
autoload/front/controls/class.AuditSEO.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class AuditSEO
|
||||
{
|
||||
public static function data05()
|
||||
{
|
||||
echo json_encode( \front\factory\AuditSEO::data05( \S::get( 'url' ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function data04()
|
||||
{
|
||||
echo json_encode( \front\factory\AuditSEO::data04( \S::get( 'url' ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function data03()
|
||||
{
|
||||
echo json_encode( \front\factory\AuditSEO::data03( \S::get( 'url' ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function data02()
|
||||
{
|
||||
echo json_encode( \front\factory\AuditSEO::data02( \S::get( 'url' ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function data01()
|
||||
{
|
||||
echo json_encode( \front\factory\AuditSEO::data01( \S::get( 'url' ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function main_view()
|
||||
{
|
||||
return \Tpl::view( 'audit-seo/main-view' );
|
||||
}
|
||||
}
|
||||
496
autoload/front/controls/class.GlobelusAdverts.php
Normal file
496
autoload/front/controls/class.GlobelusAdverts.php
Normal file
@@ -0,0 +1,496 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusAdverts
|
||||
{
|
||||
public static function last_adverts( $limit = 3 )
|
||||
{
|
||||
return \front\view\GlobelusAdverts::last_adverts(
|
||||
\front\factory\GlobelusAdverts::last_adverts( $limit )
|
||||
);
|
||||
}
|
||||
|
||||
public static function main_page_adverts( $limit = 5 )
|
||||
{
|
||||
return \front\view\GlobelusAdverts::main_page_adverts(
|
||||
\front\factory\GlobelusAdverts::main_page_adverts( $limit )
|
||||
);
|
||||
}
|
||||
|
||||
public static function top_firms( $limit = 5 )
|
||||
{
|
||||
return \front\view\GlobelusAdverts::top_firms(
|
||||
\front\factory\GlobelusAdverts::top_firms( $limit )
|
||||
);
|
||||
}
|
||||
|
||||
public static function top_categories( $limit = 5 )
|
||||
{
|
||||
return \front\view\GlobelusAdverts::top_categories(
|
||||
\front\factory\GlobelusAdverts::top_categories( $limit )
|
||||
);
|
||||
}
|
||||
|
||||
public static function top_countries( $limit = 5 )
|
||||
{
|
||||
return \front\view\GlobelusAdverts::top_countries(
|
||||
\front\factory\GlobelusAdverts::top_countries( $limit )
|
||||
);
|
||||
}
|
||||
|
||||
public static function remove_from_favorite()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusAdverts::remove_from_favorite( \S::get( 'advert_id' ), $g_user['id'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['ogloszenie-zostalo-usuniete-obserwowanych'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function add_to_favorite()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusAdverts::add_to_favorite( \S::get( 'advert_id' ), $g_user['id'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['ogloszenie-zostalo-dodane-do-obserwowanych'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function send_message()
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
\front\factory\GlobelusAdverts::send_message(
|
||||
\S::get( 'advert_id' ), $g_user['id'], \S::get( 'name' ), \S::get( 'surname' ), \S::get( 'email' ), \S::get( 'phone' ), \S::get( 'text' ), $_FILES['cv'], \S::get( 'register' )
|
||||
);
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_details()
|
||||
{
|
||||
global $page, $settings;
|
||||
|
||||
$advert_details = \front\factory\GlobelusAdverts::advert_details( \S::get( 'advert_id' ) );
|
||||
$page['language']['meta_title'] = $advert_details['title'] . ' - ' . $advert_details['country_name'] . ' - oferta pracy | Globelus';
|
||||
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
$settings['ssl'] ? $base = 'https' : $base = 'http';
|
||||
|
||||
$page['language']['canonical'] = $base . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
|
||||
|
||||
if ( ( !$advert_details['visible'] or $advert_details['old'] ) and $advert_details['user_id'] != $g_user['id'] ) {
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/adverts/advert-details', [
|
||||
'advert' => $advert_details,
|
||||
'g_user' => $g_user,
|
||||
'similar_adverts' => \front\factory\GlobelusAdverts::get_similar_adverts( $advert_details )
|
||||
] );
|
||||
}
|
||||
|
||||
public static function adverts_list()
|
||||
{
|
||||
global $page, $settings;
|
||||
|
||||
if ( \S::get( 'filtr_reset' ) == true )
|
||||
{
|
||||
\S::delete_session( 'adverts-filtr-categories' );
|
||||
\S::delete_session( 'adverts-filtr-keyword' );
|
||||
\S::delete_session( 'adverts-filtr-countries' );
|
||||
\S::delete_session( 'adverts-filtr-voivodeships' );
|
||||
\S::delete_session( 'adverts-filtr-time' );
|
||||
\S::delete_session( 'adverts-filtr-work-type' );
|
||||
\S::delete_session( 'adverts-filtr-salary' );
|
||||
\S::delete_session( 'adverts-filtr-without-language' );
|
||||
\S::delete_session( 'adverts-filtr-without-experience' );
|
||||
\S::delete_session( 'adverts_filtr_for_couples' );
|
||||
\S::delete_session( 'adverts_filtr_outside_ue' );
|
||||
\S::delete_session( 'adverts_filtr_without_driving_license' );
|
||||
\S::delete_session( 'adverts_filtr_travel_refund' );
|
||||
\S::delete_session( 'adverts_filtr_sort' );
|
||||
\S::delete_session( 'adverts-filtr-countries' );
|
||||
\S::delete_session( 'adverts-filtr-categories' );
|
||||
\S::delete_session( 'adverts_filtr_accommodation_provided' );
|
||||
}
|
||||
|
||||
if ( \S::get( 'filtr' ) )
|
||||
{
|
||||
\S::set_session( 'adverts-filtr-categories', \S::get( 'c1' ) );
|
||||
\S::set_session( 'adverts-filtr-keyword', \S::get( 'k' ) );
|
||||
\S::set_session( 'adverts-filtr-countries', \S::get( 'c2' ) );
|
||||
\S::set_session( 'adverts-filtr-voivodeships', \S::get( 'v' ) );
|
||||
\S::set_session( 'adverts-filtr-time', \S::get( 't' ) );
|
||||
\S::set_session( 'adverts-filtr-work-type', \S::get( 'wt' ) );
|
||||
\S::set_session( 'adverts-filtr-salary', \S::get( 'sl' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts-filtr-without-language', \S::get( 'wl' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts-filtr-without-experience', \S::get( 'we' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts_filtr_for_couples', \S::get( 'fc' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts_filtr_outside_ue', \S::get( 'oue' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts_filtr_without_driving_license', \S::get( 'wdl' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts_filtr_travel_refund', \S::get( 'tr' ) == 'on' ? 1 : 0 );
|
||||
\S::set_session( 'adverts_filtr_sort', (int)\S::get( 's' ) );
|
||||
\S::set_session( 'adverts_filtr_accommodation_provided', \S::get( 'ap' ) == 'on' ? 1 : 0 );
|
||||
|
||||
if ( \S::get( 'cc_name' ) and $tmp_country_id = \front\factory\Globelus::country_id_by_nameseo( \S::get( 'cc_name' ) ) )
|
||||
\S::set_session( 'adverts-filtr-countries', [ 0 => $tmp_country_id ] );
|
||||
|
||||
if ( \S::get( 'cc_name2' ) and $tmp_category_id = \front\factory\Globelus::category_id_by_nameseo( \S::get( 'cc_name2' ) ) )
|
||||
\S::set_session( 'adverts-filtr-categories', [ 0 => $tmp_category_id ] );
|
||||
}
|
||||
|
||||
$countries = \S::get_session( 'adverts-filtr-countries' );
|
||||
$voivodeships = \S::get_session( 'adverts-filtr-voivodeships' );
|
||||
$keywords = \S::get_session( 'adverts-filtr-keyword' );
|
||||
$categories = \S::get_session( 'adverts-filtr-categories' );
|
||||
$time = \S::get_session( 'adverts-filtr-time' );
|
||||
$work_type = \S::get_session( 'adverts-filtr-work-type' );
|
||||
$salary = \S::get_session( 'adverts-filtr-salary' );
|
||||
$without_lang = \S::get_session( 'adverts-filtr-without-language' );
|
||||
$without_exp = \S::get_session( 'adverts-filtr-without-experience' );
|
||||
$for_couples = \S::get_session( 'adverts_filtr_for_couples' );
|
||||
$outside_ue = \S::get_session( 'adverts_filtr_outside_ue' );
|
||||
$without_driving_license = \S::get_session( 'adverts_filtr_without_driving_license' );
|
||||
$travel_refund = \S::get_session( 'adverts_filtr_travel_refund' );
|
||||
$sort = \S::get_session( 'adverts_filtr_sort' );
|
||||
$accommodation_provided = \S::get_session( 'adverts_filtr_accommodation_provided' );
|
||||
|
||||
if ( is_array( $countries ) and count( $countries ) === 1 and $countries[0] != 75 and $countries[0] != 77 )
|
||||
{
|
||||
if ( is_array( $categories ) and count( $categories ) === 1 and !$voivodeships and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
$category_name = \S::seo( \front\factory\Globelus::category_name( $categories[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $category_name ) === false )
|
||||
{
|
||||
if ( !$keywords and !$time )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/' . $category_name );
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/' . $category_name . '/' . str_replace( [ '/oferty-pracy/', '/oferty-pracy' ], [ '', '' ], $_SERVER['REQUEST_URI'] ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( $salary and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/z-podanym-wynagrodzeniem' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if ( !$salary and $without_lang and !$without_exp and !$for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/bez-jezyka' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if ( !$salary and !$without_lang and $without_exp and !$for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/bez-doswiadczenia' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if ( !$salary and !$without_lang and !$without_exp and $for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/dla-par' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if ( !$salary and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
if ( $_SERVER['REMOTE_ADDR'] == '83.24.103.179' )
|
||||
{
|
||||
var_dump( $voivodeships );
|
||||
exit;
|
||||
}
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/od-zaraz' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if ( !$salary and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$keywords and !$categories and !$time and !$work_type and ( $voivodeships and count( $voivodeships ) == 1 ) and !$accommodation_provided )
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/' . \front\factory\Globelus::get_voivodeship_seo( $voivodeships[0] ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$country_name = \S::seo( \front\factory\Globelus::country_name( $countries[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $country_name ) === false )
|
||||
{
|
||||
if ( !$keywords and !$categories and !$time and !$work_type and !$salary and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$voivodeships and !$accommodation_provided )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name );
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $country_name . '/' . str_replace( [ '/oferty-pracy/', '/oferty-pracy' ], [ '', '' ], $_SERVER['REQUEST_URI'] ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_array( $categories ) and count( $categories ) === 1 )
|
||||
{
|
||||
$category_name = \S::seo( \front\factory\Globelus::category_name( $categories[0] ), true );
|
||||
if ( strpos( $_SERVER['REQUEST_URI'], $category_name ) === false )
|
||||
{
|
||||
if ( !$keywords and !$countries and !$time and !$work_type and !$salary and !$without_lang and !$without_exp and !$for_couples and !$outside_ue and !$accommodation_provided )
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $category_name );
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header( 'Location: /oferty-pracy/' . $category_name . '/' . str_replace( [ '/oferty-pracy/', '/oferty-pracy' ], [ '', '' ], $_SERVER['REQUEST_URI'] ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$adverts_count = \front\factory\GlobelusAdverts::adverts_count( [
|
||||
'categories' => \S::get_session( 'adverts-filtr-categories' ),
|
||||
'keyword' => \S::get_session( 'adverts-filtr-keyword' ),
|
||||
'countries' => \S::get_session( 'adverts-filtr-countries' ),
|
||||
'time' => \S::get_session( 'adverts-filtr-time' ),
|
||||
'work_type' => \S::get_session( 'adverts-filtr-work-type' ),
|
||||
'salary' => \S::get_session( 'adverts-filtr-salary' ),
|
||||
'without_language' => \S::get_session( 'adverts-filtr-without-language' ),
|
||||
'without_experience' => \S::get_session( 'adverts-filtr-without-experience' ),
|
||||
'for_couples' => \S::get_session( 'adverts_filtr_for_couples' ),
|
||||
'outside_ue' => \S::get_session( 'adverts_filtr_outside_ue' ),
|
||||
'without_driving_license' => \S::get_session( 'adverts_filtr_without_driving_license' ),
|
||||
'travel_refund' => \S::get_session( 'adverts_filtr_travel_refund' ),
|
||||
],
|
||||
\S::get_session( 'adverts-filtr-voivodeships' ),
|
||||
\S::get_session( 'adverts_filtr_accommodation_provided' )
|
||||
);
|
||||
|
||||
if ( $adverts_count > 0 and (int)\S::get( 'cp' ) > ceil( $adverts_count / \front\factory\GlobelusAdverts::advert_list_limit ) )
|
||||
{
|
||||
$query_string = preg_replace( '/\/oferty-pracy\/([0-9]*)/', '', $_SERVER['REQUEST_URI'] );
|
||||
header( 'Location: /oferty-pracy/' . $query_string );
|
||||
exit;
|
||||
}
|
||||
|
||||
$adverts_filtr_countries = \S::get_session( 'adverts-filtr-countries' );
|
||||
$adverts_filtr_categories = \S::get_session( 'adverts-filtr-categories' );
|
||||
|
||||
if ( is_array( $adverts_filtr_countries ) and is_array( $adverts_filtr_categories ) )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca ';
|
||||
foreach ( $adverts_filtr_countries as $cou_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::country_name( $cou_tmp );
|
||||
if ( $cou_tmp != end( $adverts_filtr_countries ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
|
||||
$page['language']['meta_title'] .= ', oferty pracy ';
|
||||
foreach ( $adverts_filtr_categories as $cat_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::category_name( $cat_tmp );
|
||||
if ( $cat_tmp != end( $adverts_filtr_categories ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
|
||||
$page['language']['meta_title'] .= ' - Najnowsze oferty | globelus.pl';
|
||||
}
|
||||
|
||||
if ( is_array( $adverts_filtr_categories ) and !is_array( $adverts_filtr_countries ) )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca ';
|
||||
foreach ( $adverts_filtr_categories as $cat_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::category_name( $cat_tmp );
|
||||
if ( $cat_tmp != end( $adverts_filtr_categories ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
$page['language']['meta_title'] .= ' - Najnowsze oferty pracy | globelus.pl';
|
||||
}
|
||||
|
||||
if ( !is_array( $adverts_filtr_categories ) and is_array( $adverts_filtr_countries ) and $salary and !$without_lang and !$without_exp and !$for_couples and !$keywords and !$categories and !$time and !$work_type )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca z podanym wynagrodzeniem ';
|
||||
foreach ( $adverts_filtr_countries as $cou_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::country_name( $cou_tmp );
|
||||
if ( $cou_tmp != end( $adverts_filtr_countries ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
$page['language']['meta_title'] .= ' - Aktualne oferty pracy | Globelus';
|
||||
}
|
||||
|
||||
if ( !is_array( $adverts_filtr_categories ) and is_array( $adverts_filtr_countries ) and !$salary and $without_lang and !$without_exp and !$for_couples and !$keywords and !$categories and !$time and !$work_type )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca bez języka ';
|
||||
foreach ( $adverts_filtr_countries as $cou_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::country_name( $cou_tmp );
|
||||
if ( $cou_tmp != end( $adverts_filtr_countries ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
$page['language']['meta_title'] .= ' - Aktualne oferty pracy | Globelus';
|
||||
}
|
||||
|
||||
if ( !is_array( $adverts_filtr_categories ) and is_array( $adverts_filtr_countries ) and !$salary and !$without_lang and $without_exp and !$for_couples and !$keywords and !$categories and !$time and !$work_type )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca bez doświadczenia ';
|
||||
foreach ( $adverts_filtr_countries as $cou_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::country_name( $cou_tmp );
|
||||
if ( $cou_tmp != end( $adverts_filtr_countries ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
$page['language']['meta_title'] .= ' - Aktualne oferty pracy | Globelus';
|
||||
}
|
||||
|
||||
if ( !is_array( $adverts_filtr_categories ) and is_array( $adverts_filtr_countries ) and !$salary and !$without_lang and !$without_exp and $for_couples and !$keywords and !$categories and !$time and !$work_type )
|
||||
{
|
||||
$page['language']['meta_title'] = 'Praca dla par ';
|
||||
foreach ( $adverts_filtr_countries as $cou_tmp )
|
||||
{
|
||||
$page['language']['meta_title'] .= \front\factory\Globelus::country_name( $cou_tmp );
|
||||
if ( $cou_tmp != end( $adverts_filtr_countries ) )
|
||||
$page['language']['meta_title'] .= ', ';
|
||||
}
|
||||
$page['language']['meta_title'] .= ' - Aktualne oferty pracy | Globelus';
|
||||
}
|
||||
|
||||
if ( !is_array( $adverts_filtr_categories ) and is_array( $adverts_filtr_countries ) )
|
||||
{
|
||||
if ( count( $adverts_filtr_countries ) === 1 )
|
||||
{
|
||||
$page['language']['title'] = 'Praca ' . str_replace( '-', '', \front\factory\Globelus::country_name( $adverts_filtr_countries[0] ) );
|
||||
$page['show_title'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_array( $adverts_filtr_categories ) and !is_array( $adverts_filtr_countries ) )
|
||||
{
|
||||
if ( count( $adverts_filtr_categories ) === 1 )
|
||||
{
|
||||
$page['language']['title'] = 'Praca ' . strtolower( \front\factory\Globelus::category_name( $adverts_filtr_categories[0] ) );
|
||||
$page['show_title'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$adverts_list = \front\factory\GlobelusAdverts::adverts_list( [
|
||||
'start' => \S::get( 'cp' ),
|
||||
'limit' => \front\factory\GlobelusAdverts::advert_list_limit,
|
||||
'categories' => $adverts_filtr_categories,
|
||||
'keyword' => \S::get_session( 'adverts-filtr-keyword' ),
|
||||
'countries' => \S::get_session( 'adverts-filtr-countries' ),
|
||||
'time' => \S::get_session( 'adverts-filtr-time' ),
|
||||
'work_type' => \S::get_session( 'adverts-filtr-work-type' ),
|
||||
'salary' => \S::get_session( 'adverts-filtr-salary' ),
|
||||
'without_language' => \S::get_session( 'adverts-filtr-without-language' ),
|
||||
'without_experience' => \S::get_session( 'adverts-filtr-without-experience' ),
|
||||
'for_couples' => \S::get_session( 'adverts_filtr_for_couples' ),
|
||||
'outside_ue' => \S::get_session( 'adverts_filtr_outside_ue' ),
|
||||
'without_driving_license' => \S::get_session( 'adverts_filtr_without_driving_license' ),
|
||||
'travel_refund' => \S::get_session( 'adverts_filtr_travel_refund' ),
|
||||
'sort' => \S::get_session( 'adverts_filtr_sort' )
|
||||
],
|
||||
\S::get_session( 'adverts-filtr-voivodeships' ),
|
||||
\S::get_session( 'adverts_filtr_accommodation_provided' )
|
||||
);
|
||||
|
||||
if ( \S::get( 'cp' ) > 0 )
|
||||
{
|
||||
$query_string = preg_replace( '/oferty-pracy/', '', $_SERVER['REQUEST_URI'] );
|
||||
$query_string = preg_replace( '/([0-9]*)/', '', $query_string );
|
||||
$query_string = preg_replace( '/\?/', '', $query_string );
|
||||
$query_string = preg_replace( '/\//', '', $query_string );
|
||||
|
||||
if ( strpos( $query_string, $category_name ) !== false )
|
||||
$query_string = str_replace( $category_name, '', $query_string );
|
||||
|
||||
if ( strpos( $query_string, $country_name ) !== false )
|
||||
$query_string = str_replace( $country_name, '', $query_string );
|
||||
|
||||
$url = 'oferty-pracy';
|
||||
|
||||
if ( $country_name )
|
||||
$url .= '/' . $country_name;
|
||||
|
||||
if ( $category_name )
|
||||
$url .= '/' . $category_name;
|
||||
|
||||
$settings['ssl'] ? $base = 'https' : $base = 'http';
|
||||
|
||||
$url = $base . '://' . $_SERVER['SERVER_NAME'] . '/' . $url;
|
||||
|
||||
if ( \S::get( 'cp' ) > 1 )
|
||||
$page['language']['noindex'] = '1';
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/adverts/adverts-list', [
|
||||
'values' => [
|
||||
'adverts' => $adverts_list,
|
||||
'adverts_count' => $adverts_count,
|
||||
'country_name' => $country_name,
|
||||
'category_name' => $category_name,
|
||||
'categories' => \front\factory\GlobelusAdverts::categories(),
|
||||
'countries' => \front\factory\Globelus::countries(),
|
||||
'work_types' => \front\factory\Globelus::work_types(),
|
||||
'f_categories' => $adverts_filtr_categories,
|
||||
'f_keyword' => \S::get_session( 'adverts-filtr-keyword' ),
|
||||
'f_countries' => \S::get_session( 'adverts-filtr-countries' ),
|
||||
'f_time' => \S::get_session( 'adverts-filtr-time' ),
|
||||
'f_work_type' => \S::get_session( 'adverts-filtr-work-type' ),
|
||||
'f_salary' => \S::get_session( 'adverts-filtr-salary' ),
|
||||
'f_without_language' => \S::get_session( 'adverts-filtr-without-language' ),
|
||||
'f_without_experience' => \S::get_session( 'adverts-filtr-without-experience' ),
|
||||
'f_for_couples' => \S::get_session( 'adverts_filtr_for_couples' ),
|
||||
'f_outside_ue' => \S::get_session( 'adverts_filtr_outside_ue' ),
|
||||
'f_without_driving_license' => \S::get_session( 'adverts_filtr_without_driving_license' ),
|
||||
'f_travel_refund' => \S::get_session( 'adverts_filtr_travel_refund' ),
|
||||
],
|
||||
'voivodeships' => \front\factory\Globelus::get_voivodeships_list(),
|
||||
'f_voivodeships' => \S::get_session( 'adverts-filtr-voivodeships' ),
|
||||
'f_accommodation_provided' => \S::get_session( 'adverts_filtr_accommodation_provided' )
|
||||
] );
|
||||
}
|
||||
}
|
||||
198
autoload/front/controls/class.GlobelusCandidates.php
Normal file
198
autoload/front/controls/class.GlobelusCandidates.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusCandidates
|
||||
{
|
||||
public static function new_candidate()
|
||||
{
|
||||
if ( \S::get( 'name', true ) and \S::get( 'surname', true ) and \S::get( 'email', true ) )
|
||||
{
|
||||
$temp_data['p'] = $_POST;
|
||||
\S::set_session( 'td', $temp_data );
|
||||
|
||||
$results = \front\factory\GlobelusCandidates::register_candidate(
|
||||
\S::get( 'email' ), \S::get( 'name' ), \S::get( 'surname' ), \S::get( 'phone' ), \S::get( 'date_of_birth' ), \S::get( 'sex' ), \S::get( 'positions' ), \S::get( 'positions_experience' ),
|
||||
\S::get( 'inexperience' ), \S::get( 'categories' ), \S::get( 'languages' ), \S::get( 'languages_experience' ), \S::get( 'countries' ), \S::get( 'voivodeships' ), \S::get( 'status_of_availability' ),
|
||||
\S::get( 'date_of_availability' ), \S::get( 'experience_abroad' ), \S::get( 'accommodation' ), \S::get( 'driving_license' ), \S::get( 'own_car' ), \S::get( 'other_information' ),
|
||||
$_FILES['cv'], $_FILES['avatar']
|
||||
);
|
||||
|
||||
\S::set_alert_prompt( 'Informacja', $results['msg'] );
|
||||
|
||||
if ( $results['status'] == 'ok' )
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
else
|
||||
header( 'Location: /jakiej-pracy-szukasz' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public static function cv_tmp_download()
|
||||
{
|
||||
return \front\factory\GlobelusCandidates::cv_tmp_download( \S::get( 'answer_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function adverts_list()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusCandidates::adverts_list(
|
||||
\front\factory\GlobelusCandidates::adverts_list( $g_user['id'] )
|
||||
);
|
||||
}
|
||||
|
||||
public static function answers_list()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusCandidates::answers_list(
|
||||
\front\factory\GlobelusCandidates::answers_list( $g_user['id'] )
|
||||
);
|
||||
}
|
||||
|
||||
public static function avatar()
|
||||
{
|
||||
return \front\factory\GlobelusCandidates::avatar( \S::get( 'user_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function cv_download()
|
||||
{
|
||||
return \front\factory\GlobelusCandidates::cv_download( \S::get( 'user_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function profile_disable()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusCandidates::profile_disable( $g_user['id'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-wylaczone' ] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function profile_enable()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusCandidates::profile_enable( $g_user['id'], $g_user['email'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-opublikowane' ] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function profile_extend()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( !$g_user or $g_user['type'] )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusCandidates::profile_extend( $g_user['id'], $g_user['active_to'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-przedluzone' ] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function profile_refresh()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusCandidates::profile_refresh( $g_user['id'], $g_user['last_refresh'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-odzwiezone' ] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function change_password()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusUser::user_change_password( $g_user['id'], \S::get( 'current_password' ), \S::get( 'new_password' ), \S::get( 'repeat_new_password' ) );
|
||||
|
||||
header( 'Location: /panel-kandydata/ustawienia-konta' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function profile_settings()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusCandidates::profile_settings( $g_user );
|
||||
}
|
||||
|
||||
public static function data_save()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusCandidates::datą_save(
|
||||
$g_user['id'], \S::get( 'name' ), \S::get( 'surname' ), \S::get( 'date_of_birth' ), \S::get( 'sex' ), \S::get( 'phone' ), \S::get( 'experience_abroad' ), \S::get( 'status_of_availability' ),
|
||||
\S::get( 'date_of_availability' ), \S::get( 'accommodation' ), \S::get( 'driving_license' ), \S::get( 'own_car' ), \S::get( 'positions' ), \S::get( 'positions_experience' ),
|
||||
\S::get( 'inexperience' ), \S::get( 'countries' ), \S::get( 'voivodeships' ), \S::get( 'languages' ), \S::get( 'languages_experience' ), \S::get( 'other_information' ), \S::get( 'categories' ), $_FILES['cv'], $_FILES['avatar']
|
||||
) )
|
||||
{
|
||||
if ( $g_user['visible'] )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['dane-zostaly-zaktualizowane'] );
|
||||
else
|
||||
\S::set_alert_prompt( 'Informacja', $lang['dane-zostaly-zaktualizowane-nieopublikowany-profil'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
}
|
||||
else
|
||||
header( 'Location: /panel-kandydata/edycja-profilu' );
|
||||
exit;
|
||||
}
|
||||
|
||||
static public function profile_edit()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return \Tpl::view( 'globelus/candidates/alerts/profile-edit' );
|
||||
|
||||
return \Tpl::view( 'globelus/candidates/profile-edit', [
|
||||
'g_user' => $g_user,
|
||||
'categories' => \front\factory\GlobelusAdverts::categories(),
|
||||
'positions' => \front\factory\Globelus::get_positions_list()
|
||||
] );
|
||||
}
|
||||
|
||||
public static function profile_preview()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return \Tpl::view( 'globelus/candidates/alerts/profile-edit' );
|
||||
|
||||
return \front\view\GlobelusCandidates::profile_preview( $g_user );
|
||||
}
|
||||
}
|
||||
166
autoload/front/controls/class.GlobelusCv.php
Normal file
166
autoload/front/controls/class.GlobelusCv.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusCv
|
||||
{
|
||||
static public function proposed_candidate_profile()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/cv/candidate-profile', [
|
||||
'g_user' => $g_user,
|
||||
'candidate' => \front\factory\GlobelusUser::user_details( \S::get( 'user_id' ) ),
|
||||
] );
|
||||
}
|
||||
|
||||
public static function candidate_profile()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !is_array( $g_user['categories'] ) or !count( $g_user['categories'] ) )
|
||||
return \Tpl::view( 'globelus/cv/alerts/cv-access' );
|
||||
|
||||
$next_profile = \front\factory\GlobelusCv::next_profile(
|
||||
\S::get( 'user_id' ),
|
||||
$g_user['categories'],
|
||||
\S::get_session( 'cv-filtr-keyword' ),
|
||||
\S::get_session( 'cv-filtr-countries' ),
|
||||
\S::get_session( 'cv-filtr-availability' ),
|
||||
\S::get_session( 'cv-filtr-categories' ),
|
||||
\S::get_session( 'cv-filtr-voivodeships' ),
|
||||
\S::get_session( 'cv-id_position' )
|
||||
);
|
||||
|
||||
$prev_profile = \front\factory\GlobelusCv::prev_profile(
|
||||
\S::get( 'user_id' ),
|
||||
$g_user['categories'],
|
||||
\S::get_session( 'cv-filtr-keyword' ),
|
||||
\S::get_session( 'cv-filtr-countries' ),
|
||||
\S::get_session( 'cv-filtr-availability' ),
|
||||
\S::get_session( 'cv-filtr-categories' ),
|
||||
\S::get_session( 'cv-filtr-voivodeships' ),
|
||||
\S::get_session( 'cv-id_position' )
|
||||
);
|
||||
|
||||
return \Tpl::view( 'globelus/cv/candidate-profile', [
|
||||
'g_user' => $g_user,
|
||||
'candidate' => \front\factory\GlobelusUser::user_details( \S::get( 'user_id' ) ),
|
||||
'next_profile' => $next_profile,
|
||||
'prev_profile' => $prev_profile
|
||||
] );
|
||||
}
|
||||
|
||||
public static function activate_access()
|
||||
{
|
||||
global $lang, $mdb, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
$points = \front\factory\GlobelusFirms::get_firm_points( $g_user['id'] );
|
||||
|
||||
if ( $points < $globelus_settings['pkt-dostep-baza-kandydatow'] )
|
||||
{
|
||||
//\S::set_alert_prompt( 'Nie posiadasz wystarczającej ilości punktów aby wykupić dostęp do bazy kandydatów.' );
|
||||
header( 'Location: /baza-cv' );
|
||||
exit;
|
||||
}
|
||||
|
||||
$mdb -> update( 'globelus_users', [ 'points[-]' => $globelus_settings['pkt-dostep-baza-kandydatow'], 'cv_access' => 1, 'cv_access_date' => date( 'Y-m-d', strtotime( '+30 days', time() ) ) ], [ 'id' => $g_user['id'] ] );
|
||||
$mdb -> insert( 'globelus_points_history', [
|
||||
'user_id' => $g_user['id'],
|
||||
'points' => $globelus_settings['pkt-dostep-baza-kandydatow'],
|
||||
'event_type' => 5
|
||||
] );
|
||||
|
||||
$categories = \S::get( 'categories' );
|
||||
|
||||
$mdb -> delete( 'globelus_firms_categories', [ 'user_id' => $g_user['id'] ] );
|
||||
if ( is_array( $categories ) and !empty ( $categories ) ) foreach ( $categories as $category )
|
||||
{
|
||||
if ( ++$i <= 3 )
|
||||
$mdb -> insert( 'globelus_firms_categories', [
|
||||
'user_id' => $g_user['id'],
|
||||
'category_id' => $category
|
||||
] );
|
||||
}
|
||||
|
||||
$g_user = \front\factory\GlobelusUser::user_details( $g_user['id'] );
|
||||
\S::set_session( 'g_user', $g_user );
|
||||
|
||||
//\S::set_alert_prompt( 'Dostęp do bazy kandydatów został aktywowany.' );
|
||||
header( 'Location: /baza-cv' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function cv_list()
|
||||
{
|
||||
global $lang, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return \Tpl::view( 'globelus/cv/cv-alert' );
|
||||
|
||||
if ( \S::get( 'filtr' ) )
|
||||
{
|
||||
\S::set_session( 'cv-filtr-keyword', \S::get( 'k' ) );
|
||||
\S::set_session( 'cv-filtr-countries', \S::get( 'c1' ) );
|
||||
\S::set_session( 'cv-filtr-availability', \S::get( 'a' ) );
|
||||
\S::set_session( 'cv-filtr-categories', \S::get( 'c2' ) );
|
||||
\S::set_session( 'cv-filtr-voivodeships', \S::get( 'v' ) );
|
||||
\S::set_session( 'cv-id_position', \S::get( 'id_position' ) );
|
||||
}
|
||||
|
||||
$cv_list = \front\factory\GlobelusCv::cv_list(
|
||||
(int)\S::get( 'cp' ),
|
||||
\front\factory\GlobelusCv::cv_list_limit,
|
||||
$g_user['categories'],
|
||||
\S::get_session( 'cv-filtr-keyword' ),
|
||||
\S::get_session( 'cv-filtr-countries' ),
|
||||
\S::get_session( 'cv-filtr-availability' ),
|
||||
\S::get_session( 'cv-filtr-categories' ),
|
||||
\S::get_session( 'cv-filtr-voivodeships' ),
|
||||
\S::get_session( 'cv-id_position' )
|
||||
);
|
||||
$cv_count = \front\factory\GlobelusCv::cv_count(
|
||||
$g_user['categories'],
|
||||
\S::get_session( 'cv-filtr-keyword' ),
|
||||
\S::get_session( 'cv-filtr-countries' ),
|
||||
\S::get_session( 'cv-filtr-availability' ),
|
||||
\S::get_session( 'cv-filtr-categories' ),
|
||||
\S::get_session( 'cv-filtr-voivodeships' ),
|
||||
\S::get_session( 'cv-id_position' )
|
||||
);
|
||||
|
||||
return \Tpl::view( 'globelus/cv/cv-list', [
|
||||
'cv_list' => $cv_list,
|
||||
'cv_count' => $cv_count,
|
||||
'current_page' => \S::get( 'cp' ),
|
||||
'keyword' => \S::get_session( 'cv-filtr-keyword' ),
|
||||
'countries' => \front\factory\Globelus::countries(),
|
||||
'countries_selected' => \S::get_session( 'cv-filtr-countries' ),
|
||||
'categories' => \front\factory\GlobelusAdverts::categories( $g_user['categories'] ),
|
||||
'categories_selected' => \S::get_session( 'cv-filtr-categories' ),
|
||||
'availability_selected' => \S::get_session( 'cv-filtr-availability' ),
|
||||
'g_user' => $g_user,
|
||||
'gsettings' => $globelus_settings,
|
||||
'voivodeships_selected' => \S::get_session( 'cv-filtr-voivodeships' ),
|
||||
'voivodeships' => \front\factory\Globelus::get_voivodeships_list(),
|
||||
'positions' => \front\factory\Globelus::get_positions_list(),
|
||||
'position_selected' => \S::get_session( 'cv-id_position' )
|
||||
] );
|
||||
}
|
||||
}
|
||||
681
autoload/front/controls/class.GlobelusFirms.php
Normal file
681
autoload/front/controls/class.GlobelusFirms.php
Normal file
@@ -0,0 +1,681 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusFirms
|
||||
{
|
||||
// usuwanie logo
|
||||
static public function delete_logo()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$logo_hash = \front\factory\GlobelusFirms::logo_hash( \S::get( 'user_id' ) );
|
||||
$file_name = 'files/logos/' . $logo_hash{0} . '/' . $logo_hash{1} . '/' . $logo_hash;
|
||||
|
||||
if ( file_exists( $file_name ) )
|
||||
{
|
||||
unlink($file_name);
|
||||
$mdb -> update ('globelus_firms_data', ['logo_extension' => NULL]);
|
||||
}
|
||||
echo json_encode( [ 'result' => 'ok' ] );
|
||||
exit;
|
||||
}
|
||||
//usuwanie zdjęcia górnego
|
||||
static public function delete_img_header()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$img_header_hash = \front\factory\GlobelusFirms::img_header_hash( \S::get( 'user_id' ) );
|
||||
$file_name = 'files/img_header/' . $img_header_hash{0} . '/' . $img_header_hash{1} . '/' . $img_header_hash;
|
||||
|
||||
if ( file_exists( $file_name ) )
|
||||
{
|
||||
unlink($file_name);
|
||||
$mdb -> update ('globelus_firms_data', ['img_header_extension' => NULL]);
|
||||
}
|
||||
echo json_encode( [ 'result' => 'ok' ] );
|
||||
exit;
|
||||
}
|
||||
|
||||
//usuwanie zdjęcia dolnego
|
||||
static public function delete_img_bottom()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$img_bottom_hash = \front\factory\GlobelusFirms::img_bottom_hash( \S::get( 'user_id' ) );
|
||||
$file_name = 'files/img_bottom/' . $img_bottom_hash{0} . '/' . $img_bottom_hash{1} . '/' . $img_bottom_hash;
|
||||
|
||||
if ( file_exists( $file_name ) )
|
||||
{
|
||||
unlink($file_name);
|
||||
$mdb -> update ('globelus_firms_data', ['img_bottom_extension' => NULL]);
|
||||
}
|
||||
echo json_encode( [ 'result' => 'ok' ] );
|
||||
exit;
|
||||
}
|
||||
|
||||
//usuwanie zdjęcia górnego edycja
|
||||
static public function delete_advert_img_top()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$advert_add_img_top_hash = \front\factory\GlobelusFirms::advert_add_img_top_hash( \S::get( 'id' ) );
|
||||
$file_name = 'files/advert_add_img_top/' . $advert_add_img_top_hash{0} . '/' . $advert_add_img_top_hash{1} . '/' . $advert_add_img_top_hash;
|
||||
|
||||
if ( file_exists( $file_name ) )
|
||||
{
|
||||
unlink($file_name);
|
||||
$mdb -> update ('globelus_adverts', ['advert_add_img_top' => NULL]);
|
||||
}
|
||||
echo json_encode( [ 'result' => 'ok' ] );
|
||||
exit;
|
||||
}
|
||||
|
||||
//usuwanie zdjęcia dolnego edycja
|
||||
static public function delete_advert_img_bottom()
|
||||
{
|
||||
global $mdb;
|
||||
|
||||
$advert_add_img_bottom_hash = \front\factory\GlobelusFirms::advert_add_img_bottom_hash( \S::get( 'id' ) );
|
||||
$file_name = 'files/advert_add_img_bottom/' . $advert_add_img_bottom_hash{0} . '/' . $advert_add_img_bottom_hash{1} . '/' . $advert_add_img_bottom_hash;
|
||||
|
||||
if ( file_exists( $file_name ) )
|
||||
{
|
||||
unlink($file_name);
|
||||
$mdb -> update ('globelus_adverts', ['advert_add_img_bottom' => NULL]);
|
||||
}
|
||||
echo json_encode( [ 'result' => 'ok' ] );
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public static function set_answer_as_displayed()
|
||||
{
|
||||
global $mdb;
|
||||
$mdb -> update( 'globelus_adverts_answers', [ 'displayed' => 1 ], [ 'id' => \S::get( 'answer_id' ) ] );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function payment_error()
|
||||
{
|
||||
global $page, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$page['language']['meta_title'] = 'Zamówienie nieopłacone ● Globelus';
|
||||
|
||||
return \Tpl::view( 'globelus/firms/payment-error', [
|
||||
'user' => $g_user
|
||||
] );
|
||||
}
|
||||
|
||||
public static function payment_success()
|
||||
{
|
||||
global $page, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$page['language']['meta_title'] = 'Zamówienie opłacone ● Globelus';
|
||||
|
||||
return \Tpl::view( 'globelus/firms/payment-success', [
|
||||
'user' => $g_user
|
||||
] );
|
||||
}
|
||||
|
||||
public static function set_order_status()
|
||||
{
|
||||
global $mdb, $settings;
|
||||
|
||||
if ( \S::get( 'tr_status' ) == 'TRUE' and \S::get( 'tr_crc' ) )
|
||||
{
|
||||
$order = $mdb -> get( 'globelus_orders', [ 'user_id', 'points', 'price' ], [ 'hash' => \S::get( 'tr_crc' ) ] );
|
||||
$mdb -> update( 'globelus_orders', [ 'status' => 1 ], [ 'hash' => \S::get( 'tr_crc' ) ] );
|
||||
$mdb -> update( 'globelus_users', [ 'points[+]' => $order['points'] ], [ 'id' => $order['user_id'] ] );
|
||||
|
||||
$user_tmp = \front\factory\GlobelusUser::user_details( $order['user_id'] );
|
||||
|
||||
$text = $settings['newsletter_header'];
|
||||
$text .= \front\factory\Newsletter::get_template( '#doladowanie-konta' );
|
||||
$text .= $settings['newsletter_footer_1'];
|
||||
|
||||
$settings['ssl'] ? $base = 'https' : $base = 'http';
|
||||
|
||||
$regex = "-(<img[^>]+src\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i";
|
||||
$text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text );
|
||||
|
||||
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i";
|
||||
$text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text );
|
||||
|
||||
$text = str_replace( '[KWOTA]', $order['price'], $text );
|
||||
$text = str_replace( '[SALDO]', $user_tmp['points'], $text );
|
||||
|
||||
if ( $globelus_settings['maile-wysylanie'] )
|
||||
$send = \S::send_email( $user_tmp['email'], 'Doładowanie salda - GLOBELUS.PL', $text );
|
||||
|
||||
echo 'true';
|
||||
exit;
|
||||
}
|
||||
|
||||
echo 'false';
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function create_order()
|
||||
{
|
||||
global $page, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$page['language']['meta_title'] = 'Zamówienie ● Globelus';
|
||||
|
||||
$package = \S::get( 'package' );
|
||||
if ( $package < 2 )
|
||||
$package = 2;
|
||||
|
||||
$hash = \front\factory\GlobelusFirms::generate_order(
|
||||
$g_user['id'],
|
||||
$package,
|
||||
$globelus_settings['pkt-pakiet-' . $package . '-ilosc'],
|
||||
str_replace( ',', '.', $globelus_settings['pkt-pakiet-' . $package . '-cena'] )
|
||||
);
|
||||
|
||||
return \Tpl::view( 'globelus/firms/create-order', [
|
||||
'user' => $g_user,
|
||||
'gsettings' => $globelus_settings,
|
||||
'package' => $package,
|
||||
'hash' => $hash
|
||||
] );
|
||||
}
|
||||
|
||||
static public function multi_delete()
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( is_array( \S::get( 'ids' ) ) ) foreach ( \S::get( 'ids' ) as $id )
|
||||
\front\factory\GlobelusFirms::advert_delete( $g_user['id'], $id );
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function multi_disable()
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( is_array( \S::get( 'ids' ) ) ) foreach ( \S::get( 'ids' ) as $id )
|
||||
\front\factory\GlobelusFirms::advert_disable( $g_user['id'], $id );
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function alist_set_cp() {
|
||||
\S::set_session( 'advert_list_cp', \S::get( 'cp' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function answer_delete()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusFirms::answer_delete(
|
||||
(int)$g_user['id'], (int)\S::get( 'advert_id' ), (int)\S::get( 'answer_id' )
|
||||
);
|
||||
|
||||
if ( \S::get( 'advert_id' ) )
|
||||
header( 'Location: /panel-pracodawcy/odpowiedzi/'. \S::get( 'advert_id' ) );
|
||||
else
|
||||
header( 'Location: /panel-pracodawcy/odpowiedzi-na-ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function firm_profile()
|
||||
{
|
||||
global $page;
|
||||
|
||||
$firm_profile = \front\factory\GlobelusFirms::firm_profile( \S::get( 'user_id' ) );
|
||||
$page['language']['meta_title'] = 'Praca w ' . $firm_profile['firm_name_profile'] . ' - oferta pracy | Globelus';
|
||||
|
||||
return \Tpl::view( 'globelus/firms/firm-profile', [
|
||||
'firm' => $firm_profile,
|
||||
'adverts' => \front\factory\GlobelusFirms::firm_adverts( \S::get( 'user_id' ) ),
|
||||
'g_user' => \S::get_session( 'g_user' )
|
||||
] );
|
||||
}
|
||||
|
||||
public static function firms_list()
|
||||
{
|
||||
return \front\view\GlobelusFirms::firms_list(
|
||||
\front\factory\GlobelusFirms::firms_list( (int)\S::get( 'cp' ), \S::get( 'letter' ), \front\factory\GlobelusFirms::firm_list_limit ),
|
||||
\front\factory\GlobelusFirms::firms_count( \S::get( 'letter' ) ),
|
||||
\S::get( 'letter' ),
|
||||
\S::get( 'cp' )
|
||||
);
|
||||
}
|
||||
|
||||
public static function logo()
|
||||
{
|
||||
return \front\factory\GlobelusFirms::logo( \S::get( 'user_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function img_header()
|
||||
{
|
||||
return \front\factory\GlobelusFirms::img_header( \S::get( 'user_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function img_bottom()
|
||||
{
|
||||
return \front\factory\GlobelusFirms::img_bottom( \S::get( 'user_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function advert_add_img_top()
|
||||
{
|
||||
return \front\factory\GlobelusFirms::advert_add_img_top( \S::get( 'advert_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function advert_add_img_bottom()
|
||||
{
|
||||
return \front\factory\GlobelusFirms::advert_add_img_bottom( \S::get( 'advert_id' ), \S::get( 'token' ) );
|
||||
}
|
||||
|
||||
public static function change_password()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusUser::user_change_password( $g_user['id'], \S::get( 'current_password' ), \S::get( 'new_password' ), \S::get( 'repeat_new_password' ) );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ustawienia-konta' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function data_save()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusFirms::datą_save(
|
||||
$g_user['id'], \S::get( 'firm_name' ), \S::get( 'firm_name_profile' ), \S::get( 'nip_vat' ), \S::get( 'phone' ), \S::get( 'www' ), \S::get( 'country_id' ), \S::get( 'region' ), \S::get( 'city' ),
|
||||
\S::get( 'postal_code' ), \S::get( 'street' ), \S::get( 'apartment_number' ), \S::get( 'other_information' ), $_FILES['logo'], \S::get( 'contact_person_1' ), \S::get( 'email_1' ),
|
||||
\S::get( 'phone_1' ), \S::get( 'contact_person_2' ), \S::get( 'email_2' ), \S::get( 'phone_2' ), \S::get( 'clauses' ), $_FILES['img-header'], $_FILES['img-bottom']
|
||||
) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['dane-zostaly-zaktualizowane'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
}
|
||||
else
|
||||
header( 'Location: /panel-pracodawcy/edycja-profilu' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function candidate_remove_from_favorite()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusFirms::candidate_remove_from_favorite( \S::get( 'candidate_id' ), $g_user['id'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['kandydat-zostal-usuniety-obserwowanych'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function candidate_add_to_favorite()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusFirms::candidate_add_to_favorite( \S::get( 'candidate_id' ), $g_user['id'] ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['kandydat-zostal-dodany-do-obserwowanych'] );
|
||||
\S::set_session( 'g_user', \front\factory\GlobelusUser::user_details( $g_user['id'] ) );
|
||||
}
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function followed_candidates()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \Tpl::view( 'globelus/firms/followed-candidates', [
|
||||
'user' => $g_user,
|
||||
'candidates' => \front\factory\GlobelusFirms::followed_candidates( $g_user['id'] )
|
||||
] );
|
||||
}
|
||||
|
||||
static public function proposed_candidates()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$url_components = parse_url( $_SERVER['REQUEST_URI'] );
|
||||
parse_str( $url_components['query'], $params );
|
||||
|
||||
if ( \front\factory\GlobelusFirms::is_user_advert( $g_user['id'], $params['aid'] ) )
|
||||
$advert_id = $params['aid'];
|
||||
|
||||
$adverts = \front\factory\GlobelusFirms::active_adverts_list( $g_user['id'] );
|
||||
|
||||
return \Tpl::view( 'globelus/firms/proposed-candidates', [
|
||||
'user' => $g_user,
|
||||
'positions_experience' => \front\factory\Globelus::positions_experience(),
|
||||
'candidates' => array_unique( \front\factory\GlobelusFirms::proposed_candidates( $advert_id, $adverts ) ),
|
||||
'adverts' => $adverts,
|
||||
'current_advert' => $advert_id
|
||||
] );
|
||||
}
|
||||
|
||||
public static function profile_settings()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusFirms::profile_settings( $g_user );
|
||||
}
|
||||
|
||||
public static function profile_edit()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusFirms::profile_edit( $g_user );
|
||||
}
|
||||
|
||||
public static function profile_preview()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
if ( !$g_user )
|
||||
return \front\view\GlobelusUser::login();
|
||||
return false;
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/firms/profile-preview', [
|
||||
'g_user' => $g_user
|
||||
] );
|
||||
}
|
||||
|
||||
public static function advert_refresh()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusFirms::advert_refresh( \S::get( 'advert_id'), $g_user['id'] );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_additional_promotion()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusFirms::advert_additional_promotion( $g_user['id'], \S::get( 'advert-id' ) );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_extend()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusFirms::advert_extend( \S::get( 'advert_id'), $g_user['id'] ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'ogloszenie-zostalo-przedluzone' ] );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_main_page_enable()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusFirms::advert_main_page_enable( $g_user['id'], \S::get( 'advert-id' ), $g_user['email'] );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_highlight_enable()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
\front\factory\GlobelusFirms::advert_highlight_enable( $g_user['id'], \S::get( 'advert-id' ), $g_user['email'] );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_disable()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$result = \front\factory\GlobelusFirms::advert_disable( $g_user['id'], \S::get( 'advert-id' ) );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_enable()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$result = \front\factory\GlobelusFirms::advert_enable( $g_user['id'], \S::get( 'advert-id' ), $g_user['email'] );
|
||||
\S::set_alert_prompt( 'Informacja', $result['msg'] );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function advert_delete()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$result = \front\factory\GlobelusFirms::advert_delete( $g_user['id'], \S::get( 'advert-id' ) );
|
||||
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
// dodanie nowego ogłoszenia
|
||||
static public function advert_save()
|
||||
{
|
||||
global $lang, $mdb;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$old = $mdb -> get( 'globelus_adverts', 'old', [ 'AND' => [ 'id' => \S::get( 'id' ), 'user_id' => $g_user['id'] ] ] );
|
||||
|
||||
if ( $advert_id = \front\factory\GlobelusFirms::advert_save( [
|
||||
'user_id' => $g_user['id'],
|
||||
'advert_id' => \S::get( 'id' ),
|
||||
'title' => \S::get( 'title' ),
|
||||
'category' => \S::get( 'category' ),
|
||||
'country' => \S::get( 'country' ),
|
||||
'city' => \S::get( 'city' ),
|
||||
'region' => \S::get( 'region' ),
|
||||
'text' => \S::get( 'text' ),
|
||||
'contact_person' => \S::get( 'contact_person' ),
|
||||
'email' => \S::get( 'email' ),
|
||||
'phone' => \S::get( 'phone' ),
|
||||
'contact_person2' => \S::get( 'contact_person2' ),
|
||||
'email2' => \S::get( 'email2' ),
|
||||
'phone2' => \S::get( 'phone2' ),
|
||||
'salary' => \S::get( 'salary' ),
|
||||
'work_type' => \S::get( 'work_type' ),
|
||||
'without_language' => \S::get( 'without_language' ),
|
||||
'without_experience' => \S::get( 'without_experience' ),
|
||||
'for_couples' => \S::get( 'for_couples' ),
|
||||
'from_now' => 0,
|
||||
'accommodation' => \S::get( 'accommodation' ),
|
||||
'accommodation_cost' => \S::get( 'accommodation_cost' ),
|
||||
'overtime' => \S::get( 'overtime' ),
|
||||
'overtime_quantity' => \S::get( 'overtime_quantity' ),
|
||||
'travel_refund' => \S::get( 'travel_refund' ),
|
||||
'outside_ue' => \S::get( 'outside_ue' ),
|
||||
'without_driving_license' => \S::get( 'without_driving_license' ),
|
||||
],
|
||||
\S::get( 'id_voivodeship' ), \S::get( 'aplication_link' ), $_FILES['advert-img-bottom'], $_FILES[ 'advert-img-top'], \S::get( 'position' ) ) )
|
||||
{
|
||||
if ( !\S::get( 'id' ) or $old )
|
||||
\S::set_alert_prompt( 'Ogłoszenie zostało dodane', 'Zanim będzie się ono wyświetlać kandydatom należy je jeszcze opublikować.' );
|
||||
else
|
||||
{
|
||||
if ( !\front\factory\GlobelusFirms::is_advert_visible( $advert_id ) )
|
||||
\S::set_alert_prompt( 'Ogłoszenie zostało zmodyfikowane', 'Zanim będzie się ono wyświetlać kandydatom należy je jeszcze opublikować.' );
|
||||
else
|
||||
\S::set_alert_prompt( 'Ogłoszenie zostało zmodyfikowane', '', 5 );
|
||||
}
|
||||
}
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function answers()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
return \Tpl::view( 'globelus/firms/answers', [
|
||||
'answers' => \front\factory\GlobelusFirms::answers( (int)$g_user['id'] ),
|
||||
'g_user' => $g_user
|
||||
] );
|
||||
}
|
||||
|
||||
public static function advert_answers()
|
||||
{
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$advert = \front\factory\GlobelusAdverts::advert_details( \S::get( 'advert_id' ) );
|
||||
|
||||
if ( $advert['user_id'] != $g_user['id'] )
|
||||
return false;
|
||||
|
||||
return \front\view\GlobelusFirms::advert_answers(
|
||||
$g_user,
|
||||
$advert,
|
||||
\front\factory\GlobelusFirms::advert_answers( \S::get( 'advert_id' ) )
|
||||
);
|
||||
}
|
||||
|
||||
public static function advert_edit()
|
||||
{
|
||||
global $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$advert = \front\factory\GlobelusAdverts::advert_details( \S::get( 'advert_id' ) );
|
||||
|
||||
if ( $advert['user_id'] != $g_user['id'] )
|
||||
return false;
|
||||
|
||||
return \Tpl::view( 'globelus/firms/advert-add', [
|
||||
'gsettings' => $globelus_settings,
|
||||
'user' => $g_user,
|
||||
'adverts_count' => \front\factory\GlobelusFirms::adverts_count( $g_user['id'] ),
|
||||
'user_points' => \front\factory\GlobelusFirms::get_firm_points( $g_user['id'] ),
|
||||
'advert' => $advert,
|
||||
'voivodeships' => \front\factory\Globelus::get_voivodeships_list(),
|
||||
'positions' => \front\factory\Globelus::get_positions_list()
|
||||
] );
|
||||
}
|
||||
|
||||
public static function advert_add()
|
||||
{
|
||||
global $lang, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
if ( !$g_user or !$g_user['type'] )
|
||||
return \Tpl::view( 'globelus/firms/alerts/advert-add' );
|
||||
}
|
||||
|
||||
if ( !$g_user['profile_completed'] )
|
||||
{
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/firms/advert-add', [
|
||||
'gsettings' => $globelus_settings,
|
||||
'user' => $g_user,
|
||||
'adverts_count' => \front\factory\GlobelusFirms::adverts_count( $g_user['id'] ),
|
||||
'user_points' => \front\factory\GlobelusFirms::get_firm_points( $g_user['id'] ),
|
||||
'voivodeships' => \front\factory\Globelus::get_voivodeships_list(),
|
||||
'positions' => \front\factory\Globelus::get_positions_list()
|
||||
] );
|
||||
}
|
||||
|
||||
public static function adverts_list()
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( !$g_user['id'] )
|
||||
return \Tpl::view( 'globelus/firms/alerts/advert-edit' );
|
||||
|
||||
if ( \S::get( 'alert_promotion' ) == 'true' )
|
||||
{
|
||||
\S::set_alert_prompt( 'Dodatkowa promocja', 'Wybierz z listy ogłoszeń ofertę pracy, którą chcesz, abyśmy dla Ciebie wypromowali oraz kliknij przycisk "dodatkowa promocja" znajdujący się przy ogłoszeniu.' );
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
exit;
|
||||
}
|
||||
|
||||
return \Tpl::view( 'globelus/firms/adverts-list', [
|
||||
'user' => $g_user,
|
||||
'adverts' => \front\factory\GlobelusFirms::adverts_list( $g_user['id'] ),
|
||||
'highlight_left' => \front\factory\GlobelusFirms::highlight_left( $g_user['id'] ),
|
||||
'main_page_left' => \front\factory\GlobelusFirms::main_page_left( $g_user['id'] ),
|
||||
'adverts_count' => \front\factory\GlobelusFirms::adverts_count( $g_user['id'] ),
|
||||
'firm_points' => \front\factory\GlobelusFirms::get_firm_points( $g_user['id'] ),
|
||||
'user_adverts_count' => \front\factory\GlobelusFirms::user_adverts_count( $g_user['id'] )
|
||||
] );
|
||||
}
|
||||
|
||||
public static function buy_points()
|
||||
{
|
||||
global $page, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
$page['language']['meta_title'] = 'Zakup punktów ● Globelus';
|
||||
|
||||
return \Tpl::view( 'globelus/firms/buy-points', [
|
||||
'user' => $g_user,
|
||||
'points' => \front\factory\GlobelusFirms::get_firm_points( $g_user['id'] ),
|
||||
'gsettings' => $globelus_settings
|
||||
] );
|
||||
}
|
||||
}
|
||||
180
autoload/front/controls/class.GlobelusUser.php
Normal file
180
autoload/front/controls/class.GlobelusUser.php
Normal file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusUser
|
||||
{
|
||||
public static function confirm_account_delete()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::confirm_account_delete( \S::get( 'hash' ) ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-usuniete' ] );
|
||||
unset( $_SESSION['g_user'] );
|
||||
unset( $g_user );
|
||||
}
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function delete_account()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
if ( \front\factory\GlobelusUser::delete_account( $g_user['id'] ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'usuwanie-konta-email' ] );
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function new_password()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::new_password( \S::get( 'hash' ) ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['nowe-haslo-zostalo-wyslane-na-twoj-adres-email'] );
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function send_email_password_recovery()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::send_email_password_recovery( \S::get( 'email' ) ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['odzyskiwanie-hasla-link-komunikat'] );
|
||||
else
|
||||
\S::set_alert_prompt( 'Informacja', $lang['odzyskiwanie-hasla-blad'] );
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function recover_password()
|
||||
{
|
||||
return \front\view\GlobelusUser::recover_password();
|
||||
}
|
||||
|
||||
public static function confirm()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::register_confirm( \S::get( 'hash' ) ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang['rejestracja-potwierdzenie'] );
|
||||
|
||||
\front\factory\GlobelusUser::signin( null, null, null, null, \S::get( 'hash' ) );
|
||||
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( $g_user['type'] and !$g_user['profile_completed'] )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] );
|
||||
|
||||
if ( !$g_user['type'] )
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
else
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function resend_activation_mail()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::resend_activation_mail( \S::get( 'hash' ) ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['wyslano-link-do-aktywacji-konta'] );
|
||||
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function login_as()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
|
||||
if ( !\front\factory\GlobelusUser::signin( null, null, null, null, \S::get( 'hash' ) ) )
|
||||
header( 'Location: /logowanie' );
|
||||
else
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( $g_user['type'] and !$g_user['profile_completed'] )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] );
|
||||
|
||||
if ( \S::get( 'return_url' ) )
|
||||
{
|
||||
header( 'Location: ' . \S::get( 'return_url' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !$g_user['type'] )
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
else
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function signin()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\GlobelusUser::signin( \S::get( 'email' ), \S::get( 'password' ) ) )
|
||||
header( 'Location: /logowanie' );
|
||||
else
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( $g_user['type'] and !$g_user['profile_completed'] )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] );
|
||||
|
||||
if ( !$g_user['type'] )
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
else
|
||||
{
|
||||
if ( !$g_user['profile_completed'] )
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
else
|
||||
header( 'Location: /panel-pracodawcy/ogloszenia' );
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function signup()
|
||||
{
|
||||
$result = \front\factory\GlobelusUser::signup( \S::get( 'email' ), \S::get( 'password' ), \S::get( 'type' ), \S::get( 'agremment_profile' ), \S::get( 'agremment_marketing' ) );
|
||||
echo json_encode( $result );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function register()
|
||||
{
|
||||
if ( $g_user = \S::get_session( 'g_user' ) ) {
|
||||
if ( $g_user['type'] == '1' ) {
|
||||
header( 'Location: /panel-pracodawcy/profil' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
return \front\view\GlobelusUser::register();
|
||||
}
|
||||
|
||||
public static function login()
|
||||
{
|
||||
return \front\view\GlobelusUser::login();
|
||||
}
|
||||
|
||||
public static function logout()
|
||||
{
|
||||
session_destroy();
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
38
autoload/front/controls/class.Newsletter.php
Normal file
38
autoload/front/controls/class.Newsletter.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
|
||||
class Newsletter
|
||||
{
|
||||
public static function signin()
|
||||
{
|
||||
$result = [ 'status' => 'bad' ];
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_signin( \S::get( 'email' ) ) )
|
||||
$result = [ 'status' => 'ok' ];
|
||||
|
||||
echo json_encode( $result );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function confirm()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_confirm( \S::get( 'hash' ) ) )
|
||||
\S::alert( $lang['email-zostal-dodany-do-listy-newsletter'] );
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function unsubscribe()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\Newsletter::newsletter_unsubscribe( \S::get( 'hash' ) ) )
|
||||
\S::alert( $lang['email-zostal-usuniety-z-listy-newsletter'] );
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
117
autoload/front/controls/class.Site.php
Normal file
117
autoload/front/controls/class.Site.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
|
||||
class Site
|
||||
{
|
||||
public static function route()
|
||||
{
|
||||
global $page, $lang_id;
|
||||
|
||||
if ( \S::get( 'search' ) )
|
||||
{
|
||||
if ( $_POST['search_txt'] )
|
||||
{
|
||||
\S::set_session( 'search_txt', \S::get( 'search_txt' ) );
|
||||
header( "Location: " . $_SERVER['REQUEST_URI'] );
|
||||
exit;
|
||||
}
|
||||
return \front\view\Search::search_results(
|
||||
\front\factory\Search::search_results( \S::get_session( 'search_txt' ), $lang_id )
|
||||
);
|
||||
}
|
||||
|
||||
if ( \S::get( 'tag' ) )
|
||||
return \front\view\Articles::articles_list(
|
||||
\front\factory\Articles::articles_by_tags( \S::get( 'tag' ), $lang_id )
|
||||
);
|
||||
|
||||
if ( \S::get( 'article' ) )
|
||||
{
|
||||
$article = \front\factory\Articles::article_details( \S::get( 'article' ), $lang_id );
|
||||
|
||||
if ( $article['password'] and !\S::get_session( 'article-' . $article['id'] . '-' . $article['password'] ) )
|
||||
return \front\view\Articles::password_view( [ 'article' => $article ] );
|
||||
else
|
||||
return \front\view\Articles::article( [ 'article' => $article ] );
|
||||
}
|
||||
|
||||
if ( $page['page_type'] !== null )
|
||||
{
|
||||
switch ( $page['page_type'] )
|
||||
{
|
||||
/* pełne artykuły */
|
||||
case 0:
|
||||
return \front\view\Articles::full_articles_list( $page, $lang_id, \S::get( 'bs' ) );
|
||||
break;
|
||||
|
||||
/* wprowadzenia */
|
||||
case 1:
|
||||
return \front\view\Articles::entry_articles_list( $page, $lang_id, \S::get( 'bs' ) );
|
||||
break;
|
||||
|
||||
/* miniaturki */
|
||||
case 2:
|
||||
return \front\view\Articles::miniature_articles_list( $page, $lang_id, \S::get( 'bs' ) );
|
||||
break;
|
||||
|
||||
/* strona kontaktu */
|
||||
case 4:
|
||||
$out = \front\view\Articles::full_articles_list( $page, $lang_id, \S::get( 'bs' ) );
|
||||
$out .= \front\view\Site::contact();
|
||||
return $out;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !\S::get( 'module' ) || !\S::get( 'action' ) )
|
||||
return false;
|
||||
|
||||
$class = '\front\controls\\' . ucfirst( \S::get( 'module' ) );
|
||||
$action = \S::get( 'action' );
|
||||
|
||||
if ( class_exists( $class ) and method_exists( new $class, $action ) )
|
||||
return call_user_func_array( array( $class, $action ), array() );
|
||||
}
|
||||
|
||||
public static function check_url_params()
|
||||
{
|
||||
global $lang, $config;
|
||||
|
||||
$a = \S::get( 'a' );
|
||||
|
||||
switch ( $a )
|
||||
{
|
||||
case 'page':
|
||||
$page = \front\factory\Pages::page_details( \S::get( 'id' ) );
|
||||
\S::set_session( 'page', $page );
|
||||
break;
|
||||
|
||||
case 'change_language':
|
||||
\S::set_session( 'current-lang', \S::get( 'id' ) );
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'newsletter-sign':
|
||||
if ( \front\factory\Newsletter::newsletter_signin( \S::get( 'email' ) ) )
|
||||
\S::alert( 'Dziękujemy za zapisanie się do newslettera.' );
|
||||
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'newsletter-signout':
|
||||
if ( \front\factory\Newsletter::newsletter_signout( \S::get( 'email' ) ) )
|
||||
\S::alert( 'Twój adres email został usunięty z naszej bazy.' );
|
||||
header( 'Location: ' . $_SERVER['REQUEST_URI'] );
|
||||
exit;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( \S::get( 'lang' ) )
|
||||
\S::set_session( 'current-lang', \S::get( 'lang' ) );
|
||||
|
||||
if ( file_exists( 'modules/actions.php' ) )
|
||||
include 'modules/actions.php';
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user