Exemplo n.º 1
0
 public function breadcrumbs($baseUrlString = '')
 {
     $request = Zend_Controller_Front::getInstance();
     $params = $request->getRequest()->getParams();
     $controllerName = $request->getRequest()->getControllerName();
     $action_Name = $request->getRequest()->getActionName();
     $tName = '';
     $vName = '';
     $tUrl = '';
     $serviceUrl = '';
     $burl = $controllerName . "/" . $action_Name;
     /**
      * 
      * For service request modifying the breadcrum based on t and v params
      * @var t and @var v
      */
     $param_t = isset($params['t']) ? sapp_Global::_decrypt($params['t']) : "";
     $param_v = isset($params['v']) ? sapp_Global::_decrypt($params['v']) : "";
     $service_menu = sapp_Helper::sd_menu_names();
     $service_action_arr = sapp_Helper::sd_action_names();
     if ($param_t != '' && isset($service_menu[$param_t])) {
         $tName = $service_menu[$param_t] . ' Summary';
         $tUrl = $baseUrlString . '/' . $controllerName . '/index/t/' . sapp_Global::_encrypt($param_t);
     }
     if ($param_v != '' && isset($service_action_arr[$param_v])) {
         $vName = $service_action_arr[$param_v];
     } else {
         $vName = $action_Name != 'index' ? $action_Name : '';
     }
     if ($vName != '') {
         if ($tName != '') {
             $serviceUrl = '<a href=' . $tUrl . '>' . $tName . '</a><span class="arrows">&rsaquo;</span>';
         }
         $serviceUrl .= '<span>' . ucfirst($vName) . '</span>';
     } else {
         $serviceUrl = '<span>' . $tName . '</span>';
     }
     /**
      * End modifying breadcrum for servicerequest.
      */
     unset($params['module'], $params['controller'], $params['action']);
     if (isset($params['error_handler'])) {
         unset($params['error_handler']);
     }
     $id_name = '';
     if (is_array($params) && !empty($params)) {
         foreach ($params as $key => $value) {
             if (!is_array($value)) {
                 $burl .= "/" . $key . "/" . $value;
             }
         }
         $id_name = "yes";
     }
     $pageUrl = explode("/", $_SERVER['REQUEST_URI']);
     $serverUrl = $_SERVER['HTTP_HOST'];
     $reportsArr = array('leavesreport' => 'Leaves', 'holidaygroupreports' => 'Holidays', 'activeuser' => 'Active Users', 'employeereport' => 'Employees', 'rolesgroup' => 'Roles', 'emprolesgroup' => 'Employee Roles', 'userlogreport' => 'User Logs', 'activitylogreport' => 'Activity Logs', 'requisitionstatusreport' => 'Requisition');
     $pageName = $controllerName;
     $actionName = $action_Name;
     $breadCrumbsData = '';
     $mydetails_arr = array('jobhistory' => 'Employee Job History', 'certification' => 'Training & Certification Details', 'experience' => 'Experience Details', 'education' => 'Education Details', 'medicalclaims' => 'Medical Claims', 'leaves' => 'Employee Leaves', 'skills' => 'Employee Skills', 'communication' => 'Contact Details', 'communicationdetailsview' => 'Contact Details', 'disability' => 'Disability Details', 'disabilitydetailsview' => 'Disability Details', 'workeligibility' => 'Work Eligibility Details', 'workeligibilitydetailsview' => 'Work Eligibility Details', 'visa' => 'Visa and Immigration Details', 'visadetailsview' => 'Visa and Immigration Details', 'additionaldetails' => 'Additional Details', 'additionaldetailsview' => 'Additional Details', 'salarydetails' => 'Salary Details', 'salarydetailsview' => 'Salary Details', 'personal' => 'Personal Details', 'personaldetailsview' => 'Personal Details', 'creditcard' => 'Corporate Card Details', 'creditcarddetailsview' => 'Corporate Card Details', 'dependency' => 'Dependency Details', 'edit' => 'Edit');
     $myemployees_arr = array('additionaldetailsview' => 'Additional Details', 'jobhistoryview' => 'Job History', 'perview' => 'Personal Details', 'expview' => 'Experience Details', 'eduview' => 'Education Details', 'skillsview' => 'Employee Skills', 'comview' => 'Contact Details', 'trainingview' => 'Training & Certification Details', 'view' => 'View');
     if ($pageName == '' || $pageName == 'welcome') {
         $breadCrumbsData .= '';
     } else {
         if ($pageName == 'dashboard') {
             $breadCrumbsData = '<div class="breadcrumbs">';
             if ($actionName == 'viewsettings') {
                 $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Settings';
             } else {
                 if ($actionName == 'viewprofile') {
                     $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Profile';
                 } else {
                     if ($actionName == 'changepassword') {
                         $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Change Password';
                     } else {
                         if ($actionName == 'emailsettings') {
                             $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Email Settings';
                         } else {
                             if ($actionName == 'upgradeapplication') {
                                 $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Upgrade Application  ';
                             }
                         }
                     }
                 }
             }
             $breadCrumbsData .= '</div>';
         } else {
             if ($pageName == 'configuresite') {
                 $breadCrumbsData = '<div class="breadcrumbs">';
                 $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Configure Site';
                 $breadCrumbsData .= '</div>';
             } else {
                 if ($pageName == 'managemenus') {
                     $breadCrumbsData = '<div class="breadcrumbs">';
                     $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Manage Modules';
                     $breadCrumbsData .= '</div>';
                 } else {
                     if ($pageName == 'logmanager') {
                         $breadCrumbsData = '<div class="breadcrumbs">';
                         $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Activity Log';
                         $breadCrumbsData .= '</div>';
                     } else {
                         if ($pageName == 'userloginlog') {
                             $breadCrumbsData = '<div class="breadcrumbs">';
                             $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> User Log';
                             $breadCrumbsData .= '</div>';
                         } else {
                             if ($pageName == 'servicerequests') {
                                 $breadCrumbsData = '<div class="breadcrumbs">';
                                 $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span> Service Request Management<span class="arrows">&rsaquo;</span>' . $serviceUrl . '';
                                 $breadCrumbsData .= '</div>';
                             } else {
                                 if ($pageName == 'reports') {
                                     $breadCrumbsData = '<div class="breadcrumbs">';
                                     $breadCrumbsData .= '<a href="' . $baseUrlString . '">Home</a> <span class="arrows">&rsaquo;</span>';
                                     if (isset($actionName) && $actionName != '') {
                                         $breadCrumbsData .= '<span><a href="' . $baseUrlString . '/reports">Analytics</a></span>';
                                         if ($actionName == 'userlogreport') {
                                             $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Audit Logs<span class="arrows">&rsaquo;</span><span>User log Report</span>';
                                         } else {
                                             if ($actionName == 'activitylogreport') {
                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Audit Logs<span class="arrows">&rsaquo;</span><span>Activity log Report</span>';
                                             } else {
                                                 if ($actionName == 'businessunits') {
                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Organization<span class="arrows">&rsaquo;</span><span>Business Units Report</span>';
                                                 } else {
                                                     if ($actionName == 'departments') {
                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Organization<span class="arrows">&rsaquo;</span><span>Departments Report</span>';
                                                     } else {
                                                         if ($actionName == 'leavesreport') {
                                                             $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Leave Management<span class="arrows">&rsaquo;</span><span>Employee Leaves Summary Report</span>';
                                                         } else {
                                                             if ($actionName == 'leavemanagementreport') {
                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Leave Management<span class="arrows">&rsaquo;</span><span>Leave Management Summary Report</span>';
                                                             } else {
                                                                 if ($actionName == 'holidaygroupreports') {
                                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Holiday Management<span class="arrows">&rsaquo;</span><span>Holiday Groups & Holidays Report</span>';
                                                                 } else {
                                                                     if ($actionName == 'employeereport') {
                                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span><span>Employees Report</span> ';
                                                                     } else {
                                                                         if ($actionName == 'rolesgroup') {
                                                                             $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>User Management<span class="arrows">&rsaquo;</span><span>Groups & Roles Report</span>';
                                                                         } else {
                                                                             if ($actionName == 'emprolesgroup') {
                                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>User Management<span class="arrows">&rsaquo;</span><span>Groups, Roles & Employees Report</span>';
                                                                             } else {
                                                                                 if ($actionName == 'activeuser') {
                                                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>User Management<span class="arrows">&rsaquo;</span><span>Users & Employees Report</span>';
                                                                                 } else {
                                                                                     if ($actionName == 'requisitionstatusreport') {
                                                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Resource Requisition<span class="arrows">&rsaquo;</span><span>Requisitions Report</span>';
                                                                                     } else {
                                                                                         if ($actionName == 'candidatesreport') {
                                                                                             $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Resource Requisition<span class="arrows">&rsaquo;</span><span>Candidate Details Report</span>';
                                                                                         } else {
                                                                                             if ($actionName == 'interviewrounds') {
                                                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Resource Requisition<span class="arrows">&rsaquo;</span><span>Scheduled Interviews Report</span>';
                                                                                             } else {
                                                                                                 if ($actionName == 'empscreening') {
                                                                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Background Checks<span class="arrows">&rsaquo;</span><span>Employee / Candidate Screening Report</span>';
                                                                                                 } else {
                                                                                                     if ($actionName == 'agencylistreport') {
                                                                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span>Background Checks<span class="arrows">&rsaquo;</span><span>Background Checks Agencies Report</span>';
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     } else {
                                         $breadCrumbsData .= '<span>Analytics</span>';
                                     }
                                     $breadCrumbsData .= '</div>';
                                 } else {
                                     $breadCrumbsData = '<div class="breadcrumbs">';
                                     $url = "/" . $pageName;
                                     $breadCrumIds = $this->getBreadCrumDetails($url);
                                     $breadCrumNames = array();
                                     if (!empty($breadCrumIds)) {
                                         $menu_model = new Default_Model_Menu();
                                         $breadcrumstring = trim($breadCrumIds[0]['nav_ids'], ',');
                                         $breadcrumArr = explode(",", $breadcrumstring);
                                         $breadCrumNames = $breadCrumIds;
                                         $breadCrumbsData .= '<span class="firstbreadcrumb" onclick="window.location=\'' . $baseUrlString . '\'">Home</span> <span class="arrows">&rsaquo;</span> ';
                                         for ($b = 0; $b < sizeof($breadCrumNames); $b++) {
                                             $breadCrumNames[$b]['menuName'] = $menu_model->getMenuText($breadCrumNames[$b]['menuName']);
                                             if ($b == 0) {
                                                 if ($breadCrumNames[$b]['url'] == '/sitepreference') {
                                                     $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span>';
                                                 } else {
                                                     $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span> <span class="arrows">&rsaquo;</span> ';
                                                 }
                                             } else {
                                                 if ($b == sizeof($breadCrumNames) - 1) {
                                                     if ($actionName == '') {
                                                         $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span>';
                                                     } else {
                                                         $breadCrumbsData .= '<a href="' . $baseUrlString . $breadCrumNames[$b]['url'] . '" >' . $breadCrumNames[$b]['menuName'] . '</a>';
                                                     }
                                                 } else {
                                                     $breadCrumbsData .= '<span>' . $breadCrumNames[$b]['menuName'] . '</span> <span class="arrows">&rsaquo;</span> ';
                                                 }
                                             }
                                         }
                                         if ($actionName == 'add' || $actionName == 'edit' && $id_name == '' || $actionName != '' && $actionName != 'view') {
                                             if ($actionName == 'edit' || $actionName != '') {
                                                 $idvalindex = '';
                                                 if (in_array('id', $pageUrl)) {
                                                     $idindex = array_search('id', $pageUrl);
                                                     $idvalindex = $idindex + 1;
                                                 } else {
                                                     if (in_array('userid', $pageUrl)) {
                                                         $idindex = array_search('userid', $pageUrl);
                                                         $idvalindex = $idindex + 1;
                                                     }
                                                 }
                                                 if ((in_array('id', $pageUrl) || in_array('userid', $pageUrl)) && $pageName != 'myemployees') {
                                                     $idval = intval($pageUrl[$idvalindex]);
                                                     if ($idval != 0) {
                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Edit</span>';
                                                     } else {
                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add</span>';
                                                     }
                                                 } else {
                                                     if ($pageName == 'mydetails') {
                                                         if (isset($actionName) && $actionName != '') {
                                                             if (array_key_exists($actionName, $mydetails_arr) !== false) {
                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>' . $mydetails_arr[$actionName] . '</span>';
                                                             }
                                                         } else {
                                                             $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Edit</span>';
                                                         }
                                                     } else {
                                                         if ($pageName == 'myemployees') {
                                                             if (isset($actionName) && $actionName != '') {
                                                                 if (array_key_exists($actionName, $myemployees_arr) !== false) {
                                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>' . $myemployees_arr[$actionName] . '</span>';
                                                                 }
                                                             } else {
                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>View</span>';
                                                             }
                                                         } else {
                                                             if ($actionName == 'multipleresume') {
                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add multiple CVs</span>';
                                                             }
                                                             if ($actionName == 'edit' && $pageName == 'heirarchy') {
                                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Edit</span>';
                                                             } else {
                                                                 if ($actionName == 'edit' || $actionName == 'add') {
                                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add</span>';
                                                                 } else {
                                                                     $breadCrumbsData .= '';
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             } else {
                                                 $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add</span>';
                                             }
                                         } else {
                                             if ($actionName == 'edit') {
                                                 $idvalindex = '';
                                                 if (in_array('id', $pageUrl)) {
                                                     $idindex = array_search('id', $pageUrl);
                                                     $idvalindex = $idindex + 1;
                                                 } else {
                                                     if (in_array('userid', $pageUrl)) {
                                                         $idindex = array_search('userid', $pageUrl);
                                                         $idvalindex = $idindex + 1;
                                                     }
                                                 }
                                                 if (in_array('id', $pageUrl) || in_array('userid', $pageUrl)) {
                                                     $idval = intval($pageUrl[$idvalindex]);
                                                     if ($idval != '') {
                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Edit</span>';
                                                     } else {
                                                         $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add</span>';
                                                     }
                                                 } else {
                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>Add</span>';
                                                 }
                                             } else {
                                                 if ($actionName == 'view') {
                                                     $breadCrumbsData .= '<span class="arrows">&rsaquo;</span> <span>View</span>';
                                                 }
                                             }
                                         }
                                         $breadCrumbsData .= '</div>';
                                     } else {
                                         $breadCrumbsData = '';
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     echo $breadCrumbsData;
 }
Exemplo n.º 2
0
 /**
  *
  * @param string $name
  * @param array $fields
  * @param Zend_Paginator Instance $paginator
  * @param array $extracolumn
  * @param Bool  $sorting
  *
  * @return string
  */
 public function generateGrid($name, $fields = null, $paginator = null, $extracolumn = array(), $sorting = false, $jsGridFnname = '', $perPage = '5', $page = '1', $jsFillFnName = '', $searchArray = '', $formgrid = 'false', $addaction = '', $menuName = '', $unitId, $addpermission, $actns = '', $menunamestr, $call = '', $sortStr = '', $search_filters = '', $dashboardCall = 'No', $actnArr, $sortname = '', $by = '')
 {
     $request = Zend_Controller_Front::getInstance();
     $params = $request->getRequest()->getParams();
     $menu_model = new Default_Model_Menu();
     // Store Extra Columns
     $this->extra = $extracolumn;
     $sortIconStr = "";
     $sort = Zend_Controller_Front::getInstance()->getRequest()->getParam('sort', 'DESC');
     // checking and handling sorting.
     if ($sort == "") {
         $sortIconStr = "<span class='s-ico'>\n\t\t\t<span class='ui-icon-desc ui-state-disabled ui-icon ui-icon-triangle-1-n'></span>\n\t\t\t<span class='ui-icon-asc ui-state-disabled ui-icon ui-icon-triangle-1-s'></span></span>";
     } else {
         if ($sort == 'ASC') {
             $sort = 'DESC';
             //For Sort Icons....
             $sortIconStr = "<span class='s-ico'>\n\t\t\t<span class='ui-icon-desc ui-icon ui-icon-triangle-1-n'></span>\n\t\t\t</span>";
         } else {
             $sort = 'ASC';
             //For Sort Icons....
             $sortIconStr = "<span class='s-ico'>\n\t\t\t<span class='ui-icon-asc  ui-icon ui-icon-triangle-1-s'></span></span>";
         }
     }
     if ($addaction != '') {
         $action = $addaction;
         $popupaction = 'addpopup';
     } else {
         $action = "edit";
         $popupaction = 'editpopup';
     }
     $con = '';
     if ($formgrid != '') {
         if ($unitId != '') {
             $con = 'unitId/' . $unitId;
         } else {
             $con = 'unitId/' . $params['id'];
         }
         $output = "<div class='table-header'><span>" . $menuName . "</span><input type='button' title = 'Add' onclick='displaydeptform(\"" . DOMAIN . $name . '/' . $popupaction . "/{$con}/popup/1\",\"" . $menunamestr . "\")' value='Add Record' class='sprite addrecord' /></div>";
     } else {
         $menuName = $menu_model->getMenuText($menuName);
         $output = "<div class='table-header'><span>" . $menuName . "</span><input type='button' title = 'Add'  onclick='window.location.href=\"" . DOMAIN . $name . '/' . $action . "\"' value='Add Record' class='sprite addrecord' /></div>";
     }
     if ($addpermission == 'false') {
         $output = "<div class='table-header'><span>" . $menuName . "</span></div>";
     }
     if ($actns != '' && $actns == 'remove') {
         $output = "<div class='table-header'><span>" . $menuName . "</span></div>";
     }
     $output .= "<div id='" . $name . "' class='details_data_display_block newtablegrid'>";
     $output .= "<table class='grid' align='center'  width='100%' cellspacing='0' cellpadding='4' border='0'><thead><tr>";
     // this foreach loop display the column header  in �th� tag.
     $colinr = 0;
     if (!empty($fields)) {
         $tabindx = 0;
         if (empty($actnArr)) {
             unset($fields['action']);
         }
         foreach ($fields as $key => $value) {
             if (isset($value['align'])) {
                 $align = @$value['align'] != '' ? 'align="' . $value['align'] . '" ' : '';
             }
             if (isset($value['sortkey'])) {
                 $sortkey = @$value['sortkey'] != '' ? 'align="' . $value['sortkey'] . '" ' : '';
             }
             if (isset($value['style'])) {
                 $style = @$value['style'] != '' ? 'style="' . $value['style'] . '" ' : '';
             }
             $value = is_array($value) && !isset($value['sortkey']) ? $value['value'] : $value;
             if ($value == 'Action') {
                 $width = 'width=90';
             } else {
                 $width = '';
             }
             $output .= "<th " . $width . ">";
             // Check if Sorting is set to True
             if ($sorting) {
                 // Disable Sorting if Key is in Extra Columns
                 if (@$this->extra[$key]['name'] != '' && !is_array($value)) {
                     if ($value == "Action") {
                         $output .= "<span class='action-text'>Action</span>";
                     } else {
                         $output .= $value;
                     }
                 } else {
                     if (is_array($value)) {
                         $key = $value['sortkey'];
                         $value = $value['value'];
                     }
                     $welcome = 'false';
                     $urlString = $_SERVER['REQUEST_URI'];
                     if (strpos($urlString, 'welcome') !== false) {
                         $welcome = 'true';
                     }
                     if ($formgrid == 'true') {
                         $output .= "<a href='javascript:void(0);' onclick=javascript:paginationndsorting('" . DOMAIN . $name . "/index/sort/" . $sort . "/by/" . $key . "/objname/" . $name . "/page/" . $page . "/per_page/" . $perPage . "/call/ajaxcall/{$con}/');>" . $value . "</a>";
                         //For Sort Icons....
                         if ($sortStr == $key) {
                             $output .= $sortIconStr;
                         }
                     } else {
                         if ($welcome == 'true') {
                             $output .= "<a href='javascript:void(0);' onclick=javascript:paginationndsorting('" . DOMAIN . $name . "/index/sort/" . $sort . "/by/" . $key . "/objname/" . $name . "/page/" . $page . "/per_page/" . $perPage . "/call/ajaxcall/{$con}/');>" . $value . "</a>";
                             //For Sort Icons....
                             if ($sortStr == $key) {
                                 $output .= $sortIconStr;
                             }
                         } else {
                             $output .= "<a href='javascript:void(0);' onclick=javascript:paginationndsorting('" . $this->view->url(array('sort' => $sort, 'by' => $key, 'objname' => $name, 'page' => $page, 'per_page' => $perPage)) . "');>" . $value . "</a>";
                             //For Sort Icons....
                             if ($sortStr == $key) {
                                 $output .= $sortIconStr;
                             }
                         }
                     }
                 }
             } else {
                 //For Sort Icons....
                 if ($sortStr == $key) {
                     $output .= $sortIconStr;
                 }
                 $output .= $value;
             }
             $output .= "</th>";
             $colinr++;
             $tabindx++;
         }
         //end of for each function
         $output .= "</tr><tr id='search_tr_{$name}'>";
         $tabindx = 0;
         foreach ($fields as $key => $value) {
             if (isset($value['align'])) {
                 $align = @$value['align'] != '' ? 'align="' . $value['align'] . '" ' : '';
             }
             if (isset($value['sortkey'])) {
                 $sortkey = @$value['sortkey'] != '' ? 'align="' . $value['sortkey'] . '" ' : '';
             }
             if (isset($value['style'])) {
                 $style = @$value['style'] != '' ? 'style="' . $value['style'] . '" ' : '';
             }
             $value = is_array($value) && !isset($value['sortkey']) ? $value['value'] : $value;
             if ($value == 'Action') {
                 $width = 'width=90';
             } else {
                 $width = '';
             }
             $output .= "<th " . $width . ">";
             // Check if Sorting is set to True
             if ($sorting) {
                 // Disable Sorting if Key is in Extra Columns
                 if (@$this->extra[$key]['name'] != '' && !is_array($value)) {
                     if ($value == "Action") {
                         $output .= "<span class='action-text'></span>";
                     } else {
                         $output .= $value;
                     }
                 } else {
                     if (is_array($value)) {
                         $key = $value['sortkey'];
                         $value = $value['value'];
                     }
                     $welcome = 'false';
                     $urlString = $_SERVER['REQUEST_URI'];
                     if ($key != 'id') {
                         $sText = '';
                         if (!empty($searchArray)) {
                             $display = 'display: block;';
                         } else {
                             $display = 'display: none;';
                         }
                         if (is_array($searchArray)) {
                             if (array_key_exists($key, $searchArray)) {
                                 $sText = $searchArray[$key];
                             } else {
                                 $sText = '';
                             }
                         }
                         if (isset($search_filters[$key])) {
                             $search_function = 'getsearchdata("' . $name . '","","' . $key . '",event';
                             $output .= sapp_Global::grid_data($search_filters, $key, $name, $display, $sText, $tabindx, $search_function);
                         } else {
                             $output .= "<input tabIndex={$tabindx} type='text' name='{$name}' id='{$key}' style='{$display}' class='searchtxtbox_{$name} table_inputs grid_search_inputs' value='{$sText}' onkeydown='getsearchdata(\"{$name}\",\"\",\"{$key}\",event,\"text\")' />";
                         }
                     }
                 }
             } else {
                 //For Sort Icons....
                 if ($sortStr == $key) {
                     $output .= $sortIconStr;
                 }
                 $output .= $value;
             }
             $output .= "</th>";
             $colinr++;
             $tabindx++;
         }
         //end of for each function
     }
     $output .= "</tr>\n\n        </thead>";
     $output .= "<tbody>";
     // Start Looping Data
     $ii = 0;
     foreach ($paginator as $p) {
         $cell_color = $ii % 2 == 0 ? "row1" : "row2";
         $ii++;
         $bodyCount = 0;
         $output .= "<tr onclick='selectrow({$name},this);' class='{$cell_color}'>";
         // Reset Fields Array to Top
         if (!empty($fields)) {
             reset($fields);
             foreach ($fields as $k => $v) {
                 $tdclass = '';
                 // Look for additional attributes
                 $characterlimit = 40;
                 if (is_array($v)) {
                     $class = @$v['class'] != '' ? 'class="' . $v['class'] . '" ' : '';
                     $align = @$v['align'] != '' ? 'align="' . $v['align'] . '" ' : '';
                     $valign = @$v['valign'] != '' ? 'valign="' . $v['valign'] . '" ' : '';
                     if (isset($v['characterlimit'])) {
                         $characterlimit = $v['characterlimit'];
                     }
                     $output .= "<td {$tdclass}{$align}{$valign}>";
                 } else {
                     $output .= "<td {$tdclass}>";
                 }
                 // Check to see if this Field is in Extra Columns
                 if (isset($this->extra[$k]['value'])) {
                     $output .= $this->_parseExtra($k, $p);
                 } else {
                     if ($bodyCount == 0 && $jsFillFnName != '') {
                         $valToInclude = strlen(trim($p[$k])) > $characterlimit ? substr(trim($p[$k]), 0, $characterlimit) . ".." : trim($p[$k]);
                         $output .= "<a onclick= " . $jsFillFnName . "(\"/id/{$p['id']}\") href= 'javascript:void(0)' title='" . addslashes(htmlspecialchars(strip_tags(trim($p[$k])))) . "' >" . addslashes(htmlspecialchars(strip_tags($valToInclude))) . "</a>";
                     } else {
                         $p = (array) $p;
                         if (isset($p[$k])) {
                             $valToInclude = strlen(trim($p[$k])) > $characterlimit ? substr(trim($p[$k]), 0, $characterlimit) . ".." : trim($p[$k]);
                             $output .= "<span  title='" . htmlentities(addslashes(trim($p[$k])), ENT_QUOTES, "UTF-8") . "' >" . htmlentities(addslashes($valToInclude), ENT_QUOTES, "UTF-8") . "</span>";
                         }
                     }
                 }
                 $output .= "</td>";
                 $bodyCount++;
             }
         }
         // Close the Table Row
         $output .= "</tr>";
     }
     if ($ii == 0) {
         $output .= "<tr><td colspan='{$colinr}' class='no-data-td'><p class='no-data'>No data found</p></td></tr>";
     }
     $output .= "</tbody>";
     $output .= "</table>\n<script type='text/javascript' language='javascript'>\n                \$(document).ready(function(){\n                                    \n                                    \n                                    if(\$('.searchtxtbox_" . $name . "').is(':visible'))\n                                    {\n                                        \n                                        \$('#search_tr_" . $name . "').show();\t\n                                    }\n                                    else \n                                        \n                                        \$('#search_tr_" . $name . "').hide();\t\n                                    });\n                </script>                     \n</div>";
     // Attach Pagination
     if ($paginator) {
         $params = array();
         $params['jsGridFnName'] = $jsGridFnname;
         $params['perPage'] = $perPage;
         $params['objname'] = $name;
         $params['searchArray'] = $searchArray;
         $params['formgrid'] = $formgrid;
         $params['con'] = $con;
         $params['sortname'] = $sortname;
         $params['by'] = $by;
         $params['dashboardcall'] = $dashboardCall;
         $output .= $this->view->paginationControl($paginator, 'Sliding', 'partials/pagination.phtml', $params);
     }
     $output .= "<script type='text/javascript'>\$('#{$name}').slimScrollHorizontal({\n\t\t\t\t\t\t\t\t\t  alwaysVisible: false,\n\t\t\t\t\t\t\t\t\t  start: 'left',\n\t\t\t\t\t\t\t\t\t  position: 'bottom',\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t}).css({ background: '#ccc', paddingBottom: '10px' }); </script>";
     $output .= "<script type='text/javascript'>\n\t\t\t\t\t\tvar id = \$('#columnId').val();\n\t\t\t\t\t\tvar coldata = \$('#'+id).val();\n\t\t\t\t\t\tvar focusID = \$('#columnId').val();\t\n                                                var fval = \$('#'+focusID).attr('data-focus');\n                                                if(fval == '' || fval == null)\n\t\t\t\t\t\t\$('#'+focusID).focus().val('').val(coldata);\n\t\t\t\t\t</script>";
     return $output;
 }