<?

//$HTTPADDRESS = "http://219.93.97.253/callcard/";


//$db_connect = mssql_connect("win06v3", "sa", "rewq") or Die("DB Connection Failed!");
//$db_connect = mssql_connect("localhost", "nokia", "server") or Die("DB Connection Failed!");
//$conn_buff  = mssql_select_db("CallCard");


$db_connect = mysql_connect("localhost", "creative_admin", "smartweb8881") or Die("DB Connection Failed!");
$conn_buff = mysql_select_db("creative_smartweb");



$month_set=array("January",
"February",

"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");



function hour_dropdown($F_hour) {

$hour_set=array("01:00",
"02:00",
"03:00",
"04:00",
"05:00",
"06:00",
"07:00",
"08:00",
"09:00",
"10:00",
"11:00",
"12:00",
"13:00",
"14:00",
"15:00",
"16:00",
"17:00",
"18:00",
"19:00",
"20:00",
"21:00",
"22:00",
"23:00",
"24:00");

$lc=1;
if ($F_hour=="") { $F_hour = 0; }
foreach ($hour_set as $hour_label) {
	if ($F_hour == $lc ) { $selected = " selected "; }
	echo "	<option value=$lc $selected>$hour_label</option>\n";
	$selected="";
	$lc++;
}
return $F_hour;
}




function hour_dropdown2($F_hour) {

$hour_set=array("01:00",
"02:00",
"03:00",
"04:00",
"05:00",
"06:00",
"07:00",
"08:00",
"09:00",
"10:00",
"11:00",
"12:00",
"13:00",
"14:00",
"15:00",
"16:00",
"17:00",
"18:00",
"19:00",
"20:00",
"21:00",
"22:00",
"23:00",
"24:00");

$hour2_set=array("01:00",
"02:00",
"03:00",
"04:00",
"05:00",
"06:00",
"07:00",
"08:00",
"09:00",
"10:00",
"11:00",
"12:00",
"13:00",
"14:00",
"15:00",
"16:00",
"17:00",
"18:00",
"19:00",
"20:00",
"21:00",
"22:00",
"23:00",
"00:00");

$lc=0;
if ($F_hour=="") { $F_hour = 0; }
foreach ($hour_set as $hour_label) {
	if ($F_hour == $hour2_set[$lc] ) { $selected = " selected "; }
	echo "	<option value='$hour2_set[$lc]' $selected>$hour_label</option>\n";
	$selected="";
	$lc++;
}
return $F_hour;
}




function month_dropdown($F_month) {

$month_set=array("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");

$lc=1;
if ($F_month=="") { $F_month = date("n"); }
foreach ($month_set as $month_label) {
	if ($F_month == $lc ) { $selected = " selected "; }
	echo "	<option value=$lc $selected>$month_label</option>\n";
	$selected="";
	$lc++;
}
return $F_month;
}


function day_dropdown($F_day) {
$lc=1;
if ($F_day=="") { $F_day = date("j"); }
for($day_label=1; $day_label<=31; $day_label++) {
	if ($F_day == $day_label) { $selected = " selected "; }
	echo "	<option value=$day_label $selected>$day_label</option>\n";
	$selected="";
}
return $F_day;
}


function year_dropdown($F_year) {

$year_set=array(2005,2004,2003,2002,2001);

if ($F_year=="") { $F_year=date("Y"); }
foreach ($year_set as $year_label) {
	if ($F_year == $lc ) { $selected = " selected "; }
	echo "	<option F_year=$year_label $selected>$year_label</option>\n";
	$selected="";
	$lc++;
}
return $F_year;
}


function TimeFormat($hour,$minutes,$seconds) { 
	if ($hour<10) { $hour="0$hour"; }
	if ($minutes<10) { $minutes="0$minutes"; }
	if ($seconds<10) { $seconds="0$seconds"; }
	return "$hour:$minutes:$seconds";
}

// get bank data
function getexact ($_contents,$code, $bnk){
if (strlen($_contents) > $bnk) {
           return substr($_contents, $code, $bnk);
  } else return $_contents;
}
// on web content saving 
function save_content ($f){

//$f = "page1.htm";
$sValue = stripslashes( $_POST['FCKeditor1'] ) ;
$fsave = fopen($f, 'w');  //save the edited file
 fwrite($fsave, $sValue);
 fclose($fsave); 
// header("Location: $f");
}

?>
