add webcam to customer create/update
This commit is contained in:
29
frontend/views/customer/_camera.php
Normal file
29
frontend/views/customer/_camera.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use frontend\assets\CustomerAsset;
|
||||
use backend\models\CustomerCreate;
|
||||
CustomerAsset::register($this);
|
||||
$options = [];
|
||||
|
||||
|
||||
if ( $model instanceof frontend\models\CustomerCreate){
|
||||
$options['image_data' ] = 'customercreate-photo_data';
|
||||
}else{
|
||||
}
|
||||
$this->registerJs ( 'new Customer( '. json_encode($options).');' );
|
||||
?>
|
||||
|
||||
<style>
|
||||
.photo{
|
||||
border: 1px solid gray;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div id="my_camera" class='photo pull-left' style="width: 160px; height: 120px; margin-right: 12px;"></div>
|
||||
<div id="my_result" class='photo pull-left' style="width: 160px; height: 120px;"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<a id="snap" class="btn btn-primary">Fénykép</a>
|
||||
Reference in New Issue
Block a user