Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.66 KB | None | 0 0
  1. $count1 = 0;
  2.         $count2 = 0;
  3.         $count3 = 0;
  4.         $count4 = 0;
  5.         $count5 = 0;
  6.         $count6 = 0;
  7.         $count7 = 0;
  8.         $count8 = 0;
  9.         $count9 = 0;
  10.         $count10 = 0;
  11.         $count11 = 0;
  12.         $count12 = 0;
  13.        
  14.         $arrayBooked = array(
  15.             "Jan" => $count1,
  16.             "Feb" => $count2,
  17.             "Mar" => $count3,
  18.             "Apr" => $count4,
  19.             "May" => $count5,
  20.             "Jun" => $count6,
  21.             "Jul" => $count7,
  22.             "Aug" => $count8,
  23.             "Sep" => $count9,
  24.             "Oct" => $count10,
  25.             "Nov" => $count11,
  26.             "Dec" => $count12,
  27.         );
  28.        
  29.         for($i=0; $i<count($q); $i++){
  30.  
  31.             if(date("m",strtotime($q[$i]->created_date))=='01'){
  32.                 $count1++;
  33.                 $arrayBooked['Jan']=$count1;
  34.             }
  35.             else if(date("m",strtotime($q[$i]->created_date))=='02'){
  36.                 $count2++;
  37.                 $arrayBooked['Feb']=$count2;
  38.             }
  39.             else if(date("m",strtotime($q[$i]->created_date))=='03'){
  40.                 $count3++;
  41.                 $arrayBooked['Mar']=$count3;
  42.             }
  43.             else if(date("m",strtotime($q[$i]->created_date))=='04'){
  44.                 $count4++;
  45.                 $arrayBooked['Apr']=$count4;
  46.             }
  47.             else if(date("m",strtotime($q[$i]->created_date))=='05'){
  48.                 $count5++;
  49.                 $arrayBooked['May']=$count5;
  50.             }
  51.             else if(date("m",strtotime($q[$i]->created_date))=='06'){
  52.                 $count6++;
  53.                 $arrayBooked['Jun']=$count6;
  54.             }
  55.             else if(date("m",strtotime($q[$i]->created_date))=='07'){
  56.                 $count7++;
  57.                 $arrayBooked['Jul']=$count7;
  58.             }
  59.             else if(date("m",strtotime($q[$i]->created_date))=='08'){
  60.                 $count8++;
  61.                 $arrayBooked['Aug']=$count8;
  62.             }
  63.             else if(date("m",strtotime($q[$i]->created_date))=='09'){
  64.                 $count9++;
  65.                 $arrayBooked['Sep']=$count9;
  66.             }
  67.             else if(date("m",strtotime($q[$i]->created_date))=='10'){
  68.                 $count10++;
  69.                 $arrayBooked['Oct']=$count10;
  70.             }
  71.             else if(date("m",strtotime($q[$i]->created_date))=='11'){
  72.                 $count11++;
  73.                 $arrayBooked['Nov']=$count11;
  74.             }
  75.             else if(date("m",strtotime($q[$i]->created_date))=='12'){
  76.                 $count12++;
  77.                 $arrayBooked['Dec']=$count12;
  78.             }
  79.         }
  80.  
  81.         $data['userReg'] = $arrayBooked;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement