当前位置: 首页>>代码示例>>PHP>>正文


PHP Currency::getSymbolFromCountryCode方法代码示例

本文整理汇总了PHP中Currency::getSymbolFromCountryCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::getSymbolFromCountryCode方法的具体用法?PHP Currency::getSymbolFromCountryCode怎么用?PHP Currency::getSymbolFromCountryCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Currency的用法示例。


在下文中一共展示了Currency::getSymbolFromCountryCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show()
 {
     $this->begin();
     $this->top_search('Home');
     $this->menu('member', 'home');
     $this->howitworks();
     $country = $this->member->getCountry();
     $currency = Currency::getSymbolFromCountryCode($country);
     $completeness_raw = $this->get_completeness();
     $completeness_percent = 0;
     $next_step = '';
     $total = 0;
     foreach ($completeness_raw as $key => $value) {
         $total += $value;
         $completeness_percent = $total / count($completeness_raw) * 100;
         if ($completeness_percent < 100 && empty($next_step)) {
             switch ($key) {
                 case 'seeking':
                     $next_step = 'Fill in Current Job Responsibilities / Experiences.';
                     break;
                 case 'current_salary':
                     $next_step = 'Fill in Current Salary range.';
                     break;
                 case 'expected_salary':
                     $next_step = 'Fill in Expected Salary range.';
                     break;
                 case 'preferred_job_location':
                     $next_step = 'Select your preferred job locations.';
                     break;
                 case 'can_travel_relocate':
                     $next_step = 'Fill in Willing to travel / relocate.';
                     break;
                 case 'reason_for_leaving':
                     $next_step = 'Fill in Reason for Leaving.';
                     break;
                 case 'notice_period':
                     $next_step = 'Fill in Notice Period.';
                     break;
                 case 'has_job_profiles':
                     $next_step = 'Add a Present &amp; Past Position.';
                     break;
             }
         }
     }
     if ($completeness_percent >= 100) {
         $next_step = 'Career Profile is complete.';
     }
     $answers = $this->get_answers();
     $is_active = $answers['is_active_seeking_job'] == '1' ? true : false;
     $job_profiles = $this->get_job_profiles();
     $page = file_get_contents(dirname(__FILE__) . '/../../../html/member_home_page.html');
     $page = str_replace('%root%', $this->url_root, $page);
     $page = str_replace('%country_code%', $country, $page);
     $page = str_replace('%country%', Country::getCountryFrom($country), $page);
     $page = str_replace('%currency%', $currency, $page);
     if (isset($_SESSION['yel']['member']['linkedin_id'])) {
         if (!empty($_SESSION['yel']['member']['linkedin_id'])) {
             $page = str_replace('%linkedin_copy_display%', 'block', $page);
         } else {
             $page = str_replace('%linkedin_copy_display%', 'none', $page);
         }
     } else {
         $page = str_replace('%linkedin_copy_display%', 'none', $page);
     }
     // if (!empty($this->error_message)) {
     //     $page = str_replace('%error_message%', $this->error_message, $page);
     // } else {
     //     $page = str_replace('%error_message%', '', $page);
     // }
     // completeness
     $progress_percent = $completeness_percent;
     if ($completeness_percent >= 100) {
         // this is to make sure the progress bar does not touch the right edge
         $progress_percent -= 1;
     }
     $page = str_replace('%completeness_percent%', $progress_percent, $page);
     $page = str_replace('%lbl_completeness_percent%', $completeness_percent, $page);
     $page = str_replace('%next_step%', $next_step, $page);
     // photo
     $photo_html = '<div style="text-align: center; margin: auto;">Max resolution: 200x220 pixels<br/>Max size: 150KB</div>';
     if ($this->member->hasPhoto()) {
         $photo_html = '<img id="photo_image" class="photo_image" src="candidate_photo.php?id=' . $this->member->getId() . '" />';
     }
     $page = str_replace('%photo_html%', $photo_html, $page);
     // resumes
     $resumes = $this->get_resumes();
     $page = str_replace('%member_email%', $this->member->getId(), $page);
     if (empty($resumes)) {
         $page = str_replace('%no_resumes%', 'block', $page);
         $page = str_replace('%resumes_table%', '', $page);
     } else {
         $page = str_replace('%no_resumes%', 'none', $page);
         $resumes_table = new HTMLTable('resumes_table', 'resumes');
         $resumes_table->set(0, 0, "Updated On", '', 'header');
         $resumes_table->set(0, 1, "File Name", '', 'header');
         $resumes_table->set(0, 2, "&nbsp;", '', 'header actions');
         foreach ($resumes as $i => $resume) {
             $resumes_table->set($i + 1, 0, $resume['formatted_modified_on'], '', 'cell');
             $resumes_table->set($i + 1, 1, '<a href="resume.php?id=' . $resume['id'] . '">' . $resume['file_name'] . '</a>', '', 'cell');
             $resumes_table->set($i + 1, 2, '<a class="no_link" onClick="update_resume(' . $resume['id'] . ');">Update</a>', '', 'cell actions');
//.........这里部分代码省略.........
开发者ID:pamalite,项目名称:yel,代码行数:101,代码来源:member_home_page.php

示例2: Employer

}
if ($_POST['action'] == 'resend') {
    $invoice = Invoice::get($_POST['id']);
    $invoice[0]['items'] = Invoice::getItems($_POST['id']);
    $employer = new Employer($invoice[0]['employer']);
    $recipients = $employer->getEmailAddress();
    if (isset($_POST['recipients'])) {
        if (!empty($_POST['recipients'])) {
            $recipients = str_replace(';', ',', $_POST['recipients']);
        }
    }
    $branch = $employer->getAssociatedBranch();
    $sales = 'sales.' . strtolower($branch[0]['country']) . '@yellowelevator.com';
    $branch[0]['address'] = str_replace(array("\r\n", "\r"), "\n", $branch[0]['address']);
    $branch['address_lines'] = explode("\n", $branch[0]['address']);
    $currency = Currency::getSymbolFromCountryCode($branch[0]['country']);
    $amount_payable = 0.0;
    foreach ($invoice[0]['items'] as $i => $item) {
        $amount_payable += $item['amount'];
        $items[$i]['amount'] = number_format($item['amount'], 2, '.', ', ');
    }
    $amount_payable = number_format($amount_payable, 2, '.', ', ');
    // generate pdf
    $pdf = new GeneralInvoice();
    $pdf->AliasNbPages();
    $pdf->SetAuthor('Yellow Elevator. This invoice was automatically generated. Signature is not required.');
    $pdf->SetTitle($GLOBALS['COMPANYNAME'] . ' - Invoice ' . pad($invoice[0]['id'], 11, '0'));
    $pdf->SetInvoiceType($invoice[0]['type'], 'Invoice');
    $pdf->SetCurrency($currency);
    $pdf->SetBranch($branch);
    $pdf->AddPage();
开发者ID:pamalite,项目名称:yel,代码行数:31,代码来源:payments_action.php

示例3: show

    public function show()
    {
        $this->begin();
        $branch = $this->employee->getBranch();
        if ($this->is_new) {
            $this->top('Employer - ' . $branch[0]['country'] . ' - New Employer');
        } else {
            $this->top('Employer - ' . $branch[0]['country'] . ' - ' . htmlspecialchars_decode(stripslashes($this->employer->getName())));
        }
        $this->menu_employee('employers');
        $subscriptions_rates = $GLOBALS['subscriptions_rates'];
        $available_subscriptions = $subscriptions_rates[Currency::getSymbolFromCountryCode($branch[0]['country'])];
        $raw_data = array();
        $profile = array();
        $fees = array();
        $jobs = array();
        if (!$this->is_new) {
            // get profile
            $raw_data = $this->employer->get();
            $profile = $raw_data[0];
            // get fees
            $fees = $this->employer->getFees();
            // get jobs
            $jobs = $this->employer->getJobs();
        } else {
            if ($this->is_new && !is_null($this->employer)) {
                // get profile
                $raw_data = $this->employer->get();
                $profile = $raw_data[0];
            } else {
                $profile = array('license_num' => '', 'working_months' => '12', 'payment_terms_days' => '30', 'email_addr' => '', 'contact_person' => '', 'name' => '', 'website_url' => '', 'phone_num' => '', 'address' => '', 'state' => '', 'zip' => '', 'country' => $branch[0]['country']);
            }
        }
        ?>
        <!-- submenu -->
        <div class="menu">
            <?php 
        $style = 'background-color: #CCCCCC;';
        ?>
            <ul class="menu">
                
                <li id="item_profile" style="<?php 
        echo $this->current_page == 'profile' ? $style : '';
        ?>
"><a class="menu" onClick="show_profile();">Profile</a></li>
            <?php 
        if (!$this->is_new) {
            ?>
                <li id="item_fees" style="<?php 
            echo $this->current_page == 'fees' ? $style : '';
            ?>
"><a class="menu" onClick="show_fees();">Fees</a></li>
                <li id="item_subscriptions" style="<?php 
            echo $this->current_page == 'subscriptions' ? $style : '';
            ?>
"><a class="menu" onClick="show_subscriptions();">Subscriptions</a></li>
                <li id="item_jobs" style="<?php 
            echo $this->current_page == 'jobs' ? $style : '';
            ?>
"><a class="menu" onClick="show_jobs();">Jobs</a></li>
            <?php 
        }
        ?>
            </ul>
        </div>
        <!-- end submenu -->
        
        <div id="div_status" class="status">
            <span id="span_status" class="status"></span>
        </div>
        
        <div id="employer_profile">
            <form id="profile" method="post" onSubmit="return false;">
                <table class="profile_form">
                    <tr>
                        <td class="buttons_bar" colspan="2"><input type="button" onClick="save_profile();" value="Save &amp; Update Profile" /></td>
                    </tr>
                    <tr>
                        <td class="label"><label for="business_license">Company/Business Registration No.:</label></td>
                        <td class="field"><input class="field" type="text" id="business_license" name="business_license" value="<?php 
        echo $profile['license_num'];
        ?>
" /></td>
                    </tr>
                    <tr>
                        <td class="title" colspan="2">Sign In Details</td>
                    </tr>
                    <tr>
                        <td class="label">User ID:</td>
                        <td class="field">
                            <?php 
        if ($this->is_new) {
            ?>
                            <input class="field" type="text" id="user_id" value=""  maxlength="10" />
                            <?php 
        } else {
            echo $profile['id'];
        }
        ?>
                        </td>
//.........这里部分代码省略.........
开发者ID:pamalite,项目名称:yel,代码行数:101,代码来源:employee_employer_page.php

示例4: send_invoice

function send_invoice(&$_employer, $_paid_postings, $_subscription_period)
{
    if (!is_a($_employer, 'Employer')) {
        return false;
    }
    $today = date('Y-m-d');
    $branch = $_employer->getAssociatedBranch();
    $sales = 'sales.' . strtolower($branch[0]['country']) . '@yellowelevator.com';
    $branch[0]['address'] = str_replace(array("\r\n", "\r"), "\n", $branch[0]['address']);
    $branch['address_lines'] = explode("\n", $branch[0]['address']);
    $currency = Currency::getSymbolFromCountryCode($branch[0]['country']);
    if ($_paid_postings > 0) {
        // 0. get the job postings pricing and currency
        $posting_rates = $GLOBALS['postings_rates'];
        $price = $posting_rates[$currency];
        // 1. generate invoice in the system
        $data = array();
        $data['issued_on'] = $today;
        $data['type'] = 'P';
        $data['employer'] = $_POST['id'];
        $data['payable_by'] = sql_date_add($today, $_employer->getPaymentTermsInDays(), 'day');
        $invoice = Invoice::create($data);
        if ($invoice === false) {
            echo 'ko';
            exit;
        }
        $amount = $price * $_paid_postings;
        $desc = $_paid_postings . ' Job Posting(s) @ ' . $currency . ' $' . $price;
        $item_added = Invoice::addItem($invoice, $amount, '1', $desc);
        $items = array();
        $items[0]['itemdesc'] = $desc;
        $items[0]['amount'] = number_format($amount, '2', '.', ', ');
        // 2. generate the invoice as PDF file
        $pdf = new PaidPostingsInvoice();
        $pdf->AliasNbPages();
        $pdf->SetAuthor('Yellow Elevator. This invoice was automatically generated. Signature is not required.');
        $pdf->SetTitle($GLOBALS['COMPANYNAME'] . ' - Invoice ' . pad($invoice, 11, '0'));
        $pdf->SetCurrency($currency);
        $pdf->SetBranch($branch);
        $pdf->AddPage();
        $pdf->SetFont('Arial', '', 10);
        $pdf->SetTextColor(255, 255, 255);
        $pdf->SetFillColor(54, 54, 54);
        $pdf->Cell(60, 5, "Invoice Number", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(33, 5, "Issuance Date", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(33, 5, "Payable By", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(0, 5, "Amount Payable (" . $currency . ")", 1, 0, 'C', 1);
        $pdf->Ln(6);
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Cell(60, 5, pad($invoice, 11, '0'), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(33, 5, sql_date_format($data['issued_on']), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(33, 5, sql_date_format($data['payable_by']), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(0, 5, number_format($amount, '2', '.', ', '), 1, 0, 'C');
        $pdf->Ln(6);
        $pdf->SetTextColor(255, 255, 255);
        $pdf->Cell(60, 5, "User ID", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(0, 5, "Employer Name", 1, 0, 'C', 1);
        $pdf->Ln(6);
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Cell(60, 5, $_employer->getId(), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(0, 5, $_employer->getName(), 1, 0, 'C');
        $pdf->Ln(10);
        $table_header = array("No.", "Item", "Amount (" . $currency . ")");
        $pdf->FancyTable($table_header, $items, number_format($amount, '2', '.', ', '));
        $pdf->Ln(13);
        $pdf->SetFont('', 'I');
        $pdf->Cell(0, 0, "This invoice was automatically generated. Signature is not required.", 0, 0, 'C');
        $pdf->Ln(6);
        $pdf->Cell(0, 5, "Payment Notice", 'LTR', 0, 'C');
        $pdf->Ln();
        $pdf->Cell(0, 5, "- Payment shall be made payable to " . $branch[0]['branch'] . ".", 'LR', 0, 'C');
        $pdf->Ln();
        $pdf->Cell(0, 5, "- To facilitate the processing of the payment, please write down the invoice number(s) on your cheque(s)/payment slip(s)", 'LBR', 0, 'C');
        $pdf->Ln(10);
        $pdf->Cell(0, 0, "E. & O. E.", 0, 0, 'C');
        $pdf->Close();
        $pdf->Output($GLOBALS['data_path'] . '/subscription_invoices/' . $invoice . '.pdf', 'F');
        // 3. sends it as an email
        $attachment = chunk_split(base64_encode(file_get_contents($GLOBALS['data_path'] . '/subscription_invoices/' . $invoice . '.pdf')));
        $subject = "Subscription Invoice " . pad($invoice, 11, '0');
        $headers = 'From: YellowElevator.com <admin@yellowelevator.com>' . "\n";
        $headers .= 'Bcc: ' . $sales . "\n";
        $headers .= 'MIME-Version: 1.0' . "\n";
        $headers .= 'Content-Type: multipart/mixed; boundary="yel_mail_sep_' . $invoice . '";' . "\n\n";
        $body = '--yel_mail_sep_' . $invoice . "\n";
        $body .= 'Content-Type: multipart/alternative; boundary="yel_mail_sep_alt_' . $invoice . '"' . "\n";
        $body .= '--yel_mail_sep_alt_' . $invoice . "\n";
        $body .= 'Content-Type: text/plain; charset="iso-8859-1"' . "\n";
        $body .= 'Content-Transfer-Encoding: 7bit"' . "\n";
        $mail_lines = file('../private/mail/employer_posting_invoice.txt');
        $message = '';
        foreach ($mail_lines as $line) {
//.........这里部分代码省略.........
开发者ID:pamalite,项目名称:yel,代码行数:101,代码来源:employer_action.php

示例5: Member

    $member = new Member($_POST['member']);
    $to_currency = Currency::getSymbolFromCountryCode($member->get_country_code());
    $total = 0.0;
    foreach ($result as $row) {
        $from_currency = $row['currency'];
        $amount = $row['total_reward'];
        $total += Currency::convert_amount_from_to($from_currency, $to_currency, $amount);
    }
    $response = array('reward_earned' => number_format($total, 2, '.', ', '));
    header('Content-type: text/xml');
    echo $xml_dom->get_xml_from_array($response);
    exit;
}
if ($_POST['action'] == 'get_currency_symbol') {
    $member = new Member($_POST['member']);
    if ($symbol = Currency::getSymbolFromCountryCode($member->get_country_code())) {
        header('Content-type: text/xml');
        echo $xml_dom->get_xml_from_array(array('symbol' => $symbol));
        exit;
    }
    echo "ko";
    exit;
}
if ($_POST['action'] == 'get_candidate_histories') {
    $order_by = 'referred_on desc';
    if (isset($_POST['order_by'])) {
        $order_by = $_POST['order_by'];
    }
    $query = "SELECT referrals.id, jobs.title, employers.name, branches.currency, \n              DATE_FORMAT(referrals.referred_on, '%e %b, %Y') AS formatted_referred_on, \n              DATE_FORMAT(referrals.referee_acknowledged_on, '%e %b, %Y') AS formatted_referee_acknowledged_on, \n              DATE_FORMAT(referrals.referee_acknowledged_others_on, '%e %b, %Y') AS formatted_referee_acknowledged_others_on, \n              DATE_FORMAT(referrals.employed_on, '%e %b, %Y') AS formatted_employed_on, \n              DATE_FORMAT(referrals.work_commence_on, '%e %b, %Y') AS formatted_work_commence_on, \n              referrals.total_reward, SUM(referral_rewards.reward) AS paid_reward \n              FROM referrals \n              LEFT JOIN referral_rewards ON referral_rewards.referral = referrals.id \n              LEFT JOIN members ON members.email_addr = referrals.referee \n              LEFT JOIN jobs ON jobs.id = referrals.job \n              LEFT JOIN employers ON employers.id = jobs.employer \n              LEFT JOIN branches ON branches.id = employers.branch \n              LEFT JOIN member_referees ON referrals.member = member_referees.member AND \n              referrals.referee = member_referees.referee\n              WHERE member_referees.id = " . $_POST['id'] . " AND \n              (referrals.replacement_authorized_on IS NULL OR referrals.replacement_authorized_on = '0000-00-00 00:00:00') \n              GROUP BY referrals.id \n              ORDER BY " . $order_by;
    $mysqli = Database::connect();
    $result = $mysqli->query($query);
开发者ID:pamalite,项目名称:yel,代码行数:31,代码来源:candidate_action.php


注:本文中的Currency::getSymbolFromCountryCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。