HomeCategory_New(); $cnt = $db2->num_rows(); $i = 0; // Obtenemos el listado de categorias while($db2->next_record()) { $arr_cat1_id[$i] = $db2->f('cat_id'); $arr_cat1_name[$i] = $db2->f('cat_name'); $i++; } /* **************************** PAGINACION ************************ */ //examino la página a mostrar y el inicio del registro a mostrar // Definimos un nuevo page size para mostrar adecuadamente los registros $pageSize = 10; $nro_pagina = $_GET[page]; if ( !$nro_pagina ) { $inicio = 0; $nro_pagina = 1; } else $inicio = ($nro_pagina - 1) * $pageSize; //miro a el número total de campos que hay en la tabla $num_total_registros = $member->getListNumber(isset($_GET[catId])?$_GET[catId]:$arr_cat1_id[0]); //calculo el total de páginas $total_paginas = ceil( $num_total_registros / $pageSize ); //muestro los distintos índices de las páginas, si es que hay varias páginas $pagAnterior = $nro_pagina - 1; $pagPosterior = $nro_pagina + 1; /* **************************** FIN PAGINACION ************************ */ // Obtengo todos los freelancers $member->GetSeller(isset($_GET[catId])?$_GET[catId]:$arr_cat1_id[0], $inicio, $pageSize); $j=0; while($db1->next_record()) { $arr_seller[$j]['description'] = $db1->f('seller_description'); $arr_seller[$j]['login_id'] = $db1->f('user_login_id'); $arr_seller[$j]['logo'] = $db1->f('seller_logo'); $arr_seller[$j]['mother_lang'] = $db1->f('mother_lang'); $arr_seller[$j]['seller_logo'] = $db1->f('seller_logo'); $arr_seller[$j]['lang_pairs'] = $db1->f('lang_pairs'); $arr_seller[$j]['location_1'] = $db1->f('mem_state'); $arr_seller[$j]['location'] = $db1->f('mem_city').",".$db1->f('mem_state').",".$db1->f('country_name'); if($db1->f('country_name') != '') { $arr_seller[$j]['location_2'] = $db1->f('mem_city').",".$db1->f('country_name'); } if($db1->f('country_name') == '') { $arr_seller[$j]['location_2'] = $db1->f('mem_city'); } $arr_seller[$j]['reviews'] = $seller->Average_Seller_Rating_Count($db1->f('user_login_id')); $arr_seller[$j]['rating'] = number_format($seller->Average_Seller_Rating($db1->f('user_login_id')),2); $arr_seller[$j]['earning'] = Sellect_Earning_Wallet(md5($db1->f('user_login_id'))); $j++; } // assing to template $tpl->assign(array( "img_path" => $virtual_path['Seller_Logo'], "cat_id" => $arr_cat1_id, "catId" => isset($_GET[catId])?$_GET[catId]:$arr_cat1_id[0], "catName" => $cats->GetCatName(isset($_GET[catId])?$_GET[catId]:$arr_cat1_id[0]), "cat_name" => $arr_cat1_name, "Loop1" => $cnt, "num_total_registros" => $num_total_registros, "total_cat" => $cnt-1, "arr_seller" => $arr_seller, "tab" => 2, "classFF" => "active", "nro_pagina" => $nro_pagina, "total_paginas" => $total_paginas, "pagAnterior" => $pagAnterior, "pagPosterior" => $pagPosterior )); ############################################################################################## /// assing templates and javascript with related varibles according to template ############################################################################################## $tpl->assign(array( "T_Body" => 'all_seller_profiles'. $config['tplEx'], //"JavaScript" => array('home.js'), "lang" => $lang, "navigation" => '' )); ############################################################################################## $tpl->display('default_layout'. $config['tplEx']); // assign to layout template ?>