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

PHP printJSON函数代码示例

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

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



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

示例1: actRemove

 function actRemove()
 {
     global $ST, $post;
     $field_name = $post->get('field_name');
     $ST->delete('sc_enum', "field_name='{$field_name}'");
     exit(printJSON(array('msg' => 'Удалено')));
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:7,代码来源:Enum.class.php


示例2: actSend

 function actSend()
 {
     global $post;
     $error = array();
     if (!$this->getUserId()) {
         $error['userid'] = 'Ќеобходимо выпонить вход, или зарегистрироватьс¤';
     }
     if (!trim($post->get('description'))) {
         $error['description'] = '¬ведите описание';
     }
     if (!trim($post->get('text'))) {
         $error['text'] = '¬ведите текст';
     }
     if (empty($error)) {
         $data = array('userid' => $this->getUserId(), 'text' => $post->get('text'), 'description' => $post->get('description'), 'category' => $post->getInt('category'), 'time' => now(), 'date_to' => dte($post->get('date_to'), DTE_FORMAT_SQL), 'status' => 0);
         DB::insert('sc_shop_board', $data);
         $this->sendTemplateMail($this->cfg('MAIL'), 'notice_board', $data);
         //			$this->noticeICQ($this->cfg('ICQ'),'Ќовое объ¤вление на сайте на сайте');
     } else {
         echo printJSON(array('err' => $error));
         exit;
     }
     echo printJSON(array('msg' => 'ok'));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:25,代码来源:Board.class.php


示例3: actReset

 function actReset()
 {
     global $ST;
     $ST->update('sc_news', array('view' => 0), "id=" . intval($_POST['id']));
     echo printJSON(array("id" => intval($_POST['id'])));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:7,代码来源:AdminFaq.class.php


示例4: actSend

 function actSend()
 {
     global $ST, $post;
     $error = array();
     if (!trim($post->get('name'))) {
         $error['name'] = 'Введите ФИО';
     }
     if (!trim($post->get('question'))) {
         $error['question'] = 'Введите вопрос';
     }
     if (!$this->checkCapture($post->get('capture'), $this->getType())) {
         $error['capture'] = "Введите правильный код!";
     }
     if (empty($error)) {
         $data = array('mail' => $post->get('mail'), 'phone' => $post->get('phone'), 'name' => $post->get('name'), 'question' => $post->get('question'), 'ip' => $_SERVER['REMOTE_ADDR'], 'browser' => $_SERVER['HTTP_USER_AGENT'], 'state' => 'edit');
         $data['type'] = $this->getType();
         if ($post->exists('theme')) {
             $data['theme'] = $post->get('theme');
         }
         $ST->insert('sc_faq', $data);
         $mail_contacts = $this->enum('mail_contacts', $this->getRegion());
         $this->sendTemplateMail($this->cfg('MAIL_FAQ') . '; ' . $mail_contacts, 'notice_faq', $data);
         $this->noticeICQ($this->cfg('ICQ'), 'Новое сообщение на сайте');
     }
     echo printJSON(array('err' => $error));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:27,代码来源:Faq.class.php


示例5: actSave

 function actSave()
 {
     global $ST, $post;
     $config_arr = $post->getArray('config');
     $text_arr = $post->getArray('text');
     $description_arr = $post->getArray('description');
     foreach ($description_arr as $name => $d) {
         $data = array('description' => $d, 'text' => $text_arr[$name]);
         $class = "PS" . ucfirst($name);
         include_once "ps/{$class}.class.php";
         $ps = new $class();
         $config = array();
         foreach ($ps->config as $c) {
             $config[$c] = @$config_arr[$name][$c];
         }
         $data['config'] = serialize($config);
         $rs = $ST->select("SELECT * FROM sc_pay_system WHERE name='{$name}'");
         if ($rs->next()) {
             $ST->update('sc_pay_system', $data, "name='{$name}'");
         } else {
             $data['name'] = $name;
             $ST->insert('sc_pay_system', $data);
         }
     }
     if ($paysystem = $post->get('default')) {
         $rs = $ST->select("SELECT * FROM sc_config WHERE name='PAYSYSTEM'");
         if ($rs->next()) {
             $ST->update('sc_config', array('value' => $paysystem), "name='PAYSYSTEM'");
         } else {
             $ST->insert('sc_config', array('value' => $paysystem, 'name' => 'PAYSYSTEM', 'description' => 'Платёжная система'));
         }
     }
     echo printJSON(array('msg' => 'Сохранено!'));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:35,代码来源:Paysystem.class.php


示例6: actReset

 function actReset()
 {
     global $ST;
     $ST->update('sc_vote_item', array('result' => 0), "voteid=" . intval($_POST['id']));
     $ST->delete('sc_vote_det', "itemid IN(SELECT id FROM sc_vote_item WHERE voteid=" . intval($_POST['id']) . ")");
     echo printJSON(array("id" => intval($_POST['id'])));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:8,代码来源:AdminVote.class.php


示例7: actExec

 function actExec()
 {
     global $ST, $post;
     $q = str_replace('`', '', $post->get('query'));
     $res = $ST->exec($q);
     echo printJSON(array('msg' => print_r($res, true)));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:8,代码来源:Query.class.php


示例8: actRemove

 function actRemove()
 {
     global $ST;
     $q = "DELETE FROM sc_guestbook WHERE id=" . intval($_POST['id']);
     $ST->executeDelete($q);
     echo printJSON(array("id" => intval($_POST['id'])));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:8,代码来源:AdminGuestbook.class.php


示例9: actGetPos

 function actGetPos()
 {
     global $ST, $post;
     $d = '';
     $rs = $ST->select("SELECT u.district FROM sc_shop_order o,sc_users u WHERE o.driver=u.u_id AND o.order_status=2 AND o.id={$post->getInt('order_num')}");
     if ($rs->next()) {
         $d = $rs->get('district');
     }
     echo printJSON(array('point' => $d));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:11,代码来源:Ymap.class.php


示例10: actSave

 function actSave()
 {
     global $ST, $post;
     $data = array('comment' => $post->get('comment'), 'answer' => $post->get('answer'), 'time_answer' => date('Y-m-d H:i:s'), 'status' => $post->getInt('status'));
     if ($id = $post->getInt('id')) {
         $ST->update('sc_comment', $data, "id={$id}");
     } else {
         $id = $ST->insert("sc_comment", $data);
     }
     echo printJSON(array('id' => $id, 'msg' => 'Сохранено!'));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:12,代码来源:AdminComment.class.php


示例11: actGetText

 function actGetText()
 {
     global $ST, $post;
     $data = array('rule' => '', 'text' => '', 'url' => $post->get('url'), 'exists' => false);
     $rs = $ST->select("SELECT text,url,rule FROM sc_ceo_text\r\n\t\t\t WHERE\r\n\t\t\t \tplace='{$post->get('place')}' \r\n\t\t\t \tAND ((url='" . SQL::slashes($post->get('url')) . "' AND rule='=') \r\n\t\t\t \tOR ('" . SQL::slashes($post->get('url')) . "' LIKE CONCAT(url,'%') AND rule!='=' ))\r\n\t\t\t ORDER BY LENGTH(url) DESC LIMIT 1");
     if ($rs->next()) {
         $data = $rs->getRow();
         $data['exists'] = true;
     }
     $data['place'] = $post->get('place');
     echo printJSON($data);
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:13,代码来源:Ceo.class.php


示例12: actSave

 function actSave()
 {
     global $ST, $post;
     $id = $post->getInt('id');
     $data = array('name' => $post->get('name'), 'theme' => $post->get('theme'), 'body' => $post->get('body'), 'description' => $post->get('description'));
     if ($id) {
         $ST->update('sc_letter_template', $data, 'id=' . $id);
     } else {
         $id = $ST->insert('sc_letter_template', $data);
     }
     echo printJSON(array('msg' => '—охранено', 'id' => $id));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:13,代码来源:Mailtpl.class.php


示例13: actSend

 function actSend()
 {
     global $ST, $post;
     $error = array();
     //		if($this->checkCapture($post->get('capture'))){
     //			$error['capture']="Введите правильный код!";
     //		}
     $form = trim($this->mod_alias, '/');
     if (empty($error)) {
         $data = array('data' => serialize($post->get()), 'form' => $form);
         $ST->insert('sc_forms', $data);
         $data['html'] = $data['data'];
         unset($data['data']);
         $data['html'] = $this->render(unserialize($data['html']), dirname(__FILE__) . '/' . $data['form'] . '_view.tpl.php');
         $this->sendTemplateMail($this->cfg('MAIL_CONTACTS'), 'forms_' . $form, $data);
         //			$this->noticeICQ($this->cfg('ICQ'),'Новое сообщение на сайте');
     }
     echo printJSON(array('err' => $error));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:20,代码来源:Forms.class.php


示例14: actSendComment

 function actSendComment()
 {
     global $ST, $post;
     if ($this->checkCapture($post->get('capture'), 'gfb')) {
         $d = array('itemid' => $post->getInt('itemid'), 'comment' => $post->get('comment'), 'name' => $post->get('name') ? $post->get('name') : $this->getUser('name'), 'mail' => $post->get('mail') ? $post->get('mail') : $this->getUser('mail'), 'time' => date('Y-m-d H:i:s'), 'ip' => $_SERVER['REMOTE_ADDR'], 'status' => 1, 'type' => $post->get('type') ? $post->get('type') : 'goods');
         $id = $ST->insert("sc_comment", $d, 'id');
         $d['fullurl'] = "{$_SERVER['HTTP_HOST']}" . $this->getURI();
         //			$mail_contacts=$this->enum('mail_contacts',$this->getRegion());
         $this->sendTemplateMail($this->cfg('MAIL_CONTACTS'), 'notice_goods_comment', $d);
         $rait = $post->getArray('rait');
         foreach ($rait as $k => $v) {
             $d = array('commentid' => (int) $id, 'raitid' => (int) $k, 'rating' => (int) $v);
             $ST->insert('sc_comment_rait', $d, 'raitid');
         }
         echo printJSON(array('res' => 'ok'));
         exit;
     } else {
         echo printJSON(array('err' => 'Введите правильный код'));
         exit;
     }
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:21,代码来源:Comment.class.php


示例15: actSend

 function actSend()
 {
     global $ST, $post;
     $error = array();
     if (!trim($post->get('name'))) {
         $error['name'] = 'Введите ФИО';
     }
     if (!trim($post->get('comment'))) {
         $error['comment'] = 'Введите сообщение';
     }
     if (defined('IMG_SECURITY') && (!isset($_SESSION[IMG_SECURITY]) || $post->get('capture') != $_SESSION[IMG_SECURITY])) {
         $error['capture'] = "Введите правильный код!";
     }
     if (empty($error)) {
         $data = array('mail' => $post->get('mail'), 'phone' => $post->get('phone'), 'name' => $post->get('name'), 'theme' => $post->get('theme'), 'comment' => $post->get('comment'), 'ip' => $_SERVER['REMOTE_ADDR'], 'browser' => $_SERVER['HTTP_USER_AGENT'], 'order_num' => $post->get('order_num'), 'score' => $post->get('score'));
         $ST->insert('sc_guestbook', $data);
         $this->sendTemplateMail($this->cfg('mail'), 'notice_guestbook', $data);
         $this->noticeICQ($this->cfg('ICQ'), 'Новое сообщение на сайте в разделе ' . $this->mod_name);
     }
     echo printJSON(array('err' => $error));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:22,代码来源:Guestbook.class.php


示例16: actSave

 function actSave()
 {
     global $ST, $post;
     $id = $post->getInt('c_id');
     if (!trim($post->get('c_name'))) {
         echo printJSON(array('err' => 'Введите название'));
         exit;
     }
     $rs = $ST->select("SELECT * FROM sc_content WHERE c_name='" . SQL::slashes($post->get('c_name')) . "' AND c_id<>{$id}");
     if ($rs->next()) {
         echo printJSON(array('err' => 'Содержимое с таким названием СУЩЕСТВУЕТ'));
         exit;
     }
     $data = array('c_name' => $post->get('c_name'), 'c_text' => $post->get('c_text'));
     if ($id) {
         $ST->update('sc_content', $data, 'c_id=' . $id);
     } else {
         $id = $ST->insert('sc_content', $data, 'c_id');
     }
     echo printJSON(array('msg' => 'Сохранено', 'c_id' => $id));
     exit;
 }
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:22,代码来源:Content.class.php


示例17: displaySearchControl

 public function displaySearchControl()
 {
     $this->searchControlBuilder = new PanelSearchControl($this->searchControllerId, $this->tName, $this->searchClauseObj, $this);
     $defaultValue = $this->pSet->getDefaultValue($this->ctrlField);
     $ctrlBlockArr = $this->searchControlBuilder->buildSearchCtrlBlockArr($this->id, $this->ctrlField, 0, '', false, true, $defaultValue, '');
     // build array for encode
     $resArr = array();
     $resArr['control1'] = trim($this->xt->call_func($ctrlBlockArr['searchcontrol']));
     $resArr['control2'] = trim($this->xt->call_func($ctrlBlockArr['searchcontrol1']));
     $resArr['comboHtml'] = trim($ctrlBlockArr['searchtype']);
     $resArr['delButt'] = trim($ctrlBlockArr['delCtrlButt']);
     $resArr['delButtId'] = trim($this->searchControlBuilder->getDelButtonId($this->ctrlField, $this->id));
     $resArr['divInd'] = trim($this->id);
     $resArr['fLabel'] = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($this->ctrlField));
     $resArr['ctrlMap'] = $this->controlsMap['controls'];
     if (postvalue('isNeedSettings') == 'true') {
         $this->fillSettings();
         $resArr['settings'] = $this->jsSettings;
     }
     // return JSON
     echo printJSON($resArr);
     exit;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:23,代码来源:searchpage.php


示例18: showPage

 public function showPage()
 {
     if ($this->eventsObject->exists("BeforeShowChart")) {
         $this->eventsObject->BeforeShowChart($this->xt, $this->templatefile, $this);
     }
     if ($this->mode == CHART_DETAILS || $this->mode == CHART_DASHBOARD || $this->mode == CHART_DASHDETAILS) {
         $this->addControlsJSAndCSS();
         $this->fillSetCntrlMaps();
         $this->xt->unassign("header");
         $this->xt->unassign("footer");
         $this->body["begin"] = "";
         $this->body["end"] = "";
         $this->xt->assign("body", $this->body);
         $bricksExcept = array("chart");
         $this->xt->hideAllBricksExcept($bricksExcept);
         if ($this->show_message_block) {
             $this->xt->assign("message_block", true);
         }
         $this->displayAJAX($this->templatefile, $this->id + 1);
         exit;
     }
     if ($this->mode == CHART_POPUPDETAILS) {
         $bricksExcept = array("grid", "pagination");
         $this->xt->unassign('header');
         $this->xt->unassign('footer');
         $this->body["begin"] = '';
         $this->body["end"] = '';
         $this->xt->hideAllBricksExcept($bricksExcept);
         $this->xt->prepare_template($this->templatefile);
         $respArr = array();
         $respArr['success'] = true;
         $respArr['body'] = $this->xt->fetch_loaded("body");
         $respArr['counter'] = postvalue('counter');
         $this->xt->assign("container_master", false);
         echo printJSON($respArr);
         exit;
     }
     $this->display($this->templatefile);
 }
开发者ID:kcallow,项目名称:MatchMe,代码行数:39,代码来源:chartpage.php


示例19: printJSON

</div>

</td>	
<?php 
/*tr>
<th>Статус</th>
<td>
<?foreach($status as $key=>$desc){?>
	<input type="radio" class="radio" name="state" id="<?=$key?>" value="<?=$key?>" <?=($state == $key)?'checked="checked"':''?>/> <label for="<?=$key?>"><?=$desc?></label><br />
<?}?>
</td>
</tr*/
?>
</table>
<hr/>
		<input type="submit" name="save" class="button save" value="Сохранить"/> 
		<input name="close" type="submit" class="button" value="Закрыть"/>
</form>

<script type="text/javascript">

var IMAGES=<?php 
echo printJSON($data['images']);
?>
;
</script>

<script type="text/javascript" src="/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript" src="/tiny_mce/jquery.tiny.js"></script>
<script type="text/javascript" src="/modules/gallery/admin_gallery_edit.js"></script>
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:30,代码来源:gallery_edit.tpl.php


示例20: iconv

<?php

include 'autocomplete.php';
include '../core/function.php';
if (!empty($_GET['term'])) {
    $term = iconv('utf-8', 'cp1251', $_GET['term']);
    $q = "SELECT DISTINCT value FROM sc_shop_prop_val WHERE value LIKE '{$term}%'";
    if (!empty($_GET['prop'])) {
        $prop = iconv('utf-8', 'cp1251', $_GET['prop']);
        $q = "SELECT DISTINCT v.value FROM sc_shop_prop_val v,sc_shop_prop p WHERE v.prop_id=p.id AND p.name='{$prop}' AND v.value LIKE '{$term}%'";
    }
    $rs = $ST->select($q);
    $out = array();
    while ($rs->next()) {
        $out[] = array('label' => $rs->get('value'));
    }
    echo printJSON($out);
}
开发者ID:AlexanderWhi,项目名称:tplshop2,代码行数:18,代码来源:autocomplete_sh_prop_val.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP printLanguageSelector函数代码示例发布时间:2022-05-15
下一篇:
PHP printInputText函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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