public function add_new_specialty() { $this->use->use_model('data_base'); $this->use->use_lib('table/tpl_specialty'); $tpl = new tpl_specialty(); $db = new data_base($tpl->table(), array($tpl->id_college() => $_POST['name_college'], $tpl->name() => $_POST['name_Specialty'])); echo json_encode(array('valid' => $db->add(), 'massage' => '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button><h4>Alert!</h4> <strong>Save success </strong></div>')); }
public function add_new_students() { $this->use->use_model('data_base'); $this->use->use_lib('table/tpl_students'); $tpl = new tpl_students(); $db = new data_base($tpl->table(), array($tpl->id_students() => $_POST['id_student_n'], $tpl->first_name() => $_POST['first_name_n'], $tpl->last_name() => $_POST['last_name_n'], $tpl->id_college() => $_POST['name_college_n'], $tpl->id_specialty() => $_POST['name_specialty_n'], $tpl->password() => md5($_POST['password_n']), $tpl->elect() => 0, $tpl->image() => 0)); echo json_encode(array('valid' => $db->add(), 'massage' => '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button><h4>Alert!</h4> <strong>Save success </strong></div>')); }
public function add_new_slider() { $this->use->use_model('data_base'); $this->use->use_lib('table/tpl_slider'); $tpl = new tpl_slider(); $db = new data_base($tpl->table(), array($tpl->text() => $_POST['text_n'], $tpl->status() => 0, $tpl->image() => 0)); echo json_encode(array('valid' => $db->add(), 'massage' => '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button><h4>Alert!</h4> <strong>Save success </strong></div>')); }
public function insert() { $name = $_POST[tpl_category::category() . '_' . tpl_category::name()]; $db = new data_base(tpl_category::category(), array(tpl_category::active() => 1, tpl_category::name() => $name, tpl_category::date() => date_time::Date_time_24())); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $name . ', please try again')); } }
public function insert() { $name = $_POST[tpl_specialty::specialty() . '_' . tpl_specialty::name()]; $id_college = $_POST[tpl_specialty::specialty() . '_' . tpl_specialty::id_college()]; $db = new data_base(tpl_specialty::specialty(), array(tpl_specialty::active() => 0, tpl_specialty::name() => $name, tpl_specialty::id_college() => $id_college)); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $name . ', please try again')); } }
public function insert() { $id_degree = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id_degree()]; $id_models = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id_models()]; $id_student = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id_student()]; $id_onus = $_POST[tpl_onus_designate::onus_designate() . '_' . tpl_onus_designate::id_onus()]; $db = new data_base(tpl_onus_designate::onus_designate(), array(tpl_onus_designate::status() => 0, tpl_onus_designate::id_degree() => $id_degree, tpl_onus_designate::id_student() => $id_student, tpl_onus_designate::id_models() => $id_models, tpl_onus_designate::id_onus() => $id_onus, tpl_onus_designate::date_in() => date_time::Date_time_24())); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $id_degree)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $id_degree . ', please try again')); } }
public function insert() { $id_student = $_POST[tpl_models::models() . '_' . tpl_models::id_student()]; $id_companies = $_POST[tpl_models::models() . '_' . tpl_models::id_companies()]; $id_department = $_POST[tpl_models::models() . '_' . tpl_models::id_department()]; $id_section = $_POST[tpl_models::models() . '_' . tpl_models::id_section()]; $id_supervisor = $_POST[tpl_models::models() . '_' . tpl_models::id_supervisor()]; $db = new data_base(tpl_models::models(), array(tpl_models::active() => 0, tpl_models::id_student() => $id_student, tpl_models::id_companies() => $id_companies, tpl_models::id_department() => $id_department, tpl_models::id_section() => $id_section, tpl_models::id_supervisor() => $id_supervisor, tpl_models::date_in() => date_time::Date_time_24())); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $id_student)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $id_student . ', please try again')); } }
public function insert() { $name = $_POST[tpl_trainer::trainer() . '_' . tpl_trainer::name()]; $username = $_POST[tpl_trainer::trainer() . '_' . tpl_trainer::username()]; $id_companies = $_POST[tpl_trainer::trainer() . '_' . tpl_trainer::id_companies()]; $id_department = $_POST[tpl_trainer::trainer() . '_' . tpl_trainer::id_department()]; $id_section = $_POST[tpl_trainer::trainer() . '_' . tpl_trainer::id_section()]; $db = new data_base(tpl_trainer::trainer(), array(tpl_trainer::status() => 0, tpl_trainer::name() => $name, tpl_trainer::username() => $username, tpl_trainer::id_companies() => $id_companies, tpl_trainer::id_department() => $id_department, tpl_trainer::id_section() => $id_section, tpl_trainer::date_in() => date_time::Date_time_24())); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $name . ', please try again')); } }
public function insert() { $name = $_POST[tpl_companies::companies() . '_' . tpl_companies::name()]; $id_category = $_POST[tpl_companies::companies() . '_' . tpl_companies::id_category()]; $description = $_POST[tpl_companies::companies() . '_' . tpl_companies::description()]; $mobile = $_POST[tpl_companies::companies() . '_' . tpl_companies::mobile()]; $phone = $_POST[tpl_companies::companies() . '_' . tpl_companies::phone()]; $address = $_POST[tpl_companies::companies() . '_' . tpl_companies::address()]; $db = new data_base(tpl_companies::companies(), array(tpl_companies::active() => 0, tpl_companies::name() => $name, tpl_companies::id_category() => $id_category, tpl_companies::description() => $description, tpl_companies::mobile() => $mobile, tpl_companies::phone() => $phone, tpl_companies::address() => $address)); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $name . ', please try again')); } }
public function insert() { $first_name = $_POST[tpl_students::students() . '_' . tpl_students::first_name()]; $last_name = $_POST[tpl_students::students() . '_' . tpl_students::last_name()]; $id_specialty = $_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]; $id_college = $_POST[tpl_students::students() . '_' . tpl_students::id_college()]; $id_supervisor = $_POST[tpl_students::students() . '_' . tpl_students::id_supervisor()]; $id_university = $_POST[tpl_students::students() . '_' . tpl_students::id_university()]; $password = $_POST[tpl_students::students() . '_' . tpl_students::password()]; $db = new data_base(tpl_students::students(), array(tpl_students::first_name() => $first_name, tpl_students::last_name() => $last_name, tpl_students::id_specialty() => $id_specialty, tpl_students::id_college() => $id_college, tpl_students::id_supervisor() => $id_supervisor, tpl_students::id_university() => $id_university, tpl_students::password() => md5($password))); $results = $db->add(); if ($results) { echo json_encode(array('valid' => 1, 'title' => 'Successfully !!', 'massage' => 'I\'ve been Add ' . $first_name)); } else { echo json_encode(array('valid' => 0, 'title' => 'Oops !!', 'massage' => 'Was not add ' . $first_name . ', please try again')); } }
public function new_elect() { if (isset($_POST['id_ele'])) { if (!empty($_POST['id_ele'])) { $this->use->use_model('data_base'); $this->use->use_lib('site/sessions'); $this->use->use_lib('table/tpl_election'); $tpl = new tpl_election(); $session = new sessions(); $id_login = $session->get_info_user(); $db = new data_base($tpl->table(), array($tpl->id_elect() => $_POST['id_ele'], $tpl->id_students() => $id_login[0]['id'], $tpl->date() => date('Y-m-d H:i:s'))); $db->add(); return true; } else { return false; } } else { return false; //isset } }
public function new_students() { if (isset($_POST[tpl_students::students() . '_' . tpl_students::first_name()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::last_name()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::password()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_university()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_college()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]) && isset($_POST[tpl_category::category() . '_' . tpl_category::id()]) && isset($_POST[tpl_companies::companies() . '_' . tpl_companies::id()]) && isset($_POST[tpl_department::department() . '_' . tpl_department::id()]) && isset($_POST[tpl_section::section() . '_' . tpl_section::id()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::username()]) && isset($_POST[tpl_students::students() . '_' . tpl_students::email()])) { if (!empty($_POST[tpl_students::students() . '_' . tpl_students::first_name()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::last_name()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::password()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_university()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_college()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::id_specialty()]) && !empty($_POST[tpl_category::category() . '_' . tpl_category::id()]) && !empty($_POST[tpl_companies::companies() . '_' . tpl_companies::id()]) && !empty($_POST[tpl_department::department() . '_' . tpl_department::id()]) && !empty($_POST[tpl_section::section() . '_' . tpl_section::id()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::username()]) && !empty($_POST[tpl_students::students() . '_' . tpl_students::email()])) { if ($_POST[tpl_students::students() . '_' . tpl_students::password()] == $_POST[tpl_students::students() . '_' . tpl_students::password() . '_re']) { $db = new data_base(tpl_students::students(), array(tpl_students::first_name() => $_POST[tpl_students::students() . '_' . tpl_students::first_name()], tpl_students::last_name() => $_POST[tpl_students::students() . '_' . tpl_students::last_name()], tpl_students::password() => $this->hash_password($_POST[tpl_students::students() . '_' . tpl_students::password()]), tpl_students::id_university() => $_POST[tpl_students::students() . '_' . tpl_students::id_university()], tpl_students::id_college() => $_POST[tpl_students::students() . '_' . tpl_students::id_college()], tpl_students::id_specialty() => $_POST[tpl_students::students() . '_' . tpl_students::id_specialty()], tpl_students::id_supervisor() => $_POST[tpl_students::students() . '_' . tpl_students::id_supervisor()], tpl_students::username() => $_POST[tpl_students::students() . '_' . tpl_students::username()], tpl_students::email() => $_POST[tpl_students::students() . '_' . tpl_students::email()])); $id_student = $db->add(); $db = new data_base(tpl_models::models(), array(tpl_models::id_student() => $id_student, tpl_models::id_companies() => $_POST[tpl_companies::companies() . '_' . tpl_companies::id()], tpl_models::id_department() => $_POST[tpl_department::department() . '_' . tpl_department::id()], tpl_models::id_section() => $_POST[tpl_section::section() . '_' . tpl_section::id()], tpl_models::id_supervisor() => $_POST[tpl_students::students() . '_' . tpl_students::id_specialty()])); $session = new session_students(); $session->new_login_students(); $session->set_id_user($id_student); echo json_encode(array('valid' => true, 'title' => 'yes !!', 'massage' => $db->add())); } else { echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'password not combated')); } } else { echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'Was not username & password, please try again')); } } else { echo json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'Was not username & password, please try again')); } }