本文整理汇总了PHP中encrypt_decrypt函数的典型用法代码示例。如果您正苦于以下问题:PHP encrypt_decrypt函数的具体用法?PHP encrypt_decrypt怎么用?PHP encrypt_decrypt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encrypt_decrypt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ebay_revise_item
function ebay_revise_item($user_id, $item_id, $revise_price, $revise_qty)
{
include 'site_conf.php';
$sql_config = "SELECT \n \t\t\t\teu.dev_name,\n \t\t\t\teu.app_name,\n \t\t\t\teu.cert_name,\n \t\t\t\teu.token,\n \t\t\t\tec.paypal_address,\n \t\t\t\tec.return_accept_option,\n \t\t\t\tec.refund_option,\n \t\t\t\tec.return_days \n \t\tFROM \t\n \t\t\t\tebay_users eu,\n \t\t\t\tebay_config ec\n \t\tWHERE \n \t\t\t\teu.user_id = ec.user_id AND \n \t\t\t\teu.user_id = {$user_id}\t\t\t\t\n ";
$rs_config = mysql_query($sql_config) or die(mysql_error());
if (mysql_num_rows($rs_config) != 1) {
die("Database Error - Developer Side");
}
$row_config = mysql_fetch_assoc($rs_config);
$DEVNAME = trim($row_config['dev_name']);
$APPNAME = trim($row_config['app_name']);
$CERTNAME = trim($row_config['cert_name']);
$token = encrypt_decrypt('decrypt', $row_config['token']);
$paypal_email = trim($row_config['paypal_address']);
$return_accept_option = trim($row_config['return_accept_option']);
$refund_option = trim($row_config['refund_option']);
$return_within_days = trim($row_config['return_days']);
$post_data = '<?xml version="1.0" encoding="utf-8"?>
<ReviseItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<ErrorLanguage>en_US</ErrorLanguage>
<Item>
<ItemID>' . $item_id . '</ItemID>
<StartPrice>' . $revise_price . '</StartPrice>
<Quantity>' . $revise_qty . '</Quantity>
<PayPalEmailAddress>' . $paypal_email . '</PayPalEmailAddress>
<ReturnPolicy>
<ReturnsAcceptedOption>' . $return_accept_option . '</ReturnsAcceptedOption>
<RefundOption>' . $refund_option . '</RefundOption>
<ReturnsWithinOption>' . $return_within_days . '</ReturnsWithinOption>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
</Item>
<RequesterCredentials>
<eBayAuthToken>' . $token . '</eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
</ReviseItemRequest>';
$call_name = "ReviseItem";
$ebayapiheader = array("X-EBAY-API-COMPATIBILITY-LEVEL: {$COMPATIBILITYLEVEL}", "X-EBAY-API-DEV-NAME: {$DEVNAME}", "X-EBAY-API-APP-NAME: {$APPNAME}", "X-EBAY-API-CERT-NAME: {$CERTNAME}", "X-EBAY-API-SITEID: {$SiteId}", "X-EBAY-API-CALL-NAME: " . $call_name);
$ch = curl_init();
$res = curl_setopt($ch, CURLOPT_URL, $eBayAPIURL);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
// 0 = Don't give me the return header
curl_setopt($ch, CURLOPT_HTTPHEADER, $ebayapiheader);
// Set this for eBayAPI
curl_setopt($ch, CURLOPT_POST, 1);
// POST Method
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
//My XML Request
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$body = curl_exec($ch);
//Send the request
curl_close($ch);
// Close the connection
return $body;
}
开发者ID:eparst,项目名称:ebay-amazon-sync-tool,代码行数:58,代码来源:set_profit_ratio.php
示例2: send_mail
function send_mail($to_email, $to_name, $subject, $content, $from_name = '')
{
$table = array("account");
$db = new database();
$query = $db->createQueryAll($table);
$db->setQuery($query);
$result1 = $db->loadAllRow();
//var_dump($result1);
$pass = encrypt_decrypt('decrypt', $result1[0]['pass']);
//var_dump($pass);
//tài khoản gmail dùng để gửi mail
$from_email = $result1[0]['name'];
// Reply to this email
$from_email_pass = $pass;
return send_gmail($from_email, $from_email_pass, $to_email, $to_name, $subject, $content, $from_name);
}
开发者ID:aile54,项目名称:akachan,代码行数:16,代码来源:send_gmail.php
示例3: valider_voyageur
public function valider_voyageur()
{
$message1 = '<h1>Merci d\'avoir validé la réservation.</h1><p>Un courriel a été envoyé au voyageur pour le prévenir.</p><p>N\'hésitez pas à nous appeler si vous avez un quelconque problème.</p>';
$message2 = '<h1>Vous n\'avez plus de places dans votre voiture.</h1><p>La validation de la réservation n\'a pu être effectuée.</p><p>N\'hésitez pas à nous appeler si vous avez un quelconque problème.</p>';
$message3 = '<h1>Vous avez déjà validé cette réservation</h1>';
$message4 = '<h1>Le voyageur a annulé cette réservation</h1><p>Vous ne pouvez donc la valider</p>';
$subject = 'Mariage de Pauline et Pierre-Henri - Reservation de places';
$nr_statut = encrypt_decrypt('decrypt', $_GET['r_statut']);
$nr_id = encrypt_decrypt('decrypt', $_GET['r_id']);
$nr_nb_place = encrypt_decrypt('decrypt', $_GET['r_nb_place']);
$nr_id_voyage = encrypt_decrypt('decrypt', $_GET['id_voyage']);
global $wpdb;
$r_statut = $wpdb->get_var("SELECT r_statut FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_email = $wpdb->get_var("SELECT r_email FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$nb_place = $wpdb->get_var("SELECT nb_place FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$nom = $wpdb->get_var("SELECT nom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$prenom = $wpdb->get_var("SELECT prenom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$email = $wpdb->get_var("SELECT email FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$telephone = $wpdb->get_var("SELECT telephone FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$message = '
<html>
<h3>Bonjour,</h3>
<p>' . $prenom . ' ' . $nom . ' a validé votre réservation dans sa voiture</p>
<p>N\'hésitez pas à le contacter.</p>
<p>Voici son email : ' . $email . ' ainsi que son numéro de téléphone : ' . $telephone . '.</p>
<p>Vous pouvez annuler votre reservation en cliquant ici : <a href="' . site_url() . '/annulation?r_statut=4&r_id=' . encrypt_decrypt('encrypt', $nr_id) . '&r_nb_place=' . encrypt_decrypt('encrypt', $nr_nb_place) . '&id_voyage=' . encrypt_decrypt('encrypt', $nr_id_voyage) . '">Annuler ma réservation</a></br>
<p>Dans la joie de vous voir bientôt,</p>
<p>Pauline & Pierre-Henri</p>
<p>06 86 94 22 52</p>';
if ($nb_place - $nr_nb_place >= 0 && $r_statut != 2 && $r_statut != 4) {
$wpdb->query("UPDATE {$wpdb->prefix}covoit_reservation SET r_statut = '{$nr_statut}' WHERE id = '{$nr_id}'");
$wpdb->query("UPDATE {$wpdb->prefix}covoit_voyage SET nb_place = nb_place - '{$nr_nb_place}' WHERE id = '{$nr_id_voyage}'");
wp_mail($r_email, $subject, $message, $headers);
return $message1;
} elseif ($r_statut == 2) {
return $message3;
} elseif ($r_statut == 4) {
return $message4;
} else {
return $message2;
}
}
开发者ID:phdulac,项目名称:wordpress,代码行数:44,代码来源:valider_reservation.php
示例4: refuser_voyageur
public function refuser_voyageur()
{
global $wpdb;
$subject = 'Mariage de Pauline et Pierre-Henri - Reservation de places';
$nr_statut = encrypt_decrypt('decrypt', $_GET['r_statut']);
$nr_id = encrypt_decrypt('decrypt', $_GET['r_id']);
$nr_id_voyage = encrypt_decrypt('decrypt', $_GET['id_voyage']);
$r_nom = $wpdb->get_var("SELECT r_nom FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_prenom = $wpdb->get_var("SELECT r_prenom FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_statut = $wpdb->get_var("SELECT r_statut FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_email = $wpdb->get_var("SELECT r_email FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_telephone = $wpdb->get_var("SELECT r_telephone FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$nom = $wpdb->get_var("SELECT nom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$prenom = $wpdb->get_var("SELECT prenom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$email = $wpdb->get_var("SELECT email FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$telephone = $wpdb->get_var("SELECT telephone FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$message1 = '<h1>Vous avez décliné la demande de réservation de ' . $r_prenom . ' ' . $r_nom . '</h1><p>Un courriel lui a été envoyé pour le prévenir.</p><p>N\'hésitez pas à nous appeler si vous avez un quelconque problème.</p>';
$message2 = '<h1>Vous avez déjà validé cette réservation</h1><p>Si vous ne souhaitez plus prendre ce voyageur, vous devez le contacter pour qu\'il annule lui-même sa reservation.</p>
<p>Voici ses coordonnées</p><p>Courriel : ' . $r_email . '</p><p>Téléphone : ' . $r_telephone . '</p>';
$message3 = '<h1>Vous avez déjà refusé cette réservation</h1>';
$message4 = '<h1>Le voyageur a déjà lui-même annulé cette réservation</h1>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$message = '
<html>
<h3>Bonjour,</h3>
<p>Nous sommes vraiment désolés mais ' . $prenom . ' ' . $nom . ' n\'a pas validé votre réservation dans sa voiture.</p>
<p>N\'hésitez pas à allez voir à nouveau sur notre site si d\'autres voyages sont disponibles.<p></p>Sinon, n\'hésitez pas à nous contacter pour que nous trouvions une solution.</p>
<p>Dans la joie de vous voir bientôt,</p>
<p>Pauline & Pierre-Henri</p>
<p>06 86 94 22 52</p>';
if ($r_statut != 3) {
$wpdb->query("UPDATE {$wpdb->prefix}covoit_reservation SET r_statut = '{$nr_statut}' WHERE id = '{$nr_id}'");
wp_mail($r_email, $subject, $message, $headers);
return $message1;
} elseif ($r_statut == 2) {
return $message2;
} elseif ($r_statut == 4) {
return $message4;
} else {
return $message2;
}
}
开发者ID:phdulac,项目名称:wordpress,代码行数:43,代码来源:refuser_reservation.php
示例5: check_token
function check_token($mytoken)
{
$timeout = 60;
$decr_b64 = urlsafe_b64decode($mytoken);
$decrypted = encrypt_decrypt('decrypt', $decr_b64);
$fields = explode(":", $decrypted);
if (count($fields) == 2) {
list($ip, $timestamp) = explode(":", $decrypted);
$nowtime = time();
//echo "$ip, $timestamp, $timeout\n";
$sum = (int) ($timestamp + $timeout);
if ($nowtime > $sum || $nowtime < $timestamp) {
return false;
} else {
return true;
}
} else {
return false;
}
return false;
}
开发者ID:bigHosting,项目名称:RTBH,代码行数:21,代码来源:f-encryption.php
示例6: checkUserToken
function checkUserToken($customerToken)
{
$customerId = encrypt_decrypt('decrypt', $customerToken);
$customer = Mage::getModel('customer/customer')->load($customerId);
if ($customer != null && $customer->getWebsiteId()) {
Mage::app($customer->getWebsiteId(), 'website');
$session = Mage::getSingleton('customer/session');
$session->loginById($customerId);
/*
* $customerData = $customer->getData();
foreach ($customerData as $key => $value) {
error_log("*".$key."-".$value);
}
* */
if ($session->isLoggedIn()) {
return $customerId;
} else {
return false;
}
} else {
return false;
}
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:23,代码来源:Utils.php
示例7: annuler_voyageur
public function annuler_voyageur()
{
$message1 = '<h1>Vous avez annulé votre réservation</h1><p>Nous espérons que vous avez trouvé un autre moyen de vous rendre à notre mariage.</p><p>N\'hésitez pas à nous contacter si vous avez un quelconque soucis</p>';
$message2 = '<h1>Vous avez déjà annulé votre réservation</h1><p>Nous espérons que vous avez trouvé un autre moyen de vous rendre à notre mariage.</p><p>N\'hésitez pas à nous contacter si vous avez un quelconque soucis</p>';
$subject = 'Mariage de Pauline et Pierre-Henri - Un voyageur a annulé sa réservation';
$nr_statut = encrypt_decrypt('decrypt', $_GET['r_statut']);
$nr_id = encrypt_decrypt('decrypt', $_GET['r_id']);
$nr_nb_place = encrypt_decrypt('decrypt', $_GET['r_nb_place']);
$nr_id_voyage = encrypt_decrypt('decrypt', $_GET['id_voyage']);
global $wpdb;
$r_statut = $wpdb->get_var("SELECT r_statut FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$nb_place = $wpdb->get_var("SELECT nb_place FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$nr_id_voyage}'");
$r_nom = $wpdb->get_var("SELECT r_nom FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_prenom = $wpdb->get_var("SELECT r_prenom FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_email = $wpdb->get_var("SELECT r_email FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$r_telephone = $wpdb->get_var("SELECT r_telephone FROM {$wpdb->prefix}covoit_reservation WHERE id = '{$nr_id}'");
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$message = '
<html>
<h3>Bonjour,</h3>
<p>' . $r_prenom . ' ' . $r_nom . ' a annulé sa réservation dans votre voiture</p>
<p>Voici son email : ' . $r_email . ' ainsi que son numéro de téléphone : ' . $r_telephone . '.</p>
<p>Dans la joie de vous voir bientôt,</p>
<p>Pauline & Pierre-Henri</p>
<p>06 86 94 22 52</p>';
if ($r_statut != 4) {
$wpdb->query("UPDATE {$wpdb->prefix}covoit_reservation SET r_statut = '{$nr_statut}' WHERE id = '{$nr_id}'");
if ($r_statut = 2) {
$wpdb->query("UPDATE {$wpdb->prefix}covoit_voyage SET nb_place = nb_place + '{$nr_nb_place}' WHERE id = '{$nr_id_voyage}'");
}
wp_mail($r_email, $subject, $message, $headers);
return $message1;
} else {
return $message2;
}
}
开发者ID:phdulac,项目名称:wordpress,代码行数:37,代码来源:annuler_reservation.php
示例8: d_code
function d_code($string)
{
$output = htmlspecialchars(encrypt_decrypt('decrypt', $string));
return $output;
}
开发者ID:rifkyzulfikarf,项目名称:sukasari-media,代码行数:5,代码来源:blob.php
示例9: send_email_to_headman
private function send_email_to_headman()
{
$body;
$search = array();
$replace = array();
$subject = "";
$returner = "";
$ci =& get_instance();
if ($this->type == "leave") {
$leave_id = $this->main_id;
$leave_type = $this->main_detail['LTName'];
$leave_because = $this->main_detail['LBecause'];
$leave_start_date = $this->main_detail['LStartDate'] . ' ' . $this->main_detail['LStartTime'];
$leave_end_date = $this->main_detail['LEndDate'] . ' ' . $this->main_detail['LEndTime'];
if ($this->main_detail["LAttachFile"] != NULL && $this->main_detail["LAttachFile"] != "") {
$leave_attach_file = $this->main_detail['LAttachFile'];
$leave_attach_file_name = $this->main_detail["LAttachFilename"];
//อย่าลืมเปลี่ยนการวนลูปเพราะมีการเปลี่ยนแลง table ใหม่
$this->email_attach_file[0]["filepath"] = $leave_attach_file;
$this->email_attach_file[0]["filename"] = $leave_attach_file_name;
}
//get leave time detail
$query_time = $ci->leavetime->getDetailByLeaveID($leave_id);
$leave_sum = $this->sum_show_leave_time($query_time->result_array());
$owner_emp_id = $this->user_detail['EmpID'];
$owner_firstname = $this->user_detail['EmpFirstnameThai'];
$owner_fullname = $this->user_detail["EmpFullnameThai"];
$owner_email = $this->user_detail['EmpEmail'];
$headman_user_id = $this->headman_user_id;
$headman_email = $this->headman_detail['EmpEmail'];
$headman_fullname = $this->headman_detail['EmpFullnameThai'];
if ($this->condition == 'request' || $this->condition == 'approve') {
$subject = '[ใบขอเลขที่ ' . $leave_id . '] ลูกทีม ' . $owner_firstname . ' ขออนุญาต ' . $leave_type;
$body = file_get_contents(APPPATH . 'views/Email/ask_approve_to_headman.html');
$search = array('{{headman_fullname}}', '{{leave_type}}', '{{owner_emp_id}}', '{{owner_fullname}}', '{{leave_because}}', '{{leave_start_date}}', '{{leave_end_date}}', '{{leave_sum}}', '{{siteurl}}', '{{headmanid}}', '{{leaveid}}');
$replace = array($headman_fullname, $leave_type, $owner_emp_id, $owner_fullname, $leave_because, $leave_start_date, $leave_end_date, $leave_sum, site_url(), encrypt_decrypt('encrypt', $headman_user_id), encrypt_decrypt('encrypt', $leave_id));
} else {
if ($this->condition == "edit request") {
$subject = '[ใบขอเลขที่ ' . $leave_id . '][มีการแก้ไขใบลา] ลูกทีม ' . $owner_firstname . ' ขออนุญาต ' . $leave_type;
$body = file_get_contents(APPPATH . 'views/Email/edit_ask_approve_to_headman.html');
$search = array('{{headman_fullname}}', '{{leave_type}}', '{{owner_emp_id}}', '{{owner_fullname}}', '{{leave_because}}', '{{leave_start_date}}', '{{leave_end_date}}', '{{leave_old_start_date}}', '{{leave_old_end_date}}', '{{leave_sum}}', '{{siteurl}}', '{{headmanid}}', '{{leaveid}}');
$replace = array($headman_fullname, $leave_type, $owner_emp_id, $owner_fullname, $leave_because, $leave_start_date, $leave_end_date, $leave_detail['LStartDate'] . ' ' . $leave_detail['LStartTime'], $leave_detail['LEndDate'] . ' ' . $leave_detail['LEndTime'], $leave_sum, site_url(), encrypt_decrypt('encrypt', $headman_user_id), encrypt_decrypt('encrypt', $leave_id));
}
}
} else {
if ($this->type === "overtime") {
$ot_id = $this->main_id;
$ot_date = $this->main_detail['wot_date'];
$ot_remark = $this->main_detail['wot_remark'];
$ot_time_from = $this->main_detail['wot_time_from'];
$ot_time_to = $this->main_detail['wot_time_to'];
$owner_emp_id = $this->user_detail['EmpID'];
$owner_firstname = $this->user_detail['EmpFirstnameThai'];
$owner_fullname = $this->user_detail["EmpFullnameThai"];
$owner_email = $this->user_detail['EmpEmail'];
$owner_position = $this->user_detail['PositionName'];
$headman_user_id = $this->headman_user_id;
$headman_email = $this->headman_detail['EmpEmail'];
$headman_fullname = $this->headman_detail['EmpFullnameThai'];
if ($this->condition == 'request' || $this->condition == 'approve') {
$subject = '[ใบขอเลขที่ ' . $ot_id . '] ลูกทีม ' . $owner_firstname . ' ขอทำงานล่วงเวลา';
$body = file_get_contents(APPPATH . '/views/Email/request_ot_to_headman.html');
$search = array('{{headman_fullname}}', '{{owner_emp_id}}', '{{owner_fullname}}', '{{owner_positionname}}', '{{ot_date}}', '{{ot_time_from}}', '{{ot_time_to}}', '{{ot_id}}', '{{headman_user_id}}', '{{en_ot_id}}', '{{site_url}}');
$replace = array($headman_fullname, $owner_emp_id, $owner_fullname, $owner_position, dateThaiFormatFromDB($ot_date), $ot_time_from, $ot_time_to, $ot_id, encrypt_decrypt('encrypt', $headman_user_id), encrypt_decrypt('encrypt', $ot_id), site_url());
}
}
}
$body = str_replace($search, $replace, $body);
$this->body = $body;
$this->subject = $subject;
//send mail library
//non config because default set in phpmailer class
$ci->load->library('Phpmailer', 'phpmailer');
$ci->phpmailer->ClearAllRecipients();
$ci->phpmailer->IsSMTP();
$ci->phpmailer->Subject = $this->subject;
if (count($this->email_attach_file) > 0) {
foreach ($this->email_attach_file as $email) {
$ci->phpmailer->AddAttachment($email["filepath"], $email["filename"]);
}
}
$ci->phpmailer->Body = $this->body;
//ส่วนนี้รายละเอียดสามารถส่งเป็นรูปแบบ HTML ได้
$ci->phpmailer->AddAddress($this->headman_detail["EmpEmail"], $this->headman_detail["EmpFullnameThai"]);
if (!$ci->phpmailer->Send()) {
log_message('error', 'Error send mail ' . var_dump($ci->phpmailer->ErrorInfo));
return $ci->phpmailer->ErrorInfo;
} else {
return 'success';
}
}
开发者ID:KanexKane,项目名称:hrsystem,代码行数:91,代码来源:WorkflowSystem.php
示例10: instant_hr_approve_disapprove_from_email
/**
* [instant_hr_approve_disapprove_from_email description] รวมจาก approve_from_email , disapprove_from_email
* @param string $type [approve/disapprove]
* @param int $hr_userid encrypt hr user id
* @param int $headman_userid encrypt headman user id
* @param int $leave_id encrypt leave id
*/
public function instant_hr_approve_disapprove_from_email($type, $hr_userid, $headman_userid, $leave_id)
{
$hr_userid = floatval(encrypt_decrypt('decrypt', $hr_userid));
$headman_userid = floatval(encrypt_decrypt('decrypt', $headman_userid));
$leave_id = encrypt_decrypt('decrypt', $leave_id);
$workflow_id = 0;
$log_type = '';
$log_detail = '';
$alert_success = '';
if ($type == 'approve') {
$log_type = 'hr_approve_from_email';
$log_detail = 'อนุมัติใบลาโดย HR ผ่านอีเมล์';
$workflow_id = 4;
$alert_success = 'อนุมัติใบลาเรียบร้อยแล้ว';
} else {
if ($type == 'disapprove') {
$log_type = 'hr_disapprove_from_email';
$log_detail = 'ไม่อนุมัติใบลาโดย HR ผ่านอีเมล์';
$workflow_id = 5;
$alert_success = 'ไม่อนุมัติใบลาเรียบร้อยแล้ว';
}
}
if ($headman_userid > 0) {
$query = $this->leave->getDetailForVerify($leave_id, $headman_id);
if ($query->num_rows() > 0) {
$query = $query->result_array();
$query = $query[0];
if ($query["L_WFID"] > 3) {
echo swalc("ไม่สามารถทำคำสั่งได้", "เนื่องจากมีการอนุมัติ/ไม่อนุมัติไปแล้ว", "error");
} else {
$where = array();
$where["LID"] = $leave_id;
$data = array();
$data["L_WFID"] = $workflow_id;
$this->leave->update($data, $where);
log_leave($log_type, $leave_id, $log_detail, $hr_userid);
echo swalc("สำเร็จ", $alert_success, "success");
}
}
} else {
echo swalc("ผิดพลาด", "ไม่สามารถทำรายการใบลาได้", "error");
}
}
开发者ID:KanexKane,项目名称:hrsystem,代码行数:50,代码来源:Verifyleave.php
示例11: post
<?php
include 'header.php';
//==================== Insert New User =======================
if (isset($_POST['btnSave'])) {
$cboBranch = $_POST['cboBranch'];
$txtUserName = post('txtUserName');
$txtPassword = post('txtPassword');
$txtLevel = post('txtLevel');
$txtDescription = post('txtDescription');
$txtStatus = post('txtStatus');
$encrypted_pass = encrypt_decrypt('encrypt', $txtPassword);
$insert = $db->query("CALL sp_Insert_UserAccount(\n\t\t\t\t'" . time() . "',\n\t\t\t\t'" . $cboBranch . "',\n\t\t\t\tN'" . sql_quote($txtUserName) . "',\n\t\t\t\tN'" . sql_quote($encrypted_pass) . "',\n\t\t\t\t'" . sql_quote($txtLevel) . "',\n\t\t\t\tN'" . sql_quote($txtDescription) . "',\n\t\t\t\t'" . sql_quote($txtStatus) . "'\t\t\t\n\t\t\t\t)");
if ($insert) {
cRedirect('userAccount.php');
}
}
?>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<?php
include 'nav.php';
?>
<!-- Left side column. contains the logo and sidebar -->
<?php
include 'menu.php';
?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
开发者ID:khbuoyrupppiseth7,项目名称:TransferMoney,代码行数:31,代码来源:userAccount-new.php
示例12: showLinkEpisode
function showLinkEpisode($link = null)
{
if (strpos($link, 'picasaweb.google.com/lh/photo/')) {
$link = encrypt_decrypt('decrypt', str_replace('https://picasaweb.google.com/lh/photo/', '', $link));
}
return $link;
}
开发者ID:jassonlazo,项目名称:GamersInvasion-Peliculas,代码行数:7,代码来源:plugins_player.php
示例13: foreach
<div id="page"><div class="page-inner <?php
echo $grid_size;
?>
">
<?php
if (isset($_COOKIE['etype'])) {
foreach ($_COOKIE["etype"] as $name => $value) {
$etyp[$name] = $value;
}
$decrypted_txt = encrypt_decrypt('decrypt', $etyp['perms']);
//$pos = strrpos($decrypted_txt , '_');
// $username = substr($decrypted_txt , 0, $pos);
// $password = substr($decrypted_txt , $pos + 1);
$pos = strrpos($decrypted_txt, '##');
$str1 = substr($decrypted_txt, 0, $pos + 1);
$str2 = substr($decrypted_txt, $pos + 2);
$pos1 = strrpos($str2, '--');
$username = substr($str2, 0, $pos1);
$password = substr($str2, $pos1 + 2);
$param = array('UserName' => "{$username}", 'Password' => "{$password}");
$client = new soapclient('http://etypeservices.com/Service_SubscriberLogin.asmx?WSDL');
$response = $client->ValidateSubscriber($param);
if ($response->ValidateSubscriberResult == 1) {
$query = "select name, uid from users where name='" . $username . "'";
$qu = db_query($query);
$useruid = "";
foreach ($qu as $qu) {
$useruid = $qu->uid;
}
global $user;
$user = user_load($useruid);
开发者ID:etype-services,项目名称:lsn,代码行数:31,代码来源:page.tpl.php
示例14: ajax_rrss
function ajax_rrss()
{
// First check the nonce, if it fails the function will break
check_ajax_referer('ajax-login-nonce', 'security');
foreach (array_keys($_REQUEST) as $key) {
$clean[$key] = mysql_real_escape_string($_REQUEST[$key]);
}
$autoGeneratePass = encrypt_decrypt("encrypt", $clean['uid']);
$info['user_login'] = $clean['username'];
$info['password'] = $autoGeneratePass;
$info['uid'] = $clean['uid'];
$info['nombre'] = $clean['nombre'];
$info['apellido'] = $clean['apellido'];
$info['source'] = $clean['source'];
$info['redirect'] = $clean['redirect'];
//print_d($info);
if ($clean['source'] != "facebook") {
$info['avatar'] = $clean['avatar'];
}
if ($info["user_login"] != "" and $info["uid"] != "" and $info["nombre"] != "") {
$creating = createUser($info);
//print_r($creating);
if ($creating["bool"]) {
echo json_encode(array('loggedin' => true, 'message' => $clean['redirect'], 'userID' => $creating["userID"]));
} else {
if ($creating["status"] == "El e-mail ya esta en uso.") {
$trylogin = loginUser($clean['username'], $autoGeneratePass);
if (is_wp_error($trylogin)) {
echo json_encode(array('loggedin' => 2, 'message' => __('El mail asociado a este usuario ya esta registrado en gob247 con otra red social. Por favor vuelva a intentarlo eligiendo otra de las opciones de login.')));
} else {
echo json_encode(array('loggedin' => 1, 'message' => $clean['redirect'], 'userID' => $creating["userID"]));
}
} else {
echo json_encode(array('loggedin' => 0, 'message' => "No se pudo crear usuario. Intente nuevamente."));
}
}
} else {
echo json_encode(array('loggedin' => 0, 'message' => "No se pudo crear usuario. Probablemente usted no permite compartir información necesaria para crear una cuenta en GOB247."));
}
die;
}
开发者ID:TeamGobApp,项目名称:gob247,代码行数:41,代码来源:functions.php
示例15: hash
// Hash the password
$key = hash('sha256', $key);
if ($action == 'encrypt') {
// Generate a random string, hash it and get the first 16 character of the hashed string which will be ised as the IV
$str = "qwertyuiopasdfghjklzxcvbnm,./;'\\[]-=`!@#\$%^&*()_+{}|\":?><0123456789QWERTYUIOPASDFGHJKLZXCVBNM";
$shuffled = str_shuffle($str);
$iv = substr(hash('sha256', $shuffled), 0, 16);
$output = openssl_encrypt($string, $encryption_method, $key, 0, $iv);
$output = base64_encode($output);
// Tidy up the string so that it survives the transport 100%
$ivoutput = $iv . $output;
// Concat the IV with the encrypted message
return $ivoutput;
} else {
if ($action == 'decrypt') {
$iv = substr($string, 0, 16);
// Extract the IV from the encrypted string
$string = substr($string, 16);
// The rest of the encrypted string is the message
$output = openssl_decrypt(base64_decode($string), $encryption_method, $key, 0, $iv);
return $output;
}
}
}
echo "<b>Message in plain text:</b> {$message}" . "<br /><br />";
// The encrypted text looks like this
$encrypted_txt = encrypt_decrypt('encrypt', $message, $password);
echo "<b>Encrypted text:</b> {$encrypted_txt}" . "<br /><br />";
// Decrypte the message
$decrypted_txt = encrypt_decrypt('decrypt', $encrypted_txt, $password);
echo "<b>Decrypted message:</b> {$decrypted_txt}" . "<br /><br />";
开发者ID:s3luX,项目名称:php-message-encrypt-decrypt,代码行数:31,代码来源:encdec.php
示例16: instant_approve_disapprove_ot_by_hr
public function instant_approve_disapprove_ot_by_hr($type, $hr_user_id, $ot_id)
{
$hr_user_id = encrypt_decrypt('decrypt', $hr_user_id);
$ot_id = encrypt_decrypt('decrypt', $ot_id);
$workflow_id = 0;
//check hr is in role hr
$is_hr = is_hr($hr_user_id);
if ($is_hr) {
//get ot request detail for get owner user id
$query = $this->ot->get_detail_by_id($ot_id);
if ($query->num_rows() > 0) {
$ot_detail = $query->row_array();
if (intval($ot_detail['wot_workflow_id']) > 3) {
echo swalc('ผิดพลาด!!!', 'คุณไม่สามารถทำรายการใบคำขอทำงานล่วงเวลานี้ได้เพราะคำขอนี้มีการอนุมัติ/ไม่อนุมัติไปแล้ว', 'error');
} else {
$owner_user_id = $ot_detail['wot_request_by'];
$owner_detail = getEmployeeDetailByUserID($owner_user_id);
$owner_headman_user_id = $owner_detail['EmpHeadman_UserID'];
$log_type = '';
$log_detail = '';
//set approve / disapprove
if ($type == 'approve') {
$workflow_id = 4;
$log_type = 'instant approve from email by hr';
$log_detail = 'HR ทำการอนุมัติใบคำขอทำงานล่วงเวลาทันทีผ่านอีเมล์';
} else {
if ($type == 'disapprove') {
$workflow_id = 5;
$log_type = 'instant disapprove from email by hr';
$log_detail = 'HR ไม่อนุมัติใบคำขอทำงานล่วงเวลาทันทีผ่านอีเมล์';
$send_to_headman = $this->send_email_ot_to_headman();
}
}
$data = array('wot_workflow_id' => $workflow_id);
$where = array('wot_id' => $ot_id);
//insert log
insert_log_ot($ot_id, $log_type, $log_detail, $hr_user_id);
//send email to owner request ot with log
$send = $this->send_email_result_ot_to_owner($ot_id);
if ($send == 'success') {
insert_log_ot($ot_id, 'send email result ot to owner', 'ส่งอีเมล์เพื่อแจ้งสถานะใบคำขอทำงานล่วงเวลาให้เจ้าของใบคำขอ', $hr_user_id);
} else {
insert_log_ot($ot_id, 'error send email result ot to owner', 'ไม่สามารถส่งอีเมล์เพื่อแจ้งสถานะใบคำขอทำงานล่วงเวลาให้เจ้าของใบคำขอได้', $hr_user_id);
}
//if disapprove send mail to headman
if ($type == 'disapprove') {
$send = $this->send_email_ot_to_headman('disapprove_by_hr', $ot_id);
if ($send == 'success') {
insert_log_ot($ot_id, 'send email disapprove ot to headman by hr', 'ส่งอีเมล์เพื่อแจ้งสถานะใบคำขอทำงานล่วงเวลาให้หัวหน้าเจ้าของคำขอ', $hr_user_id);
} else {
insert_log_ot($ot_id, 'error send email disapprove ot to headman by hr', 'ไม่สามารถส่งอีเมล์เพื่อแจ้งสถานะใบคำขอทำงานล่วงเวลาให้หัวหน้าเจ้าของใบคำขอได้ เพราะ ' . $send, $hr_user_id);
}
}
}
}
} else {
echo swalc('ผิดพลาด!!!', 'ไม่สามารถทำรายการได้', 'error');
}
}
开发者ID:KanexKane,项目名称:hrsystem,代码行数:59,代码来源:Overtime.php
示例17: array_pop
/*
* For each user, using respective(his) public & private keys fetch the ebay,amazon listings.
*/
$user = array_pop($user_list);
$user_id = $user['user_id'];
$DEVNAME = trim($user['dev_name']);
$APPNAME = trim($user['app_name']);
$CERTNAME = trim($user['cert_name']);
$token = encrypt_decrypt('decrypt', $user['token']);
$paypal_email = trim($user['paypal_address']);
$return_accept_option = trim($user['return_accept_option']);
$refund_option = trim($user['refund_option']);
$return_within_days = trim($user['return_days']);
$duration = trim($user['listing_duration']);
$public_key = encrypt_decrypt('decrypt', $user['amazon_publickey']);
$private_key = encrypt_decrypt('decrypt', $user['amazon_privatekey']);
$page = 1;
$is_error = false;
do {
$my_selling_pages = get_my_ebay_selling_ActiveList($page);
/* fetch ebay active list for the user first time, continue
if there are many pages DO WHILE
*/
$xml_page = new SimpleXMLElement($my_selling_pages);
//print_r($xml_page);
if (isset($xml_page->Errors->ErrorCode) and (str_replace('', '', $xml_page->Errors->ErrorCode) == '931' or str_replace('', '', $xml_page->Errors->ErrorCode) == '5')) {
$is_error = true;
break;
} elseif (isset($xml_page->Errors)) {
array_push($error, $xml_page->Errors);
}
开发者ID:eparst,项目名称:ebay-amazon-sync-tool,代码行数:31,代码来源:cron_job.php
示例18: envoyer_mail
public function envoyer_mail()
{
if (isset($_POST['reserver']) && !empty($_POST['r_nom'])) {
global $wpdb;
$r_nom = $_POST['r_nom'];
$r_prenom = $_POST['r_prenom'];
$r_email = $_POST['r_email'];
$r_telephone = $_POST['r_telephone'];
$r_nb_place = $_POST['r_nb_place'];
$id_voyage = $_POST['id_voyage'];
$r_id = $wpdb->get_var("SELECT id FROM {$wpdb->prefix}covoit_reservation WHERE r_email= '{$r_email}' AND r_nom = '{$r_nom}'");
$nom = $wpdb->get_var("SELECT nom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$id_voyage}'");
$prenom = $wpdb->get_var("SELECT prenom FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$id_voyage}'");
$email = $wpdb->get_var("SELECT email FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$id_voyage}'");
$telephone = $wpdb->get_var("SELECT telephone FROM {$wpdb->prefix}covoit_voyage WHERE id = '{$id_voyage}'");
$subject = 'Mariage de Pauline et Pierre-Henri - Reservation de places';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$message1 = '
<html>
<h3>Bonjour,</h3>
<p>' . $r_prenom . ' ' . $r_nom . ' souhaite réserver ' . $r_nb_place . ' place(s) dans votre voiture.</p>
<p>Vous pouvez valider sa réservation en cliquant ici :
<a href="' . site_url() . '/validation?r_statut=' . encrypt_decrypt('encrypt', '2') . '&r_id=' . encrypt_decrypt('encrypt', $r_id) . '&r_nb_place=' . encrypt_decrypt('encrypt', $r_nb_place) . '&id_voyage=' . encrypt_decrypt('encryp
|
请发表评论