本文整理汇总了PHP中Country::deleteCountry方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::deleteCountry方法的具体用法?PHP Country::deleteCountry怎么用?PHP Country::deleteCountry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::deleteCountry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
if ($s->check(false, $token, "CREATE_WDW")) {
$o->updatedby = $xoopsUser->getVar('uid');
//get current uid
if ($o->updateCountry()) {
//if data save successfully
redirect_header("country.php?action=edit&country_id={$o->country_id}", $pausetime, "Your data is saved.");
} else {
redirect_header("country.php?action=edit&country_id={$o->country_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
}
} else {
redirect_header("country.php?action=edit&country_id={$o->country_id}", $pausetime, "Warning! Can't save the data, please make sure all value is insert properly.");
}
break;
case "delete":
if ($s->check(false, $token, "CREATE_WDW")) {
if ($o->deleteCountry($o->country_id)) {
redirect_header("country.php", $pausetime, "Data removed successfully.");
} else {
redirect_header("country.php?action=edit&country_id={$o->country_id}", $pausetime, "Warning! Can't delete data from database.");
}
} else {
redirect_header("country.php?action=edit&country_id={$o->country_id}", $pausetime, "Warning! Can't delete data from database.");
}
break;
default:
$token = $s->createToken(120, "CREATE_WDW");
//$o->orgctrl=$selectionOrg->selectionOrg($o->createdby,0);
$o->getInputForm("new", 0, $token);
$o->showCountryTable("WHERE country_id>0", "ORDER BY defaultlevel,country_name");
break;
}
示例2: array
Country::setDataOperationBusiness($registry[$nameDataBase]);
$idTransaction = $transaction->insertTransaction(array(Country::$business, Country::$update, Country::$descriptionBusiness));
$data = array($_POST['NAME'], $_POST['EDIT']);
$statusTransactionDB = $catalog->updateCountry($data, $idTransaction);
if ($statusTransactionDB > 0) {
Forms::setMessage('SUCCESS', $v_label["SHORT_MESSAGE_OK_EDIT"], $v_label["DETAIL_MESSAGE_OK_EDIT"]);
} else {
Forms::setMessage('ERROR', $v_label["SHORT_MESSAGE_NOOK_EDIT"], $v_label["DETAIL_MESSAGE_NOOK_EDIT"]);
}
break;
case 'DELETE':
$transaction = new Transaction($registry[$nameDataBase]);
Country::setDataOperationBusiness($registry[$nameDataBase]);
$idTransaction = $transaction->insertTransaction(array(Country::$business, Country::$update, Country::$descriptionBusiness));
$data = array($_GET['DELETE']);
$statusTransactionDB = $catalog->deleteCountry($data, $idTransaction);
if ($statusTransactionDB > 0) {
Forms::setMessage('SUCCESS', $v_label["SHORT_MESSAGE_OK_DELETE"], $v_label["DETAIL_MESSAGE_OK_DELETE"]);
} else {
Forms::setMessage('ERROR', $v_label["SHORT_MESSAGE_NOOK_DELETE"], $v_label["DETAIL_MESSAGE_NOOK_DELETE"]);
}
break;
default:
break;
}
// Obtener lista
$list = $catalog->getListCountry();
?>
<div class="grid_10">
<div class="box round first">
<h2><?php
示例3: parse_str
<?php
require_once "../config/Autoload.php";
//Autoload class
require_once "../libs/datafilter.php";
//form validate
$method = $_SERVER['REQUEST_METHOD'];
//variable contains the name of the "Request method"
if ($method == 'DELETE') {
parse_str(file_get_contents("php://input"), $editData);
//$editData - variable containe delete Data
$editData = trimAll($editData);
//validate PUT data
$editData = htmlAll($editData);
//validate PUT data
$deleteCity = Main::deleteData($editData['del_country'], $editData['del_city'], $editData['del_language']);
//delete city
$editData['info'] = 'Successfully removed';
$lastCity = City::lastCity($editData['del_country']);
//if the country have only 1 city delete the country and language
if (mysqli_num_rows($lastCity) == 0) {
$deleteCountryLanguge = Language::deleteLanguage($editData['del_language']);
//delete language
$deleteCountry = Country::deleteCountry($editData['del_country']);
//delete country
$editData['info'] = 'Successfully removed';
}
echo json_encode($editData);
//send response data to Jquery
}