$TransactionSummary[$currRow]['Percentage'] = number_format($cper, 2, '.', ''); $avgPer+=$cper; */ $currRow++; } $currRow = 0; foreach ($TransactionSummary as $TransactionSummary1) { $TransactionSummaryShort[$currRow] = array('Working Day' => $TransactionSummary1['Working Day'], 'Employee Code' => $TransactionSummary1['Employee Code'], 'Resource Name' => $TransactionSummary1['Resource Name'], 'Productive' => $TransactionSummary1['Productive'], 'Shortage' => $TransactionSummary1['Shortage']); $currRow++; } return $TransactionSummaryShort; } $query = "SELECT a.empcode, a.empname, a.controllerno, a.channelno, a.type, a.adatetime FROM " . "swipe_transactions a WHERE a.isactive = 1 and a.EmpCode in (select empcode from swipe_main_employees " . "where user_id in (72)) and aDate between STR_TO_DATE('04-02-2015','%d-%m-%Y') and " . "STR_TO_DATE('04-02-2015','%d-%m-%Y') ORDER BY a.aDateTime;"; $swipeTransactions = getDBData($query); $processedTransactions = ProcessTransactions($swipeTransactions); $TransactionSummary = TransactionSummaryShort($processedTransactions); ?> <h1>Transactions Summary</h1> <?php echo ConvertArrayToTable("", $TransactionSummary, "800px"); ?> <h1>Processed Transactions</h1> <?php echo ConvertArrayToTable("", $processedTransactions, "1200px"); ?> <h1>Swipe Transactions</h1> <?php echo ConvertArrayToTable("", $swipeTransactions, "1200px"); ?>
return $output; } $currRow = 0; $body = ""; $TransactionSummary = array(); try { $mysqlPDO = new PDO('mysql:host=' . DeltaONE_HOST . ';dbname=' . DeltaONE_DBNAME . '', DeltaONE_USERNAME, DeltaONE_PASSWORD, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); if (!$mysqlPDO) { $msgarray['error'] = 'Could not connect to specified database'; } else { $sql = "select a.id, a.title,a.description, a.createddate, b.userfullname, b.unitname, b.department_name, b.jobtitlename from tbl_feedback a, vw_employee_summary b where a.createdby=b.user_id and a.createddate > DATE_SUB(NOW(), INTERVAL 24 HOUR);"; foreach ($mysqlPDO->query($sql) as $row) { $TransactionSummary[$currRow] = array('ID' => $row["id"], 'Title' => $row["title"], 'Description' => $row["description"], 'CreatedDate' => $row["createddate"], 'User' => $row["userfullname"], 'BusinessUnit' => $row["unitname"], 'Department' => $row["department_name"], 'JobTitle' => $row["jobtitlename"]); $currRow++; } if ($currRow <= 0) { $body = "<h1>No feedback exists...!</h1>"; } else { $body = ConvertArrayToTable("", $TransactionSummary); } } } catch (PDOException $e) { $body = $e->getMessage(); } //Send Email $subject = "DeltaONE:Application Feedback - " . date('d-m-Y H:i:s'); $toAddress = "sudatha@deltaintech.com;sdachepally@deltaintech.com;bramakrishna@deltaintech.com"; $toAddrs = explode(';', $toAddress); foreach ($toAddrs as $toAddr) { $msgres = SendEmail($toAddr, $toAddress, $subject, $body); }
} } else { if ($conn->query($insQuery) === TRUE) { $insSuccess++; } else { $insFailure++; } } } if (VIEWGRID == 1) { $TransactionSummary[$currRow] = array('YEAR' => CURRENTYEAR, 'AL1' => $AL1, 'SL1' => $SL1, 'CL1' => $CL1, 'CO1' => $COMPOFF1, 'PL1' => $PO1, 'OL1' => $OL1, 'AL2' => $AL2, 'SL2' => $SL2, 'CL2' => $CL2, 'CO2' => $COMPOFF2, 'PL2' => $PO2, 'OL2' => $OL2, 'UID' => $row["user_id"], 'NAME' => $row["userfullname"], 'JD' => $row["date_of_joining"], 'SID' => $row["employee_status_id"], 'ESTS' => $row["employee_status"], 'PD' => $row["probation_review_date"], 'PSTS' => $row["probation_review_status"]); $currRow++; } } if (VIEWGRID == 1) { $gridHTML = ConvertArrayToTable("", $TransactionSummary); echo $gridHTML; } } $conn->close(); if (RECORDTODB == 1) { $updResult = sprintf("<br>Inserted success : %s <br>Inserted failure : %s <br>Updated success : %s <br>Updated Failure : %s<br>", $insSuccess, $insFailure, $updSuccess, $updFailure); echo $updResult; } $toAddress = "*****@*****.**"; $subject = "DeltaONE:Leave Pool Update - " . date('d-m-Y H:i:s'); $body = $gridHTML . $updResult; $toAddrs = explode(';', $toAddress); foreach ($toAddrs as $toAddr) { $msgres = SendEmail($toAddr, $toAddress, $subject, $body); //echo $msgres;