public function add_attendance_approve_information() { $logInUser = loggedUser(); $attendance_data = array(); $sendSMSArray = array(); $student_record = array(); $userDetail = $this->session->userdata('user'); if ($this->input->post('attendance')) { $temp_data = $this->input->post('attendance'); $count = 0; $student_teacher_class_id = array(); foreach ($temp_data as $key => $value) { if ($value == "A" || $value == "L") { $aproveStatus = $this->attendanceModel->checkStudentAttendanceStatus($key, date('Y-m-d')); if ($aproveStatus > 0) { continue; } $attendance_data['is_send'] = 1; $attendance_data['attendance_approve_by'] = $logInUser['user_id']; $attendance_data['attendance_approve_by_type'] = $logInUser['user_type']; $attendance_data['approve_date'] = date('Y-m-d'); $attendance_data['approve_time'] = date('H:i:s'); $this->attendanceModel->updateStudentAttendance($key, date('Y-m-d'), $attendance_data); $student_id = $this->studentModel->get_student_id_by_st_id($key); $filterColumns = array(); $filterColumns['student_id'] = $student_id; $student_record = retrieve_records($filterColumns, $offset = NULL, $limit = NULL, $sort = NULL, "emsstudent"); $data['sender_id'] = $logInUser['user_id']; $data['receiver_id'] = $student_record[0]->student_Id; $msg_student_id = $key; $txt_message = "Your child " . $student_record[0]->first_name . " is absent today. Hope everything is fine."; $content_message = "This is a test transaction sms"; $data['message_content'] = $content_message; $mobile_no = $this->studentModel->get_mobile_no($student_id); $country_code_mobile_no = '91' . $mobile_no; if (strlen($mobile_no) == 10) { $data['mobile_no'] = $mobile_no; $this->send_sms($country_code_mobile_no, $content_message); insert($data, "ems_sent_messages"); } } } } redirect('student/student_attendance/approve_attendance'); }
public function student_edit($student_id = null) { $logInUser = loggedUser(); $studentRecord = array(); $sdata = array(); $pdata = array(); $data = array(); $adata = array(); $csdata = array(); $registerdata = array(); $registerdata['registerInfo'] = ""; if ($this->input->post()) { $sdata['salutation_id'] = $this->input->post('salutation_id'); $sdata['first_name'] = $this->input->post('first_name'); $sdata['middle_name'] = $this->input->post('middle_name'); $sdata['last_name'] = $this->input->post('last_name'); $sdata['gender'] = $this->input->post('gender'); $sdata['dob'] = $this->input->post('dob'); $sdata['updated_by_type'] = $logInUser['user_type']; $sdata['updated_by'] = $logInUser['user_id']; $sdata['updated_date'] = date('Y-m-d H:i:s'); $sdata['student_id'] = $this->input->post('student_id'); /* Too Do write a function in helper for image upload */ //if($_FILES['hd_student_photo_url']['error']) //{ //$sdata['photo_url'] = addslashes($this->input->post('hd_student_photo_url')); //} // else //{ if (isset($_FILES['student_photo_url'])) { $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["student_photo_url"]["name"]); $extension = end($temp); if (in_array($extension, $allowedExts)) { $pic_name = time() . rand(34, 68768) . '_' . $_FILES['student_photo_url']['name']; $temp_gal = $_FILES['student_photo_url']['tmp_name']; $path = './assets/students_images/' . $pic_name; $destination = getcwd() . '/' . $path; move_uploaded_file($temp_gal, $destination); $sdata['photo_url'] = $pic_name; } else { $upload_error = "Invalid File."; } } //} /*End*/ $data['student'] = $sdata; $pdata['father_salutation_id'] = $this->input->post('father_salutation_id'); $pdata['father_first_name'] = $this->input->post('father_first_name'); $pdata['father_middle_name'] = $this->input->post('father_middle_name'); $pdata['father_last_name'] = $this->input->post('father_last_name'); /*if($_FILES['hd_father_photo_url']['error']) { $pdata['father_photo_url'] = addslashes($this->input->post('hd_father_photo_url')); } else {*/ if (isset($_FILES['father_photo_url'])) { $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["father_photo_url"]["name"]); $extension = end($temp); if (in_array($extension, $allowedExts)) { $pic_name = time() . rand(34, 68768) . '_' . $_FILES['father_photo_url']['name']; $temp_gal = $_FILES['father_photo_url']['tmp_name']; $path = './assets/parents_images/' . $pic_name; $destination = getcwd() . '/' . $path; move_uploaded_file($temp_gal, $destination); $pdata['father_photo_url'] = $pic_name; } else { $upload_error = "Invalid File."; } } //} $pdata['mother_salutation_id'] = $this->input->post('mother_salutation_id'); $pdata['mother_first_name'] = $this->input->post('mother_first_name'); $pdata['mother_middle_name'] = $this->input->post('mother_middle_name'); $pdata['mother_last_name'] = $this->input->post('mother_last_name'); $pdata['mail_to'] = $this->input->post('mail_to'); $pdata['parent_mobile'] = $this->input->post('parent_mobile'); /*if($_FILES['hd_mother_photo_url']['error']) { $pdata['mother_photo_url'] = addslashes($this->input->post('hd_mother_photo_url')); } else {*/ if (isset($_FILES['mother_photo_url'])) { // Mother Photo $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["mother_photo_url"]["name"]); $extension = end($temp); if (in_array($extension, $allowedExts)) { $pic_name = time() . rand(34, 68768) . '_' . $_FILES['mother_photo_url']['name']; $temp_gal = $_FILES['mother_photo_url']['tmp_name']; $path = './assets/parents_images/' . $pic_name; $destination = getcwd() . '/' . $path; move_uploaded_file($temp_gal, $destination); $pdata['mother_photo_url'] = $pic_name; } else { $upload_error = "Invalid File."; } } //} $data['parent'] = $pdata; $adata['address1'] = $this->input->post('address1'); $adata['address2'] = $this->input->post('address2'); $adata['address3'] = $this->input->post('address3'); $adata['country_id'] = $this->input->post('country_id'); $adata['state_id'] = $this->input->post('state_id'); $adata['city_id'] = $this->input->post('city_id'); $adata['pincode'] = $this->input->post('pincode'); $data['address'] = $adata; $csdata['class_section_id'] = $this->input->post('class_section_id'); $csdata['session_id'] = $this->input->post('session_id'); $csdata['roll_number'] = 3323; $csdata['house_id'] = 3232; $data['student_teacher_class'] = $csdata; $this->studentModel->updat_emsstudent($data); $registerdata['registerInfo'] = "Student Updated Successfully!"; redirect(base_url() . "index.php/student/student/student_list/" . $csdata['class_section_id'] . '/' . $csdata['session_id']); } else { $data = array(); $studentRecord = $this->studentModel->fetch_single_student($student_id); $data['studentRecord'] = $studentRecord; $data['country'] = retrieve_records($filterColumns = NULL, $offset = NULL, $limit = NULL, $sort = NULL, "ems_country"); $data['session'] = retrieve_records($filterColumns = NULL, $offset = NULL, $limit = NULL, $sort = NULL, "ems_session"); $data['classSecton'] = $this->classSection->getClass_section(); $data['salutation'] = retrieve_records($filterColumns = NULL, $offset = NULL, $limit = NULL, $sort = NULL, "ems_salutation"); $this->template->getScript(); $this->template->getAdminHeader(); $this->template->getAdminLeftBar(); $this->load->view('student/student_registration_edit', $data); $this->template->getFooter(); } }
<?php require_once 'template/header.php'; require_once 'functions/sessionFunctions.php'; ?> <div class="col-lg-3"></div> <div class="col-lg-6"> <h1 align="center">Welcome!</h1> <?php if (loggedUser()) { ?> <p class="text-success" align="center">You are now logged as <?php echo $_SESSION['loggedUser']; ?> </p> <?php } else { ?> <h2 align="center">Login</h1> <hr /> <form action="login.php" method="post" accept-charset="utf-8"> <input type="email" class="form-control" name="userEmail" placeholder="Email" required /><br /> <input type="password" class="form-control" name="userPassword" placeholder="Password" required /><br /> <input type="submit" value="Login" class="btn btn-success btn-group-justified" /> </form> <?php } ?> </div> <div class="col-lg-3"></div>