/*USE FOR REMOTE SERVER */
$db_host = "hotprofolio71.ipowermysql.com";
$db_name = "profolios";
$db_username = "profolios";
$db_password = "profolios";
//////////////////////////////////PAYPALL DETAILS////////////////////////////////////////
$paypalurl="http://www.hotprofolio.com";
$paypalemail="pay@hotprofolio.com";
///////////////////////////////////////////////////////////////////////////////////
/*CREATING A CONNECTION OBJECT NAMED conn*/
$conn = mysql_connect($db_host,$db_username,$db_password) or die("Could not connect to Server" .mysql_error());
mysql_select_db($db_name) or die("Could not connect to Database" .mysql_error());
/*NECESSARY FUNCTIONS*/
function getSqlQuery($query)
{
$result = mysql_query($query) or die(mysql_error());
return $result;
}
function getSqlFetch($rs)
{
$res = mysql_fetch_assoc($rs);
return $res;
}
function getSqlRow($query) {
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
mysql_free_result($result);
return $row;
}
function getSqlNumber($sqlQuery) {
$query=@mysql_query($sqlQuery);
$result=@mysql_num_rows($query);
@mysql_free_result($query);
return $result;
}
function getSqlField($sqlQuery,$field) {
$isQuery = getSqlNumber($sqlQuery);
$query = @mysql_query($sqlQuery) or die (mysql_error()."
INVALID QUERY: ".$sqlQuery);
if ($isQuery>0) {
$result=@mysql_result($query,0,$field);
} else $result="n/a";
@mysql_free_result($query);
return $result;
}
function deleteFile($filepath,$filename) {
$success = FALSE;
if (file_exists($filepath.$filename)&&$filename!=""&&$filename!="n/a") {
unlink ($filepath.$filename);
$success = TRUE;
}
return $success;
}
function uploadFile($file,$destDir) {
$success = FALSE;
if (move_uploaded_file($file,$destDir))
{
$success = TRUE;
}
return $success;
}
function paginate($start,$limit,$total,$filePath,$otherParams) {
global $lang;
$allPages = ceil($total/$limit);
$currentPage = floor($start/$limit) + 1;
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9) ? 9 : $allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4) ? " ... " : " ";
$minPages = ($currentPage>4) ? $currentPage : 5;
$maxPages = ($currentPage<$allPages-4) ? $currentPage : $allPages - 4;
for($i=$minPages-4; $i<$maxPages+5; $i++) {
$pagination .= ($i == $currentPage) ? "[".$i."] " : "".$i." ";
}
$pagination .= ($currentPage<$allPages-4) ? " ... " : " ";
} else {
$pagination .= " ... ";
}
}
} else {
for($i=1; $i<$allPages+1; $i++) {
$pagination .= ($i==$currentPage) ? "[".$i."] " : "".$i." ";
}
}
if ($currentPage>1) $pagination = "[<<] [<] ".$pagination;
if ($currentPage<$allPages) $pagination .= "[>] [>>]";
echo $pagination;
}
function paginate1($start,$limit,$total,$filePath,$otherParams,$cat_name,$cat_id) {
global $lang;
$allPages = ceil($total/$limit);
$currentPage = floor($start/$limit) + 1;
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9) ? 9 : $allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4) ? " ... " : " ";
$minPages = ($currentPage>4) ? $currentPage : 5;
$maxPages = ($currentPage<$allPages-4) ? $currentPage : $allPages - 4;
for($i=$minPages-4; $i<$maxPages+5; $i++) {
$pagination .= ($i == $currentPage) ? "[".$i."] " : "".$i." ";
}
$pagination .= ($currentPage<$allPages-4) ? " ... " : " ";
} else {
$pagination .= " ... ";
}
}
} else {
for($i=1; $i<$allPages+1; $i++) {
$pagination .= ($i==$currentPage) ? "[".$i."] " : "".$i." ";
}
}
if ($currentPage>1) $pagination = "[<<] [<] ".$pagination;
if ($currentPage<$allPages) $pagination .= " [>] [>>]";
echo $pagination;
}
function paginate2($start,$limit,$total,$filePath,$otherParams) {
global $lang;
$allPages = ceil($total/$limit);
$currentPage = floor($start/$limit) + 1;
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9) ? 9 : $allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4) ? " ... " : " ";
$minPages = ($currentPage>4) ? $currentPage : 5;
$maxPages = ($currentPage<$allPages-4) ? $currentPage : $allPages - 4;
for($i=$minPages-4; $i<$maxPages+5; $i++) {
$pagination .= ($i == $currentPage) ? "[".$i."] " : "".$i." ";
}
$pagination .= ($currentPage<$allPages-4) ? " ... " : " ";
} else {
$pagination .= " ... ";
}
}
} else {
for($i=1; $i<$allPages+1; $i++) {
$pagination .= ($i==$currentPage) ? "[".$i."] " : "".$i." ";
}
}
echo $pagination;
}
function paginate3($start,$limit,$total,$filePath,$otherParams) {
global $lang;
$allPages = ceil($total/$limit);
$currentPage = floor($start/$limit) + 1;
$pagination = "";
if ($allPages>10) {
$maxPages = ($allPages>9) ? 9 : $allPages;
if ($allPages>9) {
if ($currentPage>=1&&$currentPage<=$allPages) {
$pagination .= ($currentPage>4) ? " ... " : " ";
$minPages = ($currentPage>4) ? $currentPage : 5;
$maxPages = ($currentPage<$allPages-4) ? $currentPage : $allPages - 4;
$pagination .= ($currentPage<$allPages-4) ? " ... " : " ";
}
}
}
if ($currentPage>1) $pagination = " ".$pagination;
if ($currentPage<$allPages) $pagination .= " ";
echo $pagination;
}
$settings=mysql_query("select * from pro_settings");
$rs_settings = getSqlFetch($settings);
extract($rs_settings);
?>