<? global $vis_language; ?>
<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title"><? echo $vis_language['TXTUPDATE'].' '.$vis_language['TXTSERVICEITEM']; ?></h4>
    </div>
    <div id="parent_list" class="modal-body">
    <div class="row">
		  <div class="col-md-12">
          <section id="test" class="scrollable wrapper">
          <div class="row m-b">
          <div class="col-md-12">
			<h3><?= $vis_language['TXTITILITEMREQUEST'];?></h3>
			<form role="form" name="vis_service_cost_form" id="vis_service_cost_form" method="post">
            <input type="hidden" name="vis_service_id" id="vis_service_id" value="<?= $operation['vis_service_id'];?>" />
               <input type="hidden" name="vis_ticket_id" id="vis_ticket_id" value="<?= $operation['vis_ticket_id'];?>" />
              <input type="hidden" name="vis_dept_id" id="vis_dept_id" value="<?= $operation['vis_dept_id'];?>" />
              <input type="hidden" name="vis_service_item_id" id="vis_service_item_id" value="<?= $operation['vis_service_item_id'];?>" />
              <div class="form-inline m-t">
            	<div class="form-group h5">
					<input name="vis_service_cost" id="vis_service_cost" class="input-sm input-s form-control m-r" onkeyup="change_cost(this.value);" size="6" min="0" type="text" value="<?php echo $operation['vis_service_cost'];?>"/>
				</div>
             
				<div class="form-group"><big class="m-l-sm m-r-sm">&times;</big></div>
				<div class="form-group">
					<input name="vis_service_quantity" id="vis_service_quantity" class="input-sm input-s form-control m-r" onkeyup="change_quantity(this.value);" size="4" min="0" maxlength="4" type="text" value="<?php echo $operation['vis_service_quantity'] ?>"/>
				</div>
                <div class="form-group m-l m-r font-bold badge">
					$ <span id="cost"><?= $operation['vis_service_cost'];?></span>
				</div>
              </div>  
              	<div class="b-t b-b b-2x line-lg">
					<div class="padder-v">
						<span class="h4"><?= $vis_language['TXTTOTAL']?></span>
						<span class="pull-right m-r-lg h3 font-bold">$ <span id="total_cost"><?= $operation['vis_service_cost'];?></span></span>					
					</div>
				</div>                 
          	
             <div class="form-horizontal">
              <div class="wrapper">
                 <?php echo $custom_field_var; ?>
              </div>
             </div>
             </form> 
             </div>
             </div>
             </section>
		  </div> <!-- /col-md-12 -->
		</div>
    
    </div>
    <div class="modal-footer">
		<a class="btn btn-default" data-dismiss="modal"><? echo $vis_language['TXTCANCEL']; ?></a>
		<a class="btn btn-primary" onclick="<? echo $message_info['vis_event']; ?>"><? echo $vis_language['TXTUPDATE']; ?></a>       
    </div>
  </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<script type="application/javascript">
 change_quantity(<?php echo $operation['vis_service_quantity'] ?>);
function change_quantity(quantity){
	var cost = $('#vis_service_cost').val();
	var total_cost = quantity*cost;
	//$('#vis_service_cost').val(total_cost);
	$('#total_cost').html(total_cost);
	$('#cost').html(total_cost);
}
function change_cost(cost){
	var quantity = $('#vis_service_quantity').val();
	var total_cost = quantity*cost;
	//$('#vis_service_cost').val(total_cost);
	$('#total_cost').html(total_cost);
	$('#cost').html(total_cost);
}
</script>