prepare("SELECT $select FROM $from WHERE $select = ?"); $statment->execute(array($value)); $count = $statment->rowcount(); return $count; } function getcss(){ global $inccss; if (isset($inccss)) { echo $inccss; } else{ echo 'mai.css'; } } function getprojhead() { global $conn; $getc = $conn->prepare("SELECT * FROM projects WHERE showinhead ='1' ORDER BY pid DESC LIMIT 6 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getenproj() { global $conn; $getc = $conn->prepare("SELECT tittle,compname,description,country,donedate,type,showinmain,code,img1,img2,img3 FROM projects ORDER BY pid DESC "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getenprojlimit() { global $conn; $getc = $conn->prepare("SELECT tittle,compname,description,country,donedate,type,showinmain,code,img1,img2,img3 FROM projects WHERE showinmain ='1' ORDER BY pid DESC LIMIT 8 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getarproj() { global $conn; $getc = $conn->prepare("SELECT ar_tittle,ar_compname,ar_description,ar_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects ORDER BY pid DESC "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getarprojlimit() { global $conn; $getc = $conn->prepare("SELECT ar_tittle,ar_compname,ar_description,ar_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects WHERE showinmain ='1' ORDER BY pid DESC LIMIT 8 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function gettuproj() { global $conn; $getc = $conn->prepare("SELECT tu_tittle,tu_compname,tu_description,tu_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects ORDER BY pid DESC "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function gettuprojlimit() { global $conn; $getc = $conn->prepare("SELECT tu_tittle,tu_compname,tu_description,tu_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects WHERE showinmain ='1' ORDER BY pid DESC LIMIT 8 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getduproj() { global $conn; $getc = $conn->prepare("SELECT du_tittle,du_compname,du_description,du_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects ORDER BY pid DESC "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getduprojlimit() { global $conn; $getc = $conn->prepare("SELECT du_tittle,du_compname,du_description,du_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects WHERE showinmain ='1' ORDER BY pid DESC LIMIT 8 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getruproj() { global $conn; $getc = $conn->prepare("SELECT ru_tittle,ru_compname,ru_description,ru_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects ORDER BY pid DESC "); $getc->execute(); $info = $getc->fetchAll(); return $info; } function getruprojlimit() { global $conn; $getc = $conn->prepare("SELECT ru_tittle,ru_compname,ru_description,ru_country,donedate,type,showinmain,code,img1,img2,img3 FROM projects WHERE showinmain ='1' ORDER BY pid DESC LIMIT 8 "); $getc->execute(); $info = $getc->fetchAll(); return $info; } /*count element*/ function allrow($select, $from, $where, $whereres){ global $conn; $statment = $conn->prepare("SELECT $select FROM $from WHERE $where = $whereres"); $statment->execute(array()); $count = $statment->rowcount(); return $count; } function allrow2($select, $from){ global $conn; $statment = $conn->prepare("SELECT $select FROM $from "); $statment->execute(array()); $count = $statment->rowcount(); return $count; } // get city For Calculate Building Costs function citycalclist() { global $conn; $get = $conn->prepare("SELECT * FROM citycostscalc ORDER BY citcalc_ordernum "); $get->execute(); $info = $get->fetchAll(); return $info; } // get city For Calculate Building Costs function actcitycalclist() { global $conn; $get = $conn->prepare("SELECT * FROM citycostscalc WHERE citcalc_active = 1 ORDER BY citcalc_ordernum "); $get->execute(); $info = $get->fetchAll(); return $info; }