Şuanki Dizin: /home/wwwdreamtechnolo/public_html/sattvicyug.com/lib/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/sattvicyug.com/lib/functions.php |
<?php session_start(); date_default_timezone_set('Asia/Kolkata'); // header('Content-Type: text/html; charset=utf-8'); class login_function { private $con; function __construct() { //$this->con = new mysqli("localhost","root","","shopinba_barshibazaar"); //$this->con = new mysqli("localhost","wwwdreamtechnolo_balajimall_admin","1i}};gu=7=}c","wwwdreamtechnolo_balajimall_main"); $this->con = new mysqli("localhost","wwwdreamtechnolo_admin_sattvic","tsUGimf0sFV0","wwwdreamtechnolo_sattvic_yug"); // $this->con = new mysqli("localhost","root","","book_shop"); //$this->con->set_charset("utf8mb4"); } function insert_visitor($todays_date) { $visit = 1; if($stmt_select = $this->con->prepare("Insert into `visitors`(`visits`,`date`) Values(?,?)")) { $stmt_select->bind_param("ss",$visit,$todays_date); if($stmt_select->execute()) { return true; } return false; } } function update_visit_counter($todays_date,$v_count) { if($stmt_select = $this->con->prepare("update `visitors` set `visits`=? where `date` = ?")) { $stmt_select->bind_param("ss",$v_count,$todays_date); if($stmt_select->execute()) { return true; } return false; } } function get_todays_visitor_count($todays_date) { if($stmt_select = $this->con->prepare("Select `visits` from `visitors` where `date` = ?")) { $stmt_select->bind_param("s",$todays_date); $stmt_select->bind_result($visits); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $visits; } } return false; } } function get_visit_counts() { if($stmt_select = $this->con->prepare("Select SUM(`visits`) from `visitors`")) { $stmt_select->bind_result($visits); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $visits; } } return false; } } function get_counts_of_exist_item($item_id) { if($stmt_select = $this->con->prepare("Select `qty` from `temp_cart` where `id` = ?")) { $stmt_select->bind_param("i",$item_id); $stmt_select->bind_result($res_qty); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_qty; } } return false; } } function get_password_from_user_name($email) { if($stmt_select = $this->con->prepare("Select `password` from `application_users` where `user_id` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function change_user_password($email,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `application_users` set `password`='".$password."' where `user_id` = ?")) { $stmt_select->bind_param("s",$email); if($stmt_select->execute()) { return true; } return false; } } function add_seller($shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob) { $status = "Pending"; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `seller`(`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssss",$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function check_email_id_exist_or_not($email) { if($stmt_select = $this->con->prepare("Select `id` from `seller` where `seller_email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_pending_seller_info($seller_name,$shop_name,$from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status` FROM `seller` Where `status` = 'Pending' AND `owner_name` LIKE '%$seller_name%' AND `shop_name` LIKE '%$shop_name%' AND `date` BETWEEN '$from_date' AND '$to_date' ")) { $stmt_insert->bind_result($id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $shop_name; $details[$counter][2] = $owner_name; $details[$counter][3] = $address; $details[$counter][4] = $contact_no; $details[$counter][5] = $licence_no; $details[$counter][6] = $seller_email; $details[$counter][7] = $password; $details[$counter][8] = $confirm_password; $details[$counter][9] = $gender; $details[$counter][10] = $dob; $details[$counter][11] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_count_of_all_pending_seller_info() { if($stmt_insert = $this->con->prepare("SELECT count(`id`) FROM `seller` Where `status` = 'Pending'")) { $stmt_insert->bind_result($res_count_id); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $res_count_id; } return false; } } } function get_count_of_all_pending_dispatch_products() { if($stmt_insert = $this->con->prepare("SELECT count(`id`) FROM `user_checkout_details` Where `status` = 'Pending'")) { $stmt_insert->bind_result($res_count_id); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $res_count_id; } return false; } } } function get_count_of_all_dispatch_products() { if($stmt_insert = $this->con->prepare("SELECT count(`id`) FROM `user_checkout_details` Where `status` = 'Dispatch'")) { $stmt_insert->bind_result($res_count_id); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $res_count_id; } return false; } } } function get_count_of_all_pending_dispatch_products_by_seller_email($email) { if($stmt_insert = $this->con->prepare("SELECT count(`id`) FROM `checkout_list` Where `status` = 'Pending' AND `seller_name` = ?")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($res_count_id); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $res_count_id; } return false; } } } function delete_seller_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `seller` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_seller_status($up_id) { $status = "Inactive"; if($stmt_insert = $this->con->prepare("Update `seller` set `status` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$status,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_seller_pending_status($up_id) { $status = "Active"; if($stmt_insert = $this->con->prepare("Update `seller` set `status` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$status,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_approve_seller_info($seller_name,$shop_name,$from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status`,`ads_allowed`,`account_date_from`,`account_date_to` FROM `seller` Where `status` != 'Pending' AND `owner_name` LIKE '%$seller_name%' AND `shop_name` LIKE '%$shop_name%' AND `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_result($id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status,$ads_allowed,$account_date_from,$account_date_to); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $shop_name; $details[$counter][2] = $owner_name; $details[$counter][3] = $address; $details[$counter][4] = $contact_no; $details[$counter][5] = $licence_no; $details[$counter][6] = $seller_email; $details[$counter][7] = $password; $details[$counter][8] = $confirm_password; $details[$counter][9] = $gender; $details[$counter][10] = $dob; $details[$counter][11] = $status; $details[$counter][12] = $ads_allowed; $details[$counter][13] = $account_date_from; $details[$counter][14] = $account_date_to; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_seller_info_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status`,`ads_allowed`, `account_date_from`, `account_date_to` FROM `seller` Where `id` = ? ")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status,$ads_allowed,$account_date_from,$account_date_to); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $shop_name; $details[$counter][2] = $owner_name; $details[$counter][3] = $address; $details[$counter][4] = $contact_no; $details[$counter][5] = $licence_no; $details[$counter][6] = $seller_email; $details[$counter][7] = $password; $details[$counter][8] = $confirm_password; $details[$counter][9] = $gender; $details[$counter][10] = $dob; $details[$counter][11] = $status; $details[$counter][12] = $ads_allowed; $details[$counter][13] = $account_date_from; $details[$counter][14] = $account_date_to; $counter++; } if(!empty($details)) { return $details; } return false; } } } function check_email_id_exist_or_not_for_update($email,$up_id) { if($stmt_select = $this->con->prepare("Select `id` from `seller` where `seller_email` = ? AND `id` != ? ")) { $stmt_select->bind_param("si",$email,$up_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_seller($up_id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$gender,$dob,$allowed_ads,$package_start_date,$package_end_date) { if($stmt_insert = $this->con->prepare("Update `seller` set `shop_name` = ?, `owner_name` = ?, `address` = ?, `contact_no` = ?, `licence_no` = ?, `seller_email` = ?, `password` = ?,`gender` = ?, `dob` = ?,`ads_allowed`=?,`account_date_from`=?,`account_date_to`=? Where `id` =?")) { $stmt_insert->bind_param("ssssssssssssi",$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$gender,$dob,$allowed_ads,$package_start_date,$package_end_date,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function add_application($emp_id,$full_name,$a_email,$contact,$address,$designation,$user_id,$password) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `application_users`(`emp_id`, `name`, `email`, `contact`, `address`, `designation`, `user_id`, `password`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$emp_id,$full_name,$a_email,$contact,$address,$designation,$user_id,$password,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function check_application_user_id_exist($user_id) { if($stmt_select = $this->con->prepare("Select `id` from `application_users` where `user_id` = ? ")) { $stmt_select->bind_param("s",$user_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function check_application_emp_id_exist($emp_id) { if($stmt_select = $this->con->prepare("Select `id` from `application_users` where `emp_id` = ? ")) { $stmt_select->bind_param("s",$emp_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_application_info($emp_name,$emp_id,$designation) { if($designation == "Select Operator") { $designation = ""; } if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `name`,`email`, `contact`, `address`, `designation`, `user_id`, `password` FROM `application_users` Where `emp_id` LIKE '%$emp_id%' AND `designation` LIKE '%$designation%' AND `name` LIKE '%$emp_name%' ")) { $stmt_insert->bind_result($id,$emp_id,$emp_name,$email,$contact,$address,$designation,$user_id,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $emp_id; $details[$counter][2] = $emp_name; $details[$counter][3] = $email; $details[$counter][4] = $contact; $details[$counter][5] = $address; $details[$counter][6] = $designation; $details[$counter][7] = $user_id; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_application_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `application_users` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_application_info_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `name`,`email`, `contact`, `address`, `designation`, `user_id`, `password` FROM `application_users` Where `id` = ? ")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$emp_id,$emp_name,$email,$contact,$address,$designation,$user_id,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $emp_id; $details[$counter][2] = $emp_name; $details[$counter][3] = $email; $details[$counter][4] = $contact; $details[$counter][5] = $address; $details[$counter][6] = $designation; $details[$counter][7] = $user_id; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_application($up_id,$emp_id,$full_name,$a_email,$contact,$address,$designation,$user_id,$password) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `application_users` set `emp_id` = ?, `name` = ?, `email` = ?, `contact` = ?, `address` = ?, `designation` = ?, `user_id` = ?, `password` = ? Where `id` =?")) { $stmt_insert->bind_param("ssssssssi",$emp_id,$full_name,$a_email,$contact,$address,$designation,$user_id,$password,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function check_application_user_id_for_update($user_id,$up_id) { if($stmt_select = $this->con->prepare("Select `id` from `application_users` where `user_id` = ? AND `id` != ? ")) { $stmt_select->bind_param("si",$user_id,$up_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function check_application_emp_id_for_update($emp_id,$up_id) { if($stmt_select = $this->con->prepare("Select `id` from `application_users` where `emp_id` = ? AND `id` != ? ")) { $stmt_select->bind_param("si",$emp_id,$up_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_password_from_seller_name($email) { if($stmt_select = $this->con->prepare("Select `password`,`status` from `seller` where `seller_email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password,$result_status); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $result_password; $data[1] = $result_status; return $data; } } return false; } } function get_password_from_seller_name_for_display($email) { if($stmt_select = $this->con->prepare("Select `password` from `seller` where `seller_email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function change_seller_password($email,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `seller` set `password`='".$password."', `confirm_password`='".$password."' where `seller_email` = ?")) { $stmt_select->bind_param("s",$email); if($stmt_select->execute()) { return true; } return false; } } function fetch_seller_id_by_email($email) { if($stmt_select = $this->con->prepare("Select `id` from `seller` where `seller_email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_seller_information($result_id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$gender,$dob) { if($stmt_insert = $this->con->prepare("Update `seller` set `shop_name` = ?, `owner_name` = ?, `address` = ?, `contact_no` = ?, `licence_no` = ?, `seller_email` = ?, `gender` = ?, `dob` = ? Where `id` =?")) { $stmt_insert->bind_param("ssssssssi",$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$gender,$dob,$result_id); if($stmt_insert->execute()) { return true; } return false; } } function update_profile_field($update_id) { $actual_image_name = ""; if($stmt_insert = $this->con->prepare("Update `seller` set `profile_image`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function get_profile_image_name($update_id) { if($stmt_select = $this->con->prepare("Select `profile_image` from `seller` where `id` = ? ")) { $stmt_select->bind_param("i",$update_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function update_profile_data($update_id,$actual_image_name) { if($stmt_insert = $this->con->prepare("Update `seller` set `profile_image`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function add_product($email,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock) { $date = date("Y-m-d"); $time = date("H-i-s A"); $pending_product = "pending"; if($stmt_insert = $this->con->prepare("INSERT INTO `products`(`added_by`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`, `home_delivery`, `date`, `time`,`status`,`unit`,`sr_no`,`stock`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssssss",$email,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$date,$time,$pending_product,$unit,$sr_no,$stock); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function add_product_image($insert_id,$product) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `product_image`(`seller_id`, `images`, `date`, `time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$insert_id,$product,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function get_all_product_image_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`images` FROM `product_image` Where `seller_id` = ? ")) { $stmt_insert->bind_param("s",$up_id); $stmt_insert->bind_result($id,$images); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_product_image_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `product_image` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_product_image_name($update_id) { if($stmt_select = $this->con->prepare("Select `images` from `product_image` where `id` = ? ")) { $stmt_select->bind_param("i",$update_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function get_all_product_info($category,$email) { if($category == "Select Category") { $category = ""; } if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price` FROM `products` Where `category` LIKE '%$category%' AND `added_by` = ?")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_pending_product_info_for_admin() { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`added_by` FROM `products` Where `status` = 'pending'")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$added_by); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $added_by; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_product_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `products` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_product_info_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`, `home_delivery`, `unit`, `sr_no`,`stock` FROM `products` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_delivery,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_delivery; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_product($up_id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock) { if($stmt_insert = $this->con->prepare("update `products` set `category` = ?, `product_name` = ?, `tags` = ?, `description` = ?, `actual_price` = ?, `selling_price` = ?, `home_delivery` = ?,`unit`=?,`sr_no`=?,`stock`=? Where `id` =?")) { $stmt_insert->bind_param("ssssssssssi",$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_product_info_for_admin($owner_name,$product_id,$category,$product_name) { if($category == "Select Category") { $category = ""; } $pro_stmt = ""; if($product_id!="") { $pro_stmt = " AND `id` = ".$product_id; } if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`added_by`,`unit`,`sr_no`,`stock` FROM `products` Where `added_by` LIKE '%$owner_name%' AND `category` LIKE '%$category%' AND `product_name` LIKE '%$product_name%' ".$pro_stmt)) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$added_by,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $added_by; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_advertisement($category,$title,$advertise_picture,$s_date,$e_date,$p_amount,$r_name,$r_commission) { $s_date = date("Y-m-d" , strtotime($s_date)); $e_date = date("Y-m-d" , strtotime($e_date)); $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `advertisement`(`category`, `title` , `advertise_image`, `start_date`, `expire_date`, `paid_amount`, `reference_name`, `referral_commission`, `date`,`time`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$category,$title,$advertise_picture,$s_date,$e_date,$p_amount,$r_name,$r_commission,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_advertise_info($category,$title) { $today_date = Date("Y-m-d"); if($category == 'Select Category') { $category = ""; } if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `advertise_image`, `start_date`, `expire_date`, `paid_amount`, `reference_name`, `referral_commission`,`title` FROM `advertisement` Where `category` LIKE '%$category%' AND `title` LIKE '%$title%' AND `expire_date` >= '$today_date'")) { $stmt_insert->bind_result($id,$category,$advertise_image,$start_date,$expire_date,$paid_amount,$reference_name,$referral_commission,$title); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $advertise_image; $details[$counter][3] = $start_date; $details[$counter][4] = $expire_date; $details[$counter][5] = $paid_amount; $details[$counter][6] = $reference_name; $details[$counter][7] = $referral_commission; $details[$counter][8] = $title; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_advertise_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `advertisement` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_advertise_info_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `advertise_image`, `start_date`, `expire_date`, `paid_amount`, `reference_name`, `referral_commission`,`title` FROM `advertisement` Where `id` = ? ")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$category,$advertise_image,$start_date,$expire_date,$paid_amount,$reference_name,$referral_commission,$title); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $advertise_image; $details[$counter][3] = $start_date; $details[$counter][4] = $expire_date; $details[$counter][5] = $paid_amount; $details[$counter][6] = $reference_name; $details[$counter][7] = $referral_commission; $details[$counter][8] = $title; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_advertisement($up_id,$category,$title,$s_date,$e_date,$p_amount,$r_name,$r_commission) { $s_date = date("Y-m-d" , strtotime($s_date)); $e_date = date("Y-m-d" , strtotime($e_date)); if($stmt_insert = $this->con->prepare("Update `advertisement` set `category` = ?,`title` = ?, `start_date` = ?, `expire_date` = ?, `paid_amount` = ?, `reference_name` = ?, `referral_commission` = ? Where `id` = ?")) { $stmt_insert->bind_param("sssssssi",$category,$title,$s_date,$e_date,$p_amount,$r_name,$r_commission,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_advertise_image_field($update_id) { $actual_image_name = ""; if($stmt_insert = $this->con->prepare("Update `advertisement` set `advertise_image`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function get_advertise_image_name($update_id) { if($stmt_select = $this->con->prepare("Select `advertise_image` from `advertisement` where `id` = ? ")) { $stmt_select->bind_param("i",$update_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function update_advertise_data($update_id,$actual_image_name) { if($stmt_insert = $this->con->prepare("Update `advertisement` set `advertise_image`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_expiry_advertise_info($category,$title) { $today_date = Date("Y-m-d"); if($category == 'Select Category') { $category = ""; } if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `advertise_image`, `start_date`, `expire_date`, `paid_amount`, `reference_name`, `referral_commission`,`title` FROM `advertisement` Where `category` LIKE '%$category%' AND `title` LIKE '%$title%' AND `expire_date` <= '$today_date'")) { $stmt_insert->bind_result($id,$category,$advertise_image,$start_date,$expire_date,$paid_amount,$reference_name,$referral_commission,$title); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $advertise_image; $details[$counter][3] = $start_date; $details[$counter][4] = $expire_date; $details[$counter][5] = $paid_amount; $details[$counter][6] = $reference_name; $details[$counter][7] = $referral_commission; $details[$counter][8] = $title; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_by_tags($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery`,`unit` FROM `products` Where `tags` LIKE '%$search%'")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $details[$counter][8] = $unit; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_by_tagsfor_fruite_box($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery`,`unit`,`sr_no`,`stock` FROM `products` Where `tags` LIKE '%$search%' AND `category`='Fruit Salad Box' ORDER BY `sr_no` ASC")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_by_tagsfor_juices($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery`,`unit`,`sr_no`,`stock` FROM `products` Where `tags` LIKE '%$search%' AND `category`='Natural Juices' ORDER BY `sr_no` ASC")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_by_tags_for_fruite($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery`,`unit`,`sr_no`,`stock` FROM `products` Where `tags` LIKE '%$search%' AND `category`='Fruit' ORDER BY `sr_no` ASC")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_by_tags_for_vegitable($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery`,`unit`,`sr_no`,`stock` FROM `products` Where `tags` LIKE '%$search%' AND `category`='Vegetable' ORDER BY `sr_no` ASC")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del,$unit,$sr_no,$stock); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $details[$counter][8] = $unit; $details[$counter][9] = $sr_no; $details[$counter][10] = $stock; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_images_by_product_id($p_id) { if($stmt_select = $this->con->prepare("Select `images` from `product_image` where `seller_id` = ? ORDER BY `id` ASC")) { $stmt_select->bind_param("s",$p_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_product_all_images_by_product_id($p_id) { if ($stmt_select = $this->con->prepare("SELECT `images` FROM `product_image` WHERE `seller_id` = ?")) { $stmt_select->bind_param("i", $p_id); $stmt_select->bind_result($image_path); if ($stmt_select->execute()) { $image_paths = []; while ($stmt_select->fetch()) { $image_paths[] = $image_path; } if (!empty($image_paths)) { return $image_paths; } } } return false; } function track_product_by_id($t_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`, `added_by`, `home_delivery` FROM `products` Where `id` = ?")) { $stmt_insert->bind_param("i",$t_id); $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$added_by,$home_del); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $added_by; $details[$counter][8] = $home_del; $counter++; } if(!empty($details)) { return $details; } return false; } } } function track_product_images_by_product_id($p_id) { if($stmt_select = $this->con->prepare("Select `images` from `product_image` where `seller_id` = ? ")) { $stmt_select->bind_param("s",$p_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_related_data_by_tag($tags) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price` FROM `products` Where `tags` = ?")) { $stmt_insert->bind_param("s",$tags); $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_seller_info_by_email($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status` FROM `seller` Where `seller_email` = ? ")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $shop_name; $details[2] = $owner_name; $details[3] = $address; $details[4] = $contact_no; $details[5] = $licence_no; $details[6] = $seller_email; $details[7] = $password; $details[8] = $confirm_password; $details[9] = $gender; $details[10] = $dob; $details[11] = $status; } if(!empty($details)) { return $details; } return false; } } } function fetch_image_data_by_id($p_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `images` FROM `product_image` Where `seller_id` = ?")) { $stmt_insert->bind_param("s",$p_id); $stmt_insert->bind_result($id,$images); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_search_product_by_search_name($search) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery` FROM `products` Where `category` LIKE '%".$search."%' OR `tags` LIKE '%".$search."%' OR `product_name` LIKE '%".$search."%' ")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_search_product_by_search_name_parameters($product_name,$shop_name) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price`,`home_delivery` FROM `products` Where `product_name` LIKE '%$product_name%' AND `status` = 'Approved'")) { $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price,$home_del); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $tags; $details[$counter][4] = $description; $details[$counter][5] = $actual_price; $details[$counter][6] = $selling_price; $details[$counter][7] = $home_del; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_advertise_info_for_display() { $today_date = date('Y-m-d'); if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `advertise_image`, `start_date`, `expire_date`, `paid_amount`, `reference_name`, `referral_commission`,`title` FROM `advertisement` Where `category` = 'Main Page' AND `start_date` <= '$today_date' AND `expire_date` >= '$today_date'")) { $stmt_insert->bind_result($id,$category,$advertise_image,$start_date,$expire_date,$paid_amount,$reference_name,$referral_commission,$title); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $advertise_image; $details[$counter][3] = $start_date; $details[$counter][4] = $expire_date; $details[$counter][5] = $paid_amount; $details[$counter][6] = $reference_name; $details[$counter][7] = $referral_commission; $details[$counter][8] = $title; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_slider_images($links,$advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `slider_image`(`images`, `links` , `date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$links,$advertise_picture,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_slider_images() { if($stmt_insert = $this->con->prepare("SELECT `id`,`images`, `links` FROM `slider_image`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_slider_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `slider_image` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } // function add_temp_cart($current_session,$c_id,$qty,$actual_price) // { // $date = date("Y-m-d"); // $time = date("H-i-s A"); // if($stmt_insert = $this->con->prepare("INSERT INTO `temp_cart`(`session_id`, `product_id`, `qty`, `actual_price`, `date`,`time`) VALUES (?,?,?,?,?,?)")) // { // $stmt_insert->bind_param("ssssss",$current_session,$c_id,$qty,$actual_price,$date,$time); // if($stmt_insert->execute()) // { // return true; // } // return false; // } // } function add_temp_cart($current_session, $c_id, $qty, $actual_price, $selling_price, $grams, $unit) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `temp_cart`(`session_id`, `product_id`, `qty`, `actual_price`, `date`, `time`, `selling_price`, `grams`,`unit`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$current_session, $c_id, $qty, $actual_price, $date, $time, $selling_price, $grams,$unit); if($stmt_insert->execute()) { return true; } return false; } } function fetch_all_temp_cart_data($current_session) { if($stmt_insert = $this->con->prepare("SELECT `id`, `session_id`, `product_id`, `qty`, `actual_price`, `date`, `time`, `selling_price`, `grams`,`unit` FROM `temp_cart` Where `session_id` = ?")) { $stmt_insert->bind_param("s",$current_session); $stmt_insert->bind_result($id,$session_id,$product_id,$qty,$actual_price,$date,$time,$selling_price,$grams,$unit); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { // if ($grams >= 1000) { // $converted_grams = $grams / 1000; // $weight_display = $converted_grams . " kg"; // } else { // $weight_display = $grams . " gm"; // } $weight_display = $grams; $details[$counter][0] = $id; $details[$counter][1] = $session_id; $details[$counter][2] = $product_id; $details[$counter][3] = $qty; $details[$counter][4] = $actual_price; $details[$counter][5] = $date; $details[$counter][6] = $time; $details[$counter][7] = $selling_price; $details[$counter][8] = $weight_display; $details[$counter][9] = $unit; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_temp_cart($current_session,$c_id,$qty,$actual_price) { if($stmt_select = $this->con->prepare("Delete from `temp_cart` where `session_id`=? AND `product_id` = ?")) { $stmt_select->bind_param("ss",$current_session,$c_id); if($stmt_select->execute()) { return true; } return false; } } function check_product_exist($current_session,$c_id) { if($stmt_select = $this->con->prepare("Select `qty` from `temp_cart` where `session_id` = ? AND `product_id` = ? ")) { $stmt_select->bind_param("ss",$current_session,$c_id); $stmt_select->bind_result($result_data); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_data; } } return false; } } function check_cart_product_exist($current_session,$c_id,$weight) { if($stmt_select = $this->con->prepare("Select `qty` from `temp_cart` where `session_id` = ? AND `product_id` = ? AND `grams`=?")) { $stmt_select->bind_param("sss",$current_session,$c_id,$weight); $stmt_select->bind_result($result_data); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_data; } } return false; } } function get_count_of_carts_from_session_id($current_session) { if($stmt_select = $this->con->prepare("Select COUNT(`id`) from `temp_cart` where `session_id` = ?")) { $stmt_select->bind_param("s",$current_session); $stmt_select->bind_result($result_data); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_data; } } return false; } } // function update_cart($current_session,$c_id,$qty,$actual_price) // { // if($stmt_insert = $this->con->prepare("Update `temp_cart` set `qty` = `qty` + ?, `actual_price`=`actual_price`+? Where `product_id` = ? AND `session_id` = ?")) // { // $stmt_insert->bind_param("ssis",$qty,$actual_price,$c_id,$current_session); // if($stmt_insert->execute()) // { // return true; // } // return false; // } // } function update_cart($current_session, $c_id, $qty, $actual_price,$selling_price,$weight) { $query = "UPDATE `temp_cart` SET `qty` = `qty` + ?, `actual_price` = `actual_price` + ?,`selling_price` = `selling_price` + ? WHERE `product_id` = ? AND `session_id` = ? AND `grams`=?"; if ($stmt = $this->con->prepare($query)) { $stmt->bind_param("sssiss", $qty, $actual_price,$selling_price, $c_id, $current_session,$weight); if ($stmt->execute()) { return true; } else { return false; } } return false; } function update_less_cart($current_session,$c_id,$qty,$actual_price,$selling_price) { if($stmt_insert = $this->con->prepare("Update `temp_cart` set `qty` = `qty` - ?, `actual_price`=`actual_price` - ?, `selling_price`=`selling_price` - ? Where `product_id` = ? AND `session_id` = ?")) { $stmt_insert->bind_param("sssis",$qty,$actual_price,$selling_price,$c_id,$current_session); if($stmt_insert->execute()) { return true; } return false; } } function fetch_total_qty($s_id,$p_id,$grams) { if($stmt_select = $this->con->prepare("Select `qty` from `temp_cart` where `session_id` = ? AND `product_id` = ? AND `grams`=?")) { $stmt_select->bind_param("sss",$s_id,$p_id,$grams); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_product_info_display_cart($p_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `tags`, `description`, `actual_price`, `selling_price` FROM `products` Where `id` = ?")) { $stmt_insert->bind_param("i",$p_id); $stmt_insert->bind_result($id,$category,$product_name,$tags,$description,$actual_price,$selling_price); if($stmt_insert->execute()) { $details = array(); while($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $category; $details[2] = $product_name; $details[3] = $tags; $details[4] = $description; $details[5] = $actual_price; $details[6] = $selling_price; } if(!empty($details)) { return $details; } return false; } } } function delete_product_from_temp_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `temp_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_product_from_temp_cart_by_product_id($del_id) { if($stmt_select = $this->con->prepare("Delete from `temp_cart` where `session_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_count_of_qunatity($session_id) { if($stmt_select = $this->con->prepare("Select SUM(`qty`) from `temp_cart` where `session_id` = ? ")) { $stmt_select->bind_param("s",$session_id); $stmt_select->bind_result($result); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result; } } return false; } } function add_user($full_name,$address,$contact_no,$user_email,$password,$confirm_password,$gender,$dob,$wife_name,$wife_dob,$ann_date,$child_name,$child_dob,$pin,$latitude,$longitude) { $status = "Pending"; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `users`(`full_name`, `address`, `contact_no`, `email`, `password`, `confirm_password`,`gender`, `dob`, `wife_name`, `wife_dob`, `anniversary_date`, `child_name`, `child_dob`, `status`, `date`, `time`,`pin_code`, `latitude`, `longitude`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssssssssss",$full_name,$address,$contact_no,$user_email,$password,$confirm_password,$gender,$dob,$wife_name,$wife_dob,$ann_date,$child_name,$child_dob,$status,$date,$time,$pin,$latitude,$longitude); if($stmt_insert->execute()) { return true; } return false; } } function check_user_email_id_exist_or_not($email) { if($stmt_select = $this->con->prepare("Select `password` from `users` where `email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function change_user_panel_password($email,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `users` set `password`='".$password."',`confirm_password`='".$password."' where `email` = ?")) { $stmt_select->bind_param("s",$email); if($stmt_select->execute()) { return true; } return false; } } function fetch_total_price_by_session_id($email) { if($stmt_select = $this->con->prepare("Select SUM(`actual_price`) from `temp_cart` where `session_id` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_user_data_by_email_id($contact_no) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `pin_code`, `latitude`,`longitude` FROM `users` Where `contact_no` = ? ORDER BY `contact_no` LIMIT 1")) { $stmt_insert->bind_param("s",$contact_no); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$pin,$latitude,$longitude); if($stmt_insert->execute()) { $details = array(); while($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $full_name; $details[2] = $address; $details[3] = $contact_no; $details[4] = $email; $details[5] = $pin; $details[6] = $latitude; $details[7] = $longitude; } if(!empty($details)) { return $details; } return false; } } } function add_record_to_checkout($full_name,$address,$contact_no,$user_email,$total_amount,$latitude,$longitude) { $date = date("Y-m-d"); $time = date("H-i-s A"); $status ="Pending"; if($stmt_insert = $this->con->prepare("INSERT INTO `user_checkout_details`(`full_name`, `address`, `contact_no`, `email`, `total_amount`, `date`, `time`,`status`,`latitude`,`longitude`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$full_name,$address,$contact_no,$user_email,$total_amount,$date,$time,$status,$latitude,$longitude); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function fetch_product_for_checklist($p_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`added_by`, `product_name`, `tags`, `description`, `actual_price`, `selling_price` FROM `products` Where `id` = ?")) { $stmt_insert->bind_param("i",$p_id); $stmt_insert->bind_result($id,$added_by,$product_name,$tags,$description,$actual_price,$selling_price); if($stmt_insert->execute()) { $details = array(); while($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $added_by; $details[2] = $product_name; $details[3] = $tags; $details[4] = $description; $details[5] = $actual_price; $details[6] = $selling_price; } if(!empty($details)) { return $details; } return false; } } } function add_items_to_checkout_list($transaction_id,$added_by,$prod_id,$qty,$selling_price,$actual_price1,$grams,$unit) { $status = "Pending"; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `checkout_list`(`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status`, `date`, `time`,`actual_price`,`grams`,`unit`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$transaction_id,$added_by,$prod_id,$qty,$selling_price,$status,$date,$time,$actual_price1,$grams,$unit); if($stmt_insert->execute()) { return true; } return false; } } function fetch_all_order_product_info($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status` FROM `checkout_list` Where `seller_name` = ? AND `status` = 'Pending'")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_order_product_info_from_trnsaction_id($t_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status` FROM `checkout_list` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$t_id); $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_user_checkout_details($id,$from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where `id` = ? AND `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_main_transaction_data($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount`,`date` FROM `user_checkout_details` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][6] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_product_info_by_product_id($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`category`, `product_name`, `description`, `actual_price`, `selling_price`,`added_by` FROM `products` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$category,$product_name,$description,$actual_price,$selling_price,$added_by); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $category; $details[$counter][2] = $product_name; $details[$counter][3] = $description; $details[$counter][4] = $actual_price; $details[$counter][5] = $selling_price; $details[$counter][6] = $added_by; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_product_status_dispatch($dispatch_id) { $status = "Dispatch"; if($stmt_insert = $this->con->prepare("Update `checkout_list` set `status` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$status,$dispatch_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_order_product_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `checkout_list` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_pending_approval_product_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `products` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_all_dispatch_product_info($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status` FROM `checkout_list` Where `seller_name` = ? AND `status` = 'Dispatch'")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_product_status_pending($dispatch_id) { $status = "Pending"; if($stmt_insert = $this->con->prepare("Update `checkout_list` set `status` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$status,$dispatch_id); if($stmt_insert->execute()) { return true; } return false; } } function update_product_status_pending_to_approve($approve_id) { $status = "Approved"; if($stmt_insert = $this->con->prepare("Update `products` set `status` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$status,$approve_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_all_order_product_info_for_admin($from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status` FROM `checkout_list` Where `status` = 'Pending' AND (`date` BETWEEN '$from_date' AND '$to_date')")) { $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_visits_by_date($from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`visits`, `date` FROM `visitors` Where `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_result($id,$visits,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $visits; $details[$counter][2] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_dispatch_product_info_for_admin($from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status` FROM `checkout_list` Where `status` = 'Dispatch' AND `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_user_product_checkout_details($email,$from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where `email` = ? AND `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_order_product_info_for_user($t_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status`,`date` FROM `checkout_list` Where `status` = 'Pending' AND `transaction_id`= ? ")) { $stmt_insert->bind_param("s",$t_id); $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $details[$counter][7] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_dispatch_product_info_for_user($t_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status`,`date` FROM `checkout_list` Where `status` = 'Dispatch' AND `transaction_id`= ? ")) { $stmt_insert->bind_param("s",$t_id); $stmt_insert->bind_result($id,$transaction_id,$seller_name,$product_id,$qty,$price,$status,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $details[$counter][7] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_deal_of_the_day_images($links,$advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `deal_of_the_day` set `images` = ?, `links` = ? , `date` = ?,`time` = ? ")) { $stmt_insert->bind_param("ssss",$links,$advertise_picture,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_deal_of_the_day_images() { if($stmt_insert = $this->con->prepare("SELECT `id`,`images`, `links` FROM `deal_of_the_day`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_new_hours_offers($offer_date,$s_time,$e_time,$advertise_picture,$links) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `offers`(`offer_date`,`s_time`,`e_time`,`images`, `links`,`date`,`time`) VALUES (?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssss",$offer_date,$s_time,$e_time,$advertise_picture,$links,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function update_hours_offers($up_id,$offer_date,$s_time,$e_time,$links) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `offers` set `offer_date` = ?,`s_time` = ?, `e_time` = ?, `links` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssssi",$offer_date,$s_time,$e_time,$links,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_offers() { if($stmt_insert = $this->con->prepare("SELECT `id`,`offer_date`,`s_time`,`e_time`,`images`, `links` FROM `offers`")) { $stmt_insert->bind_result($id,$offer_date,$s_time,$e_time,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $offer_date; $details[$counter][2] = $s_time; $details[$counter][3] = $e_time; $details[$counter][4] = $images; $details[$counter][5] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_user_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`,`contact_no`, `email`, `password`, `confirm_password`, `gender`, `dob`, `status`,`wife_name`,`wife_dob`,`anniversary_date`,`child_name`,`child_dob` FROM `users` ")) { $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$password,$confirm_password,$gender,$dob,$status,$wife_name,$wife_dob,$anniversary_date,$child_name,$child_dob); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $password; $details[$counter][6] = $confirm_password; $details[$counter][7] = $gender; $details[$counter][8] = $dob; $details[$counter][9] = $status; $details[$counter][10] = $wife_name; $details[$counter][11] = $wife_dob; $details[$counter][12] = $anniversary_date; $details[$counter][13] = $child_name; $details[$counter][14] = $child_dob; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_big_banner_advertise($ad) { $today_date = date('Y-m-d'); if($stmt_select = $this->con->prepare("Select `advertise_image` from `advertisement` where `category` = ? AND `start_date` <= '$today_date' AND `expire_date` >= '$today_date'")) { $stmt_select->bind_param("s",$ad); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function top_advertise($advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `detail_page_add` set `images` = ?, `date` = ?,`time` = ? ")) { $stmt_insert->bind_param("sss",$advertise_picture,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_top_advertise() { if($stmt_insert = $this->con->prepare("SELECT `id`,`images` FROM `detail_page_add`")) { $stmt_insert->bind_result($id,$images); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $counter++; } if(!empty($details)) { return $details; } return false; } } } function remove_advertise_image($advertise_picture) { $advertise_picture = ""; if($stmt_insert = $this->con->prepare("update `detail_page_add` set `images` = ?")) { $stmt_insert->bind_param("s",$advertise_picture); if($stmt_insert->execute()) { return true; } return false; } } function add_main_category($menubar,$category) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `main_category`(`menubar`, `category` , `date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$menubar,$category,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_main_category() { if($stmt_insert = $this->con->prepare("SELECT `id`,`menubar`, `category` FROM `main_category`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_main_category($del_id) { if($stmt_select = $this->con->prepare("Delete from `main_category` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_main_category_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`menubar`, `category` FROM `main_category` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_main_category($up_id,$menubar,$category) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("Update `main_category` set `menubar` = ?, `category` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$menubar,$category,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_main_category_for_sub_category() { if($stmt_insert = $this->con->prepare("SELECT `id`,`menubar`, `category` FROM `main_category` Where `menubar` = 'Top Menubar'")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_sub_category($category,$sub_category) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `sub_category`(`main_category`, `sub_category` , `date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$category,$sub_category,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_sub_category() { if($stmt_insert = $this->con->prepare("SELECT `id`,`main_category`, `sub_category` FROM `sub_category`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_sub_category($del_id) { if($stmt_select = $this->con->prepare("Delete from `sub_category` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_sub_category_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`main_category`, `sub_category` FROM `sub_category` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_sub_category($up_id,$category,$sub_category) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("Update `sub_category` set `main_category` = ?, `sub_category` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$category,$sub_category,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_sub_category_by_main_category($category) { if($stmt_insert = $this->con->prepare("SELECT `id`,`main_category`, `sub_category` FROM `sub_category` Where `main_category` = ?")) { $stmt_insert->bind_param("s",$category); $stmt_insert->bind_result($id,$main_category,$sub_category); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $main_category; $details[$counter][2] = $sub_category; $counter++; } if(!empty($details)) { return $details; } return false; } } } function check_category_exist_or_not($category) { if($stmt_select = $this->con->prepare("Select `id` from `main_category` where `category` = ? ")) { $stmt_select->bind_param("s",$category); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function check_sub_category_exist_or_not($category,$sub_category) { if($stmt_select = $this->con->prepare("Select `id` from `sub_category` where `main_category` = ? AND `sub_category` = ?")) { $stmt_select->bind_param("ss",$category,$sub_category); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_all_main_category_of_left_panel() { if($stmt_insert = $this->con->prepare("SELECT `id`,`menubar`, `category` FROM `main_category` where `menubar` = 'Left Menubar'")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_main_category_of_top_panel() { if($stmt_insert = $this->con->prepare("SELECT `id`,`menubar`, `category` FROM `main_category` where `menubar` = 'Top Menubar'")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_bottom_links($title,$links) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `bottom_links`(`title`, `links` , `date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$title,$links,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_bottom_links() { if($stmt_insert = $this->con->prepare("SELECT `id`,`title`, `links` FROM `bottom_links`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_bottom_links_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`title`, `links` FROM `bottom_links` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_bottom_links($up_id,$title,$links) { if($stmt_insert = $this->con->prepare("Update `bottom_links` set `title` = ?, `links` = ? Where `id` = ?")) { $stmt_insert->bind_param("sss",$title,$links,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_bottom_links_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `bottom_links` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_offers_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `offers` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_offers_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`offer_date`,`s_time`,`e_time`,`images`, `links` FROM `offers` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$offer_date,$s_time,$e_time,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $offer_date; $details[$counter][2] = $s_time; $details[$counter][3] = $e_time; $details[$counter][4] = $images; $details[$counter][5] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_offers_image($up_id,$advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `offers` set `images` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$advertise_picture,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_offerimage_by_id($up_id) { if($stmt_select = $this->con->prepare("Select `images` from `offers` where `id` = ? ")) { $stmt_select->bind_param("i",$up_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_offers_for_display() { $todays_date = Date('Y-m-d'); if($stmt_insert = $this->con->prepare("SELECT `id`,`offer_date`,`s_time`,`e_time`,`images`, `links` FROM `offers` Where `offer_date` = '$todays_date' ")) { $stmt_insert->bind_result($id,$offer_date,$s_time,$e_time,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $offer_date; $details[$counter][2] = $s_time; $details[$counter][3] = $e_time; $details[$counter][4] = $images; $details[$counter][5] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_particular_product_qty($current_session,$id,$grams) { if($stmt_select = $this->con->prepare("Select `qty` from `temp_cart` where `session_id` = ? AND `product_id` = ? AND `grams`=?")) { $stmt_select->bind_param("sss",$current_session,$id,$grams); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function delete_product_from_temp_cart_for_display($del_id) { if($stmt_select = $this->con->prepare("Delete from `temp_cart` where `product_id`=? LIMIT 1")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_item_permanent($del_id) { if($stmt_select = $this->con->prepare("Delete from `temp_cart` where `id`=? LIMIT 1")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function minus_item_quantity($del_id,$actual_price, $selling_price) { $new_price = $actual_price / 2; $new_selling_price = $selling_price / 2; if ($stmt_select = $this->con->prepare("UPDATE `temp_cart` SET `qty` = `qty` - 1, `actual_price` = ?, `selling_price` = ? WHERE `id` = ? LIMIT 1")) { $stmt_select->bind_param("ssi", $new_price, $new_selling_price,$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_user_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `users` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_user_checkout_details_for_admin_side($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_sum_of_selling_price($transaction_id) { if($stmt_select = $this->con->prepare("Select SUM(`price`) from `checkout_list` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$transaction_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_subcategory_data($category) { if($stmt_insert = $this->con->prepare("SELECT `sub_category` FROM `sub_category` where `main_category` = ?")) { $stmt_insert->bind_param("s",$category); $stmt_insert->bind_result($sub_category); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter] = $sub_category; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_user_designation($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `name`,`email`, `contact`, `address`, `designation`, `user_id`, `password` FROM `application_users` Where `user_id`=? ")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$emp_id,$emp_name,$email,$contact,$address,$designation,$user_id,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $emp_id; $details[$counter][2] = $emp_name; $details[$counter][3] = $email; $details[$counter][4] = $contact; $details[$counter][5] = $address; $details[$counter][6] = $designation; $details[$counter][7] = $user_id; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_seller_info_from_email($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`shop_name`, `owner_name`, `address`, `contact_no`, `licence_no`, `seller_email`, `password`, `confirm_password`,`gender`, `dob`, `status` FROM `seller` Where `seller_email` = ?")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$shop_name,$owner_name,$address,$contact_no,$licence_no,$seller_email,$password,$confirm_password,$gender,$dob,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $shop_name; $details[$counter][2] = $owner_name; $details[$counter][3] = $address; $details[$counter][4] = $contact_no; $details[$counter][5] = $licence_no; $details[$counter][6] = $seller_email; $details[$counter][7] = $password; $details[$counter][8] = $confirm_password; $details[$counter][9] = $gender; $details[$counter][10] = $dob; $details[$counter][11] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_enquiry_data($f_name,$contact) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `emergency_contact` (`title`,`contact_no`, `date`, `time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$f_name,$contact,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_enquiry_data() { if($stmt_insert = $this->con->prepare("SELECT `id`, `title`, `contact_no` FROM `emergency_contact` ORDER BY `id` DESC")) { $stmt_insert->bind_result($id,$title,$contact_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $title; $details[$counter][2] = $contact_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_enquiry_images($del_id) { if($stmt_select = $this->con->prepare("Delete from `emergency_contact` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_website_contact_details($address,$phone,$email) { if($stmt_select = $this->con->prepare("update `Contact Settings` set `address`=?,`phone` = ?,`email_id` = ?")) { $stmt_select->bind_param("sss",$address,$phone,$email); if($stmt_select->execute()) { return true; } return false; } } function get_all_contact_details() { if($stmt_select = $this->con->prepare("SELECT `address`, `phone`, `email_id` FROM `contact settings`")) { $stmt_select->bind_result($address,$phone,$email_id); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $address; $data[1] = $phone; $data[2] = $email_id; return $data; } } return false; } } function update_social_media($facebook) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'facebook' ")) { $stmt_insert->bind_param("s",$facebook); if($stmt_insert->execute()) { return true; } return false; } } function update_social_media1($twitter) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'twitter' ")) { $stmt_insert->bind_param("s",$twitter); if($stmt_insert->execute()) { return true; } return false; } } function update_social_media2($facebook) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'linked in' ")) { $stmt_insert->bind_param("s",$facebook); if($stmt_insert->execute()) { return true; } return false; } } function update_social_media3($twitter) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'google+' ")) { $stmt_insert->bind_param("s",$twitter); if($stmt_insert->execute()) { return true; } return false; } } function update_social_media4($twitter) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'you tube' ")) { $stmt_insert->bind_param("s",$twitter); if($stmt_insert->execute()) { return true; } return false; } } function update_social_media5($telegram) { if($stmt_insert = $this->con->prepare("UPDATE `social_media` set `link` = ? Where `name` = 'telegram' ")) { $stmt_insert->bind_param("s",$telegram); if($stmt_insert->execute()) { return true; } return false; } } function get_facebook_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'facebook' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } function get_twitter_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'twitter' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } function get_linked_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'linked in' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } function get_google_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'google+' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } function get_youtube_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'you tube' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } function get_telegram_link() { if($stmt_select = $this->con->prepare("Select `link` from `social_media` where `name` = 'telegram' ")) { $stmt_select->bind_result($result_link); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_link; } } return false; } } // function fetch_invoice_report_by_category_details_all($from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where `date` BETWEEN '$from_date' AND '$to_date' AND `status`='Pending' ")) { $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function dispatch_product($d_id) { if($stmt_insert = $this->con->prepare("UPDATE `user_checkout_details` SET `status`='Dispatch' WHERE `id`=? ")) { $stmt_insert->bind_param("i",$d_id); if($stmt_insert->execute()) { return true; } return false; } } function pending_product($d_id) { if($stmt_insert = $this->con->prepare("UPDATE `user_checkout_details` SET `status`='Pending' WHERE `id`=? ")) { $stmt_insert->bind_param("i",$d_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_all_dispatch_product_info_by_t_id($t_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status`, `date`, `time`, `actual_price`, `grams`,`unit` FROM `checkout_list` Where `transaction_id` = '".$t_id."' ")) { $stmt_insert->bind_result($id, $transaction_id, $seller_name, $product_id, $qty, $price, $status ,$date ,$time ,$actual_price ,$grams,$unit); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $details[$counter][7] = $date; $details[$counter][8] = $time; $details[$counter][9] = $actual_price; $details[$counter][10] = $grams; $details[$counter][11] = $unit; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_invoice_report_by_category_details_by_status($from_date,$to_date,$status) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where `date` BETWEEN '$from_date' AND '$to_date' AND `status`='".$status."' ")) { $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } //22-1-2021 function set_contact_data($name,$email_id,$contact_no,$message) { $date = date("Y-m-d"); $time = date("H:i:s"); if($stmt_set_contact_data = $this->con->prepare("insert into `contact_tbl`(`name`,`email_id`,`contact_no`,`message` ,`date`,`time`) Values(?,?,?,?,?,?)")) { $stmt_set_contact_data->bind_param("ssssss",$name,$email_id,$contact_no,$message,$date,$time); if($stmt_set_contact_data->execute()) { return true; } return false; } } function get_contact_details_all($from_date,$to_date) { $from_date = date("Y-m-d" , strtotime($from_date)); $to_date = date("Y-m-d" , strtotime($to_date)); if($stmt_insert = $this->con->prepare("SELECT `id`, `name`, `email_id`, `contact_no`, `message`, `date`, `time` FROM `contact_tbl` WHERE `date` BETWEEN '$from_date' AND '$to_date' ")) { $stmt_insert->bind_result($id,$full_name,$email,$contact_no,$message,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $email; $details[$counter][3] = $contact_no; $details[$counter][4] = $message; $details[$counter][5] = $date; $details[$counter][6] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_user_contact_record($del_id) { if($stmt_select = $this->con->prepare("Delete from `contact_tbl` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function add_feedback($name,$description,$feedback) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `feedback_tbl`( `name`, `description`, `feedback`, `date`, `time`) VALUES (?,?,?,?,?)")) { $stmt_insert->bind_param("sssss",$name,$description,$feedback,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_feedback() { if($stmt_insert = $this->con->prepare("SELECT `id`, `name`, `description`, `feedback`, `date`, `time` FROM `feedback_tbl`")) { $stmt_insert->bind_result($id,$name,$description,$feedback,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $description; $details[$counter][3] = $feedback; $details[$counter][4] = $date; $details[$counter][5] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_feedback($del_id) { if($stmt_select = $this->con->prepare("Delete from `feedback_tbl` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_feedback_details_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `name`, `description`, `feedback` FROM `feedback_tbl` WHERE `id`=?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$name,$description,$feedback); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $description; $details[$counter][3] = $feedback; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_feedback($name,$description,$feedback,$up_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("UPDATE `feedback_tbl` SET `name`=? ,`description`=? ,`feedback`=? WHERE `id`=?")) { $stmt_insert->bind_param("sssi",$name,$description,$feedback,$up_id); if($stmt_insert->execute()) { return true; } return false; } } //23-1-2020 function delete_order_product_info_from_user_checklist($del_id) { if($stmt_select = $this->con->prepare("Delete from `user_checkout_details` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_order_product_info_from_checklist($del_id) { if($stmt_select = $this->con->prepare("Delete from `checkout_list` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } //28-1-2020 NEW FUNCTIONS function add_what_new_images($advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `whats_new`(`images`,`date`,`time`) VALUES (?,?,?)")) { $stmt_insert->bind_param("sss",$advertise_picture,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_what_new_images() { if($stmt_insert = $this->con->prepare("SELECT `id`,`images` FROM `whats_new`")) { $stmt_insert->bind_result($id,$images); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_what_new_images($del_id) { if($stmt_select = $this->con->prepare("Delete from `whats_new` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function add_certified_images($links,$advertise_picture) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `certified`(`images`, `links` , `date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$links,$advertise_picture,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_certified_images() { if($stmt_insert = $this->con->prepare("SELECT `id`,`images`, `links` FROM `certified`")) { $stmt_insert->bind_result($id,$images,$links); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $images; $details[$counter][2] = $links; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_certified_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `certified` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_youtube_video($video_link,$video_message) { if($stmt_select = $this->con->prepare("update `youtube_video` set `link`=? ,`message` = ?")) { $stmt_select->bind_param("ss",$video_link,$video_message); if($stmt_select->execute()) { return true; } return false; } } function get_all_youtube_video() { if($stmt_select = $this->con->prepare("SELECT `link`, `message` FROM `youtube_video`")) { $stmt_select->bind_result($link,$message); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $link; $data[1] = $message; return $data; } } return false; } } function insert_user_registrtion($u_name,$email,$gender,$dob,$mobile_no,$pasword) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `user_registration`(`u_name`, `email`, `gender`, `dob`, `mobile_no`, `pasword`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssss",$u_name,$email,$gender,$dob,$mobile_no,$pasword,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_registered_users($u_name,$email,$gender,$dob,$mobile_no,$pasword) { if($stmt_insert = $this->con->prepare("SELECT `id`, `u_name`, `email`, `gender`, `dob`, `mobile_no`, `pasword`, `date`, `time` FROM `user_registration` ")) { $stmt_insert->bind_result($id,$u_name,$email,$gender,$dob,$mobile_no,$pasword,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $u_name; $details[$counter][2] = $email; $details[$counter][3] = $gender; $details[$counter][4] = $dob; $details[$counter][5] = $mobile_no; $details[$counter][6] = $pasword; $details[$counter][7] = $date; $details[$counter][8] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_registered_user_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `user_registration` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function user_login($email,$password) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `login_users`(`email`, `password`, `date`, `time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$email,$password,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_user_password($email) { if ($stmt = $this->con->prepare("SELECT `pasword` from `user_registration` where `email`=? ")) { $stmt->bind_param("s",$email); $stmt->bind_result($password); if ($stmt->execute()) { if ($stmt->fetch()) { return $password; } else { return false; } } } } function get_password_user_mail($email) { if($stmt_select = $this->con->prepare("Select `pasword` from `user_registration` where `email` = ? ")) { $stmt_select->bind_param("s",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function change_password($email,$newpassword) { $date = date("Y-m-d"); $time = date("H:i:s A"); echo 11111; if($stmt_select = $this->con->prepare("UPDATE `user_registration` SET `pasword`=? WHERE `email`=?")) { echo 222222; $stmt_select->bind_param("ss",$newpassword,$email); if($stmt_select->execute()) { echo 3333; return true; } return false; } } function order_history($emails) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount`, `status` FROM `user_checkout_details` Where `email`=?")) { $stmt_insert->bind_param("s",$emails); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][8] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } // functions of print orders function get_customer_details($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount`,`date`,`time` FROM `user_checkout_details` Where `id`=?")) { $stmt_insert->bind_param("s",$up_id); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][6] = $date; $details[$counter][7] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_customer_details_all($order_from,$order_to) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount`,`date`,`time` FROM `user_checkout_details` Where (`id` BETWEEN ? AND ?)")) { $stmt_insert->bind_param("ii",$order_from,$order_to); $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][6] = $date; $details[$counter][7] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_all_dispatch_product_info_by_t_id_all($up_id) { if ($stmt_insert = $this->con->prepare("SELECT `id`, `transaction_id`, `seller_name`, `product_id`, `qty`, `price`, `status`, `date`, `time`, `actual_price`, `grams`,`unit` FROM `checkout_list` WHERE `transaction_id` = ?")) { $stmt_insert->bind_param("i", $up_id); $stmt_insert->bind_result($id, $transaction_id, $seller_name, $product_id, $qty, $price, $status ,$date ,$time ,$actual_price ,$grams,$unit); if ($stmt_insert->execute()) { $counter = 0; $details = array(); while ($stmt_insert->fetch()) { // if ($grams >= 1000) { // $converted_grams = $grams / 1000; // $weight_display = $converted_grams . " kg"; // } else { // $weight_display = $grams . " gm"; // } $details[$counter][0] = $id; $details[$counter][1] = $transaction_id; $details[$counter][2] = $seller_name; $details[$counter][3] = $product_id; $details[$counter][4] = $qty; $details[$counter][5] = $price; $details[$counter][6] = $status; $details[$counter][7] = $date; $details[$counter][8] = $time; $details[$counter][9] = $actual_price; $details[$counter][10] = $grams; $details[$counter][11] = $unit; $counter++; } if (!empty($details)) { return $details; } return false; } } } // function fetch_invoice_report_by_category_details_by_status_for_search($from_date,$to_date,$status,$order_from,$order_to,$c_name,$c_contact) // { // if (empty($order_from) && empty($order_to)) { // $order_stmt = ""; // } else { // $order_stmt = "AND (`id` BETWEEN ? AND ?)"; // } // $c_name_stmt = ""; // if($c_name!="") // { // $c_name_stmt = "AND `full_name` LIKE '%".$c_name."%'"; // } // $mobile_number_statement = ""; // if($c_contact!="") // { // $mobile_number_statement = "AND `contact_no` LIKE '%".$c_contact."%'"; // } // if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `address`, `contact_no`, `email`, `total_amount` FROM `user_checkout_details` Where (`date` BETWEEN ? AND ?) AND `status`='$status'".$c_name_stmt.$mobile_number_statement)) // { // $stmt_insert->bind_param("ssss",$from_date,$to_date,$order_from,$order_to); // $stmt_insert->bind_result($id,$full_name,$address,$contact_no,$email,$total_amount); // if($stmt_insert->execute()) // { // $counter = 0; // $details = array(); // while($stmt_insert->fetch()) // { // $details[$counter][0] = $id; // $details[$counter][1] = $full_name; // $details[$counter][2] = $address; // $details[$counter][3] = $contact_no; // $details[$counter][4] = $email; // $details[$counter][5] = $total_amount; // $counter++; // } // if(!empty($details)) // { // return $details; // } // return false; // } // } // } function fetch_invoice_report_by_category_details_by_status_for_search($from_date, $to_date, $status, $order_from, $order_to, $c_name, $c_contact) { if (empty($order_from) && empty($order_to)) { $order_stmt = ""; } else { $order_stmt = "AND (`id` BETWEEN ? AND ?)"; } $c_name_stmt = ""; if($c_name != "") { $c_name_stmt = "AND `full_name` LIKE '%" . $c_name . "%'"; } $mobile_number_statement = ""; if($c_contact != "") { $mobile_number_statement = "AND `contact_no` LIKE '%" . $c_contact . "%'"; } if ($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `address`, `contact_no`, `email`, `total_amount`,`date`,`time` FROM `user_checkout_details` WHERE (`date` BETWEEN ? AND ?) AND `status` = ? " . $order_stmt . $c_name_stmt . $mobile_number_statement)) { if (!empty($order_from) && !empty($order_to)) { $stmt_insert->bind_param("sssss", $from_date, $to_date, $status, $order_from, $order_to); } else { $stmt_insert->bind_param("sss", $from_date, $to_date, $status); } $stmt_insert->bind_result($id, $full_name, $address, $contact_no, $email, $total_amount,$date,$time); if ($stmt_insert->execute()) { $counter = 0; $details = array(); while ($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][6] = $date; $details[$counter][7] = $time; $counter++; } if (!empty($details)) { return $details; } return false; } } } function carrier_entery($full_name,$mobile_no,$message,$applying_for) { $current_date = date("Y-m-d"); $current_time = date("H:i:s A"); if($stmt = $this->con->prepare("INSERT INTO `carrier_table`( `full_name`, `mobile_no`, `message`, `applying_for`, `current_date`, `current_time`) VALUES (?,?,?,?,?,?)"))//connection used and prepare by query $stmt->bind_param("ssssss",$full_name,$mobile_no,$message,$applying_for,$current_date,$current_time);//text=s,int=i if($stmt->execute()) { return true; echo "Connected successfully"; } else { return false; } } function get_carrier_user_report() { if($stmt = $this->con->prepare("SELECT `id`, `full_name`,`mobile_no`, `message`, `applying_for`, `current_date`, `current_time` FROM `carrier_table`")){//connection used and prepare by query $stmt->bind_result($res_id,$res_full_name,$res_mobile_no,$res_message,$res_applying_for,$res_current_date,$res_current_time);//text=s,int=i if($stmt->execute()) { $data = array(); $counter = 0; // Initialize a counter while($stmt->fetch()) { $data[$counter]['id'] = $res_id; $data[$counter]['full_name'] = $res_full_name; $data[$counter]['mobile_no'] = $res_mobile_no; $data[$counter]['message' ] = $res_message ; $data[$counter]['applying_for'] = $res_applying_for; $data[$counter]['date'] = $res_current_date; $data[$counter]['time'] = $res_current_time; $counter++; } if(!empty($data)) { return $data; } else { return false; } } } } function delete_carrier_user_record($del_id) { if($stmt = $this->con->prepare("Delete from `carrier_table` where `id`=?")) { $stmt->bind_param("i",$del_id); if($stmt->execute()) { return true; } else{ return false; } } } function get_exist_code_for_update($contact_no) { if ($stmt_select = $this->con->prepare("SELECT `contact_no` FROM `users` WHERE `contact_no` = ?")) { $stmt_select->bind_param("s", $contact_no); $stmt_select->bind_result($result_id); if ($stmt_select->execute()) { if ($stmt_select->fetch()) { return $result_id; } } return false; } return false; } function user_update_details($full_name, $address, $contact_no, $user_email, $pin, $latitude, $longitude) { // echo $pin, $latitude, $longitude; if ($stmt_insert = $this->con->prepare("UPDATE `users` SET `full_name` = ?, `address` = ?, `contact_no` = ?, `email` = ?, `pin_code` = ?, `latitude` = ?, `longitude` = ? WHERE `contact_no` = ?")) { $stmt_insert->bind_param("ssssssss", $full_name, $address, $contact_no, $user_email, $pin, $latitude, $longitude, $contact_no); if ($stmt_insert->execute()) { return true; } else { return false; } } return false; } function get_product_name_by_id($product_id) { if($stmt_select = $this->con->prepare("Select `product_name` from `products` where `id` = ? ")) { $stmt_select->bind_param("i",$product_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function get_counter_data() { if($stmt_select = $this->con->prepare("Select `count_no` from `visiter_counter` ")) { $stmt_select->bind_result($count_no); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $count_no; } } return false; } } function update_conter_number() { if($stmt = $this->con->prepare("UPDATE `visiter_counter` SET `count_no` = `count_no`+1 ")) { if($stmt->execute()) { return true; }else { return false; } return false; } } function get_product_actual_price($p_id) { if($stmt_select = $this->con->prepare("SELECT `actual_price` FROM `products` where `id`=?")) { $stmt_select->bind_param("s",$p_id); $stmt_select->bind_result($address,$phone,$email_id); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $address; $data[1] = $phone; $data[2] = $email_id; return $data; } } return false; } } function get_product_selling_price($p_id) { if($stmt_select = $this->con->prepare("SELECT `selling_price` FROM `products` where `id`=?")) { $stmt_select->bind_param("s",$p_id); $stmt_select->bind_result($address,$phone,$email_id); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $address; $data[1] = $phone; $data[2] = $email_id; return $data; } } return false; } } function add_location($city,$pincode,$description){ $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt = $this->con->prepare("INSERT INTO `application_location`(`city`, `pincode`, `description`, `date`, `time`) VALUES (?,?,?,?,?)")){ $stmt->bind_param("sssss",$city,$pincode,$description,$date,$time); if($stmt->execute()){ return true; } return false; } } function get_all_location() { if($stmt_insert = $this->con->prepare("SELECT `id`,`city`, `pincode`, `description` FROM `application_location` ")) { $stmt_insert->bind_result($id,$city,$pincode,$description); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $city; $details[$counter][2] = $pincode; $details[$counter][3] = $description; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_location_info($id){ if($stmt = $this->con->prepare("SELECT `id`,`city`,`pincode`,`description` FROM `application_location` WHERE `id` = ?")){ $stmt->bind_param("i",$id); $stmt->bind_result($id,$city,$pincode,$description); if($stmt->execute()){ $arr = array(); $count = 0; if($stmt->fetch()){ $arr[0] = $id; $arr[1] = $city; $arr[2] = $pincode; $arr[3] = $description; return $arr; } } return false; } } function update_location($id,$city,$pincode,$description){ if($stmt = $this->con->prepare("UPDATE `application_location` SET `city`=?,`pincode`=?,`description`=? WHERE `id` = ?")){ $stmt->bind_param("sssi",$city,$pincode,$description,$id); if($stmt->execute()){ return true; } return false; } } function delete_location($id){ if($stmt = $this->con->prepare("DELETE FROM `application_location` WHERE `id` = ?")){ $stmt->bind_param("i",$id); if($stmt->execute()){ return true; } return false; } } function check_isexit_pincode($pin) { if($stmt_select = $this->con->prepare("Select `pincode` from `application_location` where `pincode` = ?")) { $stmt_select->bind_param("s",$pin); $stmt_select->bind_result($result_data); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_data; } } return false; } } function get_emp_code_exist_from_agent($user_id) { if($stmt_select = $this->con->prepare("Select `id` from `delivery_boy_data` where `user_id` = ? ")) { $stmt_select->bind_param("s",$user_id); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function add_new_deliveryt_boy($full_name, $user_id, $email, $contact, $address, $password, $other, $profile) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `delivery_boy_data`(`full_name`, `user_id`, `email`, `contact`, `address`, `password`, `other`, `profile`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$full_name, $user_id, $email, $contact, $address, $password, $other, $profile, $date , $time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_delivery_boy_data() { if($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `user_id`, `email`, `contact`, `address`, `password`, `other`, `profile`, `date`, `time` FROM `delivery_boy_data` ")) { $stmt_insert->bind_result($id, $full_name, $user_id, $email, $contact, $address, $password, $other, $profile, $date, $time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $user_id; $details[$counter][3] = $email; $details[$counter][4] = $contact; $details[$counter][5] = $address; $details[$counter][6] = $password; $details[$counter][7] = $other; $details[$counter][8] = $profile; $details[$counter][9] = $date; $details[$counter][10] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_delivery_boy($delete_id) { if($stmt_select = $this->con->prepare("DELETE FROM `delivery_boy_data` WHERE `id`=?")) { $stmt_select->bind_param("i",$delete_id); if($stmt_select->execute()) { return true; } return false; } } function get_delivery_data_from_id($res_edit_id) { if($stmt = $this->con->prepare("SELECT `id`, `full_name`, `user_id`, `email`, `contact`, `address`, `password`, `other`, `profile`, `date`, `time` FROM `delivery_boy_data` WHERE `id`=?")) { $stmt->bind_param("i",$res_edit_id); $stmt->bind_result($res_id, $full_name, $user_id, $email, $contact, $address, $password, $other, $profile, $date,$time); if($stmt->execute()) { $users_data = array(); $counter = 0; } while($stmt->fetch()) { $users_data['id'] = $res_id; $users_data['full_name'] = $full_name; $users_data['user_id'] = $user_id; $users_data['email'] = $email; $users_data['contact'] = $contact; $users_data['address'] = $address; $users_data['password'] = $password; $users_data['other'] = $other; $users_data['profile'] = $profile; $users_data['date'] = $date; $users_data['time'] = $time; } if(!empty($users_data)) { return $users_data; } else { return false; } } } function update_delivery_record($full_name,$user_id,$email,$contact,$address,$password,$other,$res_edit_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("UPDATE `delivery_boy_data` SET `full_name`=?,`user_id`=?,`email`=?,`contact`=?,`address`=?,`password`=?,`other`=?,`date`=?,`time`=? where `id`=? ")) { $stmt_insert->bind_param("sssssssssi",$full_name,$user_id,$email,$contact,$address,$password,$other,$date,$time,$res_edit_id); if($stmt_insert->execute()) { return true; } return false; } } function get_id_from_db($email) { if ($stmt_select = $this->con->prepare("SELECT `id` FROM `delivery_boy_data` WHERE `user_id` = ?")) { $stmt_select->bind_param("s", $email); if ($stmt_select->execute()) { $stmt_select->bind_result($result_id); if ($stmt_select->fetch()) { $stmt_select->close(); return $result_id; } } $stmt_select->close(); return false; } return false; } function get_name_from_by_d_id($email) { if ($stmt_select = $this->con->prepare("SELECT `full_name` FROM `delivery_boy_data` WHERE `id` = ?")) { $stmt_select->bind_param("s", $email); if ($stmt_select->execute()) { $stmt_select->bind_result($result_id); if ($stmt_select->fetch()) { $stmt_select->close(); return $result_id; } } $stmt_select->close(); return false; } return false; } function GET_CUSTOMER_DETAILS_FOR_LOGIN($user_id) { if($stmt_select = $this->con->prepare("Select `password` from `delivery_boy_data` where `user_id` = ? ")) { $stmt_select->bind_param("s",$user_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function add_deliveryt_boy_orders_list($delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `delivery_boy_orders_list`(`delivery_boy_id`, `order_id`, `order_picked_date`, `order_picked_time`, `delivery_status`, `delivery_status_date`, `delivery_status_time`, `order_delivery_payment`, `order_delivery_payment_status`, `order_delivery_payment_status_date`, `order_delivery_payment_status_time`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssss",$delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_delivery_boy_orders_list() { if($stmt_insert = $this->con->prepare("SELECT `id`, `delivery_boy_id`, `order_id`, `order_picked_date`, `order_picked_time`, `delivery_status`, `delivery_status_date`, `delivery_status_time`, `order_delivery_payment`, `order_delivery_payment_status`, `order_delivery_payment_status_date`, `order_delivery_payment_status_time`, `date`, `time` FROM `delivery_boy_orders_list` ")) { $stmt_insert->bind_result($id,$delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $delivery_boy_id; $details[$counter][2] = $order_id; $details[$counter][3] = $order_picked_date; $details[$counter][4] = $order_picked_time; $details[$counter][5] = $delivery_status; $details[$counter][6] = $delivery_status_date; $details[$counter][7] = $delivery_status_time; $details[$counter][8] = $order_delivery_payment; $details[$counter][9] = $order_delivery_payment_status; $details[$counter][10] = $order_delivery_payment_status_date; $details[$counter][11] = $order_delivery_payment_status_time; $details[$counter][12] = $date; $details[$counter][13] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_delivery_boy_order_list_isexist($order_id) { if($stmt_select = $this->con->prepare("Select `order_id` from `delivery_boy_orders_list` where `order_id` = ? ")) { $stmt_select->bind_param("s",$order_id); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_all_delivery_boy_orders_list_pending($email) { if($stmt_insert = $this->con->prepare("SELECT `id`, `delivery_boy_id`, `order_id`, `order_picked_date`, `order_picked_time`, `delivery_status`, `delivery_status_date`, `delivery_status_time`, `order_delivery_payment`, `order_delivery_payment_status`, `order_delivery_payment_status_date`, `order_delivery_payment_status_time`, `date`, `time` FROM `delivery_boy_orders_list` where `delivery_boy_id`=? AND `delivery_status`='Pending'")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $delivery_boy_id; $details[$counter][2] = $order_id; $details[$counter][3] = $order_picked_date; $details[$counter][4] = $order_picked_time; $details[$counter][5] = $delivery_status; $details[$counter][6] = $delivery_status_date; $details[$counter][7] = $delivery_status_time; $details[$counter][8] = $order_delivery_payment; $details[$counter][9] = $order_delivery_payment_status; $details[$counter][10] = $order_delivery_payment_status_date; $details[$counter][11] = $order_delivery_payment_status_time; $details[$counter][12] = $date; $details[$counter][13] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function change_status_as_delivered($del_id, $order_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); $d_boy_payment=10; if($stmt_insert = $this->con->prepare("Update `delivery_boy_orders_list` set `delivery_status` = 'Completed',`delivery_status_date`=?,`delivery_status_time`=?,`order_delivery_payment`=? Where `delivery_boy_id` = ? AND `order_id`=?")) { $stmt_insert->bind_param("sssss",$date,$time,$d_boy_payment,$del_id,$order_id); if($stmt_insert->execute()) { return true; } return false; } } function change_status_as_incompleted($del_id, $order_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("Update `delivery_boy_orders_list` set `delivery_status` = 'Pending',`delivery_status_date`=?,`delivery_status_time`=? Where `delivery_boy_id` = ? AND `order_id`=?")) { $stmt_insert->bind_param("ssss",$date,$time,$del_id, $order_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_delivery_boy_orders_list_completed($email,$from_date,$to_daate) { if($stmt_insert = $this->con->prepare("SELECT `id`, `delivery_boy_id`, `order_id`, `order_picked_date`, `order_picked_time`, `delivery_status`, `delivery_status_date`, `delivery_status_time`, `order_delivery_payment`, `order_delivery_payment_status`, `order_delivery_payment_status_date`, `order_delivery_payment_status_time`, `date`, `time` FROM `delivery_boy_orders_list` where `delivery_boy_id`=? AND `delivery_status`='Completed' AND (`delivery_status_date` between ? AND ?)")) { $stmt_insert->bind_param("sss",$email,$from_date,$to_daate); $stmt_insert->bind_result($id,$delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $delivery_boy_id; $details[$counter][2] = $order_id; $details[$counter][3] = $order_picked_date; $details[$counter][4] = $order_picked_time; $details[$counter][5] = $delivery_status; $details[$counter][6] = $delivery_status_date; $details[$counter][7] = $delivery_status_time; $details[$counter][8] = $order_delivery_payment; $details[$counter][9] = $order_delivery_payment_status; $details[$counter][10] = $order_delivery_payment_status_date; $details[$counter][11] = $order_delivery_payment_status_time; $details[$counter][12] = $date; $details[$counter][13] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_invoice_report_by_category_details_by_status_for_search_d($status) { if ($stmt_insert = $this->con->prepare("SELECT `id`, `full_name`, `address`, `contact_no`, `email`, `total_amount`, `date`, `time`,`latitude`,`longitude` FROM `user_checkout_details` WHERE `date` = CURDATE() AND `status` = ?")) { $stmt_insert->bind_param("s", $status); if ($stmt_insert->execute()) { $stmt_insert->bind_result($id, $full_name, $address, $contact_no, $email, $total_amount, $date, $time,$latitude,$longitude); $details = array(); $counter = 0; while ($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $address; $details[$counter][3] = $contact_no; $details[$counter][4] = $email; $details[$counter][5] = $total_amount; $details[$counter][6] = $date; $details[$counter][7] = $time; $details[$counter][8] = $latitude; $details[$counter][9] = $longitude; $counter++; } $stmt_insert->close(); if (!empty($details)) { return $details; } else { return false; } } else { // Query execution failed return false; } } else { // SQL preparation failed return false; } } function get_order_selected($email) { if ($stmt_select = $this->con->prepare("SELECT `order_id` FROM `delivery_boy_orders_list` WHERE `order_id` = ?")) { $stmt_select->bind_param("s", $email); if ($stmt_select->execute()) { $stmt_select->bind_result($order_id); $order_ids = []; while ($stmt_select->fetch()) { $order_ids[] = $order_id; } return $order_ids; } $stmt_select->close(); } return []; } function delete_delivery_accepted_order($del_id) { if($stmt_select = $this->con->prepare("Delete from `delivery_boy_orders_list` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_product_price($up_id, $update_price) { if ($stmt_insert = $this->con->prepare("UPDATE `products` SET `selling_price` = ? WHERE `id` = ?")) { $stmt_insert->bind_param("si", $update_price, $up_id); if ($stmt_insert->execute()) { // echo "Updated product ID: $up_id with price: $update_price<br>"; return true; } return false; } } function update_product_sr_no($up_id, $sr_no) { if ($stmt = $this->con->prepare("UPDATE `products` SET `sr_no` = ? WHERE `id` = ?")) { $stmt->bind_param("si", $sr_no, $up_id); if ($stmt->execute()) { return true; } return false; } } function update_product_actual_price($up_id, $actual_price) { if ($stmt = $this->con->prepare("UPDATE `products` SET `actual_price` = ? WHERE `id` = ?")) { $stmt->bind_param("di", $actual_price, $up_id); if ($stmt->execute()) { return true; } return false; } } function get_picked_order_d_boy_id($email) { if ($stmt_select = $this->con->prepare("SELECT `delivery_boy_id` FROM `delivery_boy_orders_list` WHERE `order_id` = ?")) { $stmt_select->bind_param("s", $email); if ($stmt_select->execute()) { $stmt_select->bind_result($delivery_boy_id); $delivery_boy_ids = []; while ($stmt_select->fetch()) { $delivery_boy_ids[] = $delivery_boy_id; } return $delivery_boy_ids; } $stmt_select->close(); } return []; } function get_picked_order_d_boy_name($picked_order_d_id) { if ($stmt_select = $this->con->prepare("SELECT `full_name` FROM `delivery_boy_data` WHERE `id` = ?")) { $stmt_select->bind_param("s", $picked_order_d_id); if ($stmt_select->execute()) { $stmt_select->bind_result($full_name); // Bind the correct result $names = []; while ($stmt_select->fetch()) { $names[] = $full_name; // Collect the names in the array } return $names; } $stmt_select->close(); } return []; } function get_product_details_by_id($order_id) { if($stmt_select = $this->con->prepare("Select `address` from `user_checkout_details` where `id` = ? ")) { $stmt_select->bind_param("i",$order_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function get_all_delivery_boy_orders_list_completed_of_payment($email,$from_date,$to_daate) { if($stmt_insert = $this->con->prepare("SELECT `id`, `delivery_boy_id`, `order_id`, `order_picked_date`, `order_picked_time`, `delivery_status`, `delivery_status_date`, `delivery_status_time`, `order_delivery_payment`, `order_delivery_payment_status`, `order_delivery_payment_status_date`, `order_delivery_payment_status_time`, `date`, `time` FROM `delivery_boy_orders_list` where `delivery_boy_id`=? AND `delivery_status`='Completed' AND (`delivery_status_date` between ? AND ?)")) { $stmt_insert->bind_param("sss",$email,$from_date,$to_daate); $stmt_insert->bind_result($id,$delivery_boy_id, $order_id, $order_picked_date, $order_picked_time, $delivery_status, $delivery_status_date, $delivery_status_time, $order_delivery_payment,$order_delivery_payment_status,$order_delivery_payment_status_date,$order_delivery_payment_status_time,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $delivery_boy_id; $details[$counter][2] = $order_id; $details[$counter][3] = $order_picked_date; $details[$counter][4] = $order_picked_time; $details[$counter][5] = $delivery_status; $details[$counter][6] = $delivery_status_date; $details[$counter][7] = $delivery_status_time; $details[$counter][8] = $order_delivery_payment; $details[$counter][9] = $order_delivery_payment_status; $details[$counter][10] = $order_delivery_payment_status_date; $details[$counter][11] = $order_delivery_payment_status_time; $details[$counter][12] = $date; $details[$counter][13] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_product_buyer_name_by_id($order_id) { if($stmt_select = $this->con->prepare("Select `full_name` from `user_checkout_details` where `id` = ? ")) { $stmt_select->bind_param("i",$order_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } function get_product_contact_no_by_id($order_id) { if($stmt_select = $this->con->prepare("Select `contact_no` from `user_checkout_details` where `id` = ? ")) { $stmt_select->bind_param("i",$order_id); $stmt_select->bind_result($result_image); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_image; } } return false; } } }//end ?>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4