• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ConvertUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: exportSms

 public static function exportSms($id)
 {
     $ids = is_array($id) ? $id : explode(",", $id);
     header("Content-Type:application/vnd.ms-excel");
     $fileName = ConvertUtil::iIconv(Ibos::lang("SMS export name", "dashboard.default", array("{date}" => date("Ymd"))), CHARSET, "gbk");
     header("Content-Disposition: attachment;filename={$fileName}.csv");
     header("Cache-Control: max-age = 0");
     $head = array("ID", Ibos::lang("Sender", "dashboard.default"), Ibos::lang("Recipient", "dashboard.default"), Ibos::lang("Membership module", "dashboard.default"), Ibos::lang("Recipient phone number", "dashboard.default"), Ibos::lang("Content", "dashboard.default"), Ibos::lang("Result", "dashboard.default"), Ibos::lang("Send time", "dashboard.default"));
     foreach ($head as &$header) {
         $header = ConvertUtil::iIconv($header, CHARSET, "gbk");
     }
     $fp = fopen("php://output", "a");
     fputcsv($fp, $head);
     $cnt = 0;
     $limit = 100;
     $system = Ibos::lang("System", "dashboard.default");
     foreach (NotifySms::model()->fetchAll(sprintf("FIND_IN_SET(id,'%s')", implode(",", $ids))) as $row) {
         if ($limit == $cnt) {
             ob_flush();
             flush();
             $cnt = 0;
         }
         $data = array($row["id"], ConvertUtil::iIconv($row["uid"] == 0 ? $system : User::model()->fetchRealnameByUid($row["uid"]), CHARSET, "gbk"), ConvertUtil::iIconv(User::model()->fetchRealnameByUid($row["touid"]), CHARSET, "gbk"), $row["module"], $row["mobile"], ConvertUtil::iIconv($row["content"], CHARSET, "gbk"), ConvertUtil::iIconv($row["return"], CHARSET, "gbk"), date("Y-m-d H:i:s", $row["ctime"]));
         fputcsv($fp, $data);
     }
     exit;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:27,代码来源:MessageUtil.php


示例2: updateTable

 public static function updateTable($flowId, $structure = array())
 {
     $tableName = sprintf("{{flow_data_%d}}", intval($flowId));
     if (!self::tableExists($tableName)) {
         if (!self::createTable($tableName, $structure)) {
             return false;
         }
         return true;
     }
     if ($structure) {
         $rows = Ibos::app()->db->createCommand()->setText("SHOW FIELDS FROM " . $tableName)->queryAll();
         $fields = ConvertUtil::getSubByKey($rows, "Field");
         $items = array();
         foreach ($structure as $eName => $config) {
             $field = strtolower(trim($eName));
             if (!in_array($field, $fields)) {
                 if (substr($field, 0, 5) == "data_") {
                     $items[] = "ALTER TABLE " . $tableName . " ADD `{$field}` text NOT NULL;";
                 }
             }
         }
         if (!empty($items)) {
             Ibos::app()->db->createCommand()->setText(implode("\n", $items))->execute();
         }
     }
     return true;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:27,代码来源:WfCommonUtil.php


示例3: showDetail

 protected function showDetail()
 {
     $repid = intval(EnvUtil::getRequest("repid"));
     $isShowTitle = EnvUtil::getRequest("isShowTitle");
     $fromController = EnvUtil::getRequest("fromController");
     $report = Report::model()->fetchByPk($repid);
     $uid = Ibos::app()->user->uid;
     Report::model()->addReaderuid($report, $uid);
     $record = ReportRecord::model()->fetchAllRecordByRep($report);
     $attachs = array();
     if (!empty($report["attachmentid"])) {
         $attachs = AttachUtil::getAttach($report["attachmentid"], true, true, false, false, true);
     }
     $readers = array();
     if (!empty($report["readeruid"])) {
         $readerArr = explode(",", $report["readeruid"]);
         $readers = User::model()->fetchAllByPk($readerArr);
     }
     $stampUrl = "";
     if ($report["stamp"] != 0) {
         $stamp = Stamp::model()->fetchStampById($report["stamp"]);
         $stampUrl = FileUtil::fileName(Stamp::STAMP_PATH) . $stamp;
     }
     $report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u");
     $params = array("lang" => Ibos::getLangSource("report.default"), "repid" => $repid, "report" => $report, "uid" => $uid, "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "fromController" => $fromController, "isShowTitle" => $isShowTitle, "allowComment" => $this->getIsAllowComment($fromController));
     $detailAlias = "application.modules.report.views.detail";
     $detailView = $this->renderPartial($detailAlias, $params, true);
     $this->ajaxReturn(array("data" => $detailView, "isSuccess" => true));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:29,代码来源:ReportBaseController.php


示例4: getUids

 public function getUids($content, $extraUids = null, $lessUids = null)
 {
     preg_match_all($this->_atRegex, $content, $matches);
     $unames = $matches[1];
     $map = "realname in ('" . implode("','", $unames) . "')";
     $ulist = User::model()->fetchAll($map);
     $matchUids = ConvertUtil::getSubByKey($ulist, "uid");
     if (empty($matchUids) && !empty($extraUids)) {
         if (!empty($lessUids)) {
             foreach ($lessUids as $k => $v) {
                 if (in_array($v, $extraUids)) {
                     unset($extraUids[$k]);
                 }
             }
         }
         return is_array($extraUids) ? $extraUids : array($extraUids);
     }
     $suid = array();
     foreach ($matchUids as $v) {
         !in_array($v, $suid) && ($suid[] = (int) $v);
     }
     if (!empty($lessUids)) {
         foreach ($suid as $k => $v) {
             if (in_array($v, $lessUids)) {
                 unset($suid[$k]);
             }
         }
     }
     return array_unique(array_filter(array_merge($suid, (array) $extraUids)));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:30,代码来源:Atme.php


示例5: handleInitEnvironment

 public function handleInitEnvironment($event)
 {
     Ibos::app()->performance->startClock();
     Ibos::app()->performance->startMemoryUsageMarker();
     define("STATICURL", Ibos::app()->assetManager->getBaseUrl());
     define("IN_MOBILE", EnvUtil::checkInMobile());
     define("IN_DASHBOARD", EnvUtil::checkInDashboard());
     define("TIMESTAMP", time());
     define("IN_APP", EnvUtil::checkInApp());
     $this->setTimezone();
     if (function_exists("ini_get")) {
         $memorylimit = @ini_get("memory_limit");
         if ($memorylimit && ConvertUtil::ConvertBytes($memorylimit) < 33554432 && function_exists("ini_set")) {
             ini_set("memory_limit", "128m");
         }
     }
     $global = array("timestamp" => TIMESTAMP, "version" => VERSION, "clientip" => EnvUtil::getClientIp(), "referer" => "", "charset" => CHARSET, "authkey" => "", "newversion" => 0, "config" => array(), "setting" => array(), "user" => array(), "cookie" => array(), "session" => array(), "lunar" => DateTimeUtil::getlunarCalendar(), "title" => MainUtil::getIncentiveWord(), "staticurl" => STATICURL);
     $global["phpself"] = $this->getScriptUrl();
     $sitePath = substr($global["phpself"], 0, strrpos($global["phpself"], "/"));
     $global["isHTTPS"] = isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off" ? true : false;
     $global["siteurl"] = StringUtil::ihtmlSpecialChars("http" . ($global["isHTTPS"] ? "s" : "") . "://" . $_SERVER["HTTP_HOST"] . $sitePath . "/");
     $url = parse_url($global["siteurl"]);
     $global["siteroot"] = isset($url["path"]) ? $url["path"] : "";
     $global["siteport"] = empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443" ? "" : ":" . $_SERVER["SERVER_PORT"];
     $config = @(include PATH_ROOT . "/system/config/config.php");
     if (empty($config)) {
         throw new NotFoundException(Ibos::Lang("Config not found", "error"));
     } else {
         $global["config"] = $config;
     }
     Ibos::app()->setting->copyFrom($global);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:32,代码来源:InitMainModuleBehavior.php


示例6: actionIndex

 public function actionIndex()
 {
     $op = EnvUtil::getRequest("op");
     $op = in_array($op, array("dept", "letter")) ? $op : "dept";
     $params = array();
     if ($op == "letter") {
         $params["datas"] = $this->getDataByLetter();
     } else {
         $params["datas"] = $this->getDataByDept();
     }
     $userDatas = array();
     if (!empty($params["datas"])) {
         foreach ($params["datas"] as $datas) {
             $userDatas = $op == "dept" ? array_merge($userDatas, $datas["users"]) : array_merge($userDatas, $datas);
         }
     }
     $params["uids"] = implode(",", ConvertUtil::getSubByKey($userDatas, "uid"));
     $uid = Ibos::app()->user->uid;
     $params["cuids"] = Contact::model()->fetchAllConstantByUid($uid);
     $this->setPageTitle(Ibos::lang("Contact"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Contact"), "url" => $this->createUrl("defalut/index")), array("name" => Ibos::lang("Company contact"))));
     $view = $op == "letter" ? "letter" : "dept";
     $params["allLetters"] = $this->allLetters;
     $this->render($view, $params);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:25,代码来源:DefaultController.php


示例7: export

 public static function export($idstr)
 {
     $idArr = is_array($idstr) ? $idstr : explode(",", $idstr);
     if (1 < count($idArr)) {
         $zip = new Zip();
         $exportFileName = Ibos::lang("Form export file pack", "workflow.default", array("{date}" => date("Y-m-d")));
         $zipFileName = FileUtil::getTempPath() . "/" . TIMESTAMP . ".zip";
         foreach ($idArr as $id) {
             $form = self::handleExportSingleForm($id);
             $zip->addFile($form["content"], sprintf("%s.html", ConvertUtil::iIconv($form["title"], CHARSET, "gbk")));
         }
         $fp = fopen($zipFileName, "w");
         if (@fwrite($fp, $zip->file()) !== false) {
             header("Cache-control: private");
             header("Content-type: application/octet-stream");
             header("Accept-Ranges: bytes");
             header("Content-Length: " . sprintf("%u", FileUtil::fileSize($zipFileName)));
             header("Content-Disposition: attachment; filename=" . $exportFileName . ".zip");
             readfile($zipFileName);
             exit;
         }
     } else {
         $id = implode(",", $idArr);
         $form = self::handleExportSingleForm($id);
         ob_end_clean();
         header("Cache-control: private");
         header("Content-type: text/plain");
         header("Accept-Ranges: bytes");
         header("Accept-Length: " . strlen($form["content"]));
         header("Content-Disposition: attachment; filename=" . $form["title"] . ".html");
         echo $form["content"];
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:33,代码来源:WfFormUtil.php


示例8: getMemoryMarkerUsage

 public function getMemoryMarkerUsage($format = true)
 {
     $usage = (int) memory_get_usage() - $this->memoryUsage;
     if ($format) {
         return ConvertUtil::sizeCount($usage);
     }
     return $usage;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:8,代码来源:ICPerformanceMeasurement.php


示例9: actionAllDiggList

 public function actionAllDiggList()
 {
     $feedId = intval(EnvUtil::getRequest("feedid"));
     $result = FeedDigg::model()->fetchUserList($feedId, 5);
     $uids = ConvertUtil::getSubByKey($result, "uid");
     $followStates = Follow::model()->getFollowStateByFids(Ibos::app()->user->uid, $uids);
     $this->renderPartial("alldigglist", array("list" => $result, "followstates" => $followStates, "feedid" => $feedId));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:8,代码来源:FeedController.php


示例10: fetchAllPositionIdByUid

 public function fetchAllPositionIdByUid($uid)
 {
     static $uids = array();
     if (!isset($uids[$uid])) {
         $posids = $this->fetchAll(array("select" => "positionid", "condition" => "`uid` = :uid", "params" => array(":uid" => $uid)));
         $uids[$uid] = ConvertUtil::getSubByKey($posids, "positionid");
     }
     return $uids[$uid];
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:9,代码来源:PositionRelated.php


示例11: delClear

 public function delClear($id, $uid)
 {
     $fidArr = Yii::app()->db->createCommand()->select("fid")->from($this->tableName())->where("FIND_IN_SET(webid,'{$id}') AND uid = {$uid}")->queryAll();
     $fids = ConvertUtil::getSubByKey($fidArr, "fid");
     $fid = implode(",", $fids);
     Yii::app()->db->createCommand()->delete("{{email_folder}}", "FIND_IN_SET(fid,'{$fid}') AND uid = {$uid}");
     Yii::app()->db->createCommand()->update("{{email}}", array("fid" => 1), "FIND_IN_SET(fid,'{$fid}') AND toid = {$uid}");
     return $this->deleteAll("FIND_IN_SET(webid,'{$id}')");
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:9,代码来源:EmailWeb.php


示例12: getTableStatus

 public static function getTableStatus($tableName, $formatSize = true)
 {
     $status = Ibos::app()->db->createCommand()->setText("SHOW TABLE STATUS LIKE '{{" . str_replace("_", "\\_", $tableName) . "}}'")->queryRow();
     if ($formatSize) {
         $status["Data_length"] = ConvertUtil::sizeCount($status["Data_length"]);
         $status["Index_length"] = ConvertUtil::sizeCount($status["Index_length"]);
     }
     return $status;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:9,代码来源:DatabaseUtil.php


示例13: fetchAuidByUid

 public function fetchAuidByUid($uid)
 {
     $attentions = $this->fetchAll("uid = :uid", array(":uid" => $uid));
     $aUids = array();
     if (!empty($attentions)) {
         $aUids = ConvertUtil::getSubByKey($attentions, "auid");
     }
     return $aUids;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:9,代码来源:DiaryAttention.php


示例14: beforeAction

 public function beforeAction($action)
 {
     if (!Ibos::app()->user->isGuest) {
         $param = ConvertUtil::implodeArray(array("GET" => $_GET, "POST" => $_POST), array("username", "password", "formhash"));
         $action = $action->getId();
         $log = array("user" => Ibos::app()->user->username, "ip" => Ibos::app()->setting->get("clientip"), "action" => $action, "param" => $param);
         Log::write($log, "admincp", sprintf("module.dashboard.%s", $action));
     }
     return true;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:10,代码来源:DashboardBaseController.php


示例15: handleList

 protected function handleList($runProcess)
 {
     foreach ($runProcess as &$run) {
         $run["user"] = User::model()->fetchByUid($run["beginuser"]);
         $run["begintime"] = ConvertUtil::formatDate($run["begintime"], "u");
         $param = array("runid" => $run["runid"], "flowid" => $run["flowid"]);
         $run["key"] = WfCommonUtil::param($param);
     }
     return array("list" => $runProcess);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:10,代码来源:RecycleController.php


示例16: delBody

 public function delBody($bodyIds, $archiveId = 0)
 {
     $table = sprintf("{{%s}}", $this->getTableName($archiveId));
     $bodys = Yii::app()->db->createCommand()->select("attachmentid")->from($table)->where("FIND_IN_SET(bodyid,'{$bodyIds}')")->queryAll();
     $attachIds = ConvertUtil::getSubByKey($bodys, "attachmentid");
     $attachId = StringUtil::filterStr(implode(",", $attachIds));
     if (!empty($attachId)) {
         AttachUtil::delAttach($attachId);
     }
     return Yii::app()->db->createCommand()->delete($table, "FIND_IN_SET(bodyid,'{$bodyIds}')");
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:11,代码来源:EmailBody.php


示例17: actionLoadMoreDiggUser

 public function actionLoadMoreDiggUser()
 {
     $feedId = intval(EnvUtil::getRequest("feedid"));
     $offset = intval(EnvUtil::getRequest("offset"));
     $result = FeedDigg::model()->fetchUserList($feedId, 5, $offset);
     $uids = ConvertUtil::getSubByKey($result, "uid");
     $followStates = Follow::model()->getFollowStateByFids(Ibos::app()->user->uid, $uids);
     $data["data"] = $this->renderPartial("application.modules.message.views.feed.digglistmore", array("list" => $result, "followstates" => $followStates), true);
     $data["isSuccess"] = true;
     $this->ajaxReturn($data);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:11,代码来源:ApiController.php


示例18: handleCreditRule

 public function handleCreditRule($event)
 {
     $rules = array();
     $records = CreditRule::model()->fetchAll();
     if (!empty($records)) {
         foreach ($records as $rule) {
             $rule["rulenameuni"] = urlencode(ConvertUtil::iIconv($rule["rulename"], CHARSET, "UTF-8", true));
             $rules[$rule["action"]] = $rule;
         }
     }
     Syscache::model()->modify("creditrule", $rules);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:12,代码来源:CreditRuleCacheProvider.php


示例19: fetchRepidAndAidByTypeids

 public function fetchRepidAndAidByTypeids($typeids)
 {
     $typeids = is_array($typeids) ? implode(",", $typeids) : trim($typeids, ",");
     $reports = $this->fetchAll(array("select" => "repid, attachmentid", "condition" => "typeid IN({$typeids})"));
     $return = array();
     if (!empty($reports)) {
         $return["repids"] = implode(",", ConvertUtil::getSubByKey($reports, "repid"));
         $attachmentidArr = ConvertUtil::getSubByKey($reports, "attachmentid");
         $return["aids"] = implode(",", array_filter($attachmentidArr));
     }
     return $return;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:12,代码来源:Report.php


示例20: fetchAllByDocid

 public function fetchAllByDocid($docid)
 {
     $versionData = $this->fetchAll("docid=:docid ORDER BY version DESC", array(":docid" => $docid));
     if (!empty($versionData)) {
         $users = Yii::app()->setting->get("cache/users");
         foreach ($versionData as $key => $version) {
             $versionData[$key]["uptime"] = ConvertUtil::formatDate($version["uptime"], "u");
             $versionData[$key]["editor"] = isset($users[$version["editor"]]) ? $users[$version["editor"]]["realname"] : "--";
             $versionData[$key]["showVersion"] = OfficialdocUtil::changeVersion($version["version"]);
         }
     }
     return $versionData;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:13,代码来源:OfficialdocVersion.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Converter类代码示例发布时间:2022-05-23
下一篇:
PHP Convert类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap