-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ]

, 14 2017 . 12:55 +
image

, %user%. , . , . , Windows Server 2012 R2, . , . . , .


, . . , , . . , , . . - . , , IP , . ( ):

U user, -
U- , ?
- . .
U-
-, .
U- comp-01 ( )
- ? ( )
U- HP LaserJet 600, %place%
( , ). , ip ?
U- .
. , ,
U- ? ? ? ?
, .
U- ? ? ?
- ?
U- %another_user%
-
U- , ( %another_user% )
-..( : , )
U-
- ,
U- comp-02,
- %another_user% , ( )
U- , ( )
- , ,
U- , . , .
- , . , , .
- ? , .
U ....( ) .
- , ,

, , . ? , , IP , - . - . , - . . .


Windows Server 2012 R2.



  • Printer Sever
  • scripts$,
  • XAMPP
  • apache mysql , , -

:

  • . . . : HP LaserJet 600 Printer #id %filial%, %filial% , #id . . . .
  • , - , ip . .


- PHP MVC , Notepad++, Google ( ). - , , javascript 217?, ?

, :

  • \
  • \
  • -
  • , ()

:

  • App
    1. Configs
    2. Controllers
    3. Locale
    4. Views

  • Uploads

index.php :



configs database.php:



phpmyadmin, printer utf8_general_ci. 3 branches, printers, users.

branches:
Id int(6) AUTO_INCREMENT, PRIMARY, UNIQUE
branch_name varchar(255)
image varchar(255)

printers:
Id int(6) AUTO_INCREMENT, PRIMARY, UNIQUE
Name varchar(255)
branchid int(6) : 1
description text
ipaddress varchar(255)
image varchar(255)
File1 varchar(255)
File2 varchar(255)
File3 varchar(255)

users:
Id int(6) AUTO_INCREMENT, PRIMARY, UNIQUE
Login varchar(128)
Token varchar(128)
password varchar(128)
lang varchar(10)
logindate varchar(255)

branchid ( id).

id 1, none image none. . , . Ÿ .

Database . , database.php configs .

Info , , . .

Controller.php. , GET POST __construct($get, $post) index.php. Info.php.

Views , . php Views. , , :

$views = new Views;
$views->addView('header', 'header.php');
$views->addView('menu', 'menu.php');
$views->addView('dashboard', 'dashboard.php');
$views->addView('footer', 'footer.php');

, ini $lang, . (dashboard.php):



views css, javascript. CSS Bootstrap.

Lang . cookie_lang. , . getLangArray() ini > . views.


. , . , . , . , , ( , IP ). bat , vbs , scripts$ . vbs, , . . Vbs bat . , :

Printer#id
  • Printer#id.bat
  • Printer#id.vbs

#id .

, bat . , uploads. , . . . VBS .

VBS script


Vbs :

printerName = "\\prnserver01\HP LaserJet 600 printer1 branch1"
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection printerName
WSHNetwork.SetDefaultPrinter printerName

, - , . , , . :

'  
printerName = "\\prnserver01\HP LaserJet 600 printer1"

'  Internet Explorer
Set objExplorer = CreateObject("InternetExplorer.Application")

'   - , ,   
objExplorer.Navigate "about:blank"  
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Left = 500
objExplorer.Top = 250
objExplorer.Width = 550
objExplorer.Height = 170 
objExplorer.Visible = 1

' 
objExplorer.Document.Title = "Ustanovka printera"

' html  ,    
objExplorer.Document.Body.InnerHTML = "
Ustanovka printera: 0%
" & printerName & "
" ' 500 , id progress . , 0 Wscript.Sleep 500 objExplorer.document.getElementById("progress").innerText = " Ustanovka printera: 10%" ' , . Set WshNetwork = CreateObject("WScript.Network") WshNetwork.AddWindowsPrinterConnection printerName WSHNetwork.SetDefaultPrinter printerName ' 200 , Wscript.Sleep 200 objExplorer.document.getElementById("progress").innerText = " Ustanovka printera: 20%" ' 200 Wscript.Sleep 200 objExplorer.document.getElementById("progress").innerText = " Ustanovka printera: 40%" ' , Wscript.Sleep 200 objExplorer.document.getElementById("progress").innerText = " Ustanovka printera: 60%" ' Wscript.Sleep 200 objExplorer.document.getElementById("progress").innerText = " Ustanovka printera: 80%" ' , ! Wscript.Sleep 100 objExplorer.document.getElementById("progress").innerText = " Printer ustanovlen!" ' 3 , Wscript.Sleep 3000 objExplorer.Quit


image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

github

.
!
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/333056/

:  

: [1] []
 

:
: 

: ( )

:

  URL