$v) { $string .= $string_a[$v]; } session_register("stringcode"); $_SESSION['stringcode'] = $string; //$backgroundimage = "security/bg_im.gif"; //$im=imagecreatefromgif($backgroundimage); //$colour = imagecolorallocate($im, rand(0,0), rand(0,0), rand(0,0)); //$font = 'security/arial.ttf'; //$angle = rand(0,0); // Add the text //imagefttext( //imagettftext($im, 11, $angle,14, 17, $colour, $font, $string); //$outfile= "security/$fileRand.gif"; //imagegif($im,$outfile); return $string; } function NumRow($field,$table,$clause) { return mysql_num_rows(mysql_query("SELECT $field FROM $table WHERE $clause")) ; } function order($m,$j,$k) { for($i=$m;$i<$j;$i++) { echo ""; } } /*Category news*/ function CategoryNews($id,$table) { $sqlstr=mysql_query("SELECT * FROM ".$table." WHERE status=true ORDER BY stt ASC"); if(mysql_num_rows($sqlstr)>0) { while($row=mysql_fetch_array($sqlstr)) { echo ""; $sqlsub=mysql_query("SELECT * FROM ".$table." WHERE parent='".$row['id']."'"); if(mysql_num_rows($sqlsub)>0) { while($rowsub=mysql_fetch_array($sqlsub)) { echo ""; } } } } } /*Parent Category*/ function money($email,$table) { $sqlstr=mysql_query("SELECT * FROM ".$table." WHERE status=true ORDER BY id ASC"); if(mysql_num_rows($sqlstr)>0) { while($row=mysql_fetch_array($sqlstr)) { echo ""; } } } /*Parent Category*/ function CategoryParent($id,$table) { $sqlstr=mysql_query("SELECT * FROM ".$table." WHERE status=true AND parent='0' ORDER BY stt ASC"); if(mysql_num_rows($sqlstr)>0) { while($row=mysql_fetch_array($sqlstr)) { echo ""; } } } /*Parent Category*/ function CategoryParent2($id,$table) { $sqlstr=mysql_query("SELECT * FROM ".$table." WHERE status=true AND parent='0' ORDER BY stt ASC"); if(mysql_num_rows($sqlstr)>0) { while($row=mysql_fetch_array($sqlstr)) { echo ""; $toilatoi=$row['id'] ; $sqlstr2=mysql_query("SELECT * FROM ".$table." WHERE status=true AND parent='$toilatoi' ORDER BY stt ASC"); if(mysql_num_rows($sqlstr2)>0) { while($row2=mysql_fetch_array($sqlstr2)) { echo ""; } } } } } /*Category*/ function Category($id,$k,$table) { if($k !='') { $sqlstr=mysql_query("SELECT * FROM ".$table." WHERE status = true AND parent = '".intval($k)."' ORDER BY stt ASC"); if(mysql_num_rows($sqlstr)>0) { while($row=mysql_fetch_array($sqlstr)) { echo ""; } } } } /*Upload picture*/ function uploads($file='picture',$folder = '../images/') { global $picture; $picture = time()."_".$_FILES[$file]['name']; if($_FILES[$file]["size"] < 2000000) { if(@copy($_FILES[$file]['tmp_name'],$folder.$picture)) { $check=@getimagesize($folder.$picture); if($check[0]!='') { return $picture; } else { @unlink($folder.$picture); echo ""; } } else { return $picture=''; } } else { echo ""; } } /*Upload picture*/ function uploadsb($file='picture',$folder = '../images/') { global $picture; $picture = time()."_".$_FILES[$file]['name']; if(@copy($_FILES[$file]['tmp_name'],$folder.$picture)) { $check=@getimagesize($folder.$picture); return $picture; } else { return $picture=''; } } function text(&$string) { $string = trim($string); $string = str_replace("\\'","'",$string); $string = str_replace("'","''",$string); $string = str_replace('\"',""",$string); $string = str_replace("<", "<", $string); $string = str_replace(">", ">", $string); return $string; } function textContent($string) { return $string; } function vn2latin($cs, $tolower = false) { /*Mảng chứa tất cả ký tự có dấu trong Tiếng Việt*/ $marTViet=array("à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă", "ằ","ắ","ặ","ẳ","ẵ","è","é","ẹ","ẻ","ẽ","ê","ề", "ế","ệ","ể","ễ", "ì","í","ị","ỉ","ĩ", "ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ", "ờ","ớ","ợ","ở","ỡ", "ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ", "ỳ","ý","ỵ","ỷ","ỹ", "đ", "À","Á","Ạ","Ả","Ã","Â","Ầ","Ấ","Ậ","Ẩ","Ẫ","Ă", "Ằ","Ắ","Ặ","Ẳ","Ẵ", "È","É","Ẹ","Ẻ","Ẽ","Ê","Ề","Ế","Ệ","Ể","Ễ", "Ì","Í","Ị","Ỉ","Ĩ", "Ò","Ó","Ọ","Ỏ","Õ","Ô","Ồ","Ố","Ộ","Ổ","Ỗ","Ơ","Ờ","Ớ","Ợ","Ở","Ỡ", "Ù","Ú","Ụ","Ủ","Ũ","Ư","Ừ","Ứ","Ự","Ử","Ữ", "Ỳ","Ý","Ỵ","Ỷ","Ỹ", "Đ"," ","/",";",":","&",","," - ","?","!"); /*Mảng chứa tất cả ký tự không dấu tương ứng với mảng $marTViet bên trên*/ $marKoDau=array("a","a","a","a","a","a","a","a","a","a","a", "a","a","a","a","a","a", "e","e","e","e","e","e","e","e","e","e","e", "i","i","i","i","i", "o","o","o","o","o","o","o","o","o","o","o","o", "o","o","o","o","o", "u","u","u","u","u","u","u","u","u","u","u", "y","y","y","y","y", "d", "A","A","A","A","A","A","A","A","A","A","A","A", "A","A","A","A","A", "E","E","E","E","E","E","E","E","E","E","E", "I","I","I","I","I", "O","O","O","O","O","O","O","O","O","O","O","O","O","O","O","O","O", "U","U","U","U","U","U","U","U","U","U","U", "Y","Y","Y","Y","Y", "D","-","-","-","-","-","-","-","",""); if ($tolower) { return strtolower(str_replace($marTViet,$marKoDau,$cs)); } return str_replace($marTViet,$marKoDau,$cs); } ?>num_page()) $next=num_page(); if($_GET['page']>num_page()) $page=num_page(); echo ''; echo ''; for($i=1;$i<=num_page();$i++) { echo ''; if($i%15 == 0) echo ""; } echo '
Trang:'; echo " ".$i." "; echo '
'; } function view_page_view($link) { global $n_record,$i,$links; $next=$_GET['view']+1; $back=$_GET['view']-1; $page=$_GET['view']; if($back<=1) $back=1; if($next>num_page()) $next=num_page(); if($_GET['view']>num_page()) $page=num_page(); echo ''; echo '"; echo '"; if($_GET['view']>5) { echo ''; } for($i=1;$i<=num_page();$i++) { if($i < $_GET['view']+5 && $i > $_GET['view']-5) { echo ''; } } if(num_page()>=5) echo ''; $k=$i-1; echo '"; echo '
'; echo " Trang ("; echo $_GET['view']== ''?1:$_GET['view']; echo '/'.num_page().') '; echo "'; echo " "."Trang đầu tiên"." ...'; echo " ".$i." "; echo '...'; echo " "."Trang cuối"." 
'; } function view_page_view2($link) { global $n_record,$i,$links; $next=$_GET['view']+1; $back=$_GET['view']-1; $page=$_GET['view']; if($back<=1) $back=1; if($next>num_page()) $next=num_page(); if($_GET['view']>num_page()) $page=num_page(); echo ''; echo '"; echo '"; if($_GET['view']>5) { echo ''; } for($i=1;$i<=num_page();$i++) { if($i < $_GET['view']+5 && $i > $_GET['view']-5) { echo ''; } } if(num_page()>=5) echo ''; $k=$i-1; echo '"; echo '
'; echo " Trang "; echo $_GET['view']== ''?1:$_GET['view']; echo '/'.num_page().' '; echo "'; echo " "."Trang đầu tiên"." ...'; echo " ".$i." "; echo '...'; echo " "."Trang cuối"." 
'; } ?>0) { echo ""; session_start(); session_destroy(); ?>