本文整理汇总了PHP中format_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP format_lang函数的具体用法?PHP format_lang怎么用?PHP format_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_lang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_total
function check_total()
{
global $total_max_cv, $session;
if ($total_max_cv >= MAX_CV) {
$session->message("<div class='error'>" . format_lang('errormsg', 52) . "</div>");
redirect_to(BASE_URL . "curriculum_vitae/");
die;
}
}
示例2: smarty_function_lang
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_lang($params, &$smarty)
{
global $db, $database;
$arkey = $params['mkey'];
$key = $params['skey'];
$code = $params['ckey'];
global $lang;
//return format_lang( $arkey, $key );
if (!empty($code)) {
//return format_lang( $arkey, $key );
//return $lang[$arkey][$key][$code];
} elseif (empty($key)) {
return format_lang($arkey, null);
//return $lang[$arkey];
} else {
return format_lang($arkey, $key);
//return $lang[$arkey][$key];
}
}
示例3: redirect_to
}
break;
default:
if ($total_max_cl <= 0 && $action != "add") {
redirect_to(BASE_URL . "covering_letter/add/");
}
//list of cover letter
$my_cls = CovingLetter::employee_find_all($user_id);
if (is_array($my_cls) and !empty($my_cls)) {
$cl_t = array();
$i = 1;
foreach ($my_cls as $my_letter) {
if ($my_letter->is_defult == 'Y') {
$letter = empty($_POST['txt_letter']) ? $my_letter->cl_text : safe_output($_POST['txt_letter']);
}
$cl_t[$i]["id"] = $my_letter->id;
$cl_t[$i]["fk_employer_id"] = $my_letter->fk_employer_id;
$cl_t[$i]["cl_title"] = $my_letter->cl_title;
$cl_t[$i]["cl_text"] = $my_letter->cl_text;
$cl_t[$i]["created_at"] = strftime(DATE_FORMAT, strtotime($my_letter->created_at));
$cl_t[$i]["modified_at"] = strftime(DATE_FORMAT, strtotime($my_letter->modified_at));
$cl_t[$i]["is_defult"] = $my_letter->is_defult;
$i++;
}
$smarty->assign('my_letters', $cl_t);
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'cl_show_default') . " " . $employee->full_name();
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('cover_letter.tpl'));
break;
}
示例4: format_lang
/* check old password**/
if (!$correct_user) {
$error[] = format_lang('errormsg', 44);
}
/**new password*/
if (strlen($new_pass) != strlen($new_pass_try)) {
$error[] = format_lang('errormsg', 45);
}
if (strlen($new_pass) < 6 || strlen($new_pass) > 20) {
$error[] = format_lang('errormsg', 46);
}
if (sizeof($error) == 0) {
//if everything ok
$pass_change = Employee::change_password($username, $new_pass);
if ($pass_change) {
$session->message("<div class='success'>" . format_lang('success', 'pass_chg_success') . "</div>");
} else {
$session->message("<div class='error'>" . format_lang('errormsg', 47) . "</div>");
}
} else {
$message = "<div class='error'> \r\n\t\t\t\t\t" . get_lang('following_errors') . "\r\n\t\t\t\t<ul> <li />";
$message .= join(" <li /> ", $error);
$message .= " </ul> \r\n\t\t\t\t\t </div>";
$session->message($message);
}
redirect_to(BASE_URL . "account/change_password/");
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'change_password');
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('change_pass.tpl'));
示例5: foreach
}
}
//status
$_SESSION['loc']['stateprovince'] = $_SESSION['loc']['stateprovince'] != '' ? $_SESSION['loc']['stateprovince'] : "";
if ($_SESSION['loc']['stateprovince'] != '') {
$lang['counties'] = $county->get_countyOptions($countrycode, $_SESSION['loc']['stateprovince'], 'N');
if (count($lang['counties']) == 1) {
foreach ($lang['counties'] as $key => $val) {
$_SESSION['loc']['countycode'] = $key;
}
}
//county
$_SESSION['loc']['countycode'] = $_SESSION['loc']['countycode'] != '' ? $_SESSION['loc']['countycode'] : "";
if ($_SESSION['loc']['countycode'] != '') {
$lang['cities'] = $city->get_cityOptions($countrycode, $_SESSION['loc']['stateprovince'], $_SESSION['loc']['countycode'], 'N');
if (count($lang['cities']) == 1) {
foreach ($lang['cities'] as $key => $val) {
$_SESSION['loc']['citycode'] = $key;
}
}
//city
$_SESSION['loc']['citycode'] = $_SESSION['loc']['citycode'] != '' ? $_SESSION['loc']['citycode'] : "";
}
}
$smarty->assign('titles', format_lang('select', 'titles'));
$html_title = SITE_NAME . " - " . format_lang('page_title', 'my_account') . " ( " . $user->full_name() . " ) ";
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('account.tpl'));
break;
}
示例6: strlen
$employer_id = $job_by_company->fk_employer_id;
$total_jobs = Job::total_job_by_employer($employer_id);
$company[$i]['total'] = $total_jobs;
if ($employer = Employer::find_by_id($employer_id)) {
$name = $employer->company_name;
/**check length of text */
$names = strlen($employer->company_name) > 60 ? substr($employer->company_name, 0, 30) . " ... " : $employer->company_name;
$company[$i]['name'] = $names;
$company[$i]['employer_id'] = $employer_id;
$company[$i]['var_name'] = $employer->var_name;
}
$i++;
}
$smarty->assign('company', $company);
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'BrowseBYCompany');
//$meta_description = "";
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('company.tpl'));
break;
case "job_by_company":
$company_id = $company_name = $company_url[1];
$company = Employer::find_by_var_name($company_name);
$id = $company->id;
$num_rows = sizeof(Job::job_by_employer($id));
$page_no = !empty($company_url[2]) ? (int) $company_url[2] : 1;
$per_page = JOBS_PER_SEARCH <= $num_rows ? JOBS_PER_SEARCH : $num_rows;
$per_page = $per_page == 0 ? 1 : $per_page;
$total_count = $num_rows;
$smarty->assign('total_count', $total_count);
$smarty->assign('page', $page_no);
示例7: format_lang
$message = "<div class='error'>" . format_lang('error', 'status_declined_account') . "</div>";
} else {
$access = "User";
$session->login($user_found, $access);
if (isset($_SESSION['direct_to'])) {
$page = $_SESSION['direct_to'];
unset($_SESSION['direct_to']);
redirect_to($page);
die;
} else {
redirect_to(BASE_URL . "account/");
exit;
}
}
} else {
$message = "<div class='error'>" . format_lang('error', 'incorrect_user_pass') . "</div>";
}
} else {
$message = "<div class='error'><ul style='margin:0; padding:0; list-style:none;'><li />";
$message .= join(" <li /> ", $errors);
$message .= " </ul> </div>";
}
} else {
$username = "";
$pass = "";
}
/** end here **/
$html_title = SITE_NAME . " - " . format_lang('page_title', 'login');
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('login.tpl'));
示例8: strftime
$manage_list[$i]['id'] = $my_job->id;
$manage_list[$i]['var_name'] = $my_job->var_name;
$manage_list[$i]['job_title'] = $my_job->job_title;
$manage_list[$i]['is_active'] = $my_job->is_active;
$manage_list[$i]['created_at'] = strftime(DATE_FORMAT, strtotime($my_job->created_at));
$manage_list[$i]['views_count'] = $my_job->views_count;
$manage_list[$i]['apply_count'] = $my_job->apply_count;
$manage_list[$i]['spotlight'] = $my_job->spotlight;
if ($my_job->job_status == "rejected") {
$manage_list[$i]['job_status'] = $my_job->job_status;
$manage_list[$i]['reason'] = "Reason for rejection: ";
$manage_list[$i]['admin_comments'] = $my_job->admin_comments;
} elseif ($my_job->job_status != "approved") {
$manage_list[$i]['job_status'] = $my_job->job_status;
$manage_list[$i]['reason'] = "Reason for rejection: ";
$manage_list[$i]['admin_comments'] = $my_job->admin_comments;
} else {
$manage_list[$i]['job_status'] = $my_job->job_status;
$manage_list[$i]['reason'] = "";
$manage_list[$i]['admin_comments'] = "";
}
$i++;
}
$smarty->assign('manage_list', $manage_list);
}
$smarty->assign('dont_include_left', true);
$html_title = SITE_NAME . " - " . format_lang("page_title", 'MyJobs');
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('employer/my_jobs.tpl'));
//my_jobs.tpl
示例9: str_replace
$body = str_replace("#FullName#", $employee->full_name(), $body);
$body = str_replace("#UserId#", $employee->username, $body);
$body = str_replace("#Domain#", $_SERVER['HTTP_HOST'], $body);
$body = str_replace("#ContactUs#", ADMIN_EMAIL, $body);
$body = str_replace("#Message#", "", $body);
$body = str_replace("#SiteName#", SITE_NAME, $body);
$body = str_replace("#RegKey#", $reg_key, $body);
$to = array("email" => $reg_email, "name" => $employee->full_name());
$from = array("email" => NO_REPLY_EMAIL, "name" => SITE_NAME);
$mail = send_mail($body, $subject, $to, $from, "", "");
if ($mail) {
$session->message("<div class='success'>" . format_lang('success', 'rc_confirm') . "</div>");
} else {
$session->message("<div class='error'>" . format_lang('errormsg', 59) . "</div>");
}
} else {
$session->message("<div class='error'>" . format_lang('errormsg', 53) . "</div>");
}
} else {
$session->message("<div class='success'>" . format_lang('success', 'rc_confirm') . "</div>");
}
redirect_to(BASE_URL . "confirmreg/");
exit;
}
}
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'Resendconfemail');
//$meta_description = "";
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('resend_conflink.tpl'));
示例10: array
$i++;
}
$smarty->assign('package_list', $package_list);
}
//all service
$packages = $package->find_all_active();
if ($packages) {
$package_list = array();
$i = 1;
foreach ($packages as $list) {
$package_list[$i]['package_name'] = $list->package_name;
$package_list[$i]['package_price'] = $list->package_price;
$package_list[$i]['package_desc'] = nl2br($list->package_desc);
$package_list[$i]['standard'] = $list->standard;
$package_list[$i]['spotlight'] = $list->spotlight;
$package_list[$i]['cv_views'] = $list->cv_views;
$package_list[$i]['id'] = $list->id;
if ($i < sizeof($package_spotlights)) {
$package_list[$i]['line'] = true;
} else {
$package_list[$i]['line'] = false;
}
$i++;
}
$smarty->assign('all_package', $package_list);
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'services');
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('employer/services.tpl'));
//services_page.php
示例11: safe_output
$employee =& $user;
$username = $session->get_username();
$full_name = $user->full_name();
$_SESSION['apply']['email'] = !empty($_POST['txt_email']) ? $_POST['txt_email'] : $user->email_address;
$_SESSION['apply']['work_status'] = $working_status = safe_output($_POST['txt_working_status']);
///To further your application you may also wish to complete the following optional questions
$_SESSION['apply']['fname'] = $fname = !empty($_POST['txt_fname']) ? $_POST['txt_fname'] : $user->fname;
$_SESSION['apply']['sname'] = $sname = !empty($_POST['txt_sname']) ? $_POST['txt_sname'] : $user->sname;
$full_name = $fname . " " . $sname;
$address = !empty($_POST['txt_address']) ? $_POST['txt_address'] : $user->address();
$_SESSION['apply']['address'] = str_replace(":", "\n", $address);
$_SESSION['apply']['home_tel'] = !empty($_POST['txt_tel']) ? $_POST['txt_tel'] : $user->phone_number;
$_SESSION['apply']['mob_tel'] = !empty($_POST['txt_mob']) ? $_POST['txt_mob'] : $user->phone_number;
$job_history = JobHistory::check_user_already_apply($job_id, $user_id);
if ($job_history && isset($job_history)) {
$message = empty($message) ? "<div class='error'>" . format_lang('error', 'already_apply') . " " . strftime(DATE_FORMAT, strtotime($jobs->created_at)) . "</div>" : $message;
}
$letter = "";
//get all my cv
$my_cvs = CVSetting::employee_find_all($user_id);
if (is_array($my_cvs) and !empty($my_cvs)) {
$cv_t = array();
$i = 1;
foreach ($my_cvs as $my_cv) {
if ($my_cv->default_cv == 'Y') {
$_SESSION['apply']['cv_selected'] = $my_cv->id;
}
$cv_t[$i]["id"] = $my_cv->id;
$cv_t[$i]["cv_title"] = $my_cv->cv_title;
$cv_t[$i]["default_cv"] = empty($_SESSION['apply']['which_cv']) ? "N" : $my_cv->default_cv;
$i++;
示例12: foreach
}
//county
$_SESSION['loc']['countycode'] = $_SESSION['loc']['countycode'] != '' ? $_SESSION['loc']['countycode'] : "";
if ($_SESSION['loc']['countycode'] != '') {
$lang['cities'] = $city->get_cityOptions($countrycode, $_SESSION['loc']['stateprovince'], $_SESSION['loc']['countycode'], 'N');
if (count($lang['cities']) == 1) {
foreach ($lang['cities'] as $key => $val) {
$_SESSION['loc']['citycode'] = $key;
}
}
//city
$_SESSION['loc']['citycode'] = $_SESSION['loc']['citycode'] != '' ? $_SESSION['loc']['citycode'] : "";
}
}
//end of location
$_SESSION['resume']['aya'] = $aya = $cv_details->are_you_auth;
$_SESSION['resume']['wtr'] = $wtr = $cv_details->willing_to_relocate;
$_SESSION['resume']['wtt'] = $wtt = $cv_details->willing_to_travel;
$_SESSION['resume']['notes'] = $notes = $cv_details->additional_notes;
}
$smarty->assign('authorised_to_work', format_lang("select", "authorised_to_work"));
$smarty->assign('willing_to_travel', format_lang("select", "willing_to_travel"));
$smarty->assign('salary', format_lang("select", "salary"));
$smarty->assign('NoYes', format_lang('select', 'NoYes'));
$smarty->assign('month', format_lang("select", "month"));
$smarty->assign('id', $id);
$smarty->assign('select_text', format_lang('select_text'));
$html_title = SITE_NAME . " - " . format_lang('page_title', 'cvfor') . chr(10) . $employee->full_name();
$smarty->assign('message', $message);
$smarty->assign('lang', $lang);
$smarty->assign('rendered_page', $smarty->fetch('resume_change.tpl'));
示例13: empty
$state = StateProvince::find_by_code($cv_details->country, $cv_details->state_province);
$state_name = empty($state) ? $cv_details->state_province : $state->name;
$state_var_name = $state ? $state->var_name : $cv_details->state_province;
$smarty->assign('state', $state_name);
$smarty->assign('state_url', $country_var_name . "/" . $state_var_name . "/");
//county
$county = County::find_by_code($cv_details->country, $cv_details->state_province, $cv_details->county);
$county_name = empty($county) ? $cv_details->county : $county->name;
$county_var_name = $county ? $county->var_name : $cv_details->county;
$smarty->assign('county', $county_name);
$smarty->assign('county_url', $country_var_name . "/" . $state_var_name . "/" . $county_var_name . "/");
$city = City::find_by_code($cv_details->country, $cv_details->state_province, $cv_details->county, $cv_details->city);
$city_name = empty($city) ? $cv_details->city : $city->name;
$city_var_name = empty($city) ? $cv_details->city : $city->var_name;
$smarty->assign('city', $city_name);
$smarty->assign('city_url', $country_var_name . "/" . $state_var_name . "/" . $county_var_name . "/" . $city_var_name . "/");
//end of location
$authorised_to_work = format_lang('select', 'authorised_to_work');
$aya = !empty($cv_details->are_you_auth) ? $authorised_to_work[$cv_details->are_you_auth] : format_lang('none');
$smarty->assign('aya', $aya);
$wtr = !empty($cv_details->willing_to_relocate) ? $get_NoYes[$cv_details->willing_to_relocate] : format_lang('none');
$smarty->assign('wtr', $wtr);
$wtt = $cv_details->willing_to_travel;
$smarty->assign('wtt', $wtt);
$notes = $cv_details->additional_notes ? $cv_details->additional_notes : format_lang('none');
$smarty->assign('notes', $notes);
$smarty->assign('id', $id);
$html_title = SITE_NAME . " - " . format_lang('page_title', 'cv_view') . " " . $employee->full_name();
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('view_resume.tpl'));
示例14: PackageInvoice
}
*/
$clint->username = $username;
$total_post = $clint->total_job_post();
$smarty->assign('total_post', $total_post);
$total_spotlight_post = $clint->total_spotlight_job_post();
$smarty->assign('total_spotlight_post', $total_spotlight_post);
$total_cv = $clint->total_cv();
$smarty->assign('total_cv', $total_cv);
$invoice = new PackageInvoice();
$invoice->fk_employer_id = $user_id;
$recent_orders = $invoice->recent_order_by_clint();
if ($recent_orders) {
$package_list = array();
$i = 1;
foreach ($recent_orders as $list) {
$package_list[$i]['invoice_date'] = strftime(DATE_FORMAT, strtotime($list->invoice_date));
$package_list[$i]['id'] = $list->id;
$package_list[$i]['item_name'] = $list->item_name;
$package_list[$i]['package_status'] = $list->package_status;
$package_list[$i]['amount'] = $list->amount;
$package_list[$i]['package_id'] = $list->fk_package_id;
$i++;
}
$smarty->assign('recent_orders', $package_list);
}
$smarty->assign('dont_include_left', true);
$html_title = SITE_NAME . " - " . format_lang('page_title', 'credits');
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('employer/credits.tpl'));
示例15: format_lang
$save_search->id = $id;
if ($save_search->delete_saveSearch()) {
$message = "<div class='success'>" . format_lang('success', 'delete_success') . "</div>";
} else {
$message = "<div class='error'>" . format_lang('errormsg', 64) . "</div>";
}
} else {
redirect_to(BASE_URL . "save_search/");
die;
}
$session->message($message);
redirect_to(BASE_URL . "save_search/");
}
$save_search_arr = SaveSearch::find_by_user_id($user_id);
if (!empty($save_search_arr)) {
$search = array();
$i = 1;
foreach ($save_search_arr as $save_search) {
$search[$i]['id'] = $save_search->id;
$search[$i]['reference_name'] = $save_search->reference_name;
$search[$i]['reference'] = urldecode($save_search->reference);
$search[$i]['is_deleted'] = $save_search->is_deleted;
$search[$i]['created_at'] = strftime(DATE_FORMAT, strtotime($save_search->date_save));
$i++;
}
$smarty->assign('save_search', $search);
}
$html_title = SITE_NAME . " - " . format_lang('page_title', 'save_search') . chr(10) . strip_html($employee->full_name());
$smarty->assign('lang', $lang);
$smarty->assign('message', $message);
$smarty->assign('rendered_page', $smarty->fetch('save_search.tpl'));