<?php



    $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'production'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $production = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'rpt_sale_target'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $rpt_sale_target = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'rpt_svl'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $rpt_svl = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'rpt_svl_balance'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $rpt_svl_balance = $statement->fetchColumn();



    $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory = $statement->fetchColumn();



                 $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items = $statement->fetchColumn();



                $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_new = $statement->fetchColumn();



                $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_edit = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_delete = $statement->fetchColumn();



            



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_inquiry'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_inquiry = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_transfer'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_transfer = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_transfer_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_transfer_new = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_transfer_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_transfer_edit = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_transfer_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_transfer_delete = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_adjust'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_adjust = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_adjust_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_adjust_new = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_adjust_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_adjust_edit = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'items_adjust_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $items_adjust_delete = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports_stockbystore'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports_stockbystore = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports_item_ledger'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports_item_ledger = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports_stockavailable'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports_stockavailable = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports_stockavailable_value'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports_stockavailable_value = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'inventory_reports_min_stock'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $inventory_reports_min_stock = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'production_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $production_delete = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_accounts'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_accounts = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_accounts_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_accounts_new = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_accounts_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_accounts_edit = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_accounts_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_accounts_delete = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_parent_accounts'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_parent_accounts = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_accounts_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_parent_accounts_new = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_parent_accounts_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_parent_accounts_edit = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_parent_accounts_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_parent_accounts_delete = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'jv'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $jv = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'jv_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $jv_new = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'jv_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $jv_edit = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'jv_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $jv_delete = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'jv_print'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $jv_print = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_reports'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_reports = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_reports_gl'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_reports_gl = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_reports_cash_flow'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_reports_cash_flow = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_reports_trial_balance'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_reports_trial_balance = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'gl_reports_sub_accounts'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $gl_reports_sub_accounts = $statement->fetchColumn();



            $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $accounts_payable = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'vendors'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $vendors = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'vendors_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $vendors_new = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'vendors_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $vendors_edit = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'vendors_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $vendors_delete = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'sub_vendors'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $sub_vendors = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'sub_vendors_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $sub_vendors_new = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'sub_vendors_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $sub_vendors_edit = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'sub_vendors_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $sub_vendors_delete = $statement->fetchColumn();



              $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $purchase = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_new'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $purchase_new = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_edit'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $purchase_edit = $statement->fetchColumn();



             $sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_delete'";



            $statement = $connect->prepare($sql);



            $statement->execute(); 



            $purchase_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_return'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_return = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_return_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_return_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_return_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_return_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_return_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_return_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'purchase_return_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$purchase_return_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_payments'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_payments = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_payments_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_payments_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_payments_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_payments_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_payments_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_payments_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_payments_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_payments_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_reports'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_reports = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_reports_vl'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_reports_vl = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_reports_os'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_reports_os = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_reports_payments'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_reports_payments = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_payable_reports_purchase_report'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_payable_reports_purchase_report = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'customers'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$customers = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'customers_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$customers_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'customers_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$customers_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'customers_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$customers_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'cash_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$cash_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'cash_invoices_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$cash_invoices_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'cash_invoices_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$cash_invoices_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'cash_invoices_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$cash_invoices_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'cash_invoices_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$cash_invoices_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'wholesale_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$wholesale_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'wholesale_invoices_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$wholesale_invoices_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'wholesale_invoices_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$wholesale_invoices_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'wholesale_invoices_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$wholesale_invoices_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'wholesale_invoices_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$wholesale_invoices_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_wholesale'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_wholesale = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_wholesale_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_wholesale_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_wholesale_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_wholesale_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_wholesale_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_wholesale_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_wholesale_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_wholesale_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_retail'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_retail = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_retail_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_retail_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_retail_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_retail_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_retail_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_retail_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'return_retail_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$return_retail_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_payments'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_payments = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_payments_new'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_payments_new = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_payments_edit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_payments_edit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_payments_delete'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_payments_delete = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_payments_print'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_payments_print = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_cl'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_cl = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_os'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_os = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_payments'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_payments = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_cash_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_cash_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_sale_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_sale_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_sale_report_with_profit'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_sale_report_with_profit = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_aging'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_aging = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_aging_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_aging_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'OFF') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_sales_man'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_sales_man = $statement->fetchColumn();



$sql = "SELECT ifnull(doc_status,'ON') FROM user_rights WHERE user_id = '".$rights_id."' and doc_name = 'accounts_receivable_reports_cash_invoices'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$accounts_receivable_reports_cash_invoices = $statement->fetchColumn();



$sql = "SELECT ifnull(app_value,3) FROM app_options WHERE user_id = '".$rights_id."' and app_name = 'dateup'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$dateup = $statement->fetchColumn();



$sql = "SELECT ifnull(app_value,3) FROM app_options WHERE user_id = '".$rights_id."' and app_name = 'datedown'";



$statement = $connect->prepare($sql);



$statement->execute(); 



$datedown = $statement->fetchColumn();



?>