<?php include 'template/header.php'; include 'template/menu.php'; include 'inc/functions.php'; if (!empty($_GET['bundle'])) { $bundle_detail = bundle_info($_GET['bundle']); if (empty($bundle_detail)) { header('Location:index.php'); } } else { header('Location:index.php'); } ?> <div class="wrapper"> <!-- slider start here --> <div class="bundle_banner"> <img src="<?php echo $bundle_detail['bundle_image_url'] != '' ? $BASEURL . 'dashboard/' . $bundle_detail['bundle_image_url'] : 'asset/images/fish/default.jpg'; ?> "> </div> <!-- slider end here --> <H5 id="title">Bundle Detail</H5>
function order_insert($bundle_id) { $bundle_detail = bundle_info($bundle_id); if (!empty($bundle_detail)) { global $DBNAME; $db_connect = get_database_connection(); mysql_select_db($DBNAME) or die("cannot select DB"); $mobile_number = '017116666' . rand(11, 99); $order_date = date("Y-m-d H:i:s"); $bundle_price = $bundle_detail['bundle_price']; $bundle_name = $bundle_detail['bundle_name']; $order_state = 0; $sql = mysql_query("INSERT INTO tbl_orders (mobile_number, bundle_name, bundle_id, bundle_price , order_date,order_state) VALUES ('{$mobile_number}','{$bundle_name}', '{$bundle_id}', '{$bundle_price}', '{$order_date}','{$order_state}')"); if ($sql) { return true; } else { return false; } } else { return false; } }
<?php include 'template/header.php'; include 'template/menu.php'; ?> <?php if (!empty($_GET['bundle'])) { $bundle_info = bundle_info($_GET['bundle']); if (!empty($bundle_info)) { $all_product_name = all_product_name(); //for select box;s $all_bundle_list = all_bundle_list(); //for all list show /*************************************************************************************/ /**************************************update******************************************/ if (!empty($_POST['update'])) { if (!empty($_FILES['product_image']['name'])) { $bundle_image_url = image_upload(); } else { $bundle_image_url = $bundle_info['bundle_image_url']; } if (!empty($bundle_image_url)) { $product_counter = $_POST['product_counter']; $product_array = array(); for ($i = 1; $i <= $product_counter; $i++) { $product_field = 'product_' . $i; $product_unit = 'product_unit_' . $i; $product_array[] = ['product_id' => $_POST[$product_field], 'product_unit' => $_POST[$product_unit]]; } $update_bundle = update_bundle($bundle_info['bundle_id'], $_POST['bundle_name'], $_POST['bundle_price'], $product_array, $bundle_image_url, $product_counter);