$periodos=array();
for($i=1970;$i<=2010;$i++){
array_push($periodos,$i);
}
$total_auc=0;
$total_del=0;
$total_eln=0;
$total_farc=0;
$total_m19=0;
$total_total=0;
$resultado=array();
foreach($periodos as $value){
$datos=array();
$sel_auc=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor='Paramilitares' group by anio");
$sel_del=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor ='Redes Criminales' group by anio");
$sel_eln=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor='ELN' group by anio");
$sel_farc=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor='FARC' group by anio");
$sel_m19=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor='M-19' group by anio");
$sel_otros=mysql_query("SELECT COUNT( id ) AS num_sec,anio
FROM secuestrados
WHERE anio = '".$value."'
and autor='Otros' group by anio");
$row_auc=mysql_fetch_array($sel_auc);
$row_del=mysql_fetch_array($sel_del);
$row_eln=mysql_fetch_array($sel_eln);
$row_farc=mysql_fetch_array($sel_farc);
$row_m19=mysql_fetch_array($sel_m19);
$row_otros=mysql_fetch_array($sel_otros);
$datos["anio"]=$value;
$datos["del"]=($row_del["num_sec"]==''?"0":$row_del["num_sec"]);
$datos["eln"]=($row_eln["num_sec"]==''?"0":$row_eln["num_sec"]);
$datos["farc"]=($row_farc["num_sec"]==''?"0":$row_farc["num_sec"]);
$datos["m19"]=($row_m19["num_sec"]==''?"0":$row_m19["num_sec"]);
$datos["auc"]=($row_auc["num_sec"]==''?"0":$row_auc["num_sec"]);
$datos["otros"]=($row_otros["num_sec"]==''?"0":$row_otros["num_sec"]);
//$datos["total"]=$row_auc["num_sec"]+$row_del["num_sec"]+$row_eln["num_sec"]+$row_farc["num_sec"]+$row_m19["num_sec"]+$row_otros["num_sec"];
$total=$row_auc["num_sec"]+$row_del["num_sec"]+$row_eln["num_sec"]+$row_farc["num_sec"]+$row_m19["num_sec"]+$row_otros["num_sec"];
$total_auc+=$row_auc["num_sec"];
$total_del+=$row_del["num_sec"];
$total_eln+=$row_eln["num_sec"];
$total_farc+=$row_farc["num_sec"];
$total_m19+=$row_m19["num_sec"];
$total_otros+=$row_otros["num_sec"];
$total_total+=$total;
array_push($resultado,$datos);
}
// print_r($resultado);
?>
AÑO DE SECUESTRO
Redes Criminales
ELN
FARC
M-19
Paramilitares
Otros
foreach($resultado as $fechas=>$dateo){
?>
foreach($dateo as $key=>$valor){
// echo $key;
if($key=='anio'){
?>