コード例 #1
1
 function kirim_undangan($id)
 {
     if (!$this->ion_auth->logged_in()) {
         redirect('auth/login', 'refresh');
     }
     $is_update = getValue('is_invited', 'users_resignment', array('id' => 'where/' . $id));
     $undangan = array('is_invited' => 1, 'date_invitation' => date('Y-m-d', strtotime($this->input->post('date_invited'))), 'time_invitation' => $this->input->post('time_invited'), 'note_invitation' => $this->input->post('note_invited'));
     $this->db->where('id', $id)->update('users_resignment', $undangan);
     $sess_id = $this->session->userdata('user_id');
     $user_id = getValue('user_id', 'users_resignment', array('id' => 'where/' . $id));
     $url = base_url() . 'form_resignment/detail/' . $id;
     $isi_email = $is_update == 0 ? get_name($sess_id) . " mengundang anda untuk melakukan wawancara pengajuan resign yang telah anda ajukan, untuk melihat detail silakan <a class='klikmail' href={$url}>Klik Disini</a><br />" : get_name($sess_id) . " melakukan perubahan jadwal wawancara pengajuan resign yang telah anda ajukan, untuk melihat detail silakan <a class='klikmail' href={$url}>Klik Disini</a><br />";
     $subject = $is_update == 0 ? '' : 'Perubahan Jadwal ';
     $data = array('sender_id' => get_nik($sess_id), 'receiver_id' => get_nik($user_id), 'sent_on' => date('Y-m-d-H-i-s', strtotime('now')), 'subject' => $subject . 'Undangan Wawancara Resignment', 'email_body' => $isi_email . $this->detail_email($id), 'is_read' => 0);
     $this->db->insert('email', $data);
     if (!empty(getEmail(get_nik($user_id)))) {
         $this->send_email(getEmail($user_id), 'Undangan Wawancara Resignment', $isi_email);
     }
 }
コード例 #2
1
<?php

