コード例 #1
0
ファイル: lastsubmit.class.php プロジェクト: h3len/Project
 public function create()
 {
     if (!$this->input['reffer_a']) {
         return;
     }
     $this->db = hg_checkDB();
     $data = array('content' => serialize($this->input), 'module_id' => $this->input['mid'], 'admin_id' => $this->user['id'], 'op' => $this->input['reffer_a'], 'ip' => hg_getip(), 'create_time' => TIMENOW);
     hg_fetch_query_sql($data, 'last_submit_data');
 }
コード例 #2
0
ファイル: log.class.php プロジェクト: h3len/Project
 public function add_log($content, $type = 'login')
 {
     if ($this->settings['App_logs']) {
         $this->add2log($content, $type);
     } else {
         $this->db = hg_checkDB();
         if ($this->input['id']) {
             $ids = '(' . $this->input['id'] . ')';
         }
         $ip = hg_getip();
         $ipaddr = hg_getIpInfo($ip, 5);
         if ($ipaddr) {
             $zone = $ipaddr[0]['zone'];
             $service = $ipaddr[0]['service'];
         }
         $data = array('content' => $content . $ids, 'type' => $type, 'admin_id' => intval($this->user['id']), 'user_name' => $this->user['user_name'], 'group_type' => $this->user['group_type'], 'ip' => $ip, 'ip_info' => $zone . ' ' . $service, 'create_time' => TIMENOW, 'script_name' => SCRIPT_NAME . '::' . REFERRER);
         hg_fetch_query_sql($data, 'log');
     }
 }
コード例 #3
0
ファイル: source_config.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('<font color="red">请填写名称</font>');
     }
     //print_r($this->input['sort']);exit;
     $data = array('name' => $name, 'brief' => $this->input['brief'], 'db_server' => $this->input['db_server'], 'account' => $this->input['account'], 'password' => $this->input['password'], 'db' => $this->input['db'], 'host' => $this->input['host'], 'dir' => $this->input['dir'], 'model_name' => $this->input['model_name'], 'file_name' => $this->input['file_name'], 'function' => $this->input['function'], 'codefmt' => $this->input['codefmt'], 'sort' => $this->input['sort'], 'create_time' => TIMENOW);
     hg_fetch_query_sql($data, 'source_config', 'id=' . $id);
     $this->redirect('更新成功');
 }
コード例 #4
0
ファイル: menu.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     $father_id = intval($this->input['father_id']);
     $module_id = intval($this->input['module_id']);
     if ($father_id && !$module_id) {
         $this->ReportError('请填写关联模块id');
     }
     //对于非顶级模块,要插入模块标识与应用标识
     $mod_uniqueid = '';
     $app_uniqueid = '';
     if ($father_id && $module_id) {
         $sql = "SELECT * FROM " . DB_PREFIX . "modules WHERE id = '" . $module_id . "'";
         $arr = $this->db->query_first($sql);
         $mod_uniqueid = $arr['mod_uniqueid'];
         $app_uniqueid = $arr['app_uniqueid'];
     }
     $data = array('name' => $name, 'module_id' => $this->input['module_id'], 'mod_uniqueid' => $mod_uniqueid, 'app_uniqueid' => $app_uniqueid, 'url' => $this->input['url'], 'close' => $this->input['close'], 'module_id' => $this->input['module_id'], 'order_id' => $this->input['order_id'], 'class' => $this->input['class'], 'father_id' => $this->input['father_id'], 'include_apps' => $this->input['apps'], '`index`' => $this->input['index']);
     hg_fetch_query_sql($data, 'menu', 'id=' . $id);
     $this->cache->recache('menu');
     $this->redirect('更新成功', '?father_id=' . $this->input['father_id'] . '&pp=' . $this->input['pp']);
 }
