<?php
/**********************************************************************
***********************************************************************/
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/banking.inc");
include_once($path_to_root . "/includes/inventory.inc");

//include_once($path_to_root . "/payroll/includes/db/items_category_db.inc");
//include_once($path_to_root . "/payroll/includes/db/items_trans_db.inc");
include_once($path_to_root . "/payroll/includes/db/job_details_db.inc");
include_once($path_to_root . "/payroll/includes/db/employment_history_db.inc");
include_once($path_to_root . "/payroll/includes/db/qualifications_db.inc");
include_once($path_to_root . "/payroll/includes/db/employees_db.inc");
include_once($path_to_root . "/payroll/includes/db/employee_attachments_db.inc");
include_once($path_to_root . "/payroll/includes/db/working_week_db.inc");
include_once($path_to_root . "/payroll/includes/db/holidays_db.inc");
include_once($path_to_root . "/payroll/includes/db/leave_entitlements_db.inc");
include_once($path_to_root . "/payroll/includes/db/leaves_db.inc");
include_once($path_to_root . "/payroll/includes/db/apply_leave_db.inc");
include_once($path_to_root . "/payroll/includes/db/attendance_db.inc");
include_once($path_to_root . "/payroll/includes/db/calendars_db.inc");
include_once($path_to_root . "/payroll/includes/db/loans_db.inc");
include_once($path_to_root . "/payroll/includes/db/salary_components_db.inc");
include_once($path_to_root . "/payroll/includes/db/value_tables_db.inc");
include_once($path_to_root . "/payroll/includes/db/statutory_deductions_db.inc");
include_once($path_to_root . "/payroll/includes/db/payroll_calculation_seq_db.inc");
include_once($path_to_root . "/payroll/includes/db/payroll_run_db.inc");
include_once($path_to_root . "/payroll/includes/db/shifts_db.inc");

function send_reorder_email_2($loc, $st_ids, $st_names, $st_num, $st_reorder)
{
	global $path_to_root;
	
	require_once($path_to_root . "/reporting/includes/class.mail.inc");
	$company = get_company_prefs();
	$mail = new email($company['coy_name'], $company['email']);
	$from = $company['coy_name'] . " <" . $company['email'] . ">";
	$to = $loc['location_name'] . " <" . $loc['email'] . ">";
	$subject = _("Stocks below Re-Order Level at " . $loc['location_name']);
	$msg = "\n";
	for ($i = 0; $i < count($st_ids); $i++)
		$msg .= $st_ids[$i] . " " . $st_names[$i] . ", " . _("Re-Order Level") . ": " . $st_reorder[$i] . ", " . _("Below") . ": " . $st_num[$i] . "\n";
	$msg .= "\n" . _("Please reorder") . "\n\n";
	$msg .= $company['coy_name'];
	$mail->to($to);
	$mail->subject($subject);
	$mail->text($msg);
	return $mail->send();
}

?>
