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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

繁華開滿天機 2021-10-21 10:39:56
控制器:測試/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>在這段代碼中,我有一個函數(shù),即send_mail_account當我的腳本運行時我想要的位置,然后它將我重定向到控制器函數(shù)上。在這里,5 second腳本運行后會發(fā)生什么,當我使用它alert()代替window.location.replace()它時會發(fā)生什么,但是當我運行時window.location.replace()它不起作用。我不知道為什么我做錯了什么?請幫我。
查看完整描述

2 回答

?
陪伴而非守候

TA貢獻1757條經(jīng)驗 獲得超8個贊

您應(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>


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

TA貢獻1812條經(jīng)驗 獲得超5個贊

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


<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 選項卡


crontab -e

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


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



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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

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