爆炸的csv数据发送它们进行数据检索

时间:2016-01-05 07:44:20

标签: php continuous-integration

我想要分解存储在 multiId 中的员工ID列表,并使用它们从数据库中检索数据。然后将电子邮件发送到相应的电子邮件地址。请帮帮我。

        <?php
function sendmailto($id){
    $this->load->library('email');
    $result = $this->demand_model->get('demand_master', 
        'DEMAND_ID ,COUNTRY, NAME, LOT_NO,BLOCK_VISA_NO, BLOCK_VISA_ISSUE_DATE, PRE_AUTH_DATE, CREATED_DATE', 
        'DEMAND_ID = '.$id, NULL, NULL, true);
    $demand = $this->demand_model->getVacancyForList($id);

    /** 
      $val['id']=json_encode($_POST('multiId'));
      var_dump($val['id']);
      exit();
      */
    $eid = $this->input->post('multiId');

    $mailid = explode(",", $eid);
    //print_r($mailid);
    foreach ($mailid as $eid) {
        var_dump($eid);
        $emaillist['ids'] = $this->demand_model->getEmailbyId($eid);
        var_dump($emaillist['ids']);
    }
    $this->email->message('<html><body>
        <div class="col-md-12 wrapper"><b>Company Name:'
           .$this->demand_model->getCompanyName($result->NAME)
           .'-'.$this->demand_model->getCountryById($result->COUNTRY)
           .'</b></div>
        <div class="col-md-12">
            <div class="col-md-6">Pre Auth Date:'. $result->PRE_AUTH_DATE.'</div>
            <div class="col-md-6">Lot No:'.$result->LOT_NO.'</div>
        </div>
        </body>
    </html>');
    $this->email->subject('This is test email');
    $this->email->to('san_bro18@outlook.com');
    $this->email->send();
    echo $this->email->print_debugger();    
}

0 个答案:

没有答案