Beispiel #1
0
<?php

include_once "../includes/config.inc.php";
$customer_id = $_WGT['m_customer_id'];
$id = (int) $_REQUEST['id'];
$t = $_REQUEST['t'];
if ($t == 'single') {
    $infocommonModel = new Model_InfoCommon();
    $filter['where'] = " customer_id='{$customer_id}' and id='{$id}' ";
    $sql = $infocommonModel->select($filter, '*');
    $info = $infocommonModel->fetchRow($sql);
    $info['info_intro'] = nl2br($info['info_intro']);
} elseif ($t == 'multi') {
    $infocommondetailModel = new Model_InfoCommonDetail();
    $filter['where'] = " id='{$id}' ";
    $sql = $infocommondetailModel->select($filter, '*');
    $info = $infocommondetailModel->fetchRow($sql);
    $info['info_title'] = $info['title'];
    $info['info_intro'] = nl2br($info['msg_content']);
    $info['pic_showincontent'] = 1;
    $info['info_pic'] = $info['pic'];
}
$customerModel = new Model_Customer();
$filter['where'] = " id='{$customer_id}' ";
$sql = $customerModel->select($filter, 'id,weixin_name');
$customerinfo = $customerModel->fetchRow($sql);
$smarty->assign("customerinfo", $customerinfo);
$smarty->assign("info", $info);
$smarty->assign("today", date("Y-m-d"));
$smarty->setLayout('')->setTpl('/mobile/templates/info.html')->display();
Beispiel #2
0
include_once "../../includes/login_check.php";
$customer_id = (int) $_SESSION['customer_id'];
$Model_InfoCommonDetail = new Model_InfoCommonDetail();
$Model_InfoCommon = new Model_InfoCommon();
$datatwo['title'] = str_inmysql($_POST['title']);
$datatwo['pic'] = str_inmysql($_POST['pic']);
/* $msg = str_replace("\n", "<br/>", $_POST['msg_content']);
$msg = str_replace("\"", "", $msg); */
//$str = htmlspecialchars($_POST['msg_content']);
$datatwo['msg_content'] = str_inmysql($_POST['msg_content']);
$datatwo['url'] = str_inmysql($_POST['url']);
$datatwo['order_num'] = (int) $_POST['order_num'];
if ($_POST['act'] == 'sele' && $_POST['d_id']) {
    $id = (int) $_POST['d_id'];
    $p_id = (int) $_POST['id'];
    $rows = $Model_InfoCommonDetail->fetchRow("select * from info_common_detail where id='{$id}' and info_common_id='{$p_id}'");
    //$rowsstr = str_replace("\n", "", $rows['msg_content']);
    //$rows['msg_content'] = str_replace("\r", "", $rowsstr);
    $res = json_encode($rows);
    header('Content-Type: application/json');
    echo $res;
    die;
}
//The One
if ($_POST['info_type_form'] == 'one') {
    $data['keyword'] = str_inmysql(str_replace(array(';', ','), ',', $_POST['keyword']));
    $data['id'] = (int) $_POST['id'];
    $data['state'] = (int) $_POST['state'];
    $data['customer_id'] = (int) $_SESSION['customer_id'];
    $data['create_date'] = date('Y-m-d H:i:s', $_WGT['TIME']);
    $data['info_type'] = (int) 3;