コード例 #1
0
//VER 0.05-SD:25/02/2015 ED:25/02/2015, TRACKER NO:74,DESC:updated display name
//DONE BY:RAJA
//VER 0.04-SD:09/01/2015 ED:09/01/2015, TRACKER NO:175,DESC:CHANGED LOGIN ID AS EMPLOYEE NAME
//DONE BY:SAFIYULLAH
//VER 0.03,SD:06/11/2014 ED:06/11/2014,tracker:74,DESC:checked onduty date also to send remainder
//VER 0.02,SD:24/10/2014 ED:24/10/2014,TRACKER NO:82,DESC:update subject and body to get from email template
//VER 0.01-INITIAL VERSION, SD:16/09/2014 ED:08/10/2014,TRACKER NO:82
//*********************************************************************************************************//-->
<?php 
require_once 'google/appengine/api/mail/Message.php';
use google\appengine\api\mail\Message;
include "../TSLIB/TSLIB_COMMON_FUNCTIONS.php";
include "../TSLIB/TSLIB_CONNECTION.php";
date_default_timezone_set('Asia/Kolkata');
$get_active_user = array();
$get_active_user = get_active_login_id();
//GET ALL ACTIVE LOGIN ID
$currentdate = date("Y-m-d");
//CURRENT DATE
$Current_day = date('l');
//CURRENT DAY
$check_ph = Check_public_holiday($currentdate);
//CHECK CURRENT DATE IS IN PUBLIC HOLIDAY
$check_onduty = check_onduty($currentdate);
//CHECK CURRENT DATE IS IN ONDUTY
$get_login_id = array();
$get_login_id = get_login_id($currentdate);
//GET WHO ARE ALL ENTERED REPORT FOR CURRENT DATE
$ph_array = get_public_holiday();
// GET ALL PUBLIC HOLIDAY
$onduty_array = get_onduty();
                $select_intro_template="SELECT * FROM EMAIL_TEMPLATE_DETAILS WHERE ET_ID=11";
                $select_introtemplate_rs=mysqli_query($con,$select_intro_template);
                if($row=mysqli_fetch_array($select_introtemplate_rs)){
                    $intro_mail_subject=$row["ETD_EMAIL_SUBJECT"];
                    $intro_body=$row["ETD_EMAIL_BODY"];
                }
                $intro_email_body;
                $intro_body_msg =explode("^", $intro_body);
                $intro_length=count($intro_body_msg);
                for($i=0;$i<$intro_length;$i++){
                    $intro_email_body.=$intro_body_msg[$i].'<br><br>';
                }
                $replace= array("[DATE]", "[employee name]","[emailid]","[designation]");
                $str_replaced  = array(date("d-m-Y"),'<b>'.$URSRC_firstname.'</b>', $loginid,'<b>'.$URSRC_designation.'</b>');
                $intro_message = str_replace($replace, $str_replaced, $intro_email_body);
                $cc_array=get_active_login_id();

                $intro_mail_options = [
                    "sender" =>$admin,
                    "to" => $cc_array,
                    "subject" => $intro_mail_subject,
                    "htmlBody" => $intro_message
                ];
                try {
                    $message1 = new Message($intro_mail_options);
                    $message1->send();
                } catch (\InvalidArgumentException $e) {
                    echo $e;
                }

            }
コード例 #3
0
<!--//*******************************************FILE DESCRIPTION*********************************************//
//*********************************REMAINDER MAIL TRIGGER *************************************//
//DONE BY:RAJA
//VER 0.03-SD:09/01/2015 ED:09/01/2015, TRACKER NO:175,DESC:CHANGED LOGIN ID AS EMPLOYEE NAME
//DONE BY:SAFIYULLAH
//VER 0.02,SD:24/10/2014 ED:24/10/2014,TRACKER NO:82,DESC:update subject and body to get from email template
//VER 0.01-INITIAL VERSION, SD:16/09/2014 ED:08/10/2014,TRACKER NO:82
//*********************************************************************************************************//-->
<?php
require_once 'google/appengine/api/mail/Message.php';
use google\appengine\api\mail\Message;
include "COMMON_FUNCTIONS.php";
include "CONNECTION.php";
date_default_timezone_set('Asia/Kolkata');
$get_active_user=array();
$get_active_user=get_active_login_id();//GET ALL ACTIVE LOGIN ID
$currentdate=date("Y-m-d");//CURRENT DATE
$Current_day=date('l');//CURRENT DAY
$check_ph=Check_public_holiday($currentdate);//CHECK CURRENT DATE IS IN PUBLIC HOLIDAY
$check_onduty=check_onduty($currentdate);//CHECK CURRENT DATE IS IN ONDUTY
$get_login_id=array();
$get_login_id=get_login_id($currentdate);//GET WHO ARE ALL ENTERED REPORT FOR CURRENT DATE
$ph_array=get_public_holiday();// GET ALL PUBLIC HOLIDAY
$select_admin="SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='ADMIN'";
$select_sadmin="SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='SUPER ADMIN'";
$admin_rs=mysqli_query($con,$select_admin);
$sadmin_rs=mysqli_query($con,$select_sadmin);
if($row=mysqli_fetch_array($admin_rs)){
    $admin=$row["ULD_LOGINID"];//get admin
}
if($row=mysqli_fetch_array($sadmin_rs)){
require_once 'google/appengine/api/mail/Message.php';
use google\appengine\api\mail\Message;
error_reporting(0);
if(isset($_REQUEST)){
    include "CONNECTION.php";
    include "COMMON.php";
    include "GET_USERSTAMP.php";
    $USERSTAMP=$UserStamp;
    global $con;
    // FETCHING ERROR MESSAGE FROM SQL TABLE
    if($_REQUEST['option']=="INITIAL_DATAS"){
        // GET ERR MSG
        $CPVD_errmsg=get_error_msg('3,7,15');
//        $CPVD_final_values=array($CPVD_errmsg);
        $CPVD_act_employee=get_active_login_id();
        $final_array=array($CPVD_errmsg,$CPVD_act_employee);
        echo JSON_ENCODE($final_array);
    }
    //FETCHING COMPANY PROPERTIES DETAILS
    if($_REQUEST['option']=="COMPANY_PROPERTY")
    {
        $CPVD_loginid=$_REQUEST['CPVD_lb_loginid'];
        $CPVD_cmpny_prop=mysqli_query($con,"select CPD.CPD_LAPTOP_NUMBER,CPD.CPD_CHARGER_NUMBER from EMPLOYEE_DETAILS ED JOIN COMPANY_PROPERTIES_DETAILS CPD on CPD.EMP_ID = ED.EMP_ID JOIN USER_LOGIN_DETAILS ULD ON ULD.ULD_ID = ED.ULD_ID where ULD.ULD_LOGINID ='$CPVD_loginid'");
        while($row=mysqli_fetch_array($CPVD_cmpny_prop)){
            $CPVD_lap_no=$row["CPD_LAPTOP_NUMBER"];
            $CPVD_charger_no=$row["CPD_CHARGER_NUMBER"];
        }
        $CPVD_cmpny_values=array('CPVD_lap_no'=>$CPVD_lap_no,'CPVD_charger_no'=>$CPVD_charger_no);
        $values_array[]=$CPVD_cmpny_values;
        echo JSON_ENCODE($values_array);