コード例 #5
0
ファイル: application.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     if (!$this->check_unique(1)) {
         $this->form('标识必须唯一');
     }
     //检测是否添加过
     $data = array('name' => $name, 'softvar' => $this->input['softvar'], 'logo' => $this->input['logo'], 'brief' => $this->input['brief'], 'token' => $this->input['token'], 'dir' => $this->input['dir'], 'father_id' => $this->input['father_id'], 'host' => $this->input['host'], 'order_id' => $this->input['order_id']);
     hg_fetch_query_sql($data, 'applications', 'id=' . $id);
     $this->syn_auth_app($id);
     $this->cache->recache('applications');
     $this->rebuild_program($id);
     $this->redirect('更新成功');
 }
コード例 #6
0
ファイル: server.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     $data = array('name' => $name, 'type' => $this->input['type'], 'brief' => $this->input['brief'], 'ident' => $this->input['ident'], 'n_ip' => $this->input['n_ip'], 'o_ip' => $this->input['o_ip'], 'site_name' => urldecode($this->input['site_name']), 'access_deal' => urldecode($this->input['access_deal']), 'user_name' => urldecode($this->input['user_name']), 'password' => hg_encript_str(urldecode($this->input['password'])), 'token' => urldecode($this->input['token']), 'port' => $this->input['port'], 'state' => $this->input['state'], 'update_time' => TIMENOW);
     //如果密码不填,默认不更新
     if (!$this->input['password']) {
         unset($data['password']);
     }
     $data['link_state'] = $this->ping_server($data);
     hg_fetch_query_sql($data, 'servers', 'id=' . $id);
     //更新添加配置
     $info = $this->input['eid'];
     if (is_array($info) && count($info) > 0) {
         foreach ($info as $k => $v) {
             //编辑时添加新字段
             if (!$v['eid']) {
                 $extend = array('sid' => $id, 'zh_name' => $this->input['zh_name'][$k], 'en_name' => $this->input['en_name'][$k], 'value' => $this->input['value'][$k]);
                 hg_fetch_query_sql($extend, 'servers_extend');
             } else {
                 $extend = array('zh_name' => $this->input['zh_name'][$k], 'en_name' => $this->input['en_name'][$k], 'value' => $this->input['value'][$k]);
                 hg_fetch_query_sql($extend, 'servers_extend', 'eid=' . $v['eid']);
             }
         }
     }
     $this->redirect('更新成功');
 }
コード例 #7
0
ファイル: modules_op.php プロジェクト: h3len/Project
 public function update()
 {
     $id = intval($this->input['id']);
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     $op = $this->db->query_first('SELECT * FROM ' . DB_PREFIX . 'module_op WHERE id=' . $id);
     if (!$op) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $module_id = intval($this->input['module_id']);
     foreach ($this->fields as $field) {
         ${$field} = trim(urldecode($this->input[$field]));
         /*$$field = unserialize($op[$field]);
         		if (!$$field)
         		{
         			$$field = array();
         		}
         		$_field = $$field;
         		if ($this->input[$field])
         		{
         			$_field[$module_id] = $this->input[$field];
         		}
         		else
         		{
         			unset($_field[$module_id]);
         		}
         		if ($_field)
         		{
         			$$field = serialize($_field);
         		}
         		else
         		{
         			$$field = '';
         		}*/
     }
     /*$ban = unserialize($op['ban']); //禁用某操作以窜行化数组纪录
     		$isban = intval($this->input['ban']);
     		if ($isban)
     		{
     			$ban[$module_id] = $module_id;
     		}
     		else
     		{
     			unset($ban[$module_id]);
     		}
     		$is_global = intval($this->input['is_global']);
     		if ($is_global)
     		{
     			$module_id = 0;
     		}
     		$ban = serialize($ban);//禁用某操作以窜行化数组纪录
     		*/
     //检测是否添加过
     $data = array('name' => $name, 'module_id' => $module_id, 'op' => $this->input['op'], 'brief' => $this->input['brief'], 'host' => $this->input['host'], 'dir' => $this->input['dir'], 'file_name' => $file_name, 'func_name' => $this->input['func_name'], 'template' => $template, 'has_batch' => $this->input['has_batch'], 'need_confirm' => $this->input['need_confirm'], 'callback' => $callback, 'request_type' => $request_type, 'direct_return' => $direct_return, 'group_op' => $this->input['group_op'], 'trigger_pub' => $trigger_pub, 'show_pub' => $show_pub, 'is_show' => $this->input['is_show'], 'ban' => intval($this->input['ban']), 'order_id' => $this->input['order_id']);
     hg_fetch_query_sql($data, 'module_op', 'id=' . $id);
     include ROOT_PATH . 'lib/class/program.class.php';
     $program = new program();
     $id = $program->compile($module_id, $data['op']);
     $this->redirect('更新成功');
 }
