editMenu($option, 0); break; case "edit": editMenu($option, $cid[0]); break; case "copyconfirm": copyConfirm($option, $cid); break; case "savemenu": saveMenu($option); break; case "deleteconfirm": deleteconfirm($option, $cid); break; case "deletemenu": deleteMenu($option, $cid, $type); break; case "copymenu": copyMenu($option, $cid, $menu_name, $type); break; case "cancel": cancelMenu($option); break; default: showMenu($option); break; } /** * Compiles a list of menumanager items */ function showMenu($option)
if (isset($_POST['validateNewMeal'])) { insertNewMeal($_POST, $connectionObject); } if (isset($_POST['validateNewFlavour'])) { insertNewFlavour($_POST, $connectionObject); } if (isset($_POST['validateNewMenu'])) { insertNewMenu($_POST, $connectionObject); } if (isset($_POST['validateMealDeletion']) && isset($_POST['confirmMealDeletion'])) { deleteMeal($_POST, $connectionObject); } if (isset($_POST['validateFlavourDeletion']) && isset($_POST['confirmFlavourDeletion'])) { deleteFlavour($_POST, $connectionObject); } if (isset($_POST['validateMenuDeletion']) && isset($_POST['confirmMenuDeletion'])) { deleteMenu($_POST, $connectionObject); } include 'administrationLogic/newMealForm.php'; ?> </section> <footer> <?php include "backButton.html"; ?> </footer> </body> </html>
editorderrecall($jum); break; case 'getAllMenu': getAllMenu(); break; case 'newMenu': $jum = json_decode($_GET['data']); newMenu($jum); break; case 'editMenu': $jum = json_decode($_GET['data']); editMenu($jum); break; case 'deleteMenu': $jum = json_decode($_GET['data']); deleteMenu($jum); break; case 'newSettle': $jum = json_decode($_GET['data']); newSettle($jum); break; case 'newBahan': $jum = json_decode($_GET['data']); newBahan($jum); break; case 'getAllBahan': getAllBahan(); break; case 'editBahan': $jum = json_decode($_GET['data']); editBahan($jum);
function text($data) { if ($data['Content'] == '功能演示') { // replyText("这是文本消息处理钩子里设置的文本回复"); } if ($data['Content'] == '微捐赠') { // replyText('weijuanz'); } if ($data['Content'] == 'jssdk' || $data['Content'] == 'demo' || $data['Content'] == '功能演示') { $params['token'] = get_token(); $jump_url = addons_url('Example://Example/demo', $params); replyText('<a href="' . $jump_url . '">功能演示</a>'); } if ($data['Content'] == '获取消息数组') { $revData = getRevData(); replyText('消息数组:' . json_encode($revData)); } if ($data['Content'] == '获取用户ID') { $revFrom = getRevFrom(); replyText('用户id是:' . $revFrom); } if ($data['Content'] == '获取公众号ID') { $revTo = getRevTo(); replyText('公众号id是:' . $revTo); } if ($data['Content'] == '获取消息类型') { $revType = getRevType(); replyText('你发送的消息类型是:' . $revType); } if ($data['Content'] == '获取消息ID') { $revId = getRevId(); replyText('你发送的消息ID是:' . $revId); } if ($data['Content'] == '获取消息发送时间') { $revCtime = getRevCtime(); replyText('你发送的消息发送时间是:' . $revCtime); } if ($data['Content'] == '获取消息内容') { $revContent = getRevContent(); replyText('你发送的消息内容是:' . $revContent); } if ($data['Content'] == '回复文本') { replyText("这是文本回复"); } if ($data['Content'] == '回复单图文') { $articles[0] = array('Title' => '单图文消息标题', 'Description' => '单图文消息描述', 'PicUrl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'Url' => 'http://idouly.com/wenda/'); replyNews($articles); } if ($data['Content'] == '回复多图文') { $articles[0] = array('Title' => '单图文消息标题1', 'Description' => '单图文消息描述1', 'PicUrl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'Url' => 'http://idouly.com/wenda/'); $articles[1] = array('Title' => '单图文消息标题2', 'Description' => '单图文消息描述2', 'PicUrl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'Url' => 'http://idouly.com/wenda/'); $articles[2] = array('Title' => '单图文消息标题3', 'Description' => '单图文消息描述3', 'PicUrl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'Url' => 'http://idouly.com/wenda/'); $articles[3] = array('Title' => '单图文消息标题4', 'Description' => '单图文消息描述4', 'PicUrl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'Url' => 'http://idouly.com/wenda/'); replyNews($articles); } if ($data['Content'] == '回复音乐') { replyMusic('我的歌声里', '曲婉婷', 'http://yinyueshiting.baidu.com/data2/music/5a5631832313a6007da895d12994e311/255967781/255704757248400128.mp3?xcode=67dd7bdbf2d520d5bd5cc648288db746'); } if ($data['Content'] == '转接客服') { transferCustomerService(); } if ($data['Content'] == '获取菜单') { $menu = getMenu(); replyText(json_encode($menu)); } if ($data['Content'] == '删除菜单') { if (deleteMenu()) { replyText('删除菜单成功'); } } if ($data['Content'] == '创建菜单') { $btn1 = array('name' => 'button1', 'type' => 'click', 'key' => 'button1_key'); $data['button'][0] = $btn1; if (createMenu($data)) { replyText('创建菜单成功'); } else { replyText('创建菜单失败'); } } if ($data['Content'] == '发送模板消息') { $temp_data['touser'] = getRevFrom(); $temp_data['template_id'] = 'A93dk7bWn9W4oSvM7UcXm95X-WehNeLeegRq4RaKF8g'; $temp_data['url'] = 'http://idouly.com/wenda/'; $temp_data['topcolor'] = '#44b549'; $temp_data['data']['first']['value'] = '有新的用户捐赠,请注意查收'; $temp_data['data']['first']['color'] = '#da4224'; $temp_data['data']['keyword1']['value'] = '用户捐赠通知'; $temp_data['data']['keyword1']['color'] = '#0baae4'; $temp_data['data']['keyword2']['value'] = '2015年1月7日'; $temp_data['data']['keyword2']['color'] = '#0baae4'; $temp_data['data']['remark']['value'] = '用户昵称:艾逗笔,捐赠额:66元'; $temp_data['data']['remark']['color'] = '#333'; //replyText(json_encode($temp_data)); sendTemplateMessage($temp_data); // replyText(json_encode($temp_data)); exit; } if ($data['Content'] == '发送文本客服消息') { $kf_data['touser'] = getRevFrom(); $kf_data['msgtype'] = 'text'; $kf_data['text']['content'] = '你好啊,亲~'; //replyText(json_encode($kf_data)); sendCustomMessage($kf_data); exit; } if ($data['Content'] == '发送图文客服消息') { $articles[0] = array('title' => '单图文消息标题1', 'description' => '单图文消息描述1', 'picurl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'url' => 'http://idouly.com/wenda/'); $articles[1] = array('title' => '单图文消息标题2', 'description' => '单图文消息描述2', 'picurl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'url' => 'http://idouly.com/wenda/'); $articles[2] = array('title' => '单图文消息标题3', 'description' => '单图文消息描述3', 'picurl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'url' => 'http://idouly.com/wenda/'); $articles[3] = array('title' => '单图文消息标题4', 'description' => '单图文消息描述4', 'picurl' => 'https://mmbiz.qlogo.cn/mmbiz/bcPR8rBzAQhibbpsMEC1WOYIaD1l85XJRWCoricvUnfricBXO9eIuPEJgB2EsucewMYWjE3dLxohzINoxoaD6R6aA/0?wx_fmt=jpeg', 'url' => 'http://idouly.com/wenda/'); $kf_data['touser'] = getRevFrom(); $kf_data['msgtype'] = 'news'; $kf_data['news']['articles'] = $articles; //replyText(json_encode($kf_data)); sendCustomMessage($kf_data); exit; } if ($data['Content'] == '获取二维码') { $qrCode = getQRCode(88, 2); replyText(json_encode($qrCode)); } }
// { // "type":"click", // "name":"赞一下我们", // "key":"MGOOD" // }] // }] //}'; $data = '{ "button":[ { "type":"view", "name":" 首页_测试", "url":"http://cky.ritacc.net/index.php/M" }, { "type":"view", "name":" 外卖 ", "url":"http://cky.ritacc.net/index.php/M/fast/index" } , { "type":"view", "name":"个人中心", "url":"http://cky.ritacc.net/index.php/M/Person/index" }] }'; //echo getMenu(); echo deleteMenu(); echo createMenu($data);
if (isset($_POST['cmd'])) { $cmd = $_POST['cmd']; } } switch ($cmd) { case "add": add($_POST['title'], $_POST['type']); break; case "edit": edit($_GET['mid']); break; case "finishEdit": finishEdit($_POST['mid'], $_POST['edit_menu_title'], $_POST['menu_type']); break; case "delete": deleteMenu($_GET['mid']); break; case "addSpecialMenu": addSpecialMenu($_POST['specialMenuType'], $_POST['specialMenu'], $_POST['specialLabel']); break; case "editSpecialMenu": editSpecialMenu($_GET['id']); break; case "finishEditSpecialMenu": finishEditSpecialMenu($_POST['id'], $_POST['specialMenuType'], $_POST['specialMenu'], $_POST['specialLabel']); break; case "deleteSpecialMenu": deleteSpecialMenu($_GET['id']); break; case "menuWeight": menuWeight($_GET['op'], $_GET['id']);