本文整理汇总了PHP中MY_Controller::index方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Controller::index方法的具体用法?PHP MY_Controller::index怎么用?PHP MY_Controller::index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Controller
的用法示例。
在下文中一共展示了MY_Controller::index方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: booked
public function booked($id)
{
$error = false;
$duration = $this->input->post('duration');
$date = $this->input->post('date');
$this->form_validation->set_rules('date', $this->lang->line('Date'), 'xss_clean|required');
$this->form_validation->set_rules('duration', $this->lang->line('Duration (in hours)'), 'required|xss_clean|is_natural_no_zero');
if (!$this->form_validation->run()) {
$error = true;
}
if (!$error && !$this->RoomModel->check($this->session->groupe_id, $id, $date, $duration)) {
$error = true;
$this->error_date_duration = $this->lang->line('This room is already booked on the period you selected');
}
if ($error) {
$this->book($id);
} else {
if ($this->RoomModel->book($this->session->id, $id, $date, $duration)) {
$data['book_success_label'] = $this->lang->line('Your booking has been successfully registered');
$data['now_wait_label'] = $this->lang->line('Now you have to wait for an ATM member to validate your booking');
$data['you_can_label'] = $this->lang->line('You can go to your');
$data['main_page_label'] = $this->lang->line('main page');
parent::index();
$this->load->view('book_success', $data);
$this->load->view('footer');
} else {
echo 'Database error';
}
}
}
示例2: find
function find()
{
$this->form_validation->set_rules('keyword', 'Kata Pencarian', 'required');
if ($this->form_validation->run()) {
$keyword = $this->input->post('keyword');
$criteria = array('NO_ANGGOTA' => $keyword);
parent::find($criteria);
} else {
parent::index();
}
}
示例3: index
public function index()
{
parent::index();
$user = $this->loggedInUser();
$navdata['active'] = 'welcome';
$navdata['user'] = $user;
$viewdata['user'] = $user;
$this->load->view('common/header');
$this->load->view('common/navigation', $navdata);
$this->load->view('welcome', $viewdata);
$this->load->view('common/footer');
}
示例4: index
public function index()
{
$this->title = $this->lang->line('Home - ATM');
parent::index();
$data['band_label'] = $this->lang->line('Band');
$data['room_label'] = $this->lang->line('Room');
$data['date_label'] = $this->lang->line('Date');
$data['city_label'] = $this->lang->line('City');
$data['accept_label'] = $this->lang->line('Accept');
$data['refuse_label'] = $this->lang->line('Refuse');
$data['justif_label'] = $this->lang->line('Justification for the refusal');
$data['form_target'] = base_url() . 'Atm_home/refuse';
$data['msg'] = $this->lang->line($this->session->msg);
// var_dump($data['msg'] );
$data['res'] = $this->BookModel->get_reservations();
$this->load->view('home', $data);
$this->load->view('footer');
$this->session->unset_userdata('msg');
}
示例5: index
public function index()
{
$this->title = $this->lang->line('Room Search');
parent::index();
$data['roomName_label'] = $this->lang->line('Room name');
$data['date_label'] = $this->lang->line('Date');
$data['capacity_label'] = $this->lang->line('Minimal capacity');
$data['accessibility_label'] = $this->lang->line('Accessibility to disabled');
$data['options_label'] = $this->lang->line('Options');
$data['timeSlots_label'] = $this->lang->line('Time slots');
$data['to_label'] = $this->lang->line('To');
$data['address_label'] = $this->lang->line('Address');
$data['all_fields_forced_label'] = $this->lang->line('All fields are compulsory');
$data['submit_label'] = $this->lang->line('Search');
$data['duration_label'] = $this->lang->line('Duration (in hours)');
$data['lang'] = $this->lang->line('en');
$data['title'] = $this->lang->line('Room Search');
$data['form_target'] = base_url() . 'RoomSearch/results';
$this->load->view('roomsearch', $data);
if (isset($res)) {
$data['res'] = $res;
}
$this->load->view('footer', $data);
}
示例6: addbooking
public function addbooking($id)
{
parent::index();
$this->load->model('Journey_Model');
$this->load->model('Booking_Model');
$user = $this->loggedInUser();
$navdata['active'] = 'journey';
$navdata['user'] = $user;
$viewdata = null;
$this->load->view('common/header');
$this->load->view('common/navigation', $navdata);
$this->load->view('booking/addbooking', $viewdata);
$this->load->view('common/footer');
}
示例7: index
public function index()
{
$this->title = $this->lang->line('Home - Band');
parent::index();
$this->load->view('footer');
}
示例8: edit
public function edit($id)
{
parent::index();
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->model('Customer_Model');
$this->load->model('Person_Model');
//$this->form_validation->set_rules('txt_name', $this->lang->line('customer_name'), 'trim|required');
$customer = $this->Customer_Model->read($id);
if ($this->input->post('btn_save') == 'Save') {
$customer->setFirstname($this->input->post('txt_firstname'));
echo 'update -> ' . $customer->getFirstname();
$customer = $customer->update();
}
$user = $this->loggedInUser();
$navdata['user'] = $user;
$navdata['active'] = 'customer';
$viewdata['customer'] = $customer;
$this->load->view('common/header');
$this->load->view('common/navigation', $navdata);
$this->load->view('customer/customer_edit', $viewdata);
$this->load->view('common/footer');
}
示例9:
function find_collection_by_term()
{
$this->form_validation->set_rules('keyword', 'Kata Pencarian', 'required');
if ($this->form_validation->run()) {
$keyword = $this->input->post('keyword');
$criteria = "JUDUL_PUSTAKA LIKE'%{$keyword}%' ";
parent::find($criteria);
} else {
parent::index();
}
}
示例10: index
public function index()
{
parent::index();
}
示例11: find
function find()
{
$this->form_validation->set_rules("no_anggota", "No Anggota", "required");
if ($this->form_validation->run()) {
$no_anggota = $this->input->post("no_anggota");
$user = $this->anggota_model->get_byid($no_anggota);
if ($user->num_rows() > 0) {
$this->data['anggota'] = $user->row();
$pinjaman = $this->pinjaman_model->get_pinjaman($no_anggota);
if (!empty($pinjaman)) {
$this->data["pinjaman"] = $pinjaman;
$this->data["data_pinjaman"] = $this->pinjaman_model->get_detail_pinjaman($pinjaman->ID);
}
}
$this->data['main'] = "pinjaman/index";
$this->load->view($this->template, $this->data);
} else {
parent::index();
}
}