本文整理汇总了PHP中countRecord函数的典型用法代码示例。如果您正苦于以下问题:PHP countRecord函数的具体用法?PHP countRecord怎么用?PHP countRecord使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了countRecord函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createPage
include 'updateOrder.php';
//Update Show
include 'updateShow.php';
if ($_GET['code'] == 1) {
$errMsg = 'Successfully updated.';
}
//kiem tra cap nhat thanh cong hay chua
$pageindex = createPage(countRecord($tableUser, $parentWhereConfig), './?act=' . $actUser . '&codeParent=' . $_REQUEST['codeParent'] . '&name=' . $_REQUEST['name'] . '&ma=' . $_REQUEST['ma'] . '&page=', $MAXPAGE, $page, '30', $_lang_A);
//phan trang
$pageindexHtml = $totalItems > $MAXPAGE ? '<td height="30" class="smallfont" align="left" valign="middle" >Page :' . $pageindex . '</td>' : '';
if ($errMsg != '') {
$errMsgHtml = '<p align=center class="err">' . $errMsg . '<br></p>';
}
$sql = "select *,DATE_FORMAT(date_added,'%d/%m/%Y %h:%i') as dateAdd,DATE_FORMAT(last_modified,'%d/%m/%Y %h:%i') as dateModify from {$tableUser}";
$result = @mysql_query($sql, $conn);
$i = 0;
while ($row = @mysql_fetch_array($result)) {
$color = $i++ % 2 ? '#d5d5d5' : '#e5e5e5';
if ($row['status'] == 0) {
$showNotshow = " <a href=\"./?act=" . $actUser . "&action=notshow&codeParent=" . $_REQUEST['codeParent'] . "&id=" . $row['id'] . "&page=" . $_REQUEST['page'] . "&lang=" . $_lang_A . "\"><img border=\"0\" src=\"images/show.gif\" alt=\"" . TSHOW . "\" height=\"20\"/></a>";
} else {
$showNotshow = "<a href=\"./?act=" . $actUser . "&action=show&codeParent=" . $_REQUEST['codeParent'] . "&id=" . $row['id'] . "&page=" . $_REQUEST['page'] . "&lang=" . $_lang_A . "\"><img border=\"0\" src=\"images/notshow.gif\" alt=\"" . TNOTSHOW . "\" height=\"20\"/></a>";
}
$processFrameShowHtmlTr .= "\n<tr>\n\t\t<td align=\"center\" bgcolor=\"" . $color . "\" class=\"smallfont\">\n\t\t<input type=\"checkbox\" name=\"chk[]\" value=\"" . $row['id'] . "\"></td>\n\t\t<td width=\"34\" align=\"center\" bgcolor=\"" . $color . "\" class=\"smallfont\">\n\t\t\t<a href=\"./?act=" . $actUser . "_m&page=" . $_REQUEST['page'] . "&codeParent=" . $_REQUEST['codeParent'] . "&id=" . $row['id'] . "&lang=" . $_lang_A . "\">" . TEDIT . "</a>\t\t</td>\n <td width=\"41\" align=\"center\" bgcolor=\"" . $color . "\" class=\"smallfont\">\n\t\t\t<a \n\t\t\t\tonClick=\"return confirm('Are you sure you want to delete?');\" \n\t\t\t\thref=\"./?act=" . $actUser . "&action=del&page=" . $_REQUEST['page'] . "&codeParent=" . $_REQUEST['codeParent'] . "&id=" . $row['id'] . "&lang=" . $_lang_A . "\"\n\t\t\t>" . TDELETE . "</a>\t\t</td>\n\t <td bgcolor=\"" . $color . "\" class=\"smallfont\" align=\"center\">" . $row['id'] . "</td>\t\t\t\n\t\t<td align=\"left\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">" . $row['name'] . "</td>\t\t\t\n\t\t<td align=\"left\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">" . $row['uid'] . "</td>\n\t\t<td align=\"left\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">" . $row['phone'] . "</td>\t\t\t\t\n\t\t<td align=\"center\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">\n\t\t\n\t\t<input type=\"hidden\" value=\"" . $row['id'] . "\" name=\"hID[]\"/>\n <input type=\"text\" value=\"" . $row['sort'] . "\" size=\"2\" name=\"txtOrder[]\"/>\n\t\t\n\t\t\n\t\t</td>\n\t\t<td align=\"center\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">\n\t\t\t\t\n\t\t\t\n\t\t\t" . $showNotshow . "\n\t\t\t\n\t\t\t\n\t </td>\n\t\t<td align=\"center\" valign=\"middle\" bgcolor=\"" . $color . "\" class=\"smallfont\">" . $row['dateAdd'] . "</td>\n\t\t<td bgcolor=\"" . $color . "\" class=\"smallfont\" align=\"center\">" . $row['dateModify'] . "</td>\n\t</tr>\n";
}
$processFrameShowHtml = "\n<form method=\"POST\" action=\"./\" name=\"frmForm\" enctype=\"multipart/form-data\">\n<input type=\"hidden\" name=\"page\" value=\"" . $page . "\">\n<input type=\"hidden\" name=\"codeParent\" value=\"" . $_REQUEST['codeParent'] . "\">\n<input type=\"hidden\" name=\"act\" value=\"" . $actUser . "\">\n\n\n\n<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n\t<tr>\n\t\t" . $pageindexHtml . "\n\t\t\n\t</tr>\n\t\n\t\n\t\n\t\n\t\n</table>\n\n<table border=\"1\" cellpadding=\"2\" bordercolor=\"#C9C9C9\" width=\"100%\">\n\t<tr>\n\t <th width=\"20\" class=\"title\"><input type=\"checkbox\" name=\"chkall\" onClick=\"chkallClick(this);\"></th>\n\t <th class=\"title\" colspan=\"2\" rowspan></th>\t\t\n\t\t<th width=\"18\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(1) . "\">ID</a></th>\n\t <th width=\"235\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(4) . "\">" . TNAME . " </a></th>\t\t\t\n\t <th width=\"115\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(3) . "\">" . ADUSER . "</a></th>\n\t <th width=\"126\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(3) . "\">" . TFTEL . "</a></th>\t\t\t\t\n\t <th width=\"58\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(5) . "\"> " . TSORT . "</a></th>\n\t <th width=\"67\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(6) . "\">" . TSHOW . "</a></th>\n\t <th width=\"91\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(7) . "\">" . TDATEESTABLISHED . "</a></th>\n\t <th width=\"109\" align=\"center\" valign=\"middle\" class=\"title\"><a class=\"title\" href=\"" . getLinkSort(8) . "\">" . TLASTUPDATED . "</a></th>\n </tr>\n \n" . $processFrameShowHtmlTr . "\n\n<tr>\n\t <td width=\"20\"></td>\n\t\t<td colspan=\"2\"></td>\t\t\n\t\t<td width=\"18\"></td>\n\t\t<td></td>\t\t\n\t\t<td></td>\t\t\t\t\n\t\t<td></td>\n\t\t<td>\n\t\t<span class=\"title\">\n\t\t <input type=\"submit\" value=\"Update\" name=\"btnOrder\" class=\"button\">\n\t </span>\n\t </td>\n\n\t\t<td> </td>\n\t\t<td></td>\n\t\t<td></td>\n\t\t\n\t\n\t</tr>\n</table>\n\n<table width=\"100%\">\n\t<tr>\n\t\t<td width=\"30%\">\n<input type=\"submit\" value=\"Delete selected\" name=\"btnDel\" onClick=\"return confirm('Are you sure you want to delete?');\" class=\"button\">\n<input type=\"button\" value=\"Add new\" name=\"btnNew\" onClick=\"window.location='./?act=" . $actUser . "_m&page=" . $_REQUEST['page'] . "&codeParent=" . $_REQUEST['codeParent'] . "&lang=" . $_lang_A . "'\" class=\"button\">\n\t\t</td>\n\t</tr>\n</table>\n\n\n\n</form>\n<script language=\"JavaScript\">\nfunction chkallClick(o) {\n \tvar form = document.frmForm;\n\tfor (var i = 0; i < form.elements.length; i++) {\n\t\tif (form.elements[i].type == \"checkbox\" && form.elements[i].name!=\"chkall\") {\n\t\t\tform.elements[i].checked = document.frmForm.chkall.checked;\n\t\t}\n\t}\n}\n</script>\n\n\n" . $errMsgHtml . "\n\n<table width=\"100%\">\n\t<tr><td height=\"10\"></td></tr>\n\t<tr><td class=\"smallfont\">Total row : <b>" . countRecord($tableUser, $parentWhereConfig) . "</b></td></tr>\n</table>";
?>
示例2: while
while ($Search = mysql_fetch_array($resultSearch)) {
$Searchname = getRecord($tableCategorySearch, 'id_code=' . $Search['id'] . " and lang='" . $_lang_A . "'");
$searchHtmlShowCon = "";
//echo $Search['typeivm'];
if ($Search['typeivm'] == '0') {
$rewSearchProduct = getRecord($tableProductSearchId, "id_code=" . $_REQUEST['id'] . " and id_search_parent=" . $Search['id']);
//echo $rewSearchProduct['id'];
$arraySourceSearch = getArrayCombo($tableSearchId, 'id', 'name', "parent=" . $Search['id'] . " or id=1");
$searchHtmlShowCon = comboCategory('ddCatSearch_' . $Search['id'], $arraySourceSearch, 'smallfont', $rewSearchProduct['id_search'], 0);
} elseif ($Search['typeivm'] == '1') {
$searchHtmlShowCon = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$sqlSearchCon = "select * from {$tableSearchId} where parent=" . $Search['id'] . " and " . $whereStatus;
$resultSearchCon = mysql_query($sqlSearchCon, $conn);
while ($SearchCon = mysql_fetch_array($resultSearchCon)) {
$SearchConname = getRecord($tableSearch, 'id_code=' . $SearchCon['id'] . " and lang='" . $_lang_A . "'");
$countSearchProduct = countRecord($tableProductSearchId, "id_code=" . $_REQUEST['id'] . " and id_search_parent=" . $Search['id'] . " and id_search=" . $SearchCon['id'] . " and status_search=1");
$searchHtmlShowCon .= "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t <tr>\n <td class=\"smallfont\" align=\"left\" width=\"15\" valign=\"middle\" height=\"20\"><input type=\"checkbox\" name=\"chkSearch" . $Search['id'] . $SearchCon['id'] . "\" " . ($countSearchProduct > 0 ? "checked" : "") . ">\t</td>\n <td class=\"smallfont\" align=\"left\" valign=\"middle\" height=\"20\">" . $SearchConname['name'] . "</td>\n </tr>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t";
}
$searchHtmlShowCon .= "</table>";
}
$searchHtmlShow .= " <tr>\n <td width=\"300\" class=\"smallfont\" align=\"left\" valign=\"middle\" style=\"border-bottom:1px dotted #CCCCCC\">" . $searchHtmlShowCon . "</td>\n <td align=\"left\" class=\"smallfont\" valign=\"middle\" style=\"border-bottom:1px dotted #CCCCCC; border-left:1px dotted #CCCCCC; \"> " . $Searchname['name'] . "</td>\n </tr>";
}
$searchHtmlShow .= " </table></td></tr>";
}
echo $searchHtmlShow;
?>
示例3: countRecord
<?php
//lay mail mac dinh===================================================================================================================
//TINH TONG SO MAIL NGUOI NAY DA GUI TRONG NGAY (EMAIL TU TAO CUA THANH VIEN)
$whereEmailMemberCreateSendSuccessfully = "id_member=" . $idMember . " and type_email=1 and ldate='" . $strtotimeDmy . "'";
$totalEmailMemberCreateSendSuccessfully = countRecord($tableSendEmailSuccessful, $whereEmailMemberCreateSendSuccessfully);
if ($totalEmailMemberCreateSendSuccessfully < $totalEmailMemberCreateSendOk) {
//neu so luong e mail thanh vien tu tao con thi gui cua nguoi nay
//kiem tra email tu tao mac dinh con gui duoc kong
$whereEmailMemberCreateSendSuccessfullyDefault = "email_id=" . $create_email_id . " and id_member=" . $idMember . " and type_email=1";
$totalEmailMemberCreateSendSuccessfullyDefault = countRecord($tableSendEmailSuccessful, $whereEmailMemberCreateSendSuccessfullyDefault);
if ($create_email_id > 0 and $create_email_id != '' and $whereEmailMemberCreateSendSuccessfullyDefault < 99) {
$rowEmailHost = getRecord($tableEmailId, "id=" . $create_email_id);
$type_email = 1;
/*echo $rowEmailHost['name'];
exit();
*/
} else {
$rowCategoryEmailHost = getRecord($tableCategoryEmailId, "code='EMEMBERCREATE'");
$idCategoryEmailHost = $rowCategoryEmailHost['id'];
//THEM TAT CA MAIL NAY VAO BANG SO LUONG MAIL GI DI====================(chi ap dung cho email ko phai cua host)
$sqlInputSendEmailNumber = "select * from {$tableEmailId} where type_email<>'" . $typeDmailNotdefault . "' and parent=" . $idCategoryEmailHost . " and {$whereStatus}";
$resultInputSendEmailNumber = @mysql_query($sqlInputSendEmailNumber, $conn);
while ($rowInputSendEmailNumber = @mysql_fetch_array($resultInputSendEmailNumber)) {
$idEmailSend = $rowInputSendEmailNumber['id'];
$parentEmailSend = $rowInputSendEmailNumber['parent'];
$mail_username = $rowInputSendEmailNumber['email'];
require_once $ajaxUrlEmail . $folderSendmail . "/insert_email_send_number.php";
}
//THEM TAT CA MAIL NAY VAO BANG SO LUONG MAIL GI DI====================KET THUC
$whereSendEmailNumber = "parent=" . $idCategoryEmailHost . " and id in (select id_code from {$tableSendNumberEmail} where send_number<99 and ldate='" . $strtotimeDmy . "')";
示例4: countRecord
$idModuleTT2 = $rowLeveUser2['id'];
$nameModuleTT2 = $rowLeveUser2['name'];
$checkeModuleId2 = countRecord($tableUserLevel, "id_member=" . $oldid . " and parent_level1={$idModuleTT2} and status_level=1");
$checkeModuleTTShowHtml2 = $checkeModuleId2 > 0 ? 'checked="checked"' : '';
$showHtmlUserLeve3 = "";
//=================================================================================================
if (countRecord($tableCategoryConfigId, "parent=" . $idModuleTT2 . " and {$whereStatus}") > 0) {
//kiem tra cap 1 co con hay ko
$whereleveUser3 = "parent=" . $idModuleTT2;
$sqlLeveUser3 = "select * from {$tableCategoryConfigId} where {$whereleveUser3} and {$whereStatus} {$sortby} ";
$resultLeveUser3 = @mysql_query($sqlLeveUser3, $conn);
while ($rowLeveUser3 = @mysql_fetch_array($resultLeveUser3)) {
//vong while lay tat ca tra co parent =1
$idModuleTT3 = $rowLeveUser3['id'];
$nameModuleTT3 = $rowLeveUser3['name'];
$checkeModuleId3 = countRecord($tableUserLevel, "id_member=" . $oldid . " and parent_level1={$idModuleTT3} and status_level=1");
$checkeModuleTTShowHtml3 = $checkeModuleId3 > 0 ? 'checked="checked"' : '';
$showHtmlUserLeve3 .= "<tr>\n <td width=\"30\" align=\"left\" class=\"smallfont\" valign=\"middle\">\n\t<input type=\"checkbox\" id=\"chkModule" . $idModuleTT3 . "\" name=\"chkModule" . $idModuleTT3 . "\" value=\"on\" " . $checkeModuleTTShowHtml3 . ">\n\t</td>\n <td align=\"left\" class=\"smallfont\" valign=\"middle\">" . $nameModuleTT3 . "</td>\n </tr>";
}
$showHtmlUserLeveAll3 = "\n\t<tr>\n <td colspan=\"2\" align=\"left\" valign=\"middle\" style=\"padding-left:60px;\">\n\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n \t" . $showHtmlUserLeve3 . "</table>\n\t</td>\n </tr>";
} else {
$showHtmlUserLeveAll3 = "";
}
$showHtmlUserLeve2 .= "<tr>\n <td width=\"20\" align=\"left\" class=\"smallfont\" valign=\"middle\">\n\t<input type=\"checkbox\" id=\"chkModule" . $idModuleTT2 . "\" name=\"chkModule" . $idModuleTT2 . "\" value=\"on\" " . $checkeModuleTTShowHtml2 . ">\n\t</td>\n <td align=\"left\" class=\"smallfont\" valign=\"middle\">" . $nameModuleTT2 . "</td>\n </tr>\n " . $showHtmlUserLeveAll3 . "\n ";
}
$showHtmlUserLeveAll2 = "\n\t<tr>\n <td colspan=\"2\" align=\"left\" valign=\"middle\" style=\"padding-left:40px;\">\n\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n \t" . $showHtmlUserLeve2 . "</table>\n\t</td>\n </tr>";
} else {
$showHtmlUserLeveAll2 = "";
}
$showHtmlUserLeve1 .= "\n\t<tr>\n <td width=\"20\" align=\"left\" class=\"smallfont\" valign=\"middle\">\n\t<input type=\"checkbox\" id=\"chkModule" . $idModuleTT1 . "\" name=\"chkModule" . $idModuleTT1 . "\" value=\"on\" " . $checkeModuleTTShowHtml1 . ">\n\t</td>\n <td align=\"left\" class=\"smallfont\" valign=\"middle\">" . $nameModuleTT1 . "</td>\n </tr>\n " . $showHtmlUserLeveAll2 . "\n \n ";
}
示例5: str_replace
<?php
$bodytag = str_replace("-", " ", $code_id);
$whereNewAll = "(name like '%" . $bodytag . "%' or tag like '%" . $bodytag . "%')";
$totalNew = countRecord($tableNew, $whereNewAll);
$name_c = TSEARCH;
$name_title_c = $name_c;
include $folderNew . '/new_page.php';
$showHtmlHomeConnert = "<link href=\"" . $serverName . $folderCss . "/details.css\" rel=\"stylesheet\" type=\"text/css\" />\n<section class=\"main-4\">\n<div class=\"title_page\">\n<h2 class=\"details-title\"><a href=\"" . $serverName . "\" title=\"Trang chủ\">Trang chủ</a>" . $showHtmlTitlePage . " <img src=\"" . $serverName . "images/icon_4.png\" width=\"7\" height=\"14\" alt=\"\"> " . $name_title_c . " </h2>\n</div>\n<div class=\"title_page_search\">\n<div class=\"search\"> <form action=\"" . $serverName . FRAMESASNAME . "/\" method=\"get\" name=\"Search\">\n \n <input class=\"search-bg-1\" name=\"keyword\" type=\"text\" onFocus=\"if (this.value=='nhập từ khoá tìm kiếm') this.value='';\" onBlur=\"if (this.value=='') this.value='nhập từ khoá tìm kiếm';\" value=\"nhập từ khoá tìm kiếm\" />\n\t\t <input type=\"hidden\" name=\"parent\" value=\"" . $parent_1_c . "\">\n <input type=\"image\" src=\"" . $serverName . "images/search_bottom.png\" class=\"search_bottom\" alt=\"search\">\n </form></div>\n</div>\t\n<section class=\"left-col\">\n<div id=\"social-iconall\">\t\n\t\t\t<div class=\"googlelike1\">\n\t\t<!-- Place this tag where you want the +1 button to render. -->\n<div class=\"g-plusone\" data-size=\"medium\" data-href=\"" . $urlFull . "\"></div>\n\n<!-- Place this tag after the last +1 button tag. -->\n<script type=\"text/javascript\">\n window.___gcfg = {lang: 'vi'};\n\n (function() {\n var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n po.src = 'https://apis.google.com/js/plusone.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n })();\n</script>\n</div>\n\t </div>\n" . $showHtmlNewHomTop . "\n</section>\n</section>";
示例6:
<?php
require "../../config/config.php";
require "../../config/common_start.php";
include "../../lib/func.lib.php";
include 'table_act.php';
?>
<?php
// Developed by Roshan Bhattarai
// Visit http://roshanbh.com.np for this script and more.
// This notice MUST stay intact for legal use
//this varible contains the array of existing users
//value got from the get metho
$code = $_POST['code'];
$ln = $_POST['ln'];
//checking weather user exists or not in $existing_users array
if (countRecord($tableCategoryConfigId, "code='{$code}'") > 0) {
//user name is not availble
echo "0";
} else {
//user name is available
echo "1";
}
示例7: countRecord
<?php
$guest = countRecord("tbl_visitor", "member='n'");
$members = countRecord("tbl_visitor", "member='y'");
$rConfig = getRecord('tbl_config', "code = 'total_visits'");
$total_visits = $rConfig['detail'];
$total = countRecord("tbl_comment_id", "code_module='module_pro'");
?>
<table width="100%">
<tr>
<td>
<table align="center" width="250" cellpadding="5" border="1" bordercolor="#0069A8">
<tr>
<td class="smallfont" style="border-right:none;" width="60%"> - <?php
echo ONLINE;
?>
</td>
<td class="smallfont" style="border-left:none;" align="right"><b><?php
echo $members + $guest;
?>
</b> </td>
</tr>
<tr>
<td class="smallfont" style="border-right:none;"> + <?php
echo MEMBER;
?>
</td>
<td class="smallfont" style="border-left:none;" align="right"><b><?php
echo $members;
?>
示例8: createPage
if ($page != '') {
$p = $page;
}
$where = '1=1';
if ($_REQUEST['cat'] != '') {
$where = 'parent=' . $_REQUEST['cat'];
}
?>
<form method="POST" action="./" name="frmForm" enctype="multipart/form-data">
<input type="hidden" name="page" value="<?php
echo $page;
?>
">
<input type="hidden" name="act" value="config">
<?php
$pageindex = createPage(countRecord("tbl_config", $where), './?act=config&page=', $MAXPAGE, $page);
?>
<?php
if ($_REQUEST['code'] == 1) {
$errMsg = 'Cập nhật thành công.';
}
?>
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td height="30" class="smallfont">Trang : <?php
echo $pageindex;
?>
</td></tr>
</table>
示例9: str_replace
$array_where1 .= ",'" . $IdMenuProduct4 . "'";
$array_where2 .= ",'" . $IdMenuProduct4 . "'";
$array_where3 .= ",'" . $IdMenuProduct4 . "'";
$nameMenuProduct4 = str_replace($ojer, $ojers, $rowMenuProductNam4['name']);
$titleMenuProduct4 = str_replace($ojer, $ojers, $rowMenuProductNam4['title_t']);
$IdMenuProduct4 = $rowMenuProduct4['id'];
$urlMenuProduct4 = $rowMenuProductNam4['url'];
$parentMenuProduct4 = $rowMenuProduct4['parent'];
$parentMenuProduct4_1 = $rowMenuProduct4['parent_1'];
$imageProduct4 = $rowMenuProduct4['image'];
$whereProduct4 = "(" . whereParentLevel($tableCategoryNewId, $IdMenuProduct4) . ")";
$totalProduct4 = countRecord($tableNewId, $whereProduct4);
//tong sp muc nay
$totalProductShow4 = $totalProduct4 > 0 ? $totalProduct4 : 0;
$whereMenuCon_type4 = "parent=" . $IdMenuProduct4;
$con_type4 = countRecord($tableCategoryNewId, $whereMenuCon_type4);
//kiem tra danh muc nay co menu con khong
$con_typeShow4 = $con_type4 > 0 ? $con_type4 : 0;
//exp parent url=========================================1
$exp_parent4 = '<?php $' . 'url_c = "' . $urlMenuProduct4 . '"; $' . 'name_c = "' . $nameMenuProduct4 . '"; ?>';
$ft_p4 = "../inc/new/" . $IdMenuProduct4 . $ln . ".inc";
$ft_p4 = fopen($ft_p4, "w");
fwrite($ft_p4, $exp_parent4);
@chmod($ft_p4, 0777);
$urlCodeUpXml4 = trim(str_replace("-", "", $urlMenuProduct4));
$exp_url4 = '<?php $' . 'parent_1_c = "' . $parentMenuProduct4_1 . '"; $' . 'parent_c = "' . $IdMenuProduct4 . '"; $' . 'name_c = "' . $nameMenuProduct4 . '"; $' . 'title_c = "' . $titleMenuProduct4 . '"; $' . 'descriptionMeta_category = "' . $description4 . '"; $' . 'keywordsMeta_category = "' . $keywords4 . '"; ?>';
$ft_u4 = "../inc/new/" . $urlCodeUpXml4 . $ln . ".inc";
$ft_u4 = fopen($ft_u4, "w");
fwrite($ft_u4, $exp_url4);
@chmod($ft_u4, 0777);
//exp parent url=========================================KET THUC4
示例10: removeVietnamese
$urlCode = $urlCodeCode['url'] . '_' . removeVietnamese($urlCode1, " ", "-");
//lay url tu dong
}
//ket thuc xac dinh url-----------------
$name = isset($_POST['txtName' . $ln]) ? trim($_POST['txtName' . $ln]) : '';
$subject = isset($_POST['txtSubject' . $ln]) ? trim($_POST['txtSubject' . $ln]) : '';
$detail_short = isset($_POST['txtDetailShort' . $ln]) ? trim($_POST['txtDetailShort' . $ln]) : '';
$detail = isset($_POST['txtDetail' . $ln]) ? trim($_POST['txtDetail' . $ln]) : '';
$sort = isset($_POST['txtSort' . $ln]) ? trim($_POST['txtSort' . $ln]) : 0;
$status = $_POST['chkStatus' . $ln] != '' ? 1 : 0;
$fields_arr = array("parent" => "{$codeParent}", "parent_1" => "{$parent_1}", "id_code" => "'{$oldid}'", "code" => "'{$code}'", "type_link" => "'{$type_link}'", "url" => "'{$urlCode}'", "name" => "'{$name}'", "subject" => "'{$subject}'", "detail_short" => "'{$detail_short}'", "detail" => "'{$detail}'", "sort" => "{$sort}", "status" => "{$status}", "date_added" => "now()", "last_modified" => "now()", "lang" => "'{$ln}'");
$result = insert($tableCategoryConfig, $fields_arr);
$oldidLn = @mysql_insert_id();
//lay id vua them vo
//kiem tra url nay da ton tai hay chua
if (countRecord($tableCategoryConfig, "url='" . $urlCode . "' and id<>" . $oldidLn) > 0) {
$urlCodeUp = $urlCode . "-" . $oldidLn;
$fields_arrUpdateUrl = array("url" => "'{$urlCodeUp}'");
$resultUrlUpdate = update($tableCategoryConfig, $fields_arrUpdateUrl, "id=" . $oldidLn);
}
//ket thuc kiem tra url nay da ton tai hay chua
}
/*-----------------------END THEM MOI*/
}
/*-----------------------THEM HINH*/
if ($result) {
$actConfig = removeVietnamese($defaulName, ' ', '_');
if (empty($_POST['id'])) {
$r = getRecord($tableCategoryConfigId, "id=" . $oldid);
}
$sqlUpdateField = "";
示例11: chkallClick
_m&page=<?php
echo $_REQUEST['page'];
?>
&cat=<?php
echo $_REQUEST['cat'];
?>
'" class="button">
</form>
<script language="JavaScript">
function chkallClick(o) {
var form = document.frmForm;
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
form.elements[i].checked = document.frmForm.chkall.checked;
}
}
}
</script>
<?php
if ($errMsg != '') {
echo '<p align=center class="err">' . $errMsg . '<br></p>';
}
?>
<table width="100%">
<tr><td height="10"></td></tr>
<tr><td class="smallfont"><?php
echo 'Tổng số hàng : <b>' . countRecord($tableConfig, $firstWhere) . '</b>';
?>
</td></tr>
</table>
示例12: chkallClick
</td>
</tr>
</table>
</form>
<script language="JavaScript">
function chkallClick(o) {
var form = document.frmForm;
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
form.elements[i].checked = document.frmForm.chkall.checked;
}
}
}
</script>
<?php
if ($errMsg != '') {
echo '<p align=center class="err">' . $errMsg . '<br></p>';
}
?>
<table width="100%">
<tr><td height="10"></td></tr>
<tr><td class="smallfont"><?php
echo UTOTALROW . ' : <b>' . countRecord($tableAdvertisementId, $whereComment) . '</b>';
?>
</td></tr>
</table>
示例13: tbl_visitor
if (!isset($_SESSION['online'])) {
@mysql_query("insert into tbl_visitor (session_id, activity, ip_address, url, ldate, user_agent) values ('" . session_id() . "', now(), '{$_SERVER['REMOTE_ADDR']}', '{$_SERVER['HTTP_REFERER']}','{$ldate}', '{$_SERVER['HTTP_USER_AGENT']}')", $conn);
$_SESSION['online'] = true;
@mysql_query("insert into tbl_visitor_total (session_id, activity, ip_address, url, ldate, user_agent) values ('" . session_id() . "', now(), '{$_SERVER['REMOTE_ADDR']}', '{$_SERVER['HTTP_REFERER']}','{$ldate}', '{$_SERVER['HTTP_USER_AGENT']}')", $conn);
} else {
if (isset($_SESSION['member'])) {
@mysql_query("update tbl_visitor set activity=now(), member='y' where session_id='" . session_id() . "'", $conn);
} else {
@mysql_query("update tbl_visitor set activity=now(), member='n' where session_id='" . session_id() . "'", $conn);
}
}
$maxtime = 6000;
// 5 Minute time out. 60 * 5 = 300
$deleteOnline = @mysql_query("delete from tbl_visitor where UNIX_TIMESTAMP(activity) < UNIX_TIMESTAMP(now())-{$maxtime}", $conn);
if ($deleteOnline) {
unset($_SESSION['online']);
}
$ldate1 = $ldate - 1 * 24 * 60 * 60;
///hom qua
$ldate7 = $ldate - 7 * 24 * 60 * 60;
///hom qua
$ldate30 = $ldate - 30 * 24 * 60 * 60;
///hom qua
$guest = countRecord("tbl_visitor", "member='n'");
$guestqua = countRecord("tbl_visitor_total", "ldate='{$ldate1}'");
$guesthomnay = countRecord("tbl_visitor_total", "ldate='{$ldate}'");
$guestbayngay = countRecord("tbl_visitor_total", "ldate<{$ldate} and ldate>{$ldate7}");
$guestmotthang = countRecord("tbl_visitor_total", "ldate<{$ldate} and ldate>{$ldate30}");
$members = countRecord("tbl_visitor", "member='y'");
$total_visits = countRecord('tbl_visitor_total', "1=1");
$showHtmlOnline = "\n <p>- Đang xem: " . $guest . "</p>\n <p>- Lượt truy cập: " . $total_visits . "</p>";
示例14: whereParentLevel
function whereParentLevel($tableParentLevel, $IdParentLevel)
{
global $conn;
global $whereStatus;
//$IdParentLevel LA ID DUOC CUNG CAP DE TIM NHUNG PARENT THUOC CON CUA NO
//$tableParentLevel LA BANG DE TIM KIEM
$whereParentLevelw = '';
//KHOI TAO DIEU KIEN
$rowIdParentLevel = getRecord($tableParentLevel, "id=" . $IdParentLevel . " and " . $whereStatus);
if ($rowIdParentLevel['parent'] == '1') {
//kiem tra nau parent cua id duoc cung cap la 1
$whereParentLevel = 'parent_1=' . $rowIdParentLevel['id'];
} else {
// nau parent cua id duoc cung cap kong phai la 1
if (countRecord($tableParentLevel, "parent=" . $IdParentLevel . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 1
$sqlParentLevel1 = "select * from {$tableParentLevel} where parent=" . $IdParentLevel . " and " . $whereStatus;
$resultParentLevel1 = @mysql_query($sqlParentLevel1, $conn);
while ($rowParentLevel1 = @mysql_fetch_array($resultParentLevel1)) {
// vong while 1
$whereParentLevelw .= 'parent=' . $rowParentLevel1['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel1['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 2
$sqlParentLevel2 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel1['id'] . " and " . $whereStatus;
$resultParentLevel2 = @mysql_query($sqlParentLevel2, $conn);
while ($rowParentLevel2 = @mysql_fetch_array($resultParentLevel2)) {
// vong while 2
$whereParentLevelw .= 'parent=' . $rowParentLevel2['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel2['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 3
$sqlParentLevel3 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel2['id'] . " and " . $whereStatus;
$resultParentLevel3 = @mysql_query($sqlParentLevel3, $conn);
while ($rowParentLevel3 = @mysql_fetch_array($resultParentLevel3)) {
// vong while 3
$whereParentLevelw .= 'parent=' . $rowParentLevel3['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel3['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 4
$sqlParentLevel4 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel3['id'] . " and " . $whereStatus;
$resultParentLevel4 = @mysql_query($sqlParentLevel4, $conn);
while ($rowParentLevel4 = @mysql_fetch_array($resultParentLevel4)) {
// vong while4
$whereParentLevelw .= 'parent=' . $rowParentLevel4['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel4['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 5
$sqlParentLevel5 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel4['id'] . " and " . $whereStatus;
$resultParentLevel5 = @mysql_query($sqlParentLevel5, $conn);
while ($rowParentLevel5 = @mysql_fetch_array($resultParentLevel5)) {
// vong while 5
$whereParentLevelw .= 'parent=' . $rowParentLevel5['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel5['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 6
$sqlParentLevel6 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel5['id'] . " and " . $whereStatus;
$resultParentLevel6 = @mysql_query($sqlParentLevel6, $conn);
while ($rowParentLevel6 = @mysql_fetch_array($resultParentLevel6)) {
// vong while 6
$whereParentLevelw .= 'parent=' . $rowParentLevel6['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel6['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 7
$sqlParentLevel7 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel6['id'] . " and " . $whereStatus;
$resultParentLevel7 = @mysql_query($sqlParentLevel7, $conn);
while ($rowParentLevel7 = @mysql_fetch_array($resultParentLevel7)) {
// vong while 7
$whereParentLevelw .= 'parent=' . $rowParentLevel7['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel7['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 8
$sqlParentLevel8 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel7['id'] . " and " . $whereStatus;
$resultParentLevel8 = @mysql_query($sqlParentLevel8, $conn);
while ($rowParentLevel8 = @mysql_fetch_array($resultParentLevel8)) {
// vong while 8
$whereParentLevelw .= 'parent=' . $rowParentLevel8['id'] . ' or ';
if (countRecord($tableParentLevel, "parent=" . $rowParentLevel8['id'] . " and " . $whereStatus) > 0) {
//kiem tra no co con hay ko 9
$sqlParentLevel9 = "select * from {$tableParentLevel} where parent=" . $rowParentLevel8['id'] . " and " . $whereStatus;
$resultParentLevel9 = @mysql_query($sqlParentLevel9, $conn);
while ($rowParentLevel9 = @mysql_fetch_array($resultParentLevel9)) {
// vong while 9
$whereParentLevelw .= 'parent=' . $rowParentLevel9['id'] . ' or ';
}
//ket thuc vong while 9
}
//kiem tra no co con hay ko 9----------ket thuc
}
//ket thuc vong while 8
}
//kiem tra no co con hay ko 8----------ket thuc
}
//ket thuc vong while 7
}
//kiem tra no co con hay ko 7----------ket thuc
}
//ket thuc vong while 6
}
//kiem tra no co con hay ko 6----------ket thuc
}
//ket thuc vong while 5
}
//kiem tra no co con hay ko 5----------ket thuc
}
//ket thuc vong while 4
}
//.........这里部分代码省略.........
示例15: chkallClick
</td>
</tr>
</table>
</form>
<script language="JavaScript">
function chkallClick(o) {
var form = document.frmForm;
for (var i = 0; i < form.elements.length; i++) {
if (form.elements[i].type == "checkbox" && form.elements[i].name!="chkall") {
form.elements[i].checked = document.frmForm.chkall.checked;
}
}
}
</script>
<?php
if ($errMsg != '') {
echo '<p align=center class="err">' . $errMsg . '<br></p>';
}
?>
<table width="100%">
<tr><td height="10"></td></tr>
<tr><td class="smallfont"><?php
echo UTOTALROW . ' : <b>' . countRecord($tableImageId, $whereComment) . '</b>';
?>
</td></tr>
</table>