当前位置: 首页>>代码示例>>PHP>>正文


PHP Tracking类代码示例

本文整理汇总了PHP中Tracking的典型用法代码示例。如果您正苦于以下问题:PHP Tracking类的具体用法?PHP Tracking怎么用?PHP Tracking使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Tracking类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: export_kimia

 public function export_kimia($id_analisis)
 {
     $this->load->model(['type_pemohon_m', 'lokasi_m', 'conto_m']);
     $analisis = $this->analisis_m->find($id_analisis);
     $conto = $this->conto_m->by_analisis($analisis->id);
     $analisis_parameter = $this->analisis_m->parameter($id_analisis);
     $pemohon = $this->pemohon_m->find($analisis->id_pemohon);
     $type_pemohon = $this->type_pemohon_m->find($pemohon->id_type_pemohon);
     $analisis->nama_lokasi = $this->lokasi_m->detail_by_kabupaten($analisis->lokasi, TRUE);
     if (!$this->_is_pihak_luar($pemohon->id_type_pemohon)) {
         $pemohon->nama_sertifikat = 'Kp. ' . $type_pemohon->nama;
         $pemohon->alamat = 'PSDG';
     }
     foreach ($conto as $key => $row_conto) {
         $conto[$key]->detail_parameter = $this->conto_m->parameter($row_conto->id);
     }
     foreach ($analisis_parameter as $key => $row_parameter) {
         $parameter = $this->parameter_m->find_type_analisis_parameter($row_parameter->id_type_analisis_parameter);
         $metoda = $this->metoda_m->find($row_parameter->id_metoda);
         $analisis_parameter[$key]->nama_parameter = $parameter->nama_parameter;
         $analisis_parameter[$key]->metoda = !$metoda ? '' : $metoda->nama;
     }
     // Memasukkan data hasil analisis ke lembar hasil analisis
     $tracking = new Tracking();
     if (!$tracking->isset_tracking($analisis->id, 9)) {
         $tracking->add_tracking($analisis->id, 9);
     }
     $data = ['analisis' => $analisis, 'conto' => $conto, 'parameter' => $analisis_parameter, 'pemohon' => $pemohon];
     $this->load->view('sertifikat/excel_kimia', $data);
 }
开发者ID:phi314,项目名称:onix,代码行数:30,代码来源:sertifikat.php

示例2: update_to_proses

 /**
  * Id tracking 2 preparasi conto
  */
 public function update_to_proses()
 {
     $input = $this->input->post();
     $this->preparasi_m->update_to_proses($input['id']);
     $tracking = new Tracking();
     $tracking->add_tracking($input['id_analisis'], 3);
     redirect('preparasi/detail/' . $input['id']);
 }
开发者ID:phi314,项目名称:onix,代码行数:11,代码来源:preparasi.php

