<?php $pageTitle='New report';
include realpath(__DIR__).'/../_common/header.php'; ?>
	<script type="text/javascript">
        Report.objectTypes=<?php
            $types=report::gettypes(1)['rows'];
            $out=[];
            foreach ($types as $type) {
                $out[$type['name']]=$type;
            }
            echo json_encode($out);
            ?>;
        Report.report={
            "selectFrom":"plate",
            "groupAndCountBy":"locationid",
//            "showColumns":["name","locationid"],
            "and":[
                {
                    "property":"projectid",
                    "condition":"in",
                    "value":"420691"
                },
                {
                    "property":"inspectionsremaining",
                    "condition":"gte",
                    "value":"1"
                },
                { "or":[
                        {
                            "property": "platetypeid",
                            "condition": "in",
                            "value": [19145,161409]
                        },
                        {
                            "property": "screenid",
                            "condition": "nin",
                            "value": "1891207"
                        },
                    ]
                },
                {
                    "property":"hasconstructs",
                    "condition":"eq",
                    "value":"0"
                },
            ]
        };
//        Report.report={};


        window.addEventListener('DOMContentLoaded',function(){

            Report.init();
        });

        //TODO "Filter by projects"

	</script>
<?php include realpath(__DIR__).'/../_common/footer.php';