Şuanki Dizin: /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety-7-12-2024/lib/ |
Şuanki Dosya : /home/wwwdreamtechnolo/www/vahtuksanghatana.com/ssociety-7-12-2024/lib/function.php |
<?php date_default_timezone_set("Asia/Kolkata"); // session_start(); // class login_function { // private $con; function __construct() { //$this->con = new mysqli("localhost","root","","bird_group_presents"); $this->con = new mysqli("localhost","root","","bravemy8_birdsgroup"); mysqli_set_charset($this->con, 'utf8'); } function update_make_payment_report($update_id,$payment_date,$payment_type,$amount,$description) { if($stmt_insert = $this->con->prepare("UPDATE `make_payment` SET `payment_date` = ?, `payment_type` = ?, `amount` = ? , `description`=? WHERE `id` = ?")) { $stmt_insert->bind_param("ssssi",$payment_date,$payment_type,$amount,$description,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function update_note_for_invoice($note_notice,$update_id) { echo $note_notice,$update_id; $date = date("Y-m-d"); $time = date("H-i-s A"); $other_details = ""; if($stmt_insert = $this->con->prepare("UPDATE `invoice` SET `invoice_note`=?,`other_details`=? WHERE `id`=?")) { $stmt_insert->bind_param("ssi",$note_notice,$other_details,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function create_services($service) { if($stmt_select = $this->con->prepare("INSERT INTO `services`(`services`) VALUES (?)")) { $stmt_insert->bind_param("s",$service); if($stmt_insert->execute()) { return true; } return false; } } function get_password_from_user_name($mobile_no) { if($stmt_select = $this->con->prepare("Select `password` from `staff` where `mobile_no` = ? ")) { $stmt_select->bind_param("s",$mobile_no); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_registered_contact_no_stud($contact_no) { if($stmt_select = $this->con->prepare("Select `id` from `internship_students` where `primary_contact_no` = ? AND `logo`='Online Auto Registration'")) { $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; } } function get_max_certificate_id() { if($stmt_select = $this->con->prepare("Select MAX(`certificate_id`) from `internship_students`")) { $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_password_from_email_id($email) { if($stmt_select = $this->con->prepare("Select `password` from `ca` where `ca_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 get_existing_print_id($id) { if($stmt_select = $this->con->prepare("Select `certificate_id` from `internship_students` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function new_customer($name,$shop_name,$c_email,$address,$primary_contact,$other_contact,$logo,$password) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `customers`(`name`, `office_name`,`email`, `address`, `primary_contact_no`,`other_contact_no` ,`logo`, `password`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$name,$shop_name,$c_email,$address,$primary_contact,$other_contact,$logo,$password,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function new_internship_student($name,$shop_name,$c_email,$address,$primary_contact,$other_contact,$logo,$password) { $date = date("Y-m-d"); $time = date("H-i-s A"); $cert_id = 0; if($stmt_insert = $this->con->prepare("INSERT INTO `internship_students`(`name`, `office_name`,`email`, `address`, `primary_contact_no`,`other_contact_no` ,`logo`, `password`, `date`, `time`,`certificate_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssi",$name,$shop_name,$c_email,$address,$primary_contact,$other_contact,$logo,$password,$date,$time,$cert_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_user_information() { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers`")) { $stmt_insert->bind_result($id,$name,$office_name,$email,$address,$primary_contact_no,$other_contact_no,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $office_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact_no; $details[$counter][6] = $other_contact_no; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_interns_student_information() { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `internship_students`")) { $stmt_insert->bind_result($id,$name,$office_name,$email,$address,$primary_contact_no,$other_contact_no,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $office_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact_no; $details[$counter][6] = $other_contact_no; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_update_details() { if($stmt_insert= $this->con->prepare("SELECT `id`, `customer_name`, `dob`, `contact_no`, `date`, `time` FROM `update_customer`")) { $stmt_insert->bind_result($id,$name,$dob,$contact_no,$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] = $dob; $details[$counter][3] = $contact_no; $details[$counter][4] = $date; $details[$counter][5] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_product_info($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_intern_info_from_id($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password`,`date`,`certificate_id` FROM `internship_students` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password,$date,$certificate_id); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $details[$counter][9] = $date; $details[$counter][10] = $certificate_id; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_customer_info($select_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$select_id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_contact($contact_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_name`, `dob`, `contact_no`, `date`, `time` FROM `update_customer` WHERE `id`=?")) { $stmt_insert->bind_param("i",$contact_id); $stmt_insert->bind_result($id,$customer_name,$dob,$mobile_no,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $dob; $details[$counter][3] = $mobile_no; $details[$counter][4] = $date; $details[$counter][5] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_product_information($up_id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `customers` set `name`= ?,`office_name`= ?,`email`=?,`address`= ?,`primary_contact_no`= ? ,`other_contact_no` = ?,`password` = ? where `id` = ?")) { $stmt_select->bind_param("sssssssi",$name,$shop_name,$email,$address,$primary_contact,$other_contact,$password,$up_id); if($stmt_select->execute()) { return true; } return false; } } function update_max_certificate_id($update_certificate_id,$i_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `internship_students` set `certificate_id`= ? where `id` = ?")) { $stmt_select->bind_param("ii",$update_certificate_id,$i_id); if($stmt_select->execute()) { return true; } return false; } } function update_customer_information($customer_name,$dob,$mobile_no) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("INSERT INTO `update_customer`(`customer_name`, `dob`, `contact_no`, `date`, `time`) VALUES (?,?,?,?,?)")) { $stmt_select->bind_param("sssss",$customer_name,$dob,$mobile_no,$date,$time); if($stmt_select->execute()) { return true; } return false; } } function update_contact_info($customer_name,$dob,$mobile_no,$contact_id) { $date = date("Y-m-d"); $time = date("H:i:s"); if($stmt_insert = $this->con->prepare("UPDATE `update_customer` SET `customer_name`=?,`dob`=?,`contact_no`=?,`date`=?,`time`=? WHERE `id`=?")) { $stmt_insert->bind_param("sssssi",$customer_name,$dob,$mobile_no,$date,$time,$contact_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_user_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `customers` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_interns_student_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `internship_students` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_customer($del_id) { if($stmt_select = $this->con->prepare("Delete from `update_customer` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function only_customers() { if($stmt_insert = $this->con->prepare("SELECT `id`, `name` FROM `customers`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function new_services($customer_name,$service,$p_name,$amount,$status,$description,$expiry_date) { $date = date("Y-m-d"); $time = date("H-i-s A"); $renewal_status = "-"; if($stmt_insert = $this->con->prepare("INSERT INTO `customer_services`(`customer_name`, `service`, `project_name`, `amount` ,`status`, `date`, `time`,`description`,`expiry_date`,`renewal_status`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$customer_name,$service,$p_name,$amount,$status,$date,$time,$description,$expiry_date,$renewal_status); if($stmt_insert->execute()) { return true; } return false; } } function get_all_service_information_for_renewal($one_year_before_date,$next_date) { echo $next_date; if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`status`,`description`,`expiry_date`,`renewal_status` FROM `customer_services` where `expiry_date` BETWEEN '$one_year_before_date' AND '$next_date'")) { $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$status,$description,$expiry_date,$renewal_status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $status; $details[$counter][6] = $description; $details[$counter][7] = $expiry_date; $details[$counter][8] = $renewal_status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function renewal_service_status($pen_id) { $renewal_status = "RENEWED"; if($stmt_select = $this->con->prepare("Update `customer_services` set `renewal_status`= ? where `id`=?")) { $stmt_select->bind_param("si",$renewal_status,$pen_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_service_information() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`status`,`description`,`expiry_date` FROM `customer_services`")) { $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$status,$description,$expiry_date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $status; $details[$counter][6] = $description; $details[$counter][7] = $expiry_date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_credentials() { if($stmt_select = $this->con->prepare("SELECT `id`, `full_name`, `link`, `user_id`, `password`, `key_cred`, `linked_email`, `linked_mob_no` FROM `credentials`")) { $stmt_select->bind_result($id,$full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no); if($stmt_select->execute()) { $counter = 0; $details = array(); while($stmt_select->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $link; $details[$counter][3] = $user_id; $details[$counter][4] = $password; $details[$counter][5] = $key_cred; $details[$counter][6] = $linked_email; $details[$counter][7] = $linked_mob_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_credentials_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `credentials` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_credentials($up_id,$full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `credentials` SET `full_name`= ?,`link`= ?,`user_id`=?,`password`= ?,`key_cred`= ? ,`linked_email` = ?,`linked_mob_no` = ? where `id` = ?")) { $stmt_select->bind_param("sssssssi",$full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no,$up_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_credentials_info($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `link`,`user_id`, `password`, `key_cred`, `linked_email`,`linked_mob_no` FROM `credentials` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $full_name; $details[$counter][2] = $link; $details[$counter][3] = $user_id; $details[$counter][4] = $password; $details[$counter][5] = $key_cred; $details[$counter][6] = $linked_email; $details[$counter][7] = $linked_mob_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_new_details_to_trading_transactions($variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `trading_transactions`(`variety`, `tradingsymbol`, `symboltoken`, `transactiontype`, `exchange`, `ordertype`, `producttype`, `duration`, `price`, `squareoff`, `stoploss`, `quantity`,`date`,`time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssssss",$variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_details_from_trading_transactions() { if($stmt_select = $this->con->prepare("SELECT `id`, `variety`, `tradingsymbol`, `symboltoken`, `transactiontype`, `exchange`, `ordertype`, `producttype`, `duration`, `price`, `squareoff`, `stoploss`, `quantity` FROM `trading_transactions`")) { $stmt_select->bind_result($id,$variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity); if($stmt_select->execute()) { $counter = 0; $details = array(); while($stmt_select->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $variety; $details[$counter][2] = $tradingsymbol; $details[$counter][3] = $symboltoken; $details[$counter][4] = $transactiontype; $details[$counter][5] = $exchange; $details[$counter][6] = $ordertype; $details[$counter][7] = $producttype; $details[$counter][8] = $duration; $details[$counter][9] = $price; $details[$counter][10] = $squareoff; $details[$counter][11] = $stoploss; $details[$counter][12] = $quantity; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_trading_transactions($up_id,$variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `trading_transactions` SET `variety`= ?,`tradingsymbol`= ?,`symboltoken`=?,`transactiontype`= ?,`exchange`= ? ,`ordertype` = ?,`producttype` = ?,`duration` = ?,`price` = ?,`squareoff` = ?,`stoploss` = ?,`quantity` = ? WHERE `id` = ?")) { $stmt_select->bind_param("ssssssssssssi",$variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity,$up_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_trading_transaction($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `variety`, `tradingsymbol`, `symboltoken`, `transactiontype`, `exchange`, `ordertype`, `producttype`, `duration`, `price`, `squareoff`, `stoploss`, `quantity` FROM `trading_transactions` WHERE `id`=?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$variety,$tradingsymbol,$symboltoken,$transactiontype,$exchange,$ordertype,$producttype,$duration,$price,$squareoff,$stoploss,$quantity); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $variety; $details[$counter][2] = $tradingsymbol; $details[$counter][3] = $symboltoken; $details[$counter][4] = $transactiontype; $details[$counter][5] = $exchange; $details[$counter][6] = $ordertype; $details[$counter][7] = $producttype; $details[$counter][8] = $duration; $details[$counter][9] = $price; $details[$counter][10] = $squareoff; $details[$counter][11] = $stoploss; $details[$counter][12] = $quantity; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_details_from_trading_transactions($del_id) { if($stmt_select = $this->con->prepare("DELETE from `trading_transactions` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_make_payment_details($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `invoice_id`, `payment_date`, `payment_type`, `amount`, `description` FROM `make_payment` WHERE `id`=?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$invoice_id,$payment_date,$payment_type,$amount,$description); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $invoice_id; $details[$counter][2] = $payment_date; $details[$counter][3] = $payment_type; $details[$counter][4] = $amount; $details[$counter][5] = $description; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_service_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `customer_services` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_service_info($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`description`,`expiry_date` FROM `customer_services` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$description,$expiry_date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $description; $details[$counter][6] = $expiry_date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_new_credentials($full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `credentials`(`full_name`, `link`, `user_id`, `password`, `key_cred`, `linked_email`, `linked_mob_no`,`date`,`time`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$full_name,$link,$user_id,$password,$key_cred,$linked_email,$linked_mob_no,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function update_service_information($up_id,$customer_name,$service,$p_name,$amount) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `customer_services` set `customer_name`= ?,`service`= ?,`project_name` = ?,`amount`= ? where `id` = ?")) { $stmt_select->bind_param("ssssi",$customer_name,$service,$p_name,$amount,$up_id); if($stmt_select->execute()) { return true; } return false; } } function add_ ($service) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `services`(`services`) VALUES (?)")) { $stmt_insert->bind_param("s",$service); if($stmt_insert->execute()) { return true; } return false; } } function only_services() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `services`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_service() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `services`")) { $stmt_insert->bind_result($id,$service); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_project_details() { if($stmt_insert=$this->con->prepare("SELECT `id`, `update_title`, `description`, `status`, `completed_by`, `date`, `time` FROM `save_project`")) { $stmt_insert->bind_result($id,$update_title,$description,$status,$completed_by,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $update_title; $details[$counter][2] = $description; $details[$counter][3] = $status; $details[$counter][4] = $completed_by; $details[$counter][5] = $date; $details[$counter][6] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_project_details_by_id($detail_id) { if($stmt_insert= $this->con->prepare("SELECT `id`, `update_title`, `description`, `status`, `completed_by`, `date`, `time` FROM `save_project` WHERE `id`=?")) { $stmt_insert->bind_param("i",$detail_id); $stmt_insert->bind_result($id,$update_title,$description,$status,$completed_by,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $update_title; $details[$counter][2] = $description; $details[$counter][3] = $status; $details[$counter][4] = $completed_by; $details[$counter][5] = $date; $details[$counter][6] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_project_details($update_title,$description,$detail_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); $status = "pending"; $completed_by = "-"; if($stmt_insert =$this->con->prepare("UPDATE `save_project` SET `update_title`=?,`description`=?,`status`=?,`completed_by`=?,`date`=?,`time`=? WHERE `id`=?")) { $stmt_insert->bind_param("ssssssi",$update_title,$description,$status,$completed_by,$date,$time,$detail_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_registration_record($delete_id) { if($stmt=$this->con->prepare("DELETE FROM `save_project` WHERE `id`=?")) { $stmt->bind_param("i",$delete_id); if($stmt->execute()) { return true; } else { return false; } } } function services($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `services` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$service); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $counter++; } if(!empty($details)) { return $details; } return false; } } } function updates_services($up_id,$service) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `services` set `services`= ? where `id` = ?")) { $stmt_select->bind_param("si",$service,$up_id); if($stmt_select->execute()) { return true; } return false; } } function delete_services($del_id) { if($stmt_select = $this->con->prepare("Delete from `services` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_amount($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`,`service`,`amount` FROM `customer_services` where `customer_name` = ?")) { $stmt_insert->bind_param("s",$id); $stmt_insert->bind_result($id,$customer_name,$service,$amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_service_name($service) { if($stmt_select = $this->con->prepare("Select `services` from `services` where `id` = ? ")) { $stmt_select->bind_param("i",$service); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function add_payment_info($service_no,$cust_id,$customer_name,$service,$service_name,$p_name,$amount,$sms,$email,$status) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `payment_report`(`services_id`,`cust_id`,`cust_name`, `service_no`, `service_name`,`project_name`,`paid_amount` ,`sms`,`email`, `status`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssss",$service_no,$cust_id,$customer_name,$service,$service_name,$p_name,$amount,$sms,$email,$status,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_payment_information($c_name,$date_to,$date_from,$service) { if($service=="select") { $service =""; } if($stmt_insert = $this->con->prepare("SELECT `id`, `services_id`, `cust_id`, `cust_name`, `service_no`, `service_name`,`project_name`, `opening_amount`, `paid_amount`, `bal_amount`,`status`, `date`, `time` FROM `payment_report` WHERE `cust_name` LIKE '%$c_name%' AND `date` BETWEEN '$date_from' AND '$date_to' AND `service_name` LIKE '%$service%'")) { $stmt_insert->bind_result($id,$services_id,$cust_id,$cust_name,$service_no,$service_name,$p_name,$opening_amount,$paid_amount,$bal_amount,$status,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $services_id; $details[$counter][2] = $cust_id; $details[$counter][3] = $cust_name; $details[$counter][4] = $service_no; $details[$counter][5] = $service_name; $details[$counter][6] = $p_name; $details[$counter][7] = $opening_amount; $details[$counter][8] = $paid_amount; $details[$counter][9] = $bal_amount; $details[$counter][10] = $status; $details[$counter][11] = $date; $details[$counter][12] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_payment_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `payment_report` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_cust_name($customer_name) { if($stmt_select = $this->con->prepare("Select `name` from `customers` where `id` = ? ")) { $stmt_select->bind_param("i",$customer_name); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function fetch_cust_id($customer_name) { if($stmt_select = $this->con->prepare("Select `id` from `customers` where `name` = ? ")) { $stmt_select->bind_param("s",$customer_name); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function fetch_service_name_by_id($service_id) { if($stmt_select = $this->con->prepare("Select `services` from `services` where `id` = ? ")) { $stmt_select->bind_param("s",$service_id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function fetch_service_no_by_cust_id($cust_id,$service) { if($stmt_select = $this->con->prepare("Select `id` from `customer_services` where `customer_name` = ? AND `service` = ?")) { $stmt_select->bind_param("ss",$cust_id,$service); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_notice_comment_of_invoice($id) { if($stmt_select = $this->con->prepare("Select `invoice_note` from `invoice` where `id` = ?")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_note); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_note; } } return false; } } function add_expenses($expenses,$amount) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `expenses_mgt`(`expenses`,`amount`,`date`,`time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$expenses,$amount,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_expenses($title,$date_from,$date_to) { if($stmt_insert = $this->con->prepare("SELECT `id`,`expenses`,`amount`,`date` FROM `expenses_mgt` Where `expenses` LIKE '%$title%' AND `date` BETWEEN '$date_from' AND '$date_to'")) { $stmt_insert->bind_result($id,$expenses,$amount,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $expenses; $details[$counter][2] = $amount; $details[$counter][3] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_expenses($del_id) { if($stmt_select = $this->con->prepare("Delete from `expenses_mgt` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_exepense_data($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`expenses`,`amount`,`date` FROM `expenses_mgt` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$expenses,$amount,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $expenses; $details[$counter][2] = $amount; $details[$counter][3] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_expenses($up_id,$title,$amount) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `expenses_mgt` set `expenses`= ?,`amount`= ? where `id` = ?")) { $stmt_select->bind_param("ssi",$title,$amount,$up_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_services($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `service` FROM `customer_services` Where `customer_name` =?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$services); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $services; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_cutomer_id_from_invoice($invoice_id) { if($stmt_insert = $this->con->prepare("SELECT `customer_id` FROM `invoice` where `id`=?")) { $stmt_insert->bind_param("s",$invoice_id); $stmt_insert->bind_result($cust_name); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $cust_name; } return false; } } } function add_payment_details($invoice_id,$payment_date,$payment_type,$amount,$description) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `make_payment`(`id`,`invoice_id`,`payment_date`, `payment_type`, `amount`, `description`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssi",$id,$invoice_id,$payment_date,$payment_type,$amount,$description,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function add_to_the_invoice($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_invoice`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { return true; } else{ return false; echo $stmt_insert->error; } } } function change_user_password($email,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `admin` set `password`='".$password."' where `admin_name` = ?")) { $stmt_select->bind_param("s",$email); if($stmt_select->execute()) { return true; } return false; } } function get_temp_invoice_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `tmp_invoice`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_invoice($del_id) { if($stmt_select = $this->con->prepare("Delete from `tmp_invoice` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function new_employee($full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$photo,$addhar_attachment,$attachment1,$attachment2,$attachment3,$designation,$joining_date,$technology,$salary,$remark,$location) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `employees`(`full_name`, `email`, `contact`, `address`, `gender`, `dob`, `city`, `state`, `country`, `pincode`, `aadhar_no`, `id_size_photo`, `aadhar_attachment`, `attachment1`, `attachment2`, `attachment3`, `designation`, `joining_date`, `working_technology`, `salary`, `remark`,`job_location`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssssssssssssssss",$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$photo,$addhar_attachment,$attachment1,$attachment2,$attachment3,$designation,$joining_date,$technology,$salary,$remark,$location,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_employee_information($name,$emp_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `email`, `contact`, `address`, `gender`, `dob`, `city`, `state`, `country`, `pincode`, `aadhar_no`, `id_size_photo`, `aadhar_attachment`, `attachment1`, `attachment2`, `attachment3`, `designation`, `joining_date`, `working_technology`, `salary`, `remark`,`job_location` FROM `employees` WHERE `full_name` LIKE '%$name%' AND `id` LIKE '%$emp_id%'")) { $stmt_insert->bind_result($id,$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$photo,$addhar_attachment,$attachment1,$attachment2,$attachment3,$designation,$joining_date,$technology,$salary,$remark,$location); 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] = $primary_contact; $details[$counter][4] = $address; $details[$counter][5] = $gender; $details[$counter][6] = $dob; $details[$counter][7] = $city; $details[$counter][8] = $state; $details[$counter][9] = $country; $details[$counter][10] = $pincode; $details[$counter][11] = $aadhar_no; $details[$counter][12] = $photo; $details[$counter][13] = $addhar_attachment; $details[$counter][14] = $attachment1; $details[$counter][15] = $attachment2; $details[$counter][16] = $attachment3; $details[$counter][17] = $designation; $details[$counter][18] = $joining_date; $details[$counter][19] = $technology; $details[$counter][20] = $salary; $details[$counter][21] = $remark; $details[$counter][22] = $location; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_employee_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `employees` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_employee_information_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `email`, `contact`, `address`, `gender`, `dob`, `city`, `state`, `country`, `pincode`, `aadhar_no`, `id_size_photo`, `aadhar_attachment`, `attachment1`, `attachment2`, `attachment3`, `designation`, `joining_date`, `working_technology`, `salary`, `remark`,`job_location` FROM `employees` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$photo,$addhar_attachment,$attachment1,$attachment2,$attachment3,$designation,$joining_date,$technology,$salary,$remark,$location); 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] = $primary_contact; $details[$counter][4] = $address; $details[$counter][5] = $gender; $details[$counter][6] = $dob; $details[$counter][7] = $city; $details[$counter][8] = $state; $details[$counter][9] = $country; $details[$counter][10] = $pincode; $details[$counter][11] = $aadhar_no; $details[$counter][12] = $photo; $details[$counter][13] = $addhar_attachment; $details[$counter][14] = $attachment1; $details[$counter][15] = $attachment2; $details[$counter][16] = $attachment3; $details[$counter][17] = $designation; $details[$counter][18] = $joining_date; $details[$counter][19] = $technology; $details[$counter][20] = $salary; $details[$counter][21] = $remark; $details[$counter][22] = $location; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_employee($up_id,$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$designation,$joining_date,$technology,$salary,$remark,$location) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("Update `employees` set `full_name` = ?, `email` = ?, `contact` = ?, `address` = ?, `gender` = ?, `dob` = ?, `city` = ?, `state` = ?, `country` = ?, `pincode` = ?, `aadhar_no` = ? ,`designation` = ?, `joining_date` = ?, `working_technology` = ?, `salary` = ?, `remark` = ?, `job_location` = ? Where `id` = ?")) { $stmt_insert->bind_param("sssssssssssssssssi",$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$designation,$joining_date,$technology,$salary,$remark,$location,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_id_photo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `employees` set `id_size_photo` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_id_photo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `id_size_photo` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_id_size_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `employees` set `id_size_photo` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_aadhar_photo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `employees` set `aadhar_attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_aadhar_photo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `aadhar_attachment` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_aadhar_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `employees` set `aadhar_attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_attachment1_photo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `employees` set `attachment1` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_attachment1_photo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `attachment1` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_attachment1_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `employees` set `attachment1` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_attachment2_photo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `employees` set `attachment2` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_attachment2_photo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `attachment2` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_attachment2_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `employees` set `attachment2` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_attachment3_photo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `employees` set `attachment3` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_attachment3_photo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `attachment3` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_attachment3_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `employees` set `attachment3` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_employee_name() { if($stmt_select = $this->con->prepare("Select `id`, `full_name` from `employees` ")) { $stmt_select->bind_result($id,$full_name); if($stmt_select->execute()) { $data = array(); $counter = 0; while($stmt_select->fetch()) { $data[$counter][0] = $id; $data[$counter][1] = $full_name; $counter ++; }if(!empty($data)) { return $data; } } return false; } } function fetch_designation_by_id($id) { if($stmt_select = $this->con->prepare("Select `designation` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `full_name` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function new_experience_letter_data($full_name,$fetch_name,$exp_date,$duration_from,$duration_to,$text1,$text2,$photo) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `experience_certificate`(`emp_id`,`emp_name`, `date_of_letter`, `duration_from`, `duration_to`, `text1`, `text2`, `letter_attachment`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$full_name,$fetch_name,$exp_date,$duration_from,$duration_to,$text1,$text2,$photo,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function fetch_data_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`,`emp_name`, `date_of_letter`, `duration_from`, `duration_to`, `text1`, `text2` FROM `experience_certificate` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$emp_id,$emp_name,$date_of_letter,$duration_from,$duration_to,$text1,$text2); 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] = $date_of_letter; $details[$counter][4] = $duration_from; $details[$counter][5] = $duration_to; $details[$counter][6] = $text1; $details[$counter][7] = $text2; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_cerificate_data($emp_id,$emp_name) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `date_of_letter`, `duration_from`, `duration_to`, `text1`, `text2` FROM `experience_certificate` Where `emp_id` LIKE '%$emp_id%' AND `emp_name` LIKE '%$emp_name%'")) { $stmt_insert->bind_result($id,$emp_name,$date_of_letter,$duration_from,$duration_to,$text1,$text2); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $emp_name; $details[$counter][2] = $date_of_letter; $details[$counter][3] = $duration_from; $details[$counter][4] = $duration_to; $details[$counter][5] = $text1; $details[$counter][6] = $text2; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_name_by_id_for_display($id) { if($stmt_select = $this->con->prepare("Select `full_name` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function delete_experience_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `experience_certificate` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_experience_letter_data($up_id,$full_name,$exp_date,$duration_from,$duration_to,$text1,$text2) { if($stmt_insert = $this->con->prepare("Update `experience_certificate` set `emp_name` = ?, `date_of_letter` = ?, `duration_from` = ?, `duration_to` = ?, `text1` = ?, `text2` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssssssi",$full_name,$exp_date,$duration_from,$duration_to,$text1,$text2,$up_id); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function fetch_data_by_id_for_display($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`,`emp_name`, `date_of_letter`, `duration_from`, `duration_to`, `text1`, `text2` ,`letter_attachment` FROM `experience_certificate` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$emp_id,$emp_name,$date_of_letter,$duration_from,$duration_to,$text1,$text2,$letter_attachment); 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] = $date_of_letter; $details[$counter][4] = $duration_from; $details[$counter][5] = $duration_to; $details[$counter][6] = $text1; $details[$counter][7] = $text2; $details[$counter][8] = $letter_attachment; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_letter_attachment($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `experience_certificate` set `letter_attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_letter_attachment_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `letter_attachment` from `experience_certificate` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_letter_attachment_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `experience_certificate` set `letter_attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function add_salary($full_name,$fetch_name,$payment,$payment_date,$mode,$photo) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `salary`(`emp_id`, `emp_name`, `payment`, `payment_date`, `payment_mode`, `attachment`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssss",$full_name,$fetch_name,$payment,$payment_date,$mode,$photo,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function get_all_salary_data($emp_id,$emp_name) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `emp_name`, `payment`, `payment_date`, `payment_mode`, `attachment` FROM `salary` Where `emp_id` LIKE '%$emp_id%' AND `emp_name` LIKE '%$emp_name%'")) { $stmt_insert->bind_result($id,$emp_id,$emp_name,$payment,$payment_date,$payment_mode,$attachment); 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] = $payment; $details[$counter][4] = $payment_date; $details[$counter][5] = $payment_mode; $details[$counter][6] = $attachment; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_salary_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `salary` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_salary_data_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`emp_id`, `emp_name`, `payment`, `payment_date`, `payment_mode`, `attachment` FROM `salary` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$emp_id,$emp_name,$payment,$payment_date,$payment_mode,$attachment); 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] = $payment; $details[$counter][4] = $payment_date; $details[$counter][5] = $payment_mode; $details[$counter][6] = $attachment; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_salary($up_id,$full_name,$payment,$payment_date,$mode) { if($stmt_insert = $this->con->prepare("update `salary` set `emp_name` = ?, `payment` = ?, `payment_date` = ?, `payment_mode` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssssi",$full_name,$payment,$payment_date,$mode,$up_id); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function update_payment_attachment($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `salary` set `attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_payment_attachment_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `attachment` from `salary` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_payment_attachment_photo_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `salary` set `attachment` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_payment_by_id($id) { if($stmt_select = $this->con->prepare("Select `salary` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function new_projects($project_name,$languages,$college_name,$fees,$s_name1,$s_email1,$s_contact1,$s_name2,$s_email2,$s_contact2,$s_name3,$s_email3,$s_contact3,$s_name4,$s_email4,$s_contact4,$s_name5,$s_email5,$s_contact5,$r_date) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `projects`(`project_name`, `language`, `c_name`, `fees`, `student1_name`, `student1_email`, `student1_contact`, `student2_name`, `student2_email`, `student2_contact`, `student3_name`, `student3_email`, `student3_contact`, `student4_name`, `student4_email`, `student4_contact`, `student5_name`, `student5_email`, `student5_contact`, `reg_date`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssssssssssssss",$project_name,$languages,$college_name,$fees,$s_name1,$s_email1,$s_contact1,$s_name2,$s_email2,$s_contact2,$s_name3,$s_email3,$s_contact3,$s_name4,$s_email4,$s_contact4,$s_name5,$s_email5,$s_contact5,$r_date,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function get_all_project_information($p_name,$p_id,$date_from,$date_to) { $date_from = Date ("Y-m-d", strtotime($date_from)); $date_to = Date ("Y-m-d", strtotime($date_to)); if($stmt_insert = $this->con->prepare("SELECT `id`,`project_name`, `language`, `c_name`, `fees`, `student1_name`, `student1_email`, `student1_contact`, `student2_name`, `student2_email`, `student2_contact`, `student3_name`, `student3_email`, `student3_contact`, `student4_name`, `student4_email`, `student4_contact`, `student5_name`, `student5_email`, `student5_contact`, `reg_date` FROM `projects` Where `project_name` LIKE '%$p_name%' AND `id` LIKE '%$p_id%' AND `date` BETWEEN '$date_from' AND '$date_to'")) { $stmt_insert->bind_result($id,$project_name,$language,$c_name,$fees,$student1_name,$student1_email,$student1_contact,$student2_name,$student2_email,$student2_contact,$student3_name,$student3_email,$student3_contact,$student4_name,$student4_email,$student4_contact,$student5_name,$student5_email,$student5_contact,$reg_date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $project_name; $details[$counter][2] = $language; $details[$counter][3] = $c_name; $details[$counter][4] = $fees; $details[$counter][5] = $student1_name; $details[$counter][6] = $student1_email; $details[$counter][7] = $student1_contact; $details[$counter][8] = $student2_name; $details[$counter][9] = $student2_email; $details[$counter][10] = $student2_contact; $details[$counter][11] = $student3_name; $details[$counter][12] = $student3_email; $details[$counter][13] = $student3_contact; $details[$counter][14] = $student4_name; $details[$counter][15] = $student4_email; $details[$counter][16] = $student4_contact; $details[$counter][17] = $student5_name; $details[$counter][18] = $student5_email; $details[$counter][19] = $student5_contact; $details[$counter][20] = $reg_date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_college_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `projects` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_experience_certificate_name($emp_id,$full_name) { if($stmt_insert = $this->con->prepare("Update `experience_certificate` set `emp_name` = ? Where `emp_id` = ?")) { $stmt_insert->bind_param("ss",$full_name,$emp_id); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function update_emp_name_in_salary($emp_id,$full_name) { if($stmt_insert = $this->con->prepare("Update `salary` set `emp_name` = ? Where `emp_id` = ?")) { $stmt_insert->bind_param("ss",$full_name,$emp_id); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function get_all_project_information_for_display($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`project_name`, `language`, `c_name`, `fees`, `student1_name`, `student1_email`, `student1_contact`, `student2_name`, `student2_email`, `student2_contact`, `student3_name`, `student3_email`, `student3_contact`, `student4_name`, `student4_email`, `student4_contact`, `student5_name`, `student5_email`, `student5_contact`, `reg_date` FROM `projects` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$project_name,$language,$c_name,$fees,$student1_name,$student1_email,$student1_contact,$student2_name,$student2_email,$student2_contact,$student3_name,$student3_email,$student3_contact,$student4_name,$student4_email,$student4_contact,$student5_name,$student5_email,$student5_contact,$reg_date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $project_name; $details[$counter][2] = $language; $details[$counter][3] = $c_name; $details[$counter][4] = $fees; $details[$counter][5] = $student1_name; $details[$counter][6] = $student1_email; $details[$counter][7] = $student1_contact; $details[$counter][8] = $student2_name; $details[$counter][9] = $student2_email; $details[$counter][10] = $student2_contact; $details[$counter][11] = $student3_name; $details[$counter][12] = $student3_email; $details[$counter][13] = $student3_contact; $details[$counter][14] = $student4_name; $details[$counter][15] = $student4_email; $details[$counter][16] = $student4_contact; $details[$counter][17] = $student5_name; $details[$counter][18] = $student5_email; $details[$counter][19] = $student5_contact; $details[$counter][20] = $reg_date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_projects($up_id,$project_name,$languages,$college_name,$fees,$s_name1,$s_email1,$s_contact1,$s_name2,$s_email2,$s_contact2,$s_name3,$s_email3,$s_contact3,$s_name4,$s_email4,$s_contact4,$s_name5,$s_email5,$s_contact5,$r_date) { if($stmt_insert = $this->con->prepare("Update `projects` set `project_name` = ?, `language` = ?, `c_name` = ?, `fees` = ?, `student1_name` = ?, `student1_email` = ?, `student1_contact` = ?, `student2_name` = ?, `student2_email` = ?, `student2_contact` = ?, `student3_name` = ?, `student3_email` = ?, `student3_contact` = ?, `student4_name` = ?, `student4_email` = ?, `student4_contact` = ?, `student5_name` = ?, `student5_email` = ?, `student5_contact` = ?, `reg_date` = ? Where `id` =?")) { $stmt_insert->bind_param("ssssssssssssssssssssi",$project_name,$languages,$college_name,$fees,$s_name1,$s_email1,$s_contact1,$s_name2,$s_email2,$s_contact2,$s_name3,$s_email3,$s_contact3,$s_name4,$s_email4,$s_contact4,$s_name5,$s_email5,$s_contact5,$r_date,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_project_name() { if($stmt_select = $this->con->prepare("Select `id`, `project_name` from `projects` ")) { $stmt_select->bind_result($id,$full_name); if($stmt_select->execute()) { $data = array(); $counter = 0; while($stmt_select->fetch()) { $data[$counter][0] = $id; $data[$counter][1] = $full_name; $counter ++; } if(!empty($data)) { return $data; } } return false; } } function add_project_payment($project_id,$project_name,$amount,$date,$sms,$s_email) { $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `project_payment`(`project_id`,`project_name`,`amount`,`date`,`sms`,`email`,`time`) VALUES (?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssss",$project_id,$project_name,$amount,$date,$sms,$s_email,$time); if($stmt_insert->execute()) { return true; } return false; } } function fetch_project_name_by_id($project_id) { if($stmt_select = $this->con->prepare("Select `project_name` from `projects` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_project_payment_information($pro_name,$date_to,$date_from,$pro_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `project_id`,`project_name`,`amount`,`date`,`time` FROM `project_payment` WHERE `project_name` LIKE '%$pro_name%' AND `date` BETWEEN '$date_from' AND '$date_to' AND `project_id` LIKE '%$pro_id%'")) { $stmt_insert->bind_result($id,$project_id,$project_name,$amount,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $project_id; $details[$counter][2] = $project_name; $details[$counter][3] = $amount; $details[$counter][4] = $date; $details[$counter][5] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_project_payment_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `project_payment` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_project_payment_information_for_display($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `project_id`,`project_name`,`amount`,`date` FROM `project_payment` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$project_id,$project_name,$amount,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $project_id; $details[$counter][2] = $project_name; $details[$counter][3] = $amount; $details[$counter][4] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_project_payment($up_id,$project_id,$project_name,$amount,$date) { if($stmt_insert = $this->con->prepare("Update `project_payment` set `project_id` =? ,`project_name` =?,`amount` =?,`date`=? Where `id` =?")) { $stmt_insert->bind_param("ssssi",$project_id,$project_name,$amount,$date,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_final_amount($project_id) { if($stmt_select = $this->con->prepare("Select `fees` from `projects` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function check_id_exist_or_not($project_id) { if($stmt_select = $this->con->prepare("Select `id` from `project_payment` where `project_id` = ? ")) { $stmt_select->bind_param("s",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_project_records($project_id,$amount) { if($stmt_insert = $this->con->prepare("Update `project_payment` set `amount` =? Where `project_id` =?")) { $stmt_insert->bind_param("ss",$amount,$project_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_paid_amount($project_id) { if($stmt_select = $this->con->prepare("Select `amount` from `project_payment` where `project_id` = ? ")) { $stmt_select->bind_param("s",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function add_quotation_info($cust_id,$customer_name,$service,$service_name,$comment,$amount,$d_amount,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_quotation`(`cust_id`, `cust_name`, `service_id`, `service_name`, `comment`, `actual_amount`, `discount_amount`, `date`, `time`,`bill_type`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$cust_id,$customer_name,$service,$service_name,$comment,$amount,$d_amount,$date,$time,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function fetch_cust_name_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `name` from `customers` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function delete_quotation_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `tmp_quotation` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_quotation_information($c_name,$date_to,$date_from,$service) { if($service=="select") { $service =""; } if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`,`comment`, `actual_amount`, `discount_amount`, `date`, `time` FROM `quotation_cart` WHERE `cust_name` LIKE '%$c_name%' AND `date` BETWEEN '$date_from' AND '$date_to' AND `service_name` LIKE '%$service%'")) { $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $details[$counter][8] = $date; $details[$counter][9] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_quotation_information_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`, `comment`, `actual_amount`, `discount_amount`, `date`, `time`,`bill_type` FROM `quotation_cart` WHERE `transaction_id` = ?")) { $stmt_insert->bind_param("s",$up_id); $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount,$date,$time,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $details[$counter][8] = $date; $details[$counter][9] = $time; $details[$counter][10] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_logo($up_id) { $id_size_photo = ""; if($stmt_insert = $this->con->prepare("Update `customers` set `logo` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_logo_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `logo` from `customers` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_logo_image_by_id($up_id,$id_size_photo) { if($stmt_insert = $this->con->prepare("Update `customers` set `logo` = ? Where `id` =?")) { $stmt_insert->bind_param("si",$id_size_photo,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_projects() { if($stmt_insert = $this->con->prepare("SELECT `id`, `project_name` FROM `customer_services` ")) { $stmt_insert->bind_result($id,$project_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $project_name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function approve_service_status($app_id) { $status = "show in company profile"; if($stmt_select = $this->con->prepare("Update `customer_services` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$app_id); if($stmt_select->execute()) { return true; } return false; } } function pending_service_status($pen_id) { $status = "don't show in company profile"; if($stmt_select = $this->con->prepare("Update `customer_services` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$pen_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_service_information_for_display() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`status` FROM `customer_services` Where `project_name` != ' ' AND `status` = 'show in company profile' ORDER BY `service` DESC")) { $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_email_by_id($id) { if($stmt_select = $this->con->prepare("Select `email` from `customers` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function cancel_service_status($pen_id) { $status = "cancel"; if($stmt_select = $this->con->prepare("Update `customer_services` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$pen_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_service_for_display() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `services` ")) { $stmt_insert->bind_result($id,$service); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_cancel_payment_information($s_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `services_id`, `cust_id`, `cust_name`, `service_no`, `service_name`,`project_name`, `opening_amount`, `paid_amount`, `bal_amount`, `date`, `time` FROM `payment_report` Where `services_id` =?")) { $stmt_insert->bind_param("s",$s_id); $stmt_insert->bind_result($id,$services_id,$cust_id,$cust_name,$service_no,$service_name,$p_name,$opening_amount,$paid_amount,$bal_amount,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $services_id; $details[$counter][2] = $cust_id; $details[$counter][3] = $cust_name; $details[$counter][4] = $service_no; $details[$counter][5] = $service_name; $details[$counter][6] = $p_name; $details[$counter][7] = $opening_amount; $details[$counter][8] = $paid_amount; $details[$counter][9] = $bal_amount; $details[$counter][10] = $date; $details[$counter][11] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_service_information_for_cancel_status() { if($stmt_insert = $this->con->prepare("SELECT `id` FROM `customer_services` Where `status` ='cancel' ")) { $stmt_insert->bind_result($id); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_status($id) { if($stmt_select = $this->con->prepare("Select `status` from `customer_services` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_status_by_cust_id($cust_id) { if($stmt_select = $this->con->prepare("Select `status` from `customer_services` where `customer_name` = ? ")) { $stmt_select->bind_param("s",$cust_id); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function cancel_service_status_in_payment($pen_id) { $status = "cancel"; if($stmt_select = $this->con->prepare("Update `payment_report` set `status`= ? where `services_id`=?")) { $stmt_select->bind_param("ss",$status,$pen_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_make_payment_report($invoice_id) { if($stmt_select = $this->con->prepare("SELECT `id`, `payment_date`, `payment_type`, `amount`, `description` FROM `make_payment` WHERE `invoice_id` = ?")) { $stmt_select->bind_param("s",$invoice_id); $stmt_select->bind_result($id,$payment_date,$payment_type,$amount,$description); if($stmt_select->execute()) { $counter = 0; $details = array(); while($stmt_select->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $invoice_id; $details[$counter][2] = $payment_date; $details[$counter][3] = $payment_type; $details[$counter][4] = $amount; $details[$counter][5] = $description; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_make_payment_report_by_id($del_id) { if($stmt_select = $this->con->prepare("DELETE from `make_payment` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_total_paid_amount_from_make_payment($invoice_id) { if($stmt_insert = $this->con->prepare("SELECT SUM(`amount`) FROM `make_payment` where `invoice_id`=?")) { $stmt_insert->bind_param("s",$invoice_id); $stmt_insert->bind_result($total_amount); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $total_amount; } return false; } } } function fetch_customer_name_by_id($id) { if($stmt_select = $this->con->prepare("Select `name` from `customers` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function add_to_the_invoice_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `invoice_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function get_temp_invoice_info_for_display() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`, `service`,SUM(`actual_amount`),SUM(`discount_amount`), `comment` FROM `tmp_invoice`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $counter++; } if(!empty($details)) { return $details; } return false; } } } function insert_invoice_details($c_id,$actual_amount,$discount_amount,$comment,$bill_type,$max_invoice_no) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `invoice`(`customer_id`, `total_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`invoice_no`) VALUES (?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssss",$c_id,$actual_amount,$discount_amount,$date,$time,$comment,$bill_type,$max_invoice_no); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function fetch_invoice_cart_data_by_cust_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `invoice_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_invoice_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `customer_id` from `invoice` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_invoice_date_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `date` from `invoice` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_invoice_report($customer_name,$bill_type,$from_date,$to_date) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`total_amount`,`discount_amount`,`comment`,`bill_type`,`invoice_no` FROM `invoice` WHERE `customer_id` LIKE '%".$customer_name."%' AND `bill_type` LIKE '%".$bill_type."%' AND (`date` BETWEEN ? AND ?)")) { $stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$c_id,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $comment; $details[$counter][5] = $bill_type; $details[$counter][6] = $invoice_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_services_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `service` from `invoice_cart` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$c_id); $stmt_select->bind_result($service); if($stmt_select->execute()) { $count = 0; $data = array(); while($stmt_select->fetch()) { $data[$count][0] = $service; $count++; } if(!empty($data)) { return $data; } } return false; } } function fetch_invoice_cart_data_by_transaction_id($tran_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `invoice_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$tran_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_invoice_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `invoice_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_main_invoice_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `invoice` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_invoice_cart_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `invoice_cart` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function update_invoice_details($up_id,$c_id,$actual_amount,$discount_amount,$bill_type) { if($stmt_insert = $this->con->prepare("Update `invoice` set `customer_id` = ?, `total_amount` = ?, `discount_amount` = ? , `bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("ssssi",$c_id,$actual_amount,$discount_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_invoice_cart($up_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("update `invoice_cart` set `customer_id` = ?, `service` = ?, `actual_amount` = ?, `discount_amount` = ? Where `transaction_id` = ?")) { $stmt_insert->bind_param("sssss",$c_id,$service_id,$actual_total_amount,$discount_total_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_temp_invoice_cart_info($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `invoice_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$update_id); $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_total_amount_invoice_cart_info($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,SUM(`actual_amount`),SUM(`discount_amount`) FROM `invoice_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$update_id); $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_invoice_data_for_update($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `customer_id`,`service`,`actual_amount`,`discount_amount` FROM `invoice_cart` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_actual_amount_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `total_amount` from `invoice` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_discount_amount_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `discount_amount` from `invoice` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_amount_invoice_details($up_id,$actual_amount,$discount_amount) { if($stmt_insert = $this->con->prepare("Update `invoice` set `total_amount` = ?, `discount_amount` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$actual_amount,$discount_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_customer_information_for_sms($cust_name,$cust_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo` FROM `customers` Where `name` LIKE '%$cust_name%' AND `id` LIKE '%$cust_id%' ")) { $stmt_insert->bind_result($id,$name,$office_name,$email,$address,$primary_contact_no,$other_contact_no,$logo); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $office_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact_no; $details[$counter][6] = $other_contact_no; $details[$counter][7] = $logo; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_data($record,$language,$message) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `sms_panel`(`customer_id`, `language`, `message`,`date` ,`time`) VALUES (?,?,?,?,?)")) { $stmt_insert->bind_param("sssss",$record,$language,$message,$date,$time); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function get_all_customer_info_for_agreement($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_bank_details($b_name,$acc_name,$acc_no,$ifsc_code,$branch_name,$other_info) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `bank_details`(`bank_name`, `account_name`,`account_no`, `ifsc_code`, `branch_name`,`other_info`, `date`, `time`) VALUES (?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssss",$b_name,$acc_name,$acc_no,$ifsc_code,$branch_name,$other_info,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_bank_information() { if($stmt_insert = $this->con->prepare("SELECT `id`,`bank_name`, `account_name`,`account_no`, `ifsc_code`, `branch_name`,`other_info` FROM `bank_details`")) { $stmt_insert->bind_result($id,$bank_name,$account_name,$account_no,$ifsc_code,$branch_name,$other_info); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $bank_name; $details[$counter][2] = $account_name; $details[$counter][3] = $account_no; $details[$counter][4] = $ifsc_code; $details[$counter][5] = $branch_name; $details[$counter][6] = $other_info; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_bank_details($del_id) { if($stmt_select = $this->con->prepare("Delete from `bank_details` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_bank_information_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`bank_name`, `account_name`,`account_no`, `ifsc_code`, `branch_name`,`other_info` FROM `bank_details` Where `id` =?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$bank_name,$account_name,$account_no,$ifsc_code,$branch_name,$other_info); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $bank_name; $details[$counter][2] = $account_name; $details[$counter][3] = $account_no; $details[$counter][4] = $ifsc_code; $details[$counter][5] = $branch_name; $details[$counter][6] = $other_info; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_bank_details($up_id,$b_name,$acc_name,$acc_no,$ifsc_code,$branch_name,$other_info) { if($stmt_insert = $this->con->prepare("update `bank_details` set `bank_name` = ?, `account_name` = ?,`account_no` = ?, `ifsc_code` = ?, `branch_name` = ?,`other_info` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssssssi",$b_name,$acc_name,$acc_no,$ifsc_code,$branch_name,$other_info,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function only_customers_by_id_and_name($cust_name,$cust_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `name` FROM `customers` Where `name` LIKE '%$cust_name%' AND `id` LIKE '%$cust_id%'")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_quotation_information() { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`, `comment`, `actual_amount`, `discount_amount`,`bill_type` FROM `tmp_quotation` ")) { $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $details[$counter][8] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function insert_quotation_details($c_id,$actual_amount,$discount_amount,$bill_type,$max_quotation_no) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `quotation`(`cust_id`, `actual_amount`, `discount_amount`,`date` ,`time`,`bill_type`,`quotation_no`) VALUES (?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssss",$c_id,$actual_amount,$discount_amount,$date,$time,$bill_type,$max_quotation_no); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } return false; } } function add_quotation_cart($insert_id,$cust_id,$customer_name,$service,$service_name,$comment,$amount,$d_amount,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `quotation_cart`( `transaction_id`, `cust_id`, `cust_name`, `service_id`, `service_name`, `comment`, `actual_amount`, `discount_amount`, `date`, `time`, `bill_type`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$insert_id,$cust_id,$customer_name,$service,$service_name,$comment,$amount,$d_amount,$date,$time,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function fetch_quotation_information() { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`,`comment`, SUM(`actual_amount`), SUM(`discount_amount`) FROM `tmp_quotation`")) { $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_quotation_information($customer_name,$bill_type) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `actual_amount`, `discount_amount`,`bill_type`,`quotation_no` FROM `quotation` WHERE `cust_id` LIKE '%".$customer_name."%' AND `bill_type` LIKE '%".$bill_type."%' ")) { $stmt_insert->bind_result($id,$cust_id,$actual_amount,$discount_amount,$bill_type,$quotation_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $bill_type; $details[$counter][5] = $quotation_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_quotation_services_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `service_id` from `quotation_cart` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$c_id); $stmt_select->bind_result($service); if($stmt_select->execute()) { $count = 0; $data = array(); while($stmt_select->fetch()) { $data[$count][0] = $service; $count++; } if(!empty($data)) { return $data; } } return false; } } function delete_quotation_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `quotation_cart` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_quotation($del_id) { if($stmt_select = $this->con->prepare("Delete from `quotation` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_quotationcart__information($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`,`comment`, SUM(`actual_amount`), SUM(`discount_amount`) FROM `quotation_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$up_id); $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function update_quotation_info($up_id,$cust_id,$amount,$d_amount,$bill_type) { if($stmt_insert = $this->con->prepare("update `quotation` set `cust_id` = ?, `actual_amount` = ?, `discount_amount` = ?,`bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("ssssi",$cust_id,$amount,$d_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } }*/ function fetch_qutotation_cart_data_for_update($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `cust_id`,`service_id`,`actual_amount`,`discount_amount` FROM `quotation_cart` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_actual_qutotation_amount_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `actual_amount` from `quotation` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_discount_qutotation_amount_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `discount_amount` from `quotation` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_amount_in_quotation_details($up_id,$actual_amount,$discount_amount) { if($stmt_insert = $this->con->prepare("Update `quotation` set `actual_amount` = ?, `discount_amount` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$actual_amount,$discount_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_quotation_cart_by_id($del_id) { if($stmt_select = $this->con->prepare("Delete from `quotation_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_tmp_quotation_information($c_name,$date_to,$date_from,$service) { if($service=="select") { $service =""; } if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `cust_name`, `service_id`, `service_name`,`comment`, `actual_amount`, `discount_amount`, `date`, `time`,`bill_type` FROM `tmp_quotation` WHERE `cust_name` LIKE '%$c_name%' AND `date` BETWEEN '$date_from' AND '$date_to' AND `service_name` LIKE '%$service%'")) { $stmt_insert->bind_result($id,$cust_id,$cust_name,$service_no,$service_name,$comment,$actual_amount,$discount_amount,$date,$time,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $cust_name; $details[$counter][3] = $service_no; $details[$counter][4] = $service_name; $details[$counter][5] = $comment; $details[$counter][6] = $actual_amount; $details[$counter][7] = $discount_amount; $details[$counter][8] = $date; $details[$counter][9] = $time; $details[$counter][10] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function check_id_exists_or_not($p_id) { if($stmt_select = $this->con->prepare("Select `id` from `create_link` where `p_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 create_update_link($p_name,$s_code) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `create_link`(`p_id`, `security_code`, `date`, `time`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$p_name,$s_code,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_created_link($pro_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`,`p_id`, `security_code` FROM `create_link` Where `p_id` LIKE '%$pro_id%' AND `date` BETWEEN '$from_date' AND '$to_date'")) { $stmt_insert->bind_result($id,$p_id,$security_code); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $p_id; $details[$counter][2] = $security_code; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_customer_id_by_p_id($p_id) { if($stmt_select = $this->con->prepare("Select `customer_name` from `customer_services` where `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_project_name_by_customer_services($project_id) { if($stmt_select = $this->con->prepare("Select `project_name` from `customer_services` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_created_link_by_id($up_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`p_id`, `security_code` FROM `create_link` Where `id` = ?")) { $stmt_insert->bind_param("i",$up_id); $stmt_insert->bind_result($id,$p_id,$security_code); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $p_id; $details[$counter][2] = $security_code; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_created_link($up_id,$p_name,$s_code) { if($stmt_insert = $this->con->prepare("Update `create_link` set `p_id` = ?, `security_code` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$p_name,$s_code,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_create_link($del_id) { if($stmt_select = $this->con->prepare("Delete from `create_link` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_project_name_by_college_students($project_id) { if($stmt_select = $this->con->prepare("Select `project_name` from `projects` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_student_name_by_college_students($project_id) { if($stmt_select = $this->con->prepare("Select `student1_name`,`student2_name`,`student3_name`,`student4_name`,`student5_name` from `projects` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($student1_name,$student2_name,$student3_name,$student4_name,$student5_name); if($stmt_select->execute()) { $data = array(); if($stmt_select->fetch()) { $data[0] = $student1_name; $data[1] = $student2_name; $data[2] = $student3_name; $data[3] = $student4_name; $data[4] = $student5_name; } if(!empty($data)) { return $data; } } return false; } } function fetch_security_code_by_id($project_id) { if($stmt_select = $this->con->prepare("Select `security_code` from `create_link` where `id` = ? ")) { $stmt_select->bind_param("i",$project_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_password_from_customer_id($email) { if($stmt_select = $this->con->prepare("Select `password` from `customers` where `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_customer_password($email,$password) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `customers` set `password`='".$password."' where `id` = ?")) { $stmt_select->bind_param("i",$email); if($stmt_select->execute()) { return true; } return false; } } function get_all_service_information_for_customer_display($email) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`status` FROM `customer_services` Where `customer_name` = ?")) { $stmt_insert->bind_param("s",$email); $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_payment_information_for_customer_display($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `services_id`, `cust_id`, `cust_name`, `service_no`, `service_name`,`project_name`, `opening_amount`, `paid_amount`, `bal_amount`,`status`, `date`, `time` FROM `payment_report` Where `services_id` = ? ")) { $stmt_insert->bind_param("s",$id); $stmt_insert->bind_result($id,$services_id,$cust_id,$cust_name,$service_no,$service_name,$p_name,$opening_amount,$paid_amount,$bal_amount,$status,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $services_id; $details[$counter][2] = $cust_id; $details[$counter][3] = $cust_name; $details[$counter][4] = $service_no; $details[$counter][5] = $service_name; $details[$counter][6] = $p_name; $details[$counter][7] = $opening_amount; $details[$counter][8] = $paid_amount; $details[$counter][9] = $bal_amount; $details[$counter][10] = $status; $details[$counter][11] = $date; $details[$counter][12] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_project_name_by_cust_id($email) { if($stmt_select = $this->con->prepare("Select `project_name` from `customer_services` where `id` = ? ")) { $stmt_select->bind_param("i",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_total_amount_by_cust_id($email) { if($stmt_select = $this->con->prepare("Select `amount` from `customer_services` where `id` = ? ")) { $stmt_select->bind_param("i",$email); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function add_project_updates($c_id,$project_id,$updates,$attachment) { $date = date("Y-m-d"); $time = date("H-i-s A"); $status = "Pending"; if($stmt_insert = $this->con->prepare("INSERT INTO `project_updates`(`customer_id`,`project_id`, `update_details`,`attachment`, `status`, `date`, `time`) VALUES (?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssss",$c_id,$project_id,$updates,$attachment,$status,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_all_updated_services_by_customer_id($c_id,$project_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`project_id`,`update_details`,`attachment`,`status`,`date` FROM `project_updates` Where `customer_id` = ? AND `project_id` = ? ORDER BY `id` DESC")) { $stmt_insert->bind_param("ss",$c_id,$project_id); $stmt_insert->bind_result($id,$customer_id,$project_id,$update_details,$attachment,$status,$date); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_id; $details[$counter][2] = $project_id; $details[$counter][3] = $update_details; $details[$counter][4] = $attachment; $details[$counter][5] = $status; $details[$counter][6] = $date; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_updates_info($del_id) { if($stmt_select = $this->con->prepare("Delete from `project_updates` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_updated_services_by_customer_id_by_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`update_details`,`attachment` FROM `project_updates` Where `id` = ?")) { $stmt_insert->bind_param("i",$c_id); $stmt_insert->bind_result($id,$update_details,$attachment); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $update_details; $details[$counter][2] = $attachment; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_projects_updates($update_id,$updates) { $date = date("Y-m-d"); $time = date("H-i-s A"); $status = "Pending"; if($stmt_insert = $this->con->prepare("Update `project_updates` set `update_details` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$updates,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function update_attachment_in_project_updates($update_id) { $actual_image_name = ""; if($stmt_insert = $this->con->prepare("Update `project_updates` set `attachment`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function get_attachment_in_project__updates($update_id) { if($stmt_select = $this->con->prepare("Select `attachment` from `project_updates` 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_project_update_attachement($update_id,$actual_image_name) { if($stmt_insert = $this->con->prepare("Update `project_updates` set `attachment`=? Where `id`=?")) { $stmt_insert->bind_param("si",$actual_image_name,$update_id); if($stmt_insert->execute()) { return true; } return false; } } function get_all_updated_services_by_admin_panel($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`,`customer_id`,`project_id`,`update_details`,`attachment`,`status`,`date`,`time` FROM `project_updates` WHERE `date` BETWEEN '$from_date' AND '$to_date' ORDER BY `id` DESC")) { $stmt_insert->bind_result($id,$customer_id,$project_id,$update_details,$attachment,$status,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_id; $details[$counter][2] = $project_id; $details[$counter][3] = $update_details; $details[$counter][4] = $attachment; $details[$counter][5] = $status; $details[$counter][6] = $date; $details[$counter][7] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_service_information_by_id($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_name`, `service`, `project_name`,`amount`,`status` FROM `customer_services` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$customer_name,$service,$p_name,$amount,$status); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $customer_name; $details[$counter][2] = $service; $details[$counter][3] = $p_name; $details[$counter][4] = $amount; $details[$counter][5] = $status; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_project_status_work_in_progress($app_id) { $status = "Work in Progress"; if($stmt_select = $this->con->prepare("Update `project_updates` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$app_id); if($stmt_select->execute()) { return true; } return false; } } function update_project_status_pending($app_id) { $status = "Pending"; if($stmt_select = $this->con->prepare("Update `project_updates` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$app_id); if($stmt_select->execute()) { return true; } return false; } } function update_project_status_complete($app_id) { $status = "Complete"; if($stmt_select = $this->con->prepare("Update `project_updates` set `status`= ? where `id`=?")) { $stmt_select->bind_param("si",$status,$app_id); if($stmt_select->execute()) { return true; } return false; } } function get_pending_updates_count() { if($stmt_select = $this->con->prepare("Select COUNT(`id`) from `project_updates` where `status` = 'Pending'")) { $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_work_in_progress_updates_count() { if($stmt_select = $this->con->prepare("Select COUNT(`id`) from `project_updates` where `status` = 'Work in Progress'")) { $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_quotation_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `cust_id` from `quotation` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_quotation_cart_data_by_cust_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`cust_id`,`service_id`,`comment`,`actual_amount`,`discount_amount`,`bill_type` FROM `quotation_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$comment,$actual_amount,$discount_amount,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $comment; $details[$counter][5] = $actual_amount; $details[$counter][6] = $discount_amount; $details[$counter][7] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } } function new_offer_letter_data($text1) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `offer_letters`(`text1`, `date`, `time`) VALUES (?,?,?)")) { $stmt_insert->bind_param("sss",$text1,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function fetch_offer_letter_data() { if($stmt_insert = $this->con->prepare("SELECT `id`, `text1`, `date`, `time` FROM `offer_letters`")) { $stmt_insert->bind_result($id,$text1,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $text1; $details[$counter][2] = $date; $details[$counter][3] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_offer_letter_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `offer_letters` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_gender_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `gender` from `employees` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_offer_letter_data($up_id,$text1) { if($stmt_insert = $this->con->prepare("Update `offer_letters` set `text1` = ? Where `id` = ?")) { $stmt_insert->bind_param("si",$text1,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_offer_letter_data_by_id($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `text1` FROM `offer_letters` Where `id` = ?")) { $stmt_insert->bind_param("i",$update_id); $stmt_insert->bind_result($id,$text1); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $text1; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_employee_data_for_offer_letter($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`full_name`, `email`, `contact`, `address`, `gender`, `dob`, `city`, `state`, `country`, `pincode`, `aadhar_no`, `id_size_photo`, `aadhar_attachment`, `attachment1`, `attachment2`, `attachment3`, `designation`, `joining_date`, `working_technology`, `salary`, `remark`,`job_location` FROM `employees` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$full_name,$email,$primary_contact,$address,$gender,$dob,$city,$state,$country,$pincode,$aadhar_no,$photo,$addhar_attachment,$attachment1,$attachment2,$attachment3,$designation,$joining_date,$technology,$salary,$remark,$location); 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] = $primary_contact; $details[$counter][4] = $address; $details[$counter][5] = $gender; $details[$counter][6] = $dob; $details[$counter][7] = $city; $details[$counter][8] = $state; $details[$counter][9] = $country; $details[$counter][10] = $pincode; $details[$counter][11] = $aadhar_no; $details[$counter][12] = $photo; $details[$counter][13] = $addhar_attachment; $details[$counter][14] = $attachment1; $details[$counter][15] = $attachment2; $details[$counter][16] = $attachment3; $details[$counter][17] = $designation; $details[$counter][18] = $joining_date; $details[$counter][19] = $technology; $details[$counter][20] = $salary; $details[$counter][21] = $remark; $details[$counter][22] = $location; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_type_from_invoice($c_id) { if($stmt_select = $this->con->prepare("SELECT `bill_type` FROM `invoice` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function fetch_bill_type_from_quotation($c_id) { if($stmt_select = $this->con->prepare("SELECT `bill_type` FROM `quotation` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } //11-10-2020 function fetch_customer_id_from_quotation($c_id) { if($stmt_select = $this->con->prepare("SELECT `cust_id` FROM `quotation` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function fetch_customer_id_from_invoice($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `invoice` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function update_quotation_info1($up_id,$amount,$d_amount,$bill_type) { if($stmt_insert = $this->con->prepare("update `quotation` set `actual_amount` = ?, `discount_amount` = ?,`bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("sssi",$amount,$d_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_invoice_details_info($up_id,$actual_amount,$discount_amount,$bill_type) { if($stmt_insert = $this->con->prepare("Update `invoice` set `total_amount` = ?, `discount_amount` = ? , `bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("sssi",$actual_amount,$discount_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } //22-11 function get_max_quotation_no($bill_type) { if($stmt_select = $this->con->prepare("SELECT MAX(`quotation_no`) FROM `quotation` WHERE `bill_type`=?")) { $stmt_select->bind_param("s",$bill_type); $stmt_select->bind_result($qu_no); if($stmt_select->execute()) { $count = 0; $data = array(); if($stmt_select->fetch()) { return $qu_no; } else { return false; } } } } function fetch_quotation_no_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `quotation_no` from `quotation` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_quotation_no); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_quotation_no; } } return false; } } function get_max_invoice_no($bill_type) { if($stmt_select = $this->con->prepare("SELECT MAX(`invoice_no`) FROM `invoice` WHERE `bill_type`=?")) { $stmt_select->bind_param("s",$bill_type); $stmt_select->bind_result($qu_no); if($stmt_select->execute()) { $count = 0; $data = array(); if($stmt_select->fetch()) { return $qu_no; } else { return false; } } } } function fetch_invoice_no_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `invoice_no` from `invoice` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_quotation_no); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_quotation_no; } } return false; } } //2-8-21 function get_quotation_details_by_cust_id($res_sc_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `actual_amount`, `discount_amount`, `bill_type`, `quotation_no` FROM `quotation` WHERE `cust_id`=? ")) { $stmt_insert->bind_param("s",$res_sc_id); $stmt_insert->bind_result($id,$cust_id,$actual_amount,$discount_amount,$bill_type,$quotation_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $bill_type; $details[$counter][5] = $quotation_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_quatation_details_by_id() { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `actual_amount`, `discount_amount`, `bill_type`, `quotation_no` FROM `quotation` ")) { $stmt_insert->bind_result($id,$cust_id,$actual_amount,$discount_amount,$bill_type,$quotation_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $bill_type; $details[$counter][5] = $quotation_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_project_info($cust_id,$project_title,$deadline_date,$select_quotation,$project_description,$project_place) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `client_projects`(`cust_id`, `project_title`, `deadline_date`, `quotation_id`, `project_description`, `date`, `time`,`project_place`) VALUES(?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssss",$cust_id,$project_title,$deadline_date,$select_quotation,$project_description,$date,$time,$project_place); if($stmt_insert->execute()) { return true; } return false; } } function get_project_id($select_quotation) { if($stmt_select = $this->con->prepare("Select `id` from `client_projects` where `quotation_id` = ? ")) { $stmt_select->bind_param("s",$select_quotation); $stmt_select->bind_result($res_quotation_no); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_quotation_no; } } } } function get_project_information($customer_name) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `project_title`, `deadline_date`, `quotation_id`, `project_description`, `date`, `time`,`project_place` FROM `client_projects` WHERE `cust_id`LIKE '%".$customer_name."%'")) { $stmt_insert->bind_result($id,$cust_id,$project_title,$deadline_date,$quotation_id,$project_description,$date,$time,$project_place); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $cust_id; $details[$counter][2] = $project_title; $details[$counter][3] = $deadline_date; $details[$counter][4] = $quotation_id; $details[$counter][5] = $project_description; $details[$counter][6] = $date; $details[$counter][7] = $time; $details[$counter][8] = $project_place; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_project_by_id($edit_id) { $date = date("Y-m-d"); $time = date("H:i:s"); if($stmt_insert=$this->con->prepare("SELECT `id`, `cust_id`, `project_title`, `deadline_date`, `quotation_id`, `project_description`, `date`, `time`, `project_place` FROM `client_projects` WHERE `id`=?")) { $stmt_insert->bind_param("i",$edit_id); $stmt_insert->bind_result($id,$cust_id,$projec_title,$deadline_date,$quotation_id,$project_description,$date,$time,$project_place); if($stmt_insert->execute()) { $data = array(); if($stmt_insert->fetch()) { $data[0] = $id; $data[1] = $cust_id; $data[2] = $projec_title; $data[3] = $deadline_date; $data[4] = $quotation_id; $data[5] = $project_description; $data[6] = $date; $data[7] = $time; $data[8] = $project_place; return $data; } return false; } } } function add_project($title,$description) { $date = date("Y-m-d"); $time = date("H:i:s"); $status = "pending"; $completed_by = "-"; if($stmt_insert=$this->con->prepare("INSERT INTO `save_project`(`update_title`, `description`, `status`, `completed_by`, `date`, `time`) VALUES (?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssss",$title,$description,$status,$completed_by,$date,$time); if($stmt_insert->execute()) { return true; } return false; } } function get_quotation_details_by_qu_id($res_sc_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `actual_amount`, `discount_amount`, `bill_type`, `quotation_no` FROM `quotation` WHERE `id`=? ")) { $stmt_insert->bind_param("s",$res_sc_id); $stmt_insert->bind_result($id,$cust_id,$actual_amount,$discount_amount,$bill_type,$quotation_no); if($stmt_insert->execute()) { $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $cust_id; $details[2] = $actual_amount; $details[3] = $discount_amount; $details[4] = $bill_type; $details[5] = $quotation_no; return $details; } return false; } } } function delete_client_project($del_id) { if($stmt_select = $this->con->prepare("Delete from `client_projects` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_quotation_date_by_id($c_id) { if($stmt_select = $this->con->prepare("Select `date` from `quotation` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_quotation_no); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_quotation_no; } } return false; } } //3-8-21 function get_agreement_information_by_id($ag_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `cust_id`, `project_title`, `deadline_date`, `quotation_id`, `project_description`, `date`, `time`,`project_place` FROM `client_projects` WHERE `id`=?")) { $stmt_insert->bind_param("i",$ag_id); $stmt_insert->bind_result($id,$cust_id,$project_title,$deadline_date,$quotation_id,$project_description,$date,$time,$project_place); if($stmt_insert->execute()) { $counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $cust_id; $details[2] = $project_title; $details[3] = $deadline_date; $details[4] = $quotation_id; $details[5] = $project_description; $details[6] = $date; $details[7] = $time; $details[8] = $project_place; return $details; } else { return false; } } } } /*********************************************************************************************************/ function add_foodies_services($service,$price,$qty,$qty_alert) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `frenddy-foodies-services`(`services`,`price`,`qty`,`min_qty_alert`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { return true; } return false; } } function delete_foodies_services($del_id) { if($stmt_select = $this->con->prepare("Delete from `frenddy-foodies-services` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_foodies_service() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `frenddy-foodies-services`")) { $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function updates_foodies_services($service,$price,$qty,$qty_alert,$up_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `frenddy-foodies-services` set `services`= ? , `price`= ?, `qty`=?, `min_qty_alert`=? where `id` = ?")) { $stmt_select->bind_param("ssssi",$service,$price,$qty,$qty_alert,$up_id); if($stmt_select->execute()) { return true; } return false; } } function foodies_services($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `frenddy-foodies-services` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_service_name_from_foodies_by_id($service_id) { if($stmt_select = $this->con->prepare("Select `services` from `frenddy-foodies-services` where `id` = ? ")) { $stmt_select->bind_param("s",$service_id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function only_foodies_services() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `frenddy-foodies-services`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function get_temp_foodies_bill_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `tmp_foodies_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } }*/ function fetch_foodies_service_name($service) { if($stmt_select = $this->con->prepare("Select `services` from `frenddy-foodies-services` where `id` = ? ")) { $stmt_select->bind_param("i",$service); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function add_to_the_foodies_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price,$table_id) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_foodies_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type` ,`address`, `mobile_no`,`qty`,`single_price`,`table_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price,$table_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_foodies_bill($del_id) { if($stmt_select = $this->con->prepare("Delete from `tmp_foodies_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_max_foodies_bill_no($bill_type) { if($stmt_select = $this->con->prepare("SELECT MAX(`invoice_no`) FROM `foodies_bill` WHERE `bill_type`=?")) { $stmt_select->bind_param("s",$bill_type); $stmt_select->bind_result($qu_no); if($stmt_select->execute()) { $count = 0; $data = array(); if($stmt_select->fetch()) { return $qu_no; } else { return false; } } } } function get_temp_foodies_bill_info_for_display($table_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`, `service`,SUM(`actual_amount`),SUM(`discount_amount`), `comment`,`address`, `mobile_no`,`qty`,`single_price` FROM `tmp_foodies_bill` where `table_id`= '$table_id'")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function insert_foodies_bill_details($c_id,$actual_total_amount,$discount_total_amount,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty) { //echo $res_qty; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `foodies_bill`(`customer_id`, `total_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`invoice_no`,`address`, `mobile_no`,`qty`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$c_id,$actual_total_amount,$discount_total_amount,$date,$time,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } else{ return false; echo $stmt_insert->error; } } } function get_temp_foodies_bill_info($table_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price`,`table_id` FROM `tmp_foodies_bill` where `table_id` = '$table_id'")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price,$table_id); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $details[$counter][9] = $qty; $details[$counter][10] = $single_price; $details[$counter][11] = $table_id; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_to_the_foodies_bill_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type,$address,$mobile_no,$c_qty,$single_price) { //echo $c_qty; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `foodies_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type,$address,$mobile_no,$c_qty,$single_price); if($stmt_insert->execute()) { return true; } return false; } } function customer_name_from_bill_tbl() { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id` FROM `foodies_bill`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function add_to_the_foodies_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_foodies_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { return true; } else{ return false; echo $stmt_insert->error; } } }*/ function delete_foodies_bill_cart_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `foodies_bill_cart` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_main_foodies_bill_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `foodies_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_foodies_bill_report($customer_name,$bill_type,$from_date,$to_date) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`total_amount`,`discount_amount`,`comment`,`bill_type`,`invoice_no`,`address`,`mobile_no` FROM `foodies_bill` WHERE `customer_id` LIKE '%".$customer_name."%' AND `bill_type` LIKE '%".$bill_type."%' AND (`date` BETWEEN ? AND ?)")) { $stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$c_id,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $comment; $details[$counter][5] = $bill_type; $details[$counter][6] = $invoice_no; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_foodies_bill_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `invoice_no` from `foodies_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_foodies_bill_date_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `date` from `foodies_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_product_info_for_foodies_bill($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_type_from_foodies_bill($c_id) { if($stmt_select = $this->con->prepare("SELECT `bill_type` FROM `foodies_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function fetch_foodies_bill_cart_data_by_cust_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`qty`,`single_price` FROM `foodies_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_info_for_edit_by_id($edit_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id`, `address`, `mobile_no`, `total_amount`, `discount_amount`, `comment`, `bill_type`, `invoice_no` FROM `foodies_bill` WHERE `id` =? ")) { $stmt_insert->bind_param("i",$edit_id); $stmt_insert->bind_result($id,$c_id,$address,$mobile_no,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $c_id; $details[2] = $address; $details[3] = $mobile_no; $details[4] = $actual_amount; $details[5] = $discount_amount; $details[6] = $comment; $details[7] = $bill_type; $details[8] = $invoice_no; //$counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_foodies_bill_data_for_update($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `customer_id`,`service`,`actual_amount`,`discount_amount`,`address`,`mobile_no` FROM `foodies_bill_cart` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_actual_amount_by_id_foodies($c_id) { if($stmt_select = $this->con->prepare("Select `total_amount` from `foodies_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_discount_amount_by_id_foodies($c_id) { if($stmt_select = $this->con->prepare("Select `discount_amount` from `foodies_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_amount_invoice_details_foodies($up_id,$actual_amount,$discount_amount) { if($stmt_insert = $this->con->prepare("Update `foodies_bill` set `total_amount` = ?, `discount_amount` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$actual_amount,$discount_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_foodies_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `foodies_bill_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_total_amount_foodies_cart_info($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,SUM(`actual_amount`),SUM(`discount_amount`),`address`,`mobile_no` FROM `invoice_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$update_id); $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $address; $details[$counter][6] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_foodies_details_info($up_id,$actual_amount,$discount_amount,$bill_type) { if($stmt_insert = $this->con->prepare("Update `foodies_bill` set `total_amount` = ?, `discount_amount` = ? , `bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("sssi",$actual_amount,$discount_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function add_to_the_foodies_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `foodies_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function fetch_foodies_cart_data_by_transaction_id($tran_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`,`mobile_no` FROM `foodies_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$tran_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $address; $details[$counter][9] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_customer_id_from_foodies($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `foodies_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function delete_main_foodies_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `foodies_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_services_id_by_cust_id_foodies($c_id) { if($stmt_select = $this->con->prepare("Select `service` from `foodies_bill_cart` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$c_id); $stmt_select->bind_result($service); if($stmt_select->execute()) { $count = 0; $data = array(); while($stmt_select->fetch()) { $data[$count][0] = $service; $count++; } if(!empty($data)) { return $data; } } return false; } } /***********************************************************************/ function add_vcollection_services($service,$price,$qty,$qty_alert) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `vcollection-services`(`services`,`price`,`qty`,`min_qty_alert`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { return true; } return false; } } function delete_vcollection_services($del_id) { if($stmt_select = $this->con->prepare("Delete from `vcollection-services` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_vcollection_service() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `vcollection-services`")) { $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function updates_vcollection_services($service,$price,$qty,$qty_alert,$up_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `vcollection-services` set `services`= ?,`price`=?,`qty`=?, `min_qty_alert`=? where `id` = ?")) { $stmt_select->bind_param("ssssi",$service,$price,$qty,$qty_alert,$up_id); if($stmt_select->execute()) { return true; } return false; } } function vcollection_services($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `vcollection-services` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_service_name_from_vcollection_by_id($service_id) { if($stmt_select = $this->con->prepare("Select `services` from `vcollection-services` where `id` = ? ")) { $stmt_select->bind_param("s",$service_id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function only_vcollection_services() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `vcollection-services`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function get_temp_foodies_bill_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `tmp_foodies_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } }*/ function fetch_vcollection_service_name($service) { if($stmt_select = $this->con->prepare("Select `services` from `vcollection-services` where `id` = ? ")) { $stmt_select->bind_param("i",$service); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function add_to_the_vcollection_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_vcollection_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type` ,`address`, `mobile_no`,`qty`,`single_price`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { return true; } return false; } } function delete_vcollection_bill($del_id) { if($stmt_select = $this->con->prepare("Delete from `tmp_vcollection_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_max_vcollection_bill_no($bill_type) { if($stmt_select = $this->con->prepare("SELECT MAX(`invoice_no`) FROM `vcollection_bill` WHERE `bill_type`=?")) { $stmt_select->bind_param("s",$bill_type); $stmt_select->bind_result($qu_no); if($stmt_select->execute()) { $count = 0; $data = array(); if($stmt_select->fetch()) { return $qu_no; } else { return false; } } } } function get_temp_vcollection_bill_info_for_display() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`, `service`,SUM(`actual_amount`),SUM(`discount_amount`), `comment`,`address`, `mobile_no`,`qty`,`single_price` FROM `tmp_vcollection_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function insert_vcollection_bill_details($c_id,$actual_total_amount,$discount_total_amount,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty) { //echo $c_id; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `vcollection_bill`(`customer_id`, `total_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`invoice_no`,`address`, `mobile_no`,`qty`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$c_id,$actual_total_amount,$discount_total_amount,$date,$time,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } else{ return false; echo $stmt_insert->error; } } } /*function deduct_product_qty_from_vcollection_muster() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`, `mobile_no`,`qty` FROM `tmp_vcollection_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $details[$counter][9] = $qty; $counter++; } if(!empty($details)) { return $details; } return false; } } }*/ function add_to_the_vcollection_bill_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type,$address,$mobile_no,$qty,$single_price) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `vcollection_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { return true; } return false; } } function customer_name_from_bill_tbl_vcollection() { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id` FROM `vcollection_bill`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function add_to_the_foodies_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_foodies_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { return true; } else{ return false; echo $stmt_insert->error; } } }*/ function delete_vcollection_bill_cart_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `vcollection_bill_cart` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_main_vcollection_bill_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `vcollection_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_vcollection_bill_report($customer_name,$bill_type,$from_date,$to_date) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`total_amount`,`discount_amount`,`comment`,`bill_type`,`invoice_no`,`address`,`mobile_no` FROM `vcollection_bill` WHERE `customer_id` LIKE '%".$customer_name."%' AND `bill_type` LIKE '%".$bill_type."%' AND (`date` BETWEEN ? AND ?)")) { $stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$c_id,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $comment; $details[$counter][5] = $bill_type; $details[$counter][6] = $invoice_no; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_vcollection_bill_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `invoice_no` from `vcollection_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_vcollection_bill_date_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `date` from `vcollection_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_product_info_for_vcollection_bill($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_type_from_vcollection_bill($c_id) { if($stmt_select = $this->con->prepare("SELECT `bill_type` FROM `vcollection_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function fetch_vcollection_bill_cart_data_by_cust_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`qty`,`single_price` FROM `vcollection_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_info_for_edit_by_id_vcollection($edit_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id`, `address`, `mobile_no`, `total_amount`, `discount_amount`, `comment`, `bill_type`, `invoice_no` FROM `vcollection_bill` WHERE `id` =? ")) { $stmt_insert->bind_param("i",$edit_id); $stmt_insert->bind_result($id,$c_id,$address,$mobile_no,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $c_id; $details[2] = $address; $details[3] = $mobile_no; $details[4] = $actual_amount; $details[5] = $discount_amount; $details[6] = $comment; $details[7] = $bill_type; $details[8] = $invoice_no; //$counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_vcollection_bill_data_for_update($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `customer_id`,`service`,`actual_amount`,`discount_amount`,`address`,`mobile_no` FROM `vcollection_bill_cart` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_actual_amount_by_id_vcollection($c_id) { if($stmt_select = $this->con->prepare("Select `total_amount` from `vcollection_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_discount_amount_by_id_vcollection($c_id) { if($stmt_select = $this->con->prepare("Select `discount_amount` from `vcollection_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_amount_invoice_details_vcollection($up_id,$actual_amount,$discount_amount) { if($stmt_insert = $this->con->prepare("Update `vcollection_bill` set `total_amount` = ?, `discount_amount` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$actual_amount,$discount_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_vcollection_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `vcollection_bill_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_total_amount_vcollection_cart_info($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,SUM(`actual_amount`),SUM(`discount_amount`),`address`,`mobile_no` FROM `vcollection_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$update_id); $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $address; $details[$counter][6] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function fetch_customer_id_from_foodies($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `foodies_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } }*/ function update_vcollection_details_info($up_id,$actual_amount,$discount_amount,$bill_type) { if($stmt_insert = $this->con->prepare("Update `vcollection_bill` set `total_amount` = ?, `discount_amount` = ? , `bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("sssi",$actual_amount,$discount_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function add_to_the_vcollection_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `vcollection_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function fetch_vcollection_cart_data_by_transaction_id($tran_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`,`mobile_no` FROM `vcollection_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$tran_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $address; $details[$counter][9] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_customer_id_from_vcollection($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `vcollection_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function delete_main_vcollection_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `vcollection_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_services_id_by_cust_id_vcollection($c_id) { if($stmt_select = $this->con->prepare("Select `service` from `vcollection_bill_cart` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$c_id); $stmt_select->bind_result($service); if($stmt_select->execute()) { $count = 0; $data = array(); while($stmt_select->fetch()) { $data[$count][0] = $service; $count++; } if(!empty($data)) { return $data; } } return false; } } /*****************************************************************************/ function add_parlour_services($service,$price,$qty,$qty_alert) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `parlour-services`(`services`,`price`,`qty`,`min_qty_alert`) VALUES (?,?,?,?)")) { $stmt_insert->bind_param("ssss",$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { return true; } return false; } } function delete_parlour_services($del_id) { if($stmt_select = $this->con->prepare("Delete from `parlour-services` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_parlour_service() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `parlour-services`")) { $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function updates_parlour_services($service,$price,$qty,$qty_alert,$up_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("update `parlour-services` set `services`= ? ,`price` =?,`qty`=?,`min_qty_alert`=? where `id` = ?")) { $stmt_select->bind_param("ssssi",$service,$price,$qty,$qty_alert,$up_id); if($stmt_select->execute()) { return true; } return false; } } function parlour_services($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`services`,`price`,`qty`,`min_qty_alert` FROM `parlour-services` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$service,$price,$qty,$qty_alert); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $service; $details[$counter][2] = $price; $details[$counter][3] = $qty; $details[$counter][4] = $qty_alert; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_service_name_from_parlour_by_id($service_id) { if($stmt_select = $this->con->prepare("Select `services` from `parlour-services` where `id` = ? ")) { $stmt_select->bind_param("s",$service_id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function only_parlour_services() { if($stmt_insert = $this->con->prepare("SELECT `id`,`services` FROM `parlour-services`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function get_temp_foodies_bill_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type` FROM `tmp_foodies_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $counter++; } if(!empty($details)) { return $details; } return false; } } }*/ function fetch_parlour_service_name($service) { if($stmt_select = $this->con->prepare("Select `services` from `parlour-services` where `id` = ? ")) { $stmt_select->bind_param("i",$service); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } return false; } } function add_to_the_parlour_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_parlour_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type` ,`address`, `mobile_no`,`qty`,`single_price`) VALUES (?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { return true; } return false; } } function delete_parlour_bill($del_id) { if($stmt_select = $this->con->prepare("Delete from `tmp_parlour_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_max_parlour_bill_no($bill_type) { if($stmt_select = $this->con->prepare("SELECT MAX(`invoice_no`) FROM `parlour_bill` WHERE `bill_type`=?")) { $stmt_select->bind_param("s",$bill_type); $stmt_select->bind_result($qu_no); if($stmt_select->execute()) { $count = 0; $data = array(); if($stmt_select->fetch()) { return $qu_no; } else { return false; } } } } function get_temp_parlour_bill_info_for_display() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`, `service`,SUM(`actual_amount`),SUM(`discount_amount`), `comment`,`address`, `mobile_no`,`qty`,`single_price` FROM `tmp_parlour_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function insert_parlour_bill_details($c_id,$actual_total_amount,$discount_total_amount,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty) { //echo $c_id; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `parlour_bill`(`customer_id`, `total_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`invoice_no`,`address`, `mobile_no`,`qty`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$c_id,$actual_total_amount,$discount_total_amount,$date,$time,$res_comment,$bill_type,$max_invoice_no,$res_address,$res_mobile_no,$res_qty); if($stmt_insert->execute()) { return $stmt_insert->insert_id; } else{ return false; echo $stmt_insert->error; } } } function get_temp_parlour_bill_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price` FROM `tmp_parlour_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $details[$counter][9] = $qty; $details[$counter][10] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function add_to_the_parlour_bill_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type,$address,$mobile_no,$qty,$single_price) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `parlour_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { return true; } return false; } } function customer_name_from_bill_tbl_parlour() { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id` FROM `parlour_bill`")) { $stmt_insert->bind_result($id,$name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function add_to_the_foodies_bill($c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type) { $invoice_note = ""; $other_details = ""; $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `tmp_foodies_bill`(`customer_id`, `service`, `actual_amount`, `discount_amount`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssss",$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type); if($stmt_insert->execute()) { return true; } else{ return false; echo $stmt_insert->error; } } }*/ function delete_parlour_bill_cart_data($del_id) { if($stmt_select = $this->con->prepare("Delete from `parlour_bill_cart` where `transaction_id`=?")) { $stmt_select->bind_param("s",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_main_parlour_bill_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `parlour_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_parlour_bill_report($customer_name,$bill_type,$from_date,$to_date) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`total_amount`,`discount_amount`,`comment`,`bill_type`,`invoice_no`,`address`,`mobile_no` FROM `parlour_bill` WHERE `customer_id` LIKE '%".$customer_name."%' AND `bill_type` LIKE '%".$bill_type."%' AND (`date` BETWEEN ? AND ?)")) { $stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$c_id,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $actual_amount; $details[$counter][3] = $discount_amount; $details[$counter][4] = $comment; $details[$counter][5] = $bill_type; $details[$counter][6] = $invoice_no; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_parlour_bill_id_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `invoice_no` from `parlour_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_parlour_bill_date_by_cust_id($c_id) { if($stmt_select = $this->con->prepare("Select `date` from `parlour_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function get_all_product_info_for_parlour_bill($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`name`, `office_name`,`email`, `address`, `primary_contact_no`, `other_contact_no`,`logo`,`password` FROM `customers` where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$name,$shop_name,$email,$address,$primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $name; $details[$counter][2] = $shop_name; $details[$counter][3] = $email; $details[$counter][4] = $address; $details[$counter][5] = $primary_contact; $details[$counter][6] = $other_contact; $details[$counter][7] = $logo; $details[$counter][8] = $password; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_type_from_parlour_bill($c_id) { if($stmt_select = $this->con->prepare("SELECT `bill_type` FROM `parlour_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function fetch_parlour_bill_cart_data_by_cust_id($c_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`qty`,`single_price` FROM `parlour_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$c_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $qty; $details[$counter][9] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_bill_info_for_edit_by_id_parlour($edit_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `customer_id`, `total_amount`, `discount_amount`, `comment`, `bill_type`, `invoice_no`, `address`, `mobile_no`,`qty` FROM `parlour_bill` WHERE `id` =? ")) { $stmt_insert->bind_param("i",$edit_id); $stmt_insert->bind_result($id,$c_id,$actual_amount,$discount_amount,$comment,$bill_type,$invoice_no,$address,$mobile_no,$qty); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $c_id; $details[2] = $address; $details[3] = $mobile_no; $details[4] = $actual_amount; $details[5] = $discount_amount; $details[6] = $comment; $details[7] = $bill_type; $details[8] = $invoice_no; $details[9] = $qty; //$details[10]= $single_price; //$counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_parlour_bill_data_for_update($id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`, `customer_id`,`service`,`actual_amount`,`discount_amount`,`address`,`mobile_no` FROM `parlour_bill_cart` Where `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $address; $details[$counter][7] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_actual_amount_by_id_parlour($c_id) { if($stmt_select = $this->con->prepare("Select `total_amount` from `parlour_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function fetch_discount_amount_by_id_parlour($c_id) { if($stmt_select = $this->con->prepare("Select `discount_amount` from `parlour_bill` where `id` = ? ")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($result_password); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_password; } } return false; } } function update_amount_invoice_details_parlour($up_id,$actual_amount,$discount_amount) { if($stmt_insert = $this->con->prepare("Update `parlour_bill` set `total_amount` = ?, `discount_amount` = ? Where `id` = ?")) { $stmt_insert->bind_param("ssi",$actual_amount,$discount_amount,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function delete_parlour_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `parlour_bill_cart` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_total_amount_parlour_cart_info($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,SUM(`actual_amount`),SUM(`discount_amount`),`address`,`mobile_no` FROM `parlour_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$update_id); $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $address; $details[$counter][6] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } /*function fetch_customer_id_from_foodies($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `foodies_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } }*/ function update_parlour_details_info($up_id,$actual_amount,$discount_amount,$bill_type) { if($stmt_insert = $this->con->prepare("Update `parlour_bill` set `total_amount` = ?, `discount_amount` = ? , `bill_type`=? Where `id` = ?")) { $stmt_insert->bind_param("sssi",$actual_amount,$discount_amount,$bill_type,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function add_to_the_parlour_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `parlour_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`) VALUES (?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type); if($stmt_insert->execute()) { return true; } return false; } } function fetch_parlour_cart_data_by_transaction_id($tran_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`transaction_id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`,`mobile_no` FROM `parlour_bill_cart` Where `transaction_id` = ?")) { $stmt_insert->bind_param("s",$tran_id); $stmt_insert->bind_result($id,$t_id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $t_id; $details[$counter][2] = $c_id; $details[$counter][3] = $service; $details[$counter][4] = $actual_amount; $details[$counter][5] = $discount_amount; $details[$counter][6] = $comment; $details[$counter][7] = $bill_type; $details[$counter][8] = $address; $details[$counter][9] = $mobile_no; $counter++; } if(!empty($details)) { return $details; } return false; } } } function fetch_customer_id_from_parlour($c_id) { if($stmt_select = $this->con->prepare("SELECT `customer_id` FROM `parlour_bill` WHERE `id`=?")) { $stmt_select->bind_param("i",$c_id); $stmt_select->bind_result($res_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $res_id; } } return false; } } function delete_main_parlour_cart($del_id) { if($stmt_select = $this->con->prepare("Delete from `parlour_bill` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function fetch_services_id_by_cust_id_parlour($c_id) { if($stmt_select = $this->con->prepare("Select `service` from `parlour_bill_cart` where `transaction_id` = ? ")) { $stmt_select->bind_param("s",$c_id); $stmt_select->bind_result($service); if($stmt_select->execute()) { $count = 0; $data = array(); while($stmt_select->fetch()) { $data[$count][0] = $service; $count++; } if(!empty($data)) { return $data; } } return false; } } function get_all_enquiry_info($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `name`, `office_name`, `email`, `address`, `primary_contact_no`, `other_contact_no`, `logo`, `password` FROM `internship_students` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$res_name,$shop_name,$res_email,$res_address,$res_primary_contact,$other_contact,$logo,$password); if($stmt_insert->execute()) { $counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $id; $details[1] = $res_name; $details[2] = $shop_name; $details[3] = $res_email; $details[4] = $res_address; $details[5] = $res_primary_contact; $details[6] = $other_contact; $details[7] = $logo; $details[8] = $password; //$counter++; } if(!empty($details)) { return $details; } return false; } } } function update_enquiry_information($name,$c_email,$address,$primary_contact,$update_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `internship_students` SET `name`=?,`email`=?,`address`=?,`primary_contact_no`=? WHERE `id`=?")) { $stmt_select->bind_param("ssssi",$name,$c_email,$address,$primary_contact,$update_id); if($stmt_select->execute()) { return true; } return false; } } function get_product_price_by_name($product_id) { //echo $product_id; if($stmt_insert = $this->con->prepare("SELECT `price` FROM `frenddy-foodies-services` WHERE `id`=?")) { $stmt_insert->bind_param("i",$product_id); $stmt_insert->bind_result($price); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $price; } return false; } } } function get_vcollection_product_price_by_name($product_id) { //echo $product_id; if($stmt_insert = $this->con->prepare("SELECT `price` FROM `vcollection-services` WHERE `id`=?")) { $stmt_insert->bind_param("i",$product_id); $stmt_insert->bind_result($price); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $price; } return false; } } } function get_parlour_product_price_by_name($product_id) { //echo $product_id; if($stmt_insert = $this->con->prepare("SELECT `price` FROM `parlour-services` WHERE `id`=?")) { $stmt_insert->bind_param("i",$product_id); $stmt_insert->bind_result($price); if($stmt_insert->execute()) { if($stmt_insert->fetch()) { return $price; } return false; } } } /*function add_to_the_vcollection_bill_cart($insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$comments,$bill_type,$address,$mobile_no) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `vcollection_bill_cart`(`transaction_id`,`customer_id`, `service`, `actual_amount`, `discount_amount`,`date` ,`time`,`comment`,`bill_type`,`address`, `mobile_no`) VALUES (?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("sssssssssss",$insert_id,$c_id,$service_id,$actual_total_amount,$discount_total_amount,$date,$time,$comments,$bill_type,$address,$mobile_no); if($stmt_insert->execute()) { return true; } return false; } }*/ /********************************************************************************************************/ function add_instock_foodies($medicine_name,$available_qty,$purchase_price) { $current_date = date("Y-m-d"); $current_time = date("h-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `instock_foodies_products`( `medicine_name`, `available_qty`, `purchase_price`, `date`, `time`) VALUES (?,?,?,?,?)")) { $stmt_insert->bind_param("sssss",$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { return true; } return false; } } function add_instock_parlour_products($medicine_name,$available_qty,$purchase_price) { $current_date = date("Y-m-d"); $current_time = date("h-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `instock_parlour_products`( `medicine_name`, `available_qty`, `purchase_price`, `date`, `time`) VALUES (?,?,?,?,?)")) { $stmt_insert->bind_param("sssss",$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { return true; } return false; } } function add_instock_vcollection_products($medicine_name,$available_qty,$purchase_price) { $current_date = date("Y-m-d"); $current_time = date("h-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `instock_vcollection_products`( `medicine_name`, `available_qty`, `purchase_price`, `date`, `time`) VALUES (?,?,?,?,?)")) { $stmt_insert->bind_param("sssss",$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { return true; } return false; } } function update_product_qty_in_foodies_product_tbl($available_qty,$medicine_name) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `frenddy-foodies-services` SET `qty`= `qty`+ '$available_qty' WHERE `services`= ?")) { $stmt_select->bind_param("s",$medicine_name); if($stmt_select->execute()) { return true; } return false; } } function update_product_qty_in_parlour_product_tbl($available_qty,$medicine_name) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `parlour-services` SET `qty`= `qty`+ '$available_qty' WHERE `services`= ?")) { $stmt_select->bind_param("s",$medicine_name); if($stmt_select->execute()) { return true; } return false; } } function update_product_qty_in_vcollection_product_tbl($available_qty,$medicine_name) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `vcollection-services` SET `qty`= `qty`+ '$available_qty' WHERE `services`= ?")) { $stmt_select->bind_param("s",$medicine_name); if($stmt_select->execute()) { return true; } return false; } } function get_distinct_foodies_product_name() { if($stmt_insert = $this->con->prepare("SELECT DISTINCT `services` FROM `frenddy-foodies-services`")) { $stmt_insert->bind_result($medicine_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $medicine_id; $details[$counter][1] = $medicine_name; /*$details[$counter][2] = $available_qty; $details[$counter][3] = $medicine_status; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time;*/ $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_distinct_vcollection_product_name() { if($stmt_insert = $this->con->prepare("SELECT DISTINCT `services` FROM `vcollection-services`")) { $stmt_insert->bind_result($medicine_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $medicine_id; $details[$counter][1] = $medicine_name; /*$details[$counter][2] = $available_qty; $details[$counter][3] = $medicine_status; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time;*/ $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_distinct_parlour_product_name() { if($stmt_insert = $this->con->prepare("SELECT DISTINCT `services` FROM `parlour-services`")) { $stmt_insert->bind_result($medicine_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $medicine_id; $details[$counter][1] = $medicine_name; /*$details[$counter][2] = $available_qty; $details[$counter][3] = $medicine_status; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time;*/ $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_foodies_stock_products($del_id) { if($stmt_select = $this->con->prepare("Delete from `instock_foodies_products` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_vcollection_stock_products($del_id) { if($stmt_select = $this->con->prepare("Delete from `instock_vcollection_products` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_parlour_stock_products($del_id) { if($stmt_select = $this->con->prepare("Delete from `instock_parlour_products` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_foodies_stock() { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`, `available_qty`, `purchase_price`, `date`, `time` FROM `instock_foodies_products`")) { //$stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $medicine_name; $details[$counter][2] = $available_qty; $details[$counter][3] = $purchase_price; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_vcollection_stock() { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`, `available_qty`, `purchase_price`, `date`, `time` FROM `instock_vcollection_products`")) { //$stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $medicine_name; $details[$counter][2] = $available_qty; $details[$counter][3] = $purchase_price; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_parlour_stock() { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`, `available_qty`, `purchase_price`, `date`, `time` FROM `instock_parlour_products`")) { //$stmt_insert->bind_param("ss",$from_date,$to_date); $stmt_insert->bind_result($id,$medicine_name,$available_qty,$purchase_price,$current_date,$current_time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $medicine_name; $details[$counter][2] = $available_qty; $details[$counter][3] = $purchase_price; $details[$counter][4] = $current_date; $details[$counter][5] = $current_time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_foodies_stock_info($medicine_name,$available_qty,$purchase_price,$update_id) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `instock_foodies_products` SET `medicine_name`=?,`available_qty`= ?,`purchase_price`=? WHERE `id`= ?")) { $stmt_select->bind_param("sssi",$medicine_name,$available_qty,$purchase_price,$update_id); if($stmt_select->execute()) { return true; } return false; } } function get_foodies_stock_info_by_id($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`,`available_qty`, `purchase_price` FROM `instock_foodies_products` WHERE `id`=?")) { $stmt_insert->bind_param("i",$update_id); $stmt_insert->bind_result($res_id,$res_medicine_name,$res_available_qty,$res_purchase_price); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $res_id; $details[1] = $res_medicine_name; $details[2] = $res_available_qty; $details[3] = $res_purchase_price; } if(!empty($details)) { return $details; } return false; } } } function update_vcollection_stock_info($medicine_name,$available_qty,$purchase_price,$update_id) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `instock_vcollection_products` SET `medicine_name`=?,`available_qty`= ?,`purchase_price`=? WHERE `id`= ?")) { $stmt_select->bind_param("sssi",$medicine_name,$available_qty,$purchase_price,$update_id); if($stmt_select->execute()) { return true; } return false; } } function get_vcollection_stock_info_by_id($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`,`available_qty`, `purchase_price` FROM `instock_vcollection_products` WHERE `id`=?")) { $stmt_insert->bind_param("i",$update_id); $stmt_insert->bind_result($res_id,$res_medicine_name,$res_available_qty,$res_purchase_price); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $res_id; $details[1] = $res_medicine_name; $details[2] = $res_available_qty; $details[3] = $res_purchase_price; } if(!empty($details)) { return $details; } return false; } } } function update_parlour_stock_info($medicine_name,$available_qty,$purchase_price,$update_id) { //$date_time = date("Y-m-d H:i:s"); $date = date("Y-m-d"); $time = date("H:i:s A"); if($stmt_select = $this->con->prepare("UPDATE `instock_parlour_products` SET `medicine_name`=?,`available_qty`= ?,`purchase_price`=? WHERE `id`= ?")) { $stmt_select->bind_param("sssi",$medicine_name,$available_qty,$purchase_price,$update_id); if($stmt_select->execute()) { return true; } return false; } } function get_parlour_stock_info_by_id($update_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`medicine_name`,`available_qty`, `purchase_price` FROM `instock_parlour_products` WHERE `id`=?")) { $stmt_insert->bind_param("i",$update_id); $stmt_insert->bind_result($res_id,$res_medicine_name,$res_available_qty,$res_purchase_price); if($stmt_insert->execute()) { //$counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[0] = $res_id; $details[1] = $res_medicine_name; $details[2] = $res_available_qty; $details[3] = $res_purchase_price; } if(!empty($details)) { return $details; } return false; } } } function deduct_product_qty_from_foodies_muster($service,$c_qty) { if($stmt_select = $this->con->prepare("update `frenddy-foodies-services` set `qty`= `qty` - '$c_qty' where `id` = ?")) { $stmt_select->bind_param("i",$service); if($stmt_select->execute()) { return true; } return false; } } function deduct_product_qty_from_parlour_muster($service,$c_qty) { if($stmt_select = $this->con->prepare("update `parlour-services` set `qty`= `qty` - '$c_qty' where `id` = ?")) { $stmt_select->bind_param("i",$service); if($stmt_select->execute()) { return true; } return false; } } function deduct_product_qty_from_vcollection_muster($service,$c_qty) { if($stmt_select = $this->con->prepare("update `vcollection-services` set `qty`= `qty` - '$c_qty' where `id` = ?")) { $stmt_select->bind_param("i",$service); if($stmt_select->execute()) { return true; } return false; } } function get_temp_vcollection_bill_info() { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`service`,`actual_amount`,`discount_amount`,`comment`,`bill_type`,`address`, `mobile_no`,`qty`,`single_price` FROM `tmp_vcollection_bill`")) { $stmt_insert->bind_result($id,$c_id,$service,$actual_amount,$discount_amount,$comment,$bill_type,$address,$mobile_no,$qty,$single_price); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $c_id; $details[$counter][2] = $service; $details[$counter][3] = $actual_amount; $details[$counter][4] = $discount_amount; $details[$counter][5] = $comment; $details[$counter][6] = $bill_type; $details[$counter][7] = $address; $details[$counter][8] = $mobile_no; $details[$counter][9] = $qty; $details[$counter][10] = $single_price; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_tmp_data_for_display_by_tbl_id($table_id) { if($stmt_insert = $this->con->prepare("SELECT `id`,`customer_id`,`address`, `mobile_no` FROM `tmp_foodies_bill` where `table_id`=?" )) { $stmt_insert->bind_param("s",$table_id); $stmt_insert->bind_result($display_id,$display_name,$display_address,$display_mobile_no); if($stmt_insert->execute()) { $details = array(); if($stmt_insert->fetch()) { $details[0] = $display_id; $details[1] = $display_name; $details[2] = $display_address; $details[3] = $display_mobile_no; } if(!empty($details)) { return $details; } return false; } } } function add_staff($var_name,$var_address,$var_mobile_no,$var_user_type,$var_password) { $current_date = date("Y-m-d"); $current_time = date("h:i:s A"); if($stmt = $this->con->prepare("INSERT INTO `staff`(`name`, `address`, `mobile_no`, `user_type`, `password`, `date`, `time`) VALUES (?,?,?,?,?,?,?)")) { $stmt->bind_param("sssssss",$var_name,$var_address,$var_mobile_no,$var_user_type,$var_password,$current_date,$current_time); if($stmt->execute()) { return true; } } return false; } function get_all_staff_info() { if($stmt = $this->con->prepare("SELECT `id`, `name`, `address`, `mobile_no`, `user_type`, `password`, `date`, `time` FROM `staff` ")) { $stmt->bind_result($res_id,$res_name,$res_address,$res_mobile_no,$res_user_type,$res_password,$res_date,$res_time); if($stmt->execute()) { $data = array(); $counter = 0; while($stmt->fetch()) { $data[$counter][0] = $res_id; $data[$counter][1] = $res_name; $data[$counter][2] = $res_address; $data[$counter][3] = $res_mobile_no; $data[$counter][4] = $res_user_type; $data[$counter][5] = $res_password; $data[$counter][6]=$res_date; $data[$counter][7]=$res_time; $counter++; } if(!empty($data)) { return $data; } else { return false; } } } } function delete_staff_form($delete_id) { if($stmt = $this->con->prepare("DELETE FROM `staff` WHERE `id`=?")) { $stmt->bind_param("i",$delete_id); if($stmt->execute()) { return true; } return false; } } function update_staff_details($var_name,$var_address,$var_mobile_no,$var_user_type,$var_password,$var_edit_id) { $current_date = date("Y-m-d"); $current_time = date("h:i:s A"); if($stmt = $this->con->prepare("UPDATE `staff` SET `name`=?,`address`=?,`mobile_no`=?,`user_type`=?,`password`=?,`date`=?,`time`=? WHERE `id`=?")) { $stmt->bind_param("sssssssi",$var_name,$var_address,$var_mobile_no,$var_user_type,$var_password,$current_date,$current_time,$var_edit_id); if($stmt->execute()) { return true; } return false; } } function get_staff_form_details($var_edit_id) { if($stmt = $this->con->prepare("SELECT `id`, `name`, `address`, `mobile_no`, `user_type`, `password`, `date`, `time` FROM `staff` WHERE `id`=?")) { $stmt->bind_param("i",$var_edit_id); $stmt->bind_result($res_id,$res_name,$res_address,$res_mobile_no,$res_user_type,$res_password,$res_date,$res_time); if($stmt->execute()) { $data = array(); $counter = 0; if($stmt->fetch()) { $data[0] = $res_id; $data[1] = $res_name; $data[2] = $res_address; $data[3] = $res_mobile_no; $data[4] = $res_user_type; $data[5] = $res_password; $data[6]=$res_date; $data[7]=$res_time; return $data; } return false; } } } function get_user_type_from_mobile_no($mobile_no) { if($stmt_select = $this->con->prepare("Select `user_type` from `staff` where `mobile_no` = ? ")) { $stmt_select->bind_param("s",$mobile_no); $stmt_select->bind_result($result_user_type); if($stmt_select->execute()) { if($stmt_select->fetch()) { echo $result_user_type; return $result_user_type; } } return false; } } function get_id_from_product_name_to_check($service) { if($stmt_select = $this->con->prepare("Select `id` from `frenddy-foodies-services` where `services` = ? ")) { $stmt_select->bind_param("s",$service); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_exist_item($table_no) { if($stmt_select = $this->con->prepare("Select `id` from `tmp_foodies_bill` where `table_id` = ? ")) { $stmt_select->bind_param("s",$table_no); $stmt_select->bind_result($exist_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $exist_id; } } return false; } } function get_id_from_product_name_to_check_vcollection($service) { if($stmt_select = $this->con->prepare("Select `id` from `vcollection-services` where `services` = ? ")) { $stmt_select->bind_param("s",$service); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } function get_id_from_product_name_to_check_parlour($service) { if($stmt_select = $this->con->prepare("Select `id` from `parlour-services` where `services` = ? ")) { $stmt_select->bind_param("s",$service); $stmt_select->bind_result($result_id); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_id; } } return false; } } //22/5/24 function add_admission_form($date_of_admission,$center,$name_patient,$gender,$address,$is_rural,$city,$state,$pin,$phone,$mobile,$email,$date_of_birth,$age,$religion,$education_qualification,$occupation,$incone_per_month,$family,$marital_status,$living_arrangements,$name_family_member,$address_family_mem,$phone_family,$mobile_family,$email_family,$referred_by,$reason_of_addiction,$type_addiction,$jaundice,$malena,$hemelemesis,$convulsion,$ascitis,$chronic_pedal_oedems,$psychiatric_problem,$heart_attack,$shock,$tia,$kochs,$ht,$dm,$aadhar_no,$pratidnya_name,$pratidnya_address,$pratidnya_mobile,$pratidnya_age,$status,$relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name) { $date = date("Y-m-d"); $time = date("h:i:s A"); if($stmt = $this->con->prepare("INSERT INTO `admission_form`(`date_of_admission`, `center`, `name_patient`, `gender`, `address`, `is_rural`, `city`, `state`, `pin`, `phone`, `mobile`, `email`, `date_of_birth`, `age`, `religion`, `education_qualification`, `occupation`, `incone_per_month`, `family`, `marital_status`, `living_arrangements`, `name_family_member`, `address_family_mem`, `phone_family`, `mobile_family`, `email_family`, `referred_by`, `reason_of_addiction`, `type_addiction`, `jaundice`, `malena`, `hemelemesis`, `convulsion`, `ascitis`, `chronic_pedal_oedems`, `psychiatric_problem`, `heart_attack`, `shock`, `tia`, `kochs`, `ht`, `dm`, `aadhar_no`, `pratidnya_name`, `pratidnya_address`, `pratidnya_mobile`, `pratidnya_age`, `date`, `time`,`status`,`relation`,`totalamount`,`dcotor_name`,`discharge_date`,`samupdeshk_name`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt->bind_param("sssssssssssssssssssssssssssssssssssssssssssssssssssssss",$date_of_admission,$center,$name_patient,$gender,$address,$is_rural,$city,$state,$pin,$phone,$mobile,$email,$date_of_birth,$age,$religion,$education_qualification,$occupation,$incone_per_month,$family,$marital_status,$living_arrangements,$name_family_member,$address_family_mem,$phone_family,$mobile_family,$email_family,$referred_by,$reason_of_addiction,$type_addiction,$jaundice,$malena,$hemelemesis,$convulsion,$ascitis,$chronic_pedal_oedems,$psychiatric_problem,$heart_attack,$shock,$tia,$kochs,$ht,$dm,$aadhar_no,$pratidnya_name,$pratidnya_address,$pratidnya_mobile,$pratidnya_age,$date,$time,$status,$relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name); if($stmt->execute()) { return true; } } return false; } function insert_item_master($item_name) { $date = date("Y-m-d"); $time = date("h:i:s A"); if($stmt = $this->con->prepare("INSERT INTO `item_master`(`item_name`,`date`,`time`) VALUES (?,?,?)")) { $stmt->bind_param("sss",$item_name,$date,$time); if($stmt->execute()) { return true; } } return false; } function get_all_admission_report() { if($stmt_insert = $this->con->prepare("SELECT `id`, `date_of_admission`, `center`, `name_patient`, `gender`, `address`, `is_rural`, `city`, `state`, `pin`, `phone`, `mobile`, `email`, `date_of_birth`, `age`, `religion`, `education_qualification`, `occupation`, `incone_per_month`, `family`, `marital_status`, `living_arrangements`, `name_family_member`, `address_family_mem`, `phone_family`, `mobile_family`, `email_family`, `referred_by`, `reason_of_addiction`, `type_addiction`, `jaundice`, `malena`, `hemelemesis`, `convulsion`, `ascitis`, `chronic_pedal_oedems`, `psychiatric_problem`, `heart_attack`, `shock`, `tia`, `kochs`, `ht`, `dm`, `aadhar_no`, `pratidnya_name`, `pratidnya_address`, `pratidnya_mobile`, `pratidnya_age`, `date`, `time`, `status`, `relation`, `totalamount`, `dcotor_name`, `discharge_date`, `samupdeshk_name` FROM `admission_form`")) { $stmt_insert->bind_result($id,$date_of_admission,$center,$name_patient,$gender,$address,$is_rural,$city,$state,$pin,$phone,$mobile,$email,$date_of_birth,$age,$religion,$education_qualification,$occupation,$incone_per_month,$family,$marital_status,$living_arrangements,$name_family_member,$address_family_mem,$phone_family,$mobile_family,$email_family,$referred_by,$reason_of_addiction,$type_addiction,$jaundice,$malena,$hemelemesis,$convulsion,$ascitis,$chronic_pedal_oedems,$psychiatric_problem,$heart_attack,$shock,$tia,$kochs,$ht,$dm,$aadhar_no,$pratidnya_name,$pratidnya_address,$pratidnya_mobile,$pratidnya_age,$date,$time,$status,$relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $date_of_admission; $details[$counter][2] = $center; $details[$counter][3] = $name_patient; $details[$counter][4] = $gender; $details[$counter][5] = $address; $details[$counter][6] = $is_rural; $details[$counter][7] = $city; $details[$counter][8] = $state; $details[$counter][9] = $pin; $details[$counter][10] = $phone; $details[$counter][11] = $mobile; $details[$counter][12] = $email; $details[$counter][13] = $date_of_birth; $details[$counter][14] = $age; $details[$counter][15] = $religion; $details[$counter][16] = $education_qualification; $details[$counter][17] = $occupation; $details[$counter][18] = $incone_per_month; $details[$counter][19] = $family; $details[$counter][20] = $marital_status; $details[$counter][21] = $living_arrangements; $details[$counter][22] = $name_family_member; $details[$counter][23] = $address_family_mem; $details[$counter][24] = $phone_family; $details[$counter][25] = $mobile_family; $details[$counter][26] = $email_family; $details[$counter][27] = $referred_by; $details[$counter][28] = $reason_of_addiction; $details[$counter][29] = $type_addiction; $details[$counter][30] = $jaundice; $details[$counter][31] = $malena; $details[$counter][32] = $hemelemesis; $details[$counter][33] = $convulsion; $details[$counter][34] = $ascitis; $details[$counter][35] = $chronic_pedal_oedems; $details[$counter][36] = $psychiatric_problem; $details[$counter][37] = $heart_attack; $details[$counter][38] = $shock; $details[$counter][39] = $tia; $details[$counter][40] = $kochs; $details[$counter][41] = $ht; $details[$counter][42] = $dm; $details[$counter][43] = $aadhar_no; $details[$counter][44] = $pratidnya_name; $details[$counter][45] = $pratidnya_address; $details[$counter][46] = $pratidnya_mobile; $details[$counter][47] = $pratidnya_age; $details[$counter][48] = $date; $details[$counter][49] = $time; $details[$counter][50] = $status; $details[$counter][51] = $totalamount; $details[$counter][52] = $dcotor_name; $details[$counter][53] = $discharge_date; $details[$counter][54] = $samupdeshk_name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_admission($del_id) { if($stmt_select = $this->con->prepare("Delete from `admission_form` where `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function delete_item_master($del_id) { if($stmt_select = $this->con->prepare("DELETE FROM `item_master` WHERE `id`=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_admission_info($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `date_of_admission`, `center`, `name_patient`, `gender`, `address`, `is_rural`, `city`, `state`, `pin`, `phone`, `mobile`, `email`, `date_of_birth`, `age`, `religion`, `education_qualification`, `occupation`, `incone_per_month`, `family`, `marital_status`, `living_arrangements`, `name_family_member`, `address_family_mem`, `phone_family`, `mobile_family`, `email_family`, `referred_by`, `reason_of_addiction`, `type_addiction`, `jaundice`, `malena`, `hemelemesis`, `convulsion`, `ascitis`, `chronic_pedal_oedems`, `psychiatric_problem`, `heart_attack`, `shock`, `tia`, `kochs`, `ht`, `dm`, `aadhar_no`, `pratidnya_name`, `pratidnya_address`, `pratidnya_mobile`, `pratidnya_age`, `date`, `time`,`relation`,`totalamount`, `dcotor_name`, `discharge_date`, `samupdeshk_name` FROM `admission_form` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($id,$date_of_admission,$center,$name_patient,$gender,$address,$is_rural,$city,$state,$pin,$phone,$mobile,$email,$date_of_birth,$age,$religion,$education_qualification,$occupation,$incone_per_month,$family,$marital_status,$living_arrangements,$name_family_member,$address_family_mem,$phone_family,$mobile_family,$email_family,$referred_by,$reason_of_addiction,$type_addiction,$jaundice,$malena,$hemelemesis,$convulsion,$ascitis,$chronic_pedal_oedems,$psychiatric_problem,$heart_attack,$shock,$tia,$kochs,$ht,$dm,$aadhar_no,$pratidnya_name,$pratidnya_address,$pratidnya_mobile,$pratidnya_age,$date,$time,$relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name); if($stmt_insert->execute()) { $counter = 0; $details = array(); if($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $date_of_admission; $details[$counter][2] = $center; $details[$counter][3] = $name_patient; $details[$counter][4] = $gender; $details[$counter][5] = $address; $details[$counter][6] = $is_rural; $details[$counter][7] = $city; $details[$counter][8] = $state; $details[$counter][9] = $pin; $details[$counter][10] = $phone; $details[$counter][11] = $mobile; $details[$counter][12] = $email; $details[$counter][13] = $date_of_birth; $details[$counter][14] = $age; $details[$counter][15] = $religion; $details[$counter][16] = $education_qualification; $details[$counter][17] = $occupation; $details[$counter][18] = $incone_per_month; $details[$counter][19] = $family; $details[$counter][20] = $marital_status; $details[$counter][21] = $living_arrangements; $details[$counter][22] = $name_family_member; $details[$counter][23] = $address_family_mem; $details[$counter][24] = $phone_family; $details[$counter][25] = $mobile_family; $details[$counter][26] = $email_family; $details[$counter][27] = $referred_by; $details[$counter][28] = $reason_of_addiction; $details[$counter][29] = $type_addiction; $details[$counter][30] = $jaundice; $details[$counter][31] = $malena; $details[$counter][32] = $hemelemesis; $details[$counter][33] = $convulsion; $details[$counter][34] = $ascitis; $details[$counter][35] = $chronic_pedal_oedems; $details[$counter][36] = $psychiatric_problem; $details[$counter][37] = $heart_attack; $details[$counter][38] = $shock; $details[$counter][39] = $tia; $details[$counter][40] = $kochs; $details[$counter][41] = $ht; $details[$counter][42] = $dm; $details[$counter][43] = $aadhar_no; $details[$counter][44] = $pratidnya_name; $details[$counter][45] = $pratidnya_address; $details[$counter][46] = $pratidnya_mobile; $details[$counter][47] = $pratidnya_age; $details[$counter][48] = $date; $details[$counter][49] = $time; $details[$counter][50] = $relation; $details[$counter][51] = $totalamount; $details[$counter][52] = $dcotor_name; $details[$counter][53] = $discharge_date; $details[$counter][54] = $samupdeshk_name; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_admission_form($date_of_admission, $center, $name_patient, $gender, $address, $is_rural, $city, $state, $pin, $phone, $mobile, $email, $date_of_birth, $age, $religion, $education_qualification, $occupation, $incone_per_month, $family, $marital_status, $living_arrangements, $name_family_member, $address_family_mem, $phone_family, $mobile_family, $email_family, $referred_by, $reason_of_addiction, $type_addiction, $jaundice, $malena, $hemelemesis, $convulsion, $ascitis, $chronic_pedal_oedems, $psychiatric_problem, $heart_attack, $shock, $tia, $kochs, $ht, $dm, $aadhar_no, $pratidnya_name, $pratidnya_address, $pratidnya_mobile, $pratidnya_age,$relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name,$update_id) { $date = date("Y-m-d"); $time = date("H:i:s A"); if ($stmt_select = $this->con->prepare("UPDATE `admission_form` SET `date_of_admission`=?, `center`=?, `name_patient`=?, `gender`=?, `address`=?, `is_rural`=?, `city`=?, `state`=?, `pin`=?, `phone`=?, `mobile`=?, `email`=?, `date_of_birth`=?, `age`=?, `religion`=?, `education_qualification`=?, `occupation`=?, `incone_per_month`=?, `family`=?, `marital_status`=?, `living_arrangements`=?, `name_family_member`=?, `address_family_mem`=?, `phone_family`=?, `mobile_family`=?, `email_family`=?, `referred_by`=?, `reason_of_addiction`=?, `type_addiction`=?, `jaundice`=?, `malena`=?, `hemelemesis`=?, `convulsion`=?, `ascitis`=?, `chronic_pedal_oedems`=?, `psychiatric_problem`=?, `heart_attack`=?, `shock`=?, `tia`=?, `kochs`=?, `ht`=?, `dm`=?, `aadhar_no`=?, `pratidnya_name`=?, `pratidnya_address`=?, `pratidnya_mobile`=?, `pratidnya_age`=?, `date`=?, `time`=?, `relation`=? , `totalamount`=?,`dcotor_name`=?,`discharge_date`=?,`samupdeshk_name`=? WHERE `id`=?")) { $stmt_select->bind_param("ssssssssssssssssssssssssssssssssssssssssssssssssssssssi", $date_of_admission, $center, $name_patient, $gender, $address, $is_rural, $city, $state, $pin, $phone, $mobile, $email, $date_of_birth, $age, $religion, $education_qualification, $occupation, $incone_per_month, $family, $marital_status, $living_arrangements, $name_family_member, $address_family_mem, $phone_family, $mobile_family, $email_family, $referred_by, $reason_of_addiction, $type_addiction, $jaundice, $malena, $hemelemesis, $convulsion, $ascitis, $chronic_pedal_oedems, $psychiatric_problem, $heart_attack, $shock, $tia, $kochs, $ht, $dm, $aadhar_no, $pratidnya_name, $pratidnya_address, $pratidnya_mobile, $pratidnya_age, $date, $time, $relation,$totalamount,$dcotor_name,$discharge_date,$samupdeshk_name, $update_id); if ($stmt_select->execute()) { return true; } return false; } } function add_checkup_data($pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$admission_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("INSERT INTO `checkup_form`( `pulse`, `weight`,`vital_sign`, `bp`, `cvs`, `pallor`, `tremor`, `flaps`, `neuro_cns`, `pedal_oedema`, `rs`, `pa`, `date`, `time`,`admission_id`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")) { $stmt_insert->bind_param("ssssssssssssssi",$pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$date,$time,$admission_id); if($stmt_insert->execute()) { return true; } return false; } } function get_checkup_details($admission_id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `pulse`, `weight`, `vital_sign`, `bp`, `cvs`, `pallor`, `tremor`, `flaps`, `neuro_cns`, `pedal_oedema`, `rs`, `pa`, `date`, `time` FROM `checkup_form` where `admission_id`=?")) { $stmt_insert->bind_param('s',$admission_id); $stmt_insert->bind_result($res_id,$pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $res_id; $details[$counter][1] = $pulse; $details[$counter][2] = $weight; $details[$counter][3] = $vital_sign; $details[$counter][4] = $bp; $details[$counter][5] = $cvs; $details[$counter][6] = $pallor; $details[$counter][7] = $tremor; $details[$counter][8] = $flaps; $details[$counter][9] = $neuro_cns; $details[$counter][10] = $pedal_oedema; $details[$counter][11] = $rs; $details[$counter][12] = $pa; $details[$counter][13] = $date; $details[$counter][14] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function delete_checkup($del_id) { if($stmt_select = $this->con->prepare("DELETE FROM `checkup_form` WHERE id=?")) { $stmt_select->bind_param("i",$del_id); if($stmt_select->execute()) { return true; } return false; } } function get_all_data_for_checkup($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `pulse`, `weight`, `vital_sign`, `bp`, `cvs`, `pallor`, `tremor`, `flaps`, `neuro_cns`, `pedal_oedema`, `rs`, `pa`, `date`, `time` FROM `checkup_form` WHERE `id` = ?")) { $stmt_insert->bind_param("i",$id); $stmt_insert->bind_result($res_id,$pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $res_id; $details[$counter][1] = $pulse; $details[$counter][2] = $weight; $details[$counter][3] = $vital_sign; $details[$counter][4] = $bp; $details[$counter][5] = $cvs; $details[$counter][6] = $pallor; $details[$counter][7] = $tremor; $details[$counter][8] = $flaps; $details[$counter][9] = $neuro_cns; $details[$counter][10] = $pedal_oedema; $details[$counter][11] = $rs; $details[$counter][12] = $pa; $details[$counter][13] = $date; $details[$counter][14] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function get_all_data_for_item_master($id) { if($stmt_insert = $this->con->prepare("SELECT `id`, `item_name`, `date`, `time` FROM `item_master` where `id`=?")) { $stmt_insert->bind_param('i',$id); $stmt_insert->bind_result($id,$item_name,$date,$time); if($stmt_insert->execute()) { $counter = 0; $details = array(); while($stmt_insert->fetch()) { $details[$counter][0] = $id; $details[$counter][1] = $item_name; $details[$counter][2] = $date; $details[$counter][3] = $time; $counter++; } if(!empty($details)) { return $details; } return false; } } } function update_checkup_details($pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$up_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("UPDATE `checkup_form` SET `pulse`=?,`weight`=?,`vital_sign`=?,`bp`=?,`cvs`=?,`pallor`=?,`tremor`=?,`flaps`=?,`neuro_cns`=?,`pedal_oedema`=?,`rs`=?,`pa`=?,`date`=?,`time`=? WHERE `id` = ?")) { $stmt_insert->bind_param("ssssssssssssssi",$pulse,$weight,$vital_sign,$bp,$cvs,$pallor,$tremor,$flaps,$neuro_cns,$pedal_oedema,$rs,$pa,$date,$time,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function update_item_master($item_name,$up_id) { $date = date("Y-m-d"); $time = date("H-i-s A"); if($stmt_insert = $this->con->prepare("UPDATE `item_master` SET `item_name`=?,`date`=?,`time`=? WHERE `id` = ?")) { $stmt_insert->bind_param("sssi",$item_name,$date,$time,$up_id); if($stmt_insert->execute()) { return true; } return false; } } function fetch_patient_name($id) { if($stmt_select = $this->con->prepare("Select `name_patient` from `admission_form` where `id` = ? ")) { $stmt_select->bind_param("i",$id); $stmt_select->bind_result($result_service); if($stmt_select->execute()) { if($stmt_select->fetch()) { return $result_service; } } 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