示例3: actionAvtoparkAdd

 public function actionAvtoparkAdd($id = 0)
 {
     if (!empty($id)) {
         $Transport = Transport::model()->findByPk($id);
         if (!Yii::app()->user->checkAccess('admin') && (Yii::app()->getUser()->getProfile()->modules->head != UserModules::DIRECTOR_COMPANY || Yii::app()->user->getProfile()->company_id != $Transport->user->company_id) && (Yii::app()->getUser()->getProfile()->modules->avtopark != '1' || $Transport->user_id != Yii::app()->user->id)) {
             throw new CHttpException(403);
         }
     } else {
         if (!Yii::app()->user->checkAccess('admin') && Yii::app()->getUser()->getProfile()->modules->head != UserModules::DIRECTOR_COMPANY && Yii::app()->getUser()->getProfile()->modules->avtopark != '1') {
             throw new CHttpException(403);
         }
         $Transport = new Transport();
     }
     if (isset($_POST['save'])) {
         $Transport->setAttributes($_POST['Transport'], false);
         if ($Transport->validate()) {
             $Transport->save();
             $Transport->setRelations($_POST['Transport']);
             if (isset($_POST['photos'])) {
                 $Transport->setPhoto($_POST['photos']);
             }
             $this->redirect('/cabinet/avtopark/');
         }
     }
     $track = null;
     $points = [];
     Yii::import('application.modules.tracking.models.*');
     if ($Transport->tracking_on && $Transport->tracking_password) {
         $points = Tracking::model()->getDataForCurrentTrack($Transport->transport_id);
     }
     $this->render('avtoparkAdd', ['Transport' => $Transport, 'points' => $points]);
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:32,代码来源:TransportController.php

示例4: actionData

 public function actionData()
 {
     $transport_id = (int) Yii::app()->request->getPost('id');
     $pass = Yii::app()->request->getPost('pass', '');
     $dataRequest = Yii::app()->request->getPost('data', '');
     $data = json_decode($dataRequest, false);
     if ($transport_id && $pass && is_array($data)) {
         Yii::app()->getModule('cabinet');
         $transport = Transport::model()->findByPk($transport_id);
         if (!is_null($transport)) {
             $tracking = Tracking::model();
             $checkPass = $tracking->getPasswordForAPI($transport);
             if (0 == strcmp($pass, $checkPass)) {
                 $res = $tracking->saveTrackData($transport_id, $data);
                 echo CJSON::encode(['status' => $res ? 'success' : 'failed']);
                 Yii::log("actionData success", "info");
             } else {
                 echo CJSON::encode(['status' => 'failed', 'data' => "wrong pass for transport_id=[{$transport_id}]"]);
             }
         } else {
             echo CJSON::encode(['status' => 'failed', 'data' => "Transport not found [{$transport_id}]"]);
         }
     } else {
         echo CJSON::encode(['status' => 'failed', 'data' => "Wrong params transport_id=[{$transport_id}],pass=[{$pass}]"]);
     }
     Yii::app()->end();
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:27,代码来源:DefaultController.php

示例5: GetTimeSpentOnCourseInSession

 /**
  * Gets the time spent in a course by a given user
  *
  * @param string User id field name
  * @param string User id value
  * @param string Course id field name
  * @param string Course id value
  * @return array Array of results
  */
 public function GetTimeSpentOnCourseInSession($user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $session_id_field_name, $session_id_value)
 {
     $user_id = $this->getUserId($user_id_field_name, $user_id_value);
     if ($user_id instanceof WSError) {
         return $user_id;
     }
     $course_id = $this->getCourseId($course_id_field_name, $course_id_value);
     if ($course_id instanceof WSError) {
         return $course_id;
     }
     $session_id = $this->getSessionId($session_id_field_name, $session_id_value);
     if ($session_id instanceof WSError) {
         return $session_id;
     }
     return Tracking::get_time_spent_on_the_course($user_id, $course_id, $session_id);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:25,代码来源:webservice_report.php

示例6: getSessionProgress

 /**
  * Get the calculated progress for an user in a session
  * @param int $sessionId The session ID
  * @param int $userId The user ID
  *
  * @return float The progress
  */
 public static function getSessionProgress($sessionId, $userId)
 {
     $courses = SessionManager::get_course_list_by_session_id($sessionId);
     $progress = 0;
     if (empty($courses)) {
         return 0;
     }
     foreach ($courses as $course) {
         $courseProgress = Tracking::get_avg_student_progress($userId, $course['code'], [], $sessionId, false, true);
         if ($courseProgress === false) {
             continue;
         }
         $progress += $courseProgress;
     }
     return round($progress / count($courses), 2);
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:23,代码来源:GamificationUtils.php

示例7:

<?php

include '../includes.php';
Tracking::track(basename(filter_input(INPUT_SERVER, 'PHP_SELF')));
User::logout();
header("Location: ../default.php");
开发者ID:NoxNode,项目名称:OldProjects,代码行数:6,代码来源:logout.php

示例8: get_user_data

 /**
  * Get data for users list in sortable with pagination
  * @param $from
  * @param $number_of_items
  * @param $column
  * @param $direction
  * @param $includeInvitedUsers boolean Whether include the invited users
  * @return array
  */
 public static function get_user_data($from, $number_of_items, $column, $direction, $includeInvitedUsers = false)
 {
     global $user_ids, $course_code, $additional_user_profile_info, $export_csv, $is_western_name_order, $csv_content, $session_id;
     $course_code = Database::escape_string($course_code);
     $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
     $tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
     $access_url_id = api_get_current_access_url_id();
     // get all users data from a course for sortable with limit
     if (is_array($user_ids)) {
         $user_ids = array_map('intval', $user_ids);
         $condition_user = " WHERE user.user_id IN (" . implode(',', $user_ids) . ") ";
     } else {
         $user_ids = intval($user_ids);
         $condition_user = " WHERE user.user_id = {$user_ids} ";
     }
     if (!empty($_GET['user_keyword'])) {
         $keyword = trim(Database::escape_string($_GET['user_keyword']));
         $condition_user .= " AND (\n                user.firstname LIKE '%" . $keyword . "%' OR\n                user.lastname LIKE '%" . $keyword . "%'  OR\n                user.username LIKE '%" . $keyword . "%'  OR\n                user.email LIKE '%" . $keyword . "%'\n             ) ";
     }
     $url_table = null;
     $url_condition = null;
     if (api_is_multiple_url_enabled()) {
         $url_table = ", " . $tbl_url_rel_user . "as url_users";
         $url_condition = " AND user.user_id = url_users.user_id AND access_url_id='{$access_url_id}'";
     }
     $invitedUsersCondition = '';
     if (!$includeInvitedUsers) {
         $invitedUsersCondition = " AND user.status != " . INVITEE;
     }
     $sql = "SELECT  user.user_id as user_id,\n                    user.official_code  as col0,\n                    user.lastname       as col1,\n                    user.firstname      as col2,\n                    user.username       as col3\n                FROM {$tbl_user} as user {$url_table}\n    \t        {$condition_user} {$url_condition} {$invitedUsersCondition}";
     if (!in_array($direction, array('ASC', 'DESC'))) {
         $direction = 'ASC';
     }
     $column = intval($column);
     $from = intval($from);
     $number_of_items = intval($number_of_items);
     $sql .= " ORDER BY col{$column} {$direction} ";
     $sql .= " LIMIT {$from},{$number_of_items}";
     $res = Database::query($sql);
     $users = array();
     $course_info = api_get_course_info($course_code);
     $total_surveys = 0;
     $total_exercises = ExerciseLib::get_all_exercises($course_info, $session_id, false, null, false, 3);
     if (empty($session_id)) {
         $survey_user_list = array();
         $survey_list = SurveyManager::get_surveys($course_code, $session_id);
         $total_surveys = count($survey_list);
         if (!empty($survey_list)) {
             foreach ($survey_list as $survey) {
                 $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $course_info['real_id']);
                 foreach ($user_list as $user_id) {
                     isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : ($survey_user_list[$user_id] = 1);
                 }
             }
         }
     }
     while ($user = Database::fetch_array($res, 'ASSOC')) {
         $courseInfo = api_get_course_info($course_code);
         $courseId = $courseInfo['real_id'];
         $user['official_code'] = $user['col0'];
         $user['lastname'] = $user['col1'];
         $user['firstname'] = $user['col2'];
         $user['username'] = $user['col3'];
         $user['time'] = api_time_to_hms(Tracking::get_time_spent_on_the_course($user['user_id'], $courseId, $session_id));
         $avg_student_score = Tracking::get_avg_student_score($user['user_id'], $course_code, array(), $session_id);
         $avg_student_progress = Tracking::get_avg_student_progress($user['user_id'], $course_code, array(), $session_id);
         if (empty($avg_student_progress)) {
             $avg_student_progress = 0;
         }
         $user['average_progress'] = $avg_student_progress . '%';
         $total_user_exercise = Tracking::get_exercise_student_progress($total_exercises, $user['user_id'], $courseId, $session_id);
         $user['exercise_progress'] = $total_user_exercise;
         $total_user_exercise = Tracking::get_exercise_student_average_best_attempt($total_exercises, $user['user_id'], $courseId, $session_id);
         $user['exercise_average_best_attempt'] = $total_user_exercise;
         if (is_numeric($avg_student_score)) {
             $user['student_score'] = $avg_student_score . '%';
         } else {
             $user['student_score'] = $avg_student_score;
         }
         $user['count_assignments'] = Tracking::count_student_assignments($user['user_id'], $course_code, $session_id);
         $user['count_messages'] = Tracking::count_student_messages($user['user_id'], $course_code, $session_id);
         $user['first_connection'] = Tracking::get_first_connection_date_on_the_course($user['user_id'], $courseId, $session_id);
         $user['last_connection'] = Tracking::get_last_connection_date_on_the_course($user['user_id'], $courseInfo, $session_id);
         // we need to display an additional profile field
         $user['additional'] = '';
         if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) {
             if (isset($additional_user_profile_info[$user['user_id']]) && is_array($additional_user_profile_info[$user['user_id']])) {
                 $user['additional'] = implode(', ', $additional_user_profile_info[$user['user_id']]);
             }
         }
         if (empty($session_id)) {
//.........这里部分代码省略.........
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:tracking.lib.php

示例9: array

        $headerList[] = $item[0];
    }
    $csvContent[] = array();
    $csvContent[] = array(get_lang('Courses'));
    $csvContent[] = $headerList;
    $data = array();
    $courseToolInformationTotal = null;
    while ($course = Database::fetch_object($res)) {
        $courseInfo = api_get_course_info_by_id($course->c_id);
        $courseCode = $courseInfo['code'];
        $courseToolInformation = null;
        $tools = '<a href="course_information.php?code=' . $courseCode . '">' . Display::return_icon('synthese_view.gif', get_lang('Overview')) . '</a>' . '<a href="' . $courseInfo['course_public_url'] . '">' . Display::return_icon('course_home.gif', get_lang('CourseHomepage')) . '</a>' . '<a href="course_edit.php?course_code=' . $courseCode . '">' . Display::return_icon('edit.gif', get_lang('Edit')) . '</a>';
        if ($course->status == STUDENT) {
            $tools .= '<a href="user_information.php?action=unsubscribe&course_code=' . $courseCode . '&user_id=' . $user['user_id'] . '">' . Display::return_icon('delete.png', get_lang('Delete')) . '</a>';
        }
        $timeSpent = api_time_to_hms(Tracking::get_time_spent_on_the_course($user['user_id'], $courseInfo['real_id'], 0));
        $totalForumMessages = CourseManager::getCountPostInForumPerUser($user['user_id'], $course->id, 0);
        $row = array(Display::url($courseCode, $courseInfo['course_public_url']), $course->title, $course->status == STUDENT ? get_lang('Student') : get_lang('Teacher'), $timeSpent, $totalForumMessages, $tools);
        $csvContent[] = array_map('strip_tags', $row);
        $data[] = $row;
        $result = TrackingUserLogCSV::getToolInformation($user['user_id'], $courseInfo, 0);
        $courseToolInformationTotal .= $result['html'];
        $csvContent = array_merge($csvContent, $result['array']);
    }
    $courseInformation = Display::page_subheader(get_lang('Courses'));
    $courseInformation .= Display::return_sortable_table($header, $data, array(), array(), array('user_id' => intval($_GET['user_id'])));
    $courseInformation .= $courseToolInformationTotal;
} else {
    $courseInformation = '<p>' . get_lang('NoCoursesForThisUser') . '</p>';
}
/**
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:user_information.php

示例10: get_content_html

    /**
     * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
     * @return string  content html
     */
    public function get_content_html()
    {
        $content = '';
        $sessions = $this->sessions;
        //$content = '<div style="margin:10px;">';
        $content .= '<h4>' . get_lang('YourSessionsList') . '</h4>';
        if (count($sessions) > 0) {
            $sessions_table = '<table class="data_table" width:"95%">';
            $sessions_table .= '<tr>
									<th >' . get_lang('Title') . '</th>
									<th >' . get_lang('Date') . '</th>
									<th width="100px">' . get_lang('NbCoursesPerSession') . '</th>
								</tr>';
            $i = 1;
            foreach ($sessions as $session) {
                $session_id = intval($session['id']);
                $title = $session['name'];
                if ($session['access_start_date'] != '0000-00-00 00:00:00' && $session['access_end_date'] != '0000-00-00 00:00:00') {
                    $date = get_lang('From') . ' ' . api_convert_and_format_date($session['access_start_date'], DATE_FORMAT_SHORT, date_default_timezone_get()) . ' ' . get_lang('To') . ' ' . api_convert_and_format_date($session['access_end_date'], DATE_FORMAT_SHORT, date_default_timezone_get());
                } else {
                    $date = ' - ';
                }
                $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id));
                if ($i % 2 == 0) {
                    $class_tr = 'row_odd';
                } else {
                    $class_tr = 'row_even';
                }
                $sessions_table .= '<tr class="' . $class_tr . '">
										<td>' . $title . '</td>
										<td align="center">' . $date . '</td>
										<td align="center">' . $count_courses_in_session . '</td>
								   </tr>';
                $i++;
            }
            $sessions_table .= '</table>';
            $content .= $sessions_table;
        } else {
            $content .= get_lang('ThereIsNoInformationAboutYourSessions');
        }
        if (count($sessions) > 0) {
            $content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/session.php">' . get_lang('SeeMore') . '</a></div>';
        }
        //$content .= '</div>';
        return $content;
    }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:50,代码来源:block_session.class.php

示例11: get_lang

 } else {
     $form_name = get_lang('ModifyAnnouncement');
 }
 $form->addElement('header', $form_name);
 $to = [];
 if (empty($group_id)) {
     if (isset($_GET['remind_inactive'])) {
         $email_ann = '1';
         $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'), api_get_setting('platform.site_name'), 7);
         $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'), api_get_setting('platform.site_name'));
     } elseif (isset($_GET['remindallinactives']) && $_GET['remindallinactives'] == 'true') {
         // we want to remind inactive users. The $_GET['since'] parameter
         // determines which users have to be warned (i.e the users who have been inactive for x days or more
         $since = isset($_GET['since']) ? intval($_GET['since']) : 6;
         // getting the users who have to be reminded
         $to = Tracking::getInactiveStudentsInCourse(api_get_course_int_id(), $since, $sessionId);
         // setting the variables for the form elements: the users who need to receive the message
         foreach ($to as &$user) {
             $user = 'USER:' . $user;
         }
         // setting the variables for the form elements: the message has to be sent by email
         $email_ann = '1';
         // setting the variables for the form elements: the title of the email
         $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'), api_get_setting('platform.site_name'));
         // setting the variables for the form elements: the message of the email
         $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'), api_get_setting('platform.site_name'), $since);
         // when we want to remind the users who have never been active
         // then we have a different subject and content for the announcement
         if ($_GET['since'] == 'never') {
             $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'), api_get_setting('platform.site_name'));
             $content_to_modify = get_lang('YourAccountIsActiveYouCanLoginAndCheckYourCourses');
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:announcements.php

示例12: LearnpathList

     $res = Database::query($sql);
     //Getting the list of LPs in the new session
     $lp_list = new LearnpathList($user_id, $origin_course_code, $new_session_id);
     $flat_list = $lp_list->get_flat_list();
     $list = array();
     while ($row = Database::fetch_array($res, 'ASSOC')) {
         //Checking if the LP exist in the new session
         if (in_array($row['lp_id'], array_keys($flat_list))) {
             $list[$row['id']] = $row;
         }
     }
     if (!empty($list)) {
         foreach ($list as $id => $data) {
             //Getting all information of that lp_item_id
             $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
             $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
             $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' => $progress);
         }
     }
 }
 //6. Agenda
 //calendar_event_attachment no problems no session_id
 $sql = "SELECT ref FROM {$TBL_ITEM_PROPERTY} WHERE tool = 'calendar_event' AND insert_user_id = {$user_id} AND c_id = {$course_id} ";
 $res = Database::query($sql);
 while ($row = Database::fetch_array($res, 'ASSOC')) {
     $id = $row['ref'];
     if ($update_database) {
         $sql = "UPDATE {$TBL_AGENDA} SET session_id = {$new_session_id} WHERE c_id = {$course_id} AND id = {$id} ";
         if ($debug) {
             var_dump($sql);
         }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:user_move_stats.php

示例13: actionDeletefj

 public function actionDeletefj()
 {
     $userid = Yii::app()->session['login']['id'];
     $groupid = $_POST['groupid'];
     // groups tabel deleting
     $groups = Group::model()->findByAttributes(array('group_id' => $groupid));
     //$groups = new Group;
     $groups->group_activestatus = '2';
     if ($groups->save(false)) {
         echo "success";
     }
     $imagetypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Image'));
     $videotypeid = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadtype', 'lookup_status' => 1, 'lookup_name' => 'Video'));
     $sourcetypeidfinao = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'finao'));
     $sourcetypeidtile = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'tile'));
     $tracked_tileids = Yii::app()->session['login']['id'];
     /*$tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid'=>$tracked_tileids,'tracked_tileid'=>$tileid));	
     	
     				if(isset($tileinfo['0']['tracking_id']))	
     				{
     	
     					$tileinfo = Tracking::model()->findByAttributes(array('tracking_id'=>$tileinfo['0']['tracking_id']));
     	
     					$tileinfo->delete();	
     	
     				}	*/
     $sourcetypeidjournal = Lookups::model()->findByAttributes(array('lookup_type' => 'uploadsourcetype', 'lookup_status' => 1, 'lookup_name' => 'journal'));
     $groupfinao = UserFinao::model()->findByAttributes(array('group_id' => $groupid));
     // finaos deleteing
     $type = "finao";
     if ($type == "finao") {
         // uploadedetails deleteing
         $delfiles = Uploaddetails::model()->findAllByAttributes(array('upload_sourceid' => $groupfinao->user_finao_id));
         //$delfiles1 = Uploaddetails::model()->findAllByAttributes(array('uploadtype'=>$videotypeid->lookup_id,'upload_sourcetype'=>$sourcetypeidfinao->lookup_id,'upload_sourceid'=>$journalid,'uploadedby'=>$userid));
         if (isset($delfiles) && !empty($delfiles)) {
             foreach ($delfiles as $image) {
                 $image->status = 2;
                 $image->save(false);
             }
         }
         /*if(isset($delfiles1) && !empty($delfiles1))
         				{
         				foreach($delfiles1 as $video)	
         					{
         						$video->status = 2;	
         						$video->save(false);
         	
         					}	
         				}*/
         $tiles = UserFinaoTile::model()->findAllByAttributes(array('finao_id' => $groupfinao->user_finao_id, 'createdby' => $userid));
         if (isset($tiles) && !empty($tiles)) {
             foreach ($tiles as $eachtile) {
                 $eachtile->status = '2';
                 $eachtile->save(false);
             }
         }
         // finaos deleteing
         $finaodel = UserFinao::model()->findAllByAttributes(array('user_finao_id' => $groupfinao->user_finao_id, 'updatedby' => $userid));
         //echo $groupfinao->user_finao_id; echo $userid;
         if (isset($finaodel) && !empty($finaodel)) {
             $finaodel->finao_activestatus = '2';
             $finaodel->save(false);
         }
         $tracked_tileids = Yii::app()->session['login']['id'];
         $tileinfo = Tracking::model()->findAllByAttributes(array('tracked_userid' => $tracked_tileids, 'tracked_tileid' => $tileid));
         if (isset($tileinfo['0']['tracking_id'])) {
             $tileinfo = Tracking::model()->findByAttributes(array('tracking_id' => $tileinfo['0']['tracking_id']));
             $tileinfo->delete();
         }
         //echo "successful";
     }
 }
