<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	$sidenav_file=APPPATH.'views/include/sidenav.php';
	require($sidenav_file);	?>

    <!-- BEGIN: Content-->
    <div class="app-content content">
      <div class="content-overlay"></div>
      <div class="content-wrapper">
        <div class="content-header row">
          <div class="content-header-left col-md-12 col-12 mb-2 breadcrumb-new">
            <h3 class="content-header-title mb-0 d-inline-block">Supplier </h3>
            <div class="row breadcrumbs-top d-inline-block">
              <div class="breadcrumb-wrapper col-12">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item"><a href="#">Home</a>
                  </li>
                  <li class="breadcrumb-item"><a href="#">Supplier</a>
                  </li>
                  <li class="breadcrumb-item active">Supplier Creation
                  </li>
                </ol>
              </div>
            </div>
          </div>
          
        </div>
        <div class="content-body"><!-- Basic form layout section start -->
<section id="basic-form-layouts">
	<div class="row justify-content-md-center">
		<div class="col-md-12">
			<div class="card">
				<div class="card-header">
					<h4 class="card-title" id="basic-layout-form-center">Supplier Creation</h4>
					<a class="heading-elements-toggle"><i class="la la-ellipsis-v font-medium-3"></i></a>
					<div class="heading-elements">
						<ul class="list-inline mb-0">
							<li><a data-action="collapse"><i class="ft-minus"></i></a></li>
							<li><a data-action="reload"><i class="ft-rotate-cw"></i></a></li>
							<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
							<li><a data-action="close"><i class="ft-x"></i></a></li>
						</ul>
					</div>
				</div>
				<div class="card-content collapse show">
					<div class="card-body">
						<form class="form" enctype="multipart/form-data" autocomplete="off" action="<?php echo site_url('Master/addSupplier');?>" method="post">
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Vendor Name</label>
											<input type="text" class="form-control" id="sname" name="sname" value="" required placeholder="Vendor Name">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Address</label>
											<input type="text" class="form-control" id="address" name="address" value="" placeholder="Address">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">City</label>
											<input type="text" class="form-control" id="city" name="city" value="" placeholder="City">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Postal Code</label>
											<input type="text" class="form-control" id="postal_code" name="postal_code" value="" placeholder="Postal Code">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">State</label>
											<input type="text" class="form-control" id="state" name="state" value="" placeholder="State">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Country</label>
											<input type="text" class="form-control" id="country" name="country" value="" placeholder="Country">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Area Code Phone</label>
											<input type="text" class="form-control" id="area_code_phone" name="area_code_phone" value="" placeholder="Area Code Phone">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Phone Landline</label>
											<input type="text" class="form-control" id="landline" name="landline" value="" placeholder="Phone Landline">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Email ID</label>
											<input type="text" class="form-control" id="email_id" name="email_id" value="" placeholder="Email ID">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Contact Person</label>
											<input type="text" class="form-control" id="contact_person" name="contact_person" value="" placeholder="Contact Person">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Designation</label>
											<input type="text" class="form-control" id="designation" name="designation" value="" placeholder="Designation">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Department</label>
											<input type="text" class="form-control" id="dept" name="dept" value="" placeholder="Department">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Contact Mobile</label>
											<input type="text" class="form-control" id="contact_no" name="contact_no" value="" placeholder="Contact Mobile">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Fax No</label>
											<input type="text" class="form-control" id="fax_no" name="fax_no" value="" placeholder="Fax No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Bank Name</label>
											<input type="text" class="form-control" id="bank_name" name="bank_name" value="" placeholder="Bank Name">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Beneficiary Name for Payment</label>
											<input type="text" class="form-control" id="benificiary_name" name="benificiary_name" value="" placeholder="Beneficiary Name for Payment">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Branch Address</label>
											<input type="text" class="form-control" id="branch_addr" name="branch_addr" value="" placeholder="Branch Address">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Bank Account No</label>
											<input type="text" class="form-control" id="bank_acc_no" name="bank_acc_no" value="" placeholder="Bank Account No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">IFSC Code</label>
											<input type="text" class="form-control" id="ifsc_code" name="ifsc_code" value="" placeholder="IFSC Code">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">PAN No</label>
											<input type="text" class="form-control" id="pan_no" name="pan_no" value="" placeholder="PAN No">
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">GSTIN No</label>
											<input type="text" class="form-control" id="gstin_no" name="gstin_no" value="" placeholder="GSTIN No">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">MOP</label>
											<select name="mop" id="mop" class="form-control select2" >
												<option value="">Select MOP</option>
												<option value="Cash">Cash</option>
												<option value="Bank">Bank</option>
											</select>
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Payment terms From Invoice date</label>
											<input type="text" class="form-control" id="crt_period" name="crt_period" value="" placeholder="Payment terms">
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											
										</div>
									</div>
								</div>
							</div>
							<div class="row justify-content-md-center">
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Registered Under MSME</label>
											<input type="radio" name="rgst_msme" id="ryes" value="Yes" style="margin-left:15px;" />Yes
											<input type="radio" name="rgst_msme" id="rno" value="No" checked />No 
										</div>
									</div>
								</div>
								<div class="col-md-3" id="mrgst_no" style="display:none;">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">MSME Registration No</label>
											<input type="text" class="form-control" id="msme_rgst_no" name="msme_rgst_no" value="" placeholder="MSME Registration No">
										</div>
									</div>
								</div>
							<!--	<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Branch</label>
											<select name="branch[]" id="branch" class="form-control select2" required multiple="multiple" >
												
												<?php /* foreach($branch as $row)
													{
														echo '<option value="'.$row->branch_id.'">'.$row->branch_name.'</option>';
													} */
												?>
											</select>
											<input type="hidden" id="branch_name" name="branch_name"  >
										</div>
									</div>
								</div>-->
								<?php 
        							foreach($branch as $row) { ?>
        								<input class="form-control" type="text" name="branch[]"  id="branch" value="<?php echo $row->branch_id ?>" readonly >
        								<input class="form-control" type="text" name="branch_name[]" id="branch_name" value="<?php echo $row->branch_name ?>" readonly >
    							<?php 
    							}
    							?>
								<div class="col-md-2">
									<div class="form-body">
										<div class="form-group">
										    <?php
        									    $user = 'CEO';
                								$q1 = $this->db->query("SELECT * FROM user where username='$user'");
                								foreach($q1->result_array() as $r1) 
                								$phone_no = $r1['ph_no'];
        									?>
        									<input type="hidden" name="ph_no" id="ph_no" value="<?php echo $phone_no ?>" >	
										</div>
									</div>
								</div>
							</div>
							<div class="form-actions text-center">
								<button type="reset" class="btn btn-warning mr-1">
									<i class="ft-x"></i> Cancel
								</button>
								<button type="submit" class="btn btn-primary" onClick="return vendor_creation();" >
									<i class="la la-check-square-o"></i> Save
								</button>
							</div>
						</form>	
					</div>
				</div>
			</div>
		</div>
	</div>

</section>
<!-- // Basic form layout section end -->
        </div>
      </div>
    </div>
    <?php //require('include/theme_customizer.php');?>

   <?php 
  $footer_file=APPPATH.'views/include/footer.php';
	require($footer_file);
	?>
	<script type="text/javascript">
		$(function () {
			$('#branch').multiselect({
				includeSelectAllOption: true
			});
		});
	</script>
	<script>
		$("#branch").change(function(){
			   //var branch = $('#branch option:selected').text();
			var branch = $("#branch option:selected").map(function () {
			return $(this).text();
			}).get().join(',');
			//alert(branch);
			$('#branch_name').val(branch);
		});
	</script>
	<script>
	    $("input[name='rgst_msme']").click(function() {
			if($('#ryes').is(':checked'))
			{
				$('#mrgst_no').show();
			}
			else
			{
				$('#mrgst_no').hide();
			}
		});
	</script>

  </body>
  <!-- END: Body-->

<!-- Mirrored from pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-modern-menu-template/form-layout-basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Apr 2020 09:38:02 GMT -->
</html>