send_template_on_center()"; $chronic_filter = ''; $config_chronic = getConfigKey_table('selected_cronic_for_reminder'); if ($config_chronic != '' && $config_chronic != null) { $chronic_filter = " and diseases in (" . $config_chronic . ") "; } $query = "SELECT distinct(emp_id) FROM `prescription_master` where `medicine_name` is not null and `medicine_name`!='' " . $chronic_filter; error_log("sql " . $query); if (!$result = @mysqli_query($conn, $query)) { rollback(); exit(mysqli_error($conn)); } $data = array(); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $app_q = " select date(appointment_date) + INTERVAL chronic_day DAY AS DATE,date(appointment_date) as app_date,appointment_id,ohc_type_id,emp_id from employee_appointment where appointment_id=(select max(appointment_id) from employee_appointment where emp_id='" . $row['emp_id'] . "' and chronic_day!=0 ) "; if (!$result_app_q = @mysqli_query($conn, $app_q)) { rollback(); exit(mysqli_error($conn)); } if (mysqli_num_rows($result_app_q) > 0) { while ($row_app_q = mysqli_fetch_assoc($result_app_q)) { $emp_mail = getTableFieldValue('patient_master', 'offiial_email_id', 'id', $row_app_q['emp_id']); $emp_name = getTableFieldValue('patient_master', 'patient_name', 'id', $row_app_q['emp_id']); $ohc = getTableFieldValue('ohc_type', 'ohc_type_name', 'ohc_type_id', $row_app_q['ohc_type_id']); $cronic_date = $row_app_q['DATE']; if ($cronic_date < date("Y-m-d")) { echo ""; } } } } $data['status'] = "succes"; $data['message'] = "Assign menu done!"; } else { $data['status'] = 200; $data['message'] = "Data not found!"; } commit(); if ($data['status'] == 'success') { echo "