Tel. (662) 801-1226
Fax. (662) 801-1225
E-mail : info@sermat.co.th
SERVICES PRODUCT GALLERY PROFILE
                  Copy Right © SERMAT CO., LTD. 2004-2017 ALL RIGHT RESERVED.
EOF; $Foot_admin.=<< EOF; function webboard_foot(){ $Foot_.=<<
Tel. (662) 616-8827-8
Fax. (662) 616-8829
E-mail : sermat@asianet.co.th
SERVICES PRODUCT GALLERY PROFILE
                  Copy Right © SERMAT CO., LTD. 2004-2007 ALL RIGHT RESERVED.
EOF; return $Foot_; } ?> 0){ while ($myrow = mysql_fetch_array($result)) { $code_pro =$myrow["code_gallery"]; $pro_groupname=$myrow["gall_group_name"]; $values[$code_pro]=$pro_groupname; } } $gallerycombo=MakeCombo('protype',$values,400,$protype); //--------------------------- //$dir_=$mcf_url."/pictures/gallery/"; //$dir =$mcf_url."/$mcf_root/pictures/gallery/"; $dir =$_SERVER['DOCUMENT_ROOT']."$mcf_root/pictures/gallery/"; $DIR = opendir($dir); //--------------------------- $n=-1; while ($text = readdir($DIR)) { if ($text != "." && $text!="..") { if (filetype($dir.$text) != "dir" && $text!= "Thumbs.db" ){ $dir_pic=$mcf_url."/pictures/gallery/".$text; $dir_pic=$mcf_url."/pictures/gallery/".$text; $link_d=$mcf_url."/admin/gallery.php?a=3&text=".$text; $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."gallery"; $sql="SELECT * FROM ".$table." WHERE gallery_name = '".$text."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $gallery_detial =$myrow["gallery_detial"]; $codeproduct =$myrow["code_product"]; $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."gallery_gorup"; $sql="SELECT * FROM ".$table." WHERE code_gallery = '".$codeproduct."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $protype =$myrow["gall_group_name"]; $list.=<<
$n
$text
$protype
EOF; } } } } } }$n++; } //$fck=$oFCKeditor->Create() ; $uppic.=<<
Gallery


Search Products Name : $gallerycombo

             Picture Name :


$list
Number
Command
Picture Name
Product Name



EOF; mysql_close(); //--------------------------- return $uppic; } //################################################### //################################################### //--------------------------- if($File_name!=""&&$pro_type!=""){ if (move_uploaded_file($_FILES["File"]["tmp_name"],$uploadfile)) { insergallery($File_name,$picturedetail,$pro_type); } } //################################################### //################################################### /* $error_msg = validate_form($File_tmpname,$File_size,$File_type); if ($error_msg) { $content.=<<
ADD TYPE COMPLETE

BACK TO PAGE



EOF; }else{ $content.=<< $max_size) { $content = "ขนาดไฟล์ใหญ่กว่า $Max_File_Size ไบต์"; } elseif (!check_type($File_type)) { $content = "ไฟล์ประเภทนี้ ไม่อนุญาตให้ Upload"; } else { $content = false; } return $content; } //################################################### //################################################### function Showsize($size) { if($size>1024){ // $File_extension = substr($File_type,(strrpos($File_type,".")+2)); //$File_extension = strrpos($File_type,".")+2); $filesize = round($size/1024,2) ." KB"; }else{ $filesize = round($size,2) ." Byte"; } return $filesize; } //################################################### //################################################### function DeleteFile($text){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; //--------------------------- $dir_pic="../pictures/gallery/".$text; $dir =$_SERVER['DOCUMENT_ROOT']."$mcf_root/pictures/gallery/"; if (file_exists($dir) ){ $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."gallery"; $sql="DELETE FROM ".$table." WHERE gallery_name = '".$text."' "; $result = mysql_query($sql,$connection1); chmod($dir_pic,777); unlink($dir_pic); } mysql_close(); } //################################################### //################################################### function Formviwegallery($Searchgallery,$page){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; global $temp_dir; global $mcf_temp; //--------------------------- //---------------------------MakeCombo $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); $value_gallery=array(); $table=$mcf_pfx."gallery_gorup"; $sql="SELECT * FROM ".$table." "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $code_pro =$myrow["code_gallery"]; $pro_groupname=$myrow["gall_group_name"]; $value_gallery[$code_pro]=$pro_groupname; } } $gallerycombo=MakeCombo('Search_gallery',$value_gallery,350,$Search_gallery); //--------------------------- $newline=2; $dir ="pictures/gallery/"; $DIR = opendir($dir); //--------------------------- $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $per_page=12; if(!$page) { $page =1; } $prev_page =$page-1; $next_page = $page+1; $p=$per_page*$page; $page_start =$p-$per_page; $table=$mcf_pfx."gallery"; $sql="SELECT * FROM ".$table." WHERE code_product = '".$Searchgallery."' "; $result = mysql_query($sql,$connection1); $num_rows = @mysql_num_rows($result); if($num_rows <= $per_page) $num_pages = 1; elseif(($num_rows%$per_page)==0) $num_pages = ($num_rows/$per_page); else $num_pages = ($num_rows/$per_page)+1; $num_pages = (int)$num_pages; $table=$mcf_pfx."gallery"; $sql="SELECT * FROM ".$table." WHERE code_product = '".$Searchgallery."' "; $sql .= " LIMIT $page_start,$per_page "; $result = mysql_query($sql,$connection1); while ($myrow = mysql_fetch_array($result)) { $codeproduct=$myrow["code_product"]; $viewgalleryname=$myrow["gallery_name"]; $pic_gallerydetail=$myrow["gallery_detial"]; if($codeproduct==$Searchgallery){ $dir_gallery="../pictures/gallery/". $viewgalleryname; $link_pic="../gallery.php?a=4&viewgalleryname=". $viewgalleryname; if($newline % 4==1){ $pic.=<< EOF; }else{ $pic.=<<

