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


PHP Package::find_by_id方法代码示例

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


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

示例1: strftime

$smarty->assign('invoice_no', $invoice_no);
$invoice_date = strftime(DATE_FORMAT, strtotime($invoice->invoice_date));
$smarty->assign('invoice_date', $invoice_date);
$payment_date = $invoice->processed_date == 'null' || $invoice->processed_date == "0000-00-00 00:00:00" ? "" : strftime(DATE_FORMAT, strtotime($invoice->processed_date));
$smarty->assign('payment_date', $payment_date);
///$invoice_to
$emp = Employer::find_by_username($username);
$invoice_to = $emp->address();
$invoice_to = str_replace(":", "<br />", $invoice_to);
$name = $emp->full_name();
$invoice_to = $name . "<br />" . $invoice_to;
$smarty->assign('invoice_to', $invoice_to);
$payment_to = "Jobberland<br />Address1 <br />Address1<br />Code";
$smarty->assign('payment_to', $payment_to);
//item
$package = Package::find_by_id($invoice->fk_package_id);
$description = $package->package_desc;
$smarty->assign('description', $description);
$package_name = $package->package_name;
$smarty->assign('package_name', $package_name);
$qty = $package->package_job_qty;
$smarty->assign('qty', $qty);
$amount = format_number($invoice->amount);
$smarty->assign('amount', $amount);
$vat = "17.5";
$vat_cal = $vat / 100;
$vat_cal = $vat_cal + 1;
$sub_total = $amount / $vat_cal;
$sub_total = format_number($sub_total);
$smarty->assign('sub_total', $sub_total);
$vat_amount = $sub_total / 100 * $vat;
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:invoice_page.php

示例2: redirect_to

if (!isset($_REQUEST['package_id'])) {
    redirect_to(BASE_URL . "employer/credits/");
}
$user_id = $session->get_user_id();
$username = $session->get_username();
$user = Employer::find_by_id($user_id);
$packageinvoice = new PackageInvoice();
$packageinvoice->fk_employer_id = $user_id;
//$user->username;
$packageinvoice->fk_package_id = (int) $_REQUEST['package_id'];
if ($_REQUEST['action'] == 'post' || $_REQUEST['action'] == 'premium_post') {
    $pack_invoice = $packageinvoice->check_invoice();
    if ($pack_invoice) {
        $invoice_id = $pack_invoice->id;
    } else {
        $package = Package::find_by_id($_REQUEST['package_id']);
        if ($package) {
            $status = 'Selected';
            $packageinvoice->invoice_date = gmdate("Y-m-d H:i:s");
            $packageinvoice->processed_date = "null";
            $packageinvoice->package_status = $status;
            $packageinvoice->fk_employer_id = $user_id;
            $packageinvoice->fk_package_id = $package->id;
            $packageinvoice->posts_quantity = $package->package_job_qty;
            $packageinvoice->standard = $package->standard;
            $packageinvoice->spotlight = $package->spotlight;
            $packageinvoice->cv_views = $package->cv_views;
            $packageinvoice->amount = $package->package_price;
            $packageinvoice->item_name = $package->package_name;
            $packageinvoice->subscr_date = "";
            $packageinvoice->payment_method = "";
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:order_page.php

示例3: PackageInvoice

<?php

$_SESSION['direct_to_emp'] = "credits/";
include_once 'sessioninc.php';
$username = $session->get_username();
$user_id = $session->get_user_id();
$invoice = new PackageInvoice();
$invoice->fk_employer_id = $user_id;
$recent_orders = $invoice->orders_by_user();
if ($recent_orders) {
    $package_list = array();
    $i = 1;
    foreach ($recent_orders as $list) {
        $pack = Package::find_by_id($list->fk_package_id);
        $package_list[$i]['invoice_date'] = strftime(DATE_FORMAT, strtotime($list->invoice_date));
        $package_list[$i]['processed_date'] = $list->processed_date == "0000-00-00 00:00:00" || $list->processed_date == 'null' ? "Not Confirmed" : strftime(DATE_FORMAT, strtotime($list->processed_date));
        $package_list[$i]['id'] = $list->id;
        $package_list[$i]['item_name'] = $list->item_name;
        $package_list[$i]['package_desc'] = $pack->package_desc;
        $package_list[$i]['posts_quantity'] = $list->posts_quantity;
        $package_list[$i]['standard'] = $list->standard;
        $package_list[$i]['spotlight'] = $list->spotlight;
        $package_list[$i]['cv_views'] = $list->cv_views;
        $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);
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:payment_history_page.php

示例4: redirect_to

    $package->package_job_qty = $_SESSION['package']['qty'] = $_POST['txt_qty'];
    $package->standard = $_SESSION['package']['standard'] = $_POST['txt_standard'];
    $package->spotlight = $_SESSION['package']['spotlight'] = $_POST['txt_spotlight'];
    $package->cv_views = $_SESSION['package']['cv_views'] = $_POST['txt_cv_views'];
    $package->is_active = $_SESSION['package']['active'] = $_POST['txt_active'];
    if ($package->save()) {
        $session->message("<div class='success'> Package has been successfully updated. </div>");
        redirect_to("list_packages.php");
        die;
    } else {
        $message = "<div class='error'> following error(s) found: <ul> <li />";
        $message .= join(" <li /> ", $package->errors);
        $message .= " </ul></div>";
    }
} else {
    $package = Package::find_by_id($_GET['id']);
    $_SESSION['package']['name'] = $package->package_name;
    $_SESSION['package']['desc'] = $package->package_desc;
    $_SESSION['package']['price'] = $package->package_price;
    $_SESSION['package']['qty'] = $package->package_job_qty;
    $_SESSION['package']['standard'] = $package->standard;
    $_SESSION['package']['spotlight'] = $package->spotlight;
    $_SESSION['package']['cv_views'] = $package->cv_views;
    $_SESSION['package']['active'] = $package->is_active;
}
$NoYes = get_lang("select", "NoYes");
$smarty->assign('NoYes', $NoYes);
$smarty->assign('id', $_GET['id']);
$_SESSION['package']['standard'] = !isset($_SESSION['package']['standard']) ? "Y" : $_SESSION['package']['standard'];
$html_title = SITE_NAME . " Edit Package ";
$smarty->assign('lang', $lang);
开发者ID:nim94sha,项目名称:Online-Job-Portal,代码行数:31,代码来源:edit_package.php


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