dzadsod/admin/info_on.class.php

262 lines
11 KiB
PHP

<?php
defined('IN_MET') or exit ('No permission');
load::own_class('appadmin');
class info_on extends appadmin
{
//设置参数
protected $addparaurl = '';
public function __construct()
{
global $_M, $_YW;
parent::__construct();
parent::point('info_off', 'doindex');
}
public function __destruct()
{
global $_M, $_YW;
if ($this->destruct) {
if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname;
require $this->show($this->appshow, $this->input);
}
}
//场所
public function dovillage()
{
global $_M, $_YW;
parent::appnav(['table_on__dovillage', '场所资料']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
} else {
//默认值
$this->input['data']['v_province'] = '山东省';
$this->input['data']['v_city'] = '泰安市';
$this->input['data']['v_district'] = '泰山区';
}
//场所分类
$para = $this->tsql->table('para')->where(['p_type' => 6])->all();
parent::para_radio($para, 'v_type', $this->input['data']['v_type'], $this->input['para']['v_type_radio'])
->setparahtml(6, $this->input['para']['v_type_radio']);
// 百度地图
$this->input['mapkey'] = $_YW['c']['mapkey'];
//城市json
$this->input['url']['city'] = $this->cloud->city_url();
}
//企业
public function docustomer()
{
global $_M, $_YW;
parent::appnav(['table_on__docustomer', '企业资料']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
} else {
//默认值
$this->input['data']['c_province'] = '山东省';
$this->input['data']['c_city'] = '泰安市';
$this->input['data']['c_district'] = '泰山区';
}
//城市json
$this->input['url']['city'] = $this->cloud->city_url();
}
//企业
public function doworkers()
{
global $_M, $_YW;
parent::appnav(['table_on__doworkers', '企业资料']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
}
//职务选择
$para = $this->tsql->table('para')->where(['p_type' => 1])->all();
parent::para_radio($para, 'w_jid', $this->input['data']['w_jid'], $this->input['para']['radio'])
->setparahtml(1, $this->input['para']['radio']);
}
//广告位
public function doelevator()
{
global $_M, $_YW;
parent::appnav(['table_on__doelevator', '广告位']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
$this->input['data']['e_number_readonly'] = 'readonly';
// 二次编辑时采用单选
//门口方位
$para = $this->tsql->table('para')->where(['p_type' => 3])->all();
parent::para_radio($para, 'e_bno', $this->input['data']['e_bno'], $this->input['para']['e_bno_radio'])
->setparahtml(3, $this->input['para']['e_bno_radio']);
//广告位置
$para = $this->tsql->table('para')->where(['p_type' => 0])->all();
parent::para_radio($para, 'e_aps', $this->input['data']['e_aps'], $this->input['para']['e_aps_radio'])
->setparahtml(0, $this->input['para']['e_aps_radio']);
} else {
//默认值
$this->input['data']['e_vid'] = $_M['form']['e_vid'];
$this->input['data']['e_enable'] = 1;
// 新增编辑时采用多选
//门口方位
$para = $this->tsql->table('para')->where(['p_type' => 3])->all();
parent::para_checkbox($para, 'e_bno', $this->input['data']['e_bno'], $this->input['para']['e_bno_radio'])
->setparahtml(3, $this->input['para']['e_bno_radio']);
//广告位置
$para = $this->tsql->table('para')->where(['p_type' => 0])->all();
parent::para_checkbox($para, 'e_aps', $this->input['data']['e_aps'], $this->input['para']['e_aps_radio'])
->setparahtml(0, $this->input['para']['e_aps_radio']);
}
//场所名称URL
$this->input['remote_url'] = $_M['url']['own_name'] . 'c=ajax&a=doenumber&id=' . $_M['form']['id'];
}
//录入合同
public function docontract()
{
global $_M, $_YW;
parent::appnav(['table_on__docontract', '合同详情']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
$this->input['data']['h_number_readonly'] = 'readonly';
} else {
//默认值
$this->input['data']['e_vid'] = $_M['form']['e_vid'];
$this->input['data']['h_noticeday'] = 7;
}
$para = $this->tsql->table('para')->where(['p_type' => 4])->all();
parent::para_checkbox($para, 'h_medium', $this->input['data']['h_medium'], $this->input['para']['h_medium_radio'])
->setparahtml(4, $this->input['para']['h_medium_radio']);
$this->input['remote_url'] = $_M['url']['own_name'] . 'c=ajax&a=dohnumber&id=' . $_M['form']['id'];
}
//广告投放
public function dolaunch()
{
global $_M, $_YW;
$slid = $_M['form']['slid'];
parent::appnav(['table_on__dolaunch', '广告投放']);
parent::appurl(parent::tname(), ['slid' => $slid]);
$fzid = $_M['form']['fzid'];
if ($slid) {
// 编辑
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $slid])
->one();
$contract = $this->tsql->table('contract')
->where(['h_number' => $this->input['data']['l_hnumber']])
->one();
} elseif ($fzid) {
// 复制功能
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $fzid])
->one();
$contract = $this->tsql->table('contract')
->where(['h_number' => $this->input['data']['l_hnumber']])
->one();
// 注销掉不需要的属性
unset($this->input['data']['id'], $this->input['data']['l_enumber'], $this->input['data']['l_schedule'], $this->input['data']['l_enable'], $this->input['data']['l_updatetime'], $this->input['data']['l_addtime']);
} else {
//获取合同的值
$contract = $this->tsql->table('contract')
->where(['id' => $_M['form']['cid']])
->one();
//默认值
$this->input['data']['l_hnumber'] = $contract['h_number'];
$this->input['data']['l_starttime'] = $contract['h_starttime'];
$this->input['data']['l_endtime'] = $contract['h_endtime'];
}
//合同订单的时间
$this->input['data']['h_starttime'] = $contract['h_starttime'];
$this->input['data']['h_endtime'] = $contract['h_endtime'];
//获取公司名称
$this->input['data']['h_cid'] = parent::customerlist($contract['h_cid']);
//合同状态
$para = parent::paralist(2);
parent::para_radio($para, 'l_schedule', $this->input['data']['l_schedule'], $this->input['para']['l_schedule_radio'])
->setparahtml(2, $this->input['para']['l_schedule_radio']);
//广告分类
$para = parent::paralist(7);
parent::para_radio($para, 'l_type', $this->input['data']['l_type'], $this->input['para']['l_type_radio'])
->setparahtml(7, $this->input['para']['l_type_radio']);
//表格数据
// ap_plan
$this->input['table'] = load::own_class('table_theme', 'new')->start('applan')->send_all();
$this->input['table']['ajaxurl'] = $_M['url']['own_name'] . "c=table_ajax&a=doindex&tname=applan&slid=" . $slid;
}
//新增巡查人员
public function dokeylist()
{
global $_M, $_YW;
parent::appnav(['table_on__dokeylist', '巡查人员']);
parent::appurl(parent::tname(), ['id' => $_M['form']['id']]);
if ($_M['form']['id']) {
$this->input['data'] = $this->tsql->table($this->tname)
->where(['id' => $_M['form']['id']])
->one();
$this->input['data']['k_passkey'] = base64_decode($this->input['data']['k_basekey']);
} else {
$this->input['data']['k_state'] = 1;
}
}
// 调整广告位投放计划
public function douplaunch()
{
global $_M, $_YW;
parent::appnav(['info_on__douplaunch', '调整投放计划']);
// parent::appnav(['info_on__doelevators','调整投放计划']);
parent::appurl(parent::tname(), ['e_number' => $_M['form']['e_number']]);
// 先获取广告位编号,获取对应的位置信息
// 再获取 前 中 后排期
// 过期的只要最后一期,当前排期的,按照当天计算,然后罗列出预排的排期
// 选择目标排期计划
// 先查询是否满足对应条件
// 满足入库前先删除原有计划,再新增到目标计划(要清除排期缓存表,以及投放计划表,防止冲突)
// 不满足条件,则返回对应提示,是否要强制修改,若是强制修改,可给予修改建议,供管理选择
// 广告位编号,采用下拉选择
// 订单,采用下拉选择
// 投放计划采用下拉选择
}
}
?>