EOF; if($newline % 4==0){ $pic.=<< EOF; $newline=1; } }$newline++; } } $back.=<<< < back EOF; $next.=<<next > > EOF; for ( $counter=1; $counter<=$num_pages; $counter++ ) { if($counter!=$page){ $count.=<<$counter EOF; }else{ $count.=<<
$back$count$next

EOF; //--------------------------- $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."gallery_gorup "; $sql="SELECT * FROM ".$table." WHERE code_gallery = '".$Searchgallery."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $group_name=$myrow["gall_group_name"]; } } //--------------------------- $uppic.=<<
Search Gallery Name :$gallerycombo

Our Gallery  : $group_name

$pic
$back

$count

$next


EOF; mysql_close(); //--------------------------- return $uppic; } //################################################### //################################################### function picheadgallery($Searchpichead){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; global $temp_dir; global $mcf_temp; $temp_dir=$mcf_url."/"; //--------------------------- if( (int)$Searchpichead==11){ $tempdir=$mcf_url."/".$mcf_temp."/images/gallery.gif"; }elseif((int)$Searchpichead==12){ $tempdir=$mcf_url."/".$mcf_temp."/images/eku.jpg"; }elseif((int)$Searchpichead==13){ $tempdir=$mcf_url."/".$mcf_temp."/images/skylight.jpg"; }elseif((int)$Searchpichead==14){ $tempdir=$mcf_url."/".$mcf_temp."/images/Spaceframe stainless.jpg"; }elseif((int)$Searchpichead==15){ $tempdir=$mcf_url."/".$mcf_temp."/images/window and doors.jpg"; }elseif((int)$Searchpichead==16){ $tempdir=$mcf_url."/".$mcf_temp."/images/Curtainwall.jpg"; } //--------------------------- return $tempdir; } //################################################### //################################################### function headgallery($viewgalleryname){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; global $temp_dir; global $mcf_temp; $temp_dir=$mcf_url."/"; //--------------------------- $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."gallery "; $sql="SELECT * FROM ".$table." WHERE gallery_name = '".$viewgalleryname."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $codeproduct =$myrow["code_product"]; } } if( (int)$codeproduct==11){ $tempdir=$mcf_url."/".$mcf_temp."/images/gallery.gif"; }elseif((int)$codeproduct==12){ $tempdir=$mcf_url."/".$mcf_temp."/images/eku.jpg"; }elseif((int)$codeproduct==13){ $tempdir=$mcf_url."/".$mcf_temp."/images/skylight.jpg"; }elseif((int)$codeproduct==14){ $tempdir=$mcf_url."/".$mcf_temp."/images/Spaceframe stainless.jpg"; }elseif((int)$codeproduct==15){ $tempdir=$mcf_url."/".$mcf_temp."/images/window and doors.jpg"; }elseif((int)$codeproduct==16){ $tempdir=$mcf_url."/".$mcf_temp."/images/Curtainwall.jpg"; } //--------------------------- return $tempdir; } //################################################### //################################################### function Formviweprofile1($page){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; //---------------------------MakeCombo $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); $value_pro=array(); $table=$mcf_pfx."gallery_gorup"; $sql="SELECT * FROM ".$table." "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $code_pro =$myrow["code_gallery"]; $pro_groupname=$myrow["gall_group_name"]; $value_pro[$code_pro]=$pro_groupname; } } $gallerycombo=MakeCombo('Search_gallery',$value_pro,350,$Search_gallery); //--------------------------- $newline=0; //--------------------------- //--------------------------- $per_page=4; if(!$page) { $page =1; } $prev_page =$page-1; $next_page = $page+1; $p=$per_page*$page; $page_start =$p-$per_page; $table=$mcf_pfx."project_reference"; $sql="SELECT * FROM ".$table; $result = mysql_query($sql,$connection1); $num_rows = @mysql_num_rows($result); if($num_rows <= $per_page) $num_pages = 1; elseif(($num_rows%$per_page)==0) $num_pages = ($num_rows/$per_page); else $num_pages = ($num_rows/$per_page)+1; $num_pages = (int)$num_pages; //--------------------------- $back.=<<< < back EOF; $next.=<<next > > EOF; for ( $counter=1; $counter<=$num_pages; $counter++ ) { if($counter!=$page){ $count.=<<$counter EOF; }else{ $count.=<< 0){ while ($myrow = mysql_fetch_array($result)) { $textproduct =$myrow["project_pic_name"]; $projectdetail =$myrow["project_pic_detail"]; $dir_gallery="../pictures/project/".$textproduct; $link_pic="../gallery.php?a=5&textproduct=".$textproduct; $pic.=<<
$projectdetail >>Read More  

EOF; } } //$prodetail = substr($projectdetail,0,350)."........"; //
$content.=<<
$back $count $next
EOF; $uppic.=<<
Search Gallery Name :$gallerycombo
Our Project References
$pic
$back                                        $count                                        $next

