本文整理汇总了PHP中common::numberOfRows方法的典型用法代码示例。如果您正苦于以下问题:PHP common::numberOfRows方法的具体用法?PHP common::numberOfRows怎么用?PHP common::numberOfRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::numberOfRows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: common
<?php
extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
$obj_setting->delete('news_category', "id={$id}");
$obj_setting->delete('news_articles', "category_id={$id}");
$_SESSION['success_msg'] = 'Category and its associated articles deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/page/news_category.php' . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('news_category', "id={$id}");
if ($total_rows > 0) {
$singlePage = $obj_setting->customQuery("SELECT category_name FROM news_category id='" . $id . "'");
$getPageName = $db->fetchNextObject($singlePage);
$pageName = $getPageName->tab_title;
} else {
$pageName = 'There is no Category exists with this id.';
}
unset($obj_setting);
示例2: IN
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode(",", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if ($totalIds != '' and isset($action) and $action == 'delete') {
if (isset($searchtext) and $searchtext != '') {
$addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
} else {
$addToUrl = '';
}
$obj_setting->delete('car', " car_id IN ({$totalIds})");
$obj_setting->delete('contact', " car_id IN ({$totalIds})");
$_SESSION['success_msg'] = 'Cars deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/car/index.php' . $addToUrl . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('pages', " id IN('{$totalIds}')");
if ($total_rows > 0) {
$totalNames = array();
$singlePage = $obj_setting->customQuery("SELECT name FROM pages where id IN('{$totalIds}')");
while ($getPageName = $db->fetchNextObject($singlePage)) {
$totalNames[] = $getPageName->name;
}
$pageName = implode(" , ", $totalNames);
} else {
$pageName = 'There are no cars exists with these car ids.';
}
unset($obj_setting);
示例3: foreach
*/
foreach ($resp->searchResult->item as $finditem) {
$itemId = $finditem->itemId;
$title = $finditem->title;
$postalCode = $finditem->postalCode;
$location = $finditem->location;
$country = $finditem->country;
$startTime = $finditem->startTime;
$endTimes = $finditem->listingInfo->endTime;
$listingType = $finditem->listingInfo->listingType;
$buyItNowAvailable = $finditem->listingInfo->buyItNowAvailable == 'true' ? 1 : 0;
$buyItNowPrice = $finditem->sellingStatus->convertedCurrentPrice;
if ($finditem->listingInfo->buyItNowAvailable == 'true') {
$buyItNowPrice = $finditem->listingInfo->buyItNowPrice;
}
if ($obj_setting->numberOfRows("ebay_car", " itemId=" . $itemId) < 1) {
$xml = '<?xml version="1.0" encoding="utf-8"?>
<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>' . $userToken . '</eBayAuthToken>
</RequesterCredentials>
<DetailLevel>ReturnAll</DetailLevel>
<OutputSelector>Item.VIN,Item.ListingDetails.EndTime,Item.ItemID,Item.PictureDetails.PictureURL,Item.SellingStatus.CurrentPrice,Item.SubTitle,Item.ItemSpecifics,Item.ConditionDisplayName,Item.Description</OutputSelector>
<IncludeItemSpecifics>true</IncludeItemSpecifics>
<ItemID>' . $itemId . '</ItemID>
</GetItemRequest>';
$ch = curl_init("https://api.ebay.com/ws/api.dll?siteid={$siteid}");
$headers = array('X-EBAY-API-COMPATIBILITY-LEVEL: ' . $version, 'X-EBAY-API-DEV-NAME: ' . $devid, 'X-EBAY-API-APP-NAME: ' . $appid, 'X-EBAY-API-CERT-NAME: ' . $certid, 'X-EBAY-API-CALL-NAME: ' . $callname, 'X-EBAY-API-SITEID: ' . $siteid);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
示例4: common
<?php
extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
if (isset($searchtext) and $searchtext != '') {
$addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
} else {
$addToUrl = '';
}
$obj_setting->delete('newsletter_subscriber', " id={$id}");
$_SESSION['success_msg'] = 'Enquiry deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/contact/newsletter/index.php' . $addToUrl . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('newsletter_subscriber', " id={$id}");
if ($total_rows > 0) {
$singlePage = $obj_setting->customQuery("SELECT * FROM newsletter_subscriber where id='" . $id . "'");
$getPageName = $db->fetchNextObject($singlePage);
$pageName = $getPageName->name;
} else {
$pageName = 'No enquiry exists with this id.';
}
unset($obj_setting);
示例5: common
<?php
extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($car_id) and $car_id != '' and isset($action) and $action == 'delete') {
if (isset($searchtext) and $searchtext != '') {
$addToUrl = '?searchtext=' . $searchtext . '&searchcombo=' . $searchcombo;
} else {
$addToUrl = '';
}
$total_rows = $obj_setting->numberOfRows('car', " car_id={$car_id}");
if ($total_rows > 0) {
$obj_setting->delete('car', " car_id={$car_id}");
$obj_setting->delete('contact', " car_id={$car_id}");
$obj_setting->delete('car_flat', " car_id={$car_id}");
$_SESSION['success_msg'] = 'Car deleted successfully.';
if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'nostock') {
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/new_stock/new_car/index.php";</script>';
}
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/car/index.php' . $addToUrl . '";</script>';
} else {
$pageName = 'There is no car exists with this car id.';
}
}
unset($obj_setting);
示例6: common
*************************************************************************************************************/
extract($_GET);
extract($_POST);
$obj_product = new common();
$obj = new validation();
$obj_handle = new Handle();
/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
if (isset($submit) && $submit != "" && $_SERVER['REQUEST_METHOD'] == 'POST') {
$error = '';
//$obj->add_fields($name, 'req', 'Please Enter Product-Name');
if ($name == '') {
$obj->add_fields($name, 'req', 'Please Enter Sub Category Name');
} else {
$result = $obj_product->numberOfRows(TBL_MEMBER, 'name = "' . $name . '" AND cat_id=' . $cat_id . ' AND sub_cat_id =' . $sub_cat_id);
}
$obj->add_fields($cat_id, 'req', 'Please Select Product Category');
$obj->add_fields($sub_cat_id, 'req', 'Please Select Product Sub Category');
$error = $obj->validate();
if ($error || $result > 0) {
if ($result > 0) {
$error .= "Product already Exist in selected Category.";
}
$errorMsg = "<font color='#FF0000' family='verdana' size=2>" . $error . "</font>";
} else {
if ($_FILES['logo']['name']) {
$logo = $currentTimestamp . '_' . $_FILES['logo']['name'];
move_uploaded_file($_FILES['logo']['tmp_name'], LIST_ROOT_ADMIN . "/products_manager/upload/" . $logo);
} else {
$logo = 'no_img.jpg';
示例7: common
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
$field = $_GET['field'];
} else {
$field = 'name';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
$orderby = $_GET['orderBy'];
} else {
$orderby = 'ASC';
}
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
$total_rows = $obj_setting->numberOfRows('pages');
//number of rows in pages table
} else {
if ($_REQUEST['searchtext'] == 'Search') {
$total_rows = $obj_setting->numberOfRows('pages');
//number of rows in pages table
} else {
$total_rows = $obj_setting->numberOfRows('pages', " `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `desc` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
//number of rows in pages table for perticular search criteria
}
}
if (!isset($_REQUEST['searchcombo'])) {
$all_pages = $obj_setting->customQuery("SELECT * FROM pages order by {$field} {$orderby} limit {$eu}, {$limit} ");
} else {
if ($_REQUEST['searchtext'] == 'Search') {
$all_pages = $obj_setting->customQuery("SELECT * FROM pages order by {$field} {$orderby} limit {$eu}, {$limit} ");
示例8: array
$all_years[$year] = $year;
}
} else {
if ($modelID != '') {
$all_year_query = $obj_setting->customQuery("SELECT year FROM reviews WHERE model=" . $modelID);
$all_years = array();
while ($yearrow = mysql_fetch_object($all_year_query)) {
$year = $yearrow->year;
$all_years[$year] = $year;
}
}
}
}
$reviewsArrNew = array();
$reviewsArrOld = array();
$total_rowsOld = $obj_setting->numberOfRows('reviews', $QueryString);
if ($QueryString) {
$total_rowsOld = $obj_setting->numberOfRows('reviews', 'old_new = 0 AND ' . $QueryString);
$total_rowsNew = $obj_setting->numberOfRows('reviews', 'old_new = 1 AND ' . $QueryString);
$QueryStringOld = 'WHERE old_new =0 AND ' . $QueryString;
$QueryStringNew = 'WHERE old_new =1 AND ' . $QueryString;
} else {
$total_rowsOld = $obj_setting->numberOfRows('reviews', 'old_new = 0 ' . $QueryString);
$total_rowsNew = $obj_setting->numberOfRows('reviews', 'old_new = 1 ' . $QueryString);
//$QueryString = 'WHERE '.$QueryString;
$QueryStringOld = 'WHERE old_new =0 ' . $QueryString;
$QueryStringNew = 'WHERE old_new =1 ' . $QueryString;
}
//print_r($total_rowsOld);echo "kgjrkh"; print_r($total_rowsNew);die;
if (isset($start)) {
$QueryString .= ' limit ' . $eu . ', ' . $limit;
示例9: common
$select20 = "";
break;
}
$start = $_GET['start'];
if (strlen($start) > 0 and !is_numeric($start)) {
$start = 0;
}
$eu = $start - 0;
if (!$limit > 0) {
// if limit value is not available then let us use a default value
$limit = PAGING_LIMIT;
// No of records to be shown per page by default.
}
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
$field = $_GET['field'];
} else {
$field = 'id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
$orderby = $_GET['orderBy'];
} else {
$orderby = 'ASC';
}
$obj_setting = new common();
//number of rows in pages table
$total_rows = $obj_setting->numberOfRows('media');
$allMedia = $obj_setting->customQuery("SELECT * from media order by {$field} {$orderby} limit {$eu}, {$limit}");
unset($obj_setting);
示例10: common
$start = 0;
}
$eu = $start - 0;
if (!$limit > 0) {
// if limit value is not available then let us use a default value
$limit = PAGING_LIMIT;
// No of records to be shown per page by default.
}
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
$field = 'news_articles' . $_GET['field'];
} else {
$field = 'articles.id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
$orderby = $_GET['orderBy'];
} else {
$orderby = 'ASC';
}
$obj_setting = new common();
//number of rows in pages table
if ($_GET['cat_id'] != '') {
$total_rows = $obj_setting->numberOfRows('news_articles', "category_id='" . $_GET['cat_id'] . "'");
$allArticles = $obj_setting->customQuery("SELECT category.category_name,articles.id,articles.title FROM news_articles as articles LEFT JOIN news_category as category ON articles.category_id=category.id where articles.category_id='" . $_GET['cat_id'] . "' order by {$field} {$orderby} limit {$eu}, {$limit}");
} else {
$total_rows = $obj_setting->numberOfRows('news_articles');
$allArticles = $obj_setting->customQuery("SELECT category.category_name,articles.id,articles.title FROM news_articles as articles LEFT JOIN news_category as category ON articles.category_id=category.id order by {$field} {$orderby} limit {$eu}, {$limit}");
}
unset($obj_setting);
示例11: common
<?php
extract($_GET);
extract($_POST);
$obj_setting = new common();
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
$obj_setting->delete('content_page', " id={$id}");
$_SESSION['success_msg'] = 'Tab deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/logistique/index.php' . '";</script>';
}
$total_rows = $obj_setting->numberOfRows('content_page', " id={$id}");
if ($total_rows > 0) {
$singlePage = $obj_setting->customQuery("SELECT tab_title FROM content_page where page_name='logistique' and id='" . $id . "'");
$getPageName = $db->fetchNextObject($singlePage);
$pageName = $getPageName->tab_title;
} else {
$pageName = 'There is no Tab exists with this id.';
}
unset($obj_setting);
示例12: IN
<?php
extract($_GET);
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode("','", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
$obj_setting->delete('rot_banner', " id IN('{$id}')");
$_SESSION['success_msg'] = 'Banner deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/home/index.php' . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('rot_banner', " id IN('{$totalIds}')");
if ($total_rows < 0) {
$pageName = 'There are no banner exists with these banner ids.';
}
unset($obj_setting);
示例13: IN
<?php
extract($_GET);
extract($_POST);
#getting array of ids from multiple checkbox and then imploding those ids with ',' to put in IN()
$totalIds = implode("','", $allselect);
$obj_setting = new common();
# Here we are deleting all selected pages
if (isset($id) and $id != '' and isset($action) and $action == 'delete') {
$obj_setting->delete('news_category', "id IN('{$id}')");
$obj_setting->delete('news_articles', "category_id IN('{$id}')");
$_SESSION['success_msg'] = 'Category and its associated articles deleted successfully.';
echo '<script>location.href="' . DEFAULT_ADMIN_URL . '/page/news_category.php' . '";</script>';
}
#taking imploded ids and checking if these ids exists in database or not
#if not then we are showing error message and if found then we are fetching names
#of those pages to show
$total_rows = $obj_setting->numberOfRows('news_category', "id IN('{$totalIds}')");
if ($total_rows < 0) {
$pageName = 'There are no Category exists with these ids.';
}
unset($obj_setting);
示例14: common
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($_GET['field']) and $_GET['field'] != '') {
$field = $_GET['field'];
} else {
$field = 'id';
}
if (isset($_GET['orderBy']) and $_GET['orderBy'] != '') {
$orderby = $_GET['orderBy'];
} else {
$orderby = 'DESC';
}
$obj_setting = new common();
if (!isset($_REQUEST['searchcombo'])) {
$total_rows = $obj_setting->numberOfRows('newsletter_subscriber');
//number of rows in pages table
} else {
if ($_REQUEST['searchtext'] == 'Search') {
$total_rows = $obj_setting->numberOfRows('newsletter_subscriber');
//number of rows in pages table
} else {
$total_rows = $obj_setting->numberOfRows('newsletter_subscriber', " `name` like '%" . addslashes($_REQUEST['searchtext']) . "%' OR `email` like '%" . addslashes($_REQUEST['searchtext']) . "%'");
//number of rows in pages table for perticular search criteria
}
}
if (!isset($_REQUEST['searchcombo'])) {
if ($searchword == "" && $type != "") {
$all_pages = $obj_setting->customQuery("SELECT * FROM newsletter_subscriber where type = {$type} order by {$field} {$orderby} limit {$eu}, {$limit} ");
} else {
if ($searchword != "" && $type != "") {
示例15: validate
function validate()
{
$errorMsg = "";
for ($i = 0; $i < $this->id; $i++) {
$postVar = $this->check_vars[$i]['data'];
$authType = $this->check_vars[$i]['authtype'];
$error = $this->check_vars[$i]['error'];
$optionalparam = $this->check_vars[$i]['optionalparam'];
$pos = strpos($authType, '=');
if ($pos !== false) {
$authType = substr($this->check_vars[$i]['authtype'], 0, $pos);
$value = substr($this->check_vars[$i]['authtype'], $pos + 1);
}
switch ($authType) {
case "req":
if (is_array($postVar['name'])) {
$count = count($postVar['name']);
for ($j = 0; $j < $count; $j++) {
$length = strlen(trim($postVar['name'][$j]));
if (!$length) {
$errorMsg .= $error . " :File " . ($j + 1) . "<br>";
}
}
} elseif (is_array($postVar)) {
$count = count($postVar);
for ($j = 0; $j < $count; $j++) {
$length = strlen(trim($postVar[$j]));
if (!$length) {
$errorMsg .= $error . " :Car Id " . ($j + 1) . "<br>";
}
}
} elseif (isset($postVar['name']) && empty($postVar['name'])) {
$length = strlen(trim($postVar['name']));
if (!$length) {
$errorMsg .= $error . "<br>";
}
} else {
$length = strlen(trim($postVar));
if (!$length) {
$errorMsg .= $error . "<br>";
}
}
break;
case "alpha":
$regexp = '/^[A-Za-z]$/';
if (!preg_match($regexp, trim($postVar))) {
$length = strlen(trim($postVar));
if ($length) {
$errorMsg .= $error . "<br>";
}
}
break;
case "alphanum":
$regexp = '/^[A-za-z0-9]$/';
if (!preg_match($regexp, trim($postVar))) {
$length = strlen(trim($postVar));
if ($length) {
$errorMsg .= $error . "<br>";
}
}
break;
case "num":
if (is_array($postVar)) {
$count = count($postVar);
for ($j = 0; $j < $count; $j++) {
if (!is_numeric($postVar[$j])) {
$length = strlen(trim($postVar[$j]));
if ($length) {
$errorMsg .= $error . " :Car Id " . ($j + 1) . "<br>";
}
}
}
} elseif (!is_numeric($postVar)) {
$length = strlen(trim($postVar));
if ($length) {
$errorMsg .= $error . "<br>";
}
}
break;
case "uniquearray":
if (is_array($postVar)) {
$array_temp = array();
$j = 0;
foreach ($postVar as $val) {
if ($val != '') {
if (!in_array($val, $array_temp)) {
$array_temp[] = $val;
} else {
$errorMsg .= $error . " :Car Id " . ($j + 1) . "<br>";
}
}
$j++;
}
}
break;
case "uniquevalue":
if ($postVar != '') {
$obj_setting = new common();
$total_articles = $obj_setting->numberOfRows($optionalparam[0], $optionalparam[1]);
if ($total_articles > 0) {
//.........这里部分代码省略.........