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


PHP Region::fetchRegion方法代码示例

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


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

示例1:

             $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y');
             $o->getInputForm("new", -1, $token);
             $o->showRegionTable();
         }
     } else {
         // if the token is not valid or the token is expired, it back to previous form with previous inputed data
         $log->showLog(1, "Warning, '{$o->region_name}' cannot be save due to token expired");
         $token = $s->createToken($tokenlife, "CREATE_STD");
         $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N');
         $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y');
         $o->getInputForm("new", -1, $token);
         $o->showRegionTable();
     }
     break;
 case "edit":
     if ($o->fetchRegion($o->region_id)) {
         //create a new token for editing a form
         //$orgwhereaccess=$orgwhereaccess
         $token = $s->createToken($tokenlife, "CREATE_STD");
         $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N');
         $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y');
         $o->getInputForm("edit", $o->region_id, $token);
         $o->showRegionTable();
     } else {
         //if can't find particular region from database, return error message
         redirect_header("region.php", 3, "<b style='color:red'>Some error on viewing your region data, probably database corrupted.</b>");
     }
     break;
 case "update":
     if ($s->check(true, $token, "CREATE_STD")) {
         $o->updatedby = $xoopsUser->getVar('uid');
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:31,代码来源:region.php

示例2: saveRegion

 public function saveRegion()
 {
     $this->log->showLog(2, "Access saveRegion");
     global $xoopsDB, $saveHandler, $createdby, $timestamp;
     $tablename = "sim_region";
     $pkey = "region_id";
     $keyword = "Region";
     $controlfieldname = "region_name";
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array($controlfieldname, "country_id", "isactive", "defaultlevel", "created", "createdby", "updated", "updatedby");
         $arrfieldtype = array('%s', '%d', '%d', '%d', '%s', '%d', '%s', '%d');
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, $controlfieldname), $saveHandler->ReturnInsertField($currentRecord, "country_id"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "defaultlevel"), $timestamp, $createdby, $timestamp, $createdby);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, $controlfieldname);
             $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, $pkey);
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array($controlfieldname, "country_id", "isactive", "defaultlevel", "updated", "updatedby", "isdeleted");
         $arrfieldtype = array('%s', '%d', '%d', '%d', '%s', '%d', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, $controlfieldname), $saveHandler->ReturnUpdateField($currentRecord, "country_id"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "defaultlevel"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted"));
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, $controlfieldname);
             $this->UpdateRecord($tablename, $pkey, $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     include "class/{$keyword}.inc.php";
     $o = new Region();
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $o->fetchRegion($record_id);
             $controlvalue = $o->region_name;
             $isdeleted = $o->isdeleted;
             if ($o->allowDelete($record_id)) {
                 $this->DeleteRecord($tablename, $pkey, $record_id, $controlvalue, $isdeleted);
             } else {
                 $this->failfeedback .= "Cannot delete {$keyword}: {$controlvalue} <br/>";
             }
         }
     }
     //$this->failfeedback.="asdasdpasd<br/>\n";
     //$this->failfeedback.="123 3443<br/>\n";
     //$this->failfeedback.="234 45656523 234<br/>\n";
     if ($this->failfeedback != "") {
         $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
开发者ID:gauravsaxena21,项目名称:simantz,代码行数:60,代码来源:Save_Data.inc.php


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