PageRenderTime 88ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Quản lý sim số đẹp PHP/header.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien
PHP | 244 lines | 209 code | 15 blank | 20 comment | 35 complexity | 9f5ecb8c8ee541febfa198a1be194658 MD5 | raw file
  1. <?php
  2. $stv=new Smarty();
  3. ob_start();
  4. function xmang($arr)
  5. {
  6. foreach ($arr AS &$value)
  7. {
  8. if (strlen($value)==3)
  9. $l3[]="'".$value."'";
  10. else
  11. $l4[]="'".$value."'";
  12. $valuex[]=$value;
  13. }
  14. if ($l4 && $l3)
  15. $where.="(left(sim2,3) IN(".join(", ",$l3).") || left(sim2,4) IN(".join(", ",$l4)."))";
  16. else if ($l3)
  17. $where.="(left(sim2,3) IN(".join(", ",$l3)."))";
  18. else
  19. $where.="(left(sim2,4) IN(".join(", ",$l4)."))";
  20. $q=query("SELECT sim2 FROM simso WHERE $where");
  21. if (@mysql_num_rows($q) > 0)
  22. return 1;
  23. else
  24. return 0;
  25. }
  26. $qp=mysql_query("SELECT id, ptitle FROM page WHERE pcode='menu' order by pos asc");
  27. $nav='<table style="width: auto" cellspacing="0">
  28. <tr>';
  29. $nav.='<td class="selected"><span><a href="'.$myinfo[my_domain].'" target="_self" title="Trang chủ">Trang chủ</a></span></td>';
  30. while ($rqp=mysql_fetch_array($qp))
  31. {
  32. $nav.='<td><span><a href="'.$myinfo[my_domain].'/v'.$rqp['id'].xoadau($rqp['ptitle']).'.html" id='.$rqp['id'].'>'.$rqp['ptitle'].'</a></span></td>';
  33. }
  34. $nav.='<td><span><a href="'.$myinfo[my_domain].'/ho-tro-khach-hang.support">Hỗ trợ hỏi đáp</a></span></td>';
  35. $nav.='<td><span><a href="'.$myinfo[my_domain].'/Lien-He">Liên Hệ</a></span></td>';
  36. $nav.='</tr>
  37. </table>';
  38. $stv->assign("nav",$nav);
  39. /*
  40. $sql1=query("SELECT count(sim2) AS so, sim2 AS sim FROM simso GROUP BY left(sim2,4)");
  41. foreach ($mang['s'] AS $skey => $svalue)
  42. {
  43. if (xmang($mang['s'][$skey])!= 0)
  44. {
  45. $i++;
  46. $hname[] = $skey;
  47. $hdauso[]=number_format(demsodau($svalue),0,".",".");
  48. $tongdau+=demsodau($svalue);
  49. }
  50. }
  51. $stv->assign("name",$hname);
  52. $stv->assign("dauso",$hdauso);
  53. $stv->assign("tongdau",number_format($tongdau,0,".","."));
  54. */
  55. $menu="";
  56. foreach ($mang['s'] AS $mk => $mv)
  57. {
  58. $menu.='<li><a href="'.$myinfo[my_domain].'/Sim-'.$mk.'.html">'.$mk.'</a></li>';
  59. }
  60. function donhang()
  61. {
  62. $str='<table id="slidee" style="border-collapse: collapse; background: none repeat scroll 0% 0% rgb(255, 255, 255);" width="100%" border="1" bordercolor="#C0C0C0" cellpadding="5">
  63. <tbody>';
  64. $sql=mysql_query("SELECT * FROM my_order where trangthai!='Xóa' order by id desc limit 20");
  65. while ($row=mysql_fetch_array($sql))
  66. {
  67. $str.='<tr>
  68. <td><b>'.$row[hovaten].'</b>
  69. <br>'.$row[sosim].'
  70. <br>'.$row[ngaygio].'</td>
  71. </tr>';
  72. }
  73. $str.='</tbody></table>';
  74. return $str;
  75. }
  76. $stv->assign("donhang",donhang());
  77. $stv->assign("menu",$menu);
  78. foreach ($loai['s'] as $name => $value)
  79. {
  80. $links[]=$myinfo[my_domain]."/".$name.".html";
  81. $linkname[]=$value;
  82. }
  83. $stv->assign("link",$links);
  84. $stv->assign("linkname",$linkname);
  85. if ($_GET['sloai'] && $_GET['smang'])
  86. {
  87. if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  88. $title=$myinfo[my_keyword]." - ".$_GET['sloai']." &laquo; ".str_replace('-','',$_GET['sloai'])." ".$_GET['smang']." &laquo; Danh sanh so dep ".$_GET['sloai']." ".$pagex;
  89. $title=str_replace("-"," ",$title);
  90. }
  91. elseif ($_GET['sloai'])
  92. {
  93. if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  94. $title=$myinfo[my_keyword]." - Sim ".str_replace(array('-','sim'),array(' ',''),$_GET['sloai'])." &laquo; Sim ".str_replace(array('-','sim'),array(' ',''),$_GET['sloai'])." dep &laquo; Danh sach so dep ".str_replace(array('-','sim'),array(' ',''),$_GET['sloai'])." ".$pagex;
  95. }
  96. elseif ($_GET['smang'])
  97. { if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  98. if (!$_GET['act'])$title="sim so dep";
  99. else
  100. $title=$myinfo[my_keyword]." - Sim ".str_replace("-"," ",$_GET['smang'])." &laquo; Sim ".$_GET['smang']." đẹp &laquo; Danh Sách sim số đẹp ".$_GET['smang'].$pagex;
  101. }
  102. elseif ($_GET['act']=="search")
  103. {
  104. $title="Tìm Sim số đẹp ".$_GET['Textsim'];
  105. }
  106. elseif ($_GET['sdauso'])
  107. {
  108. if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  109. $dauso="dau so ".$_GET['sdauso']." ".$pagex;
  110. $title=$myinfo[my_keyword]." - dau so ".preg_replace('/[a-zA-Z-]/','',$_GET['sdauso']).", dau so viettel, dau so mobifone, dau so vinaphone";
  111. }
  112. elseif ($_GET['sosim'])
  113. {
  114. $title=$myinfo[my_keyword]." - ".$_GET['sosim']." &laquo; Sim Số Đẹp &laquo; ".$my_title." &laquo; ".$myinfo[my_domain];
  115. }
  116. elseif ($_GET['link'])
  117. {
  118. $title=str_replace('-',' ',$_GET['link']);
  119. }
  120. elseif ($_GET['cid'])
  121. {
  122. if ($_GET['cid']=="gioithieu")$title=$my_title." => Giới Thiệu";
  123. elseif ($_GET['cid']=="thanhtoan")$title=$my_title."=> Thanh Toán";
  124. elseif ($_GET['cid']=="hotro")$title=$my_title." => Hỗ trợ";
  125. elseif ($_GET['cid']=="lienhe")$title=$my_title." => Liên Hệ";
  126. }
  127. elseif ($_GET['tag'])
  128. {
  129. $xtag=str_replace("-"," ",$_GET['tag']);
  130. $title=$xtag." rẻ, ".$xtag." dep, ".$xtag." de nho, ".$xtag." vip";
  131. }
  132. else
  133. {
  134. $title=$myinfo[my_title];
  135. }
  136. $stv->assign("title",$title);
  137. if ($_GET['sosim'])
  138. {
  139. $des="Bạn đang tìm sim số đẹp ".$rxs['sim1']." ? mời bạn vào website ".$myinfo[my_domain]." nơi có hàng triệu sim số đẹp để bạn lựa chọn!";
  140. }
  141. elseif ($_GET['sloai'])
  142. { if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  143. $des=$myinfo[my_keyword]." - ".$loai['s'][$_GET['sloai']]." | Sim số đẹp ".$loai['s'][$_GET['sloai']]." | ".$myinfo[my_domain]." - Có hàng nghìn ".$loai['s'][$_GET['sloai']]." để bạn lựa chọn. ".$pagex;
  144. }
  145. elseif ($_GET['smang'])
  146. { if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  147. $des=$myinfo[my_keyword]." - Sim ".$_GET['smang'].", Sim số Đẹp ".$_GET['smang']." | ".$myinfo[my_domain]." - Có Hàng nghìn sim số đẹp ".$_GET['smang']." giá rẻ để bạn lựa chọn. ".$pagex;
  148. }
  149. elseif ($_GET['link'])
  150. {
  151. $des=str_replace('-',' ',$_GET['link']);
  152. }
  153. elseif ($_GET['cid'])
  154. {
  155. if ($_GET['cid']=="gioithieu")$title="Giới Thiệu";
  156. elseif ($_GET['cid']=="thanhtoan")$title="Thanh Toán";
  157. elseif ($_GET['cid']=="hotro")$title="Hỗ trợ";
  158. elseif ($_GET['cid']=="lienhe")$title="Liên Hệ";
  159. $des=$myinfo[my_keyword]." - ".$title." ".$myinfo[my_domain]." - Hàng triệu sim số đẹp giá rẻ để bạn chọn.
  160. Hotline: ".$myinfo[my_hl1]." - ".$myinfo[my_hl2];
  161. }
  162. elseif ($_GET['sdauso'])
  163. {
  164. if ($_GET['page'])$pagex="Trang ".$_GET['page'];
  165. $des=$myinfo[my_keyword]." - dau so ".$_GET['sdauso']." | ".$myinfo[my_domain]." - Hàng triệu sim số đẹp giá rẻ để bạn chọn.
  166. Hotline: ".$myinfo[my_hl1]." - ".$myinfo[my_hl2]." ".$pagex;;
  167. }
  168. elseif ($_GET['tag'])
  169. {
  170. $xtag=str_replace("-"," ",$_GET['tag']);
  171. $des=$xtag." rẻ, ".$xtag." dep, ".$xtag." de nho, ".$xtag." vip";
  172. $stv->assign("h1x",$des);
  173. }
  174. else
  175. {
  176. $des=$myinfo['my_keyword']." ".$myinfo[my_domain].", ".$my_title." Vinaphone - Mobifone - Viettel .
  177. Call: ".$myinfo[my_hl1]." - ".$myinfo[my_hl2];
  178. }
  179. $stv->assign("des",$des);
  180. if ($_GET['sloai'])
  181. {
  182. $h1x=xds($loai['s'][$_GET['sloai']]).", sim so dep ".$loai['s'][$_GET['sloai']];
  183. $h1link=$myinfo[my_domain]."/".$_GET['sloai'].".html";
  184. }
  185. elseif ($_GET['smang'])
  186. {
  187. $h1x=$myinfo[my_keyword]." - Sim ".$_GET['smang'].", Sim so dep ".$_GET['smang'];
  188. $h1link=$myinfo[my_domain]."/Sim-".$_GET['smang'].".html";
  189. }
  190. elseif ($_GET['sdauso'])
  191. {
  192. $h1x="Dau so ".$_GET['sdauso'];
  193. $h1link=$myinfo[my_domain]."/dau-so".$_GET['sdauso'].".html";
  194. }
  195. else
  196. {
  197. $h1x="Sim so dep";
  198. $h1link=$myinfo[my_domain];
  199. }
  200. function page_edith()
  201. {
  202. $q=mysql_query("SELECT * FROM page WHERE pcode IN('quangcao_left','mucgia')");
  203. while ($r=mysql_fetch_assoc($q))
  204. {
  205. if ($r['pcode']=='quangcao_left')
  206. $s[p_quangcao_left]=$r['pconment'];
  207. else
  208. $s[p_mucgia]=$r['pconment'];
  209. }
  210. return $s;
  211. }
  212. $stv->assign(page_edith());
  213. $stv->assign($myinfo);
  214. $stv->assign("h1",$h1x);
  215. $stv->assign("h1link",$h1link);
  216. if ($_GET['sloai'] && $_GET['smang'])
  217. $shome=' >> <a href="'.$myinfo[my_domain].'/Sim-'.$_GET['smang'].'.html">'.$_GET['smang'].'</a> >> <a href="M-'.$_GET['smang'].'-'.$_GET['sloai'].'.html">'.$loai['s'][$_GET['sloai']].'</a>';
  218. elseif ($_GET['smang'])
  219. $shome=' >> <a href="'.$myinfo[my_domain].'/Sim-'.$_GET['smang'].'.html">'.$_GET['smang'].'</a>';
  220. elseif ($_GET['sloai'])
  221. $shome=' >> <a href="'.$myinfo[my_domain].'/'.$_GET['sloai'].'.html">'.$loai['s'][$_GET['sloai']].'</a>';
  222. $stv->assign("shome",$shome);
  223. ob_clean();
  224. $stv->display("header.htm");
  225. ?>