function getEmail($name)
{
    $sqlite = new PDO("sqlite:/usr/local/users.db");
    $rows = $db->query("SELECT email FROM users WHERE name LIKE '{$name}'");
    $row = $rows->fetch();
    $email = $row['email'];
    return $email;
}
$email = getEmail('Rasmus Lerdorf');
コード例 #3
1
 function do_approve($id, $type)
 {
     if (!$this->ion_auth->logged_in()) {
         redirect('auth/login', 'refresh');
     } else {
         $user_id = get_nik($this->session->userdata('user_id'));
         $date_now = date('Y-m-d');
         $data = array('is_app_' . $type => 1, 'approval_status_id_' . $type => $this->input->post('app_status_' . $type), 'user_app_' . $type => $user_id, 'date_app_' . $type => $date_now, 'note_' . $type => $this->input->post('note_' . $type));
         $approval_status = $this->input->post('app_status_' . $type);
         $this->recruitment_model->update($id, $data);
         $approval_status_mail = getValue('title', 'approval_status', array('id' => 'where/' . $approval_status));
         $user_recruitment_id = getValue('user_id', 'users_recruitment', array('id' => 'where/' . $id));
         $isi_email = 'Status pengajuan recruitment anda ' . $approval_status_mail . ' oleh ' . get_name($user_id) . ' untuk detail silakan <a href=' . base_url() . 'form_recruitment/detail/' . $id . '>Klik Disini</a><br />';
         $isi_email_request = get_name($user_recruitment_id) . ' mengajukan Permohonan recruitment, untuk melihat detail silakan <a href=' . base_url() . 'form_recruitment/detail/' . $id . '>Klik Disini</a><br />';
         if ($is_app == 0) {
             $this->approval->approve('recruitment', $id, $approval_status, $this->detail_email($id));
             if (!empty(getEmail($user_recruitment_id))) {
                 $this->send_email(getEmail($user_recruitment_id), 'Status Pengajuan Permohonan Recruitment dari Atasan', $isi_email);
             }
         } else {
             $this->approval->update_approve('recruitment', $id, $approval_status, $this->detail_email($id));
             if (!empty(getEmail($user_recruitment_id))) {
                 $this->send_email(getEmail($user_recruitment_id), 'Perubahan Status Pengajuan Permohonan Recruitment dari Atasan', $isi_email);
             }
         }
         if ($type !== 'hrd' && $approval_status == 1) {
             $lv = substr($type, -1) + 1;
             $lv_app = 'lv' . $lv;
             $user_app = $lv < 4 ? getValue('user_app_' . $lv_app, 'users_recruitment', array('id' => 'where/' . $id)) : 0;
             if (!empty($user_app)) {
                 if (!empty(getEmail($user_app))) {
                     $this->send_email(getEmail($user_app), 'Pengajuan Permohonan Recruitment', $isi_email_request);
                 }
                 $this->approval->request($lv_app, 'recruitment', $id, $user_recruitment_id, $this->detail_email($id));
             } else {
                 if (!empty(getEmail($this->approval->approver('recruitment')))) {
                     $this->send_email(getEmail($this->approval->approver('recruitment')), 'Pengajuan Permohonan Recruitment', $isi_email_request);
                 }
                 $this->approval->request('hrd', 'recruitment', $id, $user_recruitment_id, $this->detail_email($id));
             }
         } else {
             $email_body = "Status pengajuan permohonan recruitment yang diajukan oleh " . get_name($user_recruitment_id) . ' ' . $approval_status_mail . ' oleh ' . get_name($user_id) . ' untuk detail silakan <a href=' . base_url() . 'form_recruitment/detail/' . $id . '>Klik Disini</a><br />';
             switch ($type) {
                 case 'lv1':
                     //$this->approval->not_approve('recruitment', $id, )
                     break;
                 case 'lv2':
                     $receiver_id = getValue('user_app_lv1', 'users_recruitment', array('id' => 'where/' . $id));
                     $this->approval->not_approve('recruitment', $id, $receiver_id, $approval_status, $this->detail_email($id));
                     if (!empty(getEmail($receiver_id))) {
                         $this->send_email(getEmail($receiver_id), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                     }
                     break;
                 case 'lv3':
                     $receiver_lv2 = getValue('user_app_lv2', 'users_recruitment', array('id' => 'where/' . $id));
                     $this->approval->not_approve('recruitment', $id, $receiver_lv2, $approval_status, $this->detail_email($id));
                     if (!empty(getEmail($receiver_lv2))) {
                         $this->send_email(getEmail($receiver_lv2), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                     }
                     $receiver_lv1 = getValue('user_app_lv1', 'users_recruitment', array('id' => 'where/' . $id));
                     $this->approval->not_approve('recruitment', $id, $receiver_lv1, $approval_status, $this->detail_email($id));
                     if (!empty(getEmail($receiver_lv1))) {
                         $this->send_email(getEmail($receiver_lv1), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                     }
                     break;
                 case 'hrd':
                     $receiver_lv3 = getValue('user_app_lv3', 'users_recruitment', array('id' => 'where/' . $id));
                     if (!empty($receiver_lv3)) {
                         $this->approval->not_approve('recruitment', $id, $receiver_lv3, $approval_status, $this->detail_email($id));
                         if (!empty(getEmail($receiver_lv3))) {
                             $this->send_email(getEmail($receiver_lv3), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                         }
                     }
                     $receiver_lv2 = getValue('user_app_lv2', 'users_recruitment', array('id' => 'where/' . $id));
                     if (!empty($receiver_lv2)) {
                         $this->approval->not_approve('recruitment', $id, $receiver_lv2, $approval_status, $this->detail_email($id));
                         if (!empty(getEmail($receiver_lv2))) {
                             $this->send_email(getEmail($receiver_lv2), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                         }
                     }
                     $receiver_lv1 = getValue('user_app_lv1', 'users_recruitment', array('id' => 'where/' . $id));
                     if (!empty($receiver_lv1)) {
                         $this->approval->not_approve('recruitment', $id, $receiver_lv1, $approval_status, $this->detail_email($id));
                         if (!empty(getEmail($receiver_lv1))) {
                             $this->send_email(getEmail($receiver_lv1), 'Status Pengajuan Permohonan recruitment Dari Atasan', $email_body);
                         }
                     }
                     break;
             }
         }
         redirect('form_recruitment/approval/' . $id, 'refresh');
     }
 }
コード例 #4
1
 public function add()
 {
     $this->form_validation->set_rules('destination', 'Tujuan', 'trim|required');
     $this->form_validation->set_rules('title', 'Tanggal Terakhir Cuti', 'trim|required');
     $this->form_validation->set_rules('date_spd_start', 'Tanggal Berangkat', 'trim|required');
     $this->form_validation->set_rules('date_spd_end', 'Tanggal Berangkat', 'trim|required');
     $this->form_validation->set_rules('city_to', 'Kota Tujuan', 'trim|required');
     $this->form_validation->set_rules('city_from', 'Kota Asal', 'trim|required');
     $this->form_validation->set_rules('vehicle', 'Kendaraan', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         //echo json_encode(array('st'=>0, 'errors'=>validation_errors('<div class="alert alert-danger" role="alert">', '</div>')));
         redirect('form_spd_luar_group/input', 'refresh');
     } else {
         $sess_id = $this->session->userdata('user_id');
         $sess_nik = get_nik($sess_id);
         $task_receiver = implode(',', $this->input->post('peserta'));
         $additional_data = array('task_creator' => $this->input->post('emp_tc'), 'title' => $this->input->post('title'), 'destination' => $this->input->post('destination'), 'date_spd_start' => date('Y-m-d', strtotime($this->input->post('date_spd_start'))), 'date_spd_end' => date('Y-m-d', strtotime($this->input->post('date_spd_end'))), 'from_city_id' => $this->input->post('city_from'), 'to_city_id' => $this->input->post('city_to'), 'transportation_id' => $this->input->post('vehicle'), 'user_app_lv1' => $this->input->post('atasan1'), 'user_app_lv2' => $this->input->post('atasan2'), 'user_app_lv3' => $this->input->post('atasan3'), 'created_on' => date('Y-m-d', strtotime('now')), 'created_by' => $sess_id);
         $task_creator = $this->input->post('emp_tc');
         $created_by = $sess_nik;
         $biaya_tambahan_id = $this->input->post('biaya_tambahan_id');
         $biaya_tambahan = $this->input->post('jumlah_biaya_tambahan');
         if ($this->form_validation->run() == true && $this->form_spd_luar_group_model->create_($task_receiver, $additional_data)) {
             $spd_id = $this->db->insert_id();
             $tr = $this->input->post('peserta');
             if (!empty($biaya_tambahan_id)) {
                 for ($i = 0; $i < sizeof($tr); $i++) {
                     for ($j = 0; $j < sizeof($biaya_tambahan_id); $j++) {
                         $data = array('user_spd_luar_group_id' => $spd_id, 'user_id' => $tr[$i], 'pjd_biaya_id' => $biaya_tambahan_id[$j], 'jumlah_biaya' => str_replace(',', '', $biaya_tambahan[$j]), 'created_on' => date('Y-m-d', strtotime('now')), 'created_by' => $sess_id);
                         $this->db->insert('users_spd_luar_group_biaya', $data);
                     }
                 }
             }
             $task_receiver_id = explode(',', $task_receiver);
             $this->send_spd_mail($spd_id, $task_creator, $task_receiver_id);
             $user_app_lv1 = getValue('user_app_lv1', 'users_spd_luar_group', array('id' => 'where/' . $spd_id));
             $isi_email = get_name($task_creator) . ' mengajukan Perjalanan Dinas Luar Kota, untuk melihat detail silakan <a href=' . base_url() . 'form_spd_luar_group/submit/' . $spd_id . '>Klik Disini</a><br />';
             if ($task_creator !== $created_by) {
                 $this->approval->by_admin('spd_luar_group', $spd_id, $created_by, $task_creator, $this->detail_email_submit($spd_id));
             }
             if (!empty($user_app_lv1)) {
                 if (!empty(getEmail($user_app_lv1))) {
                     $this->send_email(getEmail($user_app_lv1), 'Pengajuan Perjalanan Dinas Luar Kota (Group)', $isi_email);
                 }
                 $this->approval->request('lv1', 'spd_luar_group', $spd_id, $task_creator, $this->detail_email_submit($spd_id));
             } else {
                 if (!empty(getEmail($this->approval->approver('dinas')))) {
                     $this->send_email(getEmail($this->approval->approver('dinas')), 'Pengajuan Perjalanan Dinas Luar Kota (Group)', $isi_email);
                 }
                 $this->approval->request('hrd', 'spd_luar_group', $spd_id, $task_creator, $this->detail_email_submit($spd_id));
             }
             //echo json_encode(array('st' =>1));
             redirect('form_spd_luar_group/input_biaya/' . $spd_id, 'refresh');
         }
     }
 }
コード例 #5
0
ファイル: modify.php プロジェクト: pauljenny/NoCMS
function traiter()
{
    global $db_realmd;
    $id = $_SESSION['id'];
    if (empty($_POST['email'])) {
        die("Vous n'avez pas rentré d'adresse email !");
    }
    $email = $_POST['email'];
    if (!empty($_POST['mdp'])) {
        $mdp = $_POST['mdp'];
        $query = $db_realmd->query("SELECT `username` FROM `account` WHERE `id` = '" . $id . "' LIMIT 1");
        $fetch = $query->fetch(PDO::FETCH_NUM);
        $sha_pass = sha1(strtoupper($fetch[0]) . ':' . strtoupper($mdp));
        try {
            global $prepare_query_mdp;
            $prepare_query_mdp->execute(array($sha_pass, $id));
        } catch (Exception $e) {
            die("Erreur lors de la requête du mot de passe <br/>Erreur à communiquer : " . $e->getMessage());
        }
    }
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        die("<div align=\"center\"><font color=\"red\">L'adresse email rentré n'a pas le bon format !</font></div>");
    }
    if ($email != getEmail()) {
        global $prepare_query_email;
        $prepare_query_email->execute(array($email, $id));
    }
    return true;
}
コード例 #6
0
ファイル: getContact.php プロジェクト: ekutor/hermes
function getContact($idContact)
{
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    $sql = "SELECT * FROM contacts a LEFT JOIN contacts_cstm ac ON a.id = ac.id_c WHERE id = '{$idContact}'";
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $obj->email_address = getEmail($idContact);
        $obj->idAccount = getAccountId($idContact);
        $obj->nameAccount = getAccountName($obj->idAccount);
        $obj->reports_to_name = getContactName($obj->reports_to_id);
        $obj->created_by_name = getUserName($obj->created_by);
        $obj->modified_user_name = getUserName($obj->modified_user_id);
        $obj->assigned_user_name = getUserName($obj->user_id_c);
        $obj->nameCampaign = getCampaignName($obj->campaign_id);
        $a = (array) $obj;
        $rows[] = $a;
    }
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
コード例 #7
0
ファイル: user_logic.php プロジェクト: jagumiel/bigou-Album
function login($ip, $nick, $password)
{
    /*$intentos = 0;
    		if (isset($_COOKIE['intentos'])){ 
    			$intentos = $_COOKIE['intentos'];
    		}
    				
    		if ($intentos <= 3){*/
    $hashedPassword = hash("sha256", $password, false);
    if (checkNickPassword($nick, $hashedPassword)) {
        $email = getEmail($nick);
        $_SESSION['nick'] = $nick;
        $_SESSION['email'] = $email;
        $_SESSION['role'] = getRole($email);
        //setcookie( 'intentos', 0, time() + 1800 ); //30 minutos
        addAction($nick, $email, $ip, 'logged_in');
        addConnection($nick, $email, $ip);
        return '0';
        // Logged.
    } else {
        //if ($intentos < 3) {
        //setcookie( 'intentos', $intentos + 1, time() + 1800 ); //30 minutos
        return '1';
        // Log in failed.
    }
    /*} 
    		
    		setcookie( 'intentos', 0, time() + 1800);
    		return '2';	// Superado el límite de intentos.
    		*/
}
コード例 #8
0
ファイル: fzc.class.php プロジェクト: v998/dsu
 function register_header()
 {
     global $_G;
     $inputemail = 'gp_' . $this->regemail['email'];
     $_G['gp_email'] = $_G[$inputemail];
     if ($_POST) {
         $_G['gp_activationauth'] = strip_tags(str_replace(" ", "+", $_G['gp_activationauth']));
         $activationinfo = authcode($_G['gp_activationauth'], $operation = 'DECODE');
         $activationinfoname = preg_replace("/\\s.+/i", "", $activationinfo);
         if ($activationinfoname) {
             loaducenter();
             if ($data = uc_get_user($activationinfoname)) {
                 list($uid, $username, $email) = $data;
             }
             $_G['gp_email'] = getEmail(strip_tags($email));
         } else {
             $_G['gp_email'] = getEmail(strip_tags($_G['gp_email']));
         }
         $_G['gp_rid'] = strip_tags($_G['gp_rid']);
         if (!$_G['gp_rid']) {
             showmessage('dsu_amufzc:1', '');
         }
         if (!$_G['gp_email']) {
             showmessage('dsu_amufzc:5', '');
         }
         $amutb = DB::table("plugin_dsuamfzc");
         $query = DB::fetch_first("SELECT * FROM {$amutb} WHERE rid = '" . $_G['gp_rid'] . "'");
         if (!$query || $query['yes'] == '1') {
             showmessage('dsu_amufzc:2', '');
         }
         if ($_G['gp_email'] != $query['email']) {
             showmessage('dsu_amufzc:11', '');
         }
     }
 }
コード例 #9
0
ファイル: authorize.php プロジェクト: Nnamso/tbox
 function action($data = array(), $post = array(), $id)
 {
     $ci =& get_instance();
     $ci->load->library('session');
     if (isset($this->ini['sandbox']) && isset($this->ini['api_login_id']) && isset($this->ini['transaction_key']) && isset($post['card_num']) && isset($post['exp_date'])) {
         require dirname(__FILE__) . '/lib/shared/AuthorizeNetRequest.php';
         require dirname(__FILE__) . '/lib/shared/AuthorizeNetTypes.php';
         require dirname(__FILE__) . '/lib/shared/AuthorizeNetXMLResponse.php';
         require dirname(__FILE__) . '/lib/shared/AuthorizeNetResponse.php';
         require dirname(__FILE__) . '/lib/AuthorizeNetAIM.php';
         define("AUTHORIZENET_API_LOGIN_ID", $this->ini['api_login_id']);
         define("AUTHORIZENET_TRANSACTION_KEY", $this->ini['transaction_key']);
         define("AUTHORIZENET_SANDBOX", $this->ini['sandbox']);
         $sale = new AuthorizeNetAIM();
         $sale->amount = number_format($data['amount'], 2);
         $sale->card_num = $post['card_num'];
         $sale->exp_date = $post['exp_date'];
         $response = $sale->authorizeAndCapture();
         if ($response->approved) {
             $ci =& get_instance();
             $ci->load->model('order_m');
             $order = $ci->order_m->getOrderNumber($data['item_number']);
             if (count($order) > 0) {
                 $update['status'] = 'completed';
                 $updatehis['order_id'] = $order->id;
                 $updatehis['label'] = 'order_status';
                 $updatehis['content'] = json_encode(array($order->order_number => 'completed'));
                 $updatehis['date'] = date('Y-m-d H:i:s');
                 $ci->order_m->_table_name = 'orders';
                 if ($ci->order_m->save($update, $order->id)) {
                     $ci->order_m->_table_name = 'orders_histories';
                     $ci->order_m->save($updatehis);
                     $ci->load->helper('cms');
                     $user = $ci->session->userdata('user');
                     //params shortcode email.
                     $params = array('username' => $user['username'], 'email' => $user['email'], 'date' => date('Y-m-d H:i:s'), 'shop' => getSiteName(config_item('site_name')), 'shop_url' => site_url(), 'total' => number_format($data['amount'], 2), 'order_number' => $data['item_number'], 'status' => 'completed');
                     //config email.
                     $config = array('mailtype' => 'html');
                     $subject = configEmail('sub_order_status', $params);
                     $message = configEmail('order_status', $params);
                     $ci->load->library('email', $config);
                     $ci->email->from(getEmail(config_item('admin_email')), getSiteName(config_item('site_name')));
                     $ci->email->to($user['email']);
                     $ci->email->subject($subject);
                     $ci->email->message($message);
                     $ci->email->send();
                 }
             }
             $ci->session->set_flashdata('msg', 'Thanks you for payment!');
             if (isset($this->ini['message'])) {
                 $ci->session->set_flashdata('message', $this->ini['message']);
             }
         } else {
             $ci->session->set_flashdata('error', 'Your payment not success!');
         }
     }
     redirect(site_url('payment/confirm'));
 }
コード例 #10
0
function createVCard($array)
{
    $return = 'BEGIN:VCARD' . PHP_EOL;
    $return .= 'VERSION:2.1' . PHP_EOL;
    $return .= getName($array) . PHP_EOL;
    $return .= getFormatedName($array) . PHP_EOL;
    $return .= getPhoto($array);
    $return .= getTelephonePrivate($array);
    $return .= getMobilePrivate($array);
    //$return .= 'TEL;WORK;VOICE:(0221) 9999123' . PHP_EOL;
    //$return .= 'TEL;HOME;VOICE:(0221) 1234567' . PHP_EOL;
    $return .= getAddress($array);
    $return .= getEmail($array);
    $return .= date('Y-m-d H:i:s') . PHP_EOL;
    $return .= 'END:VCARD' . PHP_EOL;
    return $return;
}
コード例 #11
0
ファイル: wo.php プロジェクト: abdulghanni/gsm
 function send_notification($id)
 {
     permissionUser();
     $url = base_url() . $this->file_name . '/detail/' . $id;
     $subject = 'Pengajuan Work Order';
     $isi = getName(sessId()) . " membuat Work Order, Untuk melihat detail silakan <a href={$url}> KLIK DISINI </a>.";
     $no = getValue('no', $this->table_name, array('id' => 'where/' . $id));
     //SEND NOTIFICATION TO PRODUCTION
     $group_id = array('8');
     $user_id = $this->db->select('user_id')->where_in('group_id', $group_id)->get('users_groups')->result();
     foreach ($user_id as $u) {
         $data = array('sender_id' => sessId(), 'receiver_id' => $u->user_id, 'sent_on' => dateNow(), 'judul' => $subject, 'isi' => $isi, 'no' => $no, 'url' => $url);
         $this->db->insert('notifikasi', $data);
         $this->send_email(getEmail($u->user_id), $subject, $isi);
     }
     return TRUE;
 }
コード例 #12
0
 public function indexAction($maquina, $usuario)
 {
     $destinatario = $usuario . getEmail();
     $message = \Swift_Message::newInstance()->setSubject('Soporte Tecnico Agrotecnica N° 4')->setFrom('*****@*****.**')->setTo($destinatario)->setBody($this->renderView('Emails/maquinaMail.html.twig', array('maquina' => $maquina), array('usuario' => $usuario)), 'text/html');
     $this->get('mailer')->send($message);
     /*
     if ($mailer->send($message))
     {
         echo "Mensaje enviado correctamente";
     }
     else
     {
         echo "Mensaje fallido";
     }
     }
     */
     //return $this->render(...);
 }
コード例 #13
0
ファイル: getLeads.php プロジェクト: ekutor/hermes
function getAdditionalInfoFromBD($sql)
{
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $obj->email_address = getEmail($obj->id);
        $obj->campaign_name = getCampaignName($obj->campaign_id);
        $a = (array) $obj;
        $rows[] = $a;
    }
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
コード例 #14
0
 public function store(Request $request)
 {
     $request = $request->input('email');
     dd($request->getEmail());
     //$dados = $request->all();
     $dados = ['tb_nome' => $request->input('nome'), 'tb_email' => $request->input('email'), 'tb_data_nascimento' => $request->input('dataNasc'), 'tb_rg' => $request->input('rg'), 'tb_cpf' => $request->input('cpf'), 'tb_pais' => $request->input('pais'), 'tb_estado' => $request->input('estado'), 'tb_cidade' => $request->input('cidade'), 'tb_bairro' => $request->input('bairro'), 'tb_endereco' => $request->input('logradouro')];
     $cadastrar = new \App\Models\ClienteModel();
     $cadastrar->create($dados);
     if ($cadastrar) {
         $mail = ['nome' => $request->input('nome'), 'email' => $request->input('email'), 'data_nascimento' => $request->input('dataNasc'), 'rg' => $request->input('rg'), 'cpf' => $request->input('cpf'), 'pais' => $request->input('pais'), 'estado' => $request->input('estado'), 'cidade' => $request->input('cidade'), 'bairro' => $request->input('bairro'), 'endereco' => $request->input('logradouro')];
         // dd($request->input('email'));
         Mail::send('emails.contact', $mail, function ($msg) {
             $email = $request->input('email');
             $msg->{$email};
             $msg->subject('Email de cadastro');
             $msg->to(getEmail($request->input('email')));
         });
         Session::flash('message', 'Mensagem de criação de cadastro MedCenter');
         return redirect('clientes')->with(['mensagem' => 'Cadastrado com sucesso!']);
     } else {
         return redirect('/');
     }
 }
コード例 #15
0
ファイル: getCliente.php プロジェクト: ekutor/hermes
function getCliente($idCliente)
{
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    $sql = "SELECT * FROM leads a LEFT JOIN leads_cstm ac ON a.id = ac.id_c WHERE id = '{$idCliente}'";
    //$sql = "SELECT id,first_name,last_name FROM leads";
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $obj->email_address = getEmail($idCliente);
        $obj->campaign_name = getCampaignName($obj->campaign_id);
        $obj->assigned_user_name = getUserName($obj->assigned_user_id);
        $a = (array) $obj;
        $rows[] = $a;
    }
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
コード例 #16
0
 public function add()
 {
     $this->form_validation->set_rules('destination', 'Tujuan', 'trim|required');
     $this->form_validation->set_rules('title', 'Tanggal Terakhir spd_dalam', 'trim|required');
     $this->form_validation->set_rules('date_spd', 'Tanggal Berangkat', 'trim|required');
     $this->form_validation->set_rules('spd_start_time', 'Waktu Berangkat', 'trim|required');
     $this->form_validation->set_rules('spd_end_time', 'Waktu Selesai', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         //echo json_encode(array('st'=>0, 'errors'=>validation_errors('<div class="alert alert-danger" role="alert">', '</div>')));
         redirect('form_spd_dalam_group/input', 'refresh');
     } else {
         $sess_id = $this->session->userdata('user_id');
         $sess_nik = get_nik($sess_id);
         $task_receiver = implode(',', $this->input->post('peserta'));
         $start_spd_dalam = $this->input->post('start_spd_dalam');
         $end_spd_dalam = $this->input->post('end_spd_dalam');
         $additional_data = array('task_creator' => $this->input->post('emp_tc'), 'title' => $this->input->post('title'), 'destination' => $this->input->post('destination'), 'date_spd' => date('Y-m-d', strtotime($this->input->post('date_spd'))), 'start_time' => $this->input->post('spd_start_time'), 'end_time' => $this->input->post('spd_end_time'), 'user_app_lv1' => $this->input->post('atasan1'), 'user_app_lv2' => $this->input->post('atasan2'), 'user_app_lv3' => $this->input->post('atasan3'), 'created_on' => date('Y-m-d', strtotime('now')), 'created_by' => $sess_id);
         $task_creator = $this->input->post('emp_tc');
         $created_by = $sess_nik;
         if ($this->form_validation->run() == true && $this->form_spd_dalam_group_model->create_($task_receiver, $additional_data)) {
             $spd_id = $this->db->insert_id();
             $user_app_lv1 = getValue('user_app_lv1', 'users_spd_dalam_group', array('id' => 'where/' . $spd_id));
             $isi_email = get_name($task_creator) . ' mengajukan Perjalanan Dinas Dalam Kota (Group), untuk melihat detail silakan <a href=' . base_url() . 'form_spd_dalam_group/submit/' . $spd_id . '>Klik Disini</a><br />';
             if ($task_creator !== $created_by) {
                 $this->approval->by_admin('spd_dalam_group', $spd_id, $created_by, $task_creator, $this->detail_email_submit($spd_id));
             }
             if (!empty($user_app_lv1)) {
                 if (!empty(getEmail($user_app_lv1))) {
                     $this->send_email(getEmail($user_app_lv1), 'Pengajuan Perjalanan Dinas Dalam Kota (Group)', $isi_email);
                 }
                 $this->approval->request('lv1', 'spd_dalam_group', $spd_id, $task_creator, $this->detail_email_submit($spd_id));
             } else {
                 if (!empty(getEmail($this->approval->approver('dinas')))) {
                     $this->send_email(getEmail($this->approval->approver('dinas')), 'Pengajuan Perjalanan Dinas Dalam Kota (Group)', $isi_email);
                 }
                 $this->approval->request('hrd', 'spd_dalam_group', $spd_id, $task_creator, $this->detail_email_submit($spd_id));
             }
             $task_receiver_id = explode(',', $task_receiver);
             $this->send_spd_mail($spd_id, $task_creator, $task_receiver_id);
             redirect('form_spd_dalam_group', 'refresh');
             //echo json_encode(array('st' =>1));
         }
     }
 }
コード例 #17
0
ファイル: login.php プロジェクト: wedesign-pf/Tit
<?php

$racine_smarty = "../";
include_once "../init.php";
include_once "config_admin.php";
include_once DOS_INC_ADMIN . "class.form.php";
include_once DOS_INC_ADMIN . "class.field.php";
$webmaster = getEmail("webmaster");
$smarty->assign("email_webmaster", $webmaster[0]);
$smarty->assign("nom_webmaster", $webmaster[1]);
// initialisation de la langue
include_once DOS_INC_ADMIN . "loadLang.php";
if (!isset($_SESSION["tentatives"])) {
    $_SESSION["tentatives"] = 0;
}
if ($thisSite->SERVER == "local") {
    $_SESSION["tentatives"] = 0;
}
$myAdmin->DATAS_LOGIN = "";
$myAdmin->LOGIN = "";
$myAdmin->MOTDEPASSE = "";
// traitement du formulaire
if (isset($__POST['identifiant'])) {
    //if(verifier_token('sky-form', $thisSite->RACINE . $thisSite->DOS_ADMIN . "login.php")==FALSE) { exit; }
    $mySelect = new mySelect(__FILE__);
    $mySelect->tables = $thisSite->PREFIXE_TBL_ADM . "administrateurs";
    $mySelect->fields = "*";
    $mySelect->where = "login=:login AND mdp=:mdp AND actif=1";
    $mySelect->whereValue["login"] = array($__POST['identifiant'], PDO::PARAM_STR);
    $mySelect->whereValue["mdp"] = array(md5($__POST['password']), PDO::PARAM_STR);
    $result = $mySelect->query();
コード例 #18
0
ファイル: form_absen.php プロジェクト: ocpyosep78/hris_client
 function do_approve($id, $type)
 {
     if (!$this->ion_auth->logged_in()) {
         redirect('auth/login', 'refresh');
     }
     $user_id = get_nik($this->session->userdata('user_id'));
     $date_now = date('Y-m-d');
     $data = array('is_app_' . $type => 1, 'user_app_' . $type => $user_id, 'date_app_' . $type => $date_now);
     $this->form_absen_model->update($id, $data);
     $user_absen_id = getValue('user_id', 'users_absen', array('id' => 'where/' . $id));
     $approval_status = 1;
     $this->approval->approve('absen', $id, $approval_status, $this->detail_email($id));
     $isi_email = 'Status pengajuan keterangan tidak absen anda disetujui oleh ' . get_name($user_id) . ' untuk detail silakan <a href=' . base_url() . 'form_absen/detail/' . $id . '>Klik Disini</a><br />';
     $isi_email_request = get_name($user_absen_id) . ' mengajukan keterangan tidak absen absen, untuk melihat detail silakan <a href=' . base_url() . 'form_absen/detail/' . $id . '>Klik Disini</a><br />';
     if (!empty(getEmail($user_absen_id))) {
         $this->send_email(getEmail($user_absen_id), 'Status Pengajuan Keterangan Tidak Absen dari Atasan', $isi_email);
     }
     if ($type !== 'hrd') {
         $lv = substr($type, -1) + 1;
         $lv_app = 'lv' . $lv;
         $user_app = $lv < 4 ? getValue('user_app_' . $lv_app, 'users_absen', array('id' => 'where/' . $id)) : 0;
         if (!empty($user_app)) {
             if (!empty(getEmail($user_app))) {
                 $this->send_email(getEmail($user_app), 'Pengajuan Keterangan Tidak Absen', $isi_email_request);
             }
             $this->approval->request($lv_app, 'absen', $id, $user_absen_id, $this->detail_email($id));
         } else {
             if (!empty(getEmail($this->approval->approver('absen')))) {
                 $this->send_email(getEmail($this->approval->approver('absen')), 'Pengajuan Keterangan Tidak Absen', $isi_email_request);
             }
             $this->approval->request('hrd', 'absen', $id, $user_absen_id, $this->detail_email($id));
         }
     }
 }
コード例 #19
0
ファイル: app.php プロジェクト: EBSCO-GSS/curriculum_builder
function course_link_id()
{
    $courseid = getConsumerID() . "-" . getCourseLabel() . "-" . getLTIlinkID() . "-" . getEmail();
    return $courseid;
}
コード例 #20
0
ファイル: auth.php プロジェクト: AgoraUS1516/G03
/**
 * \brief Email único.
 * \details Comprobar si la dirección de email dado ya existe en la base de datos.
 * \param $email Dirección de email.
 * \return Boolean
 */
function uniqueEmail($email)
{
    $result = True;
    $email = getEmail($email);
    if (!empty($email)) {
        $result = False;
    }
    return $result;
}
コード例 #21
0
ファイル: forgot.php プロジェクト: ultramookie/mindof
<?php

include_once "header.php";
include_once "db.php";
include_once "mindoflib.php";
if (!stripslashes($_POST['checksubmit'])) {
    showForgotform();
} else {
    if (stripslashes($_POST['checksubmit'])) {
        $email = getEmail();
        $user = getUser();
        $postemail = stripslashes($_POST['email']);
        $postuser = stripslashes($_POST['user']);
        if (strcmp($email, $postemail) == 0 && strcmp($user, $postuser) == 0) {
            sendRandomPass($email, "lost");
        } else {
            echo "things didn't match.  <a href=\"forgot.php\">try again</a>!";
        }
    }
}
?>

<?php 
include_once "footer.php";
?>

コード例 #22
0
ファイル: modify.php プロジェクト: pauljenny/NoCMS
<?php

/****************************************************************************/
/*             NoCMS est un projet de site web pour l'�mulateur Mangos      */
/*            	Bas� sur le kit graphique de Frozen Blade Enhanced          */
/*           				Cod� par Polo                                   */
/****************************************************************************/
if (!isset($_SESSION['connect'])) {
    include './modules/error.php';
} else {
    include './modules/compte/fonctions/modify.php';
    $email_actuel = getEmail();
    if (isset($_POST['bouton'])) {
        traiter();
    }
    include './modules/compte/html/modify.php';
}
コード例 #23
0
									<p><b>Paso 1. Completa tus datos personales</b></p>
								</td>
							</tr>
					
							<tr>
								<td  width='152px' valign='middle'>
									<p>Correo Electronico:</p>			
								</td>
								<td colspan='3' valign='middle'>
									<input id='email' name='email' size='42' type='text' class='campo'
                                       <?php 
if (request . getAttribute("error") != null) {
    out . println("value='" + request . getParameter("email") + "'");
} else {
    if (ul != null) {
        out . println("value='" + ul . getEmail() + "'");
    }
}
?>
 />
								</td>
							</tr>	
			
							<tr>
								<td  width='152px' valign='middle'>
									<p>Nombre:</p>
								</td>
								<td width='168px' valign='middle'>
									<input id='nombre' name='nombre' type='text' class='campo'
                                       <?php 
if (request . getAttribute("error") != null) {
コード例 #24
0
        $token = empty($_GET['token']) ? "" : $_GET['token'];
    }
    if (!tok_val($token)) {
        header("Location:login.php?error=2");
        exit;
    }
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM {$table_global_config}");
count($row_config_globale) > 0 ? $r = 'SUCCESS' : ($r = '');
if ($r != 'SUCCESS') {
    include "include/lang/english.php";
    echo "<div class='error'>" . translate($r) . "<br>";
    echo "</div>";
    exit;
}
if (empty($row_config_globale['language'])) {
    $row_config_globale['language'] = "english";
} else {
    include "include/lang/" . $row_config_globale['language'] . ".php";
}
$q = !empty($_POST['search']) ? $_POST['search'] : '';
if (!empty($q)) {
    $tabMails = getEmail($cnx, $q, $row_config_globale['table_email']);
    if (sizeof($tabMails)) {
        foreach ($tabMails as $row) {
            $q_strong = '<strong>' . $q . '</strong>';
            $show_mail = str_ireplace($q, $q_strong, $row['email']);
            echo "<div align='left' class='show'>" . $show_mail . "</div>";
        }
    }
}
コード例 #25
0
										<div class="amount"><div class="amount-number cart-price">$70.80</div> <span>Sous-total</span></div>
									</div>
									<div class="cart-row">
										<div class="amount-operator">+</div>
										<div class="amount"><div class="amount-number cart-tax">$9.20</div> <span>Taxe</span></div>
									</div>
									<div class="cart-row">
										<div class="amount-operator"></div>
										<div class="amount total"><div class="amount-number cart-total-amount">$80.00</div> <span>Total</span></div>
									</div>

									<input type="hidden" name="total_amount" id="total_amount" value="7080" />
									<input type="hidden" name="tax_percent" id="tax_percent" value="0.13" />
									<input type="hidden" name="total_tax" id="total_tax" value="920" />
									<input type="hidden" name="user_email" id="user_email" value="<?php 
echo getEmail();
?>
" />

								</div>
								<p class="payment-error">Nous sommes désolés, mais la carte inscrite est invalide.</p>
								<a class="prev-screen" href="#">Retour</a>
								<button tabindex="11" type="submit" class="pay-now" >Payer maintenant</button>
								<p class="payment-fail-instruction">Si vous éprouvez de la difficulté à payer, retournez à <a href="/fr/mon-compte?status=payment-incomplete">Mon compte</a>. Cette inscription pourra être consultée en tant qu’inscription de base; elle pourra être reclassée comme inscription complète à un moment ultérieur.</p>
								<img class="cc-img" alt="accepted credit cards" src="<?php 
echo get_template_directory_uri();
?>
/imgs/credit-cards.jpg">
								<img class="ssl-img" alt="accepted credit cards" src="<?php 
echo get_template_directory_uri();
?>
コード例 #26
-1
ファイル: login.php プロジェクト: achmun/mybackend
 public function google()
 {
     $this->load->model('user_model');
     $data = array();
     require_once APPPATH . 'libraries/google-api-php-client/src/Google/autoload.php';
     //$this->load->model('users_model');
     /************************************************
     		  ATTENTION: Fill in these values! Make sure
     		  the redirect URI is to this page, e.g:
     		  http://localhost:8080/user-example.php
     		 ************************************************/
     $client_id = '1063903629062-1q9qletmv9v0m7nedfjtq2nu1aabv3mk.apps.googleusercontent.com';
     $client_secret = '_beoTqZJ9LuVxN5SmUT39y-c';
     $redirect_uri = base_url('login/google');
     /************************************************
     		  Make an API request on behalf of a user. In
     		  this case we need to have a valid OAuth 2.0
     		  token for the user, so we need to send them
     		  through a login flow. To do this we need some
     		  information from our API console project.
     		 ************************************************/
     $client = new Google_Client();
     $client->setClientId($client_id);
     $client->setClientSecret($client_secret);
     $client->setRedirectUri($redirect_uri);
     $client->setScopes('email');
     $client->addScope(Google_Service_Analytics::ANALYTICS_READONLY);
     // Handle authorization flow from the server.
     if (!isset($_GET['code'])) {
         $auth_url = $client->createAuthUrl();
         //header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
         redirect(filter_var($auth_url, FILTER_SANITIZE_URL));
     } else {
         $client->authenticate($_GET['code']);
         $getAccessToken = $client->getAccessToken();
         $tokenData = $client->verifyIdToken()->getAttributes();
         //$this->session->set_userdata('access_token', $getAccessToken);
         $email = getEmail($tokenData);
         if ($email != '') {
             $getUserProfile = $this->user_model->get_single_data(array('email' => $email));
             if ($getUserProfile['uid'] != '') {
                 $status = $getUserProfile['status'];
                 $level = get_level_name($getUserProfile['level']);
                 $idlevel = $getUserProfile['level'];
                 $name = $getUserProfile['name'];
                 $uid = $getUserProfile['uid'];
                 $sessions = array('uid' => $uid, 'email' => $email, 'name' => $name, 'level' => $level, 'idlevel' => $idlevel, 'access_token' => $getAccessToken);
                 // account diblokir/banned
                 if ($status == '0') {
                     $data['message'] = '!! Account anda diblokir. Untuk informasi lebih lanjut, silahkan hubungi Administrator !!';
                     // account aktif
                 } elseif ($status == '1') {
                     $this->session->sess_expiration = '3600';
                     $this->session->set_userdata($sessions);
                     redirect('');
                 }
             } else {
                 $data['message'] = 'Anda tidak terdaftar sebagai admin aplikasi ini. Silahkan hubungi Administrator untuk mendapatkan akses.';
             }
         } else {
             $data['message'] = 'Your Email account is not valid.';
         }
         //$_SESSION['access_token'] = $getAccessToken;
         //$access_token = json_decode($getAccessToken);
         //$_SESSION['new_access_token'] = $access_token['access_token'];
         //$redirect_uri = base_url('');
         //header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
         //redirect(filter_var($redirect_uri, FILTER_SANITIZE_URL));
     }
     $content['CONTENT'] = $this->parser->parse($this->path_view . '/login', $data, true);
     $this->parser->parse($this->settings['default_layout'], $content);
 }
コード例 #27
-1
<?php

// vim:set ts=4 sw=4 sts=4 et:
require_once "config.php";
require_once "html.php";
require_once "db-func.php";
require_once "utils.php";
// Redirect to the login page, if not logged in
$uid = isLoggedIn();
// Start HTML
head("mailinglists");
$email = getEmail($uid);
$moira_entity = getMoiraEntity($email);
$first_time = true;
$krb5ccname = "";
foreach ($mailing_lists as $list => $description) {
    if (isset($_POST[$list . "-type"])) {
        $list_type = $_POST[$list . "-type"];
        $old_value = $_POST[$list . "-original"];
        if (isset($_POST[$list])) {
            $new_value = $_POST[$list];
        } else {
            $new_value = "";
        }
        if ($old_value != $new_value) {
            if ($first_time) {
                print "<h2>Subscription results</h2>\n";
                $first_time = false;
            }
            if ($list_type == "moira") {
                if (!$krb5ccname) {
コード例 #28
-1
ファイル: funcs.php プロジェクト: CCardosoDev/Safeguard
function getJSON()
{
    parse_str($_SERVER['QUERY_STRING']);
    if (is_null($token)) {
        return 'token not set';
    }
    $fileContent = file_get_contents("https://*****:*****@" . authLink() . "/getData?token=" . $token);
    if ($fileContent == '') {
        header("Location: https://" . redirectAuthLink() . "/login?redirecturl=http://" . redirectLink() . "/SafeFront/index.php");
        /* Redirect browser */
        exit;
    }
    $json = json_decode($fileContent, true);
    if (!isset($_SESSION['id'])) {
        $_SESSION['id'] = getID($json);
        $_SESSION['name'] = getName($json);
        $_SESSION['picture'] = getImage($json);
        $_SESSION['mail'] = getEmail($json);
        $_SESSION['token'] = $token;
        $_SESSION['mobileImagesRequest'];
        $_SESSION['hasNewImages'] = 0;
        $_SESSION['gotOne'] = 0;
        $_SESSION['pokeReady'] = 0;
        $_SESSION['poke'];
        //$tokenToUse = getServerAccess();
        insertUser($token);
    }
    return null;
}
コード例 #29
-1
ファイル: dertyn.php プロジェクト: ultramookie/dertyn
function changePass($user, $pass)
{
    $email = getEmail();
    $salt = substr("{$user}", 0, 2);
    $epass = crypt($pass, $salt);
    $params = array('user' => $user, 'epass' => $epass);
    $result = query("user.changePass", $params);
    echo " <img src=\"icon_accept.gif\" border=\"0\" /> password has been updated!";
}
コード例 #30
-1
 protected function validarNuevo()
 {
     //validar que no exista un usuario con el mismo nombre de usuario o email
     // 			Usuario
     $u1 = Usuario::GetOne(this . getEmail());
     if (isset($u1)) {
         throw new \Exception("Nombre de Usuario ya registrado");
     }
 }