arc("fs_interfaces","/_mod/smod_18/inc_interface.php","' . $ajCfgDevice . '",0,0,' . $interfaces . '); arc("tblinterface","/_mod/smod_18/list_interface.php","' . $ajCfgDevice . '",0,0,' . $interfaces . '); arc("list18-1","/_mod/smod_18/list_interface_filtered.php","' . $ajCfgDevice . '",0,0,' . $interfaces . '); </script>'; } switch ($formAction) { # frmConfig case "frmConfig,insert": $dbo->dbTable = "_cfg"; $dbo->insertRec(); $_POST['id_cfg'] = $dbo->insertedID; include "edit.php"; break; case "frmConfig,edit": $dbo->dbTable = "_cfg"; $dbo->updateRec("id_cfg=" . $_POST["id_cfg"]); include "edit.php"; break; case "frmConfig,delete": $dbo->dbTable = "_cfg"; $dbo->deleteRec("id_cfg=" . $_POST["id_cfg"]); $dbo->sql = "SELECT id_cfg_device FROM _cfg_device WHERE id_cfg=" . $_POST["id_cfg"]; $dbo->getRec(); $devices = $dbo->dbData; $dbo->dbTable = "_cfg_device_interface"; foreach ($devices as $record => $cols) { $dbo->deleteRec("id_cfg_cdevice=" . $cols[0]); } $dbo->dbTable = "_cfg_device"; $dbo->deleteRec("id_cfg=" . $_POST["id_cfg"]); include "index.php";
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ require_once "_lib/php/auth.php"; $_POST["tm_timesheet_approvedBy"] = $id_cust_contact_derived; $arc = new ArcDb(); $arc->dbType = $globalDBTP; $arc->dbSchema = $globalDB; $arc->dbConStr = $globalDBCON; $arc->dbTable = "_tm_timesheet"; switch ($_POST["edit"]) { case 1: $arc->updateRec("id_tm_timesheet=" . $_POST["id_tm_timesheet"]); break; case 2: $arc->deleteRec("id_tm_timesheet=" . $_POST["id_tm_timesheet"]); break; default: break; } ?> <div class="cList" id="list16"> <?php include "list.php"; ?> </div>
$approverFirst = $approver[0]["cust_contact_givenName"]; $approverLast = $approver[0]["cust_contact_familyName"]; $approverCount = $arc->dbRows; $arc->sql = "\nSELECT\nconcat(b.cust_contact_givenName,' ',b.cust_contact_familyName) as fullName\nFROM\n_tm_timesheet a\nLEFT JOIN\n_hr_emp c ON a.id_hr_emp=c.id_hr_emp\nLEFT JOIN\n_cust_contact b ON c.id_cust_contact=b.id_cust_contact\nWHERE\na.id_tm_timesheet={$id_tm_timesheet}\n"; $arc->getRec(); $timesheetdetail = $arc->getAssociative(); if ($approverCount > 0) { /*********************************************************************/ /*The correct approver was matched*/ /*********************************************************************/ if (preg_match("/I.+?" . $approverFirst . ".+?" . $approverLast["cust_contact_familyName"] . ".*/i", $body, $matches)) { $arc->dbTable = "_tm_timesheet"; if (preg_match("/\\sapprove|\\saccept|\\sapproved/i", $matches[0])) { $response = "Thank you for approving the time sheet for " . $timesheetdetail[0]["fullName"] . "."; $arc->sql = "tm_timesheet_approved=1,tm_timesheet_du=" . strtotime(date("Y-m-d H:i:s")); $arc->updateRec("id_tm_timesheet=" . $id_tm_timesheet); } elseif (preg_match("/\\sreject|\\sdo not accept|\\srejected/i", $matches[0])) { $response = "You have elected to reject the time sheet for " . $timesheetdetail[0]["fullName"] . "."; $arc->sql = "tm_timesheet_approved=0,tm_timesheet_du=" . strtotime(date("Y-m-d H:i:s")); $arc->updateRec("id_tm_timesheet=" . $id_tm_timesheet); } else { $response = "Your response was not entered correctly. Please re-attempt to respond to the original e-mail."; } } else { $response = "Your response was not entered correctly. Please re-attempt to respond to the original e-mail."; } /*********************************************************************/ /* Send Appropriate Responses */ /*********************************************************************/ /* Email Timesheet Approver */ $message = $approverFull . ". {$response}<p>If you have any questions, please log into http://arc.bifrostapps.com and submit a ticket to our helpdesk.</p>";
if (isset($_POST["con_password"]) && $_POST["con_password"] != "") { $_POST["con_password"] = encrypt($_POST["con_password"]); } switch ($formAction) { /* ********************************************************************** */ case "dbcon,insert": /* ********************************************************************** */ $dbo->dbTable = "_con"; $dbo->insertRec(); $id_con = $dbo->insertedID; $_POST["id_con"] = $id_con; include "edit.php"; break; /* ********************************************************************** */ /* ********************************************************************** */ case "dbcon,update": /* ********************************************************************** */ $dbo->dbTable = "_con"; $dbo->updateRec("id_con=" . $_POST["id_con"]); include "edit.php"; break; /* ********************************************************************** */ /* ********************************************************************** */ case "dbcon,delete": /* ********************************************************************** */ $dbo->dbTable = "_con"; $dbo->deleteRec("id_con=" . $_POST["id_con"]); include "index.php"; break; } include "_error/status.php";
$alert = "<div class='timesheeterror'>This timesheet has already been submitted for approval.</div>"; $sendmail = FALSE; break; case 1: /*Approved*/ $alert = "<div class='timesheeterror'>This timesheet has already been approved.</div>"; $sendmail = FALSE; break; case 2: /*Rejected*/ $_POST["tm_timesheet"] = bin2hex($timecard); $_POST["tm_timesheet_du"] = strtotime($dtTimeCurrent); $_POST["tm_timesheet_approved"] = 0; $alert = "<div class='timesheeterror'>Your timesheet was just recently rejected. Resending updated timesheet to your approver.</div>"; $gdbo->dbTable = "_tm_timesheet"; $gdbo->updateRec("id_tm_timesheet=" . $timesheet[0]["id_tm_timesheet"]); $sendmail = TRUE; break; default: break; } } $message = "\n<style>div,td,caption,th{font-family:sans-serif;font-size:10pt}td{padding:5px;border:1px solid #000}table{margin:auto;border-collapse:collapse}</style>\n<p>Please review the following timecard for {$fullName_derived}. You can approve/reject this timecard by logging into your portal.</p>\n{$timecard}\n<p>If you believe you have received this message in error, please contact us at info@bifrostapps.com</p>\n<p style=\"font-size:8pt;text-align:center;border-top:1px dotted #dedede\">To view this properly, HTML e-mail must be enabled.<p>\n"; $message = wordwrap($message, 70); $subject = "TIME APPROVAL REQUEST | {$fullName_derived} |" . encrypt($recordID); $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/html; charset=iso-8859-1"; $headers[] = "From: Bifrost Software LLC <*****@*****.**>"; $headers[] = "Subject: {$subject}"; $headers[] = "X-Mailer: PHP/" . phpversion();