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


PHP Club::update方法代码示例

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


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

示例1: intval

 * File name: getinfo.php
 */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule("iblock");
CModule::IncludeModule("mytb");
$club_id = intval($_POST["club_id"]);
$clubInfo['NAME'] = trim($_POST["NAME"]);
$clubInfo['DETAIL_TEXT'] = trim($_POST["DESCR"]);
$clubInfo['SITE'] = trim(str_replace("http://", "", $_POST["SITE"]));
$clubInfo['EMAIL_MANAGER'] = trim($_POST["EMAIL_MANAGER"]);
$clubInfo['TIME_WORKING'] = trim($_POST["TIME_WORKING"]);
$clubInfo['AVERAGE_CHECK'] = trim($_POST["AVERAGE_CHECK"]);
$clubInfo['TYPE_FACILITY'] = (array) $_POST["KIND_CLUB"];
$clubInfo['MUSIC'] = (array) $_POST["MUSIC"];
$clubInfo['ADDRES'] = (array) $_POST["ADDRES"];
$clubInfo['ADDRES_NEW'] = (array) $_POST["ADDRES_NEW"];
foreach ($clubInfo['ADDRES'] as $address) {
    $obj = json_decode(file_get_contents("http://geocode-maps.yandex.ru/1.x/?geocode=" . urlencode(trim($address["addres"])) . "&format=json"));
    list($LAT, $LON) = explode(" ", $obj->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos);
    $res = new MyTbCore();
    $res->update(intval($address["id"]), array("SITY_ID" => intval($address["sity"]), "ADDRESS" => trim($address["addres"]), "LON" => $LON, "LAT" => $LAT, "PHONE" => serialize(explode("\n", $address["phone"]))), "address");
}
foreach ($clubInfo['ADDRES_NEW'] as $address) {
    $obj = json_decode(file_get_contents("http://geocode-maps.yandex.ru/1.x/?geocode=" . urlencode(trim($address["addres"])) . "&format=json"));
    list($LAT, $LON) = explode(" ", $obj->response->GeoObjectCollection->featureMember[0]->GeoObject->Point->pos);
    $res = new MyTbCore();
    $res->Add(array("CLUB_ID" => $club_id, "SITY_ID" => intval($address["sity"]), "ADDRESS" => trim($address["addres"]), "LON" => $LON, "LAT" => $LAT, "PHONE" => serialize(explode("\n", $address["phone"]))), "address");
}
$clubRes = new Club($club_id);
$clubRes->update(array("NAME" => $clubInfo['NAME'], "SITE" => $clubInfo['SITE'], "EMAIL_MANAGER" => $clubInfo['EMAIL_MANAGER'], "AVERAGE_CHECK" => $clubInfo['AVERAGE_CHECK'], "TIME_WORKING" => $clubInfo['TIME_WORKING'], "TYPE_FACILITY" => $clubInfo['TYPE_FACILITY'], "MUSIC" => $clubInfo['MUSIC'], "DETAIL_TEXT" => $clubInfo['DETAIL_TEXT']));
die(json_encode(array("status" => "ok", "result" => array("ID" => $club_id, "NAME" => $clubInfo['NAME'], "PREVIEW_PICTURE" => $clubInfo['PREVIEW_PICTURE'], "SITE" => $clubInfo['PROPERTY_SITE_VALUE'], "EMAIL_MANAGER" => $clubInfo['PROPERTY_EMAIL_MANAGER_VALUE'], "AVERAGE_CHECK" => $clubInfo['PROPERTY_AVERAGE_CHECK_VALUE'], "TIME_WORKING" => $clubInfo['PROPERTY_TIME_WORKING_VALUE'], "KIND_CLUB" => (array) $clubInfo['PROPERTY_KIND_CLUB_VALUE'], "MUSIC" => (array) $clubInfo['PROPERTY_MUSIC_VALUE'], "DETAIL_TEXT" => $clubInfo['DETAIL_TEXT'], "ADDRESS" => $clubRes->getAddress()))));
开发者ID:nProfessor,项目名称:Mytb,代码行数:31,代码来源:saveinfo.php

示例2: checkclash

        // If name has changed, check it doesn't clash
        if ($newcode != $club->Code) {
            checkclash($newcode);
            $qcode = mysql_real_escape_string($newcode);
            mysql_query("update club set code='{$qcode}' where {$club->queryof()}");
            $club->Code = $newcode;
        }
        $club->Name = $newname;
        $club->Contactfirst = $contfirst;
        $club->Contactlast = $contlast;
        $club->Contactemail = $contemail;
        $club->Contactphone = $contphone;
        $club->Website = $website;
        $club->Night = $night;
        $club->Schools = $sch;
        $club->update();
        $Title = "Club {$club->display_name()} updated OK";
        break;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Title = "Update individual club";
include 'php/head.php';
?>
<body>
<script language="javascript" src="webfn.js"></script>
<?php 
$showadmmenu = true;
include 'php/nav.php';
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:updindclub2.php


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