javascript — электронная почта без дублирования и полного имени с middlename (CodeIgniter)

я пытаюсь сделать систему зачисления в школу, и мне нужна помощь
не дублировать электронные письма и полное имя с middlename, но если имя и фамилия совпадают, добавление будет разрешено, но с middlename добавление студента не будет продолжено. все тот же процесс, когда я обновляю студента

function student($param1 = '', $param2 = '', $param3 = '')
{
if ($this->session->userdata('admin_login') != 1)
redirect('login', 'refresh');
if ($param1 == 'create') {
$data['name']        = $this->input->post('name');
$data['mname']       = $this->input->post('mname');
$data['lastname']    = $this->input->post('lastname');
$data['birthday']    = $this->input->post('birthday');
$data['sex']         = $this->input->post('sex');
$data['address']     = $this->input->post('address');
$data['phone']       = $this->input->post('phone');
$data['email']       = $this->input->post('email');
$data['password']    = md5($this->input->post('password'));
$data['father_name'] = $this->input->post('father_name');
$data['mother_name'] = $this->input->post('mother_name');
$data['class_id']    = $this->input->post('class_id');
$data['roll']        = $this->input->post('roll');
$this->db->insert('student', $data);
$student_id = mysql_insert_id();
move_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/student_image/' . $student_id . '.jpg');
$this->email_model->account_opening_email('student', $data['email']); //SEND EMAIL ACCOUNT OPENING EMAIL
$this->session->set_flashdata('flash_message', get_phrase('add_student_success'));
redirect(base_url() . 'index.php?admin/student/' . $data['class_id'], 'refresh');
}
if ($param2 == 'do_update') {
$data['name']        = $this->input->post('name');
$data['mname']       = $this->input->post('mname');
$data['lastname']    = $this->input->post('lastname');
$data['birthday']    = $this->input->post('birthday');
$data['sex']         = $this->input->post('sex');
$data['address']     = $this->input->post('address');
$data['phone']       = $this->input->post('phone');
$data['email']       = $this->input->post('email');
$data['password']    = md5($this->input->post('password'));
$data['father_name'] = $this->input->post('father_name');
$data['mother_name'] = $this->input->post('mother_name');
$data['class_id']    = $this->input->post('class_id');
$data['roll']        = $this->input->post('roll');

$this->db->where('student_id', $param3);
$this->db->update('student', $data);
move_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/student_image/' . $param3 . '.jpg');
$this->crud_model->clear_cache();
$this->session->set_flashdata('flash_message', get_phrase('edit_student_success'));
redirect(base_url() . 'index.php?admin/student/' . $param1, 'refresh');
} else if ($param2 == 'edit') {
$page_data['edit_data'] = $this->db->get_where('student', array(
'student_id' => $param3
))->result_array();
} else if ($param2 == 'personal_profile') {
$page_data['personal_profile']   = true;
$page_data['current_student_id'] = $param3;
} else if ($param2 == 'academic_result') {
$page_data['academic_result']    = true;
$page_data['current_student_id'] = $param3;
}

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector