$monthsInYear = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
$textMonths = array("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec");
$testing = sortByMonth($quotes, $currentMonth, $Theyear);
$poppyseeds = getTheDate($quotes, $currentMonth, $Theyear);
function dates_month($month, $year)
{
    $num = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    $dates_month = array();
    for ($i = 1; $i <= $num; $i++) {
        $mktime = mktime(0, 0, 0, $month, $i, $year);
        $date = date("n-j-Y", $mktime);
        $dates_month[$i] = $date;
    }
    return $dates_month;
}
$dates = dates_month($currentMonth, $Theyear);
if (count($testing) > 0) {
    ?>

 <section class="numberContainer">
   <span class="top"> Number of Quotes in <?php 
    echo $textMonths[$currentMonth - 1];
    ?>
</span>
   <p> <?php 
    echo $numQuotes = count($testing);
    ?>
 </p>
 </section>
 <section class="numberContainer">
   <span class="top">Number of Quoted Pieces in <?php 
Example #2
0
 }
 /* Single Select Filter */
 if (count($selectedMonths) == 1) {
     $selMon = $selectedMonths[0];
     function dates_month($month, $year)
     {
         $num = cal_days_in_month(CAL_GREGORIAN, $month, $year);
         $dates_month = array();
         for ($i = 1; $i <= $num; $i++) {
             $mktime = mktime(0, 0, 0, $month, $i, $year);
             $date = date("d", $mktime);
             $dates_month[$i] = $date;
         }
         return $dates_month;
     }
     $listDays = dates_month($selMon, $selectedYear);
     //print_r(dates_month($selMon,$selectedYear));
     foreach ($listDays as $k => $v) {
         $table_qry[] = " " . (count($table_qry) > 1 ? ' OR ' : ' ') . " (MONTH(add_date)='" . mysql_prep($selMon) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "') ";
         $graph_lab[] = '"' . $LETHE_MONTH_NAMES['short'][$selMon] . ' ' . $v . '"';
         $graph_data['click'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=0 AND CID=" . $ID . " AND DAY(add_date)='" . mysql_prep($v) . "' AND MONTH(add_date)='" . mysql_prep($selMon) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
         $graph_data['open'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=1 AND CID=" . $ID . " AND DAY(add_date)='" . mysql_prep($v) . "' AND MONTH(add_date)='" . mysql_prep($selMon) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
         $graph_data['bounce'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=2 AND CID=" . $ID . " AND DAY(add_date)='" . mysql_prep($v) . "' AND MONTH(add_date)='" . mysql_prep($selMon) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
     }
 } else {
     foreach ($selectedMonths as $k => $v) {
         $table_qry[] = " " . (count($table_qry) > 1 ? ' OR ' : ' ') . " (MONTH(add_date)='" . mysql_prep($v) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "') ";
         $graph_lab[] = '"' . $LETHE_MONTH_NAMES['short'][$v] . ' ' . date("y", strtotime("01-01-" . $selectedYear)) . '"';
         $graph_data['click'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=0 AND CID=" . $ID . " AND MONTH(add_date)='" . mysql_prep($v) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
         $graph_data['open'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=1 AND CID=" . $ID . " AND MONTH(add_date)='" . mysql_prep($v) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
         $graph_data['bounce'][] = cntData("SELECT ID FROM " . db_table_pref . "reports WHERE OID=" . set_org_id . " AND pos=2 AND CID=" . $ID . " AND MONTH(add_date)='" . mysql_prep($v) . "' AND YEAR(add_date)='" . mysql_prep($selectedYear) . "'");
    }
}
$theArray = array_unique($actualDate);
$theArray = array_values($theArray);
function dates_month($month, $year)
{
    $num = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    $dates_month = array();
    for ($i = 1; $i <= $num; $i++) {
        $mktime = mktime(0, 0, 0, $month, $i, $year);
        $date = date("n-d-Y", $mktime);
        $dates_month[$i] = $date;
    }
    return $dates_month;
}
$dates = dates_month($currentMonth, 2015);
/*
foreach($month as $key => $theMonth) {
  if($theMonth == $currentMonth)
    echo $actualDate[$key];
}
*/
?>
<div class="activeQuotes">
  <p class="badgeTitle">
    Quotes Made in <?php 
echo $dasMonth;
?>
 &#187;
  </p>
  <div class="data">
$link = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_SCHEMA) or die(mysqli_error($link));
//: End
//: Content
$fleetdayobj = new fleetDayHandler();
function dates_month($month, $year)
{
    $num = cal_days_in_month(CAL_GREGORIAN, $month, $year);
    $dates_month = array();
    for ($i = 1; $i <= $num; $i++) {
        $mktime = mktime(0, 0, 0, $month, $i, $year);
        $date = date("d-M-Y", $mktime);
        $dates_month[$i] = $date;
    }
    return $dates_month;
}
$days = dates_month(date("m"), date("Y"));
foreach ($days as $day) {
    if (date("d", strtotime($day)) > 31) {
        continue;
    }
    $fleetData = $fleetdayobj->pullT24FleetData(date("d", strtotime($day)));
    $fleet_trucks = (array) array();
    foreach ($fleetData as $row) {
        $fleet_trucks[$row["fleet_id"]][] = $row;
    }
    unset($fleetData);
    // print_r($fleet_trucks);
    $t24Budget = (array) array();
    foreach ($fleet_trucks as $fleetId => $truck) {
        $trucks = (string) "";
        foreach ($truck as $data) {