<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000030" 
	label="Activité. Intégrité de la base de données" 
	title="Intégrité de la base de données" 
	database="iCTI" 
	swf="*CTI_view1" 
	softCode="iCTI_activite">
	<CACHE cachable="false" />
	<VIEWPROPERTIES>
	</VIEWPROPERTIES>
	
	<QUERIES>
	
		<QUERY label=""> 
			
			<SQL>
				<select><![CDATA[
						SELECT 1, 'Séjours', 'Vue v_sejours_1', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM activite.p_sejours WHERE etat = '') subviewp,
							(SELECT count(*) AS count FROM activite.v_sejours_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 2, 'Mouvements', 'Vue v_mouvements_sejour_4', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM activite.p_mouvements_sejour) subviewp,
							(SELECT count(*) AS count FROM activite.v_mouvements_sejour_4) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
					SELECT 3, 'Factures', 'Vue v_factures_1', subviewp.count, subviewv.count
					FROM
						(SELECT count(*) AS count FROM activite.p_factures) subviewp,
						(SELECT count(*) AS count FROM activite.v_factures_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
					SELECT 4, 'Lignes factures C', 'Vue v_factures_lignes_c_1', subviewp.count, subviewv.count
					FROM
						(SELECT count(*) AS count FROM activite.p_factures_lignes_c) subviewp,
						(SELECT count(*) AS count FROM activite.v_factures_lignes_c_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
					SELECT 5, 'Lignes factures H', 'Vue v_factures_lignes_h_1', subviewp.count, subviewv.count
					FROM
						(SELECT count(*) AS count FROM activite.p_factures_lignes_h) subviewp,
						(SELECT count(*) AS count FROM activite.v_factures_lignes_h_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
					SELECT 4, 'Clients C', 'Vue v_facture_solde_tiers_c_1', subviewp.count, subviewv.count
					FROM
						(SELECT count(*) AS count FROM activite.p_facture_solde_tiers_c) subviewp,
						(SELECT count(*) AS count FROM activite.v_facture_solde_tiers_c_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
					SELECT 5, 'Clients H', 'Vue v_factures_soldes_h_1', subviewp.count, subviewv.count
					FROM
						(SELECT count(*) AS count FROM activite.p_factures_soldes_h) subviewp,
						(SELECT count(*) AS count FROM activite.v_factures_soldes_h_1) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>
			
			<SQL>
				<select><![CDATA[
						SELECT 6, 'Vue v_sejours_1', 'Vue v_sejours_test_join', subviewp.count, subviewv.count
						FROM
							(SELECT count(*) AS count FROM activite.v_sejours_1) subviewp,
							(SELECT count(*) AS count FROM activite.v_sejours_test_join) subviewv
				]]></select>
				<FIELDS>
					<FIELD name="NUM" />
					<FIELD name="TAB" />
					<FIELD name="VIEW" />
					<FIELD name="NB_P" />
					<FIELD name="NB_V" />
				</FIELDS>
			</SQL>

			
		</QUERY>
		
		
		
	</QUERIES>
	
	<PRESENTATION>
	
		
		<ONGLET>
				
			<DATAGRID title="" total="false" key="NUM" sortable="false" headerHeight="40" >
				<ROWSTYLE name="fontSize" value="12" />
				
				<COLUMN dataField="NUM"
					width="60"
					type="Number"
					outputFormat="#"
					visible="false"
					headerText="N°" 
					textAlign="left" >
				</COLUMN>
				<COLUMN dataField="TAB"
					minWidth="100"
					type="Char"
					visible="true"
					headerText="Table" 
					textAlign="left">
				</COLUMN>
				<COLUMN dataField="VIEW"
					minWidth="200"
					type="Char"
					visible="true"
					headerText="Vue" 
					textAlign="left">
				</COLUMN>
				
				
				<COLUMN dataField="NB_P"
					width="100"
					type="Number"
					visible="true"
					headerText="Taille table" 
					outputFormat="0"
					fixed="false"
					textAlign="right">
				</COLUMN>
				<COLUMN dataField="NB_V"
					width="100"
					type="Number"
					visible="true"
					headerText="Taille vue" 
					outputFormat="0"
					fixed="false"
					textAlign="right">
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0xFF0000" 
							condition="ROW.NB_V != ROW.NB_P" />
					<CELLSTYLE name="cellIndicator" value="circle, 5, left top, 0x00FF33" 
							condition="ROW.NB_V == ROW.NB_P" />
				</COLUMN>
				
				
				
			</DATAGRID>
		
		</ONGLET>
		
	</PRESENTATION>
	
</VUE>

			
