application/controllers/Pharmacy.php
/*
			* It removes the data from the database
			* and it returns the response into the json format
		*/
It removes the data from the database
and it returns the response into the json format
It removes the data from the database and it returns the response into the json format
public function remove()
		{
			if(!in_array('deleteProduct', $this->permission)) {
				redirect('dashboard', 'refresh');
			}
			$product_id = $this->input->post('product_id');
			$response = array();
			if($product_id) {
				$delete = $this->model_products->remove($product_id);
				if($delete == true) {
					$response['success'] = true;
					$response['messages'] = "Successfully removed";
				}
				else {
					$response['success'] = false;
					$response['messages'] = "Error in the database while removing the product information";
				}
			}
			else {
				$response['success'] = false;
				$response['messages'] = "Refersh the page again!!";
			}
			echo json_encode($response);
		}
public function remove ( ) { if ( ! in_array ( 'deleteProduct' , $ this -> permission ) ) { redirect ( 'dashboard' , 'refresh' ) ; } $ product_id = $ this -> input -> post ( 'product_id' ) ; $ response = array ( ) ; if ( $ product_id ) { $ delete = $ this -> model_products -> remove ( $ product_id ) ; if ( $ delete == true ) { $ response [ 'success' ] = true ; $ response [ 'messages' ] = " Successfully removed " ; } else { $ response [ 'success' ] = false ; $ response [ 'messages' ] = " Error in the database while removing the product information " ; } } else { $ response [ 'success' ] = false ; $ response [ 'messages' ] = " Refersh the page again!! " ; } echo json_encode ( $ response ) ; }
It removes the data from the database
 and it returns the response into the json format
It removes the data from the database and it returns the response into the json format