template_dir = '/templates/'; $smarty->compile_dir = 'templates_c/'; $smarty->config_dir = '/configs/'; //$smarty->cache_dir = 'cache/'; if(!isset($_POST['partnumber'])){ //$smarty->caching = true; } error_reporting(E_ALL); //error_reporting(0); $my_cache_id=$_SERVER["REQUEST_URI"]; $domain="chips.radio-electronics.co"; $short_domain="chips.radio-electronics.co"; $header=""; $url=""; include("./functions.php"); //$header=authenticated_user($domain); if (array_key_exists('REQUEST_URI', $_SERVER)) { $url=split("/", $_SERVER["REQUEST_URI"]); for($i=0;$igetMessage(); } if($url[1]=="alph") { include("modules/alph.php"); $content.=$cont; } elseif($url[1]=="search"){ include ("./modules/search.php"); } /* elseif ($url[1]=="prices_search") { $content.='
'; if (array_key_exists("HTTP_REFERER", $_SERVER)) $content.="Back
"; $content.="Return to main page"; } */ elseif ($url[1]=="find") { if($url[2]) { if(array_key_exists("partnumber", $_REQUEST)) { $searchstring=preg_replace("/[\s\-\+\.\,\(\)\<\>\[\]\!\@\#\$\%\^\&\*\/]/", '', trim(addslashes($_REQUEST["partnumber"]))); } else { $searchstring=preg_replace("/[\s\-\+\.\,\(\)\<\>\[\]\!\@\#\$\%\^\&\*\/]/", '', trim(addslashes($url[2]))); } $query="INSERT INTO search_stat SET keyword='".$searchstring."', time='".time()."', ip='".$_SERVER["REMOTE_ADDR"]."', site='prices', page='search'"; $result=$db->query($query); $title="Stock offers and availability of chips (parts) begins from ".$searchstring." at the Chips.radio-electronics.co."; $keywords=$searchstring.", parts, search, online, distributors, suppliers"; $describe="Finding electronic components located in stocks of our suppliers - franchised distributors of electronic components."; $content.="

"; //Делаем пагинацию и запрос на выборку с пагинацией $query="SELECT COUNT(id) FROM comps WHERE s_name LIKE '".$searchstring."%'"; $result=$db->query($query); $row=$result->fetch(); if($row[0]>50) //Если результатов больше 50 { //if(is_int($url[3])) { if(array_key_exists(3, $url)){ $page_c=$url[3]; } //} else {$page_c=1;} //echo($page_c); if(!$page_c){ $page_c=1; } if(!is_numeric($page_c)){ $page_c=1; } $pages_count=(int)($row[0]/50); if(($row[0]/50-$pages_count)>0) ++$pages_count; if($pages_count<=5) { for($i=1;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.="p. ".$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { if($page_c<5){ for($i=1;$i<=5;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.="p. ".$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } if($page_c+10<$pages_count) {$content.='  p. '.($page_c+10).'  ';} if($page_c+50<$pages_count) {$content.='  p. '.($page_c+50).'  ';} if($page_c+100<$pages_count) {$content.='  p. '.($page_c+100).'  ';} $content.='  Last page'; } elseif($page_c>$pages_count-5){ $content.='  First page'; if($page_c-100>0) {$content.='  p. '.($page_c-100).'  ';} if($page_c-50>0) {$content.='  p. '.($page_c-50).'  ';} if($page_c-10>0) {$content.='  p. '.($page_c-10).'  ';} for($i=$pages_count-4;$i<=$pages_count;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.="p. ".$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } } else { $content.='  First page'; if($page_c-100>0) {$content.='  p. '.($page_c-100).'  ';} if($page_c-50>0) {$content.='  p. '.($page_c-50).'  ';} if($page_c-10>0) {$content.='  p. '.($page_c-10).'  ';} for($i=$page_c-2;$i<=$page_c+2;++$i){ if($page_c<>$i) {$content.='  ';} else {$content.="  [";} $content.="p. ".$i; if($page_c<>$i) {$content.='  ';} else {$content.="]  ";} } if($page_c+10<$pages_count) {$content.='  p. '.($page_c+10).'  ';} if($page_c+50<$pages_count) {$content.='  p. '.($page_c+50).'  ';} if($page_c+100<$pages_count) {$content.='  p. '.($page_c+100).'  ';} $content.='  Last page'; } } $query="SELECT id, name, s_name FROM comps WHERE s_name LIKE '".$searchstring."%' LIMIT ".(($page_c-1)*50).", 50 "; } else { $query="SELECT id, name, s_name FROM comps WHERE s_name LIKE '".$searchstring."%'"; } //закончилась пагинация и создание запроса с пагинацией $result=$db->query($query); $content.="

"; $count=0; $count1=0; while($row=$result->fetch()) { ++$count1; if($count) { --$count; $bg="bgcolor='#ffffff'"; } else { ++$count; $bg="bgcolor='#eeeeee'"; } $query1="SELECT COUNT(*) FROM pricelist WHERE comp_id=".$row['id']; $result1=$db->query($query1); if ($result1) $row1=$result1->fetch(); if ($row1[0]>0) { $content.=""; //$content.=""; if($count1==5){ $content.=" "; } else { $content.=''; } } else { $content.=""; if($count1==5){ $content.=" "; } else { $content.=""; } } } $content.="
Part NamePricelist Search Results
".$row[1]." (see datasheet)
".$row[1].""; $file = fopen("banners/120x240.inc", "r"); $content .= fread($file, 8152); $content.=" Prices and suppliers for ".$row[1]." - see ".$row1[0]." resultsPrices and suppliers for '.$row[1].' - see '.$row1[0].' results
".$row[1]." (see datasheet)"; $file = fopen("banners/120x240.inc", "r"); $content .= fread($file, 8152); $content.=" Prices and suppliers for ".$row[1]." - see ".$row1[0]." resultsPrices for ".$row[1]." - global search
"; } else { $content.="Empty search string!"; } if (array_key_exists("HTTP_REFERER", $_SERVER)) $content.="Back
"; $content.="Return to main page"; } elseif ($url[1]=="datasheet_html") { $query="SELECT id FROM comps WHERE s_name='".$url[2]."' LIMIT 1"; $result=$db->query($query); $row=$result->fetch(); if(count($row)>0){ $query="SELECT html FROM datasheets_html WHERE comp_id=".$row[0]." LIMIT 1"; $result=$db->query($query); $row=$result->fetch(); $content.= "

HTML version of datasheet for ".$url[2]."

".$row["html"]; } else { $content.="No results found"; } if (array_key_exists("HTTP_REFERER", $_SERVER)) $content.="Back
"; $content.="Return to main page"; } elseif (($url[1]=="prices")||($url[1]=="prices_search")) { include ("./modules/prices.php"); } elseif ($url[1]=="files") { $comp=split("_", $url[2]); $query="SELECT id FROM comps WHERE s_name='".$comp[0]."' LIMIT 1"; $result=$db->query($query); $row=$result->fetch(); print_r($row); $num=split(".", $comp[2]); $query="SELECT datasheet_source FROM datasheets WHERE comp_id='".$row[0]."' LIMIT ".$num[0].", 1"; $result=$db->query($query); $row=$result->fetch(); print_r($row); } else { $content.="

Chips and Electronic Components Search online

Most popular parts

"; $query="SELECT id FROM view_stat ORDER BY parts_views DESC LIMIT 99"; $result=$db->query($query); if($result) { //$ids=""; $row=$result->fetchAll(PDO::FETCH_COLUMN, 0); //print_r($row); $ids=implode(", " , $row); } $query="SELECT name, s_name FROM comps WHERE id IN (".$ids.")"; $result=$db->query($query); if($result) { $count=0; while($row=$result->fetch()) { $content.=""; ++$count; if($count==3) { $content.=""; $count=0; } } } $content.="
".$row[0]."

About us

We are a stocking distributor of electronic components with access to over 75 million line items worth of inventory that include obsolete, hard to find, allocated, and on a long lead-time items. Our inventory is complimented by an extensive and comprehensive worldwide parts sourcing network, which gives our customers access to tens of millions of parts. We offers the best possible pricing and lead-times on all parts. We are not reseller, we only supply information about prices and availability from our suppliers.

About electronic components

Electronic component (or a part) is a device that affects or uses in its operation the flow of electrical charges or electromagnetic fields. Basic components are classified into passive (such as resistors, capacitors and inductors) or active (such as transistors and diodes). Passive components do not have any control or directionality. Active components have directionality or active control. Most active components today are semiconductor based.

For producers, suppliers and distributors

You can register at our site and place here your price list up to 10000 lines absolutely free! Also you can get your own site http://\"your_name\".radio-electronics.co, with information about your enterprise. Please, register, confirm your e-mail and begin working with us! At present, we allow the very advantageous advertising proposal! You hurry, proposal can be abolished at any moment!


"; include("modules/alph.php"); $content.=$cont; $content.="
"; } if(!isset($template)) $template='index.tpl'; // используемый шаблон //эти метатеги могут произвести другие модули, например, каталог, тогда они "важнее", чем дефолтные //передаем разные элементы содержания в смарти $smarty->assign('content', $content); $smarty->assign('title', $title); $smarty->assign('keywords', $keywords); $smarty->assign('describe', $describe); $smarty->assign('domain', $domain); $smarty->display($template, $my_cache_id); unset ($db); ?>