getNew(30); // キャリア利用率 $make_count = $people->getCntMake(); $total = 0; foreach($make_count as $value){ $total += $value->cnt; } $chd = round($make_count[0]->cnt/$total*100,1); $chl = $make_count[0]->make .'+'. round($make_count[0]->cnt/$total*100,1) .'%'; for($i=1; $i<3; $i++){ $chd .= ',' . round($make_count[$i]->cnt/$total*100,1); $chl .= '|' . $make_count[$i]->make .'+'. round($make_count[$i]->cnt/$total*100,1) .'%'; } $make_chart = 'http://chart.apis.google.com/chart?' . 'cht=p3' . '&chs=400x100' . '&chd=t:' . $chd . '&chl=' . $chl; // 全件リスト $all_list = $people->getAll(); // 件数取得 $total = $people->getTotal(); // PCとモバイルの判別で、テンプレートの切り替え $userAgent = Net_UserAgent_Mobile::singleton(); if ($userAgent->isNonMobile()) { $template = 'index.html'; } else { $template = 'mindex.html'; } // Yahoo! APIで関連ワードを検索 $yahoo_webunitsearch = new YahooAPI(); if(!$kanren_keyword = $yahoo_webunitsearch->webunitSearch("携帯機種", "", 20)){ $kanren_keyword; } // 画面表示 $smarty = new Smarty(); $smarty->assign('people_list',$people_list); $smarty->assign('make_chart',$make_chart); $smarty->assign('all_list',$all_list); $smarty->assign('total',$total); $smarty->assign('kanren_keyword',$kanren_keyword); $smarty->display($template); ?>