/**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     //load user
     $objUser = \FrontUserLogin\Models\FrontUserSession::isLoggedIn();
     //load user contacts
     $objContacts = $this->getContactsModel()->fetchContacts(array("regtbl_user" => $objUser->id));
     $arr = array();
     foreach ($objContacts as $objContact) {
         if (!is_numeric($objContact->id) || $objContact->id == "") {
             continue;
         }
         //end if
         $arr_contact["name"] = $objContact->fname . " " . $objContact->sname;
         $arr_contact["reference"] = $objContact->reference;
         $arr_contact["source"] = $objContact->source;
         $view_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts", array("action" => "view-contact", "id" => $objContact->id)) . "\" title=\"View Contact Information\" data-toggle=\"tooltip\">" . ICON_SMALL_PROFILE_HTML . "</a>";
         $edit_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts", array("action" => "edit-contact", "id" => $objContact->id)) . "\" title=\"Edit Contact Information\" data-toggle=\"tooltip\">" . ICON_SMALL_MODIFY_HTML . "</a>";
         $comms_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts", array("action" => "view-contact", "id" => $objContact->id)) . "\" class=\"contact_comms\" data-contact-id=\"" . $objContact->id . "\" title=\"Contact Communications\" data-toggle=\"tooltip\">" . ICON_SMALL_COMMS_HTML . "</a>";
         $arr_contact["Links"] = $view_url . "&nbsp;" . $edit_url . "&nbsp" . $comms_url;
         $arr[] = $arr_contact;
     }
     //end foreach
     $add_url = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts", array("action" => "create-contact")) . "\" title=\"Create a new Contact\" data-toggle=\"tooltip\"><span class=\"icon-button-very-large\">" . ICON_MEDIUM_ADD_HTML . "</a>";
     //load table helper
     $objSimpleHTMLTable = new \FrontCore\ViewHelpers\FrontRenderSimpleHtmlTable();
     $html = $objSimpleHTMLTable->generate("", array("Name", "Reference", "Source", $add_url), $arr);
     $objPanel->set("html", $html);
     return $objPanel;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     //load user
     $objUser = \FrontUserLogin\Models\FrontUserSession::isLoggedIn();
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-contacts") . "\" title=\"Contacts\">" . ICON_XLARGE_CONTACTS_HTML . "</a>";
     $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 . "&nbsp;" . $complete_url . "&nbsp;" . $delete_url;
         $arr[] = $arr_task;
     }
     //end foreach
     //load table helper
     $objSimpleHTMLTable = new \FrontCore\ViewHelpers\FrontRenderSimpleHtmlTable();
     $html = $objSimpleHTMLTable->generate("", array("Contact", "Task", "Due", "Status", "&nbsp;"), $arr);
     $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
     $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)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-inbox-manager") . "\" title=\"Inbox\">" . ICON_XLARGE_INBOX_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-users") . "\" title=\"Manage Users\">" . ICON_XLARGE_USERS_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-comms-templates") . "\" title=\"Communications Templates\">" . ICON_XLARGE_HTML_TEMPLATES_COMMS_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }
    /**
     * (non-PHPdoc)
     * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
     */
    public function processPanel(FrontPanelsPanelEntity $objPanel)
    {
        $html = '
			<div id="advsearch">
				<div class="well clearfix">
					<form method="post" id="search-form" action="/front/contacts">
						<div class="form-group">
							<label for="keyword">Keyword:</label>
							<input type="text" class="form-control" name="keyword" id="keyword" placeholder="e.g. First Name / Email" value=""/>
						</div>

							<div class="col-md-6">
								<div class="form-group">
									<label for="regtbl_date_created_start">From date:</label>
									<input type="text" class="form-control" data-provide="datepicker" placeholder="from date" name="regtbl_date_created_start" readonly="readonly" value=""/>
								</div>
							</div>

							<div class="col-md-6">
								<div class="form-group">
									<label for="regtbl_date_created_end">To date:</label>
									<input type="text" class="form-control" data-provide="datepicker" placeholder="to date" name="regtbl_date_created_end" readonly="readonly" value=""/>
								</div>
							</div>

							<div class="col-md-6">
								<div class="form-group">
									<label for="regtbl_source">Source:</label>
									<select name="regtbl_source" id="regtbl_source" class="ajax-dropdown form-control">
										<option value="">--select--</option>
										<option value="_load_data_">Load Data</option>
									</select>
								</div>
							</div>

							<div class="col-md-6">
								<div class="form-group">
									<label for="regtbl_status">Contact status:</label>
									<select name="regtbl_status" id="regtbl_status" class="ajax-dropdown form-control">
										<option value="">--select--</option>
										<option value="_load_data_">Load Data</option>
									</select>
								</div>
							</div>

							<div class="col-md-6">
								<div class="form-group">
									<label for="regtbl_user">User:</label>
									<select name="regtbl_user" id="regtbl_user" class="ajax-dropdown form-control">
										<option value="">--select--</option>
										<option value="_load_data_">Load Data</option>
									</select>
								</div>
							</div>


						<input type="submit" value="Search" class="btn btn-primary pull-right"/>

					</form>
				</div>
			</div>
			<script type="text/javascript">
				jQuery(document).ready(function () {
					jQuery(".ajax-dropdown").change(function () {
						if (jQuery(this).val() == "_load_data_")
						{
							loadSearchFormData(jQuery(this).attr("id"), jQuery(this));
						}//end if
					});
		
					//monitor quick search button
					jQuery(".quick-search-button").click(function (e) {
						e.preventDefault();
		
						//populate values into search form
						jQuery("#search-form").find("#keyword").val(jQuery("#quick-search-keyword").val());
		
						//submit the form
						jQuery("#search-form").submit();
					});
				});
		
				function loadSearchFormData(param, element)
				{
					//set element data
					element.empty();
					element.append(jQuery("<option></option>").text("--loading--"));
		
					var param_url = "/front/contacts/ajax-search-values?param=#param";
		
					//request data
					jQuery.ajax({
						url: param_url.replace("#param", param),
					})
					.done(function (data) {
						var objData = jQuery.parseJSON(data);
		
						if (objData.error == 1)
						{
							//reset element
							element.append(jQuery("<option></option>").text("--select--"));
							element.append(jQuery("<option></option>").val("_load_data_").text("--select--"));
							alert("An error occured: " + objData.response);
							return false;
						}//end if
		
						element.empty();
						element.append(jQuery("<option></option>").val("").text("--select--"));
						jQuery.each(objData.response, function (i, obj) {
							element.append(jQuery("<option></option>").val(obj.id).text(obj.val));
						});
					})
					.fail(function () {
						alert("Data could not be loaded. An unkown error has occured");
						return false;
					});
				}//end function
			</script>';
        $html_id = str_replace(".", "", microtime(TRUE));
        $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;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-profile-file-manager") . "\" title=\"File Manager\">" . ICON_XLARGE_FILE_MANAGER_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-comms-admin/journeys") . "\" title=\"My Journeys\">" . ICON_XLARGE_COMMS_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }
 /**
  * (non-PHPdoc)
  * @see \FrontPanels\Interfaces\InterfacePanelsProcessor::processPanel()
  */
 public function processPanel(FrontPanelsPanelEntity $objPanel)
 {
     $html = "<a href=\"" . $this->getViewUrlHelper()->url("front-custom-tables") . "\" title=\"Custom Tables\">" . ICON_XLARGE_DATABASE_HTML . "</a>";
     $objPanel->set("html", $html);
     return $objPanel;
 }