/** * Gets the collection of data for the OTD graph of database for the selected period. * * @param int $selectedPeriod period selected for display. * * @return array Information relevant to the OTD graph. * */ public function get_otd_bi($selected_period = "x") { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = $sql = "SELECT TARGET_RELEASE,\n\t\tTO_CHAR(SCHED_FINISH_DATE, 'YYYY/MM') as ByYearMonth,\n\t\tSUM(CASE WHEN ACTUAL_FINISH_DATE <= SCHED_FINISH_DATE THEN 1 ELSE 0 END) AS PASSED,\n\t\tSUM(CASE WHEN ACTUAL_FINISH_DATE > SCHED_FINISH_DATE THEN 1 ELSE 0 END) AS NOT_PASSED,\n\t\tcount (*) as TOTAL,\n\t\tROUND (((SUM(CASE WHEN ACTUAL_FINISH_DATE <= SCHED_FINISH_DATE THEN 1 ELSE 0 END) * 100) / count (*) )) as AVERG\n\t\t FROM vw_24fitness_all_tickets \n\t\tWHERE IT_GROUP='BI' AND \n\t\tTARGET_RELEASE IS NOT NULL AND\n\t\tACTUAL_FINISH_DATE IS NOT NULL AND\n\t\tSCHED_FINISH_DATE IS NOT NULL AND \n\t\tSCHED_FINISH_DATE between to_date (?, 'yyyy/mm/dd') AND \n\t\tto_date (?, 'yyyy/mm/dd')\n\t\tGROUP BY TO_CHAR(SCHED_FINISH_DATE, 'YYYY/MM'), TARGET_RELEASE \n\t\tORDER BY ByYearMonth"; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $assigned_to User to show detail. * * @return array Information relevant to the Estimation Variance graph. * */ public function get_estimation_variance_detailed_data($selected_period = "x", $assigned_to) { $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $assigned_to == 'JANUARY' ? $month = 1 : ''; $assigned_to == 'FEBRUARY' ? $month = 2 : ''; $assigned_to == 'MARCH' ? $month = 3 : ''; $assigned_to == 'APRIL' ? $month = 4 : ''; $assigned_to == 'MAY' ? $month = 5 : ''; $assigned_to == 'JUNE' ? $month = 6 : ''; $assigned_to == 'JULY' ? $month = 7 : ''; $assigned_to == 'AUGUST' ? $month = 8 : ''; $assigned_to == 'SEPTEMBER' ? $month = 9 : ''; $assigned_to == 'OCTOBER' ? $month = 10 : ''; $assigned_to == 'NOVEMBER' ? $month = 11 : ''; $assigned_to == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT ticket_id, ASSIGNED_TO, title, actual_effort, estimated_fix_time, round((ACTUAL_EFFORT / ESTIMATED_FIX_TIME),2) as DIVISION, prod_deployment_date \n\t\t\tFROM vw_24fitness_all_tickets WHERE \n\t\t\tIT_GROUP='BI' AND prod_deployment_date between \n\t\t\tto_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd') and EXTRACT(MONTH FROM prod_deployment_date)=" . $month . " ORDER BY ASSIGNED_TO"; } else { $sql = "SELECT ticket_id, ASSIGNED_TO, title, actual_effort, estimated_fix_time, round((ACTUAL_EFFORT / ESTIMATED_FIX_TIME),2) as DIVISION, prod_deployment_date "; $sql .= "FROM vw_24fitness_all_tickets WHERE "; $sql .= "IT_GROUP='BI' AND prod_deployment_date between "; $sql .= "to_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd') and assigned_to='" . $assigned_to . "' ORDER BY ASSIGNED_TO"; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * ShopEx licence * * @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn) * @license http://ecos.shopex.com/license/gpl GPL License */ function widget_goods(&$setting, &$render) { $limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6; $goods =& app::get('b2c')->model('goods'); $goods->defaultCols = 'bn,name,cat_id,price,store,marketable,brand_id,weight,d_order,uptime,type_id'; $goods->appendCols = 'goods_id,thumbnail_pic,brief,mktprice,image_default_id'; $config = app::get('b2c')->getConf('site.save_price'); $data['onSelect'] = $setting['onSelect'] ? $setting['onSelect'] : 0; $setting['max_length'] = $setting['max_length'] ? $setting['max_length'] : 35; $setting['view'] = app::get('b2c')->getConf('gallery.default_view'); $imageDefault = app::get('image')->getConf('image.set'); $search =& app::get('b2c')->model('search'); $setting['str'] = $search->encode($filter); $setting['restrict'] = $setting['restrict'] ? $setting['restrict'] : 'on'; $order = $setting['goods_orderby'] ? orderBy($setting['goods_orderby']) : null; if ($setting['columNum'] > 1) { for ($i = 0; $i < $setting['columNum']; $i++) { parse_str($setting['adjunct']['items'][$i], $filter[$i]); $filter[$i] = getFilter($filter[$i]); $result['link'][$i - 1] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $setting['view'], 'args' => array($str_cat_id, $search->encode($filter[$i]), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0))); $result['goods'][] = $goods->getList(null, $filter[$i], 0, $limit, $order['sql']); $result['defaultImage'] = $imageDefault['S']['default_image']; unset($filter[$i]); } return $result; } else { parse_str($setting['adjunct']['items'][0], $filter); $filter = getFilter($filter); $result['link'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => $setting['view'], 'args' => array(implode(",", (array) $filter['cat_id']), $search->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0))); $result['goods'] = $goods->getList('*', $filter, 0, $limit, $order['sql']); $result['defaultImage'] = $imageDefault['S']['default_image']; return $result; } }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail.. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the Defect Rate graph. * */ public function get_defect_rate_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $target_release == 'JANUARY' ? $month = 1 : ''; $target_release == 'FEBRUARY' ? $month = 2 : ''; $target_release == 'MARCH' ? $month = 3 : ''; $target_release == 'APRIL' ? $month = 4 : ''; $target_release == 'MAY' ? $month = 5 : ''; $target_release == 'JUNE' ? $month = 6 : ''; $target_release == 'JULY' ? $month = 7 : ''; $target_release == 'AUGUST' ? $month = 8 : ''; $target_release == 'SEPTEMBER' ? $month = 9 : ''; $target_release == 'OCTOBER' ? $month = 10 : ''; $target_release == 'NOVEMBER' ? $month = 11 : ''; $target_release == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT ticket_id, title, APPLICATION, TARGET_RELEASE, SUM(CASE WHEN TYPE_24FITNESS = 'Defect' THEN 1 ELSE 0 END) AS DEFECTS, \n\t\t\tSUM(CASE WHEN TYPE_24FITNESS = 'Defect' OR TYPE_24FITNESS = 'Requirement' THEN 1 ELSE 0 END) AS TASKS, PROD_DEPLOYMENT_DATE \n\t\t\tFROM vw_24fitness_all_tickets where PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND \n\t\t\tto_date (?, 'yyyy/mm/dd') and EXTRACT(MONTH FROM PROD_DEPLOYMENT_DATE)=" . $month . " and it_group='BI' \n\t\t\tgroup by ticket_id , APPLICATION, TARGET_RELEASE, PROD_DEPLOYMENT_DATE, title order by prod_deployment_date"; } else { $sql = "SELECT ticket_id, title, APPLICATION, TARGET_RELEASE, SUM(CASE WHEN TYPE_24FITNESS = 'Defect' THEN 1 ELSE 0 END) AS DEFECTS, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' OR TYPE_24FITNESS = 'Requirement' THEN 1 ELSE 0 END) AS TASKS, PROD_DEPLOYMENT_DATE "; $sql .= "FROM vw_24fitness_all_tickets where PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd') and application='" . $application . "' and target_release='" . $target_release . "' and it_group='BI' "; $sql .= "group by ticket_id , APPLICATION, TARGET_RELEASE, PROD_DEPLOYMENT_DATE, title order by application, target_release "; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the Number of Cycles graph. * */ public function get_number_of_cycles_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $target_release == 'JANUARY' ? $month = 1 : ''; $target_release == 'FEBRUARY' ? $month = 2 : ''; $target_release == 'MARCH' ? $month = 3 : ''; $target_release == 'APRIL' ? $month = 4 : ''; $target_release == 'MAY' ? $month = 5 : ''; $target_release == 'JUNE' ? $month = 6 : ''; $target_release == 'JULY' ? $month = 7 : ''; $target_release == 'AUGUST' ? $month = 8 : ''; $target_release == 'SEPTEMBER' ? $month = 9 : ''; $target_release == 'OCTOBER' ? $month = 10 : ''; $target_release == 'NOVEMBER' ? $month = 11 : ''; $target_release == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT TICKET_ID, TITLE, APPLICATION, TARGET_RELEASE, TARGET_CYCLE \n\t\t\tFROM vw_24fitness_all_tickets \n\t\t\tWHERE PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND \n\t\t\tto_date (?, 'yyyy/mm/dd') and it_group='DEV'\n\t\t\tand EXTRACT(MONTH FROM PROD_DEPLOYMENT_DATE)=" . $month . "\n\t\t\tORDER BY APPLICATION, TARGET_RELEASE, TARGET_CYCLE"; } else { $sql = "SELECT TICKET_ID, TITLE, APPLICATION, TARGET_RELEASE, TARGET_CYCLE "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE "; $sql .= "APPLICATION = '" . $application . "' AND "; $sql .= "TARGET_RELEASE = '" . $target_release . "' AND "; $sql .= "PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd') and it_group='DEV' "; $sql .= "ORDER BY APPLICATION, TARGET_RELEASE, TARGET_CYCLE "; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
public function get_series($selected_period = "x") { $series_data = NULL; $period = getFilter($selected_period); $query = $this->db->get_where('survey', array('period >=' => $period['start_date'], 'period <' => $period['end_date'], 'survey_type_id' => 2)); $survey_id = $query->result(); if ($survey_id != NULL) { for ($i = 0; $i < count($survey_id); $i++) { $query = $this->db->get_where('survey_question', array('survey_id' => $survey_id[$i]->id)); $survey[] = $query->result(); for ($j = 0; $j < count($this->get_questions()); $j++) { if ($i == 0) { if ($survey[0][$j]->answer_types_id != NULL) { $MAX[] = $MIN[] = (int) $survey[0][$j]->answer_types_id; $AVG[] = (double) $survey[0][$j]->answer_types_id; } } else { if ($survey[$i][$j]->answer_types_id != NULL) { $MAX[$j] < $survey[$i][$j]->answer_types_id ? $MAX[$j] = (int) $survey[$i][$j]->answer_types_id : (int) $MAX[$j]; $MIN[$j] > $survey[$i][$j]->answer_types_id ? $MIN[$j] = (int) $survey[$i][$j]->answer_types_id : (int) $MIN[$j]; $AVG[$j] += $survey[$i][$j]->answer_types_id; if (count($survey_id) - 1 == $i) { $AVG[$j] = (double) ($AVG[$j] / count($survey_id)); } } } } } $series_data[] = array('name' => 'Max', 'data' => $MAX); $series_data[] = array('name' => 'Average', 'data' => $AVG); $series_data[] = array('name' => 'Min', 'data' => $MIN); } return $series_data; }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $assigned_to User to show detail. * * @return array Information relevant to the Utilization graph. * */ public function get_utilization_detailed_data($selected_period = "x", $assigned_to) { $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $assigned_to == 'JANUARY' ? $month = 1 : ''; $assigned_to == 'FEBRUARY' ? $month = 2 : ''; $assigned_to == 'MARCH' ? $month = 3 : ''; $assigned_to == 'APRIL' ? $month = 4 : ''; $assigned_to == 'MAY' ? $month = 5 : ''; $assigned_to == 'JUNE' ? $month = 6 : ''; $assigned_to == 'JULY' ? $month = 7 : ''; $assigned_to == 'AUGUST' ? $month = 8 : ''; $assigned_to == 'SEPTEMBER' ? $month = 9 : ''; $assigned_to == 'OCTOBER' ? $month = 10 : ''; $assigned_to == 'NOVEMBER' ? $month = 11 : ''; $assigned_to == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT ticket_id, ASSIGNED_TO, title, IT_GROUP, ACTUAL_EFFORT, actual_finish_date \n\t\t\tFROM vw_24fitness_all_tickets \n\t\t\tWHERE (actual_finish_date between to_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd')) AND IT_GROUP = 'DEV' \n\t\t\tand EXTRACT(MONTH FROM actual_finish_date)=" . $month . " order by actual_finish_date"; } else { $sql = "SELECT ticket_id, ASSIGNED_TO, title, IT_GROUP, ACTUAL_EFFORT, actual_finish_date "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE (actual_finish_date between to_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd')) AND IT_GROUP = 'DEV' "; $sql .= "and ASSIGNED_TO = '" . $assigned_to . "' order by assigned_to"; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
public function get_defect_rate_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ticket_id, title, APPLICATION, TARGET_RELEASE, SUM(CASE WHEN TYPE_24FITNESS = 'Defect' THEN 1 ELSE 0 END) AS DEFECTS, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' OR TYPE_24FITNESS = 'Requirement' THEN 1 ELSE 0 END) AS TASKS, PROD_DEPLOYMENT_DATE "; $sql .= "FROM vw_24fitness_all_tickets where PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd') and application='" . $application . "' and target_release='" . $target_release . "' "; $sql .= "group by ticket_id , APPLICATION, TARGET_RELEASE, PROD_DEPLOYMENT_DATE, title order by application, target_release "; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
public function get_efficiency_detailed_data($selected_period = "x", $assigned_to) { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ticket_id , ASSIGNED_TO, title, IT_GROUP, actual_effort, SCHED_FINISH_DATE "; $sql .= "FROM vw_24fitness_all_tickets WHERE IT_GROUP = 'DEV' and "; $sql .= "ACTUAL_EFFORT is not null and SCHED_FINISH_DATE between "; $sql .= "to_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd') and assigned_to='" . $assigned_to . "' "; $sql .= "GROUP BY ticket_id, actual_effort, assigned_to, IT_GROUP, title, SCHED_FINISH_DATE "; $sql .= "ORDER BY assigned_to"; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail.. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the Total Effort graph. * */ public function get_total_effort_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ticket_id, TITLE, APPLICATION, TARGET_RELEASE,SUM(ESTIMATED_FIX_TIME) as TOTAL_EFFORT, "; $sql .= "PROD_DEPLOYMENT_DATE FROM vw_24fitness_all_tickets "; $sql .= "where PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND to_date (?, 'yyyy/mm/dd') "; $sql .= "AND target_release='" . $target_release . "' and application='" . $application . "' "; $sql .= "GROUP BY ticket_id, TITLE, PROD_DEPLOYMENT_DATE, APPLICATION, TARGET_RELEASE "; $sql .= "ORDER BY target_release"; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail.. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the Defect Leakage and Defect Removal Rate graph. * */ public function get_defect_leakage_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ticket_id, title, APPLICATION, TARGET_RELEASE, prod_deployment_date, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' AND (test_env like '%QA%' or test_env like '%ALL%') THEN 1 ELSE 0 END) AS DEFECT_QA, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' AND (test_env like '%Prod%' or test_env like '%ALL%') THEN 1 ELSE 0 END) AS DEFECT_PROD "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE (TYPE_24FITNESS = 'Defect' AND (test_env like '%QA%' or test_env like '%ALL%') OR TYPE_24FITNESS = 'Defect' AND (test_env like '%Prod%' or test_env like '%ALL%') AND "; $sql .= "prod_deployment_date between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd')) AND target_release='" . $target_release . "' and application='" . $application . "' GROUP BY TYPE_24FITNESS, test_env, APPLICATION, TARGET_RELEASE, ticket_id, title, prod_deployment_date "; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
public function get_defect_leakage_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ticket_id, title, APPLICATION, TARGET_RELEASE, PROD_DEPLOYMENT_DATE, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' AND IT_GROUP = 'QA' THEN 1 ELSE 0 END) AS DEFECT_QA, "; $sql .= "SUM(CASE WHEN TYPE_24FITNESS = 'Defect' AND IT_GROUP = 'DEV' THEN 1 ELSE 0 END) AS DEFECT_PROD "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE (TYPE_24FITNESS = 'Defect' and IT_GROUP = 'QA' OR TYPE_24FITNESS = 'Defect' AND IT_GROUP = 'DEV' AND "; $sql .= "TARGET_RELEASE <> 'NULL' AND "; $sql .= "PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd')) AND target_release='" . $target_release . "' and application='" . $application . "' GROUP BY TYPE_24FITNESS, IT_GROUP, APPLICATION, TARGET_RELEASE, ticket_id, title, PROD_DEPLOYMENT_DATE "; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
public function get_estimation_variance($selected_period = "x") { $this->db_tickets = $this->load->database('oracle', TRUE); $sql = "SELECT ASSIGNED_TO, ROUND(AVG((ACTUAL_EFFORT / ESTIMATED_FIX_TIME)),2) as ESTIMATION_VARIANCE "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE "; $sql .= "ACTUAL_EFFORT IS NOT NULL AND "; $sql .= "ACTUAL_EFFORT !=0 AND "; $sql .= "ESTIMATED_FIX_TIME IS NOT NULL AND "; $sql .= "ESTIMATED_FIX_TIME !=0 AND "; $sql .= "IT_GROUP='BI' AND "; $sql .= "SCHED_FINISH_DATE IS NOT NULL AND "; $sql .= "SCHED_FINISH_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd') "; $sql .= "GROUP BY ASSIGNED_TO "; $sql .= "ORDER BY ASSIGNED_TO"; $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail.. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the Release Size graph. * */ public function get_release_size_detailed_data($selected_period = "x", $application, $target_release) { $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $target_release == 'JANUARY' ? $month = 1 : ''; $target_release == 'FEBRUARY' ? $month = 2 : ''; $target_release == 'MARCH' ? $month = 3 : ''; $target_release == 'APRIL' ? $month = 4 : ''; $target_release == 'MAY' ? $month = 5 : ''; $target_release == 'JUNE' ? $month = 6 : ''; $target_release == 'JULY' ? $month = 7 : ''; $target_release == 'AUGUST' ? $month = 8 : ''; $target_release == 'SEPTEMBER' ? $month = 9 : ''; $target_release == 'OCTOBER' ? $month = 10 : ''; $target_release == 'NOVEMBER' ? $month = 11 : ''; $target_release == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT TICKET_ID, TITLE, APPLICATION, TARGET_RELEASE, assigned_to, PROD_DEPLOYMENT_DATE, SUM(actual_effort) as Release_Size \n\t\t\tFROM vw_24fitness_all_tickets \n\t\t\tWHERE PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND \n\t\t\tto_date (?, 'yyyy/mm/dd') and it_group='BI'\n\t\t\tand EXTRACT(MONTH FROM PROD_DEPLOYMENT_DATE)=" . $month . "\n \t\tGROUP BY ticket_id, TITLE, PROD_DEPLOYMENT_DATE, APPLICATION, TARGET_RELEASE, assigned_to, it_group"; } else { $sql = "SELECT ticket_id, title, application, target_release, assigned_to, PROD_DEPLOYMENT_DATE,\n\t\t\tit_group, SUM(actual_effort) as Release_Size, \n\t\t\tTO_CHAR(PROD_DEPLOYMENT_DATE, 'YYYY/MM') as ByYearMonth \n\t\t\tFROM vw_24fitness_all_tickets where PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND \n\t\t\tto_date (?, 'yyyy/mm/dd') and it_group='BI' AND target_release='" . $target_release . "' and \n\t\t\tapplication='" . $application . "'\n\t\t\tGROUP BY ticket_id, TITLE, PROD_DEPLOYMENT_DATE, APPLICATION, TARGET_RELEASE, assigned_to, it_group"; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
<?php if (isset($_GET["expert"])) { $expertName = $_GET["expert"]; $expert = getExpert($expertName); $expert = $expert->speaker; } else { $experts = array(); $currPage = isset($_GET["p"]) ? $_GET["p"] : 1; $keyword = isset($_GET["q"]) ? $_GET["q"] : ""; $availability = isset($_GET["a"]) ? $_GET["a"] : ""; $industry = isset($_GET["i"]) ? $_GET["i"] : ""; $sort = isset($_GET["s"]) ? $_GET["s"] : "name"; $pagesize = isset($_GET["n"]) ? $_GET["n"] : 10; $responseData = getResults($currPage, $keyword, $availability, $industry, $sort, $pagesize); $filters = getFilter($currPage, $keyword, $availability, $industry, $sort, $pagesize); $pagination = buildPagination($currPage, $responseData->total, $pagesize); $searchDetail = getSearchInfo($currPage, $responseData->total, $pagesize); $filterArray = array(); if ($sort !== 'name') { $filterArray[] = 's=' . $sort; } if ($pagesize !== 10) { $filterArray[] = 'n=' . $pagesize; } if (!empty($filterArray)) { $filterString = implode('&', $filterArray); } $filter_availability = $availability; $filter_industry = $industry; $filter_keyword = $keyword;
/** * Go to a assigned path, and send the array of file objects with JSON format to client. * @param unknown_type $path */ function gotoPath($path) { setCurrentPath($path); $file = @scandir($path); $files = array(); $dotPattern = '/^(\\.){1,2}$/i'; $suffixPattern = '/^[^\\.]\\S*(?<=\\.)(\\S+)$|^\\.\\S+(?<=\\.)(\\S+)$/i'; //Add all files in the current path to the array $files foreach ($file as $val) { if (!preg_match($dotPattern, $val)) { $fullName = $path . '/' . $val; $f = new file(); $f->name = $val; $f->type = filetype($fullName); $f->fileSize = filesize($fullName); $f->accessTime = fileatime($fullName); $f->modifyTime = filemtime($fullName); $matches = array(); preg_match($suffixPattern, $val, $matches); $f->suffix = @$matches[count($matches) - 1]; unset($matches); $files[] = $f; } } //filters //Search filter $fk = getSearchKeyword(); $caseInsensitive = 'true' == $fk[1] ? true : false; $files = filtrateFileNameByKeyword($files, $fk[0], $caseInsensitive); //Sort filter $sc = getSortCriteria(); $asc = 'true' == $sc[1] ? true : false; sortFiles($files, $sc[0], $asc); //Suffix and invisible filter $f = getFilter(); $invisible = 'true' == $f[1] ? true : false; if (!$invisible) { $files = filtrateHidden($files); } $files = filtrateSuffix($files, $f[0]); //Send the file list to the client echo json_encode($files); }
<?php $filterAlls = getFilterAll(); $filters = getFilter(Input::get('filter', array())); $colum_number = count($filters); if (!(in_array("Impressions", $filters) === false)) { $colum_number++; } if (!(in_array("Clicks", $filters) === false)) { $colum_number++; } ?> <!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> {{ HTML::style("{$assetURL}css/excel.css") }} </head> <body> <table> <tr class="mb12"><th colspan="{{($colum_number+1)}}" class="brand" valign="middle">Yomedia Digital - Flight Report Summary</th></tr> <tr><th align="center">Campaign Name:</th><th colspan="{{($colum_number)}}" align="center" >{{$campaign->name}}</th></tr> <tr><th align="center">Duration:</th><th colspan="{{$colum_number}}" align="center">{{$campaign->dateRange}}</th></tr> <tr><th align="center">Advertise:</th><th colspan="{{$colum_number}}" align="center">{{$campaign->advertiser->name}}</th></tr> <tr><th align="center">Agency:</th><th colspan="{{$colum_number}}" align="center">{{$campaign->agency->name}}</th></tr> </table> @if( !empty($listFlight) && $listFlight->count() ) @foreach( $listFlight as $flight )
function getWhere($where) { $clauses = array(); $sql = ''; if ($where) { foreach ($where as $w) { $clause = getFilter($w); if ($clause) { $clauses[] = $clause; } } } if ($clauses) { $sql = ' where ' . implode(' AND ', $clauses); } return $sql; }
$params[$k] = ${$k}; // unset key from params that are using default values. So URLs aren't // ridiculously long. if ($params[$k] == $v[1]) { unset($params[$k]); } } $vbar = ' class="vbar"'; $vwbar = ' class="vwbar"'; $vwlbar = ' class="vwlbar"'; $vbbar = ' class="vbbar"'; $vrbar = ' class="vrbar"'; $vgbar = ' class="vgbar"'; $xhprof_runs_impl = new XHProfRuns_Default(); $domainFilter = getFilter('domain_filter'); $serverFilter = getFilter('server_filter'); $domainsRS = $xhprof_runs_impl->getDistinct(array('column' => 'server_name')); $domainFilterOptions = array("None"); while ($row = XHProfRuns_Default::getNextAssoc($domainsRS)) { $domainFilterOptions[] = $row['server_name']; } $serverRS = $xhprof_runs_impl->getDistinct(array('column' => 'server_id')); $serverFilterOptions = array("None"); while ($row = XHProfRuns_Default::getNextAssoc($serverRS)) { $serverFilterOptions[] = $row['server_id']; } $criteria = array(); if (!is_null($domainFilter)) { $criteria['server_name'] = $domainFilter; } if (!is_null($serverFilter)) {
function widget_goods(&$setting, &$system) { $o = $system->loadModel('goods/products'); $limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6; $config = $system->getConf('site.save_price'); $setting['onSelect'] = $setting['onSelect'] ? $setting['onSelect'] : 0; $setting['max_length'] = $setting['max_length'] ? $setting['max_length'] : 35; $setting['view'] = $system->getConf('gallery.default_view'); $search = $system->loadModel('goods/search'); $setting['str'] = $search->encode($filter); $oSearch = $system->loadModel('goods/search'); $output = $system->loadModel('system/frontend'); if ($output->theme) { $theme_dir = $system->base_url() . 'themes/' . $output->theme; } else { $theme_dir = $system->base_url() . 'themes/' . $system->getConf('system.ui.current_theme'); } $setting['titleImgSrc'] = $setting['titleImgSrc'] ? str_replace('%THEME%', $theme_dir, $setting['titleImgSrc']) : ''; $setting['restrict'] = $setting['restrict'] ? $setting['restrict'] : 'on'; $order = $setting['goods_orderby'] ? $o->orderBy($setting['goods_orderby']) : null; if ($setting['columNum'] > 1) { for ($i = 1; $i <= $setting['columNum']; $i++) { parse_str($setting['filter' . $i], $filter[$i]); $filter[$i] = getFilter($filter[$i]); if ($filter[$i]['cat_id']) { $setting['cat_id'] = implode(",", $filter[$i]['cat_id']); } else { $setting['cat_id'] = 0; } if ($filter[$i]['type_id'] && !is_array($filter[$i]['type_id'])) { $filter[$i]['type_id'] = array($filter[$i]['type_id']); } if ($filter[$i]['pricefrom']) { $filter[$i]['price'][0] = $filter[$i]['pricefrom']; } if ($filter[$i]['priceto']) { if (!$filter[$i]['price'][0]) { $filter[$i]['price'][0] = 0; } $filter[$i]['price'][1] = $filter[$i]['priceto']; } $setting['link'][$i - 1] = $system->mkUrl('gallery', $setting['view'], array(implode(",", $filter[$i]['cat_id']), $oSearch->encode($filter[$i]), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)); $result[] = $o->getList(null, $filter[$i], 0, $limit, $c, $order['sql']); unset($filter[$i]); } return $result; } else { parse_str($setting['filter1'], $filter); $filter = getFilter($filter); if (!is_array($filter['cat_id'])) { $filter['cat_id'] = array($filter['cat_id']); } if ($filter['type_id'] && !is_array($filter['type_id'])) { $filter['type_id'] = array($filter['type_id']); } if ($filter['pricefrom']) { $filter['price'][0] = $filter['pricefrom']; } if ($filter['priceto']) { if (!$filter['price'][0]) { $filter['price'][0] = 0; } $filter['price'][1] = $filter['priceto']; } $oSearch = $system->loadModel('goods/search'); $setting['link'] = $system->mkUrl('gallery', $setting['view'], array(implode(",", $filter['cat_id']), $oSearch->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)); $result = $o->getList(null, $filter, 0, $limit, $c, $order['sql']); return $result; } }
require_once 'lib/indexfilter.php'; require_once 'lib/index.php'; require_once 'vendor/autoload.php'; require_once 'specs/spechelpers.php'; describe("Index Filter", function () { it("should return a list of matching index IDs", function () { $Filter = getFilter(); $results = $Filter->filter(null, 'date', '1660')->ids(); expect($results)->to_equal(array(0, 1)); }); it("should be able to filter down indefinitely", function () { $Filter = getFilter(); $results = $Filter->filter(null, 'imprint', 'London')->filter(null, 'date', '1780')->ids(); expect($results)->to_equal(array(2)); }); }); describe("an empty IndexFilter", function () { it("should return all ids", function () { $Filter = getFilter(); $results = $Filter->filter()->ids(); expect($results)->to_equal(array(0, 1, 2, 3, 4)); }); }); describe("Traversing out from a filter with a predicate (printed.date=1780 )", function () { it("Should select all subjects with that predicate, and the existing filter set as objects", function () { $Filter = getFilter(); $results = $Filter->filter(null, 'date', '1780')->traverseOut('printed')->ids(); expect($results)->to_equal(array(4)); }); }); //\pecs\run();
/** * Create and send the catalog page for the current search criteria. * The search criteria is a GET paramter string. * * @param integer $index index of page in search */ function opdsBySearch($index = 0) { global $app, $globalSettings; // parameter checking if (!is_numeric($index)) { $app->getLog()->warn('opdsBySearch: invalid page id ' . $index); $app->halt(400, "Bad parameter"); } $search = $app->request()->get('search'); if (!isset($search)) { $app->getLog()->error('opdsBySearch called without search criteria, page ' . $index); // 400 Bad request $app->response()->status(400); return; } $filter = getFilter(); $tl = $app->calibre->titlesSlice($globalSettings['lang'], $index, $globalSettings[PAGE_SIZE], $filter, $search); $books1 = $app->calibre->titleDetailsFilteredOpds($tl['entries']); $books = array_map('checkThumbnailOpds', $books1); $gen = mkOpdsGenerator($app); $cat = $gen->searchCatalog(NULL, $books, false, $tl['page'], getNextSearchPage($tl), getLastSearchPage($tl), $search, $tl['total'], $globalSettings[PAGE_SIZE]); mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_ACQ); }
function widget_goods(&$setting, &$system) { $o = $system->loadModel('goods/products'); $limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6; $config = $system->getConf('site.save_price'); $data['onSelect'] = $setting['onSelect'] ? $setting['onSelect'] : 0; $setting['max_length'] = $setting['max_length'] ? $setting['max_length'] : 35; $setting['view'] = $system->getConf('gallery.default_view'); $search = $system->loadModel('goods/search'); $setting['str'] = $search->encode($filter); $oSearch = $system->loadModel('goods/search'); $setting['restrict'] = $setting['restrict'] ? $setting['restrict'] : 'on'; $order = $setting['goods_orderby'] ? $o->orderBy($setting['goods_orderby']) : null; if ($setting['columNum'] > 1) { for ($i = 1; $i <= $setting['columNum']; $i++) { parse_str($setting['filter' . $i], $filter[$i]); $filter[$i] = getFilter($filter[$i]); if ($filter[$i]['cat_id']) { $setting['cat_id'] = implode(",", $filter[$i]['cat_id']); } else { $setting['cat_id'] = 0; } if ($filter[$i]['type_id'] && !is_array($filter[$i]['type_id'])) { $filter[$i]['type_id'] = array($filter[$i]['type_id']); } if ($filter[$i]['pricefrom']) { $filter[$i]['price'][0] = $filter[$i]['pricefrom']; } if ($filter[$i]['priceto']) { if (!$filter[$i]['price'][0]) { $filter[$i]['price'][0] = 0; } $filter[$i]['price'][1] = $filter[$i]['priceto']; } $result['link'][$i - 1] = $system->mkUrl('gallery', $setting['view'], array(implode(",", $filter[$i]['cat_id']), $oSearch->encode($filter[$i]), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)); $result['goods'][] = $o->getList(null, $filter[$i], 0, $limit, $order['sql']); unset($filter[$i]); } return $result; } else { parse_str($setting['filter1'], $filter); $filter = getFilter($filter); if (!is_array($filter['cat_id']) && $filter['cat_id']) { $filter['cat_id'] = array($filter['cat_id']); } if (!$filter['cat_id']) { unset($filter['cat_id']); } if ($filter['type_id'] && !is_array($filter['type_id'])) { $filter['type_id'] = array($filter['type_id']); } if ($filter['pricefrom']) { $filter['price'][0] = $filter['pricefrom']; } if ($filter['priceto']) { if (!$filter['price'][0]) { $filter['price'][0] = 0; } $filter['price'][1] = $filter['priceto']; } $oSearch = $system->loadModel('goods/search'); $result['link'] = $system->mkUrl('gallery', $setting['view'], array(implode(",", $filter['cat_id']), $oSearch->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)); $result['goods'] = $o->getList(null, $filter, 0, $limit, $order['sql']); $result['goods'] = $o->getList(null, $filter, 0, $limit, $order['sql']); $result['goods_num'] = count($result['goods']); return $result; } }
/** * Gets a collection of data relevant to each point of the graph, to show details of each ticket. * * @param int $selectedPeriod period selected for display. * @param String $application Application to show detail.. * @param String $target_release Target Release to show detail. * * @return array Information relevant to the On Time Delivery graph. * */ public function get_otd_detailed_data($selected_period = "x", $application, $target_release) { //Changing the name of this application: application='Web Admin Tool' $this->db_tickets = $this->load->database('oracle', TRUE); if ($selected_period == 'year') { //This is to rename the names of the months by digit, for the search in the query. $target_release == 'JANUARY' ? $month = 1 : ''; $target_release == 'FEBRUARY' ? $month = 2 : ''; $target_release == 'MARCH' ? $month = 3 : ''; $target_release == 'APRIL' ? $month = 4 : ''; $target_release == 'MAY' ? $month = 5 : ''; $target_release == 'JUNE' ? $month = 6 : ''; $target_release == 'JULY' ? $month = 7 : ''; $target_release == 'AUGUST' ? $month = 8 : ''; $target_release == 'SEPTEMBER' ? $month = 9 : ''; $target_release == 'OCTOBER' ? $month = 10 : ''; $target_release == 'NOVEMBER' ? $month = 11 : ''; $target_release == 'DECEMBER' ? $month = 12 : ''; $sql = "SELECT TICKET_ID, TITLE, APPLICATION, TARGET_RELEASE, ASSIGNED_TO, ACTUAL_FINISH_DATE, SCHED_FINISH_DATE, prod_deployment_date\n\t\t\tFROM vw_24fitness_all_tickets \n\t\t\tWHERE IT_GROUP='DEV' AND \n\t\t\tprod_deployment_date between to_date (?, 'yyyy/mm/dd') AND \n\t\t\tto_date (?, 'yyyy/mm/dd') and EXTRACT(MONTH FROM prod_deployment_date)=" . $month . "\n\t\t\torder by prod_deployment_date"; } else { $sql = "SELECT TICKET_ID, TITLE, APPLICATION, TARGET_RELEASE, ASSIGNED_TO, ACTUAL_FINISH_DATE, SCHED_FINISH_DATE, PROD_DEPLOYMENT_DATE "; $sql .= "FROM vw_24fitness_all_tickets "; $sql .= "WHERE IT_GROUP='DEV' AND "; $sql .= "APPLICATION = '" . $application . "' AND "; $sql .= "TARGET_RELEASE = '" . $target_release . "' AND "; $sql .= "PROD_DEPLOYMENT_DATE between to_date (?, 'yyyy/mm/dd') AND "; $sql .= "to_date (?, 'yyyy/mm/dd') "; } $query = $this->db_tickets->query($sql, getFilter($selected_period)); return $query->result(); }
/** * Shows information for the current period from the beginning to the end of this period. */ public function testfilter($selected = "x") { var_dump(getFilter($selected)); die; }
/** * A filter of the column is stored in session ? * * @param string $columnId * Id of the column * @return boolean * @throws \Exception */ public function hasFilter($columnId) { if ($this->hash === null) { throw new \Exception('hasFilters method is only available in the manipulate callback function or after the call of the method isRedirected of the grid.'); } return getFilter($columnId) !== null; }
} elseif ($_SERVER['REQUEST_METHOD'] == "POST") { Log::debug('Route Service: Detailed route request posted.', 5); // takes posted data of points and renders more accurate point by point route $json = file_get_contents('php://input'); $data = json_decode($json); $maxDetour = 25; $numToReturn = 50; if (array_key_exists('maxDetour', $data)) { $maxDetour = $data->{'maxDetour'}; } if (array_key_exists('return', $data)) { $numToReturn = $data->{'return'}; } $filter = ''; if (array_key_exists('categories', $data)) { $filter = getFilter($data->{'categories'}); } if (!array_key_exists('points', $data)) { Service::returnError('An array of points must be posted to retrieve a route.'); } $points = $data->{'points'}; $rows = array(); for ($i = 1; $i < count($points); $i++) { Log::debug('Processing point #' . $i . ' ' . $points[$i]->lat . ', ' . $points[$i]->lng, 1); $data = fetchData($points[$i - 1]->lat, $points[$i - 1]->lng, $points[$i]->lat, $points[$i]->lng, $maxDetour, $numToReturn, $filter, $tenantID, $userID); while ($r = mysqli_fetch_assoc($data)) { if (!alreadyInSet($rows, $r)) { $rows[] = $r; } } }
// Сохраняем историю изменения статусов $change_status_query = "INSERT INTO helpdesk_history (`changed`,`changer`,`ticket`,`status`)\r\n VALUES (NOW(), '{$admin_id}','{$id}', '1')"; $db->query($change_status_query); } // Куда перенаправляем? $url = $back == 1 ? "/helpdesk" : "/helpdesk?stage=edit&id={$id}"; header("Location: http://" . $_SERVER["HTTP_HOST"] . $url); break; // Список всех заявок с фильтром/без // Список всех заявок с фильтром/без default: if (!$c['filter']) { $settings = json_decode($admin_login['settings'], true); $def_filter = $settings['helpdesk_def_filter']; if ($def_filter) { $filter = getFilter($def_filter); header("Location: ./?filter={$filter}"); } } $c['row_count'] = getListRowCount($c['filter']); $c['pages'] = ceil($c['row_count'] / $c['r']); $c['tickets'] = getTicketList($c['filter'], $c['ob'], $c['od'], $c['page'], $c['r'], 'filter'); if ($c['ob'] == $default_order) { $c['ob'] = ''; } break; } // $c['test'] = microtime() - $c['test']; echo $twig->render($template, $c); } else { $_SESSION["ref"] = "helpdesk";
} } return 'Showing <strong>' . $p . '</strong> - <strong>' . $o . '</strong>' . ' of <strong>' . $total . '</strong>'; } if (isset($_GET["expert"])) { $expertName = $_GET["expert"]; $expert = getExpert($expertName); $expert = $expert->speaker; } else { $experts = array(); $currPage = isset($_GET["p"]) ? $_GET["p"] : 1; $keyword = isset($_GET["q"]) ? $_GET["q"] : ""; $availability = isset($_GET["a"]) ? $_GET["a"] : ""; $industry = isset($_GET["i"]) ? $_GET["i"] : ""; $responseData = getResults($currPage, $keyword, $availability, $industry); $filters = getFilter($currPage, $keyword, $availability, $industry); $pagination = buildPagination($currPage, $responseData->total, 5); $searchDetail = getSearchInfo($currPage, $responseData->total, 5); $filter_availability = $availability; $filter_industry = $industry; $filter_keyword = $keyword; if ($responseData->success) { $experts = $responseData->speakers; $total = $responseData->total; } } require_once "header.inc"; ?> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> <body>
function postfilter_repl($filter, $value, $options = '') { if (!function_exists('postfilter_' . $filter) and !function_exists('filter_' . $filter)) { $ff = getFilter($filter); if (!$ff) { return $value; } include_once "plugin/filter/{$ff}.php"; #$filter=$ff; } if (!function_exists("postfilter_" . $filter)) { return $value; } return call_user_func("postfilter_{$filter}", $this, $value, $options); }