function run_on_course_page_view($courseid, $page, $userid) { global $USER; $this->log->debug("RUN ON COURSE PAGE VIEW FOR PROJECT PROTOTYPE:" . $courseid); $groupid = getGroupID($USER->id, $courseid); ///Creating customized event here $eventclass = '\\local_morph\\event\\project_course_page_viewed'; // $cm = get_coursemodule_from_instance('chat', $chatuser->chatid, $chatuser->course); $params = array('context' => context_course::instance($courseid), 'objectid' => $courseid, 'relateduserid' => $userid, 'other' => array()); $config = get_config('project'); $this->log->debug(" CONFIG:" . json_encode($config)); $projectconfig = json_decode(json_encode($config), true); // $projectconfig=get_object_wars($config); $this->log->debug("PROJECT CONFIG:" . json_encode($projectconfig)); $this->log->debug("SENDING NEW CHAT EVENT:" . json_encode($params)); $event = $eventclass::create($params); //$event->add_morph_record_snapshot('chat_messages', $message); // $event->add_morph_other_data('messagelength',strlen($message->message)); $groupid = getGroupID($USER->id, $courseid); $event->add_morph_other_data('config', $projectconfig); $event->add_morph_other_data('groupid', $groupid); $event->trigger(); ///Finished triggering new event // checkAlerts($USER->id, getGroupID($USER->id, $courseid)); // $this->log->debug("FINISHED CHECKING ALERTS IN PROJECT:".$courseid); }
if ($adddefault_i) { $id_block_content[] = $bid_i; } } $catid = $nv_Request->get_int('catid', 'get', 0); $rowcontent = array('id' => 0, 'listcatid' => $catid, 'user_id' => $admin_info['admin_id'], 'addtime' => NV_CURRENTTIME, 'edittime' => NV_CURRENTTIME, 'status' => 0, 'publtime' => NV_CURRENTTIME, 'exptime' => 0, 'archive' => 1, 'product_code' => '', 'product_number' => 1, 'product_price' => 1, 'discount_id' => 0, 'money_unit' => $pro_config['money_unit'], 'product_unit' => '', 'product_weight' => '', 'weight_unit' => $pro_config['weight_unit'], 'homeimgfile' => '', 'homeimgthumb' => '', 'homeimgalt' => '', 'imgposition' => 0, 'copyright' => 0, 'inhome' => 1, 'allowed_comm' => $module_config[$module_name]['setcomm'], 'allowed_rating' => 1, 'ratingdetail' => '0', 'allowed_send' => 1, 'allowed_print' => 1, 'allowed_save' => 1, 'hitstotal' => 0, 'hitscm' => 0, 'hitslm' => 0, 'showprice' => 1, 'com_id' => 0, 'title' => '', 'alias' => '', 'hometext' => '', 'bodytext' => '', 'note' => '', 'keywords' => '', 'keywords_old' => '', 'files' => array(), 'files_old' => array(), 'gift_content' => '', 'gift_from' => NV_CURRENTTIME, 'gift_to' => 0); $page_title = $lang_module['content_add']; $error = ''; $groups_list = nv_groups_list(); $is_copy = $nv_Request->isset_request('copy', 'get'); $rowcontent['id'] = $nv_Request->get_int('id', 'get,post', 0); $group_id_old = array(); if ($rowcontent['id'] > 0) { $rowcontent['listcatid'] = $db->query("SELECT listcatid FROM " . $db_config['prefix'] . "_" . $module_data . "_rows where id=" . $rowcontent['id'])->fetchColumn(); // Old group $group_id_old = getGroupID($rowcontent['id']); // Old keywords $array_keywords_old = array(); $_query = $db->query('SELECT tid, keyword FROM ' . $db_config['prefix'] . '_' . $module_data . '_tags_id_' . NV_LANG_DATA . ' WHERE id=' . $rowcontent['id'] . ' ORDER BY keyword ASC'); while ($row = $_query->fetch()) { $array_keywords_old[$row['tid']] = $row['keyword']; } $rowcontent['keywords'] = implode(', ', $array_keywords_old); $rowcontent['keywords_old'] = $rowcontent['keywords']; // Old files $result = $db->query("SELECT id_files FROM " . $db_config['prefix'] . "_" . $module_data . "_files_rows WHERE id_rows=" . $rowcontent['id']); if ($result->rowCount() > 0) { while (list($id_files) = $result->fetch(3)) { $rowcontent['files'][] = $id_files; } $rowcontent['files_old'] = $rowcontent['files'];
function allmember_note() { global $reprating, $adminid, $timestamp; $ispost = MooGetGPC('ispost', 'integer', 'P'); if ($ispost) { $uid = MooGetGPC('uid', 'integer', 'P'); $grade = MooGetGPC('grade', 'integer', 'P'); $contact = MooGetGPC('contact', 'integer', 'P'); $master = MooGetGPC('master', 'integer', 'P'); $time = strtotime(MooGetGPC('time', 'string', 'P')); $interest = MooGetGPC('interest', 'string', 'P'); $different = MooGetGPC('different', 'string', 'P'); $service = MooGetGPC('service', 'string', 'P'); $desc = MooGetGPC('desc', 'string', 'P'); $comment = MooGetGPC('comment', 'string', 'P'); $phonecall = MooGetGPC('phonecall', 'integer', 'P'); //note 手机是否验证原因 $checkreason = MooGetGPC('checkreason', 'integer', 'P'); //note 手机号码 $telphone = MooGetGPC('telphone', 'string', 'P'); $dateline = time(); //采集使用 $usertype = MooGetGPC('usertype', 'string', 'P'); //如果客服已经给全权会员做了小记,那么这个会员就处于使用状态 if ($usertype == 3) { $action_time = $GLOBALS['_MooClass']['MooMySQL']->getOne('SELECT `action_time` FROM `web_full_log` WHERE `uid`=\'' . $uid . '\'', true); if (empty($action_time)) { $GLOBALS['_MooClass']['MooMySQL']->query('INSERT INTO `web_full_log` (`uid`, `action_time`) VALUES (\'' . $uid . '\', \'' . $dateline . '\')'); } } $sql = "INSERT INTO {$GLOBALS['dbTablePre']}member_backinfo(mid,manager,uid,effect_grade,effect_contact,master_member,next_contact_time,interest,different,service_intro,next_contact_desc,comment,dateline,phonecall)\n\t\t\t\tVALUES({$GLOBALS['adminid']},'{$GLOBALS['username']}',{$uid},{$grade},{$contact},{$master},'{$time}','{$interest}','{$different}','{$service}','{$desc}','{$comment}','{$dateline}','{$phonecall}')"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); // $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'"; // original file $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'"; // updated file $member_admininfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (!empty($member_admininfo)) { $dateline = time(); $sql = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET effect_grade='{$grade}',effect_contact='{$contact}',master_member='{$master}',next_contact_time='{$time}',dateline='{$dateline}',checkreason='{$checkreason}' WHERE uid='{$uid}'"; } else { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo(uid,effect_grade,effect_contact,master_member,next_contact_time,dateline,checkreason)\n\t\t\t\tVALUES('{$uid}','{$grade}','{$contact}','{$master}','{$time}','{$dateline}','{$checkreason}')"; } $GLOBALS['_MooClass']['MooMySQL']->query($sql); //NOTE 3,4,5类会员保存小记后台提醒客服组长 $gid = getGroupID($adminid); $wokao = $grade - 1; if (in_array($wokao, array('3', '4', '5'))) { $title = '会员' . $uid . '转为 ' . $wokao . '类'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$GLOBALS['dbTablePre']}admin_remark set sid='{$gid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql_remark); } //发送短信评价 /* if($phonecall=='1'){ if($telphone!='0'){ $arrtxt = implode(" ",$reprating); $mes = "回复数字对专属红娘进行评价:".$arrtxt." 。谢谢!回复免费。【真爱一生网】"; $ret = SendMsg($telphone,$mes); if($ret!==false){ $sql = "INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$mes}','{$dateline}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); }else{ $sql = "INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','短信发送失败','{$dateline}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); } } } */ // 会员跟踪步骤 mycount 统计 try { $m = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT b.source as source FROM web_members_search s left join web_members_base b on s.uid=b.uid where s.uid='{$uid}' ", true); // 只统计有渠道的 $source = trim($m['source']); if (!empty($source)) { $str_md5 = md5($uid . ($grade - 1) . MOOPHP_AUTHKEY); $apiurl = "http://tg.zhenaiyisheng.cc/hongniang/hongniang_effect_grade_import.php?uid=" . $uid . "&md5=" . $str_md5 . "&grade=" . ($grade - 1); $result = file_get_contents($apiurl); } } catch (Exception $ex) { } //note //添加操作日志 //serverlog(4,$GLOBALS['dbTablePre']."members_backinfo","{$GLOBALS['username']}保存用户{$uid}的小记",$GLOBALS['adminid'],$uid); salert("小记保存成功!", "index.php?action=allmember&h=view_info&uid={$uid}"); } }
<?php require_once '../init.php'; $groupsPopulated = $mdb->findField('storage', 'contents', ['locker' => 'groupsPopulated']); if ($groupsPopulated === true && date('H') % 12 != 0 && date('i') != 25) { exit; } $groups = CrestTools::getJSON('https://public-crest.eveonline.com/inventory/groups/'); $newGroups = 0; $newItems = 0; do { foreach ($groups['items'] as $group) { $href = $group['href']; $groupID = (int) getGroupID($href); $name = $group['name']; $exists = $mdb->count('information', ['type' => 'groupID', 'id' => $groupID]); if ($exists == 0) { ++$newGroups; } $mdb->insertUpdate('information', ['type' => 'groupID', 'id' => $groupID], ['name' => $name, 'lastCrestUpdate' => $mdb->now(-86400)]); $types = CrestTools::getJSON($href); if (@$types['types'] != null) { foreach ($types['types'] as $type) { $typeID = (int) getTypeID($type['href']); $name = $type['name']; $exists = $mdb->count('information', ['type' => 'typeID', 'id' => $typeID]); if ($exists > 0) { continue; } Util::out("Discovered item: {$name}"); ++$newItems;
echo html_writer::start_tag('form', array('action' => '.', 'method' => 'get')); echo html_writer::start_tag('div'); echo html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'completion_dynamic_change', 'name' => 'completion_dynamic_change', 'value' => '0')); echo html_writer::end_tag('div'); echo html_writer::end_tag('form'); } // Course wrapper start. echo html_writer::start_tag('div', array('class' => 'course-content')); // make sure that section 0 exists (this function will create one if it is missing) course_create_sections_if_missing($course, 0); // get information about course modules and existing module types // format.php in course formats may rely on presence of these variables $modinfo = get_fast_modinfo($course); $modnames = get_module_types_names(); $modnamesplural = get_module_types_names(true); $modnamesused = $modinfo->get_used_module_names(); $mods = $modinfo->get_cms(); $sections = $modinfo->get_section_info_all(); // CAUTION, hacky fundamental variable defintion to follow! // Note that because of the way course fromats are constructed though // inclusion we pass parameters around this way.. $displaysection = $section; // Include the actual course format. require $CFG->dirroot . '/course/format/' . $course->format . '/format.php'; // Content wrapper end. echo html_writer::end_tag('div'); // Include course AJAX include_course_ajax($course, $modnamesused); echo $OUTPUT->footer(); echo $OUTPUT->box(checkAlerts($USER->id, getGroupID($USER->id)));
function saveNotes() { global $reprating, $adminid, $timestamp; $uid = MooGetGPC('uid', 'integer', 'P'); $grade = MooGetGPC('grade', 'integer', 'P'); $contact = MooGetGPC('contact', 'integer', 'P'); $master = MooGetGPC('master', 'integer', 'P'); $time = strtotime(MooGetGPC('time', 'string', 'P')); $interest = MooGetGPC('interest', 'string', 'P'); $different = MooGetGPC('different', 'string', 'P'); $service = MooGetGPC('service', 'string', 'P'); $desc = MooGetGPC('desc', 'string', 'P'); $comment = MooGetGPC('comment', 'string', 'P'); $phonecall = MooGetGPC('phonecall', 'integer', 'P'); //note 手机是否验证原因 $checkreason = MooGetGPC('checkreason', 'integer', 'P'); //note 手机号码 $telphone = MooGetGPC('telphone', 'string', 'P'); //采集使用 $usertype = MooGetGPC('usertype', 'string', 'P'); //如果客服已经给全权会员做了小记,那么这个会员就处于使用状态 if ($usertype == 3) { $action_time = $GLOBALS['_MooClass']['MooMySQL']->getOne('SELECT `action_time` FROM `web_full_log` WHERE `uid`=\'' . $uid . '\'', true); if (empty($action_time)) { $GLOBALS['_MooClass']['MooMySQL']->query('INSERT INTO `web_full_log` (`uid`, `action_time`) VALUES (\'' . $uid . '\', \'' . $timestamp . '\')'); } } $sql = "INSERT INTO {$GLOBALS['dbTablePre']}member_backinfo(mid,manager,uid,effect_grade,effect_contact,master_member,next_contact_time,interest,different,service_intro,next_contact_desc,comment,dateline,phonecall)\n\t\t\tVALUES({$GLOBALS['adminid']},'{$GLOBALS['username']}',{$uid},{$grade},{$contact},{$master},'{$time}','{$interest}','{$different}','{$service}','{$desc}','{$comment}','{$timestamp}','{$phonecall}')"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'"; // updated file $member_admininfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); if (!empty($member_admininfo)) { $sql = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET effect_grade='{$grade}',effect_contact='{$contact}',master_member='{$master}',next_contact_time='{$time}',dateline='{$timestamp}',checkreason='{$checkreason}' WHERE uid='{$uid}'"; } else { $sql = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo(uid,effect_grade,effect_contact,master_member,next_contact_time,dateline,checkreason)\n\t\t\tVALUES('{$uid}','{$grade}','{$contact}','{$master}','{$time}','{$timestamp}','{$checkreason}')"; } $GLOBALS['_MooClass']['MooMySQL']->query($sql); //NOTE 3,4,5类会员保存小记后台提醒客服组长 $gid = getGroupID($adminid); $wokao = $grade - 1; if (in_array($wokao, array('3', '4', '5'))) { $title = '会员' . $uid . '转为 ' . $wokao . '类'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$GLOBALS['dbTablePre']}admin_remark set sid='{$gid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql_remark); } // 会员跟踪步骤 mycount 统计 try { $m = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT b.source as source FROM web_members_search s left join web_members_base b on s.uid=b.uid where s.uid='{$uid}' ", true); // 只统计有渠道的 $source = trim($m['source']); if (!empty($source)) { $str_md5 = md5($uid . ($grade - 1) . MOOPHP_AUTHKEY); $apiurl = "http://tg.zhenaiyisheng.cc/hongniang/hongniang_effect_grade_import.php?uid=" . $uid . "&md5=" . $str_md5 . "&grade=" . ($grade - 1); $result = file_get_contents($apiurl); } } catch (Exception $e) { //var_dump($e->getMessage()); } }
echo html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'completion_dynamic_change', 'name' => 'completion_dynamic_change', 'value' => '0')); echo html_writer::end_tag('div'); echo html_writer::end_tag('form'); } // Course wrapper start. echo html_writer::start_tag('div', array('class' => 'course-content')); // make sure that section 0 exists (this function will create one if it is missing) course_create_sections_if_missing($course, 0); // get information about course modules and existing module types // format.php in course formats may rely on presence of these variables $modinfo = get_fast_modinfo($course); $modnames = get_module_types_names(); $modnamesplural = get_module_types_names(true); $modnamesused = $modinfo->get_used_module_names(); $mods = $modinfo->get_cms(); $sections = $modinfo->get_section_info_all(); // CAUTION, hacky fundamental variable defintion to follow! // Note that because of the way course fromats are constructed though // inclusion we pass parameters around this way.. $displaysection = $section; // Include the actual course format. require $CFG->dirroot . '/course/format/' . $course->format . '/format.php'; // Content wrapper end. echo html_writer::end_tag('div'); // Include course AJAX include_course_ajax($course, $modnamesused); echo $OUTPUT->footer(); $groupid = getGroupID($USER->id); if (isset($groupid[$USER->id]->groupid)) { echo $OUTPUT->box(checkAlerts($USER->id, $groupid[$USER->id]->groupid)); }
function getGroupID($name) { $groupID = false; $sortOrder = 1; $model = oc::model('catalog_attribute_group'); $list = $model->getAttributeGroups(array('sort' => 'ag.sort_order')); foreach ($list as $group) { if (mb_strtolower($group['name'], 'UTF-8') == mb_strtolower($name, 'UTF-8')) { $groupID = $group['attribute_group_id']; } $sortOrder = $group['sort_order']; } if (!$groupID) { $model->addAttributeGroup(array('sort_order' => $sortOrder + 10, 'attribute_group_description' => array(1 => array('name' => $name)))); return getGroupID($name); } return $groupID; }