add webcam to customer create/update

This commit is contained in:
2015-12-30 12:02:26 +01:00
parent 135d64e4c8
commit eb989d5f80
16 changed files with 240 additions and 7 deletions

View 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>