public function SaveThread($dataForm, $thread_userId) { global $mySession; $db = new Db(); $Datainsert['topic_id'] = $dataForm['topic_id']; $Datainsert['thread_id'] = $dataForm['thread_id']; $Datainsert['replyof'] = $dataForm['replyof']; $Datainsert['user_id'] = $dataForm['user_id']; $Datainsert['date_posted'] = $dataForm['date_added']; $Datainsert['post_text'] = $dataForm['post_text']; $db->save(FORUM_POSTS, $Datainsert); $threadcommentuser = $db->runQuery("select * from " . FORUM_POSTS . " AS TP inner join " . USERS . " AS U \n\t\t\t\t\t\t\t\tON TP.user_id=U.user_id where TP.user_id=" . $dataForm['user_id'] . ""); $comment_user = $threadcommentuser[0]['first_name'] . $threadcommentuser[0]['last_name']; $userData = $db->runQuery("select * from " . FORUM_THREADS . " AS T inner join " . USERS . " AS U \n\t\t\t\t\t\t\t\tON T.user_id=U.user_id where T.thread_id=" . $dataForm['thread_id'] . ""); $fullName = $userData[0]['first_name'] . $userData[0]['last_name']; $commentuser = $comment_user; $useremail = $userData[0]['email_address']; $threadtitle = $userData[0]['thread_text']; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='5'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[USERNAME]", $fullName, $messageText); $messageText = str_replace("[THREADTITLE]", $threadtitle, $messageText); $messageText = str_replace("[COMMENTUSERNAME]", $commentuser, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); SendEmail($useremail, $subject, $messageText); return 1; }
function CustomScheduler() { global $sugar_config, $db; $timeDate = new TimeDate(); $timeDateNow = $timeDate->getNow(true)->asDb(); $days_offset = 15; $GLOBALS['log']->fatal("Checking Opportunities..."); $query = "select opportunities.id from opportunities\n\twhere opportunities.sales_stage != 'Closed Won'\n\tand DATEDIFF(opportunities.date_modified,'" . $timeDateNow . "') < " . $days_offset . "\n\tand !opportunities.deleted"; $GLOBALS['log']->fatal("Query: " . $query); $res = $db->query($query, true, 'Error: '); while ($row = $db->fetchByAssoc($res)) { $opportunity = new Opportunity(); if (!is_null($opportunity->retrieve($row['id']))) { $user = new User(); if (!is_null($user->retrieve($opportunity->assigned_user_id))) { $emailsTo = array(); $emailSubject = "Opportunity Alert"; $emailBody = "The following Opportunity has " . $days_offset . " days without changes.<br /><br />\n\t\t\t\tName: " . $opportunity->name . "<br />\n\t\t\t\tAccount: " . $opportunity->account_name . "<br />\n\t\t\t\tAmount: " . $opportunity->amount . "<br />\n\t\t\t\tSales Stage: " . $opportunity->sales_stage . "<br />\n\t\t\t\tDate Close: " . $opportunity->date_closed . "<br /><br />\n\t\t\t\tYou can see the opportunity here:<br />\n\t\t\t\t<a href=\"" . $sugar_config['site_url'] . "/index.php?module=Opportunities&action=DetailView&record=" . $opportunity->id . "\">" . $opportunity->name . "</a>"; $emailsTo[] = $user->email1; SendEmail($emailsTo, $emailSubject, $emailBody); } } } $GLOBALS['log']->fatal("Opportunities checked"); return true; }
public function hireuserAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('friendprofile'); $id = $this->getRequest()->getParam('user_id'); $this->view->id = $id; //echo ("select * from ".USERS." inner join ".COUNTRIES." on ".COUNTRIES.".country_id=".USERS.".country_id where user_id='".$id."' ");die; //echo ("select * from ".USERS." inner join ".COUNTRIES." on ".COUNTRIES.".country_id=".USERS.".country_id where user_id='".$id."' ");die; $sql = $db->runquery("select * from " . USERS . " where user_id='" . $id . "' "); $this->view->pageTitle = "Hire:" . $sql[0]['public_name']; $follow = $db->runquery("select *," . USERS . ".user_id as user_id from " . FOLLOW . " inner join " . USERS . " on (" . FOLLOW . ".following_id=" . USERS . ".user_id) where following_id='" . $id . "' "); $follower = $db->runquery("select *," . USERS . ".user_id as user_id from " . FOLLOW . " inner join " . USERS . " on (" . FOLLOW . ".follower_id=" . USERS . ".user_id) where follower_id='" . $id . "' "); $this->view->follower = $follower; $this->view->follow = $follow; $this->view->dataQry = $sql[0]; $myform = new Form_Hire(); $this->view->myform = $myform; $loggeduser = $db->runquery("select * from " . USERS . " where user_id='" . $mySession->TeeLoggedID . "' "); if ($this->getRequest()->isPost()) { $request = $this->getRequest(); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='18'"); $emailidcreator = $sql[0]['emailid']; $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", $useremail[0]['public_name'], $messageText); $messageText = str_replace("[MESSAGE]", $dataForm['Message'], $messageText); $messageText = str_replace("[SENDEREMAIL]", $loggeduser[0]['emailid'], $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); //$messageText=str_replace("[ORDERNO]",$orderno,$messageText); $result = SendEmail($emailidcreator, $subject, $messageText); if ($result) { $mySession->errorMsg = "Mail Sent Successfully !!!"; $this->_redirect('user/view/user_id/' . $id); } else { $mySession->errorMsg = "Email Address is not correct!!!"; $this->_redirect('user/view/user_id/' . $id); } } else { $mySession->errorMsg = "Please Fill All The Fields !!!"; $this->view->myform = $myform; $this->view->id = $id; $this->view->follower = $follower; $this->view->follow = $follow; $this->view->dataQry = $sql[0]; //echo "dfasdf";die; $this->render('hireuser'); } } }
public function emailfriends($dataForm) { $db = new Db(); global $mySession; //$friendsemailid=$dataForm['friendsemailid']; $friendsemailid = explode(",", $dataForm['friendsemailid']); //prd($friendsemailid); //$emailid=$dataForm['signupemailid']; for ($i = 0; $i < count($friendsemailid); $i++) { //$TeeLink='<a href="'.APPLICATION_URL.'launchcampaign/showcampaign/name/'.$teeurl.'">'.APPLICATION_URL.'launchcampaign/showcampaign/name/'.$teeurl.'</a>'; //$templateData=$db->runQuery("select * from ".EMAIL_TEMPLATES." where template_id='9'"); $messageText = $dataForm['content']; $subject = $dataForm['subject']; SendEmail($friendsemailid[$i], $subject, $messageText); } return 1; }
public function sendnewsletterAction() { global $mySession; $db = new Db(); $r = $this->getRequest()->getParam('r'); $exp = explode("|", $r); for ($i = 0; $i < count($exp) - 1; $i++) { $emailData = $db->runQuery("select * from " . USERS . " where user_id='" . $exp[$i] . "'"); $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='1'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[LOGINNAME]", $emailData[0]['email_address'], $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); SendEmail($emailData[0]['email_address'], $subject, $messageText); } $mySession->errorMsg = "Newsletter has been sent successfully."; $this->_redirect('system/viewnewsletter'); }
public function SaveSub($dataForm) { global $mySession; $db = new Db(); $value = $_POST['plan']; $dataForm = SetupMagicQuotes($dataForm); $chkQry = $db->runQuery("select * from " . SUBSCRIPTION . " where email_address='" . $dataForm['email_address'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['first_name'] = $dataForm['first_name']; $dataInsert['last_name'] = $dataForm['last_name']; $dataInsert['email_address'] = $dataForm['email_address']; $dataInsert['username'] = $dataForm['username']; $dataInsert['password'] = md5($dataForm['password_o']); $dataInsert['address'] = $dataForm['address']; $dataInsert['country_id'] = $dataForm['country_id']; //$dataInsert['state_id']=$dataForm['state_id']; //$dataInsert['city_id']=$dataForm['city_id']; $dataInsert['zipcode'] = $dataForm['zipcode']; $dataInsert['phone_number'] = $dataForm['phone_number']; $dataInsert['mobile_number'] = $dataForm['mobile_number']; $dataInsert['id'] = $value; $dataInsert['date_joined'] = date('Y-m-d H:i:s'); $dataInsert['user_status'] = '1'; $dataInsert['user_type'] = $dataForm['signup_type']; $db->save(USERS, $dataInsert); $UserId = $db->lastInsertId(); //code to send registration email $fullName = $dataForm['first_name'] . ' ' . $dataForm['last_name']; $Url = '<a href="' . APPLICATION_URL . '">' . APPLICATION_URL . '</a>'; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='2'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", "<strong>" . $fullName . "</strong>", $messageText); $messageText = str_replace("[SITENAME]", "<strong>" . SITE_NAME . "</strong>", $messageText); $messageText = str_replace("[LOGINNAME]", "<strong>" . $dataForm['username'] . "</strong>", $messageText); $messageText = str_replace("[PASSWORD]", "<strong>" . $dataForm['password_o'] . "</strong>", $messageText); $messageText = str_replace("[SITEURL]", "<strong>" . $Url . "</strong>", $messageText); SendEmail($dataForm['email_address'], $subject, $messageText); //code to send registration email return $UserId; } }
function AddContacts() { global $config, $txtName, $txtEmail, $txtType, $txtCompany, $txtTitle, $txtSubject, $txtMessage; $c = new ContactsDetails(); $c->_contact_name = $txtName; $c->_contact_email = $txtEmail; $c->_contact_type = $txtType; $c->_contact_company = $txtCompany; $c->_contact_title = $txtTitle; $c->_contact_subject = $txtSubject; $c->_contact_message = nl2br($txtMessage); //eregi_replace(chr(13),"<br>",$txtMessage); $c->_contact_date_submited = date("Y-m-d"); if (ValidateContacts()) { $td = ContactsDetails::Insert($c); //send email SendEmail(); return $td; } return false; }
public function saveComment($dataForm) { //echo 'hello'; exit(); global $mySession; $db = new Db(); // prd($dataForm); $db->save(BLOG_COMMENTS, $dataForm); $commentuser = $db->runQuery("select * from " . BLOG_COMMENTS . " AS BC \n\t\t\t\t\t\t\t\tinner join " . USERS . " as U ON BC.post_by=U.user_id\n\t\t\t\t\t\t\t\twhere BC.post_by=" . $dataForm['post_by'] . ""); $comment_user = $commentuser[0]['first_name'] . $commentuser[0]['last_name']; $userData = $db->runQuery("select * from " . BLOG_POST . " AS BP inner join " . BLOG_COMMENTS . " AS BC \n\t\t\t\t\t\t\t\tON BP.blog_post_id=BC.blog_post_id \n\t\t\t\t\t\t\t\tinner join " . USERS . " as U ON BP.user_id=U.user_id\n\t\t\t\t\t\t\t\twhere BP.status='1' and BP.activeBlog='1' and BP.blog_post_id=" . $dataForm['blog_post_id'] . ""); $fullName = $userData[0]['first_name'] . $userData[0]['last_name']; $commentbyuser = $comment_user; $useremail = $userData[0]['email_address']; $threadtitle = $userData[0]['title']; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='6'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[USERNAME]", $fullName, $messageText); $messageText = str_replace("[BLOGTITLE]", $threadtitle, $messageText); $messageText = str_replace("[COMMENTUSERNAME]", $commentbyuser, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); SendEmail($useremail, $subject, $messageText); return 1; }
public function sendMessage($dataForm) { global $mySession; $db = new Db(); foreach ($dataForm['box2View'] as $val) { $dataMessage['receiver_id'] = $val; $dataMessage['sender_id'] = 0; $dataMessage['message_subject'] = $dataForm['message_subject']; $dataMessage['message_text'] = $dataForm['message_text']; $dataMessage['date_message_sent'] = date('Y-m-d H:i:s'); $db->save(MESSAGES, $dataMessage); $user = $db->runQuery("select * from " . USERS . " where user_id=" . $dataMessage['receiver_id'] . ""); $receiveuser = $user[0]['first_name'] . ' ' . $user[0]['last_name']; $useremail = $user[0]['email_address']; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='8'"); $messageText = $templateData[0]['email_body']; $subject = $dataForm['message_subject']; $messageText = str_replace("[NAME]", $receiveuser, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); SendEmail($useremail, $subject, $messageText); return 1; } return 0; }
public function CheckForgotpass($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . USERS . " where emailid='" . mysql_escape_string($dataForm['emailid']) . "'"); if ($chkQry != "" and count($chkQry) > 0) { $dataUpdate['pass_reset'] = md5($chkQry[0]['user_id']); $conditionUpdate = "user_id='" . $chkQry[0]['user_id'] . "'"; $db->modify(USERS, $dataUpdate, $conditionUpdate); //code to send password reset email $emailid = $chkQry[0]['emailid']; $Urls = '<a href="' . APPLICATION_URL . 'login/reset/requestId/' . md5($chkQry[0]['user_id']) . '">' . APPLICATION_URL . 'login/reset/requestId/' . md5($chkQry[0]['user_id']) . '</a>'; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='3'"); $messageText = $templateData[0]['email_body']; $messageText = str_replace("[NAME]", $emailid, $messageText); $messageText = str_replace("[PASSWORDRESETURL]", $Urls, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); $subject = "forgotpassword mail"; //echo $messageText; exit; SendEmail($dataForm['emailid'], $subject, $messageText); //code to send password reset email return $chkQry[0]['user_id']; } }
function saveSqlError($conn, $error, $sql, $params) { // Guarda el error que generó un query en la tabla de errores web.. global $servidorContingenciaActivo; try { $sql = str_replace("\t", " ", $sql); while (strpos($sql, " ")) { $sql = str_replace(" ", " ", $sql); } $url = $_SERVER["SERVER_NAME"] . $_SERVER["SCRIPT_NAME"]; if (!$servidorContingenciaActivo) { $params = adminXSS($params, false); $sqlError = "INSERT INTO web.wew_erroreswebsql\n\t\t\t\t\t\t\t\t\t\t(ew_error, ew_fechaalta, ew_files, ew_get, ew_id, ew_parametros, ew_post, ew_remotehost, ew_session, ew_sql, ew_url)\n\t\t\t\t\t\t VALUES (:error, SYSDATE, :files, :get, -1, :parametros, :post, :remotehost, :sesion, :sql, :url)"; $stmtError = OCIParse($conn, $sqlError); oci_bind_by_name($stmtError, ":error", substr($error, 0, 512)); oci_bind_by_name($stmtError, ":files", nullIsEmpty(substr(print_r($_FILES, true), 0, 1024))); oci_bind_by_name($stmtError, ":get", nullIsEmpty(substr(print_r($_GET, true), 0, 1024))); oci_bind_by_name($stmtError, ":parametros", nullIsEmpty(substr(print_r($params, true), 0, 4000))); oci_bind_by_name($stmtError, ":post", nullIsEmpty(substr(print_r($_POST, true), 0, 1024))); oci_bind_by_name($stmtError, ":remotehost", nullIsEmpty(substr(gethostbyaddr($_SERVER['REMOTE_ADDR']), 0, 128))); oci_bind_by_name($stmtError, ":sesion", nullIsEmpty(substr(str_replace(" ", " ", isset($_SESSION) ? print_r($_SESSION, true) : ""), 0, 1024))); oci_bind_by_name($stmtError, ":sql", substr($sql, 0, 4000)); oci_bind_by_name($stmtError, ":url", substr($url, 0, 512)); //oci_execute($stmtError); EscribirLogTxt1("saveSqlError errors ", substr($error, 0, 512)); EscribirLogTxt1("saveSqlError params", implode(",", $params)); EscribirLogTxt1("saveSqlError sql", $sql); EscribirLogTxt1("saveSqlError url", substr($url, 0, 512)); throw new Exception($error); } $dbError = oci_error($stmtError); if (isset($dbError["offset"])) { $body = "<html><body>"; $body .= "<div>El siguiente error hay ocurrido mientras se intentaba guardar un error de Oracle desde la web:<span style='color:red;'>" . $dbError["message"] . "</span></div>"; $body .= "<div>Los datos que se intentaban guardar son:"; $body .= "<p>URL: <b>" . $url . "</b></p>"; $body .= "<p>ERROR: <b>" . $error . "</b></p>"; $body .= "<p>SQL: <b>" . $sql . "</b></p>"; $body .= "<p>PARÁMETROS: <b>" . print_r($params, true) . "</b></p>"; $body .= "<p>REMOTE HOST: <b>" . substr(gethostbyaddr($_SERVER['REMOTE_ADDR']), 0, 128) . "</b></p>"; $body .= "<p>SESSION: <b>" . (isset($_SESSION) ? print_r($_SESSION, true) : "") . "</b></p>"; $body .= "<p>POST: <b>" . print_r($_POST, true) . "</b></p>"; $body .= "<p>GET: <b>" . print_r($_GET, true) . "</b></p>"; $body .= "<p>FILES: <b>" . print_r($_FILES, true) . "</b></p>"; $body .= "</div></body></html>"; SendEmail($body, "Provincia ART Web", "Error al intentar guardar un error sql web", array("*****@*****.**"), array(), array(), "H"); } } catch (Exception $e) { // } }
public function csendmailAction() { global $mySession; $db = new Db(); $users = array(); if (!empty($_REQUEST['allusers'])) { //process all users $sql = $db->runQuery("select * from " . BUYERS . ""); for ($i = 0; $i < count($sql); $i++) { $temp = array(); $user_id = $sql[$i]['user_id']; $temp['email'] = $sql[$i]['email']; $temp['name'] = $sql[$i]['name']; $users[] = $temp; } } else { $mailArray = $_REQUEST['rightValues']; if (!empty($mailArray)) { for ($i = 0; $i < count($mailArray); $i++) { $str = explode("::", $mailArray[$i]); $temp = array(); $temp['email'] = $str[0]; $temp['name'] = $str[2]; $users[] = $temp; } } } //send mails if (!empty($users)) { $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='21'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); $messageText = str_replace("[SITEURL]", APPLICATION_URL, $messageText); foreach ($users as $user) { if (!empty($user['name'])) { $message = str_replace("[NAME]", $user['name'], $messageText); } else { $message = str_replace("[NAME]", $user['email'], $messageText); } $to = $user['email']; SendEmail($to, $subject, $message); } $mySession->errorMsg = "Mails has been sent successfully."; } $this->_redirect('users/buyers'); }
$note = addslashes($_POST['note']); if (!CheckName($name)) { $fail_msg_name = "U dient een geldige voor- en achternaam op te geven. Let op: de apostrof (') wordt niet geaccepteerd."; } if (isset($fail_msg_name)) { $fail = TRUE; } if (!isset($fail)) { $query = "INSERT INTO `schades` (Datum, Naam, Boot_ID, Oms_lang) VALUES ('{$today_db}', '{$name}', '{$boat_id}', '{$note}');"; $result = mysql_query($query); if (!$result) { die("toevoegen klacht mislukt." . mysql_error()); } else { // mail aan matcom $message = $name . " heeft zojuist een schade gemeld betreffende '" . $boat . "'.<br>"; SendEmail("*****@*****.**", "Nieuwe schademelding", $message); // feedback op scherm echo "<p>Uw schademelding is doorgegeven aan de Materiaalcommissie.<br>"; echo "Mocht u de melding nog nader willen toelichten of willen wijzigen, neemt u dan contact op via <a href='mailto:materiaal@hunze.nl'>e-mail</a>.<br>"; echo "<br><br><a href='index_boten.php'>Terug naar het schadeoverzicht voor de boten</a></p>"; } } } // Formulier if (!isset($_POST['insert']) && !isset($_POST['delete']) && !isset($_POST['cancel']) || isset($fail) && $fail == true) { echo "<form name='form' action=\"" . (isset($REQUEST_URI) ? $REQUEST_URI : "") . "\" method=\"post\">"; // naam echo "<div class='form-group'><label for='name'>Uw naam</label>"; echo "<input type=\"text\" name=\"name\" id=\"name\" autofocus required value=\"" . (isset($name) ? $name : "") . "\" class=\"form-control\"></div>"; if (isset($fail_msg_name)) { echo "<td><em>" . $fail_msg_name . "</em></td>";
} $sql.= " WHERE se_id = :id"; $params[":id"] = $_REQUEST["Id"]; DBExecSql($conn, $sql, $params); ?> <script> <? if ($dbError["offset"]) { ?> alert('<?= $dbError["message"]?>'); <? } else { if ($imgFotoPath != "") { SendEmail("Se ha cargado la foto del usuario ".$_REQUEST["UserName"].".", "Contacto Web", "Nueva foto cargada desde la intranet", array("*****@*****.**"), array(), array()); echo "window.parent.document.getElementById('NombreFoto').value = '<?= $imgFotoPath?>';"; } ?> function closeWindow() { divWin.close(); } setInterval("closeWindow()", 2000); medioancho = (screen.width - 320) / 2; medioalto = (screen.height - 200) / 2; divWin = window.parent.dhtmlwindow.open('divBox', 'div', 'msgOk', 'Aviso', 'width=320px,height=40px,left=' + medioancho + 'px,top=' + medioalto + 'px,resize=0,scrolling=0'); // window.parent.document.getElementById('spanMensaje').style.display = 'block'; <? }
include_once "inc/header.php"; if (!empty($_POST['username'])) { $entryValue = $_POST['username']; //check to make sure email address is valid //PROBABLY SHOULD ADD A DNS CHECK HERE TOO. SEE http://www.soaptray.com/blog/2008/04/validate-email-addresses-using-php/ if (preg_match("/^.+@.+\\..+\$/", $entryValue)) { //if email is valid: include_once "inc/class.users.inc.php"; $user = new SiteUser(); $addNewUser_result = $user->addNewUser($entryValue); if ($addNewUser_result[0] == 2 or $addNewUser_result[0] == 4) { //Send Email to new user: include_once 'inc/send_mail.php'; //include email file $verification_instruction = "<h4>A verification link has been sent to your email address. Please click the link to verify your account</h4>"; SendEmail($entryValue, "Welcome to " . BRAND_NAME, "Thank you for signing up. \n Please click the following link to verify your account: " . $addNewUser_result[2] . "\n\n If clicking the link does not work, please copy and paste it into your browser."); } echo "<div id='signup_page_message_div' style='padding-left:20px;'>"; echo $addNewUser_result[1]; echo $verification_instruction; echo "</div>"; if ($addNewUser_result[0] == 2) { //if email was stored successfully, don't show the signup HTML exit; } } else { //if email is not valid: echo "<p style='color:red'>Please enter a valid email address</p>"; } } //if page loads and form is blank:
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); }
public function paythroughcreditAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $url = $this->getRequest()->getParam('url'); if ($this->getRequest()->isPost()) { $userId = $mySession->TeeLoggedID; $request = $this->getRequest(); $myform = new Form_Indexpayement(); //$myform=new Form_Indexpayement($url); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); //$packageId=$this->getRequest()->getParam('packageId'); $Data = $db->runQuery("select * from " . LAUNCHCAMPAIGN . " WHERE url='" . $url . "'"); //$getamount=$mySession->price; require_once "paypal_pro.inc.php"; $emai_id = $dataForm['emailid']; //require_once("includes/config.php"); $firstName = urlencode($dataForm['fname']); $lastName = urlencode($dataForm['lname']); $creditCardType = urlencode($dataForm['creditcardtype']); $creditCardNumber = urlencode($dataForm['creditcardno']); $expDateMonth = urlencode($dataForm['exprymonth']); $padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT); $expDateYear = urlencode($dataForm['expryyear']); $cvv2Number = urlencode($dataForm['cvvno']); $address1 = urlencode($dataForm['address']); //$address2 = urlencode($_POST['address2']); $city = urlencode($dataForm['city']); $state = urlencode($dataForm['state']); $zip = urlencode($dataForm['zipcode']); $amount = $mySession->totalamt; $currencyCode = "USD"; $paymentAction = urlencode("Sale"); if ($_POST['recurring'] == 1) { $profileStartDate = urlencode(date('Y-m-d h:i:s')); $billingPeriod = urlencode($_POST['billingPeriod']); // or "Day", "Week", "SemiMonth", "Year" $billingFreq = urlencode($_POST['billingFreq']); // combination of this and billingPeriod must be at most a year $initAmt = $amount; $failedInitAmtAction = urlencode("ContinueOnFailure"); $desc = urlencode("Recurring \$" . $amount); $autoBillAmt = urlencode("AddToNextBilling"); $profileReference = urlencode("Anonymous"); $methodToCall = 'CreateRecurringPaymentsProfile'; $nvpRecurring = '&BILLINGPERIOD=' . $billingPeriod . '&BILLINGFREQUENCY=' . $billingFreq . '&PROFILESTARTDATE=' . $profileStartDate . '&INITAMT=' . $initAmt . '&FAILEDINITAMTACTION=' . $failedInitAmtAction . '&DESC=' . $desc . '&AUTOBILLAMT=' . $autoBillAmt . '&PROFILEREFERENCE=' . $profileReference; } else { $nvpRecurring = ''; $methodToCall = 'doDirectPayment'; } $nvpstr = '&PAYMENTACTION=' . $paymentAction . '&AMT=' . $amount . '&CREDITCARDTYPE=' . $creditCardType . '&ACCT=' . $creditCardNumber . '&EXPDATE=' . $padDateMonth . $expDateYear . '&CVV2=' . $cvv2Number . '&FIRSTNAME=' . $firstName . '&LASTNAME=' . $lastName . '&STREET=' . $address1 . '&CITY=' . $city . '&STATE=' . $state . '&ZIP=' . $zip . '&COUNTRYCODE=US&CURRENCYCODE=' . $currencyCode . $nvpRecurring; /*$paypalPro = new paypal_pro('sdk-three_api1.sdk.com', 'QFZCWN5HZM8VBG7Q', 'A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI', '', '', TRUE, FALSE ); */ $paypalPro = new paypal_pro('8ndra_api1.seznam.cz', 'J3K2SD2RXGG3ZTUY', 'AFcWxV21C7fd0v3bYYYRCpSSRl31A1bWIW8aO685Dq4z21-5wttwtLoY', '', '', TRUE, FALSE); $resArray = $paypalPro->hash_call($methodToCall, $nvpstr); $ack = strtoupper($resArray["ACK"]); if ($ack != "SUCCESS") { echo '<table border="0" cellspacing="4" cellpadding="4" align="center" style="padding-top:40px; padding-bottom:80px;">'; //echo "if"; echo '<tr>'; echo '<td colspan="2" style="font-weight:bold; font-size:20px; color:Green" align="center">Error! Please check that u will provide all information correctly :(</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> TIMESTAMP:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["TIMESTAMP"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Correlation ID:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray['CORRELATIONID'] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;">ACK:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray['ACK'] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> VERSION:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["VERSION"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> BUILD:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["BUILD"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> L_ERRORCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_ERRORCODE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SHORTMESSAGE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SHORTMESSAGE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_LONGMESSAGE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_LONGMESSAGE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SEVERITYCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SEVERITYCODE0"] . '</td>'; echo '</tr>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SEVERITYCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SEVERITYCODE0"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> AMT:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["AMT"] . '</td>'; echo '</tr>'; echo '</table>'; } else { echo '<table border="0" cellspacing="4" cellpadding="4" align="center" style="padding-top:40px; padding-bottom:80px;">'; //echo "success"; echo '<tr>'; echo '<td colspan="2" style="font-weight:bold; font-size:20px; color:Green" align="center">Thank You For Your Payment :)</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Transaction ID:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["TRANSACTIONID"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Amount:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $currencyCode . $resArray['AMT'] . '</td>'; echo '</tr>'; echo '</table>'; $qty = $mySession->totalquantity; $Data = $db->runQuery("select * from " . LAUNCHCAMPAIGN . " WHERE url='" . $url . "'"); //echo "select * from ".LAUNCHCAMPAIGN." WHERE url='".$url."'"; die; $no_ofsold = $Data[0]['sold']; $no_ofsold = $no_ofsold + $qty; //echo "No. Of T sold :".$no_ofsold; die; $data_update['sold'] = $no_ofsold; $condition = "url='" . $url . "'"; $addrs = $dataForm['address'] . " , " . $dataForm['city'] . " , " . $dataForm['state']; //echo "address: ".$addrs; die; //prd($condition); $db->modify(LAUNCHCAMPAIGN, $data_update, $condition); $idqry = $db->runquery("select * from " . LAUNCHCAMPAIGN . " where url='" . $url . "'"); $userid = $idqry[0]['user_id']; $useremail = $db->runquery("select * from " . USERS . " where user_id='" . $userid . "'"); $emailidcreator = $useremail[0]['emailid']; //echo "after payment mail to : ".$emailidcreator; die; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='14'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", $emailidcreator, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); //$messageText=str_replace("[ORDERNO]",$orderno,$messageText); //echo "msg text".$messageText; SendEmail($emailidcreator, $subject, $messageText); $dataInsert['name'] = $dataForm['fname'] . " " . $dataForm['lname']; $dataInsert['total_quantity'] = $mySession->totalquantity; $dataInsert['emailid'] = $dataForm['emailid']; $dataInsert['teeurl'] = $url; $dataInsert['size'] = $mySession->sizes; $dataInsert['t_image'] = 'designtee.png'; //$dataInsert['quantity']=$mySession->seeqty; $dataInsert['totalamt'] = $mySession->totalamt; $dataInsert['amount'] = $mySession->amount; $dataInsert['shipping_address'] = $addrs; $dataInsert['order_date'] = date('Y-m-d H:i:s'); // prd($dataInsert); $db->save(ORDER_RECORD, $dataInsert); $id = $db->lastInsertId(); $orderno = '000D' . $id; //echo "Your Order No. is: ".$orderno; $myObj = new Myaccountdb(); $data = $myObj->emailorder($orderno, $dataForm['emailid']); //$mySession->errorMsg="Your Order No. is: ".$orderno; if ($data == 1) { $mySession->errorMsg = "Order Placed. Order Number Mailed to you"; } $mySession->sizes = ""; unset($mySession->sizes); $mySession->totalquantity = ""; unset($mySession->totalquantity); $mySession->amount = ""; unset($mySession->amount); $mySession->totalamt = ""; unset($mySession->totalamt); } } } }
if ($_SESSION["idUsuario"] == $_SESSION["idEvaluado"]) { // Si es el evaluado.. $params = array(":id" => $_SESSION["idEvaluado"]); $sql = "SELECT dpl1.pl_empleado, dpl2.pl_mail\n\t\t\t\t\t FROM rrhh.dpl_login dpl1, rrhh.dpl_login dpl2\n\t\t\t\t\tWHERE dpl1.pl_jefe = dpl2.pl_id\n\t\t\t\t\t\tAND dpl1.pl_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); $body = "<html><body>El usuario " . $row["PL_EMPLEADO"] . " se ha dado por notificado sobre la descripción de su puesto, <a href='" . $link . LOCAL_PATH_DESCRIPCION_PUESTO . "'>haga click aquí</a> para consultar.<br><br>Si el link no funciona pegue esta dirección en su navegador: " . $link . LOCAL_PATH_DESCRIPCION_PUESTO . "</body></html>"; SendEmail($body, "Sistema de Descripción de Puesto", "[SDP] Aviso de notificación efectuada", array($row["PL_MAIL"]), array(), array(), "H"); } else { // Si es el jefe.. $params = array(":id" => $_SESSION["idEvaluado"]); $sql = "SELECT dpl1.pl_empleado, dpl2.pl_mail\n\t\t\t\t\t FROM rrhh.dpl_login dpl1, rrhh.dpl_login dpl2\n\t\t\t\t\tWHERE dpl1.pl_rrhh = dpl2.pl_id\n\t\t\t\t\t\tAND dpl1.pl_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); $body = "<html><body>El jefe del empleado " . $row["PL_EMPLEADO"] . " se ha dado por notificado sobre la descripción de su puesto, <a href='" . $link . LOCAL_PATH_DESCRIPCION_PUESTO . "'>haga click aquí</a> para consultar.<br><br>Si el link no funciona pegue esta dirección en su navegador: " . $link . LOCAL_PATH_DESCRIPCION_PUESTO . "</body></html>"; SendEmail($body, "Sistema de Descripción de Puesto", "[SDP] Aviso de notificación efectuada", array($row["PL_MAIL"]), array(), array(), "H"); } } } catch (Exception $e) { $dbError = $e->getMessage(); DBRollback($conn); } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>..:: Sistema de Descripción de Puesto ::..</title> <link href="/styles/style.css" rel="stylesheet" type="text/css" /> <? if ($dbError != "") { ?>
} if ($telph) { $message .= "Telefoonnummer: " . $telph . "<br>"; } if ($email) { $message .= "E-mailadres: " . $email . "<br>"; } // Verstuur naar cursist zelf if ($email) { SendEmail($email, "Bevestiging cursusaanmelding", $intro . $message); } // Verstuur naar organisatie if ($org_email != "*****@*****.**") { SendEmail($org_email, "Nieuwe cursusaanmelding", $message); } SendEmail("*****@*****.**", "Nieuwe cursusaanmelding", $message); echo "<h1>Hartelijk dank voor uw aanmelding!</h1><p>Deze is doorgegeven aan het betreffende lid van de Instructiecommissie.<br>Als u zelf een e-mailadres had opgegeven, krijgt u een kopie van uw inschrijving via e-mail.<br>"; echo "<a href='index.php' class='btn btn-primary'>Terug naar het cursusscherm/a></p>"; } } } // Formulier if (!$_POST['insert'] && !$_POST['cancel'] || $fail) { echo "<h1>Aanmeldformulier voor " . $type . " beginnend op " . strftime('%A %d-%m-%Y', $startdate_sh) . " " . $description . "</h1>"; echo "<form name='form' action=\"{$REQUEST_URI}\" method=\"post\">"; // naam echo "<div class='form-group'><label>Naam</label>"; echo "<input type=\"text\" name=\"name\" value=\"{$name}\" class='form-control'>"; if ($fail_msg_name) { echo "<div class='help-block'>{$fail_msg_name}</div>"; }
public function UpdateTemplate($dataForm, $templateId) { global $mySession; $db = new Db(); $dataUpdate['email_subject'] = $dataForm['email_subject']; $dataUpdate['email_body'] = $dataForm['email_body']; $conditionUpdate = "template_id='" . $templateId . "'"; $db->modify(EMAIL_TEMPLATES, $dataUpdate, $conditionUpdate); //Code to send newsletter email to subscribed members if (isset($_REQUEST['save_or_send']) && $_REQUEST['save_or_send'] == '2') { $newsuserData = $db->runQuery("select * from " . USERS . " where newsletter_subscribe='1'"); if ($newsuserData != "" and count($newsuserData) > 0) { foreach ($newsuserData as $key => $valueUserData) { SendEmail($valueUserData['email_address'], $dataForm['email_subject'], $dataForm['email_body']); } } } //Code to send newsletter email to subscribed members return true; }
public function processbookAction() { global $mySession; $db = new Db(); $dataForm = array(); $dataextraForm = array(); $request = $this->getRequest(); if ($this->getRequest()->isPost()) { $post = $request->getPost(); $dateFrom = explode("/", $post['date_from']); $dateFrom = $dateFrom[1] . "/" . $dateFrom[0] . "/" . $dateFrom[2]; $dateTo = explode("/", $post['departureDates']); $dateTo = $dateTo[1] . "/" . $dateTo[0] . "/" . $dateTo[2]; $spclOffer = $post['spclOffrId']; $extras = implode(",", $post['extras']); $dataForm['property_id'] = $post['propertyId']; //$dataForm['property_id'] = $mySession->bookingUser['property_id']; $dataForm['user_id'] = $post['userId']; $dataForm['date_from'] = date('Y-m-d', strtotime($dateFrom)); $dataForm['date_to'] = date('Y-m-d', strtotime($dateTo)); $dataForm['offer_id'] = $spclOffer; $dataForm['min_rate'] = $post['totalAmount']; //$dataForm['extras_id'] = $extras; $dataForm['children'] = $post['Children']; $dataForm['adult'] = $post['Adults']; $dataForm['infants'] = $post['Infants']; // $dataForm['total'] = $mySession->Infants; // $dataForm['rental_amt'] = $post['finalAmount']; $dataForm['booking_date'] = date('Y-m-d'); //TO DO $dataForm['booking_type'] = '0'; // if (!empty($dataForm['depositAmount'])) { $dataForm['paid_status'] = '2'; $dataForm['payment_status'] = 'success'; // } else { // $dataForm['paid_status'] = '0'; // } $dataForm['rental_amt'] = $post['totalAmount']; $dataForm['telephonic'] = '1'; $db->save(BOOKING, $dataForm); $bookingId = $db->lastInsertId(); $dataForm = array(); //code to save in payment table $dataForm['user_id'] = $post['userId']; $dataForm['property_id'] = $post['propertyId']; $dataForm['amount_paid'] = $post['finalAmount']; $dataForm['booking_id'] = $bookingId; $dataForm['payment_date'] = date('Y-m-d'); $dataForm['card_amount'] = $post['cardFees']; $db->save(PAYMENT, $dataForm); $Url = '<a href="' . APPLICATION_URL . '">' . APPLICATION_URL . '</a>'; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='7'"); $usernewData = $db->runQuery("select * from users where user_id=" . $post['userId']); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; //userId $messageText = str_replace("[NAME]", $usernewData[0]['first_name'] . ' ' . $usernewData[0]['last_name'], $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); $messageText = str_replace("[SITEURL]", APPLICATION_URL, $messageText); $messageText = str_replace("[PROPERTYNO]", $post['propertyCode'], $messageText); SendEmail($post['emailAddress'], $subject, $messageText); //code to save data in calendar table /*if($post['finalupdatecalendar']=='yes'){ $dataForm = array(); $dataForm['property_id'] = $mySession->pptyId; $dataForm['date_from'] = date('Y-m-d',strtotime($mySession->arrivalDate)); $dataForm['date_to'] = date('Y-m-d',strtotime($mySession->arrivalDate." + ".$mySession->noOfNights." day")); $dataForm['cal_status'] = '0'; save_calendar_stat($mySession->pptyId,$dataForm['date_from'],$dataForm['date_to']); }*/ if ($post['finalupdatecalendar'] == 'yes') { $updatecalendar = array(); $updatecalendar['property_id'] = $post['propertyId']; $updatecalendar['date_from'] = date('Y-m-d', strtotime($dateFrom)); $updatecalendar['date_to'] = date('Y-m-d', strtotime($dateTo) - 86400); $updatecalendar['cal_status'] = '0'; $db->save('cal_avail', $updatecalendar); } //saving in the booking extra table foreach ($post['extras'] as $values) { if (!empty($values)) { $extrasArr = $db->runQuery("select ename,eprice*exchange_rate as eprice,etype,stay_type from " . EXTRAS . " \n\t\t\t inner join " . PROPERTY . " on " . PROPERTY . ".id = " . EXTRAS . ".property_id\n\t\t\t\t\t inner join " . CURRENCY . " on " . CURRENCY . ".currency_code = " . PROPERTY . ".currency_code\n where eid = '" . $values . "'\t "); $dataForm = array(); $dataForm['booking_id'] = $bookingId; $dataForm['option_name'] = $extrasArr[0]['ename']; $dataForm['option_price'] = $extrasArr[0]['eprice']; $dataForm['option_status'] = $extrasArr[0]['etype']; $dataForm['stay_type'] = $extrasArr[0]['stay_type']; $db->save(BOOKING_EXTRA, $dataForm); } } $extrasArr = $db->runQuery("select ename,eprice*exchange_rate as eprice,etype,stay_type from " . EXTRAS . " \n inner join " . PROPERTY . " on " . PROPERTY . ".id = " . EXTRAS . ".property_id\n \t\t\t\t\tinner join " . CURRENCY . " on " . CURRENCY . ".currency_code = " . PROPERTY . ".currency_code\n\t\t\t\t\twhere property_id = '" . $post['propertyId'] . "' and etype = '1' "); //saving for the compulosry extras table foreach ($extrasArr as $values) { $dataForm = array(); $dataForm['booking_id'] = $bookingId; $dataForm['option_name'] = $values['ename']; $dataForm['option_price'] = $values['eprice']; $dataForm['option_status'] = $values['etype']; $dataForm['stay_type'] = $values['stay_type']; $db->save(BOOKING_EXTRA, $dataForm); } $mySession->sucessMsg = "Thank you.. Property has been Booked Successfully"; $pptyno = $db->runQuery("select propertycode from " . PROPERTY . " where id = '" . $post['propertyId'] . "' "); // $fullName = $mySession->LoggedUserName; // // $Url = '<a href="' . APPLICATION_URL . '">' . APPLICATION_URL . '</a>'; // $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='7'"); // $messageText = $templateData[0]['email_body']; // $subject = $templateData[0]['email_subject']; // // $messageText = str_replace("[NAME]", $fullName, $messageText); // $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); // $messageText = str_replace("[SITEURL]", APPLICATION_URL, $messageText); // $messageText = str_replace("[PROPERTYNO]", $pptyno[0]['propertycode'], $messageText); // // SendEmail($dataForm['email_address'], $subject, $messageText); //===== code for adding popular properties //two cases //1. when booked property is already in the list of slides property //2. when booked property is not in the list of slides property $identifyArr = $db->runQuery("select * from " . SLIDES_PROPERTY . " where lppty_property_id = '" . $post['propertyId'] . "' and lppty_type = '1' "); if ($identifyArr != "" and count($identifyArr) > 0) { $db->delete(SLIDES_PROPERTY, 'lppty_id= "' . $identifyArr[0]['lppty_id'] . '" '); $updateData = array(); $updateData['lppty_order'] = new Zend_Db_Expr('lppty_order-1'); $updateData['lppty_status'] = '1'; $db->modify(SLIDES_PROPERTY, $updateData, "lppty_type='1' and lppty_order > '" . $identifyArr[0]['lppty_order'] . "' "); } else { $updateData = array(); $updateData['lppty_order'] = new Zend_Db_Expr('lppty_order+1'); $updateData['lppty_status'] = '1'; $db->modify(SLIDES_PROPERTY, $updateData, "lppty_type='1'"); $saveData = array(); $saveData['lppty_property_id'] = $post['propertyId']; $saveData['lppty_type'] = '1'; $saveData['lppty_order'] = '1'; $db->save(SLIDES_PROPERTY, $saveData); } //--------------------------------------- //__bookSessionClear(); $this->_redirect("booking"); } else { $this->_redirect("booking/manage"); } }
$referrer = intval($_COOKIE['ava_ref']); } else { $referrer = 0; } $seo_url = seoname($username); // If email validation is off, instantly activate the account if ($setting['email_on'] == 0) { $sql = mysql_query("INSERT INTO ava_users (username, password, email, activate, joined, referrer, seo_url)\n \t\tVALUES('{$username}', '{$passwordpro}', '{$email}', '1', '{$date}', {$referrer}, '{$seo_url}')") or die(mysql_error()); $new_user = mysql_insert_id(); // If user was referred, give the referrer points if (isset($_COOKIE['ava_ref'])) { mysql_query("UPDATE ava_users SET points = points + {$setting['points_refer']} WHERE id= {$referrer}"); $date = date("F j Y, G:i"); $profile_url = ProfileUrl($new_user, seoname($username)); mysql_query("INSERT INTO ava_messages (user_id, sender_id, sender_name, title, message, date) \n\t\t\t\t\tVALUES ('{$referrer}', '{$new_user}', '{$username}', '{$username} " . REF_PM_TITLE . " {$setting['site_name']}', '{$username} " . REF_PM_MESSAGE . ": <a href=\"{$profile_url}\">{$profile_url}</a>', '{$date}')"); } echo VALIDATED; } else { $sql = mysql_query("INSERT INTO ava_users (username, password, email, joined, referrer, seo_url)\n \t\t\tVALUES('{$username}', '{$passwordpro}', '{$email}', '{$date}', {$referrer}, '{$seo_url}')") or die(mysql_error()); $userid = mysql_insert_id(); $data = array('email_address' => $email, 'to_username' => $username, 'subject' => EMAIL_REGISTER_HEADER . ' ' . $username, 'send_email' => 1); $data['validate_url'] = $setting['site_url'] . '/index.php?task=validate&id=' . $userid . '&code=' . $passwordpro; SendEmail($data, 'validate_email'); echo EMAIL4; // Email sent message } } } } else { include $register_form; }
$params = array(":mejora" => $_POST["CompromisoMejora" . $iLoop], ":usumodif" => $user, ":id" => $_POST["CompromisoMejoraId" . $iLoop]); DBExecSql($conn, $sql, $params); } else { $sql = "INSERT INTO rrhh.hcm_compromisomejora (cm_id_formularioevaluacion, cm_mejora, cm_usualta, cm_fechaalta)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t VALUES (:idformularioevaluacion, SUBSTR(:mejora, 1, 2000), UPPER(:usualta), SYSDATE)"; $params = array(":idformularioevaluacion" => $_POST["FormularioId"], ":mejora" => $_POST["CompromisoMejora" . $iLoop], ":usualta" => $user); DBExecSql($conn, $sql, $params); } $iLoop++; } if ($_POST["CerrarEvaluacion"] == "true") { $sql = "UPDATE rrhh.hue_usuarioevaluacion\n\t\t\t\t\t\tSET ue_evaluador_ok = 1\n\t\t\t\t WHERE ue_evaluado = UPPER(:evaluado)\n\t\t\t\t\t\tAND ue_anoevaluacion = :ano"; $params = array(":evaluado" => $_POST["Evaluado"], ":ano" => $_POST["Ano"]); DBExecSql($conn, $sql, $params); $sql = "SELECT ue_evaluador destinatarios\n \t\t\t\t FROM rrhh.hue_usuarioevaluacion\n \t\t\t\t\tWHERE ue_evaluado = " . addQuotes($_POST["Evaluado"]) . "\n \t\t\t\t\t\tAND ue_anoevaluacion = " . $_POST["Ano"]; $body = "<html><body>Su evaluación de desempeño ya está disponible, por favor <a href='http://" . $_SERVER["HTTP_HOST"] . "/modules/encuestas/evaluacion_desempeno/'>ingrese haciendo click aquí</a> para notificarse.<br><br>Si el link no funciona pegue esta dirección en su navegador: http://" . $_SERVER["HTTP_HOST"] . "/modules/encuestas/evaluacion_desempeno</body></html>"; SendEmail($body, "Aviso Intranet", "Evaluación efectuada", GetEmail(explode(";", $_POST["Evaluado"])), array(), array(), "H"); } } if ($user == $_POST["Supervisor"]) { // Si el que guarda es el supervisor.. $sql = "UPDATE rrhh.hfe_formularioevaluacion2008\n\t\t\t\t\tSET fe_fechasupervisor = SYSDATE,\n\t\t\t\t\t\t\tfe_comentariosupervisor = SUBSTR(:comentariossupervisor, 1, 2000),\n\t\t\t\t\t\t\tfe_usumodif = UPPER(:usumodif),\n\t\t\t\t\t\t\tfe_fechamodif = SYSDATE\n\t\t\t WHERE fe_id = :id"; $params = array(":comentariossupervisor" => $_POST["ComentariosSupervisor"], ":usumodif" => $user, ":id" => $_POST["FormularioId"]); DBExecSql($conn, $sql, $params); } } catch (Exception $e) { echo "<script>alert(unescape('" . rawurlencode($e->getMessage()) . "'));</script>"; exit; } ?> <script> function closeWindow() {
while ($user = mysql_fetch_array($user_data)) { if ($user['id'] == $friend) { $to_data = array('email_address' => $user['email'], 'to_username' => $user['username'], 'send_email' => $user['email_friend_request']); } else { $from_data = array('from_username' => $user['username'], 'from_join_date' => $user['joined'], 'from_location' => $user['location']); $from_data['from_avatar'] = AvatarUrl($user['avatar'], $user['facebook'], $user['facebook_id']); } } $data = $to_data + $from_data; $data['subject'] = EMAIL_FR_HEADING; if ($setting['seo_on'] != 0) { $data['accept_link'] = $setting['site_url'] . '/friends'; } else { $data['accept_link'] = $setting['site_url'] . '/?task=friends'; } SendEmail($data, 'friend_request'); } } } } // Accept friend request if ($_POST['type'] == 'accept_request') { $valid_request = mysql_query("SELECT * FROM tbl_friend_requests WHERE (from_user = {$friend} AND to_user = {$xuserid}) OR (from_user = {$xuserid} AND to_user = {$friend})"); //$valid_request = mysql_query("SELECT * FROM tbl_friend_requests WHERE from_user = $friend AND to_user = $xuserid"); if (mysql_num_rows($valid_request)) { mysql_query("INSERT INTO tbl_friends SET user1 = {$xuserid}, user2 = {$friend}"); mysql_query("INSERT INTO tbl_friends SET user1 = {$friend}, user2 = {$xuserid}"); mysql_query("DELETE FROM tbl_friend_requests WHERE from_user = {$friend} AND to_user = {$xuserid}") or die(mysql_error()); mysql_query("UPDATE tbl_users SET friend_requests = friend_requests - 1 WHERE id = {$xuserid}"); } }
public function InviteReceive($email, $pool_id, $inviter = NULL) { //get Pool Invites values for given user (this is a string of pool ids that a user has been invited to) $query = "SELECT `Pool Invites` FROM `User` WHERE `Email Address` = '{$email}'"; $result = mysqli_query($this->cxn, $query); $result_array = mysqli_fetch_assoc($result); if (!isset($result_array)) { //if the user is a new user: $add_new_user_result = $this->addNewUser($email); //store user in DB as an unverified user include 'send_mail.php'; //include email file //send user email: SendEmail($email, "You have been invited to a pool on Poolski.com!", "You have been invited to a pool by " . $inviter . " on Poolski.com! \n \n\nClick here to create an account and join the pool: " . $add_new_user_result[2] . " \n \nPlease copy and paste the entire URL into your browser if clicking on it doesn't work.\n \n\nPoolski.com is a site that allows you to create betting pools with your friends online\n \nUse Poolski to bet on anything from the Academy Awards or the outcome of your favorite TV show."); $append_value = $pool_id . ","; //this is the value we will be appending to the original Pool Invites value $append_query = "UPDATE `User` SET `Pool Invites` = '{$append_value}' WHERE `Email Address` = '{$email}';"; $result2 = mysqli_query($this->cxn, $append_query); //append given pool id into user's Pool Invites field in DB return "\n\nInvite sent to " . $email . "!"; } else { //if user is NOT a new user: $user_id = $this->GetUserIDFromEmail($email); //get given email's USER ID //check to see if given user is already a member of given pool: $check_pool_membership_query = "SELECT * FROM `Pool Membership` WHERE `User ID` = '{$user_id}' AND `Pool ID` = '{$pool_id}'"; $membership_check_result = mysqli_query($this->cxn, $check_pool_membership_query); $membership_check_array = mysqli_fetch_assoc($membership_check_result); if (!isset($membership_check_array)) { //if given user is NOT already a member of given pool: $existing_pool_invites = $result_array['Pool Invites']; //store original Pool Invites value //Check to make sure invitee does not already have an invite for this pool waiting: $existing_pool_invites_array = explode(',', $existing_pool_invites); if (in_array($pool_id, $existing_pool_invites_array)) { //if user already has an invite pending for this pool: return "\n\nInvite NOT sent to " . $email . " because they have already been invited to the pool."; exit; } //If invitee does NOT already have an invite pending for this pool: $append_value = $pool_id . ","; //this is the value we will be appending to the original Pool Invites value $append_query = "UPDATE `User` SET `Pool Invites` = concat('{$append_value}', '{$existing_pool_invites}') WHERE `Email Address` = '{$email}';"; $result2 = mysqli_query($this->cxn, $append_query); //append given pool id into user's Pool Invites field in DB include 'send_mail.php'; //include email file SendEmail($email, "You have been invited to a pool!", "You have been invited to a pool by " . $inviter . "! Click here to see the invite: " . DOMAIN . "home.php"); return "\n\nInvite sent to " . $email . "!"; } else { //if the given user IS already a member of the given pool: return "\n\nInvite NOT sent to " . $email . " because they have already been invited to the pool."; } } }
function BorrarBD() { global $mysqliDB; global $ErrorSQL; global $ErrorSQLtxt; $query = "LOCK TABLES comppilots WRITE;"; $ErrorSQL = 0; $ErrorSQLtxt = ""; $resultado = $mysqliDB->query($query); if (!$resultado) { $ErrorSQLtxt = __LINE__ . " Error : (" . $mysqliDB->errorCode() . ") " . $mysqliDB->errorCode(); $ErrorSQL = 1; return 1; } $query = "DELETE FROM comppilots WHERE CompNo = " . $_REQUEST["CompNo"] . " AND PilotNo = " . $_REQUEST["PilotNo"] . ";"; $resultado = $mysqliDB->query($query); if (!$resultado) { $ErrorSQLtxt = __LINE__ . " Error inserting row: (" . $mysqliDB->errorCode() . ") " . $query; $ErrorSQL = 1; return 1; } $resultado = $mysqliDB->query("UNLOCK TABLES"); if (!$resultado) { $ErrorSQLtxt = __LINE__ . " Error inserting row: (" . $mysqliDB->errorCode() . ") " . $query; $ErrorSQL = 1; return 1; } $query = "SELECT FirstName, Email FROM pilots WHERE PilotNo = " . $_REQUEST["PilotNo"] . ";"; $resultado = $mysqliDB->query($query); if (!$resultado) { $ErrorSQLtxt = __LINE__ . " Error inserting row: (" . $mysqliDB->errorCode() . ") " . $query; $ErrorSQL = 1; return 1; } $pilot = $resultado->fetch(PDO::FETCH_ASSOC); $query = "SELECT CompName, DATE_FORMAT(CompDate, '%d/%m/%Y') as CompDate, CompVenue FROM comps WHERE CompNo = " . $_REQUEST["CompNo"] . ";"; $resultado = $mysqliDB->query($query); if (!$resultado) { $ErrorSQLtxt = __LINE__ . " Error inserting row: (" . $mysqliDB->errorCode() . ") " . $query; $ErrorSQL = 1; return 1; } $concurso = $resultado->fetch(PDO::FETCH_ASSOC); $message = "Estimado " . $pilot["FirstName"] . "<br><br>" . "Has quedado eliminado del concurso " . $concurso["CompName"] . " que tendrá lugar el " . $concurso["CompDate"] . " en " . $concurso["CompVenue"] . "<br><br>" . "Un saludo<br>Gliderlink"; SendEmail($pilot["Email"], $message); return 0; }
public function ownercontactus($dataForm) { global $mySession; $db = new Db(); $adminArr = $db->runQuery("select * from " . ADMINISTRATOR . " "); //code to send password reset email $dataForm = SetupMagicQuotes($dataForm); $fullName = $dataForm['full_name']; $subject = "Dealatrip:" . $dataForm['subject']; $messageText = "Full Name : " . $dataForm['full_name'] . "<br>"; $messageText .= "Email : " . $dataForm['email_address'] . "<br>"; $messageText .= "Phone : " . $dataForm['phone'] . "<br>"; if ($dataForm['property_no'] != "") { $messageText .= "Property Number : " . $dataForm['property_no'] . "<br>"; } $messageText .= "Message : " . $dataForm['question']; //$messageText .= "Enquiry : ".$dataForm['comment']; SendEmail($adminArr[0]['admin_email'], $subject, $messageText, $dataForm['email_address']); SendEmail("*****@*****.**", $subject, $messageText, $dataForm['email_address']); //return $chkQry[0]['user_id']; }
<? session_start(); require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db_funcs.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/send_email.php"); if (!isset($_SESSION["idUsuario"])) { ?> <script type="text/javascript"> window.location.href = '/modules/admin_users_web/login.php'; </script> <? exit; } $body = "Usuario: ".$_REQUEST["usuario"]."\n". "e-Mail: ".$_REQUEST["email"]; $subject = "Error en la carga de usuarios de Adecco"; SendEmail($body, "Web", $subject, array("*****@*****.**"), array(), array()); ?> <script type="text/javascript"> alert('Momentaneamente el sistema no puede guardar los datos, pero se envió un e-mail a Provincia ART \n para que los datos sean cargados manualmente. Los mismos estarán cargados dentro de la próxima hora.'); history.go(-3); </script>
$sMessage .= " using:\n"; $sMessage .= "From Name = {$sFromName}\n"; $sMessage .= "From Address = {$sFromEmailAddress}\n"; $sSQL = "SELECT * FROM email_message_pending_emp " . "WHERE emp_usr_id='{$iUserID}'"; extract(mysql_fetch_array(RunQuery($sSQL))); // $sMessage .= "Email sent to $emp_num_sent email addresses.\n"; // $emp_num_sent not a field in email_message_pending_emp $sMessage .= "Email job terminated at {$tTimeStamp}\n\n"; $sMessage .= "Email job log:\n\n"; $sSQL = "SELECT * FROM email_job_log_{$iUserID} ORDER BY ejl_id"; $sHTMLLog = '<br><br><div align="center"><table>'; $rsEJL = RunQuery($sSQL); while ($aRow = mysql_fetch_array($rsEJL)) { extract($aRow); $sTime = date('i:s', intval($ejl_time)) . '.'; $sTime .= substr($ejl_usec, 0, 3); $sMsg = $ejl_text; $sMessage .= $sTime . ' ' . $sMsg . "\n"; $sHTMLLog .= "<tr><td>{$sTime}</td><td>{$sMsg}</td></tr>\n"; } $sHTMLLog .= '</table></div>'; echo $sHTMLLog; $sMsg = "Attempting to email log to {$sFromEmailAddress}\n"; echo $sMsg . '<br>'; SendEmail($sSubject, $sMessage, "", 0, $sFromEmailAddress); } else { // we're in an undefined state // exit this with an error $_SESSION['sEmailState'] = 'error'; AddToEmailLog('Job in undefined state, attempt to save data and exit', $iUserID); } require 'Include/Footer.php';
'); <? } else { $params = array(":id" => $_REQUEST["MotivoAusencia"]); $sql = "SELECT ma_detalle FROM rrhh.rma_motivosausencia WHERE ma_id = :id"; $motivo = ValorSql($sql, "", $params); // Envío un e-mail de aviso a RRHH.. $body = "Se registró una nueva ausencia.\n". "El empleado ausente es: ".$empleado.".\n". "Reportado por: ".GetUserName().".\n". "Motivo: ".$motivo.".\n". "Enviar médico: ".(($_REQUEST["enviarMedico"] == "T")?"Sí":"No").".\n"; if ($_REQUEST["enviarMedico"] == "F") $body.= "Justificación: ".$_REQUEST["justifique"]."."; SendEmail($body, "Aviso Intranet", "Aviso de Ausencia", array("rrhh-provinciaart"), array(), array()); echo "window.parent.document.getElementById('spanMensaje').style.display = 'block';"; echo "window.parent.LimpiarForm(window.parent.document.getElementById('formAusentismo'))"; } ?> </script> </head> <body> ok </body> </html>