第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如果條件使用 codeigniter,則 window.location.replace()

如果條件使用 codeigniter,則 window.location.replace()

控制器:測(cè)試/send_mail_account()public function send_mail_account() {    $usertype = $this->session->userdata("usertype");    $loginuserID = $this->session->userdata("loginuserID");    $adminID = $this->session->userdata("adminID");    $email = $this->session->userdata("email");    $username = $this->session->userdata("username");    if($usertype == "Accountant")     {        $totalData = $this->invoice_m->get_order_by_student_by_join_Count($adminID);        $totalFiltered = $totalData;        $data['posts'] = $this->invoice_m->make_datatables($adminID);        $this->load->library('email');        $config=array(        'charset'=>'utf-8',        'wordwrap'=> TRUE,        'mailtype' => 'html'        );        $this->email->initialize($config);        $html = $this->load->view('emailTemplates/feeupdation/feeupdationaccountant', $data , true);        $this->email->set_mailtype("html");        $this->email->from($email, $username);        $this->email->to('xyz@gmail.com');        $this->email->subject("Student Account List");        $this->email->message($html);        $this->email->send();    }     else     {        $this->data["subview"] = "error";        $this->load->view('_layout_main', $this->data);    }}看法:<script>    function checkDate() {        var date = new Date();        console.log(date.getDay());        console.log(date.getHours());        console.log(date.getMinutes());        console.log(date.getSeconds());        if(date.getDay() === 3 && date.getHours() ===13 && date.getMinutes() === 33 && date.getSeconds() === 1) {            window.location.replace("<?php echo base_url(); ?>test/send_mail_account");        }    }    var dateLoop = setInterval(function() {        checkDate();    },5000);</script>在這段代碼中,我有一個(gè)函數(shù),即send_mail_account當(dāng)我的腳本運(yùn)行時(shí)我想要的位置,然后它將我重定向到控制器函數(shù)上。在這里,5 second腳本運(yùn)行后會(huì)發(fā)生什么,當(dāng)我使用它alert()代替window.location.replace()它時(shí)會(huì)發(fā)生什么,但是當(dāng)我運(yùn)行時(shí)window.location.replace()它不起作用。我不知道為什么我做錯(cuò)了什么?請(qǐng)幫我。
查看完整描述

2 回答

?
陪伴而非守候

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超8個(gè)贊

您應(yīng)該嘗試location.replace():


<script>

    function checkDate() {

        var date = new Date();

        console.log(date.getDay());

        console.log(date.getHours());

        console.log(date.getMinutes());

        console.log(date.getSeconds());

        if(date.getDay() === 3 && date.getHours() ===13 && date.getMinutes() === 33 && date.getSeconds() === 1) {

            location.replace("<?php echo base_url(); ?>test/send_mail_account");

        }

    }


    var dateLoop = setInterval(function() {

        checkDate();

    },5000);

</script>


查看完整回答
反對(duì) 回復(fù) 2021-10-21
?
慕雪6442864

TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊

您的“如果”條件出錯(cuò),并且始終無(wú)法滿足所有條件。您可以刪除'date.getSeconds() === 1'或更改'5000'為'1000'(每秒運(yùn)行)。


<script>

    function checkDate() {

        var date = new Date();

        console.log(date.getDay());

        console.log(date.getHours());

        console.log(date.getMinutes());

        console.log(date.getSeconds());

        if(date.getDay() === 3 && date.getHours() ===13 && date.getMinutes() === 33 ) {

            window.location.replace("<?php echo base_url(); ?>test/send_mail_account");

        }

    }


    var dateLoop = setInterval(function() {

        checkDate();

    },5000);

</script>

設(shè)置為 Cron 作業(yè)


使用以下命令編輯 cron 選項(xiàng)卡


crontab -e

添加以下行以在星期三 13:33 運(yùn)行它(對(duì)路徑進(jìn)行必要的更改)


33 13 * * 3 /php.ini-folder-path/php /path/to/codeigniter/root/index.php test send_mail_account



查看完整回答
反對(duì) 回復(fù) 2021-10-21
  • 2 回答
  • 0 關(guān)注
  • 218 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)