<?php 
	$header_file=APPPATH.'views/include/header.php';
	require($header_file);
	//$sidenav_file=APPPATH.'views/include/sidenav.php';
	//require($sidenav_file);	?>
<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"><?php echo $sub_ModuleName;?></h3>
                <div class="row breadcrumbs-top d-inline-block float-right">
                    <div class="breadcrumb-wrapper col-12">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo site_url('User/dashboard');?>">Home</a></li>
                            <li class="breadcrumb-item"><a href="#"><?php echo $moduleName;?></a></li>
                            <li class="breadcrumb-item active"><?php echo $sub_ModuleName;?></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-content collapse show">
					<div class="card-body">

						<form class="form" autocomplete="off" action="<?php echo site_url('Eshanya/recipeCategoryInsert');?>" method="post">
							<div class="row">
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Category Name</label>
											<input type="text" class="form-control" id="cat_name" name="cat_name" value="" required placeholder="Category Name">
											<input type="hidden" class="form-control" id="sub_mod_id" name="sub_mod_id" value="<?php echo $submod_id; ?>" >
										</div>
									</div>
								</div>
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Effective From</label>
											<input type="text" class="form-control pickadate datepicker" id="effective" name="effective" value="" required placeholder="Effective From">
											
										</div>
									</div>
								</div>
								<div class="col-md-3">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Combination</label>
											<select name="combination[]" id="combination" class="form-control select2" multiple="multiple" >
											<option value="">Select</option>	
												<?php  foreach($combination as $row)
													{
														echo '<option value="'.$row->comb_id.'">'.$row->combination.'</option>';
													} 
												?>
											</select>
										</div>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group">
											<label for="eventInput1">Qty Limit</label>
											<input type="text" class="form-control" id="qty_limit" name="qty_limit" value="" placeholder="Qty Limit">
										</div>
									</div>
								</div>
								<!--<div class="col-md-4">
									<div class="form-body">
										<div class="form-group" style="margin-top:35px;">
											<label for="eventInput1">Applicable for Sales</label>
											
									<input type="radio" class="icheck_minimal" name="applicable" id="yes" value="Yes" required />Yes
								
									<input type="radio" name="applicable" id="no" value="No" checked />No 
								
											
										</div>
									</div>
								</div>
								<div class="col-md-4">
									<div class="form-body">
										<div class="form-group" style="margin-top:35px;">
											<label for="eventInput1">Allowed for Food Delivery</label>
											
									    <input type="radio" class="icheck_minimal" name="fdelivery" id="tyes" value="1" required />Yes
								
									    <input type="radio" name="fdelivery" id="tno" value="0" checked />No 
									</div>
									</div>
								</div>
								<?php //foreach($counter as $ctr) { ?>
									<input type="hidden" class="form-control cbranch" id="cbranch" name="cbranch[]" value="<?php echo $ctr->branch_name; ?>" >
									<input type="hidden" class="form-control cbranch_id" id="cbranch_id" name="cbranch_id[]" value="<?php echo $ctr->branch_id; ?>" >
									<input type="hidden" class="form-control cbranch_code" id="cbranch_code" name="cbranch_code[]" value="<?php echo $ctr->branch_code; ?>" >
								<?php //} ?>-->
							</div>

							<div class=" text-right">
								<button type="reset" class="btn btn-sm btn-warning mr-1">
									<i class="ft-x"></i> Reset
								</button>
								<button type="submit" class="btn btn-primary btn-sm">
									<i class="la la-check-square-o"></i> Save
								</button>
							</div>
						</form>	
						<br/>
						<div class="table-responsive">
                            <table class="table table-striped table-bordered zero-configuration">
                                <thead>
                                    <tr>
                                        <th>Sl No</th>
                                        <th>Category</th>
										<th>Status</th>
										<th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
								 <?php
									$count =1;
									foreach($productCategory as $record)
								{
								?>
                                    <tr>
                                        <td><?php echo $count;?></td>
                                        <td><?php echo $record->pr_cat_name ?></td>
                                        <td><?php echo $record->status;?></td>
										<td class="uk-text-nowrap">
											<a href="<?php echo site_url('Eshanya/recipeCatEdit/' .$submod_id. '/' . $record->pr_cat_id); ?>" class="btn btn-sm btn-info">Edit</a>
											<a href="<?php echo site_url('Eshanya/rccategoryDelete/'. $submod_id . '/' . $record->pr_cat_id); ?>" class="btn btn-sm btn-info" onClick="return confirm('Are you sure want to delete?');" >Delete</a>
											<?php if($record->status == 'Enabled') { ?>
												<a href="#medlist" class="grid-form-dialog-btn btn btn-sm btn-info cat_status" onclick="javascript:load_marks(<?php echo $record->pr_cat_id; ?>,'Disabled')">Disable</a>
											<?php } else { ?>
												<a href="#medlist" class="grid-form-dialog-btn btn btn-sm btn-info cat_status" onclick="javascript:load_marks(<?php echo $record->pr_cat_id; ?>,'Enabled')">Enable</a>
											<?php } ?>
										</td>
                                    </tr>
                                    
                                   <?php
								  $count++;
								}
							  
							?>
							
                                </tbody>
                               
                            </table>
                        </div>
					</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>
$('.param_check').each(function() { $(this).on( {'click contextmenu': function() {
//contextmenu
	var i = $(this).data('value');
	var anchor = $("a");
	var anchorTarget = $(this).parent().find('.parmetre').val();
	var submodid = $(this).parent().find('.submod_id').val();
	var link = $(this).attr('href');
	$(this).attr("href", link + submodid +'/'+anchorTarget);

	location.reload();
	}
	})
})
  </script>
<script>
function load_marks(cid,status)
{
	$('#cat_id').val(cid);
	$('#status').val(status);
}
</script>
<div class="grid-form-dialog" id="" title="Enable/Disable">
	<div class="container">
	<form  action="" id="invoice_form_validate" class="uk-form-stacked"  method="post" autocomplete="off">
		<div class="row">
			<div class="col-md-4">
				<div class="form-body">
					<div class="form-group">
						<label for="eventInput1">Effective From</label>
						<input type="text" class="form-control date-picker" id="effective_date" name="effective_date" value="" required placeholder="Effective From">
						<input type="hidden" class="form-control" id="cat_id" name="cat_id" value="" >
						<input type="hidden" class="form-control" id="status" name="status" value="" >
					</div>
				</div>
			</div>
		</div>
		<div class=" text-right">
			<button type="reset" class="btn btn-warning mr-1">
				<i class="ft-x"></i> Reset
			</button>
			<button type="submit" id="sub" name="sub" class="btn btn-primary">
				<i class="la la-check-square-o"></i> Save
			</button>
		</div>
	</form>
	</div>
</div>

 <script>
	$('#sub').click(function() {
		var effective = $('#effective_date').val();
		var cat_id = $('#cat_id').val();
		var cat_status = $('#status').val();
		if(effective == '')
		{
			alert("Please Enter Effective Date");
			return false;
		}
		else
		{
			$.ajax({
				type: "POST",
				dataType:'json',
				data : { cat_id : cat_id, cat_status : cat_status, effective : effective },
				url: "<?php echo base_url();?>index.php/Eshanya/change_prcat_status",
				success: function(dataz) { 
					setInterval(function(){
							window.location.reload(true);
						}, 200);
				}
			});
		}
	});
</script>
<script type="text/javascript">
	$(function() {
		$('.date-picker').datepicker({
			changeMonth: true,
			changeYear: true,
			showButtonPanel: true,
			dateFormat: 'dd-mm-yy',
		});
	});	
</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>