<?php
include_once(_DIR_TO_CLASS."/c_page.php");
include_once(_DIR_EXT.'/aspmo_personal/list_personal_table_img.php') ;
class c_page_cab_authorization extends c_page
{
    public $h1='Авторизация' ;
    var $no_view_in_setting_right=1 ;
    function check_access() { return 1 ; }

    function block_main()
    { global $aspmo_system,$rec ;
?>
        <script type="text/javascript" src="/class_v2.01/ext/aspmo_narko/visualize/js/jquery.js"></script>
        <script type="text/javascript" language="JavaScript" >
            var pluginObject;

            function addEvent(obj, name, func)
            {
                if (obj.attachEvent) {
                    obj.attachEvent(name, func);
                } else {
                    obj.addEventListener(name, func, false);
                }
            }

            $(document).ready(function(){
                pluginObject = document.getElementById( 'AuthorizationPlugin' );
                pluginObject.initializeScaner();
                addEvent(pluginObject, 'onScanDone', function(FIO,passportNumber){
                    alert(FIO+" "+passportNumber);
                });
            });
            function startScan()
            {
                pluginObject.startScan();
            }


        </script>
        <object id="AuthorizationPlugin" type="application/x-authorization" width="300" height="300">
            <param name="onload" value="pluginLoaded" />
        </object><br />
        <div id="main">
            <input type="button" id="startScan" value="Отсканировать" onclick="startScan()">
            <div id="info"> </div>
        </div>
        <?

    }
}
