require ("conexionEstadisticas.php");
$sql[1]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 1
group by b.nomsujobl order by b.orden";
$sql[2]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 2
group by b.nomsujobl order by b.orden";
$sql[3]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 3
group by b.nomsujobl order by b.orden";
$sql[4]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 4
group by b.nomsujobl order by b.orden";
$sql[5]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 5
group by b.nomsujobl order by b.orden";
$sql[6]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 6
group by b.nomsujobl order by b.orden";
$sql[7]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 7
group by b.nomsujobl order by b.orden";
$sql[8]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 8
group by b.nomsujobl order by b.orden";
$sql[9]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 9
group by b.nomsujobl order by b.orden";
$sql[10]="select count(a.cveentsol) dato,
b.nomsujobl as nombre,
b.cvesujobl,
b.sglsujobl,
(select count(a1.cveentsol) from tblentrr a1, tblentsol c1 where a1.CveEntSol=c1.CveEntSol and c1.cvesujobl=b.cvesujobl and c1.TpoEntSol =1 and a1.FolEntRR like '%/2017') as ip,
(select count(a2.cveentsol) from tblentrr a2, tblentsol c2 where a2.CveEntSol=c2.CveEntSol and c2.cvesujobl=b.cvesujobl and c2.TpoEntSol =2 and a2.FolEntRR like '%/2017') as ad,
(select count(a3.cveentsol) from tblentrr a3, tblentsol c3 where a3.CveEntSol=c3.CveEntSol and c3.cvesujobl=b.cvesujobl and c3.TpoEntSol =3 and a3.FolEntRR like '%/2017') as rd,
(select count(a4.cveentsol) from tblentrr a4, tblentsol c4 where a4.CveEntSol=c4.CveEntSol and c4.cvesujobl=b.cvesujobl and c4.TpoEntSol =4 and a4.FolEntRR like '%/2017') as cd,
(select count(a5.cveentsol) from tblentrr a5, tblentsol c5 where a5.CveEntSol=c5.CveEntSol and c5.cvesujobl=b.cvesujobl and c5.TpoEntSol =5 and a5.FolEntRR like '%/2017') as od
from (select * from saim.tblentrr where FolEntRR like '%/2017') a right join saim.tblsujobl b on (a.cvesujobl = b.cvesujobl), saim.tblentcat c
where b.cveentcat = c.cveentcat and c.CveEntCat = 10
group by b.nomsujobl order by b.orden";
$titulo[1]="Poder Ejecutivo";
$titulo[2]="Órganos Autónomos";
$titulo[3]="Ayuntamientos";
$titulo[4]="Poder legislativo";
$titulo[5]="Poder Judicial";
$titulo[7]="Partidos Políticos";
$titulo[8]="Sindicatos";
$titulo[9]="Fideicomisos";
$titulo[10]="Personas Jurídicas Colectivas";
$id=$_GET["id"];
?>
Calle de Pino Suárez sin número, actualmente Carretera Toluca-Ixtapan # 111, Colonia La Michoacana; Metepec Estado de México, C.P. 52166
Calle de Nezahualcoyotl S/N Col. Izcalli IPIEM, Toluca, Estado de México. C. P. 50150
Tel: 01 (722) 226 1980