HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/school/public_html/school/application/models/unmodel/Event_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Event_model extends CI_Model { 
	
	function __construct()
    {
        parent::__construct();
    }

    function createNoticeboardFunction(){

        $page_data['title'] =   html_escape($this->input->post('title'));
        $page_data['location'] =   html_escape($this->input->post('location'));
        $page_data['timestamp'] =   strtotime($this->input->post('timestamp'));
        $page_data['description'] =   html_escape($this->input->post('description'));

        $this->db->insert('noticeboard', $page_data);
        $sendphone  =   html_escape($this->input->post('sendsms'));

        if($sendphone == 1){
            $parents = $this->db->get('parent')->result_array();
            $teachers = $this->db->get('teacher')->result_array();
            $students = $this->db->get('student')->result_array();
            $senddate= html_escape($this->input->post('timestamp'));

            $message = $page_data['title']. ' ';
            $message .= get_phrase('on'). ' ' . $senddate;

            foreach($parents as $key => $parent){
                $recieverPhoneNumber = $parent['phone'];
                $this->sms_model->send_sms($message, $recieverPhoneNumber);
            }
            foreach($teachers as $key => $teacher){
                $recieverPhoneNumber = $teacher['phone'];
                $this->sms_model->send_sms($message, $recieverPhoneNumber);
            }
            foreach($students as $key => $student){
                $recieverPhoneNumber = $student['phone'];
                $this->sms_model->send_sms($message, $recieverPhoneNumber);
            }


        }
    }

    function updateNoticeboardFunction($param2){

        $page_data['title'] =   html_escape($this->input->post('title'));
        $page_data['location'] =   html_escape($this->input->post('location'));
        $page_data['timestamp'] =   strtotime($this->input->post('timestamp'));
        $page_data['description'] =   html_escape($this->input->post('description'));

        $this->db->where('noticeboard_id', $param2);
        $this->db->update('noticeboard', $page_data);
    }

    function deleteNoticeboardFunction($param2){
        $this->db->where('noticeboard_id', $param2);
        $this->db->delete('noticeboard');

    }
	


	
	
}