Upazila/Thana Monthwise
Contraceptive Acceptors and Acceptance Rate (CAR%)
$Div_Code = @$_POST["Div_Code"];?>
Select Division
$result=mysql_query("select div_code,div_name from division "); while($Row=mysql_fetch_array($result)){ if($Div_Code==$Row[div_code]){ echo"
$Row[div_name]
";} else{ echo"
$Row[div_name]
";} } ?>
$Dist_Id = @$_POST["Dist_Id"];?>
Select District
$result1=mysql_query("select dist_code,dist_name from district where Div_code=$Div_Code"); while($Row1=mysql_fetch_array($result1)){ if($Dist_Id==$Row1[dist_code]){ echo"
$Row1[dist_name]
";} else{ echo"
$Row1[dist_name]
";} } ?>
$Thana_id = @$_POST["Thana_id"];?>
Select Thana
$result2=mysql_query("select Thana_code,Thana_name from thana where Dist_code=$Dist_Id "); while($Row2=mysql_fetch_array($result2)){ if($Thana_id==$Row2[Thana_code]){ echo"
$Row2[Thana_name]
";} else{ echo"
$Row2[Thana_name]
";} } ?>
$union_code = $_POST["union_code"];?>
Required>
Select Union
$result3=mysql_query("Select Union_code,Union_name from unio where Thana_code='$Thana_id' order by Union_code "); while($Row3=mysql_fetch_array($result3)){ if($union_code==$Row3[Union_code]){ echo"
$Row3[Union_name]
";} else{ echo"
$Row3[Union_name]
";} } ?>
Select Month
January
February
March
April
May
June
July
August
September
October
November
December
Select Year
2016
2017
2018
To:
Select Month
January
February
March
April
May
June
July
August
September
October
November
December
Select Year
2016
2017
2018
$m=$_POST['H_Mon']; $y=$_POST['H_Year']; $Date="$y-$m-28"; $m1=$_POST['H_Mon1']; $y1=$_POST['H_Year1']; $Date1="$y1-$m1-28"; //Month name From $sql=mysql_query("select M_name from month where M_id='$m'"); $rowM=mysql_fetch_array($sql); $M_Name=$rowM['M_name']; //Month name To $sql1=mysql_query("select M_name from month where M_id='$m1'"); $rowM1=mysql_fetch_array($sql1); $M_Name1=$rowM1['M_name']; //Union name $Union_Name = mysql_query("select Union_Name from unio where union_Code='$union_code'"); $rowU=mysql_fetch_array($Union_Name); $U_Name=$rowU['Union_Name']; //Thana name $Thana_Name = mysql_query("select thana.Thana_Name from thana where Thana_Code='$Thana_id'"); $rowT=mysql_fetch_array($Thana_Name); $T_Name=$rowT['Thana_Name']; //District name $Dist_Name = mysql_query("select district.Dist_Name from district where Dist_Code='$Dist_Id' "); $rowD=mysql_fetch_array($Dist_Name); $D_Name=$rowD['Dist_Name']; ?>
$result = mysql_query("select unio.union_code,car_go.Month_Id,Sum(car_go.Total_EC) EC, (Sum(car_go.Pill_Old)+Sum(car_go.Pill_New)) Pill, (Sum(car_go.Con_Old)+Sum(car_go.Con_New)) Con, (Sum(car_go.Inj_Old)+Sum(car_go.Inj_New)) Inj, (Sum(car_go.IUD_Old)+Sum(car_go.IUD_New)) IUD, (Sum(car_go.Imp_Old)+Sum(car_go.Imp_New)) Imp, (Sum(car_go.PerM_Old)+Sum(car_go.PerM_New)) PerM, (Sum(car_go.PerF_Old)+Sum(car_go.PerF_New)) PerF, (Sum(car_go.PerM_Old)+Sum(car_go.PerM_New)+Sum(car_go.PerF_Old)+Sum(car_go.PerF_New)) TPer, (Sum(car_go.Pill_Old)+Sum(car_go.Pill_New))+ (Sum(car_go.Con_Old)+Sum(car_go.Con_New))+ (Sum(car_go.Inj_Old)+Sum(car_go.Inj_New))+ (Sum(car_go.IUD_Old)+Sum(car_go.IUD_New))+ (Sum(car_go.Imp_Old)+Sum(car_go.Imp_New))+ (Sum(car_go.PerM_Old)+Sum(car_go.PerM_New)+Sum(car_go.PerF_Old)+Sum(car_go.PerF_New)) TUser, (((Sum(car_go.Pill_Old)+Sum(car_go.Pill_New))+ (Sum(car_go.Con_Old)+Sum(car_go.Con_New))+ (Sum(car_go.Inj_Old)+Sum(car_go.Inj_New))+ (Sum(car_go.IUD_Old)+Sum(car_go.IUD_New))+ (Sum(car_go.Imp_Old)+Sum(car_go.Imp_New))+ (Sum(car_go.PerM_Old)+Sum(car_go.PerM_New)+Sum(car_go.PerF_Old)+Sum(car_go.PerF_New))) /Sum(car_go.Total_EC))*100 CAR from unio,car_go Where (car_go.union_code=unio.union_code) And (car_go.Month_Id Between '$Date' and '$Date1' ) AND car_go.union_code='$union_code' Group By unio.union_code ,car_go.Month_Id Order By car_go.Month_Id"); $num=mysql_num_rows($result); ?>
Contraceptive Acceptors and Acceptance Rate (CAR%) by Month at Upazila Level
Union: Upazila: District: Reporting Period: , From ,
Reporting Month
Eligible Couple
Oral Pill
Condom
Injectable
I U D
Implant
NSV
Tubectomy
Total Acceptors
CAR(%)
$i=0; while ($i<$num){ //$Thana_name=mysql_result($result,$i,"Thana.Thana_Name"); $Month_Id=mysql_result($result,$i,"car_go.Month_Id"); $Toatal_Ec=mysql_result($result,$i,"EC"); $Pill=mysql_result($result,$i,"Pill"); $Con=mysql_result($result,$i,"Con"); $Inj=mysql_result($result,$i,"Inj"); $IUD=mysql_result($result,$i,"IUD"); $Imp=mysql_result($result,$i,"Imp"); $PerM=mysql_result($result,$i,"PerM"); $PerF=mysql_result($result,$i,"PerF"); $TPer=mysql_result($result,$i,"TPer"); $TUser=mysql_result($result,$i,"TUser"); $CA=mysql_result($result,$i,"CAR"); $CAR=number_format($CA,2); $MonthId=date("F,Y",mktime(0,0,0,substr($Month_Id,5,2),28,substr($Month_Id,0,4))); $style = "sr"; if ($i % 2 != 0) { $style = "dr"; } ?>
echo $MonthId;?>
echo $Toatal_Ec;?>
echo $Pill;?>
echo $Con;?>
echo $Inj;?>
echo $IUD;?>
echo $Imp;?>
echo $PerM;?>
echo $PerF;?>
echo $TUser;?>
echo $CAR;?>
++$i; } ?>