本文整理汇总了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()))));
示例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';