/** * (non-PHPdoc) * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel() */ public function processPanel(FrontPanelsPanelEntity $objPanel) { if (!is_object($objPanel->get("panel_read_data")) && !is_array($objPanel->get("panel_read_data"))) { return $objPanel; } //end if $html_id = str_replace(".", "", microtime(TRUE)); $html = "<script type=\"text/javascript\">"; $html .= "jQuery(function () {\n\t\t\t\t\t jQuery('#{$html_id}').highcharts({\n\t\t\t\t\t data: {\n\t\t\t\t\t table: 'sources-vs-contacts-count'\n\t\t\t\t\t },\n\t\t\t\t\t chart: {\n\t\t\t\t\t type: 'pie'\n\t\t\t\t\t },\n\t\t\t\t\t title: {\n\t\t\t\t\t text: 'Contacts per Source'\n\t\t\t\t\t },\n\t\t\t\t\t yAxis: {\n\t\t\t\t\t allowDecimals: false,\n\t\t\t\t\t },\n\t\t\t\t\t });\n\t\t\t\t\t});"; $html .= "</script>"; $html .= "<table id=\"sources-vs-contacts-count\" style=\"display: none;\">"; // $html .= "<thead>"; // $html .= "</thead>"; $html .= "<tbody>"; foreach ($objPanel->get("panel_read_data") as $k => $objData) { if ($objData->source == "") { $objData->source = "Not Specified"; } //end if $html .= "<tr>"; $html .= "<th>" . $objData->source . "</th>"; $html .= "<td>" . $objData->contact_count . "</td>"; $html .= "</tr>"; } //end foreach $html .= "</tbody>"; $html .= "</table>"; $html .= "<div id=\"{$html_id}\"></div>"; $objPanel->set("html", $html); return $objPanel; }
/** * (non-PHPdoc) * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel() */ public function processPanel(FrontPanelsPanelEntity $objPanel) { if (!is_object($objPanel->get("panel_read_data")) && !is_array($objPanel->get("panel_read_data"))) { return $objPanel; } //end if $arr = array(); foreach ($objPanel->get("panel_read_data") as $objTask) { if ($objTask->reg_id == "") { continue; } //end if //do not display tasks already completed if ($objTask->complete == 1) { continue; } //end if $arr_task["contact"] = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts", array("action" => "view-contact", "id" => $objTask->reg_id)) . "\" title=\"View Contact Information\" data-toggle=\"tooltip\">" . ICON_SMALL_PROFILE_HTML . " " . $objTask->registrations_fname . " " . $objTask->registrations_sname . "</a>"; $arr_task["task"] = $objTask->content; $arr_task["due"] = $objTask->datetime_reminder; $arr_task["status"] = "Pending"; $complete_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-users-tasks", array("action" => "complete-task", "user_id" => $objTask->user_id, "id" => $objTask->id)) . "\" title=\"Mark task as complete\" data-toggle=\"tooltip\">" . ICON_SMALL_ACTIVE_HTML . "</a>"; $edit_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-users-tasks", array("action" => "edit", "user_id" => $objTask->user_id, "id" => $objTask->id)) . "\" title=\"Edit Task Details\" data-toggle=\"tooltip\">" . ICON_SMALL_MODIFY_HTML . "</a>"; $delete_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-users-tasks", array("action" => "delete", "user_id" => $objTask->user_id, "id" => $objTask->id)) . "\" title=\"Delete Task\" data-toggle=\"tooltip\">" . ICON_SMALL_DELETE_HTML . "</a>"; $arr_task["urls"] = $edit_url . " " . $complete_url . " " . $delete_url; $arr[] = $arr_task; } //end foreach //load table helper $objSimpleHTMLTable = new \FrontCore\ViewHelpers\FrontRenderSimpleHtmlTable(); $html = $objSimpleHTMLTable->generate("", array("Contact", "Task", "Due", "Status", " "), $arr); $objPanel->set("html", $html); return $objPanel; }
/** * Delete a profile panel * @param FrontPanelsPanelEntity $objPanel * @return \FrontPanels\Entities\FrontPanelsPanelEntity */ public function deleteProfilePanel(FrontPanelsPanelEntity $objPanel) { //create the request object $objApiRequest = $this->getApiRequestModel(); //setup the object and specify the action $objApiRequest->setApiAction("panels/profile/setup/" . $objPanel->get("id")); //execute $objResult = $objApiRequest->performDELETERequest()->getBody(); $objPanel = $this->getServiceLocator()->get("FrontPanels\\Entities\\FrontPanelsPanelEntity"); $objPanel->set($objResult->data); return $objPanel; }