コード例 #8
0
ファイル: node.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('<font color="red">请填写名称</font>');
     }
     $module_id = trim($this->input['module_id']);
     if (!$module_id) {
         $this->form('<font color="red">请填写该节点关联的模块id</font>');
     }
     $application_id = intval($this->input['application_id']);
     //检测是否添加过
     $data = array('name' => $name, 'brief' => $this->input['brief'], 'application_id' => $application_id, 'file_name' => $this->input['file_name'], 'func_name' => $this->input['func_name'], 'template' => $this->input['template'], 'host' => $this->input['host'], 'dir' => $this->input['dir'], 'token' => $this->input['token'], 'return_var' => $this->input['return_var'], 'order_id' => $this->input['order_id']);
     hg_fetch_query_sql($data, 'node', 'id=' . $id);
     //根据关联模块id查出模块标识
     $sql = "SELECT * FROM " . DB_PREFIX . "modules WHERE id = '" . $module_id . "'";
     $arr = $this->db->query_first($sql);
     $mod_uniqueid = '';
     if ($arr['id']) {
         $mod_uniqueid = $arr['mod_uniqueid'];
     }
     $module_node_data = array('module_id' => $module_id, 'mod_uniqueid' => $mod_uniqueid, 'node_id' => $id);
     hg_fetch_query_sql($module_node_data, 'module_node', 'node_id=' . $id);
     include_once ROOT_PATH . 'lib/class/node.class.php';
     $program = new nodeapi();
     $program->compile($id);
     $this->redirect('更新成功');
 }
