GetCountryList(); $Country = fillDbCombo($contry_list,'country_id','country_name'); ############################################################################################## ############################################################################################## /// assing templates and javascript with related varibles according to template ############################################################################################## $tpl->assign(array( "T_Body" => 'all_projects'. $config['tplEx'], "JavaScript" => array('home.js'), "lang" => $lang, "page_content" => $rsPage->page_content, "Cat_Options_1" => $cats->Home_Page_1(), // get first 9 category "Cat_Options_2" => $cats->Home_Page_2(), // get next 9 category after first period "Country_List" => $Country, // assing combo of country "Project_Array" => fillArrayCombo($arr_langs["Search_Project"]), // display array in combo box "navigation" => '' )); ############################################################################################## ############################################################################################## /// get homepage data from table and set them according to id ############################################################################################## $home_page->ShowHomePage(); $i = 1; while($db->next_record() ) { $tpl->assign(array( "content_".$i."" => $db->f('home_content'), )); $i++; } ############################################################################################## ############################################################################################## /// get project listing data from table ############################################################################################## $proj->ViewAll_Projects(); $rscntpro = $db->num_rows(); // get num of rows $i=0; while($db->next_record()) // loop till last record { $view_pro[$i]['id'] = $db->f('project_id'); $view_pro[$i]['status'] = $db->f('project_status'); $view_pro[$i]['clear_title'] = clean_url($db->f('project_title')); $view_pro[$i]['premium_project'] = $db->f('premium_project'); $view_pro[$i]['membership_id'] = $db->f('membership_id'); $view_pro[$i]['project_date'] = $db->f('project_posted_date'); $view_pro[$i]['title'] = $db->f('project_title'); $view_pro[$i]['dec'] = $db->f('project_description'); $view_pro[$i]['urgent_project'] = $db->f('urgent_project'); list($view_pro[$i]['bid'],$view_pro[$i]['Ave_Bid'],$view_pro[$i]['Ave_Time']) = explode(",",Get_Bids_By_Id1($db->f('project_id'))); $view_pro[$i]['category'] = Get_Cat_Names_Project($db->f('project_category')); // get category name if($view_pro[$i]['bid'] != 0) { $view_pro[$i]['Ave_Bid1'] = number_format((($view_pro[$i]['Ave_Bid'])/($view_pro[$i]['bid'])),2); } $i++; } /// assing to template $tpl->assign(array( "view_project" => $view_pro, "Loop" => $rscntpro, )); /// used for pagination if($_SESSION['total_record'] > $_SESSION['user_page_size']) { $tpl->assign(array('Page_Link' => $utility->showPaginationUser($_SESSION['total_record']) )); } $tpl->display('default_layout'. $config['tplEx']); // assign to layout template ?>