开发者ID:gopi158,项目名称:Sample,代码行数:72,代码来源:GroupController.php

示例14: search_courses

 /**
  * Search the courses database for a course that matches the search term.
  * The search is done on the code, title and tutor field of the course table.
  * @param string $search_term The string that the user submitted, what we are looking for
  * @param array $limit
  * @return array An array containing a list of all the courses matching the the search term.
  */
 public function search_courses($search_term, $limit)
 {
     $courseTable = Database::get_main_table(TABLE_MAIN_COURSE);
     $extraFieldTable = Database::get_main_table(TABLE_EXTRA_FIELD);
     $extraFieldValuesTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
     $limitFilter = getLimitFilterFromArray($limit);
     // get course list auto-register
     $sql = "SELECT item_id\n                FROM {$extraFieldValuesTable} tcfv\n                INNER JOIN {$extraFieldTable} tcf ON tcfv.field_id =  tcf.id\n                WHERE\n                    tcf.variable = 'special_course' AND\n                    tcfv.value = 1 ";
     $special_course_result = Database::query($sql);
     if (Database::num_rows($special_course_result) > 0) {
         $special_course_list = array();
         while ($result_row = Database::fetch_array($special_course_result)) {
             $special_course_list[] = '"' . $result_row['item_id'] . '"';
         }
     }
     $without_special_courses = '';
     if (!empty($special_course_list)) {
         $without_special_courses = ' AND course.code NOT IN (' . implode(',', $special_course_list) . ')';
     }
     $search_term_safe = Database::escape_string($search_term);
     $sql_find = "SELECT * FROM {$courseTable}\n                    WHERE (\n                            code LIKE '%" . $search_term_safe . "%' OR\n                            title LIKE '%" . $search_term_safe . "%' OR\n                            tutor_name LIKE '%" . $search_term_safe . "%'\n                        )\n                        {$without_special_courses}\n                    ORDER BY title, visual_code ASC\n                    {$limitFilter}\n                    ";
     if (api_is_multiple_url_enabled()) {
         $url_access_id = api_get_current_access_url_id();
         if ($url_access_id != -1) {
             $tbl_url_rel_course = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
             $sql_find = "SELECT *\n                            FROM {$courseTable} as course\n                            INNER JOIN {$tbl_url_rel_course} as url_rel_course\n                            ON (url_rel_course.c_id = course.id)\n                            WHERE\n                                access_url_id = {$url_access_id} AND (\n                                    code LIKE '%" . $search_term_safe . "%' OR\n                                    title LIKE '%" . $search_term_safe . "%' OR\n                                    tutor_name LIKE '%" . $search_term_safe . "%'\n                                )\n                                {$without_special_courses}\n                            ORDER BY title, visual_code ASC\n                            {$limitFilter}\n                            ";
         }
     }
     $result_find = Database::query($sql_find);
     $courses = array();
     while ($row = Database::fetch_array($result_find)) {
         $row['registration_code'] = !empty($row['registration_code']);
         $count_users = count(CourseManager::get_user_list_from_course_code($row['code']));
         $count_connections_last_month = Tracking::get_course_connections_count($row['id'], 0, api_get_utc_datetime(time() - 30 * 86400));
         $point_info = CourseManager::get_course_ranking($row['id'], 0);
         $courses[] = array('real_id' => $row['id'], 'point_info' => $point_info, 'code' => $row['code'], 'directory' => $row['directory'], 'visual_code' => $row['visual_code'], 'title' => $row['title'], 'tutor' => $row['tutor_name'], 'subscribe' => $row['subscribe'], 'unsubscribe' => $row['unsubscribe'], 'registration_code' => $row['registration_code'], 'creation_date' => $row['creation_date'], 'visibility' => $row['visibility'], 'count_users' => $count_users, 'count_connections' => $count_connections_last_month);
     }
     return $courses;
 }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:46,代码来源:auth.lib.php

示例15: Tracking

<?php

require 'include/config.php';
require 'include/class.tracking.php';
$t = new Tracking($db);
$views = $t->getViews($_GET['hash']);
include 'include/top.php';
?>

<table>
	<thead>
		<tr>
			<th>Date/Time</th>
			<th>Browser</th>
			<th>Referer</th>
			<th>IP</th>
			<th>Source</th>
			<th>Parameters</th>
		</tr>
	</thead>
	<tbody>
		<?php 
foreach ($views as $v) {
    ?>

			<tr>
				<td><?php 
    echo $v['datetime'];
    ?>
</td>
				<td><?php 
开发者ID:polaris610,项目名称:track_software,代码行数:31,代码来源:click_list.php


注:本文中的Tracking类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。