コード例 #9
0
ファイル: settings.php プロジェクト: h3len/Project
    public function show()
    {
        $app = $this->app;
        $curl = new curl($app['host'], $app['dir']);
        $curl->setSubmitType('post');
        $curl->setReturnFormat('json');
        $curl->initPostData();
        $curl->addRequestData('a', 'setting_group');
        $setting_groups = $curl->request('configuare.php');
        $setting_groups = $setting_groups[0];
        $curl->initPostData();
        $curl->addRequestData('a', 'settings');
        $settings = $curl->request('configuare.php');
        $sql = 'SELECT * FROM ' . DB_PREFIX . "crontab WHERE app_uniqueid='{$this->app['softvar']}'";
        $q = $this->db->query($sql);
        $crontabs = array();
        $exist_crontabs = array();
        while ($r = $this->db->fetch_array($q)) {
            $r['run_time'] = date('Y-m-d H:i:s', $r['run_time']);
            if ($r['is_use']) {
                $r['is_use'] = '是';
                $r['op'] = '停止';
            } else {
                $r['is_use'] = '否';
                $r['op'] = '启用';
            }
            $exist_crontabs[$r['mod_uniqueid']] = $r['id'];
            $crontabs[$r['id']] = $r;
        }
        $curl->initPostData();
        $curl->addRequestData('a', 'get_cron_file');
        $init_crontabs = $curl->request('configuare.php');
        $used_crontables = array();
        if ($init_crontabs) {
            $testcurl = new curl($app['host'], $app['dir'] . 'cron/');
            $testcurl->mNotInitedNeedExit = false;
            $testcurl->setErrorReturn(false);
            foreach ($init_crontabs as $cron) {
                $testcurl->initPostData();
                $testcurl->addRequestData('a', 'initcron');
                $crondata = $testcurl->request($cron);
                if (!is_array($crondata)) {
                    continue;
                }
                $crondata = $crondata[0];
                if (!$crondata['mod_uniqueid']) {
                    continue;
                }
                if ($exist_crontabs[$crondata['mod_uniqueid']]) {
                    //计划任务数据有变动
                    $data = array('name' => $crondata['name'], 'brief' => $crondata['brief'], 'file_name' => $cron);
                    hg_fetch_query_sql($data, 'crontab', 'id=' . $exist_crontabs[$crondata['mod_uniqueid']]);
                    $crontabs[$exist_crontabs[$crondata['mod_uniqueid']]]['file_name'] = $cron;
                    $crontabs[$exist_crontabs[$crondata['mod_uniqueid']]]['name'] = $data['name'];
                    $crontabs[$exist_crontabs[$crondata['mod_uniqueid']]]['brief'] = $data['brief'];
                    unset($exist_crontabs[$crondata['mod_uniqueid']]);
                } else {
                    //新增计划任务
                    $data = array('app_uniqueid' => $this->app['softvar'], 'mod_uniqueid' => $crondata['mod_uniqueid'], 'name' => $crondata['name'], 'brief' => $crondata['brief'], 'space' => $crondata['space'], 'file_name' => $cron, 'is_use' => $crondata['is_use'], 'host' => $this->app['host'], 'dir' => $this->app['dir'] . 'cron/', 'port' => 80, 'run_time' => TIMENOW, 'create_time' => TIMENOW);
                    hg_fetch_query_sql($data, 'crontab');
                    $data['id'] = $this->db->insert_id();
                    $data['run_time'] = date('Y-m-d H:i:s', $data['run_time']);
                    if ($data['is_use']) {
                        $data['is_use'] = '是';
                        $data['op'] = '停止';
                    } else {
                        $data['is_use'] = '否';
                        $data['op'] = '启用';
                    }
                    $crontabs[$data['id']] = $data;
                }
            }
            //清除已经取消的计划任务
            if ($exist_crontabs) {
                $sql = 'DELETE FROM ' . DB_PREFIX . 'crontab WHERE id IN(' . implode(',', $exist_crontabs) . ')';
                $this->db->query($sql);
                foreach ($exist_crontabs as $id) {
                    unset($crontabs[$id]);
                }
            }
        } else {
            //该应用无计划任务
            $sql = 'DELETE FROM ' . DB_PREFIX . "crontab WHERE app_uniqueid='{$this->app['softvar']}'";
            $this->db->query($sql);
            $crontabs = array();
        }
        if ($crontabs) {
            $setting_groups['cron'] = '计划任务';
        }
        /**************获取水印设置***************/
        if ($app['app_uniqueid'] != 'material' && !empty($this->settings['App_material'])) {
            $curl = new curl($this->settings['App_material']['host'], $this->settings['App_material']['dir']);
            $curl->setSubmitType('post');
            $curl->setReturnFormat('json');
            $curl->initPostData();
            $curl->setErrorReturn('');
            $curl->addRequestData('app_uniqueid', $app['app_uniqueid']);
            $curl->addRequestData('a', 'fetchWatermarkSet');
            $watermark = $curl->request('admin/material_update.php');
            isset($watermark[0]) && ($watermark = $watermark[0]);
        }
        /**************获取水印设置***************/
        if (DEVELOP_MODE) {
            $s = '<ul class="form_ul">
					<li class="i">
						<div class="form_ul_div">
							<span  class="title">&nbsp;&nbsp;&nbsp;测试配置1:</span>
							<input type="text" value="{$settings[\'define\'][\'DB_PREFIX\']}" name=\'define[DB_PREFIX]\' style="width:200px;">
							<font class="important" style="color:red"></font>
						</div>
					</li>
					<li class="i">
						<div class="form_ul_div">
							<span  class="title">&nbsp;&nbsp;&nbsp;测试配置2:</span>
							<input type="text" value="{$settings[\'base\'][\'testset\'][\'host\']}" name=\'base[testset][host]\' style="width:200px;">
							
							<font class="important" style="color:red"></font>
						</div>
					</li>
					<li class="i">
						<div class="form_ul_div">
							<span  class="title">&nbsp;&nbsp;&nbsp;测试配置21:</span>			
							{template:form/radio,base[testset][open],$settings[\'base\'][\'testset\'][\'open\'],$option}
							<font class="important" style="color:red"></font>
						</div>
					</li>
					<li class="i">
						<div class="form_ul_div">
							<span  class="title">&nbsp;&nbsp;&nbsp;测试配置3:</span>
							<input type="text" value="{$settings[\'base\'][\'testsetad\']}" name=\'base[testsetad]\' style="width:200px;">
							
							<font class="important" style="color:red"></font>
						</div>
					</li>
					<li class="i">
						<div class="form_ul_div">
							<span  class="title">&nbsp;&nbsp;&nbsp;测试配置4:</span>
							<input type="text" value="{$settings[\'base\'][\'article_status\'][1]}" name=\'base[article_status][1]\' style="width:200px;">
							<input type="text" value="{$settings[\'base\'][\'article_status\'][2]}" name=\'base[article_status][2]\' style="width:200px;">
							<input type="text" value="{$settings[\'base\'][\'article_status\'][3]}" name=\'base[article_status][3]\' style="width:200px;">
							<input type="text" value="{$settings[\'base\'][\'article_status\'][4]}" name=\'base[article_status][4]\' style="width:200px;">
							
							<font class="important" style="color:red"></font>
						</div>
					</li>
				</ul>';
            $example = nl2br(htmlspecialchars($s));
            $this->tpl->addVar('example', $example);
            $this->tpl->setScriptDir();
            $this->tpl->setTemplateVersion();
        } else {
            $this->tpl->setScriptDir('app_' . $app['softvar'] . '/');
            $this->tpl->setTemplateVersion($app['softvar'] . '/' . $app['version']);
        }
        $this->tpl->setSoftVar($app['softvar']);
        //设置软件界面
        $this->tpl->addVar('setting_groups', $setting_groups);
        $this->tpl->addVar('crontabs', $crontabs);
        $this->tpl->addVar('settings', $settings);
        $this->tpl->addVar('firstvisit', $this->input['mid']);
        $this->tpl->addVar('app_uniqueid', $this->app['softvar']);
        $this->tpl->addVar('watermark', $watermark);
        $this->tpl->outTemplate('settings');
    }
コード例 #10
0
ファイル: modules.php プロジェクト: h3len/Project
 public function saveStorage()
 {
     $id = intval($this->input['id']);
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $bundle_id = explode(',', urldecode($this->input['bundle_id']));
     $design_name = explode(',', urldecode($this->input['name']));
     $design_desc = explode(',', urldecode($this->input['desciption']));
     $type_length = explode(',', urldecode($this->input['type_length']));
     $data_source = explode(',', urldecode($this->input['data_source']));
     $data_type = explode(',', urldecode($this->input['data_type']));
     $is_primary = explode(',', urldecode($this->input['is_primary']));
     $is_index = explode(',', urldecode($this->input['is_index']));
     /*************************更新app_design开始*******************************************/
     //先把原来的全部删除掉
     $sql = "DELETE FROM " . DB_PREFIX . "app_design WHERE mid = '" . $id . "'";
     $this->db->query($sql);
     //插入新的app_design数据
     for ($i = 0; $i < count($design_name); $i++) {
         foreach ($this->settings['data_type'] as $k => $v) {
             if ($v == $data_type[$i]) {
                 $d_type = intval($k);
             }
         }
         foreach ($this->settings['data_source'] as $k => $v) {
             if ($v == $data_source[$i]) {
                 $d_src = intval($k);
             }
         }
         $data_design = array();
         $data_design = array('mid' => $id, 'name' => $design_name[$i], 'bundle_id' => $bundle_id[$i], 'desciption' => $design_desc[$i], 'type_length' => $type_length[$i], 'data_source' => $d_src, 'data_type' => $d_type, 'is_index' => intval($is_index[$i]), 'is_primary' => intval($is_primary[$i]), 'is_edit' => 1);
         hg_fetch_query_sql($data_design, 'app_design');
     }
     /*************************更新app_design结束*******************************************/
     $this->redirect('保存成功');
 }
コード例 #11
0
ファイル: cloud_site.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     $data = array('name' => $name, 'custom_appkey' => trim(urldecode($this->input['custom_appkey'])), 'appid' => intval($this->input['appid']), 'appkey' => trim(urldecode($this->input['appkey'])), 'username' => trim(urldecode($this->input['username'])), 'pwd' => hg_encript_str(trim(urldecode($this->input['pwd'])), true, trim($this->input['custom_appkey'])), 'localusername' => trim(urldecode($this->input['localusername'])), 'localuserpwd' => hg_encript_str(trim(urldecode($this->input['localuserpwd']))), 'authapi' => trim(urldecode($this->input['authapi'])), 'is_close' => intval($this->input['is_close']));
     hg_fetch_query_sql($data, 'cloud_site', 'id=' . $id);
     $this->cache->recache('cloud_site');
     $this->redirect('更新成功', '?pp');
 }
コード例 #12
0
ファイル: ui.base.php プロジェクト: h3len/Project
 protected function record_search()
 {
     $hash = $this->input['search_hash'];
     if ($this->input['hg_search']) {
         $this->db = hg_checkDB();
         unset($this->input['search_hash']);
         $search = serialize($this->input);
         $hash = md5($search . SCRIPT_NAME);
         $data = array('hash' => $hash, 'search' => $search, 'update_time' => TIMENOW);
         $sql = 'SELECT * FROM ' . DB_PREFIX . 'search WHERE hash=\'' . $hash . "'";
         $search = $this->db->query_first($sql);
         if ($search) {
             $searchs = unserialize($search['search']);
             $conditicon = "hash='{$hash}'";
         } else {
             $searchs = $this->input;
         }
         hg_fetch_query_sql($data, 'search', $conditicon);
         $sql = 'DELETE FROM ' . DB_PREFIX . 'search WHERE update_time < ' . (TIMENOW - 3600);
         //1小时前的搜索清理
         $this->db->query($sql);
     }
     if ($hash && !$searchs) {
         $this->db = hg_checkDB();
         $sql = 'SELECT hash,search FROM ' . DB_PREFIX . 'search WHERE hash=\'' . $hash . "'";
         $search = $this->db->query_first($sql);
         $searchs = unserialize($search['search']);
     }
     if ($searchs) {
         $this->input['search_hash'] = $hash;
         $this->input = $searchs + $this->input;
     }
 }
コード例 #13
0
ファイル: update.php プロジェクト: h3len/Project
 public function show()
 {
     if ($this->bus_line_exists()) {
         $this->errorOutput('bus数据已更新');
     }
     $lines = $this->get_lines();
     $city = array('id' => 1, 'name' => '无锡');
     foreach ($lines as $k => $v) {
         $line = $this->get_singleline_bus($v['ROUTEID']);
         if (!$line['SEGMENTID']) {
             $seg = array();
             foreach ($line as $kk => $vv) {
                 $seg['id'][] = $vv['SEGMENTID'];
                 $seg['name'][] = $vv['SEGMENTNAME'];
             }
             $segmentid = implode(',', $seg['id']);
             $segmentname = implode(',', $seg['name']);
         } else {
             $segmentid = $line['SEGMENTID'];
             $segmentname = $line['SEGMENTNAME'];
         }
         $line8684 = $this->get_singleline_8684($v['ROUTENAME'], $city['name']);
         $line8684data = $line8684[0];
         $data = array('city_id' => $city['id'], 'city_name' => $city['name'], 'name' => $v['ROUTENAME'], 'brief' => '', 'time' => $line8684data['time'], 'price' => $line8684data['price'], 'gjgs' => $line8684data['gjgs'], 'kind' => $line8684data['kind'], 'routeid' => $v['ROUTEID'], 'segmentid' => $segmentid, 'segmentname' => $segmentname, 'stands' => json_encode($line8684['stations']));
         hg_fetch_query_sql($data, 'line');
         //exit;
     }
     $this->output(array('done'));
 }
コード例 #14
0
ファイル: appstore_install.php プロジェクト: h3len/Project
            if (!is_array($crondata)) {
                continue;
            }
            $crondata = $crondata[0];
            if (!$crondata['mod_uniqueid']) {
                continue;
            }
            if ($exist_crontabs[$crondata['mod_uniqueid']]) {
                //计划任务数据有变动
                $data = array('name' => $crondata['name'], 'brief' => $crondata['brief'], 'file_name' => $cron);
                hg_fetch_query_sql($data, 'crontab', 'id=' . $exist_crontabs[$crondata['mod_uniqueid']]);
                unset($exist_crontabs[$crondata['mod_uniqueid']]);
            } else {
                //新增计划任务
                $data = array('app_uniqueid' => $this->app['softvar'], 'mod_uniqueid' => $crondata['mod_uniqueid'], 'name' => $crondata['name'], 'brief' => $crondata['brief'], 'space' => $crondata['space'], 'file_name' => $cron, 'is_use' => $crondata['is_use'], 'host' => $this->app['host'], 'dir' => $this->app['dir'] . 'cron/', 'port' => 80, 'run_time' => TIMENOW, 'create_time' => TIMENOW);
                hg_fetch_query_sql($data, 'crontab');
            }
        }
        //清除已经取消的计划任务
        if ($exist_crontabs) {
            $sql = 'DELETE FROM ' . DB_PREFIX . 'crontab WHERE id IN(' . implode(',', $exist_crontabs) . ')';
            $this->db->query($sql);
        }
    } else {
        //该应用无计划任务
        $sql = 'DELETE FROM ' . DB_PREFIX . "crontab WHERE app_uniqueid='{$this->app['softvar']}'";
        $this->db->query($sql);
    }
    $selfconfigcontent = preg_replace("/define\\('INITED_APP',\\s*.*?\\s*\\);/is", "define('INITED_APP', true);", $selfconfigcontent);
}
$conf = $app_dir . 'conf/global.conf.php';
コード例 #15
0
ファイル: cloud_manage.php プロジェクト: h3len/Project
 public function update()
 {
     $id = $this->input['cloud_id'];
     if (!$id) {
         $this->ReportError('指定记录不存在或已删除!');
     }
     $name = trim($this->input['cloud_name']);
     if (!$name) {
         $this->form('请填写名称');
     }
     $module_id = intval($this->input['module_id']);
     if (!$module_id) {
         $this->ReportError('请填写关联模块id');
     }
     $site_id = intval($this->input['site_id']);
     if (!$site_id) {
         $this->ReportError('请重新选择对应客户!');
     }
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'cloud_site WHERE id=' . $site_id;
     $f = $this->db->query_first($sql);
     if (!$f) {
         $this->ReportError('此客户信息不存在或被删除!');
     }
     //检测是否添加过
     $data = array('cloud_name' => $name, 'site_id' => $site_id, 'module_id' => $module_id, 'remote_host' => trim(urldecode($this->input['remote_host'])), 'remote_dir' => trim(urldecode($this->input['remote_dir'])), 'remote_file' => trim(urldecode($this->input['remote_file'])), 'remote_update_file' => trim(urldecode($this->input['remote_update_file'])), 'remote_node_file' => trim(urldecode($this->input['remote_node_file'])), 'appid' => intval($this->input['appid']) ? intval($this->input['appid']) : $f['appid'], 'appkey' => trim(urldecode($this->input['appkey'])) ? trim(urldecode($this->input['appkey'])) : $f['appkey'], 'username' => trim(urldecode($this->input['username'])) ? trim(urldecode($this->input['username'])) : $f['username'], 'pwd' => trim(urldecode($this->input['pwd'])) ? hg_encript_str(trim($this->input['pwd']), true, $f['custom_appkey']) : $f['pwd'], 'authapi' => trim(urldecode($this->input['authapi'])) ? trim(urldecode($this->input['authapi'])) : $f['authapi'], 'localusername' => trim(urldecode($this->input['localusername'])) ? trim(urldecode($this->input['localusername'])) : $f['localusername'], 'localuserpwd' => trim($this->input['localuserpwd']) ? hg_encript_str(trim($this->input['localuserpwd'])) : $f['localuserpwd'], 'is_close' => intval($this->input['is_close']));
     hg_fetch_query_sql($data, 'cloud', 'cloud_id=' . $id);
     $this->cache->recache('cloud_manage');
     $this->redirect('更新成功', '?id=' . $site_id);
 }