getCustomViewCombo(); if(isset($_REQUEST['viewname']) == false || $_REQUEST['viewname']=='') { if($oCustomView->setdefaultviewid != "") { $viewid = $oCustomView->setdefaultviewid; }else { $viewid = "0"; } } $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; //Retreive the list from Database //<<<<<<<<>>>>>>>> $date_var = date('Y-m-d'); //Changed for Patch 2 by Don $where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_invoice.invoicestatus != \'Paid\''; $query = getListQuery("Invoice",$where); $query .= " ORDER BY total DESC"; //<<<<<<<>>>>>>>> $query .= " LIMIT " . $adb->sql_escape_string($maxval); if($calCnt == 'calculateCnt') { $list_result_rows = $adb->query(mkCountQuery($query)); return $adb->query_result($list_result_rows, 0, 'count'); } $list_result = $adb->query($query); //Retreiving the no of rows $noofrows = $adb->num_rows($list_result); //Retreiving the start value from request if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') { $start = vtlib_purify($_REQUEST['start']); } else { $start = 1; } //Retreive the Navigation array $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); if ($navigation_array['start'] == 1) { if($noofrows != 0) $start_rec = $navigation_array['start']; else $start_rec = 0; if($noofrows > $list_max_entries_per_page) { $end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1; } else { $end_rec = $noofrows; } } else { if($navigation_array['next'] > $list_max_entries_per_page) { $start_rec = $navigation_array['next'] - $list_max_entries_per_page; $end_rec = $navigation_array['next'] - 1; } else { $start_rec = $navigation_array['prev'] + $list_max_entries_per_page; $end_rec = $noofrows; } } $focus = new Invoice(); $title=array('myTopInvoices.gif',$current_module_strings['LBL_MY_TOP_INVOICE'],'home_mytopinv'); //Retreive the List View Table Header $listview_header = getListViewHeader($focus,"Invoice",$url_string,$sorder,$order_by,"HomePage",$oCustomView); $header = Array($listview_header[1],$listview_header[2]); $listview_entries = getListViewEntries($focus,"Invoice",$list_result,$navigation_array,"HomePage","","EditView","Delete",$oCustomView); foreach($listview_entries as $crmid=>$valuearray) { $entries[$crmid] = Array($valuearray[1],$valuearray[2]); } $search_qry = "&query=true&Fields0=vtiger_invoice.invoicestatus&Condition0=isn&Srch_value0=Paid&Fields1=vtiger_crmentity.smownerid&Condition1=is&Srch_value1=".$current_user->column_fields['user_name']."&searchtype=advance&search_cnt=2&matchtype=all"; $values=Array('ModuleName'=>'Invoice','Title'=>$title,'Header'=>$header,'Entries'=>$entries,'search_qry'=>$search_qry); if ( ($display_empty_home_blocks && $noofrows == 0 ) || ($noofrows>0) ) return $values; } ?>