EOF; mysql_close(); //--------------------------- return $uppic; } //################################################### //################################################### function Formviweprofile(){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; //--------------------------- $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); $value_pro=array(); $table=$mcf_pfx."gallery_gorup"; $sql="SELECT * FROM ".$table." "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $code_pro =$myrow["code_gallery"]; $pro_groupname=$myrow["gall_group_name"]; $value_pro[$code_pro]=$pro_groupname; } } $gallerycombo=MakeCombo('Search_gallery',$value_pro,350,$Search_gallery); //--------------------------- $uppic.=<< Search Gallery Name :$gallerycombo
EOF; //--------------------------- $content.=<< 0){ while ($myrow = mysql_fetch_array($result)) { $viwe_name =$myrow["gallery_name"]; $viwedetial =$myrow["gallery_detial"]; $codeproduct =$myrow["code_product"]; $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $dir_pic="../pictures/gallery/".$viwe_name; } } } } } $table=$mcf_pfx."gallery_gorup"; $sql="SELECT * FROM ".$table." WHERE code_gallery = '".$codeproduct."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $pro_groupname=$myrow["gall_group_name"]; } } $list.=<< EOF; $uppic.=<<Our Gallery : $pro_groupname
$list



EOF; mysql_close(); //--------------------------- return $uppic; } //################################################### //################################################### function viewpicpro($productview){ //--------------------------- global $mcf_pfx; global $mcf_root; global $mcf_url; global $mcf_ext; global $mcf_pictures_root; global $mcf_pictures_url; global $mcf_db_host; global $mcf_db_pass; global $mcf_db_user; global $mcf_db_db; //--------------------------- $link_back="../gallery.php"; $dir ="pictures/project/"; $DIR = opendir($dir); //--------------------------- while ($textproduct = readdir($DIR)) { if ($textproduct != "." && $textproduct!="..") { if (filetype($dir.$textproduct) != "dir" && $textproduct!= "Thumbs.db" ){ $connection1 = mysql_connect($mcf_db_host, $mcf_db_user, $mcf_db_pass); $db = mysql_select_db($mcf_db_db,$connection1); //--------------------------- $table=$mcf_pfx."project_reference"; $sql="SELECT * FROM ".$table." WHERE project_pic_name = '".$productview."' "; $result = mysql_query($sql,$connection1); if (@mysql_num_rows($result) > 0){ while ($myrow = mysql_fetch_array($result)) { $project_id =$myrow["project_id"]; $project_pic_name =$myrow["project_pic_name"]; $project_pic_detail =$myrow["project_pic_detail"]; //--------------------------- $dir_pic="../pictures/project/".$project_pic_name; } } } } } $list.=<<

  $project_pic_detail EOF; $uppic.=<<Our Project References
$list



EOF; mysql_close(); //--------------------------- return $uppic; } ?>