Example #1
0
function build_table($array, $me)
{
    $html = '<table class="table js_data_table table-bordered table-striped">';
    // header row
    $html .= '<thead><tr>';
    foreach ($array[0] as $key => $value) {
        $html .= '<th>' . $key . '</th>';
    }
    $html .= '<th>' . 'Actions' . '</th>';
    $html .= '</tr><thead><tbody>';
    // data rows
    foreach ($array as $key => $value) {
        $html .= '<tr>';
        foreach ($value as $key2 => $value2) {
            $html .= '<td>' . getCellData($key2, $value2, $me) . '</td>';
        }
        //        print_r('<pre>');
        //        print_r($value);
        //        print_r('</pre>');
        $html .= '<td>';
        $html .= '<div class="tools">' . '<a href="' . site_url('templates/edit/' . $value['id']) . '" title="Edit" class="fa fa-edit"></a>' . '<a href="' . site_url('templates/delete/' . $value['id']) . '"title="Delete" class="fa fa-trash-o"></a>' . '</div>';
        $html .= '</td>';
        $html .= '</tr>';
    }
    $html .= '</tbody></table>';
    return $html;
}
        if (isset($monthEventDataList[$Day->thisDay()]) && count($monthEventDataList[$Day->thisDay()]) > 0) {
            // 	    $event_color = $colorCodeList[$eventType];
            // 		    $tooltip_color = '#7799FF';
            // 		    $tooltip = "vacation:<br>Hobbe Smit (905-528-5907)<br>Russ Martin (222-543-5355)<br>Calvin Jien (433-543-5333)";
            // 		    $display_data = '<a style="text-decoration: none" class="info smalltext" href="#">VAC<span>'.$tooltip.'</span></a>';
            // 		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span style="color:'.$tooltip_color.';border-color:'.$tooltip_color.'">'.$tooltip.'</span></a><br>';
            // 		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a>';
            //  		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a>';
            //  		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a><br>';
            // 		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a>';
            //  		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a>';
            //  		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">OFF<span>'.$tooltip.'</span></a><br>';
            // 		    $display_data .= '&nbsp;<a style="text-decoration: none" class="info smalltext" href="#">MORE EVENTS<span>'.$tooltip.'</span></a>';
            echo '<td valign="top" width="14%">' . $Day->thisDay() . getCellData($monthEventDataList[$Day->thisDay()], $colorCodeList, $Day->thisDay()) . "</td>\n";
        } else {
            echo '<td valign="top" width="14%">' . $Day->thisDay() . getCellData(array(), $colorCodeList) . "</td>\n";
        }
    }
    if ($Day->isLast()) {
        echo "</tr>\n";
    }
}
echo "</table>\n";
function getCellData($data_array = array(), $color_codes = array(), $day = 0)
{
    $EVENT_DESC = 0;
    $PERSON_NAME = 1;
    $CONTACT_NUM = 2;
    $MIN_ROWS = 4;
    // 	$MAX_ROWS = 4;
    $MAX_COLS = 2;