<? 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>
			 <? if(isset($operation['vis_product_id'])){ ?>	<h4 class="modal-title"><? echo $vis_language['TXTADDVENDOR']; ?></h4>	 
	            <? } else { ?>   <h4 class="modal-title"><? echo $vis_language['TXTADDPRODUCT']; ?></h4><? } ?>
        </div>
        <div class="modal-body">
            <div class="row">
                <div class="col-sm-12">
                <form method="post" role="form" class="form-horizontal" name="vis_ciproduct_form" id="vis_ciproduct_form">
             <? if(isset($operation['vis_product_id'])){ ?>
                <div class="form-group">
                   <label class="col-sm-3 control-label"><? echo $vis_language['TXTVENDOR']; ?></label>
                   <div class="col-sm-9">
                   <select class="form-control selectpicker" name="vis_vendor_id" id="vis_vendor_id" <? if(count($civendor_details) > 10) echo 'data-live-search="true"' ?>>
				      <option value="0"><? echo$vis_language['TXTSELECTVENDOR']; ?></option>
                    <?php if($civendor_details!=-1){
							for($p=0;$p<count($civendor_details);$p++){ 
								$filter='p.vendor_id='.$civendor_details[$p]['vendor_id'].' and p.product_id='.$operation['vis_product_id'];
								$ret = $object->get_ciproduct_list($filter,$data='',VIS_STAFF_ID, VIS_LOCATION_AREA,$limit='');
									if($ret==-1)
                                	echo '<option value="'.$civendor_details[$p]['vendor_id'].'">'.$civendor_details[$p]['name'].'</option>';
								
                          }}?>
                      </select>
                   </div>
                </div>
                 <input type="hidden" name="vis_product_id" id="vis_product_id" value="<?php echo $operation['vis_product_id']; ?>" />
                 <input type="hidden" name="vis_operation_action" id="vis_operation_action" value="product" />
            <? }else{?>    
                <div class="form-group">
                   <label class="col-sm-3 control-label"><? echo $vis_language['TXTPRODUCT']; ?></label>
                   <div class="col-sm-9">
                   <select class="form-control selectpicker" name="vis_product_id" id="vis_product_id" <? if(count($ci_product_details) > 10) echo 'data-live-search="true"' ?>>
				      <option value="0"><? echo$vis_language['TXTSELECTPRODUCT']; ?></option>
                    <?php if($ci_product_details!=-1){
						  for($p=0;$p<count($ci_product_details);$p++){ 
					         	$filter='p.product_id='.$ci_product_details[$p]['product_id'].' and p.vendor_id='.$operation['vis_vendor_id']; 
								$ret = $object->get_ciproduct_list($filter,$data='',VIS_STAFF_ID, VIS_LOCATION_AREA,$limit='');
									if($ret==-1)
                                	echo '<option value="'.$ci_product_details[$p]['product_id'].'">'.$ci_product_details[$p]['name'].'</option>';
								
                          }}?>
                      </select>
                   </div>
                </div>
                 <input type="hidden" name="vis_vendor_id" id="vis_vendor_id" value="<?php echo $operation['vis_vendor_id']; ?>" />
                 <input type="hidden" name="vis_operation_action" id="vis_operation_action" value="vendor" />
           <? }?>     
                <div class="form-group" id="vis_show_amt_balance">
                    <label class="col-sm-3 control-label txt_nowrap"><?= $vis_language['TXTPRICE']; ?></label>
                    <div class="col-sm-9">
                        <input class="form-control input-sm" type="text" name="vis_price" id="vis_price" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label"><?= $vis_language['TXTQUANTITY']; ?></label>
                    <div class="col-sm-9">
                        <input class="form-control input-sm" type="text" name="vis_quantity" id="vis_quantity" />
                    </div>
                </div>
                 <div class="form-group">
                    <label class="col-sm-3 control-label"><?= $vis_language['TXTWARRANTYNVALIDITY']; ?></label>
                    <div class="col-sm-3">
                         <select class="form-control selectpicker"  name="vis_year" id="vis_year" >
                             <option value="0"><?=$vis_language['TXTYEAR']?></option>
                             <option value="0">0</option>
							 <option value="1">1</option>
                             <option value="2">2</option>
                             <option value="3">3</option>
                             <option value="4">4</option>
                             <option value="5">5</option>
                             <option value="6">6</option>
                             <option value="7">7</option>
                             <option value="8">8</option>
                             <option value="9">9</option>
                             <option value="10">10</option>
                         </select>
                    </div>
                    <div class="col-sm-3">
                       <select class="form-control selectpicker"  name="vis_month" id="vis_month" >
                             <option value="0"><?=$vis_language['TXTMONTH']?></option>
                             <option value="0">0</option>
							 <option value="1">1</option>
                             <option value="2">2</option>
                             <option value="3">3</option>
                             <option value="4">4</option>
                             <option value="5">5</option>
                             <option value="6">6</option>
                             <option value="7">7</option>
                             <option value="8">8</option>
                             <option value="9">9</option>
                             <option value="10">10</option>
                             <option value="11">11</option>
                         </select>
                    </div>
              	</div>
              </form>
                </div>
            </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="$(this).visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'create_ciproductvendor', 'vis_form':'vis_ciproduct_form'});"><? echo $vis_language['TXTADD']; ?></a>
        </div>
    </div>
</div>
<script type="text/javascript">
	$('.selectpicker').selectpicker();
</script>
<script>
/*$("#vis_type_in").change( function(){ $("#vis_show_ticket_balance").hide(); });
	$("#vis_type_ex").change( function(){ $("#vis_show_ticket_balance").show(); });
	$("#vis_type_in").change( function(){ $("#vis_show_amt_balance").show(); });
	$("#vis_type_ex").change( function(){ $("#vis_show_amt_balance").hide(); });*/
</script>
