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


PHP mysql::get_total方法代码示例

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


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

示例1: dirname

 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
require_once dirname(__FILE__) . '/../../include/common.inc.php';
require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
require_once QISHI_ROOT_PATH . 'include/fun_personal.php';
$smarty->cache = false;
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
$act = !empty($_REQUEST['act']) ? trim($_REQUEST['act']) : 'password_edit';
if ($_SESSION['uid'] == '' || $_SESSION['username'] == '' || intval($_SESSION['utype']) == 1) {
    header("Location: ../wap_login.php");
} elseif ($act == 'password_edit') {
    $uid = intval($_SESSION['uid']);
    $smarty->assign('total', $db->get_total("SELECT COUNT(*) AS num FROM " . table('pms') . " WHERE (msgfromuid='{$uid}' OR msgtouid='{$uid}') AND `new`='1'"));
    $smarty->assign('title', '修改密码 - 个人会员中心 - ' . $_CFG['site_name']);
    $smarty->display("wap/personal/wap-password.html");
} elseif ($act == 'save_password') {
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $arr['username'] = $_SESSION['username'];
    $arr['oldpassword'] = trim($_POST['oldpassword']) ? trim($_POST['oldpassword']) : exit('请输入旧密码!');
    $arr['password'] = trim($_POST['password']) ? trim($_POST['password']) : exit('请输入新密码!');
    if ($arr['password'] != trim($_POST['password1'])) {
        exit('两次输入密码不相同,请重新输入!');
    }
    //edit_password()修改密码的方法
    $info = edit_password($arr);
    if ($info == -1) {
        exit('旧密码输入错误,请重新输入!');
    }
开发者ID:source-hunter,项目名称:74cms,代码行数:31,代码来源:wap_password.php

示例2: intval

    if ($category > 0) {
        $joinwheresql = " WHERE  category=" . intval($category);
        if ($subclass > 0) {
            $joinwheresql .= " AND  subclass=" . intval($subclass);
        }
        $joinsql .= "  INNER  JOIN  ( SELECT DISTINCT pid FROM " . table('resume_jobs') . " {$joinwheresql} )AS j ON  f.resume_id=j.pid ";
    }
    $perpage = 5;
    $count = 0;
    $page = empty($_GET['page']) ? 1 : intval($_GET['page']);
    if ($page < 1) {
        $page = 1;
    }
    $start = ($page - 1) * $perpage;
    $total_sql = "SELECT COUNT(*) AS num FROM  " . table('company_favorites') . " as f " . $joinsql . " {$wheresql}";
    $count = $db->get_total($total_sql);
    $smarty->assign('favorites', wap_get_favorites($start, $perpage, $joinsql . $wheresql));
    $smarty->display("m/company/m-collect-resumes.html");
} elseif ($act == "ajax_collect_resume") {
    $favoriteshtml = "";
    $rows = intval($_GET['rows']);
    $offset = intval($_GET['offset']);
    $wheresql = " WHERE a.company_uid='{$_SESSION['uid']}' ";
    $row = $db->getall("select a.*,r.title,r.fullname,r.sex,r.display_name,r.education_cn,r.birthdate,r.experience_cn,r.residence from " . table("company_favorites") . " as a left join " . table("resume") . " as r on a.resume_id=r.id  {$wheresql} order by a.favoritesa_ddtime desc limit {$offset},{$rows}");
    if (!empty($row) && $offset <= 100) {
        foreach ($row as $list) {
            $list["birthdate_"] = date('Y', time()) - $list["birthdate"];
            if ($list['display_name'] == "2") {
                $list['fullname'] = "N" . str_pad($list['resume_id'], 7, "0", STR_PAD_LEFT);
            } elseif ($list['display_name'] == "3") {
                if ($list['sex'] == 1) {
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:company_collect_reusme.php

示例3: exit

    } else {
        exit('删除失败!');
    }
} elseif ($act == 'next_page') {
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    //试卷id
    $id = $_REQUEST['id'] ? intval($_REQUEST['id']) : 0;
    //试卷信息
    $peper_sql = "SELECT * FROM " . table('evaluation_paper') . " WHERE id=" . $id;
    $paper_info = $db->getone($peper_sql);
    $smarty->assign('paper_info', $paper_info);
    //测题信息
    $perpage = 10;
    $total_sql = "SELECT COUNT(*) AS num from " . table('evaluation_question') . " WHERE paper_id=" . $id;
    $total_val = $db->get_total($total_sql);
    $page_num = ceil($total_val / $perpage);
    //点击上一页
    if ($_REQUEST['pre_page']) {
        $page = $_REQUEST['page'] ? intval($_REQUEST['page']) - 1 : 2;
        $offset = ($page - 1) * $perpage;
        $smarty->assign('page', $page);
        $smarty->assign('next_page', 1);
        if ($page != 1) {
            $smarty->assign('pre_page', 1);
        }
    } else {
        $page = $_REQUEST['page'] ? intval($_REQUEST['page']) + 1 : 2;
        if ($page != $page_num) {
            $smarty->assign('next_page', 1);
        }
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:evaluation_ajax.php

示例4: exit

            $user_points = get_user_points($_SESSION['uid']);
            if ($points_rule['jobs_add']['type'] == "2" && $points_rule['jobs_add']['value'] > 0) {
                $total = $points_rule['jobs_add']['value'];
                if ($total > $user_points) {
                    exit("你的" . $_CFG['points_byname'] . "不足,请充值后再发布!");
                }
            }
        } elseif ($add_mode == '2') {
            $setmeal = get_user_setmeal($_SESSION['uid']);
            if ($setmeal['endtime'] < time() && $setmeal['endtime'] != "0") {
                exit("您的服务已经到期,请重新开通");
            }
            /*
            	显示中的职位(审核通过,审核中,未暂停)
            */
            $jobs_num = $db->get_total("select count(*) num from " . table("jobs") . " where uid={$_SESSION['uid']} and audit=1 and display=1 ");
            $jobs_tmp_num = $db->get_total("select count(*) num from " . table("jobs_tmp") . " where uid={$_SESSION['uid']} and audit=2 and display=1 ");
            $com_jobs_num = $jobs_num + $jobs_tmp_num;
            if ($com_jobs_num >= $setmeal['jobs_ordinary']) {
                exit("当前显示的职位已经超过了最大限制,请升级服务套餐!");
            }
        }
        exit("1");
    } else {
        exit("2");
        //header("Location: user.php?act=company_info_add");
    }
} elseif ($act == "jobs_add") {
    $smarty->cache = false;
    $company_info = get_company(intval($_SESSION['uid']));
    if ($company_info['companyname']) {
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:company_jobs.php

示例5: intval

$company_id = $_GET['company_id'] ? intval($_GET['company_id']) : "";
$vip_menu = $_GET['vip_menu'] ? intval($_GET['vip_menu']) : "";
if ($act == "index") {
    // 企业信息
    if ($company_id > 0) {
        //插入访问记录(1->访问  2->点赞  3->分享)
        $insetarr['company_id'] = $company_id;
        $insetarr['uid'] = $_SESSION['uid'];
        $insetarr['click_type'] = 1;
        $insetarr['addtime'] = strtotime(date("Y-m-d"));
        $insetarr['ip'] = getip();
        $db->inserttable(table('company_praise'), $insetarr);
        $company_info = $db->getone("SELECT * from " . table("company_profile") . " where id={$company_id} limit 1");
        $company_info['contents'] = htmlspecialchars_decode($company_info['contents'], ENT_QUOTES);
        //统计点赞数
        $praise = $db->get_total("SELECT COUNT(*) AS num FROM " . table('company_praise') . " WHERE company_id={$company_id} AND click_type=2 ");
        $company_info['wzp_click'] = $praise;
        if ($company_info['logo']) {
            $company_info['logo'] = $_CFG['site_domain'] . $_CFG['site_dir'] . 'data/logo/' . $company_info['logo'];
        } else {
            $company_info['logo'] = $_CFG['site_domain'] . $_CFG['site_dir'] . 'data/logo/no_logo.gif';
        }
        $smarty->assign('company_info', $company_info);
        if (empty($company_info)) {
            $smarty->display("m/m-wzp_error.html");
        } else {
            // 企业自己访问出现菜单
            if ($vip_menu == "1") {
                $smarty->assign('show_menue', 1);
            }
            // 企业职位
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:m-wzp.php

示例6: date

        $resume_info['age'] = date("Y") - $resume_info['birthday'];
        $smarty->assign('resume_info', $resume_info);
        $smarty->display("wap/personal/wap-user-personal-index.html");
    }
} elseif ($act == 'favorites') {
    $perpage = 5;
    $count = 0;
    $page = empty($_GET['page']) ? 1 : intval($_GET['page']);
    if ($page < 1) {
        $page = 1;
    }
    $theurl = "wap_user.php?act=favorites";
    $start = ($page - 1) * $perpage;
    $wheresql = " WHERE f.personal_uid='{$_SESSION['uid']}' ";
    $total_sql = "SELECT COUNT(*) AS num FROM " . table('personal_favorites') . " AS f {$wheresql} ";
    $count = $db->get_total($total_sql);
    $joinsql = " LEFT JOIN " . table('jobs') . " as  j  ON f.jobs_id=j.id ";
    $smarty->assign('favorites', get_favorites($start, $perpage, $joinsql . $wheresql));
    $smarty->assign('pagehtml', wapmulti($count, $perpage, $page, $theurl));
    $smarty->display('wap/personal/wap-collect.html');
} elseif ($act == 'add_favorites') {
    $id = isset($_POST['id']) ? intval($_POST['id']) : exit("err");
    if (intval($_SESSION['utype'] != 2)) {
        exit("个人会员请登录后收藏职位");
    } elseif (add_favorites($id, intval($_SESSION['uid'])) == 0) {
        exit("收藏夹中已经存在此职位");
    } else {
        exit("ok");
    }
} elseif ($act == "make_resume") {
    $smarty->cache = false;
开发者ID:source-hunter,项目名称:74cms,代码行数:31,代码来源:wap_user.php

示例7: table

    $smarty->cache = false;
    //顾问信息
    $member_info = get_user_info(intval($_SESSION['uid']));
    if (intval($member_info['consultant']) > 0) {
        $consultant = $db->getone("SELECT * FROM " . table('consultant') . " WHERE id=" . intval($member_info['consultant']));
        $smarty->assign('consultant', $consultant);
    }
    $smarty->display("m/company/m-setmealproduct.html");
} elseif ($act == 'setmeal_surplus') {
    $smarty->cache = false;
    //账户状态
    $user_setmeal = get_user_setmeal(intval($_SESSION['uid']));
    $smarty->assign('user_setmeal', $user_setmeal);
    //剩余发布职位数    发布的招聘职位 = 发布中的 + 待审核的
    $jobs = "SELECT COUNT(*) AS num FROM " . table('jobs') . " where uid='{$_SESSION['uid']}'";
    $jobs_num = $db->get_total($jobs);
    $jobs_tmp = "SELECT COUNT(*) AS num FROM " . table('jobs_tmp') . " where uid='{$_SESSION['uid']}' and  audit=2 ";
    $jobs_tmp_num = $db->get_total($jobs_tmp);
    $smarty->assign('jobs_num', intval($user_setmeal['jobs_ordinary']) - (intval($jobs_num) + intval($jobs_tmp_num)));
    //人才库容量
    $favorites = "SELECT COUNT(*) AS num FROM " . table('company_favorites') . " where company_uid='{$_SESSION['uid']}'";
    $favorites_num = $db->get_total($favorites);
    $favorites_num = intval($user_setmeal['talent_pool']) - intval($favorites_num);
    $smarty->assign('favorites_num', intval($favorites_num));
    $smarty->display("m/company/m-setmeal-margin.html");
} elseif ($act == "company_auth") {
    $company_profile = get_company($_SESSION['uid']);
    $smarty->assign('company_profile', $company_profile);
    $smarty->display("m/company/m-enterprise-authenticate.html");
} elseif ($act == "company_auth_save") {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:user.php


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