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


PHP Country::deleteCountry方法代码示例

本文整理汇总了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;
}
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:31,代码来源:country+copy.php

示例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 
开发者ID:vicholuis,项目名称:proyectopruebalms,代码行数:31,代码来源:country_admin.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
}
开发者ID:capons,项目名称:math,代码行数:30,代码来源:deleteData.php


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