<?php

include('../conf.php');

?>
<style type="text/css">
.align-center{
	text-align: center;
	float: center;
	margin: -4px;
	margin-top: 6.5%;

}

.fileform { 
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 2px;
    cursor: pointer;
    height: 30px;
    overflow: hidden;
    padding: 2px;
    position: relative;
    text-align: left;
    vertical-align: middle;
    width: 330px;
}
 
.fileform .selectbutton { 
    background-color: #408DD2;
    border: 1px solid #FFFFFF;
    border-radius: 4px;
    color: #FFFFFF;
    float: right;
    font-size: 11px;
    height: 23px;
    line-height: 15px;
    overflow: hidden;
    padding: 2px 6px;
    text-align: center;
    vertical-align: middle;
    width: 55px;
}
 
.fileform #upload{
    position:absolute; 
    top:0; 
    left:0; 
    width:100%; 
    -moz-opacity: 0; 
    filter: alpha(opacity=0); 
    opacity: 0; 
    font-size: 150px; 
    height: 30px; 
    z-index:20;
}

.fileform #fileformlabel { 
	background-color: #FFFFFF;
	float: left;
	height: 22px;
	line-height: 22px;
	overflow: hidden;
	padding: 2px;
	text-align: left;
	vertical-align: middle;
	width:260px;
}
</style>
						<div class="col-lg-4">
							<div id="form" class="bs-component">
								<div class="panel panel-default">
									<div class="panel-body">

										<form enctype="multipart/form-data" action="" method="POST">
										<label class="control-label" for="inputSmall"><?=$GLOBALS['lang']['tri17'];?></label>

										<div style="margin:2px;" class="form-group">
											<div class="fileform">
												<div id="fileformlabel"></div>
												<div class="selectbutton"><?=$GLOBALS['lang']['f37'];?></div>
												<input type="file" name="file" id="upload" onchange="getName(this.value);" />
											</div>
										</div>
											
										<div class="col-lg-10 col-lg-offset-2 align-center">
											<button type="reset" onclick="$('#fileformlabel').text('');" class="btn btn-default"><?=$GLOBALS['lang']['tri1'];?></button>
											<button type="submit" class="btn btn-primary"><?=$GLOBALS['lang']['tri2'];?></button>
										</div>
										</form>

									</div>
								</div>
							</div>
						</div>

<script type="text/javascript">

function getName (str){
    if (str.lastIndexOf('\\')){
        var i = str.lastIndexOf('\\')+1;
    }else{
        var i = str.lastIndexOf('/')+1;
    }						
    var filename = str.slice(i);

    $('#fileformlabel').text(filename);
}

</script>