Jump to content

dbert

New Members
  • Posts

    6
  • Joined

  • Last visited

dbert's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Let me test it, thanks Barand.
  2. and this is how report looks like, you will notice that the months are scattered all over the place.
  3. Hi Barand, it is because of this: if( $report_type < 5) { $array_data[$i][0] = $row['role'] .' '. $row['role_other'] ; $array_data[$i][1] = $row['description'] ; $array_data[$i][2] = ($row['is_UBC'] ? 'Yes' : null ) ; if ( $row['month'] <> '') $row['month'] = $row['month'] . '/'; $array_data[$i][3] = ltrim($row['month'] .''. $row['year']) ; $array_data[$i][100] = false; $i++; }
  4. and this is where the data is entered: <?php echo $this->Form->select('ContinuingEducationActivity/month', $monthArray, array('id' => 'month', )) ?> <?php echo $this->Form->select('ContinuingEducationActivity/year', $endYearArray, array('id' => 'year', 'value'=>$default_year)) ?> and this is one of the controller: function global_init(){ $monthArray = array( NULL => '', '01' => '01', '02'=> '02', '03'=> '03', '04'=> '04', '05'=> '05', '06'=> '06', '07'=> '07', '08'=> '08', '09'=> '09' , '10'=> '10' , '11' => '11', '12' => '12' ); $this->set('monthArray', $monthArray ); $endYearArray = array( 'Present'=>'Present', '1950'=>'1950', '1951'=>'1951', '1952'=>'1952', '1953'=>'1953', '1954'=>'1954', '1955'=>'1955', '1956'=>'1956', '1957'=>'1957', '1958'=>'1958', '1959'=>'1959', '1960'=>'1960', '1961'=>'1961', '1962'=>'1962', '1963'=>'1963', '1964'=>'1964', '1965'=>'1965', '1966'=>'1966', '1967'=>'1967', '1968'=>'1968', '1969'=>'1969', '1970'=>'1970', '1971'=>'1971', '1972'=>'1972', '1973'=>'1973', '1974'=>'1974', '1975'=>'1975', '1976'=>'1976', '1977'=>'1977', '1978'=>'1978', '1979'=>'1979', '1980'=>'1980', '1981'=>'1981', '1982'=>'1982', '1983'=>'1983', '1984'=>'1984', '1985'=>'1985', '1986'=>'1986', '1987'=>'1987', '1988'=>'1988', '1989'=>'1989', '1990'=>'1990', '1991'=>'1991', '1992'=>'1992', '1993'=>'1993', '1994'=>'1994', '1995'=>'1995', '1996'=>'1996', '1997'=>'1997', '1998'=>'1998', '1999'=>'1999', '2000'=>'2000', '2001'=>'2001', '2002'=>'2002', '2003'=>'2003', '2004'=>'2004', '2005'=>'2005', '2006'=>'2006', '2007'=>'2007', '2008'=>'2008', '2009'=>'2009', '2010'=>'2010', '2011'=>'2011', '2012'=>'2012', '2013'=>'2013', '2014'=>'2014', '2015'=>'2015', '2016'=>'2016', '2017'=>'2017', '2018'=>'2018', '2019'=>'2019', '2020'=>'2020', '2021'=>'2021', '2022'=>'2022', '2023'=>'2023', '2024'=>'2024', '2025'=>'2025', '2026'=>'2026', '2027'=>'2027', '2028'=>'2028', '2029'=>'2029', '2030' ); $this->set('endYearArray', $endYearArray ); $this->set('default_year', date('Y')); }
  5. Hello this code is supposed to sort by year and month, but it doesn't. It sort by year and months are random. Any suggestions? Many thanks, $sortdata =[]; $namecolumn = array_column($data, '0'); foreach($data as $datecolumn){ $dateexplode = explode('/', $datecolumn[3]); $sortdata[] = (isset($dateexplode[1])) ? $dateexplode[1] : ((isset($dateexplode[0])) ? $dateexplode[0] : ''); } array_multisort($namecolumn, (($sorttype=='DESC') ? SORT_DESC : SORT_ASC), $sortdata, (($sorttype=='DESC') ? SORT_DESC : SORT_ASC), $data);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.