예제 #1
0
 /**
  * function to get the prospect wins
  * @param string $where
  * @param integer $iduser
  * @param integer $date_filter_type
  * @param string $start_date
  * @param string $date_end
  * @return array
  */
 public function get_detailed_win_data($where = '', $iduser = 0, $date_filter_type, $start_date = '', $end_date = '')
 {
     $do_potentials = new Potentials();
     $do_potentials->get_list_query();
     if ($where == '') {
         $user_where = $this->get_report_where($iduser, 'potentials', 'pot_to_grp_rel');
         $date_where = $this->get_date_filter_where('potentials', 'expected_closing_date', $date_filter_type, $start_date = '', $end_date = '');
         $additonal_where = " AND\n\t\t\t`potentials`.`sales_stage` = 'Close Win'\n\t\t\t";
         $where = $user_where . $date_where . $additonal_where;
     }
     $qry = $do_potentials->getSqlQuery();
     $qry .= $where;
     $this->query($qry);
 }
예제 #2
0
 /**
  * function to get the detailed forcasting data 
  * @param string $where
  * @param integer $iduser
  * @return void
  */
 public function get_detailed_forecast_data($where = '', $iduser = 0)
 {
     $do_potentials = new Potentials();
     $do_potentials->get_list_query();
     if ($where == '') {
         $user_where = $this->get_report_where($iduser, 'potentials', 'pot_to_grp_rel');
     }
     $date_where = '';
     $start_date = TimeZoneUtil::get_user_timezone_date();
     $date_obj = new DateTime($start_date);
     $add_89 = $date_obj->modify('+89 day');
     $end_date = $add_89->format('Y-m-d');
     $date_where = " and `potentials`.`expected_closing_date` >= '{$start_date}' \n\t\tand `potentials`.`expected_closing_date` <= '{$end_date}' \n\t\t";
     $qry = $do_potentials->getSqlQuery();
     $qry .= $user_where . $date_where . " order by `potentials`.`expected_closing_date`";
     $this->query($qry);
 }
예제 #3
0
 /**
  * function to get the detailed funnel data 
  * @param string $where
  * @param integer $iduser
  * @param integer $date_filter_type
  * @param string $start_date
  * @param string $date_end
  * @return array
  */
 public function get_detailed_funnel_data($where = '', $iduser = 0, $date_filter_type, $start_date = '', $end_date = '')
 {
     $do_potentials = new Potentials();
     $do_potentials->get_list_query();
     if ($where == '') {
         $user_where = $this->get_report_where($iduser, 'potentials', 'pot_to_grp_rel');
         $date_where = $this->get_date_filter_where('potentials', 'expected_closing_date', $date_filter_type, $start_date = '', $end_date = '');
         $where = $user_where . $date_where;
     }
     $qry = $do_potentials->getSqlQuery();
     $qry .= $where;
     $this->query($qry);
 }