index.tpl 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <!doctype html>
  2. <!--
  3. Design by Free Responsive Templates
  4. http://www.free-responsive-templates.com
  5. Released for free under a Creative Commons Attribution 3.0 Unported License (CC BY 3.0)
  6. -->
  7. <html>
  8. <head>
  9. <meta charset="utf-8">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <title>Companies Info UK</title>
  12. <link href="css/styles.css" rel="stylesheet" type="text/css">
  13. <style type="text/css">
  14. article table td:nth-child(2), td:nth-child(3) {
  15. text-align: right;
  16. }
  17. article table.nj td:nth-child(2), td:nth-child(3) {
  18. text-align: left;
  19. }
  20. article table.dist td:nth-child(3), td:nth-child(4), td:nth-child(5) {
  21. text-align: right;
  22. }
  23. table {
  24. margin-left:auto;
  25. margin-right:auto;
  26. }
  27. table, th, td
  28. {
  29. border: 1px solid #ccc;
  30. }
  31. table td {
  32. vertical-align:top;
  33. padding-left: 0.5em;
  34. padding-right: 0.5em;
  35. }
  36. table.bold2 td:nth-child(2) {font-weight:bold;}
  37. .post header {
  38. text-align:center;
  39. float:none;
  40. width:100%;
  41. padding:0;
  42. }
  43. </style>
  44. <?
  45. local account_categories = [
  46. ["TOTAL EXEMPTION SMALL","1,417,506","46.38%"],
  47. ["NO ACCOUNTS FILED","837,086","27.39%"],
  48. ["DORMANT","406,070","13.29%"],
  49. ["TOTAL EXEMPTION FULL","164,883","5.40%"],
  50. ["FULL","137,209","4.49%"],
  51. ["SMALL","61,113","2.00%"],
  52. ["GROUP","21,292","0.70%"],
  53. ["MEDUM","5,523","0.18%"],
  54. ["ACCOUNTS TYPE NOT AVAILABLE","5,099","0.17%"],
  55. ["PARTIAL EXEMPTION","230","0.01%"],
  56. ["INITIAL","7","0%"],
  57. ]
  58. local company_categories = [
  59. ["Private Limited Company","2,816,656","92.17%"],
  60. ["PRI/LTD BY GUAR/NSC (Private, limited by guarantee, no share capital)","77,564","2.54%"],
  61. ["Limited Liability Partnership","54,887","1.80%"],
  62. ["PRI/LBG/NSC (Private, Limited by guarantee, no share capital, use of 'Limited' exemption)","39,623","1.30%"],
  63. ["Limited Partnership","22,542","0.74%"],
  64. ["Other company type","11,580","0.38%"],
  65. ["Industrial and Provident Society","9,961","0.33%"],
  66. ["Public Limited Company","8,473","0.28%"],
  67. ["Community Interest Company","7,101","0.23%"],
  68. ["Private Unlimited Company","6,011","0.20%"],
  69. ["Royal Charter Company","832","0.03%"],
  70. ["Investment Company with Variable Capital","500","0.02%"],
  71. ["Private Unlimited","140","0.00%"],
  72. ["Investment Company with Variable Capital(Umbrella)","99","0.00%"],
  73. ["Old Public Company","22","0.00%"],
  74. ["PRIV LTD SECT. 30 (Private limited company, section 30 of the Companies Act)","15","0.00%"],
  75. ["Investment Company with Variable Capital (Securities)","12","0.00%"],
  76. ]
  77. local company_status = [
  78. ["Active","2,824,726","92.43%"],
  79. ["Active - Proposal to Strike off","139,788","4.57%"],
  80. ["Liquidation","79,770","2.61%"],
  81. ["In Administration","4,740","0.16%"],
  82. ["Live but Receiver Manager on at least one charge","2,516","0.08%"],
  83. ["Voluntary Arrangement","1,864","0.06%"],
  84. ["ADMINISTRATIVE RECEIVER","1,492","0.05%"],
  85. ["In Administration/Administrative Receiver","425","0.01%"],
  86. ["RECEIVERSHIP","322","0.01%"],
  87. ["ADMINISTRATION ORDER","189","0.01%"],
  88. ["In Administration/Receiver Manager","102","0.00%"],
  89. ["RECEIVER MANAGER / ADMINISTRATIVE RECEIVER","74","0.00%"],
  90. ["VOLUNTARY ARRANGEMENT / RECEIVER MANAGER","8","0.00%"],
  91. ["VOLUNTARY ARRANGEMENT / ADMINISTRATIVE RECEIVER","1","0.00%"],
  92. ["VOLUNTARY ARRANGEMENT / RECEIVERSHIP","1","0.00%"],
  93. ]
  94. local company_ages = [
  95. ["475","1","0.00%"],
  96. ["+150","75","0.00%"],
  97. ["100-149","5,758","0.19%"],
  98. ["50-99","53,788","1.76%"],
  99. ["30-49","120,862","3.95%"],
  100. ["20-29","175,876","5.76%"],
  101. ["10-19","565,363","18.50%"],
  102. ["5-9","719,719","23.55%"],
  103. ["4","179,057","5.86%"],
  104. ["3","233,894","7.65%"],
  105. ["2","316,072","10.34%"],
  106. ["1","451,577","14.78%"],
  107. ["-1","233,976","7.66%"],
  108. ]
  109. function emptyOnNull(key){
  110. local str = table_get(this, key, null);
  111. return str ? str : "";
  112. }
  113. function getPageLink(page){
  114. local fmt = "/?search_str=%s&search_post_code=%s&search_sic_code=%s&search_origin_post_code=%s&search_around_post_code=%s&page=%d";
  115. return format(fmt,
  116. url_encode(emptyOnNull("search_str")),
  117. url_encode(emptyOnNull("search_post_code")),
  118. url_encode(emptyOnNull("search_sic_code")),
  119. url_encode(emptyOnNull("search_origin_post_code")),
  120. url_encode(emptyOnNull("search_around_post_code")),
  121. page);
  122. }
  123. ?>
  124. <? if (table_get(this, "use_vjs", false) && table_get(this, "page_name", null) == "search_results"){ ?>
  125. <!--Load the AJAX API-->
  126. <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  127. <script type="text/javascript">
  128. // Load the Visualization API and the piechart package.
  129. google.load('visualization', '1.0', {'packages':['corechart']});
  130. // Set a callback to run when the Google Visualization API is loaded.
  131. google.setOnLoadCallback(drawChart);
  132. // Callback that creates and populates a data table,
  133. // instantiates the pie chart, passes in the data and
  134. // draws it.
  135. function drawChart() {
  136. // Create the data table.
  137. var data = new google.visualization.DataTable();
  138. data.addColumn('string', 'Topping');
  139. data.addColumn('number', 'Slices');
  140. data.addRows([
  141. <? foreach(k,v in account_categories) { ?>
  142. ["<?=v[0]?>", <?=v[1].gsub(",","")?>],
  143. <? } ?>
  144. ['', 0]
  145. ]);
  146. // Set chart options
  147. var options = {'title':'Distribution of companies by Account Category',
  148. 'width2':400,
  149. 'height':300};
  150. // Instantiate and draw our chart, passing in some options.
  151. var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
  152. chart.draw(data, options);
  153. // Create the data table.
  154. var data2 = new google.visualization.DataTable();
  155. data2.addColumn('string', 'Topping');
  156. data2.addColumn('number', 'Slices');
  157. data2.addRows([
  158. <? foreach(k,v in company_categories){ ?>
  159. ["<?=v[0]?>", <?=v[1].gsub(",","")?>],
  160. <? } ?>
  161. ['', 0]
  162. ]);
  163. // Set chart options
  164. var options2 = {'title':'Distribution of companies by Company Category',
  165. 'width2':400,
  166. 'height':300};
  167. // Instantiate and draw our chart, passing in some options.
  168. var chart2 = new google.visualization.PieChart(document.getElementById('chart2_div'));
  169. chart2.draw(data2, options2);
  170. // Create the data table.
  171. var data3 = new google.visualization.DataTable();
  172. data3.addColumn('string', 'Topping');
  173. data3.addColumn('number', 'Slices');
  174. data3.addRows([
  175. <? foreach(k,v in company_status) { ?>
  176. ["<?=v[0]?>", <?=v[1].gsub(",","")?>],
  177. <? } ?>
  178. ['', 0]
  179. ]);
  180. // Set chart options
  181. var options3 = {'title':'Distribution of companies by Company Status',
  182. 'width2':400,
  183. 'height':300};
  184. // Instantiate and draw our chart, passing in some options.
  185. var chart3 = new google.visualization.PieChart(document.getElementById('chart3_div'));
  186. chart3.draw(data3, options3);
  187. // Create the data table.
  188. var data4 = new google.visualization.DataTable();
  189. data4.addColumn('string', 'Topping');
  190. data4.addColumn('number', 'Slices');
  191. data4.addRows([
  192. <? foreach(k,v in company_ages){ ?>
  193. ["<?=v[0]?> years", <?=v[1].gsub(",","")?>],
  194. <? } ?>
  195. ['', 0]
  196. ]);
  197. // Set chart options
  198. var options4 = {'title':'Distribution of companies by Age',
  199. 'width2':400,
  200. 'height':300};
  201. // Instantiate and draw our chart, passing in some options.
  202. var chart4 = new google.visualization.PieChart(document.getElementById('chart4_div'));
  203. chart4.draw(data4, options4);
  204. var data5 = google.visualization.arrayToDataTable([
  205. ['Year', 'Survive', 'Registered'],
  206. ["2000",50134,210350],
  207. ["2001",58321,231281],
  208. ["2002",60334,211903],
  209. ["2003",95499,280408],
  210. ["2004",126032,378591],
  211. ["2005",102056,317459],
  212. ["2006",114497,341322],
  213. ["2007",135753,374450],
  214. ["2008",167628,423018],
  215. ["2009",157289,320284],
  216. ["2010",191538,333040],
  217. ["2011",253577,365982],
  218. ["2012",377167,413809],
  219. ]);
  220. var options5 = {
  221. title: 'Historical Company Registered and Survival',
  222. hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
  223. };
  224. var chart5 = new google.visualization.ColumnChart(document.getElementById('chart5_div'));
  225. chart5.draw(data5, options5);
  226. }
  227. </script>
  228. <? } ?>
  229. <script type="text/javascript">
  230. function getCookie(c_name)
  231. {
  232. var i,x,y,ARRcookies=document.cookie.split(";");
  233. for (i=0;i<ARRcookies.length;i++)
  234. {
  235. x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  236. y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  237. x=x.replace(/^\s+|\s+$/g,"");
  238. if (x==c_name)
  239. {
  240. return unescape(y);
  241. }
  242. }
  243. }
  244. function setCookie(c_name,value,exdays)
  245. {
  246. var exdate=new Date();
  247. exdate.setDate(exdate.getDate() + exdays);
  248. var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  249. document.cookie=c_name + "=" + c_value;
  250. }
  251. var saveLoadFormFields = ['search_str', 'search_post_code', 'search_sic_code', 'search_origin_post_code', 'search_around_post_code'];
  252. function saveFormFields(frm){
  253. for(var i=0; i< saveLoadFormFields.length; ++i){
  254. setCookie(saveLoadFormFields[i], frm[saveLoadFormFields[i]].value, 180);
  255. }
  256. return true;
  257. }
  258. function loadFormFields(){
  259. var frm = document.getElementById("search_form");
  260. if(frm){
  261. for(var i=0; i< saveLoadFormFields.length; ++i){
  262. frm[saveLoadFormFields[i]].value = getCookie(saveLoadFormFields[i]) || '';
  263. }
  264. }
  265. }
  266. function show_location(position) {
  267. var request;
  268. if (window.XMLHttpRequest) request = new XMLHttpRequest(); // Firefox, Safari, ...
  269. else if (window.ActiveXObject) request = new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer
  270. request.onreadystatechange = function(event, cached){
  271. if (request.readyState != 4) return;
  272. var cpc = document.getElementById("cpc");
  273. cpc.value = request.responseText;
  274. }
  275. request.open("GET", "/getpc?lat=" + position.coords.latitude + "&lon=" +position.coords.longitude, true);
  276. request.send(null);
  277. }
  278. function get_post_code(){
  279. navigator.geolocation.getCurrentPosition(show_location);
  280. }
  281. function setSicCode(code){
  282. document.getElementById("search_form").search_sic_code.value=code
  283. }
  284. var isSortedByDistance = true;
  285. function sortTable(id, col, numeric){
  286. var tbl = document.getElementById(id).tBodies[0];
  287. var store = [];
  288. for(var i=1, len=tbl.rows.length; i<len; i++){
  289. store.push( tbl.rows[i]);
  290. }
  291. if(numeric){
  292. store.sort(function(x,y){
  293. var num1 = parseFloat(x.cells[col].textContent || row.cells[col].innerText);
  294. var num2 = parseFloat(y.cells[col].textContent || row.cells[col].innerText);
  295. return num1-num2;
  296. });
  297. } else {
  298. store.sort(function(x,y){
  299. var str1 = x.cells[col].textContent || row.cells[col].innerText;
  300. var str2 = y.cells[col].textContent || row.cells[col].innerText;
  301. return (str1 < str2 ? -1 : (str1 > str2 ? 1 : 0));
  302. });
  303. }
  304. for(var i=0, len=store.length; i<len; i++){
  305. tbl.appendChild(store[i]);
  306. }
  307. store = null;
  308. return false;
  309. }
  310. </script>
  311. </head>
  312. <body onload="loadFormFields()">
  313. <div class="wrapper">
  314. <header>
  315. <div class="logo"><h1><a href="/">CIUK</a></h1></div>
  316. <nav>
  317. <ul id="navlist">
  318. <li id="active"><a href="/">Home</a></li>
  319. <li><a href="#">About</a></li>
  320. <li><a href="#">Shop</a></li>
  321. <li><a href="#">Customers</a></li>
  322. <li><a href="#">Contact</a></li>
  323. </ul>
  324. </nav>
  325. <div class="clearfloat"></div>
  326. </header>
  327. <section>
  328. <div class="horSeparator"></div>
  329. <h1>Welcome to Companies Info UK</h1>
  330. <p>
  331. Here you'll find interesting statistics and info about companies in UK.
  332. </p>
  333. <form action="/#results" method="post" onsubmit="saveFormFields(this)" id="search_form">
  334. <table>
  335. <tr><td>Company Name</td><td><input type="text" name="search_str" value="<?=search_str?>" title="enter a company name to search"></td></tr>
  336. <tr><td>Extra info</td><td><input type="text" name="search_extra_info" value="<?=search_extra_info?>" title="enter extra info to search"></td></tr>
  337. <tr><td>Post Code</td><td><input type="text" name="search_post_code" value="<?=search_post_code?>" title="enter a complete or parcial post code"></td></tr>
  338. <tr><td><select name="sic_street"><option value="sic">SIC Code</option><option value="street">Street</option></select></td>
  339. <td><input type="text" name="search_sic_code" value="<?=search_sic_code?>" title="enter a complete or parcial sic code"></td></tr>
  340. <tr><td>Your Post Code</td><td><input type="text" id="cpc" name="search_origin_post_code" value="<?=search_origin_post_code?>" title="enter your postcode if you want see distances" size="7">
  341. <input type="text" name="search_around_post_code" value="<?=search_around_post_code?>" title="enter the distance in meters to search around your postcode" size="7">
  342. </td></tr>
  343. <tr><td><button type=submit>Search</button></td><td id="cloc"><button type=button onclick="get_post_code()">Get Postcode</button>
  344. <button type=reset>Reset</button></td></tr>
  345. </table>
  346. </form>
  347. <? if (table_get(this, "isAndroid", false)){ ?>
  348. <a href="/mk-gpx?sic_term=<?=search_sic_code?>">Generate GPX</a>
  349. <? } ?>
  350. <div class="horSeparator"></div>
  351. </section>
  352. <article class="post">
  353. <? if (page_name == "search_results"){ ?>
  354. <? if (table_get(this, "sic_street", null) == "street"){ ?>
  355. <header><h1 id="results">Street Search Results</h1></header>
  356. <? if (table_get(this, "queryWasInterrupted", false)){ ?>
  357. <p>Please try again with more specific search terms, it took too long !</p>
  358. <? } ?>
  359. <? if (table_get(this, "rows", false) && rows.len() > 0){ ?>
  360. <table class="nj">
  361. <tr><th>Company</th><th>Street</th><th>Postcode</th></tr>
  362. <? foreach( k, rec in rows){ ?>
  363. <tr><td><a href="view?id=<?=rec[0]?>#results"><?=rec[0]?></a></td><td><?=rec[1]?></td><td><?=rec[2]?></td></tr>
  364. <? }
  365. page = page.tointeger();
  366. local hasPrevious = page;
  367. local hasNext = rows.len() == limit;
  368. if (hasPrevious || hasNext){
  369. ?>
  370. <tr><td>
  371. &nbsp;
  372. <? if (hasPrevious){ ?>
  373. <a href="/?search_sic_code=<?=url_encode(table_get(this, "search_sic_code", ""))?>&page=<?=page-1?>">Prev</a>
  374. <? } ?>
  375. </td><td>&nbsp;</td><td>
  376. &nbsp;
  377. <? if (hasNext){ ?>
  378. <a href="/?search_sic_code=<?=url_encode(table_get(this, "search_sic_code", ""))?>&page=<?=page+1?>">Next</a>
  379. <? } ?>
  380. </td></tr>
  381. <? } ?>
  382. </table>
  383. <?
  384. }
  385. } else if (table_get(this, "sicSearchResults", false)) { ?>
  386. <header><h1 id="results">SIC Code Search Results</h1></header>
  387. <? if (table_get(this, "queryWasInterrupted", false)){ ?>
  388. <p>Please try again with more specific search terms, it took too long !</p>
  389. <? } ?>
  390. <? if (table_get(this, "rows", false) && rows.len() > 0){ ?>
  391. <table class="nj">
  392. <tr><th>Code</th><th>Description</th><th>#Companies</th></tr>
  393. <? foreach( k, rec in rows){ ?>
  394. <tr><td><a href="#search_form" onclick="setSicCode(<?=rec[1]?>)"><?=rec[1]?></a></td><td><?=rec[2]?></td><td><?=table_get(rec, 3, "")?></td></tr>
  395. <? }
  396. page = page.tointeger();
  397. local hasPrevious = page > 0;
  398. local hasNext = rows.len() == limit;
  399. if (hasPrevious || hasNext){
  400. ?>
  401. <tr><td>
  402. &nbsp;
  403. <? if (hasPrevious){ ?>
  404. <a href="/?search_sic_code=<?=url_encode(table_get(this, "search_sic_code", ""))?>&page=<?=page-1?>">Prev</a>
  405. <? } ?>
  406. </td><td>&nbsp;</td><td>
  407. &nbsp;
  408. <? if (hasNext){ ?>
  409. <a href="/?search_sic_code=<?=url_encode(table_get(this, "search_sic_code", ""))?>&page=<?=page+1?>">Next</a>
  410. <? } ?>
  411. </td></tr>
  412. <? } ?>
  413. </table>
  414. <?
  415. }
  416. } else { ?>
  417. <header><h1 id="results">Companies Search Results</h1></header>
  418. <? if (table_get(this, "queryWasInterrupted",false)) { ?>
  419. <p>Please try again with more specific search terms, it took too long !</p>
  420. <? } ?>
  421. <? if (table_get(this, "rows", false) && rows.len() > 0){ ?>
  422. <table class="nj dist" id="tblcr">
  423. <tr><th><a href="" onclick="return sortTable('tblcr', 0)">Number</a></th>
  424. <th><a href="" onclick="return sortTable('tblcr', 1)">Name</a></th>
  425. <th><a href="" onclick="return sortTable('tblcr', 2, true)">Age (years)</a></th>
  426. <?
  427. local hasDistances = table_get(this, "search_origin_post_code", false) && search_origin_post_code.len() > 0;
  428. if (hasDistances){
  429. ?>
  430. <th><a href="" onclick="return sortTable('tblcr', 3, true)">Dist. Meters</a></th>
  431. <? } ?>
  432. <th>Google</th></tr>
  433. <? foreach( k, rec in rows){ ?>
  434. <tr><td><?=rec[1]?></td><td><a href="view?id=<?=rec[0]?>#results"><?=rec[2]?></a></td><td><?=rec[3]?></td>
  435. <?if (hasDistances){ ?>
  436. <td><?=rec[5]?> <img src="images/small-arrow.png" style="transform:rotate(<?=rec[6]?>deg);-webkit-transform:rotate(<?=rec[6]?>deg)"></td>
  437. <? } ?>
  438. <td><a href="http://www.google.co.uk/search?q=<?=url_encode(format("%s %s", rec[2], rec[4]))?>" target="gsearch">Google</a></td></tr>
  439. <? }
  440. page = page.tointeger();
  441. local hasPrevious = page > 0;
  442. local hasNext = rows.len() == limit;
  443. if (hasPrevious || hasNext){
  444. ?>
  445. <tr><td>
  446. &nbsp;
  447. <? if (hasPrevious){ ?>
  448. <a href="<?=getPageLink(page-1)?>#results">Prev</a>
  449. <? } ?>
  450. </td><td>&nbsp;</td><td>
  451. &nbsp;
  452. <? if (hasNext){ ?>
  453. <a href="<?=getPageLink(page+1)?>#results">Next</a>
  454. <? } ?>
  455. </td>
  456. <?if (hasDistances){ ?>
  457. <td>&nbsp;</td>
  458. <? } ?>
  459. <td>&nbsp;</td></tr>
  460. <? } ?>
  461. </table>
  462. <?
  463. }
  464. }
  465. }
  466. else if (page_name == "view_company") {
  467. var pc1, pc2, google_map_url, geo_link;
  468. if (table_get(company, "post_code", false) && company.post_code.len() > 0){
  469. company.post_code.gmatch("([^%s]+)%s([^%s]+)", function(m1,m2) {pc1=m1;pc2=m2;});
  470. if (pc1 && pc2){
  471. google_map_url = format("https://maps.google.co.uk/maps?key=AIzaSyAF53Wut8B5cvaUDY-pfegBhbftJdRHovM&amp;channel=cs&amp;q=%s+%s&amp;ie=UTF8&amp;hq=&amp;hnear=%s+%s,+United+Kingdom&amp;gl=uk&amp;t=m&amp;z=14&amp;source=embed", pc1, pc2, pc1, pc2);
  472. }
  473. if (longitude) geo_link = format("geo:%f,%f&z=16", latitude,longitude);
  474. else geo_link = "#";
  475. ?>
  476. <header><h1 id="results"><?=company.number?> - <?=company.name?></h1></header>
  477. <table class="nj dist">
  478. <tr><td>Address</td><td>
  479. <?=company.address?><br>
  480. <?=company.address2?><br>
  481. <?=company.post_town?><br>
  482. <?=company.county?><br>
  483. </td></tr>
  484. <tr><td>Post code</td><td>
  485. <a href="<?=geo_link?>"><?=company.post_code?></a>
  486. <? if (google_map_url){ ?>
  487. <small><a href="<?=google_map_url?>" style="color:#0000FF;text-align:right" target="ViewOnMap">View Map</a></small>
  488. <? } ?>
  489. </td></tr>
  490. <tr><td>Status</td><td><?=company.status?></td></tr>
  491. <tr><td>Date of Incorporation</td><td><?=company.incorporation_date?></td></tr>
  492. <tr><td>Country of Origin</td><td><?=company.country_of_origin?></td></tr>
  493. <tr><td>Accounting Reference Date</td><td><?=company.incorporation_date?></td></tr>
  494. <tr><td>Last Accounts Made Up To</td><td><?=company.account_last_made_up_date?></td></tr>
  495. <tr><td>Next Accounts Due</td><td><?=company.account_next_due_date?></td></tr>
  496. <tr><td>Last Return Made Up To</td><td><?=company.returns_last_made_up_date?></td></tr>
  497. <tr><td>Next Return Due</td><td><?=company.returns_next_due_date?></td></tr>
  498. <tr><td>Company Type</td><td><?=company.category?></td></tr>
  499. <tr><td>Nature of Business (SIC)</td><td>
  500. <? foreach(k,v in company_sic_codes){ ?>
  501. <?=v[0]?> - <?=v[1]?><br>
  502. <? } ?>
  503. </td></tr>
  504. <tr><td>Previous Names</td><td>
  505. <? if (table_get(this, "company_old_names", false) && company_old_names.len() > 0){ ?>
  506. <table>
  507. <tr><th>Date of change</th><th>Previous Name</th></tr>
  508. <? foreach(k,v in company_old_names){ ?>
  509. <tr><td><?=v[0]?></td><td><?=v[1]?></td></tr>
  510. <? } ?>
  511. </table>
  512. <? } ?>
  513. </td></tr>
  514. </table>
  515. <? if (table_get(this, "extra_data", false) && extra_data.len() > 0){ ?>
  516. <table>
  517. <tr><th>Doc. Type</th><th>Date</th><th>Description</th></tr>
  518. <? foreach(k,v in extra_data.split('\n')){
  519. local rec = v.split('|');
  520. ?>
  521. <tr><td><?=rec[0]?></td><td><?=rec[1]?></td><td><?=rec[2]?></td></tr>
  522. <? } ?>
  523. </table>
  524. <? } ?>
  525. <?
  526. if (table_get(this, "show_map", false) && pc1 && pc2){
  527. ?>
  528. <br />
  529. <div style="margin: 0 auto; width: 425px;">
  530. <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
  531. src="https://maps.google.co.uk/maps?key=AIzaSyAF53Wut8B5cvaUDY-pfegBhbftJdRHovM&amp;channel=cs&amp;q=<?=pc1?>+<?=pc2?>&amp;ie=UTF8&amp;hq=&amp;hnear=<?=pc1?>+<?=pc2?>,+United+Kingdom&amp;gl=uk&amp;t=m&amp;z=14&amp;output=embed"></iframe>
  532. <br /><small><a href="<?=google_map_url?>" style="color:#0000FF;text-align:left">View Larger Map</a></small>
  533. </div>
  534. <?
  535. }
  536. }
  537. } ?>
  538. </article>
  539. <? if (page_name == "search_results"){ ?>
  540. <article class="post">
  541. <header><h1>Distribution of companies by Account Category</h1></header>
  542. <table>
  543. <tr><th>Account Category</th><th>Companies</th><th>%Total</th></tr>
  544. <tr><td>All Companies</td><td>3,056,018</td><td>100%</td></tr>
  545. <? foreach(k,v in account_categories){ ?>
  546. <tr><td><?=v[0]?></td><td><?=v[1]?></td><td><?=v[2]?></td></tr>
  547. <? } ?>
  548. </table>
  549. <!--Div that will hold the pie chart-->
  550. <div id="chart_div"></div>
  551. <div class="clearfloat"></div>
  552. </article>
  553. <article class="post">
  554. <header><h1>Distribution of companies by Company Category</h1></header>
  555. <table>
  556. <tr><th>Company Category</th><th>Companies</th><th>%Total</th></tr>
  557. <tr><td>All Companies</td><td>3,056,018</td><td>100%</td></tr>
  558. <? foreach(k,v in company_categories){ ?>
  559. <tr><td><?=v[0]?></td><td><?=v[1]?></td><td><?=v[2]?></td></tr>
  560. <? } ?>
  561. </table>
  562. <!--Div that will hold the pie chart-->
  563. <div id="chart2_div"></div>
  564. <div class="clearfloat"></div>
  565. </article>
  566. <article class="post">
  567. <header><h1>Distribution of companies by Company Status</h1></header>
  568. <table>
  569. <tr><th>Company Status</th><th>Companies</th><th>%Total</th></tr>
  570. <tr><td>All Companies</td><td>3,056,018</td><td>100%</td></tr>
  571. <? foreach(k,v in company_status){ ?>
  572. <tr><td><?=v[0]?></td><td><?=v[1]?></td><td><?=v[2]?></td></tr>
  573. <? } ?>
  574. </table>
  575. <!--Div that will hold the pie chart-->
  576. <div id="chart3_div"></div>
  577. <div class="clearfloat"></div>
  578. </article>
  579. <article class="post">
  580. <header><h1>Distribution of companies by Age (years)</h1></header>
  581. <table>
  582. <tr><th>Age(years)</th><th>Companies</th><th>%Total</th></tr>
  583. <tr><td>All Companies</td><td>3,056,018</td><td>100%</td></tr>
  584. <? foreach(k,v in company_ages){ ?>
  585. <tr><td><?=v[0]?></td><td><?=v[1]?></td><td><?=v[2]?></td></tr>
  586. <? } ?>
  587. </table>
  588. <!--Div that will hold the pie chart-->
  589. <div id="chart4_div"></div>
  590. <div class="clearfloat"></div>
  591. <!--Div that will hold the pie chart-->
  592. <div id="chart5_div"></div>
  593. <div class="clearfloat"></div>
  594. </article>
  595. <? } ?>
  596. <section class="sectionFooter">
  597. <div class="footerBox">
  598. <h2>Free data from <a href="http://www.companieshouse.gov.uk/index.shtml">Companies House</a></h2>
  599. <p>
  600. The Free Public Data Product is a downloadable data snapshot containing basic company data of live companies on the register. This snapshot is provided as ZIP files containing data in CSV format and is split into multiple files for ease of downloading.
  601. </p>
  602. </div>
  603. <div class="footerBox">
  604. <h2>Free data from <a href="https://www.ordnancesurvey.co.uk/">Ordnance Survey</a></h2>
  605. <p>
  606. Code-Point Open provides a precise geographic location for each postcode unit in Great Britain. The product is a CSV file containing postcodes, grid references, NHS® health and regional health authority codes, administrative ward, district, county and country area codes.
  607. </p>
  608. </div>
  609. <div class="clearfloat"></div>
  610. </section>
  611. </div>
  612. <footer>
  613. <p>
  614. Copyright &copy; Domingo Alvarez Duarte. All rights reserved. Designed by <a href="http://www.free-responsive-templates.com" title="free responsive templates">Free Responsive Templates</a>, Validation
  615. <a class="footerLink" href="http://validator.w3.org/check/referer" title="This page validates as HTML5"><abbr title="HyperText Markup Language">HTML5</abbr></a> |
  616. <a class="footerLink" href="http://jigsaw.w3.org/css-validator/check/referer" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS3</abbr></a>
  617. </p>
  618. </footer>
  619. </body>
  620. </html>