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


PHP State::insert方法代码示例

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


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

示例1: State

<?php

include_once $CFG->dirroot . "/lib/classes/" . "application/State.Class.php5";
$StateObj = new State();
$GeneralObj->getRequestVars();
$StateObj->setAllVar();
$redirect_file = "index.php?file=t-state_masteradd&mode={$mode}&iId={$iStateId}";
$message = "State Already Exist";
$GeneralObj->checkDuplicate('iStateId', 'state_master', array('vStateCode', 'vCountryCode'), $redirect_file, $message, $iStateId, ' AND ');
if ($mode == "Add") {
    $StateObj->insert();
    $msg = MSG_ADD;
    header("Location:index.php?file=State&AX=Yes&var_msg={$msg}");
    exit;
} else {
    if ($mode == "Update") {
        $StateObj->update($iStateId);
        $msg = MSG_UPDATE;
        header("Location:index.php?file=State&AX=Yes&var_msg={$msg}");
        exit;
    }
}
开发者ID:redeyes1024,项目名称:medlii_mlm_backend,代码行数:22,代码来源:state_masteradd_a.php

示例2: Country

    include_once SITE_CLASS_APPLICATION . "class.Country.php";
    $countryObj = new Country();
}
$view = PostVar("view");
$Data = PostVar("Data");
$iStateId = PostVar("iStateId");
$cntcode = $countryObj->getCountryDetail("vCountryCode", "AND iCountryId = '{$Data['iCountryId']}'");
$Data['vCountryCode'] = $cntcode[0]['vCountryCode'];
/** This is for Check Duplicate Record-------------------------------------------*/
$generalobj->getRequestVars();
$redirect_file = "index.php?file={$file}&view={$view}&iStateId={$iStateId}";
$generalobj->checkDuplicate('iStateId', PRJ_DB_PREFIX . "_state_master", array('vState' => $Data['vState']), $redirect_file, STATE_ALREADY_EXISTS, $iStateId);
if ($view == "add") {
    //prints($Data);exit;
    $stateObj->setAllVar($Data);
    $id = $stateObj->insert();
    if ($id) {
        $var_msg = "Record Added Successfully.";
    } else {
        $var_msg = "Eror-in Add.";
    }
} else {
    if ($view == "edit") {
        //prints($Data);exit;
        $arr = $stateObj->select($iStateId);
        $stateObj->setAllVar($arr);
        $stateObj->setAllVar($Data);
        $where = " iStateId = '" . $iStateId . "'";
        $id = $stateObj->update($where);
        if ($id) {
            $var_msg = "Record Updated Successfully.";
开发者ID:nstungxd,项目名称:F2CA5,代码行数:31,代码来源:addstate_a.php

示例3: Rating

    $request = \Slim\Slim::getInstance()->request();
    $rating = json_decode($request->getBody());
    $ratingDAO = new Rating();
    $ratingDAO->delete($rating);
    echo '{"result":"ok"}';
});
$app->get('/state', function () {
    $stateDAO = new State();
    $result = $stateDAO->get();
    echo json_encode($result);
});
$app->post('/state', function () {
    $request = \Slim\Slim::getInstance()->request();
    $state = json_decode($request->getBody());
    $stateDAO = new State();
    $stateDAO->insert($state);
    echo '{"result":"ok"}';
});
$app->put('/state', function () {
    $request = \Slim\Slim::getInstance()->request();
    $state = json_decode($request->getBody());
    $stateDAO = new State();
    $stateDAO->update($state);
    echo '{"result":"ok"}';
});
$app->delete('/state', function () {
    $request = \Slim\Slim::getInstance()->request();
    $state = json_decode($request->getBody());
    $stateDAO = new State();
    $stateDAO->delete($state);
    echo '{"result":"ok"}';
开发者ID:,项目名称:,代码行数:31,代码来源:


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