示例#1
0
		<!-- End breadcrumb -->
		
		<div class="panel panel-info">
		  <div class="panel-heading">
		  	<div class="right-content">
				<a href="add_offer.php"><button class="btn btn-success btn-perspective btn-lg pull-right">ADD PRODUCT OFFER</button></a>
			</div>
			<h3>View Offers</h3>
		  </div>
		  <div class="panel-body">
			<!-- BEGIN DATA TABLE -->
			<div class="the-box">
				<div class="table-responsive">
					<?php 
$offer = new offer();
$results = $offer->get_products();
if ($results) {
    ?>
						<table class="table table-striped table-hover" id="datatable-example">
							<thead class="the-box dark full">
								<tr>
									<th>Name</th>
									<th>Min Purchase</th>
									<th>Offer Status</th>
								</tr>
							</thead>
							<tbody>
								<?php 
    foreach ($results as $res) {
        ?>
								<tr>
示例#2
0
if (isset($_POST['add_offer'])) {
    // Update old record
    if (isset($ID)) {
        $results = $offer->update_offer($_POST, $ID);
    } else {
        // Insert new
        $results = $offer->insert_offer($_POST);
    }
    if ($results) {
        echo '<div class="alert alert-success" role="alert"> Add Offer Sucessfully </div>';
    } else {
        echo '<div class="alert alert-danger" role="alert"> Error </div>';
    }
}
if (isset($ID)) {
    $product_result = $offer->get_products($ID);
    $offer_result = $offer->get_offers($ID);
    // print_f($offer_result);
}
?>
			<div class="the-box noborder">
				<form id="ExampleBootstrapValidationForm" method="post" action="" class="form-horizontal">
					<fieldset>
						<legend>Product Detail:</legend>
						
						<div class="form-group">
							<label class="col-lg-3 control-label">Product Name</label>
							<div class="col-lg-5">
								<?php 
if (isset($ID)) {
    ?>