Upazila/Thana Monthwise (NGO) Contraceptive Acceptors and Acceptance Rate (CAR%)
//Month name
$sql=mysql_query("select M_name from month where M_id='$m'");
$rowM=mysql_fetch_array($sql);
$M_Name=$rowM['M_name'];
$sql1=mysql_query("select M_name from month where M_id='$m1'");
$rowM1=mysql_fetch_array($sql1);
$M_Name1=$rowM1['M_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'];
?>
$result = mysql_query("select thana.Thana_Name,car_details.Month_Id,Sum(car_details.Total_EC) EC,
(Sum(car_details.Pill_Old)+Sum(car_details.Pill_New)) Pill,
(Sum(car_details.Con_Old)+Sum(car_details.Con_New)) Con,
(Sum(car_details.Inj_Old)+Sum(car_details.Inj_New)) Inj,
(Sum(car_details.IUD_Old)+Sum(car_details.IUD_New)) IUD,
(Sum(car_details.Imp_Old)+Sum(car_details.Imp_New)) Imp,
(Sum(car_details.PerM_Old)+Sum(car_details.PerM_New)) PerM,
(Sum(car_details.PerF_Old)+Sum(car_details.PerF_New)) PerF,
(Sum(car_details.PerM_Old)+Sum(car_details.PerM_New)+Sum(car_details.PerF_Old)+Sum(car_details.PerF_New)) TPer,
(Sum(car_details.Pill_Old)+Sum(car_details.Pill_New))+
(Sum(car_details.Con_Old)+Sum(car_details.Con_New))+
(Sum(car_details.Inj_Old)+Sum(car_details.Inj_New))+
(Sum(car_details.IUD_Old)+Sum(car_details.IUD_New))+
(Sum(car_details.Imp_Old)+Sum(car_details.Imp_New))+
(Sum(car_details.PerM_Old)+Sum(car_details.PerM_New)+Sum(car_details.PerF_Old)+Sum(car_details.PerF_New)) TUser,
(((Sum(car_details.Pill_Old)+Sum(car_details.Pill_New))+
(Sum(car_details.Con_Old)+Sum(car_details.Con_New))+
(Sum(car_details.Inj_Old)+Sum(car_details.Inj_New))+
(Sum(car_details.IUD_Old)+Sum(car_details.IUD_New))+
(Sum(car_details.Imp_Old)+Sum(car_details.Imp_New))+
(Sum(car_details.PerM_Old)+Sum(car_details.PerM_New)+Sum(car_details.PerF_Old)+Sum(car_details.PerF_New)))
/Sum(car_details.Total_EC))*100 CAR
from thana,car_details
Where (car_details.Thana_code=thana.Thana_code)
And (car_details.Month_Id Between '$Date' and '$Date1' )
AND car_details.Thana_code='$Thana_id' And NGO_Code<>'1'
Group By thana.Thana_Name ,car_details.Month_Id Order By car_details.Month_Id");
$num=mysql_num_rows($result);
?>